OSPF

Revision as of 07:43, 26 January 2016 by m>Amandeep (→‎Neighbor Stateswww.3i-infotech.com: table)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Introduction

  • Attributes:
Type Link-State
Algorithm Dijkstra
Metric Cost (Bandwidth)
AD 110
Standard RFC 2328, RFC 2740
Protocols IP
Transport IP/89
Authentication Plaintext, MD5
AllSPF Address 224.0.0.5
AllDR Address 224.0.0.6
  • OSPF Hello Packet has TTL=1. It cannot cross a hop.[1]
  • Change AD in OSPF:
#router ospf 1
#distance 250 		   (useful in Protocol Migration)
#distance 255              (invalid; do not use these routes)
  • Various Packet types in OSPF:
Type Packet Name Description
1 Hello Discovers Neighbors & builds adjacencies between them
2 Database Description(DBD) Checks for database sync between routers
3 Link-State request(LSR) Requests specific link-state records from other router
4 LSU Sends specifically requested link-state records
5 LSAck Acknowledges the other packet types
  • OSPF has 3 databases which are used to create 3 Tables:
Database Table Name Description
Adjacency Database Neighbor Table
  • List of all neighboring routers to which a router has established bidirectional Communication.
  • This table isunique for each router.
  • show ip ospf neighbor
Link-State Database Topology Table
  • List of information about all other routers in the networks.
  • Shows the Network Topology
  • All routers within an area have identical link-state databases.
  • show ip ospf database
Forwarding Database Routing Table
  • List of routes generated when SPF is generated on the Link-State Database.
  • Each router's routing table is unique.
  • show ip route
  • DR/BDR Election
The DR serves as a common point for all adjacencies on a multiaccess segment
The BDR also maintains adjacencies with all routers in case the DR fails
Election does not occur on point-to-point or multipoint links
Default priority (0-255) is 1
Highest priority wins
0 cannot be elected
In case of tie, Router with Highest Router ID wins election
DR preemption will not occur unless the current DR is reset
  • Virtual Links
Tunnel formed to join two areas across an intermediate
Both end routers must share a common area
At least one end must reside in area 0
Cannot traverse stub areas
area 2 virtual-link 10.0.34.2
  • Metric Formula
 

This can be modifiable with cmd:

ospf auto-cost reference-bandwidth
  • To change route cost in OSPF:
ip ospf cost
  • What is a Demand Circuit?
         This section is under construction.


Area Summary

  • Standard areas can contain LSAs of type 1, 2, 3, 4, and 5, and may contain an ASBR. The backbone is considered a standard area.
  • Stub areas can contain type 1, 2, and 3 LSAs. A default route is substituted for external routes.
  • Totally stubby areas can only contain type 1 and 2 LSAs, and a single type 3 LSA. The type 3 LSA describes a default route, substituted for all external and inter-area routes.
  • Not-so-stubby areas implement stub or totally stubby functionality yet contain an ASBR. Type 7 LSAs generated by the ASBR are converted to type 5 by ABRs to be flooded to the rest of the OSPF domain.


LSA

  • LSA Details:
LSA type Name Description
Type 1 Router LSAs Sent from a router to other routers in the same area. It contains information regarding the routers interfaces in the same area, relevant interfaces IPs, its adjacent routers on those interfaces and sub networks
Type 2 Network LSAs Represents the pseudonode (designated router) for a multiaccess link. Generated by the DR on a multi access segment, and provides similar information to an LSA type 1 for the multi access segment and subnet which it belongs
Type 3 Network Summary LSA Generated by ABRs and contain the subnets & costs but omit the topological data from all subnets in one area and sent to another area via the ABR
Type 4 ASBR summary LSA Represents ASBRs and are identical in structure to a type 3 LSA and sent when crossing an AS boundary
Type 5 AS external LSA Originated by ASBRs and describe a route external to the OSPF domain
Type 7 NSSA External LSA Used in stub areas in place of a type 5 LSA. Generated by the ASBR in an NSSA area
  • LSA as per Areas[2]:-
 


Adjacency

  • OSPF neighbor requirements:
  1. Router should be in same area
  2. Router should have same authentication config
  3. Router should be on same subnet
  4. Router have same hello/dead interval
  5. Router have matching stub flags


  • Difference between Adjacency & Neighbor:
  1. Only Adjacent Routers can sync Link State DB
  2. Point-to-Point Links: If Neighbors, Adjcency automatically established
  3. Broadcast Link: Adjacency established with DR & BDR only, rest are in 2-way state[3]
  4. Point-to-Multipoint:_________
  5. Neighbor means Physical Connectivity(Direct)
  6. Adjacency means Database Syncronization
  7. Neighbor Requirements:
    1. Hello exchange => Subnet Mask, Subnet Number, Hello/Dead Interval, Area ID, Authentication must match.
    2. Exchange hellos but not LSAs(2-Way State).
  8. Adjacency Requirements:
    1. Exchange LSAs
    2. Both routers are in Stable(Full) State.
  9. Still final LSDB is same even in Neighbors as well as Adjacent routers.


Neighbor States[4]

State Details
1. Down
  • OSPF process not yet started, No hellos sent.
  • Starting state for all OSPF routers.
  • A start event, such as configuring the protocol, transitions the router to the Init state.
  • The local router may list a neighbour in this state when no hello packets have been received within the specified router dead interval for that interface.
2. Attempt
  • Valid only for Non-Broadcast Multi-Access (NBMA) networks.
  • Similar to Down state, router is in the process of concerted efforts to establish a conversation with another router.
  • A hello packet has not been received from the neighbor and the local router is going to send a unicast hello packet to that neighbor within the specified hello interval period.
3. Init
  • Hello packets sent out from all interfaces, but two-way conversation is not established.
  • OR when an OSPF router receives a hello packet but the local router ID is not listed in the received Neighbour field.
  • This means that bidirectional communication has not been established between the peers.
4. 2-Way
  • Received a hello from another router that contains its own router ID in neighbor list.
  • Thus, bidirectional communication has been established and the peers are now OSPF neighbors.
  • Only Neighborship has been formed, databases haven’t been exchanged.
5. ExStart
  • Determine which router is in charge of the database synchronization process.
  • The higher router ID of the two neighbors controls which router becomes the master.
6. Exchange
  • The local router and its neighbor exchange DBD packets listing LSAs in their LS database by RID & sequence number that describe their local databases.
7. Loading
  • Each router compares the DBD received to the contents of its LS database.
  • It then sends a LSR for missing or outdated LSAs.
  • Each router responds to its neighbor's LSR with a LSU.
  • Each LSU is acknowledged.
8. Full
  • The LSDB of neighbors are fully synchronized.
  • It represents a fully functional OSPF adjacency.
  • Local router is having received a complete link-state database from its peer.
  • Both neighboring routers in this state add the adjacency to their local database and advertise the relationship in a link-state update packet.


LAB

Troubleshooting

  • If OSPF is stuck in INIT State, check Netmask, Hello/Dead Timer, Area ID, Authentication password.
  • On a shared/ethernet network, only 2 router, DR & BDR will form full relationship, all others will stay in 2-way state.[5]
  • If OSPF is stuck in ExStart State, MTU mismatch may be the cause, as it is requirement to successfully pass DBD Packets.

Matching MTU is not a Adjacency Requirement, but is required to successfully pass Database Descriptor Packets

  • In OSPF, MTU Mismatch causes neighbors swinging between ExStart state to Down state
Mar  1 00:10:09.535: %OSPF-5-ADJCHG: Process 1, Nbr 10.10.10.1 on Ethernet0/0 from EXSTART to DOWN, Neighbor Down: Too many retransmissions

Complete OSPF Lab

         This section is under construction.



References

  1. www.wipro.com
  2. www.ericsson.com/in
  3. www.wipro.com
  4. www.3i-infotech.com
  5. www.wipro.com


{{#widget:DISQUS |id=networkm |uniqid=OSPF |url=https://aman.awiki.org/wiki/OSPF }}