7

I was studying, and I got stuck in trying to find out the best way to answer this question:

explain how a router learns about networks that can be reached from its interfaces and how it routes packets. You should assume that the router has just been connected to the network.

So, am I correct in describing it in a simple way by saying that :

A router learns about networks that can be reached from its interface thanks to the switches, which themselves learn what computers are connected to each port. And once it learns, it uses the network layer to determine the best route to a destination by using IP.

I've been studying with the book Microsoft Networking Essentials, and I can't seem to find a detailed enough answer to this simple question. It is somewhat confusing because of the way the book is structured.

2
  • Unfortunately, product or resource recommendations are explicitly off-topic here, so your request for "additional webpages online to understand this subject" is off-topic. Also, all "education, certification, or homework" questions are explicitly off-topic here. – Ron Maupin Apr 23 '16 at 18:10
  • Did any answer help you? if so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could post and accept your own answer. – Ron Maupin Jan 3 at 21:53
6

Your answer to the question is incorrect. There are multiple ways routers can learn which interfaces should be used for which network:

  • Routers implicitly know about directly connected networks when the interface is configured with an IP address and mask, either manually, or through DHCP.
  • Routers can be configured with static routes to specific networks, or even with a default route.
  • Routers can exchange route information with other routers through routing protocols.

Regardless of how a router learns a route to a network, it adds the route to its routing table, including the interface to which it should switch the traffic destined for that network.

This is a huge subject, and the details are far too broad to be discussed here in any more detail. You can ask specific questions on a subject to limit the answer(s) to acceptable size(s).

6

There are a few "layers" to get through to answer your question. Lets start at the beginning:

A device who wants to speak/access the Internet (or any network) must have an IP address. The IP address serves as the identity of the device on the network.

IP addresses, however, do not exist on islands. Instead, IP Addresses exist within groups known as Networks, or Local Networks, or Sub Networks, or a plethora of similar names.

The reason this is important is because if this wasn't the case, a Router would have to know the location of every IP address in the world. Which in IPv4, means 4.2~ billion different "routes". Being able to organize IP addresses into groups, means Routers don't have to learn NEARLY as many routes.

As such, anytime any device is configured with an IP address, it must also be configured with a Subnet Mask. The Subnet Mask will serve to tell the device just how many other IP addresses are within its grouping (or Network). This is all done through the process of what is called Subnetting -- you can read more about the process here.

For example, a device configured with the IP address 10.1.1.30 and the Subnet Mask 255.255.255.0 will intrinsically know the size of its Network contains every IP address in the range 10.1.1.0 through 10.1.1.255.

A router configured with the same IP address would work the same way and also intrinsically know the size of the Network it is directly connected to. Which will then tell the Router what Directly Connected network it is attached to.

If a router has multiple interfaces, it will repeat the same process for each interface, until it knows ALL the Networks it is directly connected to.


That said, there is so much more to all this than what was summarized above. But I wanted to focus on just answering your question. For more information, I highly suggest reading through this article series that describes how packets move through a network, and specifically the article that picks apart how a Router routes packets. When you've done that, you can see it all tied together in this video.

Disclaimer: I wrote the aforementioned articles

1

Well I don't know how to put this delicately but your answer is the answer that comes up with a simple google search word for word. As someone who graded papers in college for teachers I can tell you that would be my first step, check if the answers are word for word google searched. It may be in your book that way, but I am not sure what switches have to do with layer 3 routing. Unless they are a L3 switch that is, which is really operating as a layer 3 device when enabled. Switches do not share routing information, they map mac addresses to ports on a switch. You can have an entire network without a switch and they still route packets.

As is stated this is a deep topic, but Routers learn from other routers about the networks connected to each router. They are aware of the networks connected directly or locally, but need other routers to fill in the gaps of the networks not connected directly to the router. This is where routing protocols come in, as well as static routes. Routing protocols dynamically exchange information about routes connected to them with other routers. Static routes are fixed routes that are administratively added to a routers routing table. Static routes will be believed over any routing protocol with the same route. Meaning if a static route exists to network, the router assumes the administrator knows what they are doing and puts that as the highest priority route. The problem with them is they don't dynamically change the routing information base if a route fails, the administrator has to manually change the routing table to express another route to the destination. There are several routing protocols that do this automatically when configured on a router. A router is connected and it shares its routing database with other routers, and those routers do the same. This allows them to build a topology of the network or in the case of RIPv2 a routing database, which in turn is used to determine the best route to all destinations it has in that table. Once the best route is determined that information is put into the Routing Table. Not all routes will be put into the table, just the best routes as deemed by the metric of the routing protocol (meaning another protocol may choose another better route and it may be a better route than RIP or will be a better route than rip). Some Protocols send regular updates even when there is no changes, RIP every 30 secs sends the entire contents of its table, and can trigger updates based on changes but EIGRP and OSPF will only update when changes in the network occur. This is what makes Routing protocols dynamic in nature, they can react to changes in topology pretty much as they occur. If there were no routing protocols we would have to manually create tables with static routes, which as stated does not account for changes as they occur in the network. They are useful still, but unmanageable in modern networks as the sole source for routing information. That's a start, I wasn't accusing you of plagiarism per se, but you really ought to try to put these concepts in your own words, because trying to memorize what you wrote would be cumbersome. NetworKing on Youtube or David Bombal both have great lessons on this stuff for beginners and help you to understand the concepts much better than reading it only. They go through examples and use packet tracer a widely available simulator by Cisco or available through Cisco great for CCNA level networking. GNS3, or an actual physical device are better options but Packet tracer handles pretty much all the basics well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.