Solved

Linux, Interrupts

Posted on 2012-03-25
2
426 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
2 Comments
 
LVL 20

Expert Comment

by:CompProbSolv
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

744 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now