OSPF: Difference between revisions

Content added Content deleted
Line 561: Line 561:
= Concept Recap =
= Concept Recap =


Protocol Number = 89, TTL=1, DES IP = 224.0.0.5 & 6
<pre>
'''Network Types:'''
Protocol Number = 89, TTL=1, DES IP = 224.0.0.5 & 6
Network Types:
PTP:
No DR, BDR and ospf packets are sent to MC address.
PTP:
Broadcast: (ethernet, token ring, FDDI)
No DR, BDR and ospf packets are sent to MC address.
DR, BDR election occurs and communicates using .5 and .6 address.
Broadcast: (ethernet, token ring, FDDI)
DR, BDR election occurs and communicates using .5 and .6 address.
DR and BDR listen to .5 and .6 addresses.
NBMA network: (Frame relay, ATM)
DR and BDR listen to .5 and .6 addresses.
NBMA network: (Frame relay, ATM)
Manual configuration of neighbors and DR/BDR.
All communication via unicast
Manual configuration of neighbors and DR/BDR.
Point to multipoint:
All communication via unicast
No DR and BDR. Neighbor statement not necessary.
Point to multipoint:
Unicast
No DR and BDR. Neighbor statement not necessary.
Virtual link:
Unicast
Virtual link:
Packets are unicast.
'''OSPF packet types:'''
Packets are unicast.
OSPF packet types:
Hello type 1
Hello – type 1
Database description – type 2
Database description – type 2
LS request – type 3
LS request – type 3
LS update – type 4
LS update – type 4
LS ACK – type 5
To bring neighborship up, following fields should be matched:
LS ACK – type 5
Hello interval, Dead interval, area ID, network mask, option fields and authentication, if any
To bring neighborship up, following fields should be matched:
Neighborship will not form via secondary address. Other words, router will not generate hello packet with SRC IP = secondary IP.
Hello interval, Dead interval, area ID, network mask, option fields and authentication, if any
'''DR/BDR election:'''
Neighborship will not form via secondary address. Other words, router will not generate hello packet with SRC IP = secondary IP.
DR/BDR election:
Highest Priority
Tie, highest router ID
Highest Priority
Tie, highest router ID
Tie, highest interface address.
No preempt. So, first come will elect as DR, BDR, DRother. So, always start the router which has to be DR and then BDR and then other routers.
Tie, highest interface address.
Priority=0 means ineligible to become DR/BDR.
No preempt. So, first come will elect as DR, BDR, DRother. So, always start the router which has to be DR and then BDR and then other routers.
When interface comes up, it sets DR,BDR to 0.0.0.0 and wait for ‘wait timer’= router dead interval. Within that period, if it receives hello with DR/BDR filled, accept those. Else if the time period elapse, move to BDR and then to DR.
Priority=0 means ineligible to become DR/BDR.
'''Timers:'''
When interface comes up, it sets DR,BDR to 0.0.0.0 and wait for ‘wait timer’= router dead interval. Within that period, if it receives hello with DR/BDR filled, accept those. Else if the time period elapse, move to BDR and then to DR.
Default H=10 sec and D= 40 sec
Timers:
InfTransDelay = 1 sec. change by “ip ospf transmit-delay’
Default H=10 sec and D= 40 sec
InfTransDelay = 1 sec. change by “ip ospf transmit-delay’
RxmtInterval = 5 sec. Change by “ip ospf retramit-delay’
'''Neighbor state machine:'''
RxmtInterval = 5 sec. Change by “ip ospf retramit-delay’
Neighbor state machine:
Down: at initial
Attempt: Only in NBMA
Down: at initial
Init: Hello packet received. But couldn’t see our ID in its active neighbor list.
Attempt: Only in NBMA
Init: Hello packet received. But couldn’t see our ID in its active neighbor list.
2-way:Could see our ID in neighbor list
Exstart: Start electing master/slave to exchange DBD packets. Highest router ID becomes master.
2-way:Could see our ID in neighbor list
Exstart: Start electing master/slave to exchange DBD packets. Highest router ID becomes master.
Exchange: exchange the LSA headers using DBD packets.
Loading: Syn the LSD using LS request and LS update. In real scenario, both Exchange and loading occurs parallel.
Exchange: exchange the LSA headers using DBD packets.
Full: Database was sync-ed.
Loading: Syn the LSD using LS request and LS update. In real scenario, both Exchange and loading occurs parallel.
'''DBD packet:'''
Full: Database was sync-ed.
Have Interface MTU settings.
DBD packet:
Initial(I) bit, More (M) bit and Master/Slave (MS) bit
Have Interface MTU settings.
Initial(I) bit, More (M) bit and Master/Slave (MS) bit
First DBD packet sent with I/M/MS = 1/1/1 with seq =x
First DBD packet sent with I/M/MS = 1/1/1 with seq =x
Neighbor sends DBD with I/M/MS = 1/1/1 with seq = y
Neighbor sends DBD with I/M/MS = 1/1/1 with seq = y
After master selection, slave send DBD with I/M/MS = 0/1/0 with seq = master seq + 1.
Retransmission packets are always unicast.
After master selection, slave send DBD with I/M/MS = 0/1/0 with seq = master seq + 1.
Use stub concept and summarization to reduce memory and CPU utilization.
Retransmission packets are always unicast.
'''Sequence number, checksum and age uniquely defines as LSA:'''
Use stub concept and summarization to reduce memory and CPU utilization.
Seq #:
Sequence number, checksum and age uniquely defines as LSA:
Seq #:
From 0×80000001 to 0x7fffffff
If the seq# reaches 0x7ffffff, router flushes those LSA with age = MAXage.
From 0×80000001 to 0x7fffffff
Checksum:
If the seq# reaches 0x7ffffff, router flushes those LSA with age = MAXage.
Calculated entire LSA except age field.
Checksum:
Calculated entire LSA except age field.
Checksum is verified every 5 mins as it resides in LSD.
Age:
Checksum is verified every 5 mins as it resides in LSD.
Age:
0 to 3600 (1 Hr-MaxAge)
Age increments when it resides in LSA and also incremented by ‘Infdelay’ value as it transits an interface.
0 to 3600 (1 Hr-MaxAge)
'''Virtual Links:'''
Age increments when it resides in LSA and also incremented by ‘Infdelay’ value as it transits an interface.
Must be configured between 2 ABRs alone.
Virtual Links:
Transit area must have full routing information.
Must be configured between 2 ABRs alone.
Transit area must have full routing information.
Transit area cannot be stub.
Transit area cannot be stub.
Usually it is the worst design and needs to be changed.
Can temporarily deploy to avoid partitioned area.
Usually it is the worst design and needs to be changed.
'''LSA types:'''
Can temporarily deploy to avoid partitioned area.
LSA types:
Router LSA:
Type-1. Generated by all routers with all active networks which has ospf configured.
Router LSA:
Show ip ospf database router
Type-1. Generated by all routers with all active networks which has ospf configured.
Show ip ospf database router
LSAs are flooded within an area only.
LSAs are flooded within an area only.
Above command should have same output in all routers in an area. Seq #,checksum etc should be same.
Network LSA:
Above command should have same output in all routers in an area. Seq #,checksum etc should be same.
Type-2: Generated by the DR with network ID of the BC network.
Network LSA:
Type-2: Generated by the DR with network ID of the BC network.
Show ip ospf database network
Show ip ospf database network
No metric field as in router LSA.
No metric field as in router LSA.
LSAs are flooded within an area only.
N/w summary LSA:
LSAs are flooded within an area only.
Type-3: Generated by ABR to advertise the networks in another area.
N/w summary LSA:
Type-3: Generated by ABR to advertise the networks in another area.
If there are multiple routes to a destination, ABR advertise only the lowest cost route to its area along with cost metric.
Means, intra area routers use distance-vector protocol to know about inter-area routes.
If there are multiple routes to a destination, ABR advertise only the lowest cost route to its area along with cost metric.
Show ip ospf database summary
Means, intra area routers use distance-vector protocol to know about inter-area routes.
ASBR summary LSA:
Show ip ospf database summary
ASBR summary LSA:
Type-4; Same as summary LSA except the destination advertised by ABR is ASBR.
Show ip ospf database asbr-summary
Type-4; Same as summary LSA except the destination advertised by ABR is ASBR.
AS external LSA:
Show ip ospf database asbr-summary
AS external LSA:
Type-5; Advertise routes external to OSPF domain.
Typically redistribution of RIP, ISIS etc
Type-5; Advertise routes external to OSPF domain.
Show ip ospf database external
Typically redistribution of RIP, ISIS etc
Not associated with any area.
Show ip ospf database external
Group-Membership LSA:
Not associated with any area.
Type-6; Used in MOSPF- multicast ospf
Group-Membership LSA:
NSSA external LSA:
Type-6; Used in MOSPF- multicast ospf
NSSA external LSA:
Type-7; originated by ASBR within NSSA
Show ip ospf database nssa-external
Type-7; originated by ASBR within NSSA
Flooded within NSSA region only.
Show ip ospf database nssa-external
Flooded within NSSA region only.
ASBR can set/reset “P-bit” under “options field” of every LSA.
Only if NSSA-ABR receives type-7 LSA with P-bit set, it will translate into type-5 LSA and flood to other areas.
ASBR can set/reset “P-bit” under “options field” of every LSA.
External Attribute LSA:
Only if NSSA-ABR receives type-7 LSA with P-bit set, it will translate into type-5 LSA and flood to other areas.
Type-8. Can be used as alternative to iBGP
External Attribute LSA:
Not deployed yet.
Type-8. Can be used as alternative to iBGP
Opaque LSA:
Not deployed yet.
Opaque LSA:
Type- 9,10,11
Type- 9,10,11
Extension to OSPF. Used for TE in MPLS.
'''Areas:'''
Extension to OSPF. Used for TE in MPLS.
Areas:
Backbone area:
Backbone area:
Area-0. Need for inter-area communication.
Area-0. Need for inter-area communication.
If there is only one area, no need for area-0
If there is only one area, no need for area-0
All types of LSAs except type-7 can be seen.
Stub area:
All types of LSAs except type-7 can be seen.
Single exist point for inter-area communication. But still can have more than one ABR.
Stub area:
Single exist point for inter-area communication. But still can have more than one ABR.
Have info about OSPF domain areas. Both intra and inter-area routes.
Have info about OSPF domain areas. Both intra and inter-area routes.
No info about external (other domain) routes. Hence, ABR sends a default route.
Type-1,2 and 3 LSAs can be seen.
No info about external (other domain) routes. Hence, ABR sends a default route.
Type-1,2 and 3 LSAs can be seen.
All the routers should have “E-bit” set to 0 in their hello packets to form adjacency.
Command: “area x stub”
All the routers should have “E-bit” set to 0 in their hello packets to form adjacency.
Totally stubby area:
Command: “area x stub”
Router has info about its area alone. No info about inter-area routes.
Totally stubby area:
Can see type-1, type-2 LSAs and single default route type-3 LSA by ABR.
Router has info about its area alone. No info about inter-area routes.
Command: ‘area x stub no-summary’
Can see type-1, type-2 LSAs and single default route type-3 LSA by ABR.
NSSA:
Command: ‘area x stub no-summary’
Same property as stub area (not totally-stub area) with exception of allowing other domain routes as Lype-7 LSA.
NSSA:
No default route from ABR. (unless ‘default-info originate’ CLI configured where N2 default route (or) ‘area x nssa no-summary’ configured. In later, IA routes will not be available and default route has IA tag)
Same property as stub area (not totally-stub area) with exception of allowing other domain routes as Lype-7 LSA.
Can see Type-1,2,3,4 and type-7 LSAs.
No default route from ABR. (unless ‘default-info originate’ CLI configured where N2 default route (or) ‘area x nssa no-summary’ configured. In later, IA routes will not be available and default route has IA tag)
Command: ‘area x nssa’.
Can see Type-1,2,3,4 and type-7 LSAs.
'''Path types:'''
Command: ‘area x nssa’.
Path types:
Intra-area paths
Inter-area paths. Denoted by “IA” in show ip route.
Intra-area paths
E1:
Inter-area paths. Denoted by “IA” in show ip route.
Cost = advertised by ASBR + cost to ASBR
E1:
E2:
Cost = advertised by ASBR + cost to ASBR
Cost = advertised by ASBR. Enabled by default.
E2:
Cost = advertised by ASBR. Enabled by default.
If there is only one ASBR in OSPF, there is no necessity of adding cost to ASBR. Hence E2 is default.
If there is only one ASBR in OSPF, there is no necessity of adding cost to ASBR. Hence E2 is default.
If there are more than on ASBR, enable E1.
'''Authentication:'''
If there are more than on ASBR, enable E1.
No authentication: Type-0
Simple password: Type-1
MD5 password: Type-2
'''Few points:'''
Router LSA of ABR will have “B-bit” set in router-lsa packet
Router LSA of ASBR will have “E-bit” set in router-lsa packet
When NSSA ABR, translates type-7 LSA to type-5 LSA, it advertise with “Advertising Router” field set to its own router ID and it changes to ASBR. It could be confirmed by seeing “E” bit set in router LSA packet.
“Options field” in OSPF hello, DBD and every LSA: From MSB
DN – used in MPLS VPN. To detect loop.
O- Set to indicate routers’ opaque LSA support.
DC- OSPF over Demand circuit.
EA – external attribute support
N/P bit
N bit in hello: Set to indicate support for NSSA external LSAs. Mismatch will not bring adjacency
P-bit in NSSA external LSA header: to inform ABR to translate T-7 to T-5 LSAs.
MC – set to indicate multicast ospf capability
E – E bit=0 to indicate stub area.
MT – set to indicate Multi-topology OSPF support. Under development.
'''Troubleshooting point of view:'''
Neighborship not coming UP:
Check for Hello packet parameter match
Network ID in correct area??
Access-list blocking OSPF packets??
Packet dropped on the way to CP incase if interface multicast count is incrementing??
Check Stub-area configuration?? Virtual link via stub area??
Neighborship UP but no advertised routes in database:
Enable debug and check for LSupdate packets.
Routes in OSPF database but not in routing table:
Routes via another protocol which has AD less than OSPFs??
One end of router has “ip ospf network PTP’ whereas other end router has default BC network type.
In case of external routes not installed in routing table, check whether the forwarding address is reachable. If not, configure ‘suppress-fa’ option at the NSSA ABR.
If an LSA has less age or high sequence number among others, we need to look for why this network was keep flapping and flooding updates. Might be reason for high CPU utilization.
'''Observations:'''
ABR with area-1 and area-2 only:
Routes from area-1 are not leaked into area-2 using type-3 network summary LSA.
Authentication:
Authentication:
Configure ‘ip ospf authentication’ to change to type-1. No user-defined password possible.
No authentication: Type-0
For loopback IP to become router-id either remove and reapply the ospf configuration or configure ‘router-id’ command.
Simple password: Type-1
DBD packet can have multiple LSA headers each can be of different type.(T1/T2)
MD5 password: Type-2
When we change the network type to ‘point-point’, the interface will send a hello with DR,BDR =0 and no neighbor IDs in active neighbor field. This makes other end router to move to init.
Few points:
In BC network: DBD, LS request and LS updates are exchanged via unicast. LS update (repeat) and LS ACK are sent to 224.0.0.5
Router LSA of ABR will have “B-bit” set in router-lsa packet
In PTP, all communications via 224.0.0.5
Router LSA of ASBR will have “E-bit” set in router-lsa packet
Changing hello packet parameters (hello interval, dead interval etc) on one end makes the other end router to ignore those hello packets which has modified parameters.
When NSSA ABR, translates type-7 LSA to type-5 LSA, it advertise with “Advertising Router” field set to its own router ID and it changes to ASBR. It could be confirmed by seeing “E” bit set in router LSA packet.
Both side of router configured with priority =0 with default n/w type, they will stuck in 2way/DRother.
“Options field” in OSPF hello, DBD and every LSA: From MSB
In an already existing stub network, if we change to totally stub, border router send an update with IA routes’ age= 3600 for flushing from database. Same as in ‘clear ip ospf process’
DN – used in MPLS VPN. To detect loop.
Redistributing RIP to ospf in a router which is inside a stub network:
O- Set to indicate routers’ opaque LSA support.
“%OSPF-4-ASBR_WITHOUT_VALID_AREA: Router is currently an ASBR while having only one area which is a stub area”
DC- OSPF over Demand circuit.
EA – external attribute support
Summarization has no effect of external routes (E1/E2).
N/P bit
N bit in hello: Set to indicate support for NSSA external LSAs. Mismatch will not bring adjacency
P-bit in NSSA external LSA header: to inform ABR to translate T-7 to T-5 LSAs.
MC – set to indicate multicast ospf capability
E – E bit=0 to indicate stub area.
MT – set to indicate Multi-topology OSPF support. Under development.
Troubleshooting point of view: few
Neighborship not coming UP:
Check for Hello packet parameter match
Network ID in correct area??
Access-list blocking OSPF packets??
Packet dropped on the way to CP incase if interface multicast count is incrementing??
Check Stub-area configuration?? Virtual link via stub area??
Neighborship UP but no advertised routes in database:
Enable debug and check for LSupdate packets.
Routes in OSPF database but not in routing table:
Routes via another protocol which has AD less than OSPFs??
One end of router has “ip ospf network PTP’ whereas other end router has default BC network type.
In case of external routes not installed in routing table, check whether the forwarding address is reachable. If not, configure ‘suppress-fa’ option at the NSSA ABR.
If an LSA has less age or high sequence number among others, we need to look for why this network was keep flapping and flooding updates. Might be reason for high CPU utilization.
Observations:
ABR with area-1 and area-2 only.
Routes from area-1 are not leaked into area-2 using type-3 network summary LSA.
Authentication:
Configure ‘ip ospf authentication’ to change to type-1. No user-defined password possible.
For loopback IP to become router-id either remove and reapply the ospf configuration or configure ‘router-id’ command.
DBD packet can have multiple LSA headers each can be of different type.(T1/T2)
When we change the network type to ‘point-point’, the interface will send a hello with DR,BDR =0 and no neighbor IDs in active neighbor field. This makes other end router to move to init.
In BC network: DBD, LS request and LS updates are exchanged via unicast. LS update (repeat) and LS ACK are sent to 224.0.0.5
In PTP, all communications via 224.0.0.5
Changing hello packet parameters (hello interval, dead interval etc) on one end makes the other end router to ignore those hello packets which has modified parameters.
Both side of router configured with priority =0 with default n/w type, they will stuck in 2way/DRother.
In an already existing stub network, if we change to totally stub, border router send an update with IA routes’ age= 3600 for flushing from database. Same as in ‘clear ip ospf process’
Redistributing RIP to ospf in a router which is inside a stub network:
“%OSPF-4-ASBR_WITHOUT_VALID_AREA: Router is currently an ASBR while having only one area which is a stub area”
Summarization has no effect of external routes (E1/E2).
</pre>


=LAB=
=LAB=