The journey of a packet

Send your assignment to the campus site and see what happens inside: the data go down TCP/IP (or OSI) and each layer adds its header, like envelopes inside envelopes. Then the frame travels through the classroom switch and two routers to the server, and you see what each device opens, what changes on the way and how many bytes end up on the cable. It runs in your browser, on your phone too.

How to use it

  1. Choose the model (TCP/IP or OSI) and the transport (TCP or UDP), and type how many bytes you send and the MSS. Start with the 3000 B of the assignment, the same as in the theory article.
  2. The table shows the segments (or the fragments, with UDP). Tap one to see its encapsulation.
  3. Press Step to go down layer by layer and follow the journey, or Run to watch it all. Tap any header in the drawing to see its fields.
  4. Below are the bytes on the cable, the share taken by headers and who reads what. Share copies a link with your data.

How to read the encapsulation

Each row is a layer, from top to bottom. The data box never changes; what grows are the headers: TCP (20 B, or UDP with 8 B) adds the ports and the sequence number, IP (20 B) the source and destination addresses and the TTL, and Ethernet (14 B in front and a 4 B FCS at the end) the MACs for this link. On the right, the size of each layer’s PDU: segment, datagram, frame and bits. In OSI, presentation and session have no header of their own, because on the Internet the application does that job.

The journey: who opens what

  • The switch only opens up to layer 2: it reads the destination MAC and sends the frame out of the right port, changing nothing.
  • Each router opens up to layer 3: it reads the destination IP, picks the next network, subtracts 1 from the TTL, recalculates the IP header checksum and adds a new Ethernet header. That is why your laptop’s destination MAC is the router’s, not the server’s.
  • The server opens everything: it checks the MAC, the IP and the port, and puts the segments back together by sequence number.

The numbers

With 3000 B and an MSS of 1460 you get 3 segments and frames of 1518, 1518 and 138 B: 3174 B on the cable, and headers are 5.5 %. With an MSS of 536 you need 6 segments and headers go up to 10.4 %. And if you send a single byte, the frame is 64 B long (Ethernet pads the payload to 46 B): 98.4 % is headers and padding. With UDP, 3000 B do not fit in one frame and it is IP that splits them into 3 fragments of at most 1480 B.