Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

routing decision for subnet ID

I have a little question about how router forward a packet destined to a subnet id.

consider this scenario,with the following line in the routing table.

C 10.10.10.128/28 is directly connected, Serial0/1

S 0.0.0.0/0 to 2.2.2.2

now if a packet with destination address 10.10.10.128 (note that this is subnet ID) receives on other interface, now how do the router route this packet.

thanks in advance

15 REPLIES

Re: routing decision for subnet ID

Hello,

According to Internet standard documents the values of all zeros and all ones in the subnet field should not be assigned to actual interfaces. If you try to assign the subnet address to an interface in a Cisco router (as I did by mistake once, what a shame :-), you will receive a rather embarrassing message from the router. The all ones means all hosts, so it is possible to route towards them if configuration allows it (directed broadcast), but the destination of all zeros does not specify anybody. It is just an abstract convenience to refer to the hosts in a subnet in compact form in the routing table and elsewhere. So, I believe packet should be dropped by the first router that has enough routing (mask) information to recognize that this is an invalid destination.

Kind Regards,

M.

p.s. Since I did not consider the "I believe" above enough to convince you, I tried from a Windows machine to ping the subnet address of my DSL connection (LAN subnet actually) and Windows ping says that this is an invalid destination (I do not paste the output because it says "invalid destination" in Greek and for most people Greek is Greek to them :-)

Hall of Fame Super Silver

Re: routing decision for subnet ID

Maria

I thought it was a good answer and deserves the rating I gave it. You told us what you know about it and what the basic principles are. Then you tested to see what would happen. And the ending sentence has just made my afternoon.

HTH

Rick

Re: routing decision for subnet ID

Rick,

Thanks. I think the original question was a good one. No matter how many years pass, there are always questions I have never thought about that can send me back to review the basics :-)

By the way, the Greek equivalent of "It's Greek to me" is "It's Chinese to me" :-)

Kind Regards,

Maria

Re: routing decision for subnet ID

... and in Italian they say it's arabic ...

Re: routing decision for subnet ID

It's fun to see that besides the international perspective on networking technologies (stole this from Paolo's interview), this forum can offer international perspective in general :-)

Hall of Fame Super Gold

Re: routing decision for subnet ID

That is the internet documents and heaven bless them. But the documents say to not assigning addresses with all zero or ones, not how to route them. This is left to "implementation" in typical early internet fashion.

So, not to fault anybody, the router will happily forward anything falling into 10.10.10/128 to whatever route is has for that.

On interfaces that have L2 addresses (ethernet), a broadcast L2 address will be used. Interfaces without L2 addressing, like serial or anything p-t-p will just forward and that be it.

That's why when you are curious to know what's on a lan segment, you can ping the broadcast address from a router (requires enable mode). You can also ping the directed broadcast address, in either all zeros or all one format, same result, ping is sent and routers and certain other devices will reply.

Why the router does like that, hmm I leave the answer for a next time.

Re: routing decision for subnet ID

Paolo,

Now that you say this I recall of reading something about such implementation dependent issues in early implementations. Please tell us the why when you have the time. We have both mentioned the ping behavior on local segment. But does the router actually forward such packets ?

Kind Regards,

Maria

p.s. Don't worry about faulting me. I can handle being corrected by anyone that has more knowledge on something and sure thing by you guys.

Hall of Fame Super Gold

Re: routing decision for subnet ID

Ok since the guy that is supposed to ride me home is fighting ios zone firewall, here's one reason why the router forwards directed brodcasts in either all zero or all ones form.

The are some applications (like old ms network browsing) that are based on broadcast. That is, each computer must see other's bcast. But routers don't forward bcast, we all know that.

So what's the solution when you have wan links in between? bridging maybe ? Noooo says cisco (in 1985 or so), the solution is "ip helper address". What it does ? It takes bcast packets (default list is limited to certain udp ports, but you can change it), translates them to an address that you define, and forward them.

So let's say you have two lan segments, 10.0.0.0/24 and 10.0.1.0/24 and you want the old ms network browsing to work. What you do, on each lan interface you configure "ip helper-address" with the directed brodcast address of the other segment, local router will change destination address and forward, remote router will forward destination unchanged, as an ethernet broadcast and everyone is happy.

More modestly, network guys do use the feature to boot routers from a remote tftp address of which they don't even know the exact address, as requests for tftp 255.255.255.255 are perfectly served by the feature.

All is good so far, but someone can have multiple lans and wants the broadcasts to be replicated to reach anywhere in the network.

Good says cisco, just configure multiple ip helper-address and router will duplicate packets and forward to multiple destinations.

Ohh but that can lead to packet storms, can say any smart guy, I mean how routers that receive direct broadcasts can know if or not to copy and forward them.

Well believe it or not, cisco invented (not sure when, but predates me, and I'm old) something called turbo broadcast flooding. It uses a modified spanning-tree protocol to decide the shortest and unique path between broadcast emitter and destination.

I've never meet anybody that uses it, but if I do, I would invite the guy for a beer or two, that's for sure.

Re: routing decision for subnet ID

Paolo,

I am more curious about the reason for allowing the broadcast in all zero form. I suspect it has to do with old applications that (due to the lack of explicit guidance from standards that you mentioned earlier) decided to use the zero form to initiate those broadcasts (so routers had to also cope with that), but I am only 30 and cannot know for sure :-)

Kind Regards,

Maria

Hall of Fame Super Gold

Re: routing decision for subnet ID

Well, a router can know if to use an all zero or all ones directed broadcast for local segments, as there is a command to tell it about. But a for remote subnets, it can't know what is used for each of them, in theory it could be different, so the only logical choice is to forward anything. Side effect, that makes the algorithm even faster and simple, as there are no additional checks after the longest match search.

That has worked well for 2/3 of your life Maria!

As always I thank you vm much for the appreciation!

Re: routing decision for subnet ID

LOL Paolo!

New Member

Re: routing decision for subnet ID

Thanks Maria and Paolo, Its been a nice healthy conversation, and now I want to share what I got from ethereal places on the 10.10.10.128/28 subnet.

I ping from another interface of Router to 10.10.10.128, I see the ping packet on ethereal and with Layer 3 address 10.10.10.128 and MAC address with all Fs.

so this I suppose a normal behaviour of all the routers ?

Re: routing decision for subnet ID

Hello,

According to the analysis from Paolo it is a behavior that can be expected to occur. Yet it is not very consistent. In the test I did from a Windows machine, Windows ping said that the destination is invalid. I would not count on such implementation dependent features.

Kind Regards,

Maria

Hall of Fame Super Gold

Re: routing decision for subnet ID

Maria, remember we're talking about routers that are routers, not pc's that are hosts :)

In particular consider that windows like any modern host, uses all ones in the host portion for directed bcast, if you ping that address, it will.

Re: routing decision for subnet ID

Paolo, remember that Cisco routers are not the only routers, although there are a lot of them out there :-)

Anyway, I never said that a directed broadcast is impossible. I only doubt specifically the all zeros option being available everywhere.

Kind Regards,

Maria

187
Views
25
Helpful
15
Replies