How do internet packets know which way to go?

587 views

I’ve had this explained to me many times by people who “know”

Not one could clearly explain how a packet gets to its intended destination address without randomly trying a bunch of other address.

How does the first “ping Freddy” find Freddy when he could be anywhere on the network.

Once Freddy has been pinged how does the packet know which way to go next time?

In: Technology

5 Answers

Anonymous 0 Comments

I think what you’re interested in are Routing Protocols.

If a computer on the internet is trying to connect to another, Routing Protocols are used to determine how to get to the destination in the most efficient way possible.

Typical routing protocols used are Open Shortest Path First (OSPF), Routing Information Protocol (RIP), and Border Gateway Protocol (BGP).

These routing protocols get complicated really quick, but typically involve each device enroute to the destination maintain a table on which paths are available e.g. who their neighbors are and how long it takes to get to each neighbor, which then the packet reads and determines which path is most efficient to take.

Anonymous 0 Comments

The packets don’t. They just have an address on them, like mail. The things doing the routing are… the routers. They each know the IP addresses of their own ports (and thus which networks they are in). They tell each other about these, and those routers pass the info on along with their own port data. The end result is that every router knows which of their ports are connected to another router which has an idea where that packet needs to go next, passing it from one to another until it gets to the router that has a port in the target network and can directly pass the packet to the destination computer.

Anonymous 0 Comments

Think of it like finding someone’s phone number in a phone book.

You might start by looking for the general area. Asking each one in turn until one answers “yes, I know a freddy you might be looking for”.

Then getting more specific, looking for more information. “no, I don’t have anyone with that last name”.

Finally, you find the freddy you are looking for and can ring his number. This then gets saved to make finding him quicker next time. Your router will say “freddy? Yes I’ve seen him before, does he still live here…” and will double check the final address bit.

Anonymous 0 Comments

The Internet Service Providers will share information with each other on where each range of addresses is. They tell each other over each link how far it is to every other address range. So Freddys ISP is connected to a different ISP and tells them thet they can deliver any packets directly to Freddy. Your ISP happens to also have a direct line to this intermediary ISP and will get a message from them saying that they can route packets to Freddy through one jump. Another ISP might also tell your ISP that it can reach Freddy but in two jumps so your ISP will not send the packet in their direction unless they lose connection with the first ISP. So all the ISPs know at all times in which direction they should send any packets for it to get closer to the destination.

Anonymous 0 Comments

Routes.

Each host has an IP address. An IP address is just a big number. So say, address 100.25.35.40 is pinging address 200.5.7.8. Your ISP provides you with a “gateway”, which is just a router that knows what to do next. Let’s say the gateway is 100.25.35.1.

Each router has a list of routes, which define which range of IP addresses goes where. A router is something that connects to multiple networks and decides what to send where. Eg, one cable goes to one city, another goes to another.

1. Ping packet destined for 200.5.7.8 gets sent to 100.25.35.1.
2. 100.25.35.1 has a list of routes: packets 110.anything get sent out of the 110 wire. Packets 120.anything get sent out of the 120 wire. Packets for 200.anything get sent out of the 200 wire to router 200.0.0.1
3. Router 200.0.0.1 is far away and let’s say in another city. The process repeats: 200.1.anything goes to one block. 200.2.anything goes to another block. 200.5 goes to yet another block.
4. The block has yet another router: 200.5.1 goes to one building. 200.5.2 goes to another building. 200.5.7 goes to our destination building.
5. The building has yet another router. 200.5.7.8 goes to a specific flat.

This is an drastic over-simplification, but basically that’s the idea.