How do Internet packets know where to go?

By Envergure
May 7, 2009
Post New Reply
  1. Here's an example to show what I mean:
    Let's say you're planning a road trip from Los Angeles to Halifax, which is quite some distance. You look at a map and can see highways (connections) that intersect at cities (routers) and plan the shortest route through a certain set of cities.

    Now, afaik nobody - not even Google - has completed a near-complete map of all the connections in the whole Internet, which change regularly anyway. How, then, do packets know where to go? Or, more precisely, how does one router know where to send it next?

  2. jobeard

    jobeard TS Ambassador Posts: 11,161   +986

    The Internet, or more properly the TCP/IP transport layer that is relies upon,
    is far more myopic than anyone would imagine.

    Using the analogy of posting a letter to a friend who lives in Halifax,
    you address the letter and drop it into the mail box. You know it goes first to
    your local Post Office, but what routing does your letter take to finally arrive
    at the Halifax Post Office and thence to your friend?

    At the very bottom of TCP is the Network Interface Card (NIC) which has Your TCP address
    (aka your street address in Los Angeles). It is given the address of your friend in Halifax and performs like this
    send this where? I don't know anything about xxx, so I'll send it to someone (hopefully) who does; that is ALWAYS the default gateway address on the NIC.​
    This continues until some system somewhere has a routing table that says
    AHH; xxx is located over here and forwards to that location.​

    Just like we have a Phone Book of Names and addresses (from the actual Phone company, or a Contact file on our system), we lookup JoeDoe to find the mailing address to write on the cover of the letter. Our systems use the Domain Name Service (DNS) to lookup the readable in a URL or Email address and it replies with the Post Office address in Halifax; which is the IP address of the ISP that the server is running upon or which your friend has a connection to.

    So a URL like or email like both ask the DNS,
    'where is' and get the IP address. Notice the www and user are stripped off at this point.
    The address is returned and the 'letter' is sent to it (xxx above)

    When the 'letter' arrives at xxx, the system sees the prefix www or user@ and repeats the DNS lookup (locally this time) for the system supporting www or that which supports email and --- the final system receives the 'letter'
  3. Lanarkshire IT

    Lanarkshire IT TS Rookie Posts: 46

    hi there

    warriors of the net have an excellent, educational video to explain packet journeys

    get it here

    FREE for home / educational use

    hope that helps
  4. Justin

    Justin TS Rookie Posts: 942

Similar Topics

Add your comment to this article

You need to be a member to leave a comment. Join thousands of tech enthusiasts and participate.
TechSpot Account You may also...