Main content
Computers and the Internet
Course: Computers and the Internet > Unit 3
Lesson 4: Routing with redundancyInternet 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.
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.
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.
Field | Content |
---|---|
Source IP Address | 216.3.192.1 |
Destination IP Address | 91.198.174.192 |
Version | 4 |
Time to Live | 64 |
... 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.
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 2, start superscript, 32, end superscript possible IP addresses, and that's far too much to store. Instead, the table has rows for IP address prefixes.
IP address prefix | path |
---|---|
91.112 | #1 |
91.198 | #2 |
192.92 | #3 |
... |
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.
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 |
---|---|
91.112 | #1 |
91.198.174.192 | Direct |
192.92 | #2 |
... |
The router can now send the message to the destination IP address, which may be a personal computer or a server.
🙋🏽🙋🏻♀️🙋🏿♂️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 12.131.31.31 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)