All Tools

Internet Routing & Packets Explorer

Visualize how data travels across the internet. Build network topologies, run routing algorithms, send animated packets through the network, and explore TCP/IP encapsulation, traceroutes, and packet fragmentation.

Click a node or link in the graph to disable it and watch the packet reroute automatically.

10ms15ms12ms20ms8ms10msASBCDEDClient / SourceRouterServer / DestOff

Dijkstra's Algorithm

Greedy algorithm that finds shortest paths from source to all nodes. Each step selects the unvisited node with minimum distance, then relaxes its neighbors.

Time: O((V + E) log V)
Click "Find Path" to compute the shortest route

Reference Guide

TCP/IP Model (4 Layers)

The TCP/IP model organizes internet communication into four layers, each adding headers as data moves from the application down to the physical network.

  • Application generates the data (HTTP, DNS, FTP)
  • Transport segments the data and ensures reliable delivery (TCP) or fast delivery (UDP)
  • Network (Internet) handles logical addressing and routing (IP)
  • Link (Network Access) handles physical addressing and frame delivery (Ethernet, Wi-Fi)

When sending, data travels down through the layers (encapsulation). When receiving, headers are stripped off moving up (decapsulation).

Routing Algorithms

Dijkstra's algorithm finds the shortest path by greedily selecting the closest unvisited node and relaxing its neighbors.

d[v]=min(d[v],  d[u]+w(u,v))d[v] = \min(d[v],\; d[u] + w(u,v))

Distance Vector protocols (like RIP) have each router share its routing table with neighbors. Routers iteratively update using the Bellman-Ford equation.

Link State protocols (like OSPF) have each router flood its link information to all others. Every router then independently computes shortest paths using Dijkstra.

All three converge to the same shortest paths for non-negative edge weights. The difference is in how the topology information is gathered and distributed.

Fault Tolerance

The internet was designed to survive failures. When a router or link goes down, routing protocols detect the change and recompute paths automatically.

Redundant paths ensure that even if one route fails, packets can be rerouted through alternative paths. Mesh topologies provide the highest redundancy.

TTL (Time To Live) prevents packets from looping forever. Each router decrements the TTL field, and the packet is discarded when TTL reaches zero.

In this simulator, click any node or link to disable it. The routing algorithm will automatically find an alternative path if one exists.

Packet Switching & Fragmentation

Packet switching breaks data into small packets that travel independently through the network. Each packet may take a different path. This contrasts with circuit switching (like traditional phone calls) which reserves a dedicated path.

When a packet exceeds a link's Maximum Transmission Unit (MTU), it is fragmented into smaller pieces.

Fragments=Packet SizeMTU\text{Fragments} = \lceil \frac{\text{Packet Size}}{\text{MTU}} \rceil

Each fragment carries a fragment offset and identification number so the destination can reassemble them in order, even if they arrive out of sequence.

Throughput is calculated as the ratio of data sent to total transmission time.

Throughput=Packet SizeTotal Latency\text{Throughput} = \frac{\text{Packet Size}}{\text{Total Latency}}