Computers and the Internet
Internet routing protocol
The Internet Protocol (IP) is the protocol that describes how to route messages from one computer to another computer on the network. Each message is split up into packets, and the packets hop from router to router on the way to their destination.
Diagram of laptop computer sending packet to server computer. A network of 9 routers is shown between the laptop and the server, with various lines connecting them. There's a path from the laptop, through the routers, to the server, highlighted with green arrows.
Let's step through the process of routing a packet from a source to a destination.
Step 1: Send packet to router
Computers send the first packet to the nearest router. A router is a type of computing device used in computer networks that helps move the packets along.
Diagram with laptop on left and router on right. Arrow goes from laptop to router, with message "TO: 22.214.171.124" and "FROM: 126.96.36.199".
You likely have a router in your home or classroom right now, and that's the first stop for your current computer's packets.
Step 2: Router receives packet
When the router receives a packet, it looks at its IP header. The most important field is the destination IP address, which tells the router where the packet wants to end up.
|Source IP Address|
|Destination IP Address|
|Time to Live|
|... plus 10 more fields!|
Step 3: Router forwards packet
The router has multiple paths it could send a packet along, and its goal is to send the packet to a router that's closer to its final destination.
Diagram with router on left and 3 routers on right. The left router has a line going to each of the right routers, and the lines are labeled 1, 2, and 3. A question mark is shown above each line.
How does it decide? The router has a forwarding table that helps it pick the next path based on the destination IP address. That table does not have a row for every possible IP address; there are possible IP addresses, and that's far too much to store. Instead, the table has rows for IP address prefixes.
|IP address prefix||path|
IP addresses are hierarchical. When two IP addresses start with the same prefix, that often means they're on the same large network, like the Comcast SF network. Router forwarding tables take advantage of that fact so that they can store far less information.
Once the router locates the most specific row in the table for the destination IP address, it sends the packet along that path.
Diagram with router on left and 3 routers on right. The left router has a line going to each of the right routers, and the lines are labeled 1, 2, and 3. The second line, labeled 2, is highlighted with green arrows going from left to right, and shows a packet above it.
Step 4: Final router forwards message
If all goes well, the packet should eventually arrive at a router that knows exactly where to send it.
|IP address prefix||path|
The router can now send the message to the destination IP address, which may be a personal computer or a server.
Diagram with router on left side and laptop on right side. Arrow goes from router to laptop with packet displayed above it.
🙋🏽🙋🏻♀️🙋🏿♂️Do you have any questions about this topic? We'd love to answer—just ask in the questions area below!
Want to join the conversation?
- How do routers get their routing table? Do they build it themselves or do they get it from some server or from other routers P2P style?(17 votes)
- Routing tables can be built in two ways. The first method is the manual one, you basically have a system administrator who enters possible routes.
For the second method you basically use routing protocols (e.g. the OSPF - Open Shortest Path First) that automatically create and update a database of possible routes.(24 votes)
- In part 3, it says, "The router has multiple paths it could send a packet along, and its goal is to send the packet to a router that's closer to its final destination." Does that mean that different routers communicate with one another, and that your router is used to transport other people's data? Is so, how do they do so (e.g. wirelessly, which means that they would have to be close together)? Additionally, wouldn't that decrease the speed of routers in heavily populated areas, since they would be processing more information that routers in, say, rural areas?(10 votes)
- Routers work with each other, but those are public routers made for this purpose (think huge information hubs, a bit like airports for information). Running internet connections over private routers would be incredibly dangerous because anyone could just trap the message flow, then decode it or change it or just block it altogether.
Transport happens over cables.
Heavily populated areas have stronger internet infrastructure (much higher demand and of course business interests) which is why internet speeds in city areas tend to be much faster than in rural ones.(19 votes)
- In the field of computer networks, what is a protocol?(0 votes)
- A protocol is the basic concept which this article and the ones before this were about. It is basically a set of rules governing the format of data sent over the internet or other network along which devices are connected. (Pls do upvote)(30 votes)
- what if we send message to suppose ip 188.8.131.52 and he change his network ,will he recive message .if so then how?(7 votes)
- If you tell your system to send packets to a specific IP it will try to do that. Identifying that it got the wrong recipient is too complex of a task and trying to actually look for the targets new location would be like randomly running through a large city and trying to find a package recipient by just yelling their name.(15 votes)
- What does, "If all goes well, the packet should eventually arrive at a router that knows exactly where to send it.
The router can now send the message to the destination IP address, which may be a personal computer or a server," mean?" How would some routers know exactly where to send it, but others don't?(3 votes)
- Not all routers contain all the information, that just wouldn't be feasible. Imagine it like each router knows what happens in its area, so if one router doesn't know where the target is it sends you to the router that's in the general area and therefore should know where to send information.
It's like someone might know where the east side of the city is, but they have no idea where 123 Main Street is located. So they give you directions to the east side and once you're there you have to find someone to give you directions to 123 Main Street.(12 votes)
- this is too much(7 votes)
- how to get a 5 on ap exam(4 votes)
- Can you plug an Internet Routing Protocol in a TV Cords?(3 votes)
- Funny enough - yes. IP protocol works not on a physical layer (for more information you can google OSI model) but on a network layer. So, it does not give a thing about through what cable or radio waves you send packets. You can send IP packets via sound (nobody does that though).
For learning more you can start with this: https://en.wikipedia.org/wiki/Ethernet_over_coax(3 votes)
- What is the best description of how routing works on the Internet?(3 votes)
- So, I often hear the term "Subnet table" associated with routing protocols. What is a subnet table?(3 votes)