Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 467
  • Last Modified:

Linux, Interrupts

Could someone please give me a quick explanation of what an interrupt is, and how it relates to a networking device ?

Thanks
0
Los Angeles1
Asked:
Los Angeles1
1 Solution
 
CompProbSolvCommented:
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
 
Kerem ERSOYPresidentCommented:
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

Technology Partners: 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!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now