Networking – Hardware/Software behind IP/TCP layers encapsulation

internetipnetworkingtcp

Every tutorial I read talks about how the layers "communicate" with each other, but never mentions what hardware/software receives, adds on, and sends each layer of control data.

What piece of hardware and software recieves/encapsulates/sends the data pertaining to each layer of IP/TCP?

For example, what layer does my router work on? What software translates a text file into SMTP? What/Where in my computer is the software for flow control/ transportation?

Best Answer

Layer 1 - Physical - Signaling 

Layer 2 - Data Link - Switching (Ethernet frames) 

Layer 3 - Network - Routing (IP packets)

Layer 4 - Transport - Multiplexing (TCP segments)

Layer 5 - Session

Layer 6 - Presentation

Layer 7 - Application

The reason why specific software/hardware implementations are not mentioned is because that is the whole point of developing the standard. Each layer does not care how the layer above and beneath takes care of its function, as long as the data is presented according to the standard. It can be in software, hardware, firmware, by way of a mechanical non-electronic device, or even manually by human beings (google "TCP over carrier pigeon" for a non-serious example).

The specific software and hardware involved vary widely as well in the real world. It is entirely possible to perform all functions in software (cheap but slow). It is also entirely possible to do all of them in hardware (fast but expensive). Dedicated network devices such as Cisco routers, etc. will perform more functions in hardware than say, a PC running Linux configured as a router.

Generally Layer 1 and mostly Layer 2 is guaranteed to be performed in hardware. Layer 3 is mostly done in hardware on an enterprise-level router such as those from Cisco. Many NICs come with a feature called "TCP Offload Engine" that can accelerate most of Layer 3 and 4 via hardware on the NIC. Your consumer-level routers from Wal-mart usualy do the routing function entirely in software. Layer 5, 6, and 7 are usually not done in hardware, and if they are, the devices that do so are termed "accelerators".