How Does the NIC Pass Bits to / from a Process?

chrstrbrts

Senior member
Aug 12, 2014
522
3
81
Hello,

I don't know if this is a hardware question or a network question, but I'll post here.

How does the NIC pass bits to or get bits from a process running in RAM?

Is there a special bus that links the NIC to RAM?

Or, is the connection made through the CPU?

Thanks.
 

imagoon

Diamond Member
Feb 19, 2003
5,199
0
0
It depends on the tech. RAM -> CPU -> NIC, RAM -> DMA -> NIC, Bus Mastering (device) RAM -> NIC. RAM -> RAM IO / Memory Map, Others that I have missed.

Also more steps are added based on the protocols, OS requirements, offloading etc. IE data coming in to a NIC is raw and then sent though the network stack and processed by the NIC hardware / CPU before it pops out at layer 7 or 5 (depending on the model.)
 
Last edited:

chrstrbrts

Senior member
Aug 12, 2014
522
3
81
It depends on the tech. RAM -> CPU -> NIC, RAM -> DMA -> NIC, Bus Mastering (device) RAM -> NIC. RAM -> RAM IO / Memory Map, Others that I have missed.

OK. Which would you say is the most popular for a standard desktop?
 

imagoon

Diamond Member
Feb 19, 2003
5,199
0
0
OK. Which would you say is the most popular for a standard desktop?

Cheap desktop is likely something like this:

NIC -> NIC buffers -> NIC processing for Layer 1 processing and frame work, IRQ to CPU so it will assist with the Layer 2 work. IRQ to CPU to offload (ship the data) to the Layer 3 handler. At this point the "data" is in the network stack RAM. CPU will process Layer 4, 5, 6 based on what applications are hooked in to the TCP/IP stack at that point (port numbers, application IDs, protocol numbers etc). At that point the Layer 7 data will be in RAM, the CPU will then interrupt the process it is bound for. At that point it could send the raw data or send a pointer to a buffer for the application to read.

Outgoing is the reverse.