Computer networks use layered models to organize how data moves from an application on one host to an application on another. This cheat sheet covers the OSI model, the TCP/IP model, protocol data units, addressing, DNS, web protocols, TCP behavior, and congestion control. College students need these layers because they connect terminology, packet traces, socket programming, routing, and protocol design into one framework.
A clear layer map makes it easier to diagnose where a network problem occurs.
Key Facts
- The OSI layers from top to bottom are Application, Presentation, Session, Transport, Network, Data Link, and Physical.
- The TCP/IP model is commonly summarized as Application, Transport, Internet, and Link, with OSI Application, Presentation, and Session usually grouped into TCP/IP Application.
- Encapsulation means each lower layer wraps data with its own header, so application data becomes a transport segment, then an IP packet, then a link-layer frame.
- IPv4 addresses are 32 bits written in dotted decimal notation, while IPv6 addresses are 128 bits written in hexadecimal groups separated by colons.
- A socket endpoint is identified by IP address + transport protocol + port number, such as 203.0.113.5 + TCP + 443.
- DNS translates names to records, with common records including A for IPv4, AAAA for IPv6, CNAME for aliases, MX for mail servers, and NS for authoritative name servers.
- TCP connection setup uses a three-way handshake: SYN, SYN-ACK, ACK.
- TCP congestion window growth is limited by effective send window = min(congestion window, receiver advertised window).
Vocabulary
- OSI Model
- A seven-layer reference model that describes network communication from physical signaling up to application services.
- TCP/IP Model
- The practical Internet protocol suite model that groups networking functions into application, transport, internet, and link layers.
- Encapsulation
- The process of adding protocol headers, and sometimes trailers, as data moves down the network stack.
- IP Address
- A logical network-layer identifier used to route packets between hosts across interconnected networks.
- Port
- A transport-layer number that identifies a process or service on a host, such as TCP port 80 for HTTP.
- Congestion Window
- A TCP sender-side limit that controls how much unacknowledged data may be in the network based on congestion estimates.
Common Mistakes to Avoid
- Confusing the OSI Network layer with the TCP/IP Internet layer is wrong because both involve IP routing, while the TCP/IP Network Access or Link layer handles local frames.
- Calling TCP packets frames is wrong because TCP creates segments, IP creates packets or datagrams, and the data link layer creates frames.
- Assuming DNS sends web pages is wrong because DNS only resolves names to records, while HTTP or HTTPS transfers web content after the address is known.
- Treating ports as physical connectors is wrong because network ports are software identifiers used by transport protocols to deliver data to applications.
- Assuming TCP always increases speed linearly is wrong because TCP adjusts its congestion window using slow start, congestion avoidance, and loss recovery behavior.
Practice Questions
- 1 Map the OSI layers Application, Transport, Network, Data Link, and Physical to the closest TCP/IP model layers.
- 2 A client connects to 198.51.100.20 using TCP port 443 from local port 51500. Write the full client socket endpoint and server socket endpoint.
- 3 If a TCP sender has congestion window = 24 KB and receiver advertised window = 16 KB, what is the effective send window?
- 4 A browser cannot load example.com, but it can reach 93.184.216.34 directly. Which layer or service is most likely failing, and why?