Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
"IP/TCP" ??? These Internet protocols have always been referred to as "TCP/IP", never the other way around. – jlliagre Jan 22 '12 at 9:42
up vote 3 down vote accepted
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".

share|improve this answer
This is ISO, not IP/TCP but this explains everything just as well =)! One last question though. How is a pathway of gateways found for the packet to travel? Is there some sort of server software that is aware of every gateways position, as so it can make the best path to the destination? – Griffin Jan 22 '12 at 2:30
There is no server software but there is a protocol ISPs use to inform each other about gateways to other ISPs/subnets within the IP address space: BGP. – LawrenceC Jan 22 '12 at 4:55
Ok last question, When a server passes a socket connection down to new thread process, does new incoming/outgoing data still have to be dealt with by the main server as so it can be redirected to the correct child process? – Griffin Jan 22 '12 at 6:23
Probably get a better answer reading the Apache documentation (an example of a "forking" server) or on – LawrenceC Jan 22 '12 at 15:09

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

Ethernet hardware is typically only used at the lowest layers, the physical and link layers. Based on its MAC address, the hardware will only accept unicast frames that match. The Ethernet device driver is typically responsible for providing the software interface to this device. The device can typically read and write complete Ethernet frames from and to buffers arranged in a linked (circular) ring, and the driver either services interrupts or polls status for any change in buffer ring status (i.e. read or write frame operation complete).

The software is collectively known as the protocol stack. It is a collection of procedures and functions built into the kernel. They are invoked just like any hierarchy of software. When the user program makes a socket R/W system call, a top-layer application routine is invoked. This subroutine/procedure hierarchy is just like any other well-constructed software that enforces modularity, loose coupling and high cohesion.

Each layer in the protocol is performed by one or more (nested) procedure calls, until the data packet is stored in a frame buffer, ready for output by hardware. On successful write completion, the status is returned to the user's call.

For example, what layer does my router work on?

The Internet is described by the TCP/IP model :

  • Application layer
  • Transport layer
  • Internet layer
  • Link layer
  • Physical layer

Your router directs packets based on IP address, which is the Internet layer. But the router has its own protocol stack to perform other services like its web-based configuration utility. Every host on the network will probably have a complete protocol stack; the layers are not distributed among network hosts/devices.

What software translates a text file into SMTP?

Your mail program interfaces with the Application layer.

What/Where in my computer is the software for flow control/ transportation?

Probably the Transport layer, where TCP operates.

share|improve this answer
"the layers are not distributed among network hosts/devices" doesn't server software / routers apply their own layers? Mac addresses change between every hop for instance. My Windows operating system doesn't apply every layer down to the physical layer does it? – Griffin Jan 22 '12 at 2:18
I worded that poorly. The protocol stack of a host would consist of all protocols and layers that that host must handle. Even though your router "works at layer 3, the Internet layer", that does not mean that there is no Internet layer in any other protocol stack in any hosts. Your Windows PC does have all layers in its protocol stack, and various protocols can be configured as enabled or disabled or added (e.g. DHCP server). And most of your network activity will use all the layers on your PC down to the Physical layer (since you expect it to get out on the wire). – sawdust Jan 23 '12 at 0:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .