Systems study
Offline — showing the cached copy.
Home / Networking / 1. Encapsulation and layers

1. Encapsulation and layers

One-liner. Every layer adds a header, and each device only reads the layers it needs.

Memorize

  • L2 (Ethernet) frame: MAC addresses + EtherType + payload + FCS.
  • L3 (IP) packet: source/dest IP, TTL, protocol, fragmentation fields.
  • L4 (TCP/UDP) segment: ports, sequence/ack, flags, window.
  • L7 (HTTP/DNS/TLS) message: application semantics.
  • Default MTU 1500; IP+TCP headers leave MSS 1460 (1440 with IPv6).
  • Switches forward by MAC; routers by IP; load balancers by port (L4) or content (L7).
  • Each layer's header is overhead: 14 (Ethernet) + 20 (IP) + 20 (TCP) = 54 bytes per 1500.
ENCAPSULATION L7 HTTP request L4 TCP header: por… seq flags L3 IP header: src/… TTL L2 Ethernet: MACs VLAN tag L1 bits on the wire
Encapsulation

Trap. Forgetting the 54 bytes of overhead when sizing throughput — goodput is below line rate. Do this. Compute MSS from MTU, then multiply by packets per second.

Check

With a 1500-byte MTU and IPv4/TCP without options, what is the maximum TCP payload per segment?