cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1124
Views
10
Helpful
11
Replies

How do Routers packets between diff subnets/vlans/domains

adsuther1
Level 1
Level 1

How do Routers route packets between diff subnets/vlans/domains?

 

thanks,

Anthony

ADS
11 Replies 11

Joseph W. Doherty
Hall of Fame
Hall of Fame

When a packet enters a router it examines the destination address and determines if it "knows" where to send the packet.  If it does, it does so.  If not, it drops the packet.

In the foregoing, I don't go into detail about "knows" nor do I describe other options a router might do to a packet it receives.  However, what I've described is the basic function/operation of a router.

All the full details to possibly answer your question may require a book length answer.

umeshpathak
Level 1
Level 1

In Simple words for routing decision

1.When packet enters the router it first check the header checksum to detect corruption,If the packet is corrupted ,discard the packet.

2.If the checksum pass,router check for the destination IP,If it is router self IP ,then check for the protocol field for which this packet  packet need to be sent.

3.If the packet is not for him,it check the routing table if route is found packet is again encapsulated using the  correct layer2 forwarding information and put on wire.

4.If the router is not found packet is discarded.

So in sort based on the destination route status in the routing table decision is taken.

adsuther1
Level 1
Level 1

Hi,

If a packet enter a router and the destination IP route is not found in the current router routing table; where does the packet go? 

What I'm trying to get at, if an IP packet enters a router, should there always be a route available to take the Packet to the next router? I the subnet of the packet is not in the current routing table, the IP packet is dropped. Why would the route not exist in the routing table?

ADS

A key part of the answer to your question is how the router builds its routing table. As the router boots up it does these things:

- for every interface that is in the up/up state it determines the subnet of the interface and inserts that subnet into its routing table as a connected route.

- it then examines its configuration for any static routes and if it finds any they are added to the routing table.

- if any dynamic routing protocols are configured then the router initiates the routing protocol, establishes neighbor relationships, advertises its own routes and listens for route advertisements from neighbors and inserts those routes into the routing table.

After everything is initialized and running the router reacts to any configuration changes that might add or delete routes and reacts to any advertisements in its routing protocols that might add or remove subnets/networks.

you ask " should there always be a route available to take the Packet to the next router?". The answer is that it depends on whether the router has a default route. A default route might be a locally configured static route or might be learned from a dynamic routing protocol. If there is a default route than no packet would be dropped but if there is not a default route in the routing table then it is quite possible that some packets would be dropped.

HTH

Rick

Re: no known route/prefix, where packet go?

It's dropped/discarded/deleted, trashed or sent to "bit bucket" (the latter being the computer version of the "circular file" or your waste can with shredder).

Re: should there always be a route?

No.

Re: if not, why not?

There are some very good reasons, why not, which I hope to provide later (when I'm at my PC).

 

(Part II)

"If a packet enter a router and the destination IP route is not found in the current router routing table; where does the packet go?"

Well, actually a router will forward a packet if the destination address falls within any of its known (i.e. in route table) networks or if there's a default route (the latter mentioned by Rick.)

E.g. if destination IP is 192.168.1.10, packet will go toward 192.168.1.10/32, 192.168.1.0/27, 192.168.1.0/24, 192.168.0.0/16, 192.0.0.0/8, or 0.0.0.0/0, in that order of matching, if any of those network prefixes are in the route table.  If no match at all, packet is dropped/discarded.

"What I'm trying to get at, if an IP packet enters a router, should there always be a route available to take the Packet to the next router?"

No, because the destination IP might be invalid or not currently reachable in your network.  (Which, incidentally, since routers may not have all actually existing or reachable networks in their route table, using defaults or aggregates can lead to needless forwarding packets, across your network, which cannot be delivered.  Ideally, we want to drop/discard such packets ASAP.)

"Why would the route not exist in the routing table?"

As already mentioned, route might be invalid or currently unreachable.  But, with large networks, we often don't have every actual existing and reachable network in a route table to reduce the size of the route table.  I.e. we might be using aggregates and/or the global default.  Although this is great for minimizing the route table's size, again, it can lead to forwarding packets that cannot be delivered.

Here is an additional thought about the question about default routes. We typically assume that most networks would have a default route, and especially if the network wants access to Internet it is pretty much true. But some networks do not need (and sometimes do not want) Internet access and therefore may not have a default route. I have worked with customers who have "secure" inside networks which do not have access to Internet. For them there is no need for a default route. If you were setting up a network for study purposes, or establishing a lab environment it is possible that you would not have a default route. So yes it is quite common for a network to have a default route but there are circumstances where there is no default route and dropping packets can occur.

HTH

Rick

100 percent true.

But when using a default route to go to the Internet, what's the norm when you get to the first router with the full Internet route table?

As Rick didn't respond to my question (either he missed it or thought it was just rhetorical), I believe any router with full Internet route tables would not have a default route.  I.e. packets with destination IPs that are "unknown", will be dropped.

Again, Rick correctly describes what you will find in most networks, is a default route that leads to the Internet.  (Of course, I do remember the days when you mentioned "Internet" and response was "what's that"?  For networking then, i.e. when businesses often didn't have an Internet connection, using a default route was much less prevalent [especially if using a dynamic routing protocol].)

Thanks you y'all HELP.

When a packet's destination IP  or subnet is not configured on the interfaces of the router, and there is a default route or static route; where does the default or static points to? what is the next hop for the default or static route? am i trying to send the default or static route to the INTERNET? If i'm trying to send the Packet to the internet, what would be the next hop to reach the internet?

I log all answers,

Thanks Anthony

ADS

". . . default route or static route; where does the default or static points to?"

Whatever interface and/or next hop IP you've configured.

Ditto for your other questions, i.e. you configure where each router's configured default and/or static routes go to.

If advertising a default route within a dynamic routing protocol, the dynamic routing protocol will have each router compute it's own "best path" decision going toward the router that originated the default route.  Once you get to that router, it too might have a hard coded default route, where, again, you configure egress interface and/or next hop IP, or if this is default for getting to Internet (the usual case), that router might have the full Internet route table, which it uses to make the decision where to forward the packet or drop it.

BTW, if you have (or obtain) a copy of Packet Tracer, you can "lab" these cases pretty easily.

 

Review Cisco Networking for a $25 gift card