Trace a Packet Through Network Layers
Each layer in the network stack adds its own header to the data before passing it down.
1. Application creates the HTTP request
The browser builds an HTTP GET /orders request with headers and an empty body. This is the data the application wants to send.
2. Transport wraps data in a TCP segment
TCP takes the HTTP data and wraps it in a segment. It adds source and destination port numbers (e.g., port 54321 → port 443) and a sequence number so the receiver can reassemble segments in order.
3. Network adds IP header with destination
IP takes the TCP segment and wraps it in a packet. It adds the source IP (e.g., 192.168.1.5) and destination IP (e.g., 203.0.113.42). Every router along the path inspects this header to decide where to send the packet next.
4. Link layer creates an Ethernet frame
The link layer wraps the IP packet in an Ethernet frame. It adds the source MAC address (this machine's network card) and the destination MAC address — which is the address of the next router on the path, not the final server.
5. Physical layer sends bits over the medium
The Ethernet frame is converted to electrical, optical, or radio signals and transmitted over the physical medium (copper cable, fiber optic, or WiFi air).
6. Router forwards the packet to the next hop
The router receives the bits, reconstructs the frame and packet, checks its routing table, and forwards the packet toward the next hop on the path to the destination.
7. Bits travel over the second link
The process repeats: Ethernet frame → bits on the next physical link → next router.
8. Link layer delivers the frame to the destination
The packet arrives at the destination network. The link layer delivers the frame to the destination server's network card.
9. Network layer passes the packet to transport
IP receives the packet, reads the destination port from the TCP header, and passes the segment to the appropriate transport layer.
10. Transport reassembles and delivers to the application
TCP receives the segment, uses the sequence number to place the data in the correct position, and reassembles the full HTTP message. The completed request is delivered to the web server application, which processes it and returns a response — following the same layered path back to the client.
Read: Network Layers Diagram · Learn more about IP and routing