Networking Foundations
Start here if packet captures look like noise. Every lesson in this app assumes you already know what a layer is, why a machine has two different addresses, what a subnet mask does, and how a packet reaches a network nobody has ever heard of. This page teaches those directly instead of expecting you to work them out from a trace.
There are no captures on this page at all. When you are done, the protocol map shows how the modules fit together, and TCP Foundations covers what TCP specifically assumes on top of all this.
How much networking do you already have?
This only changes what we recommend and how deeply things are explained by default. Every chapter below stays open whatever you pick, and you can change your mind at any time.
Same ideas, three depths. No packet captures anywhere on this page.
- — What are the layers, and why does anyone care?
- — Why does the same data have five different names?
- — What is the difference between a frame and a packet?
- — What makes something a client and something else a server?
- Layer
- One job in the delivery chain, with a defined interface to the job above and below it. Each layer adds its own header on the way out and strips it on the way in.
- OSI model
- A seven-layer reference model (physical, data link, network, transport, session, presentation, application). Nobody implements it literally, but its layer NUMBERS are everywhere: 'a layer 2 problem' means the link layer, 'layer 3' means IP, 'layer 7' means the application.
- TCP/IP model
- The four-layer model the internet actually runs on: link, internet, transport, application. This is the one that maps onto real code.
- Peer layer
- The matching layer on the other machine. Your TCP talks to their TCP; your Ethernet talks to the next hop's Ethernet. Each pair behaves as if it had a direct line, even though everything travels down and back up the stack.
Where the models line up, and what each layer is called in practice:
OSI TCP/IP Examples Called a… ─────────────── ──────────── ──────────────── ────────── 7 Application Application HTTP, DNS, BGP message 6 Presentation Application TLS record 5 Session Application — — 4 Transport Transport TCP, UDP segment / datagram 3 Network Internet IPv4, ICMP, OSPF packet 2 Data link Link Ethernet, ARP frame 1 Physical Link copper, fibre bits
When someone says 'that is a layer 2 issue', they mean the wire and the switch. 'Layer 3' means addressing and routing. 'Layer 7' means the application spoke nonsense. The numbers are OSI's; the stack is TCP/IP's.
✗ Common misunderstanding: The internet implements the seven-layer OSI model.
Why that's wrong: OSI was a separate, competing protocol suite that lost. Its model survived as vocabulary because the layer numbers turned out to be a useful shorthand.
Correct model: The internet implements the four-layer TCP/IP model. Layers 5 and 6 have no separate implementation — TLS is usually called 'layer 6-ish' by convention, not by design.
The packets prove it: Open any packet in this app. You will find exactly four header groups — Ethernet, IPv4, TCP, and the application data — never seven.
- 1Your browser produces a request — just bytes. This is the message.
- 2TCP prepends its header (ports, sequence number, flags). The result is a segment.
- 3IP prepends its header (source and destination addresses, TTL, protocol number). The result is a packet.
- 4Ethernet prepends its header (source and destination MAC, EtherType) and appends a trailing checksum. The result is a frame.
- 5The frame is turned into electrical or radio signals and sent.
- 6The receiving card reassembles the frame, checks the trailing checksum, reads EtherType 0x0800, and hands the payload to IP.
- 7IP checks its own header checksum, sees protocol 6, and hands the payload to TCP.
- 8TCP checks the ports, finds the connection, and hands the bytes to the application.
- Header
- Bytes a layer adds at the FRONT of what it was given, carrying only what that layer needs to do its job.
- Payload
- Everything after the header — the layer above's unit, which this layer treats as meaningless bytes it must not interpret.
- Trailer
- Bytes added at the END. Rare: Ethernet's frame check sequence is the one you will meet, because a checksum over the whole frame can only be computed once the frame is complete.
- Encapsulate / decapsulate
- Adding your header on the way out; removing it on the way in.
Watch these fields in the lab: eth.type · ipv4.protocol