The concept
Networking is organized in layers. Each layer solves one problem and hands its result to the layer above, so the web application does not care whether the cable is copper or the link is wireless, and the wireless driver does not care what a web page is. When something breaks, layers tell you where to look. The practical model has five layers.
- Physical and link: cables, radios, switches and MAC addresses. Moves frames between directly connected devices. In the cloud this layer is abstracted away entirely.
- Network (IP): addresses and routes packets across many networks. Every host has an IP address; routers forward packets toward the destination. This is where subnets, route tables and gateways live.
- Transport (TCP and UDP): delivers data between processes using port numbers. TCP adds ordering, retransmission and congestion control; UDP sends independent datagrams with none of that.
- Session and presentation (TLS): encryption and identity, which in practice means TLS sitting between transport and application.
- Application: the protocols programs speak, such as HTTP, DNS, SSH and SMTP.
Encapsulation
When an application sends data, each layer wraps it in a header. The HTTP request becomes the payload of a TCP segment with source and destination ports. The segment becomes the payload of an IP packet with source and destination addresses. The packet becomes the payload of a frame with MAC addresses. At each router the frame is stripped and rebuilt for the next link, but the IP packet inside travels unchanged until it reaches the destination, where the headers are peeled off in reverse.
Why it matters in the cloud
Cloud networking exposes the IP and transport layers to you directly: you choose address ranges, write route tables, open ports in security groups. Load balancers are described as layer 4 or layer 7 depending on whether they look at TCP or at HTTP. A firewall rule that allows port 443 is a transport-layer decision; a rule that blocks a URL path is application-layer. Knowing which layer a control operates at tells you what it can and cannot see.
A worked example
A user loads your site. Their browser resolves the hostname with DNS (application layer over UDP), opens a TCP connection to port 443 (transport), negotiates TLS (session), and sends an HTTP request (application). The packets cross the public internet (network layer routing), reach your cloud load balancer, which terminates TLS and opens a new TCP connection to a backend in a private subnet. You can trace this with a packet capture and see every header.
sudo tcpdump -ni eth0 'tcp port 443' -c 10 -vv
The output shows IP addresses, ports, TCP flags and sizes, which is exactly the layering in action.
Common mistakes
- Troubleshooting at the wrong layer, for example checking certificates when the problem is that the TCP connection never opens.
- Assuming a security group can filter by URL. It operates on IP and port only.
- Confusing a host being reachable (ping works) with a service being reachable (the port is open and something is listening).
Action Step
Pick one request your application makes and write down, layer by layer, what happens from the moment the code calls the library to the moment bytes leave the machine. Keep this sheet; every troubleshooting path in this course follows it.