Solved

Linux, Interrupts

Posted on 2012-03-25
2
450 Views
Last Modified: 2012-03-25
Could someone please give me a quick explanation of what an interrupt is, and how it relates to a networking device ?

Thanks
0
Comment
Question by:Los Angeles1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 21

Expert Comment

by:CompProbSolv
ID: 37763686
First of all, there are hardware and software interrupts.  I'm presuming that you are asking about hardware interrupts.

My information is old, but I suspect that it is still relevant to current architecture.

From the early days of PCs, there were two ways to know when a hardware device wanted the CPUs attention: polling or interrupts.  Polling is similar to how you check to see if there is mail in your (physical) mailbox.  You go take a look out the window and see if there are letters sticking out.  This works really well for some types of information, especially those which are not time-sensitive.

Your telephone is a good example of something that is interrupt-driven.  If it were polled, you'd just answer the phone every once in a while just to see if someone was calling. Obviously, not very practical.  Instead, your phone issues an interrupt (rings) to let you know that you need to deal with it pretty promptly.

Network data is similar.  When a packet arrives on the cable, your computer needs to grab it before it is overrun by the next packet.  While network cards can have their own buffers to store the data, at some point they will be overrun and data will be lost.

When the data arrives, the network card will change the electrical state of the interrupt line (IRQ), which will signal to the Interrupt Controller that something needs to be dealt with.  The CPU will put its current work on hold, and "service the interrupt".  That would typically mean grabbing the data from the network card and putting it in a RAM buffer somewhere.  Once that is done, it may set some flags to note that there is data there and will tell the card that it got the data.  Then it will resume whatever it was doing before.
0
 
LVL 30

Accepted Solution

by:
Kerem ERSOY earned 500 total points
ID: 37763688
Hi,

In a nutshell interrupt is a mechanism for CPU. When a device such as an ethernet adapter receives data it taps the CPU on the shoulder and it says it needs attention. When CPU gets the interrupt it saves whatever it does and goes to service the device.

In network adapter it means that there's an incoming  oan/or outgoing traffic which requires to be transmitted upper / lower levels of communication protocol. Simply when a network adapter receives adata it sends an interrupt to the CPU so that the CPU gets the data and sends it to the related application.

Just think that you have a Web Server and when someone connected the network requests a web page it reaches to the Network adapter. it generates an interrupt so that CPU takes the data to the Web Server through TCP/IP stack. Then CPU process the data through Web Server Code. And then puts the response back to the TCP/IP communication stack so that it is transferred to the Network adapter..

I hope this helps.

Cheers,
K.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question