The Runtime Theory
ApplicationFoundationsnetwork

Trace a Packet Through Network Layers

Follow a single packet from the application layer through transport, network, link, and physical layers to its destination and back.

The Runtime Theory Team2 min read10 steps

layer stack

Application

HWHardware
KKernel
RTRuntime
APPApplication
SYSSystem
CLIClient
NETNetwork
TLSCrypto
SRVServer

adjacent altitudes in this subsystem are still being traced

trace spine

  1. 01 Application creates the HTTP request
  2. 02 Transport wraps data in a TCP segment
  3. 03 Network adds IP header with destination
  4. 04 Link layer creates an Ethernet frame
  5. 05 Physical layer sends bits over the medium
  6. 06 Router forwards the packet to the next hop
  7. 07 Bits travel over the second link
  8. 08 Link layer delivers the frame to the destination
  9. 09 Network layer passes the packet to transport
  10. 10 Transport reassembles and delivers to the application
▸ On this page

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.

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.

The process repeats: Ethernet frame → bits on the next physical link → next router.

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

Not started

Sign in to save your learning progress.

Sign in to save