Wednesday, February 4, 2009

Overlapping/Duplicate AS-External-LSA IDs

I was reading OSPF: Anatomy of an Internet Routing Protocol by John T. Moy today and I came across an issue with AS-external LSA Link-State IDs. The LSA uses the network address as the identifier. If one router was to generate multiple Type 5 LSA's with the same network number but different masks, only 1 would be advertised because the LSA ID would be the same.

The book was published in 1998 and at the time there was no way of dealing with this. After doing this lab, I realized there was a way and it had since been documented in Appendix E of RFC 2328:

RFC 2328 Appendix E

Here I create 3 static routes, that all end up with the same network number and would normally have the same LSA ID:

R1(config)#ip route 192.9.0.0 255.255.0.0 Null0
R1(config)#ip route 192.9.0.0 255.255.254.0 Null0
R1(config)#ip route 192.9.0.0 255.255.255.0 Null0
R1(config)#router ospf 1
R1(config-router)#redistribute static subnets

Let's see what the LSA IDs are:

R1#sho ip osp database | inc 192.9
192.9.0.0 1.1.1.1 246 0x80000001 0x00933F 0
192.9.0.255 1.1.1.1 149 0x80000001 0x00933F 0
192.9.1.255 1.1.1.1 234 0x80000001 0x00834F 0
R1#

R1#sho ip ospf database external 192.9.0.0

OSPF Router with ID (1.1.1.1) (Process ID 1)

Type-5 AS External Link States

LS age: 14
Options: (No TOS-capability, DC)
LS Type: AS External Link
Link State ID: 192.9.0.0 (External Network Number )
Advertising Router: 1.1.1.1
LS Seq Number: 80000003
Checksum: 0x8F41
Length: 36
Network Mask: /16
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 20
Forward Address: 0.0.0.0
External Route Tag: 0

The router gives the last 2 networks the broadcast address of that respective network as the Link State ID. The /16 network got the network address as the ID. I wonder if order of operations has anything to do with it

R1(config)#no ip route 192.9.0.0 255.255.0.0 Null0
R1(config)#no ip route 192.9.0.0 255.255.254.0 Null0
R1(config)#no ip route 192.9.0.0 255.255.255.0 Null0
R1(config)#ip route 192.9.0.0 255.255.255.0 Null0

Ok, so now the /24 is the only in there and it is using 192.9.0.0 as its ID:

R1#sho ip osp database external 192.9.0.0

OSPF Router with ID (1.1.1.1) (Process ID 1)

Type-5 AS External Link States

LS age: 36
Options: (No TOS-capability, DC)
LS Type: AS External Link
Link State ID: 192.9.0.0 (External Network Number )
Advertising Router: 1.1.1.1
LS Seq Number: 80000001
Checksum: 0x933F
Length: 36
Network Mask: /24
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 20
Forward Address: 0.0.0.0
External Route Tag: 0

What happens if we add a /16 now?

R1(config)#ip route 192.9.0.0 255.255.0.0 Null0

R1#sho ip osp database external 192.9.0.0

OSPF Router with ID (1.1.1.1) (Process ID 1)

Type-5 AS External Link States

LS age: 12
Options: (No TOS-capability, DC)
LS Type: AS External Link
Link State ID: 192.9.0.0 (External Network Number )
Advertising Router: 1.1.1.1
LS Seq Number: 80000002
Checksum: 0x9140
Length: 36
Network Mask: /16
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 20
Forward Address: 0.0.0.0
External Route Tag: 0

R1#

The /16 stold the ID from the /24!

R1#sho ip osp database | inc 192.9
192.9.0.0 1.1.1.1 45 0x80000002 0x009140 0
192.9.0.255 1.1.1.1 45 0x80000001 0x00933F 0

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.