computing-networking

How Internet Packets Travel

The internet delivers your message like a postal system built for tiny envelopes.

A large drawing is easier to send when you cut it into numbered pieces, put each piece in an addressed envelope, and rebuild it at the destination.

  1. A large message divided into three numbered TCP segments.One large messageHello, farawaycomputerManageable piecesSegment 1Segment 2Segment 3

    Step 1

    A message becomes pieces

    For a TCP connection, data is divided into manageable pieces. TCP labels segments so the receiver can track the byte stream.

  2. A postal envelope compared with an IP packet carrying source and destination addresses.Addressed envelope=IP packet header

    Step 2

    Each packet gets an address

    IP wraps each piece with a header containing source and destination addresses, much like writing addresses on an envelope.

  3. A flow from a laptop through a home router toward the wider internet.local linknext hopYour deviceLocal routerOther networks

    Step 3

    Your router sends it onward

    Your device sends the packet across its local network to a router that can reach other networks.

  4. Three routers forwarding a packet one hop at a time toward its destination.forwardforwardRouter ARouter BDestinationnetwork

    Step 4

    Routers choose the next hop

    Each router reads the destination address and forwards the packet to another useful router or to the destination network.

  5. Three packets taking two different routes and converging on the same destination.Packet 1Router ARouter BDestinationPacket 2Router ARouter CDestination

    Step 5

    Packets travel independently

    IP handles each packet separately. Packets from one message can arrive by different routes or at different times.

  6. Numbered segments arriving, being checked, and forming the original message again.Pieces arriveTCP checksMissing datareturnsMessage is ready

    Step 6

    The receiver rebuilds the message

    For TCP traffic, the receiver orders data. When bytes are missing, TCP gets the sender to retransmit them.

Common trap

Every packet follows one fixed road.

IP forwards each packet independently. Routers can send related packets along different useful paths before the destination receives them.

Quick check

What does a router inspect to choose a packet's next hop?

  1. The destination IP address
  2. The packet's color
  3. The sender's screen size
Show the answer

The destination IP address tells the router which network the packet is trying to reach.

Sources

  1. Internet Protocol — RFC 791RFC Editor
  2. Requirements for Internet Hosts — RFC 1122RFC Editor
  3. Transmission Control Protocol — RFC 9293RFC Editor