From wikistone
Jump to: navigation, search
Line 152: Line 152:
 
Clear OSPF:  
 
Clear OSPF:  
 
<pre># clear ip ospf process</pre>
 
<pre># clear ip ospf process</pre>
 +
 
Show OSPF db:
 
Show OSPF db:
 
<pre># sh ip ospf database</pre>
 
<pre># sh ip ospf database</pre>
  
−
 
+
Show OSPF config per interface
 +
<pre># sh ip ospf int</pre>
  
  

Revision as of 12:21, 12 April 2013

OSPF: Open Shortest Path First

Link State routing protocol.
Uses Dijkstra's SPF (Shortest Path First) algorithm.

Tables

  • Neighbor
  • Topology
  • Route


Notes

  • All areas connect to area 0.
  • All routers in an area know about all other routers in that area.
  • Area 0 is aka Backbone area.
  • Neighborships form in same area only.
  • Hellos:
    • 10 sec on broadcast & P2P networks
    • 30 sec on NBMA networks
    • Timeout 4x Hello
  • Reliability: Uses RTP (Reliable Transport Protocol) for reliability. This is built into OSPF.


Router Types

  • ABR: Area Border Router. Must have 1 int in area 0. Can summarize here only.
  • ASBR: Autonomous System Boundary Router. Links the OSPF AS to external network(s).


Technical

LSA Types

(Link State Adverts)

  • ...


Packet Types

  • Hello
    • RID, Router Priority, Neighbors, BR & BDR addresses
    • (Must match for neighborship formation.) Area #, Hello & Dead timers, NetMask, Auth
  • Link-State packets:
    • LSU (Link-Stake Update). Encapsulating packet for updates. Contain LSAs.
    • LSA (Link-State Advert). Individual updates about routes to networks.
    • LSAck (Link-State Ack). Acks for reliability. (RTP)


Neighborship

  • RID (Router ID) is determined.
    • Staticly declared or determined by: highest active IP when OSPF starts (loopback > physical).
    • RID is 32 bit in IPv4 format.
    • If dynamic RID, RID will only change if OSPF is manually restarted or at router reload.
  • If Hello contains This router, This knows neighborship is formed. If Hello doesn't contain This, This attempts to form neighborship.


Router States

  • Init State: received Hello (if no Hello matches, Init -> Down).
  • 2-Way State: This router listed in Other's Hello & Other router listed in This' Hello. (DROthers stay here)
  • ExStart State: Master-Slave determined by Priority > RID. Master sends DB Desc (DBD) packet (summary of Link-State db). Slave sends DBD.
  • Loading State: Ack DBDs.
    • Slave Req details (Link-State Requests [LSR])
    • Master Tx updates (Link-State Updates [LSU])
    • Master Req details (LSR)
    • Slave Tx updates (LSU)
  • Full State: Neighborship formed.


Router Roles

  • DR (Designated Router)
    • updates are sent to DR (from all rtrs) on 224.0.0.6
    • DR calculates changes, then sends update on 224.0.0.5
    • determined by Rtr Priority > RID
  • BDR (Backup Designated Router)
    • takes over as DR if DR fails.
  • DROther (all other routers on network segment or routers on P2P)
    • listen on 224.0.0.5
    • P2P links have DROthers only (stuck in 2-Way) and only use 224.0.0.5

Roles are per network. A router connected to multiple networks can have multiple roles.
Router Role Election: Router Priority > RID


OSPF Over NBMA

for Frame Relay, ATM, MPLS


Modes of Operation:

Non-Broadcast

  • Default mode for X.25, FR, ATM
  • Neighbors Statically Configured
  • Must be one subnet.
  • Acts like LAN environment
  • DR/BDR election.
    • ie full connectivity b/w all rtrs
    • result: Hub rtr must be DR, Spokes (to Hub) will be BDR, Spoke-Spoke will be 2-Way


Point to Multipoint

  • Fixes issues with NBMA networks by treating all links as P2P.
  • Requires single subnet.
  • No DR/BDR election.
  • Neighborships auto form.


Point to Point (Cisco proprietary)

  • Uses seperate sub-interfaces.
  • Requires diff subnets.
  • No DR/BDR election.
  • Neighborships auto form.


Broadcast (Cisco proprietary)

  • Treated as Ethernet network.
  • DR/BDR election.


Point to Multipoint Non-Broadcast (Cisco proprietary)

  • Fixes issues with NBMA networks by treating all links as P2P.
  • Requires single subnet.
  • No DR/BDR election.
  • Neighbors statically defined.



Implementation

Non-Broadcast

- Setup connectivity per any requirements.
- Start OSPF process and declare networks to advert.
- Create neighborships.

config# router ospf #
router# router-id #
router# network [IP] [wildcard] area #

router# neighbor [IP] (priority #)


Point-to-Multipoint

Point-to-Point

Broadcast

Point-to-Multipoint Non-Broadcast

Routes

  • Standard: AD: 110
  • InterArea:
  • E1: AD: 110. Cost: [det+cost]. Cost metric increments as the route traverses the AS.
  • E2: AD: 110. Cost: [det]. Cost metric does not increment across AS.


Cost: 100 / (BW-inMBps). All speeds above 100 MBps are 1... Unless you adjust the factor.


Commands

Clear OSPF:

# clear ip ospf process

Show OSPF db:

# sh ip ospf database

Show OSPF config per interface

# sh ip ospf int




.