OSPF NSSA Forward Address Selection Process
Now I don’t know about you guys, but it’s the little things that bother me at times.
Well the big things bother me more, but let’s move on
Consider the following topology:
R2 F1/0 & F1/1 are in Area 0.
R4 F1/1 & F1/0 are in Area 0.
R2 F2/0 is in Area 1.
R3 F1/0 & F1/1 are in Area 1.
R4 F2/0 is in Area 1.
- Loopback1 30.30.30.30 YES manual up up
- router ospf 100
router-id 3.3.3.3
area 1 nssa
redistribute connected subnets
- R3#sh ip o d nssa-external 30.30.30.30 | i Forward
Forward Address: 10.1.34.3
In the case of R3, the loopback address 30.30.30.30 is NOT running OSPF:
- R3#sh ip o int b
Interface PID Area IP Address/Mask Cost State Nbrs F/C
Fa1/1 100 1 10.1.34.3/24 1 BDR 1/1
Fa1/0 100 1 10.1.23.3/24 1 DR 1/1
So its clear that something is going on here…
RFC 3101 (The OSPF Not-So-Stubby Area (NSSA) Option) states:
- If the P-bit is set, the forwarding address must be non-zero; otherwise it may be 0.0.0.0. If an NSSA requires the P-bit be set and a non-zero forwarding address is unavailable, then the route’s Type-7 LSA is not originated into this NSSA. When a router is forced to pick a forwarding address for a Type-7 LSA, preference should be given first to the router’s internal addresses (provided internal addressing is supported). If internal addresses are not available, preference should be given to the router’s active OSPF stub network addresses. These choices avoid the possible extra hop that may happen when a transit network’s address is used. When the interface whose IP address is the LSA’s forwarding address transitions to a Down state (see [OSPF] Section 9.3), the router must select a new forwarding address for the LSA and then re-originate it. If one is not available the LSA should be flushed.
Now by default whenever an NSSA ASBR originates a Type 7 NSSA External LSA, it sets the P-bit (propagate-bit) to 1, to indicate that the NSSA ABR receiving this Type 7 LSA should perform a 7-5 translation & advertise a Type 5 LSA for the external into the backbone.
So…as R3 sets the P-bit to 1 by default, this means R3 MUST set the forward address to a non zero value.
Question is, WHAT IP is R3 to choose?!
Well from the RFC & some testing, the order goes:
- Highest Loopback IP on the NSSA ASBR (that is running OSPF, and is in the NSSA area)
- Else, Highest Non Loopback IP on the NSSA ASBR (that is running OSPF, and is in the NSSA area)
To prove the above, lets check what the current forward address is again:
- R3#sh ip o d nssa-external 30.30.30.30 | i Forward
Forward Address: 10.1.34.3
Checking the active interfaces in the NSSA area, we see that 10.1.34.3 is indeed the highest IP currently:
- R3#sh ip o int b
Interface PID Area IP Address/Mask Cost State Nbrs F/C
Fa1/1 100 1 10.1.34.3/24 1 BDR 1/1
Fa1/0 100 1 10.1.23.3/24 1 DR 1/1
Lets add a Loopback IP into the mix and add it to the NSSA area 1:
- R3(config)#int lo100
R3(config-if)#ip add 100.100.100.100 255.255.255.255
R3(config-if)#router ospf 100
R3(config-router)#net 100.100.100.100 0.0.0.0 area 1
Now lets check whether the forward address has changed:
- R3#sh ip o d nssa-external 30.30.30.30 | i Forward
Forward Address: 100.100.100.100
Yep, as expected ![]()
Let’s remove the network statement for 100.100.100.100 & see what happens.
- R3(config)#router ospf 100
R3(config-router)#no net 100.100.100.100 0.0.0.0 area 1
R3#sh ip o d nssa-external 30.30.30.30 | i Forward
Forward Address: 10.1.34.3
OK, so this proves that even if the IP address of an interface is higher than the IP of the current forward address, that IP must be in the NSSA area.
Adding 100.100.100.100/32 back to NSSA 1:
- R3(config)#router ospf 100
R3(config-router)#net 100.100.100.100 0.0.0.0 area 1
100.100.100.100 is back as the forward address:
- R3#sh ip o d nssa-external 30.30.30.30 | i Forward
Forward Address: 100.100.100.100
Now lets create another loopback interface & add it to area 1:
- R3(config)#int lo200
R3(config-if)#ip add 200.200.200.200 255.255.255.255
R3(config-if)#router ospf 100
R3(config-router)#net 200.200.200.200 0.0.0.0 area 1
Any change to the forward address? Yep as expected
- R3#sh ip o d nssa-external 30.30.30.30 | i Forward
Forward Address: 200.200.200.200
One LASt thing…in the above cases we used loopback ips that were HIGHER than 10.1.34.3.
What if we add a loopback ip that is smaller then 10.1.34.3?
Removed the network statements for the above loopbacks so that 10.1.34.3 is once more the forward address:
- R3#sh ip o d nssa-external 30.30.30.30 | i Forward
Forward Address: 10.1.34.3
Ok, cool, NOW lets add a loopback ip 3.1.1.1:
- R3(config)#int lo2
R3(config-if)#ip add 3.1.1.1 255.255.255.255
R3(config)#router ospf 100
R3(config-router)#net 3.1.1.1 0.0.0.0 area 1
What do we see?
- R3#sh ip o d nssa-external 30.30.30.30 | i Forward
Forward Address: 3.1.1.1
Yep the SMALLER ip, even though its a loopback, wins!
So to reiterate the rules its:
- Highest loopback IP in the NSSA area
- If no loopback interface in NSSA area, choose highest physical interface IP in the NSSA area
Finally a few more things to be aware of.
Note above in our topology diagram that we have TWO NSSA ABRs, R2 & R4.
Question is, as R2 & R4 will BOTH receive the Type 7 LSA for Link State ID 30.30.30.30, do BOTH routers translate the Type 7 into a Type 5 or just one of the ABRs. If one ABR is responsible, then which ABR is reponsible for injecting the Type 5 LSA for 30.30.30.30 into the normal areas?
Well the rule is:
The Type 7 LSA has a bit (called Bit P, P = Propagate) which is used in order to tell the NSSA ABR whether to translate type 7 into type 5:
- No Type 7/5 translation means bit P = 0
- Type 7/5 translation means bit P = 1
- If there are multiple NSSA ABRs with bit P = 1, then the router with the HIGHEST Router-ID ONLY is responsible for translating the Type 7 into Type 5.
- R1#sh ip o d ext 30.30.30.30
OSPF Router with ID (1.1.1.1) (Process ID 100)
Type-5 AS External Link States
Routing Bit Set on this LSA
LS age: 1257
Options: (No TOS-capability, DC)
LS Type: AS External Link
Link State ID: 30.30.30.30 (External Network Number )
Advertising Router: 4.4.4.4
LS Seq Number: 80000035
Checksum: 0xE5F7
Length: 36
Network Mask: /32
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 20
Forward Address: 3.1.1.1
External Route Tag: 0
Comments(6)