Network protocols for anyone who knows a programming language
When a packet arrives destined for google.com, a quick lookup in the routing table tells the router where the packet should go next to bring it closer to Google. The packets are small, so each router in the chain ties up the next router for only a tiny fraction of a second. Now that we have addresses, we need to know how to route a packet through the Internet toward its destination. To route quickly, routers maintain routing tables indicating the paths to various groups of IP addresses. When a new packet arrives, the router looks it up in the table, telling it which peer is closest to the destination.
Source: www.destroyallsoftware.com