Module 02

Data Shredding

The internet doesn't ship files whole. It chops them into tiny envelopes called packets, each able to take its own path to the destination.

Diagram showing square data packets flying through a digital tunnel

What Is a Packet?

A packet is a small unit of data transmitted over a network. Think of it as a digital envelope. It has a header with the sender and recipient addresses, a sequence number, and a payload containing a fragment of the original message.

Why Break Data Apart?

  • Resilience: If one packet is lost, only that packet needs to be resent, not the entire file.
  • Efficiency: Multiple packets can travel different routes simultaneously, balancing network load.
  • Fairness: Smaller chunks let many users share the same connection without one large transfer blocking everyone else.
Interactive

Fragmentation & Reassembly

1 fragment · 20 bytes of header overhead
1200 bytes
Link MTU
Original datagram · ID 0x4f2c
IP hdr
1200 bytes payload
After fragmentation — click a fragment to drop it in transit
Reassembly at the destination

All 1 fragments arrived. The receiver groups them by identification field 0x4f2c, orders them by fragment offset, and knows the datagram is complete because the last fragment has MF = 0. The original 1200-byte payload is handed up to TCP intact.

Interactive

Path MTU Discovery

current probe 1500 B · DF = 1

The sender marks every packet Don't Fragment. Any router whose outgoing link is too small must drop the packet and reply with ICMP Type 3 / Code 4 — Fragmentation Needed, quoting the MTU it can actually carry. The sender caches that value and retries smaller until packets get through.

Path hops · link MTU
Host NIC
Ethernet LAN
MTU 1500
Edge router
Fibre uplink
MTU 1500
VPN gateway
IPsec tunnel overhead
MTU 1400
Transit AS
Backbone
MTU 1500
Server NIC
Datacenter
MTU 1500
No probes sent yet. The stack optimistically starts at the local interface MTU of 1500 bytes.
Sender adaptation

Keep probing. Each ICMP "Fragmentation Needed" message carries the constrained link's MTU, so the sender does not have to guess — it jumps straight to that size and retries. If those ICMP messages are filtered by a firewall, the connection stalls instead: the classic "PMTUD black hole".

Interactive

Fragment loss & reordering simulator

3/3 fragments arrived · 4000/4000 B
Arrival order at the receiver — click a fragment to drop it, arrows to reorder
#1
#2
#3
Reassembly buffer (sorted by offset)
0–1480
1480–2960
2960–4000
Outcome

Every fragment arrived. Order on the wire does not matter: the receiver keys fragments on (source, destination, protocol, identification) and files each one at its fragment offset × 8 in the buffer. Seeing MF = 0 gives the total length, and once there are no holes the 4000-byte datagram is handed up to TCP.

Interactive

TCP vs UDP under fragmentation

link MTU 1500 B · 3 segments of ≤ 1460 B — no IP fragmentation
4000 bytes
On the wire · 3 × TCP segments
seq 1 · 1460 B
seq 2 · 1460 B · lost
seq 3 · 1080 B
Who splits the data

TCP itself, at the MSS learned from the path MTU. IP receives packets that already fit.

Header cost per packet

40 B on every segment (IP + TCP).

Effect of one lost packet

Only that segment is retransmitted; the rest of the stream stays in the receive buffer.

Loss amplification

1 lost packet = 1 lost segment.

Outcome for 4000 bytes of application data

Segment 2 was lost. The receiver ACKs what it has, the sender detects the gap through duplicate ACKs or a timeout, and retransmits only that segment — 1460 B resent out of 4000 B. Flow control and congestion control also react, briefly slowing the stream.

The Journey of a Packet

  1. Segmentation: Your device splits a file into chunks, often around 1,500 bytes each.
  2. Encapsulation: Each chunk gets wrapped with headers containing source IP, destination IP, port, and sequence number.
  3. Transmission: Packets are sent onto the network, where routers forward them hop by hop.
  4. Reassembly: The receiving device uses sequence numbers to put packets back in order and reconstruct the original file.

Key Term

MTU (Maximum Transmission Unit)

The largest packet size that can be sent over a network link. Ethernet commonly uses an MTU of 1,500 bytes. If data exceeds this, it must be fragmented.