How the OSI and TCP/IP models work
medium 40 minA network request is a message wrapped in headers, one per layer, like dolls inside dolls.
Check yourself
One question at a time. Each answer explains why.
Question 1 of 12
Which TCP/IP layer covers OSI's session, presentation and application layers?
What does a switch read to forward a frame?
MTU is 1500 and TCP has no options. What is the MSS?
curl says "Connection refused" instantly. What came back?
What does a router change in a forwarded IPv4 packet when there is no NAT?
Small API calls work through a VPN, large downloads hang. Most likely?
How does traceroute find the routers on a path?
Users see HTTP 502 from the load balancer. Which kind of device produced it?
Why does the home router keep a NAT table?
How many ephemeral ports does Linux use by default?
Which protocol runs on UDP and includes TLS 1.3?
A pure TCP ACK with no data is 54 bytes. What leaves the card on Ethernet?
Pick an answer to see why.
Not quite. RFC 1122's application layer is the top of the suite. TLS and HTTP live there.
Not quite. A switch works at layer 2 and never opens the IP packet.
Not quite. 1500 minus 20 bytes of IPv4 and 20 bytes of TCP. 1448 is with 12 bytes of timestamps.
Not quite. The host answered the SYN with a reset because nothing listens on that port.
Not quite. It lowers the TTL and must fix the checksum. It also builds a new layer 2 header.
Not quite. Packets above the tunnel's MTU are dropped and the ICMP message that would say so is blocked.
Not quite. Each router that lowers the TTL to zero sends back ICMP Time Exceeded from its address.
Not quite. 502 is an HTTP status. Only something that speaks HTTP can send it: a gateway whose backend gave a bad answer.
Not quite. Replies come back to the public address and port. The table maps that port to the device that started the connection.
Not quite. 32768 to 60999 inclusive is 28,232 ports.
Not quite. RFC 9000: QUIC packets are carried in UDP datagrams and QUIC integrates the TLS handshake.
Not quite. The data field must be at least 46 bytes, so 40 bytes of IP and TCP get 6 bytes of padding: 60, plus the 4-byte check.
Flashcards
Say your answer, then reveal it.
Card 1 of 12
OSI's seven layers, bottom up?
Physical, data link, network, transport, session, presentation, application.
Say your answer, then reveal it.
TCP/IP's four layers?
Link, internet, transport, application (RFC 1122).
Say your answer, then reveal it.
PDU at layers 2, 3, 4, 7?
Frame, packet, segment (TCP) or datagram (UDP), message.
Say your answer, then reveal it.
Address at each layer?
MAC (L2), IP (L3), port (L4), name or URL (L7).
Say your answer, then reveal it.
Header sizes?
Ethernet 14 + 4, IPv4 20, IPv6 40, TCP 20, UDP 8.
Say your answer, then reveal it.
MTU 1500. MSS?
1460: 1500 minus 20 IP minus 20 TCP.
Say your answer, then reveal it.
What does ARP do?
Broadcasts "who has this IP?" and caches the MAC that answers. EtherType 0x0806.
Say your answer, then reveal it.
What changes at a router?
New source and destination MAC, TTL minus 1, IP checksum. Not the IP addresses or ports (unless NAT).
Say your answer, then reveal it.
Refused versus timed out?
Refused: RST came back, nothing listens. Timed out: SYNs were dropped.
Say your answer, then reveal it.
What does NAT rewrite?
Source IP and port on the way out, destination on the way back, from a table. Fixes both checksums.
Say your answer, then reveal it.
MTU black hole?
DF packets too big for a link, and the ICMP "fragmentation needed" is blocked. Small works, big hangs.
Say your answer, then reveal it.
Round trips before the first byte of HTTPS?
About three after DNS: TCP, TLS 1.3, HTTP.
Say your answer, then reveal it.
These cards come back in Today, just before you would forget them.