How is routing table order specified by the TCP/IP protocols and can this order be exploited for routing?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have noted that the routing table in Linux is orderly by the length of the
netid given in the NETMASK.
Is this merely fortuitous or do the TCP/IP protocols state that networks
with a bigger netid must match before than networks with a smaller netid
Since the addressing scheme allows having networks like the following:
128.0.192.0/18
128.0.0.0/16
the order in which these entries appear in the routing table matters because
the computers in the network 128.0.192.0/18 match both entries.
#BEGIN TRICKY
It could be used to have various subnets (like is 128.0.192.0/18 in this
case) and a default network to which deliver the remaining datagrams,
though computer hosts 128.0.0.0 through 128.0.191.255 would need
to add entries in their routing tables to contemplate the other subnets
(128.0.192.0 through 128.0.255.255 hosts network in this case) and for
not to deliver datagrams in the 128.0.0.0 through 128.0.191.255
network to the gateway, since they are not for those subnets.

#END TRICKY
The main questions are:
First:
Is the order in the Linux routing table on purpouse?
Is it a TCP/IP specification?
This feature (the order in the routing table) would be innecessary if
subnetting was done in an uniform way: network addresses do not
match several entries in a routing table.
Second:
Is it common practice to exploit this feature as shown in the above
subnetting example or it should be avoided?
TIA
Zacarias


-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux