routing decision for subnet ID

Unanswered Question
Mar 25th, 2008

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 is directly connected, Serial0/1

S to

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

thanks in advance

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (5 ratings)
marikakis Tue, 03/25/2008 - 10:58


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,


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 :-)

Richard Burts Tue, 03/25/2008 - 12:45


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.



marikakis Tue, 03/25/2008 - 13:09


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,


marikakis Tue, 03/25/2008 - 14:24

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 :-)

Paolo Bevilacqua Tue, 03/25/2008 - 12:57

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.

marikakis Tue, 03/25/2008 - 13:17


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,


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.

Paolo Bevilacqua Tue, 03/25/2008 - 13:44

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, and 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 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.

marikakis Tue, 03/25/2008 - 14:13


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,


Paolo Bevilacqua Tue, 03/25/2008 - 14:43

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!

syedumairali Thu, 03/27/2008 - 02:52

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

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

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

marikakis Fri, 03/28/2008 - 06:56


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,


Paolo Bevilacqua Fri, 03/28/2008 - 07:10

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.

marikakis Fri, 03/28/2008 - 07:25

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,



This Discussion