secrets of IRDP

From: Ahmed Mamoor Amimi (mamoor@ieee.org)
Date: Mon Oct 21 2002 - 09:18:41 GMT-3


I was confused why the lower priorty irdp is the preffered. like this :

Rack03r3#sh ip route
Gateway Using Interval Priority Interface
192.168.1.2 IRDP 5 1 Ethernet0
192.168.1.1 IRDP 5 2 Ethernet0

Default gateway is 192.168.1.2

Here is the theory behind.

Consider a scenrio :

r1---------------------------r2
                 |
               r3 (no ip routing)

r1:
e0
ip irdp
ip irdp preference 2

r2:
e0
ip irdp
ip irdp preference 1

As per the Doc CD and RFC the highest value is preffered , i got the
following result at r3 :

Rack03r3#sh ip route
Gateway Using Interval Priority Interface
192.168.1.2 IRDP 5 1 Ethernet0
192.168.1.1 IRDP 5 2 Ethernet0

Default gateway is 192.168.1.2

And by seeing this it shows that lower value is preferred............ this
is not lower value actaully IRDP dont calculate in decimal normally it makes
these values in twos complement and twos complement says "convert the value
in binary theninvert the value then add one to it and then convert back to
decimal.
So When r3 will recieve packets from r1 and r2 for the irdp default-gateway
then it will do as follows

R1 - preference = 1 = 01 <--- in binary
R2 - preference = 2 = 10 <--- in binary

NOW invert :
R1 - preference = 1 = 10 <--- in binary
R2 - preference = 2 = 01 <--- in binary

NOW add one :
R1 - preference = 1 = 11 <--- in binary
R2 - preference = 2 = 10 <--- in binary

Convert back to decimal

R1 - preference = 1 = 3 (new value)
R2 - preference = 2 = 2 (new value)

New values are not visible on the show commands but they are calcualed from
TWOs complement formula.

REFERENCES :

http://www.ietf.org/rfc/rfc1256.txt?number=1256
      Preference Level[i], The preferability of each Router Address[i]
       i = 1..Num Addrs as a default router address, relative to
                            other router addresses on the same subnet.
                            A signed, twos-complement value; higher
                            values mean more preferable.

http://www.vb-helper.com/tutorial_twos_complement.html#TwosComplement

For a concrete example, consider the value 17 which is 00010001 in binary.
Inverting gives 11101110. Adding one makes this 11101111. This is the twos
complement representation of -17. Don't worry if you can't see this
intuitively. You really need to take the twos complement again to see what
value this is. Inverting the bits gives 00010000. Adding 1 gives 00010001,
the representation for 17. All this shows that -(-17) = 17.

http://127.0.0.1:8080/cc/td/doc/product/software/ios121/121cgcr/ip_r/iprprt1
/1rdipadr.htm#xtocid1783326

preference number(Optional) Preference value. The allowed range is -231 to
231. The default is 0. A higher value increases the router's preference
level. You can modify a particular router so that it will be the preferred
router to which others home.

-Mamoor



This archive was generated by hypermail 2.1.4 : Tue Nov 05 2002 - 08:35:52 GMT-3