Comm Notes
Internet protocol stack, TCP/IP architecture, packet switching, routing protocols, and quality of service mechanisms
Internet Communication: How Data Travels Across the World
When you send a WhatsApp message to a friend in another city, your text breaks into tiny packets, bounces through dozens of routers, possibly traverses undersea fiber optic cables, and reassembles perfectly at the destination — all in under 100 milliseconds. This miraculous process is governed by the TCP/IP protocol stack, the communication architecture that powers the entire internet.
The Fundamental Idea: Packet Switching
Before the internet, telecommunications used circuit switching — dedicating a physical path between two endpoints for the entire duration of a call. This is like building a private highway between your house and your friend's house every time you want to send a letter. Terribly wasteful when the road sits empty between sentences.
Packet switching revolutionized this approach. Your data is chopped into small packets (typically 1500 bytes maximum), each packet gets a destination address header, and packets are sent independently through the network. Different packets from the same message might take completely different routes. Routers at each hop examine the destination address and forward the packet toward its destination based on routing tables.
The key advantage is statistical multiplexing — since most connections are bursty (sending data in bursts with idle periods), many users can share the same network links efficiently. A 1 Gbps link serving 1000 users who each burst at 10 Mbps works beautifully because they rarely burst simultaneously. This is why your internet connection seems fast even though you share infrastructure with thousands of neighbors.
The TCP/IP Protocol Stack
The internet uses a layered architecture where each layer provides services to the layer above while hiding implementation complexity. Think of it like the postal system — you write a letter (application), put it in an envelope with an address (transport), the postal system routes it through sorting centers (network), and physical trucks carry it between cities (link/physical).
Application Layer: This is where user-facing protocols live. HTTP delivers web pages, SMTP sends email, DNS translates domain names to IP addresses, and RTP carries real-time voice and video. Each application protocol defines message formats and exchange sequences specific to its purpose.
Transport Layer: Two main protocols operate here. TCP (Transmission Control Protocol) provides reliable, ordered delivery with flow control and congestion control — perfect for web browsing and file downloads where every byte must arrive correctly. UDP (User Datagram Protocol) provides unreliable but fast delivery — ideal for real-time applications like video calls where a lost packet is better than a delayed one.
Network Layer (IP): The Internet Protocol handles addressing and routing. Every device gets a unique IP address (32-bit for IPv4, 128-bit for IPv6). Routers use IP addresses to forward packets hop-by-hop toward the destination. The network layer provides best-effort delivery — packets might be lost, duplicated, or arrive out of order. Reliability is built on top by TCP.
Link Layer: Handles communication over a single physical link — Ethernet for wired connections, WiFi (802.11) for wireless, PPP for point-to-point serial links. Each technology has its own frame format, addressing (MAC addresses), and error detection.
How Routing Works
When a packet arrives at a router, how does the router decide where to send it next? This is the routing problem, and it's solved by routing protocols that build forwarding tables.
OSPF (Open Shortest Path First): Each router advertises its directly connected links to all other routers in the network. Every router then has a complete map of the network topology and computes shortest paths using Dijkstra's algorithm. The "cost" of each link can be configured based on bandwidth — a 10 Gbps link has lower cost than a 100 Mbps link, so traffic naturally flows over faster paths.
BGP (Border Gateway Protocol): While OSPF works within a single organization's network (autonomous system), BGP handles routing between organizations — between ISPs, between countries, between continents. BGP is a policy-based protocol where each organization can control which routes it advertises and which routes it prefers, enabling complex business relationships.
The routing table in a core internet router might contain 900,000+ entries (the current size of the global BGP table). Longest-prefix matching ensures that a packet destined for 192.168.1.5 matches the most specific route available — perhaps a /24 route for 192.168.1.0/24 rather than a less specific /16 route.
TCP: Reliable Communication Over Unreliable Networks
TCP is arguably the most important protocol on the internet. It provides reliable byte-stream delivery over a network that makes no guarantees. Here's how:
Three-Way Handshake: Before sending data, TCP establishes a connection using SYN → SYN-ACK → ACK. This ensures both sides are ready and establishes initial sequence numbers used to order packets.
Sequence Numbers and Acknowledgments: Every byte sent gets a sequence number. The receiver acknowledges by sending back the next expected sequence number. If the sender doesn't receive an acknowledgment within a timeout period, it retransmits the data.
Flow Control: The receiver advertises a "window size" indicating how much buffer space is available. The sender never sends more than this amount without acknowledgment, preventing buffer overflow at the receiver.
Congestion Control: TCP starts slowly (slow start phase, doubling the sending rate each round-trip time) and backs off when it detects packet loss (which signals network congestion). The algorithms — slow start, congestion avoidance, fast retransmit, and fast recovery — ensure TCP connections collectively share network capacity fairly.
The throughput of a TCP connection can be approximated as:
Throughput ≈ (MSS / RTT) × (1 / √loss_rate)
Where MSS is maximum segment size, RTT is round-trip time, and loss_rate is the packet loss probability. This explains why high-latency connections (satellite links with 600 ms RTT) achieve lower throughput than low-latency ones.
Quality of Service (QoS) Mechanisms
The basic internet provides best-effort service — all packets are treated equally. But modern applications have diverse requirements. A video conference needs low latency and consistent bandwidth, while a file download can tolerate delays. QoS mechanisms differentiate traffic:
DiffServ (Differentiated Services): Packets are marked with a 6-bit DSCP code in the IP header indicating their priority class. Routers use these markings to apply different queuing disciplines — high-priority voice packets are served before lower-priority bulk data.
Traffic Shaping: At network boundaries, traffic is shaped to conform to agreed-upon rates. Token bucket algorithms limit burst sizes while permitting short bursts above the average rate. The token bucket parameters are burst size (B) and token rate (R):
- Maximum burst duration = B / (Peak_rate - R)
- Long-term average rate ≤ R
Queuing Disciplines: Weighted Fair Queuing (WFQ) gives each flow a guaranteed share of bandwidth proportional to its weight. Priority queuing serves high-priority queues first but risks starving low-priority traffic.
DNS: The Internet's Phone Book
Before your browser can load a website, it must translate the domain name (like "google.com") into an IP address. DNS uses a hierarchical, distributed database:
- Your computer queries a local recursive resolver (usually your ISP's DNS server)
- The resolver queries a root server → "Who handles .com?"
- Root server directs to .com TLD server → "Who handles google.com?"
- TLD server directs to Google's authoritative nameserver → "What's the IP for google.com?"
- Answer (e.g., 142.250.190.78) is cached at every level to speed up future queries
The entire process typically takes 20-100 ms for uncached queries but near-zero for cached ones. DNS caching, controlled by TTL (Time-To-Live) values, dramatically reduces query load on authoritative servers.
Network Address Translation (NAT)
IPv4 provides only 4.3 billion addresses — not enough for today's connected devices. NAT solves this by allowing multiple devices to share a single public IP address. Your home router assigns private addresses (192.168.x.x) to your devices and translates between private and public addresses, maintaining a translation table mapping internal (IP:port) pairs to external (IP:port) pairs.
Performance Metrics and Calculations
Latency Components: Total delay = propagation delay + transmission delay + queuing delay + processing delay
- Propagation delay = distance / (2/3 × speed of light) — about 5 ms per 1000 km in fiber
- Transmission delay = packet_size / link_bandwidth — 12 μs for a 1500-byte packet on 1 Gbps Ethernet
- Queuing delay — varies with congestion; can dominate during peak traffic
Throughput: End-to-end throughput is limited by the bottleneck link (minimum bandwidth along the path) and by TCP window size. Maximum throughput = window_size / RTT.
Bandwidth-Delay Product: BDP = Bandwidth × RTT represents the amount of data "in flight" in the network. For a 100 Mbps link with 50 ms RTT: BDP = 100 × 10⁶ × 0.05 = 5,000,000 bits = 625 KB. TCP's window must be at least this large to fully utilize the link.
Key Takeaways
- Packet switching enables statistical multiplexing, allowing millions of users to efficiently share network infrastructure — far more efficient than dedicating circuits.
- The TCP/IP layered architecture separates concerns: applications don't worry about routing, routers don't worry about reliability, and link layers don't worry about addressing.
- TCP provides reliable delivery through sequence numbers, acknowledgments, retransmissions, and congestion control — transforming an unreliable network into a reliable communication channel.
- Routing protocols (OSPF within networks, BGP between networks) collectively build the forwarding tables that guide packets across the global internet.
- QoS mechanisms (DiffServ, traffic shaping, queuing) differentiate service for applications with different latency and bandwidth requirements.
- Understanding bandwidth-delay products and TCP window sizing is essential for diagnosing and optimizing internet communication performance.
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for Internet Communication.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this Communication Systems topic.
Search Terms
communication-systems, communication systems, communication, systems, modern, internet, internet communication
Related Communication Systems Topics