Layer mapping
| OSI layer | Function | Concrete example |
|---|---|---|
| 7 Application | Application messages | HTTP request, DNS query |
| 6 Presentation | Representation and encoding | JSON, serialization; encryption is often discussed here |
| 5 Session | Conversation coordination | Session establishment concepts |
| 4 Transport | End-to-end transport | TCP segments, UDP datagrams, ports |
| 3 Network | Logical addressing and routing | IPv4 packet, router |
| 2 Data link | Local-link delivery | Ethernet frame, MAC, ARP context |
| 1 Physical | Signals and media | Copper, fibre, radio |
The TCP/IP model usually groups application, presentation and session into Application; keeps Transport and Internet; and groups the lower layers into Link. Some teaching models split Link into Data Link and Physical, producing five layers. Real protocols do not always fit one box cleanly; TLS is a good example.
Walk through a page load
- The browser builds an HTTP request for a hostname.
- The transport layer adds TCP information; the network layer adds IP addressing.
- The local link encapsulates the packet in a frame for the next hop, often the gateway.
- Routers change link headers at each hop; IP TTL decreases. NAT may change IPs and ports.
- The destination decapsulates the data and delivers the request to the listening process.
Lab: observe your own traffic
Install tcpdump using your distribution package manager. In one terminal capture DNS packets; in another resolve a name. Stop with Ctrl+C.
sudo tcpdump -ni any port 53 -c 10
getent hosts example.com
ip neigh show
ip routeEncrypted DNS, resolver caching, or /etc/hosts can mean no port-53 packet appears. Browser HTTPS content is encrypted, although endpoints and traffic timing remain observable. Packet captures may contain sensitive material; use a small lab capture rather than collecting unrelated traffic.
Diagnose by layer
A disconnected interface suggests link/physical trouble. No gateway or wrong CIDR suggests network trouble. A reachable IP with a timed-out port suggests transport filtering. An HTTP 404 confirms a working path to an HTTP application but an unmatched resource. A 500 points to application processing, not proof that the network is broken.
Assignment
Draw the route from your laptop to Nginx on EC2. Label DNS resolution, home NAT, internet gateway, security group, TCP port and HTTP response. Explain which headers change at the home router and which address the web application may log behind a proxy.
Official reference
Ravindra’s Tip
Layers रटने से ज्यादा useful है failure की layer पहचानना। HTTP 404 आया तो server तक रास्ता बना हुआ है—अब file और routing देखो।
Interview and revision check
What does an HTTP 404 tell you about the network?
An HTTP server responded over the established path. Investigate resource/virtual-host routing before assuming a basic connectivity failure.
Ravindra Bagale · Cloud & DevOps Academy · Handbook and project downloads