TCP/IP Fundamentals & the OSI Model

Key Takeaways

  • The OSI model has 7 layers (Physical, Data Link, Network, Transport, Session, Presentation, Application) and is used as a conceptual framework for troubleshooting network issues.
  • TCP is connection-oriented and guarantees delivery through three-way handshakes and acknowledgments; UDP is connectionless and faster but does not guarantee delivery.
  • IPv4 addresses are 32-bit (4 octets, e.g., 192.168.1.1) while IPv6 addresses are 128-bit (8 hexadecimal groups, e.g., 2001:0db8::1).
  • Private IP address ranges (10.x.x.x, 172.16-31.x.x, 192.168.x.x) are not routable on the internet and require NAT to access external resources.
  • APIPA (Automatic Private IP Addressing) assigns a 169.254.x.x address when a device cannot reach a DHCP server — this indicates a network configuration problem.
Last updated: March 2026

TCP/IP Fundamentals & the OSI Model

The OSI Model

The OSI (Open Systems Interconnection) model is a seven-layer conceptual framework that standardizes how network communication occurs. While real networks use the TCP/IP model (4 layers), the OSI model is essential for troubleshooting because it helps isolate which layer a problem exists at.

LayerNameFunctionProtocols/DevicesData Unit
7ApplicationUser-facing network servicesHTTP, FTP, SMTP, DNS, DHCPData
6PresentationData formatting, encryption, compressionSSL/TLS, JPEG, ASCII, MPEGData
5SessionManages sessions between applicationsNetBIOS, RPC, SMBData
4TransportEnd-to-end delivery, flow controlTCP, UDPSegments (TCP) / Datagrams (UDP)
3NetworkLogical addressing and routingIP, ICMP, ARPPackets
2Data LinkPhysical addressing, error detectionEthernet, Wi-Fi (802.11), MAC addressesFrames
1PhysicalElectrical/optical signals over mediaCables, hubs, repeatersBits

Memory Aid: "Please Do Not Throw Sausage Pizza Away" (Layers 1–7) or "All People Seem To Need Data Processing" (Layers 7–1).

Troubleshooting with the OSI Model

When troubleshooting network issues, start at Layer 1 (Physical) and work up:

  1. Layer 1 (Physical): Is the cable plugged in? Is the NIC light on? Is Wi-Fi enabled?
  2. Layer 2 (Data Link): Can you reach the local switch? Are MAC addresses resolving?
  3. Layer 3 (Network): Do you have an IP address? Can you ping the gateway?
  4. Layer 4 (Transport): Can you connect to specific ports? Is the firewall blocking TCP/UDP?
  5. Layers 5-7 (Upper): Is DNS resolving? Can you reach the application/website?

TCP vs. UDP

FeatureTCP (Transmission Control Protocol)UDP (User Datagram Protocol)
ConnectionConnection-oriented (three-way handshake)Connectionless
ReliabilityGuaranteed delivery with acknowledgmentsNo guarantee — "best effort"
OrderingPackets arrive in orderPackets may arrive out of order
Error CheckingYes (checksums + retransmission)Minimal (checksum only)
SpeedSlower (overhead from handshake/ACKs)Faster (no overhead)
Use CasesWeb (HTTP/HTTPS), email (SMTP), file transfer (FTP)Streaming, VoIP, DNS queries, gaming
Header Size20 bytes minimum8 bytes

TCP Three-Way Handshake

  1. SYN — Client sends synchronization request to server
  2. SYN-ACK — Server acknowledges and sends its own synchronization
  3. ACK — Client acknowledges server's response → connection established

IPv4 Addressing

An IPv4 address is a 32-bit number written as four octets in dotted decimal notation (e.g., 192.168.1.100).

IP Address Classes

ClassFirst Octet RangeDefault Subnet MaskNetwork/HostPurpose
A1–126255.0.0.0 (/8)8 network, 24 host bitsLarge organizations
B128–191255.255.0.0 (/16)16 network, 16 host bitsMedium organizations
C192–223255.255.255.0 (/24)24 network, 8 host bitsSmall organizations
D224–239N/AN/AMulticast
E240–255N/AN/AExperimental/Reserved

Note: 127.0.0.0/8 is reserved for loopback (localhost). 127.0.0.1 is the most common loopback address.

Private IP Address Ranges (RFC 1918)

These addresses are not routable on the public internet and require NAT (Network Address Translation) to access internet resources:

ClassPrivate RangeCIDRAddresses Available
A10.0.0.0 – 10.255.255.25510.0.0.0/8~16.7 million
B172.16.0.0 – 172.31.255.255172.16.0.0/12~1 million
C192.168.0.0 – 192.168.255.255192.168.0.0/16~65,000

Special IPv4 Addresses

AddressPurpose
127.0.0.1Loopback (localhost) — tests local TCP/IP stack
169.254.x.xAPIPA — assigned when DHCP is unavailable
0.0.0.0Default route / "any address"
255.255.255.255Broadcast to all devices on local network

IPv6 Addressing

IPv6 uses 128-bit addresses to solve IPv4 address exhaustion:

FeatureIPv4IPv6
Address Size32 bits128 bits
NotationDotted decimal (192.168.1.1)Hexadecimal colon (2001:0db8::1)
Total Addresses~4.3 billion~3.4 × 10³⁸
HeaderVariable lengthFixed 40-byte header
IPsecOptionalBuilt-in
BroadcastSupportedReplaced by multicast/anycast

IPv6 Address Types

TypePrefixDescription
Global Unicast2000::/3Publicly routable (like public IPv4)
Link-Localfe80::/10Auto-configured, local network only (like APIPA)
Unique Localfc00::/7Private networks (like RFC 1918 IPv4)
Loopback::1Equivalent to 127.0.0.1
Multicastff00::/8One-to-many communication

IPv6 Shortening Rules

  1. Remove leading zeros in each group: 2001:0db8:0000:0042 → 2001:db8:0:42
  2. Replace consecutive groups of zeros with :: (once per address): 2001:db8:0:0:0:0:0:1 → 2001:db8::1
Test Your Knowledge

At which OSI layer do routers primarily operate?

A
B
C
D
Test Your Knowledge

Which transport protocol would be BEST for real-time video streaming?

A
B
C
D
Test Your Knowledge

A computer has been assigned the IP address 169.254.45.201. What does this indicate?

A
B
C
D
Test Your KnowledgeMulti-Select

Which of the following are valid private (RFC 1918) IPv4 address ranges? (Select THREE)

Select all that apply

10.0.0.0/8
127.0.0.0/8
172.16.0.0/12
192.168.0.0/16
169.254.0.0/16