Ospf Flashcards
OSPF Characteristics
• OSPF is a Link State routing protocol
• It supports large networks
• It has very fast convergence time
• Messages are sent using multicast
• OSPF is an open standard protocol
• It uses Dijkstra’s Shortest Path First algorithm to determine the best path to learned networks
OSPF vs EIGRP VS RIP
• RIP has scalability limitations so it is not typically used in production networks
@ It is suitable for small networks or lab/test environments
• The choice for most companies for their IGP comes dowi?to EIGRP or
OSPF
OSPF is the most commonly used
• It supports large networks and has always been an open standard. It is supported on all vendors equipment
• EIGRP can be simpler to implement and troubleshoot
• It was historically a Cisco proprietary protocol
e It is now an open standard but there is still limited support on other
vendor’s equipment
Link State Routing Protocols
• In Link State routing protocols, each router describes itself and its interfaces to its directly connected neighbours
• This information is passed unchanged from one router to another
• Every router learns the full picture of the network incluang every router, its interfaces and what they connect to
• OSPF routers use LSA Link State Advertisements to pass on routing updates
OSPF Operations
- Discover neighbours
- Form adjacencies
- Flood Link State Database (LSDB)
- Compute Shortest Path
- Install best routes in routing table
- Respond to network changes
OSPF Packet Types
• Hello: A router will send out and listen for Hello packets when OSPF is enabled on an interface, and form adjacencies with other OSPF routers on the link
• DBD DataBase Description: Adjacent routers will tell each other the networks they know about with the DBD packet
• LSR Link State Request: If a router is missing information about any of the networks in the received DBD, it will send the neighbour an LSR
• LSA Link State Advertisement: A routing update
• LSU Link State Update: Contains a list of LSA’s which should be updated, used during flooding
• LSAck: Receiving routers acknowledge LSAs
OSPF Configuration - Process ID
R1 (config) #router ospf 1
@ Different interfaces on a router can run in different instances of OSPF.
• Different instances have different Link State Databases
• Only one instance is typically configured on OSPF routers - multiple
Process IDs are very rarely used
• The Process ID is locally significant. It does not have to match on the neighbour router to form an adjacency
OSPF Configuration - network
• The network command uses a wildcard mask which is the inverse of a subnet mask.
• Subtract each octet in the subnet mask from 255 to calculate the wildcard
mask
• A subnet mask of 255.255.0.0 equals a wildcara mask of 0.0.255.255
• A subnet mask of 255.255.255.252 equals a wildcard mask of 0.0.0.3
• The command does not default to using the classful boundary
• You must enter a wildcard mask
OSPF Configuration - network
R1 (config-router) # network 10.0.0.0 0.0.255.255 area 0
• The network command means:
• Look for interfaces with an IP address which falls within this range.
• Enable OSPF on those interfaces - send out and listen for
OSPF hello messages, and peer with adjacent OSPF routers.
• Advertise the network and mask which is configured on those interfaces.
OSPF Verification
sh run | section ospf
-router ospf 1
-network 10.0.0.0 0.255.255.255 area 0
OSPF Operations
- Discover neighbours
- Form adjacencies
- Flood Link State Database (LSDB)
- Compute Shortest Path
- Install best routes in routing table
- Respond to network changes
OSPF Router ID
OSPF routers identify themselves using an OSPF Router ID which is in the form of an IP address.
• This will default to being the highest IP address of any loopback interfaces configured on the router, or the highest other IP address if a loopback does not exist.
• Loopback interfaces never go down so the Router ID will not change.
• You can also manually specify the Router ID.
• Best practice is to use a Loopback or manually set the Router ID.
Passive Interface Configuration
R1 (config) #router ospf 1
R1 (config-router) #passive-interface loopback 0
R1 (config-router) #passive-interface f2/0
RI (config) #router ospf 1
R1 (config-router) #passive-interface default
R1 (config-router) #no passive-interface f0/0
R1 (config-router) #no passive-interface f1/0
R1 (config-router) #no passive-interface f3/0
Default Route Injection using ospf
R4 (config) #ip route 0.0.0.0 0.0.0.0 203.0.113.2
R4 (config) #router ospf 1
R4 (config-router) #default-information originate
Default Route Injection Verification in ospf
Gateway of last resort is 10.0.0.2 to network 0.0.0.0
O*E20.0.0.0/0 [110/1] via 10.0.0.2, 00:00:01, FastEtherneto/0
OSPF Areas
• Every router learns the full picture of the network including every router, its interfaces and what they connect to @ This can cause issues in large networks:
• Too many routes can use up too much router memory
• Network changes cause all routers to reconverge which takes time and CPU resources
• OSPF supports a hierarchical design which segments large networks into smaller areas to solve this problem
• Each router maintains full information about its own area, but only summary information about other areas
A two level hierarchy is used:
• Transit area (backbone or area 0). Does not generally contain end users.
Regular areas (nonbackbone areas). Used to connect end users to the Transit area.
By default, all transit traffic goes through the Transit area.
The interface speed and commands
• The rate that Ethernet interfaces physically transmit at is set by the
‘speed’ command
• GigabitEthernet interfaces transmit at 1000 Mbps by default
• FastEthernet interfaces transmit at 100 Mbps by default
• If you use the ‘speed 10’ command on a FastEthernet interface it will physically transmit at 10 Mbps
The clock rate command
• The rate that Serial interfaces physically transmit at is set by the ‘clock rate’ command
• Serial interfaces transmit at 1.544 Mbps by default
• If you use the ‘clock rate 64000’ command on a Serial interface it will physically transmit at 64 Kbps
The bandwidth command
Interfaces also have a default bandwidth (eg 100 Mbps on FastEthernet interfaces, 1.544 Mbps on a serial interface)
• The bandwidth usually matches the physical transmission rate of the interface
• The ‘bandwidth’ setting on an interface does not affect the physical transmission rate - that is set by the ‘speed’ or ‘clock rate’
• If you set a bandwidth of 50 Mbps on a FastEthernet interface, it will still transmit at 100 Mbps
• The bandwidth command affects software policy on the router, such as which path will be selected by EIGRP or OSPF, or how much bandwidth will be guaranteed to a traffic type by QoS
• You can influence software policy by setting the bandwidth on an interface
OSPF Metric Calculation
• As OSPF is a Link State routing protocol, the router will learn about all destinations in its area, the links and their cost
• The router will select routes based on its lowest cost to get to
the destination
OSPF Link States
• An OSPF router knows about all links in its OSPF area, and each link’s cost
• In a multiple area OSPF network, ABRs know the information for each area they are connected to
• When multiple areas are in use, each router has individual routes for each IP subnet in its own area, and summary routes to other areas which go via an ABR
OSPF Metric Calculation
• For destinations in its own area, a router looks at all available links to get there, and chooses the path with the lowest overall cost
• For destinations in another area, a router looks at all available links to get to the ABR and chooses the path with the lowest overall cost to the ABR. It’s then up to the ABR to choose the best path onwards from there
SPF Shortest Path First Algorithm
• The SPF Shortest Path First algorithm calculates the overall cost for each available path to each destination network, and then selects the lowest cost path
• The overall cost = cumulative cost of all outgoing interfaces
• You should ensure the cost is set the same on the interfaces on both sides of a link or you can get asymmetric routing
Reference Bandwidth
• The cost is automatically derived from the interface bandwidth
• Cost = Reference Bandwidth / Interface Bandwidth
• The default reference bandwidth is 100 Mbps
• FastEthernet link cost defaults to 1 (100 / 100)
• T1 link cost defaults to 64 (100 / 1.544)
• OSPF treats all interfaces of 100 Mbps or faster as equal
• FastEthernet, Gigabit Ethernet, 10 Gigabit Ethernet etc. all default to a cost of 1
• This can cause undesirable routing in modern networks
Reference Bandwidth commmnds
R1 (config) #router ospf 1
R1 (config-router) #auto-cost reference-bandwidth 100000
•The reference bandwidth should be changed on all routers