Open Shortest Path First : Open Shortest Path First OSPF
By: Nagham Kubba Introduction to Open Shortest Path First (OSPF) : Introduction to Open Shortest Path First (OSPF) Open Shortest Path First (OSPF) is a routing protocol which is used to allow routers to dynamically learn routes from other routers and to advertise routes to other routers.
Advertisements containing routes are referred to as Link State Advertisements (LSAs) in OSPF. Specifications : Specifications Keeps track of the state of all the various network connections (links) between itself and a network it is trying to send data to. This makes it a link-state routing protocol.
Supports the use of classless IP address ranges and is very efficient.
Uses areas to organize a network into a hierarchal structure; it summarizes route information to reduce the number of advertised routes and thereby reduce network load and uses a designated router (elected via a process that is part of OSPF) to reduce the quantity and frequency of Link State Advertisements. Specifications : Specifications Does require the router to have a more powerful processor and more memory than other routing protocols.
Selects the best routes by finding the lowest cost paths to a destination. All router interfaces (links) are given a cost. The cost of a route is equal to the sum of all the costs configured on all the outbound links between the router and the destination network, plus the cost configured on the interface that OSPF received the Link State Advertisement on. Slide 5: The Shortest path to a destination is not necessarily the path with the least number of hops OSPF cost : OSPF cost The cost (also called metric) of an interface in OSPF is an indication of the overhead required to send packets across a certain interface. The cost of an interface is inversely proportional to the bandwidth of that interface. A higher bandwidth indicates a lower cost. (There is more overhead “higher cost” and time delays involved in crossing a 56k serial line than crossing a 10M Ethernet line.
The formula used to calculate the cost is:
cost= 10000 0000/bandwith in bps Example : Example For example, it will cost
108/107 = 10 to cross a 10M Ethernet line while it will cost
108 /1544000 = 64 to cross a T1 line.
By default, the cost of an interface is calculated based on the bandwidth; you can force the cost of an interface with the
ip ospf cost <value> interface subconfiguration mode command. Link-State Routing Process : Link-State Routing Process Each routers learns about its own directly connected networks
Link State Packet (LSP)
Flooding to all neighbors
Calculating SPF Slide 9: The Shortest path to a destination is not necessarily the path with the least number of hops Neighbors : Neighbors Routers that share a common segment become neighbors on that segment.
Neighbors are elected via the Hello protocol.
Hello packets are sent periodically out of each interface using IP multicast.
Routers become neighbors as soon as they see themselves listed in the neighbor's Hello packet. This way, a two way communication is guaranteed. Adjacencies : Adjacencies Adjacency is the next step after the neighboring process. Adjacent routers are routers that go beyond the simple Hello exchange and proceed into the database exchange process.
In order to minimize the amount of information exchange on a particular segment, OSPF elects one router to be a designated router (DR), and one router to be a backup designated router (BDR), on each multi-access segment.
The BDR is elected as a backup mechanism in case the DR goes down. The idea behind this is that routers have a central point of contact for information exchange. Instead of each router exchanging updates with every other router on the segment, every router exchanges information with the DR and BDR. The DR and BDR relay the information to everybody else. Slide 14: Example Router types : Router types OSPF elects two or more routers to manage the Link State Advertisements:
Designated Router (DR)
It is the router to which all other routers within an area send their Link State Advertisements. The Designated Router will keep track of all link state updates and make sure the LSAs are flooded to the rest of the network using Reliable Multicast transport.
Backup Designated Router (BDR)
The election process which determines the Designated Router will also elect a Backup Designated Router (BDR). The BDR takes over from the DR when the DR fails. Router types : Router types OSPF elects two or more routers to manage the Link State Advertisements:
Designated Router (DR)
Backup Designated Router (BDR)
A priority value of zero indicates an interface which is not to be elected as DR or BDR. The state of the interface with priority zero will be DROTHER. Areas and Border Routers : Areas and Border Routers As previously mentioned, OSPF uses flooding to exchange link-state updates between routers. Any change in routing information is flooded to all routers in the network. Areas are introduced to put a boundary on the explosion of link-state updates. Flooding and calculation of the Dijkstra algorithm on a router is limited to changes within an area.
All routers within an area have the exact link-state database.
Routers that belong to multiple areas, and connect these areas to the backbone area are called area border routers (ABR). ABRs must therefore maintain information describing the backbone areas and other attached areas. Enabling OSPF on the Router : Enabling OSPF on the Router Enabling OSPF on the router involves the following two steps in config mode:
1. Enabling an OSPF process using the router ospf <process-id> command.
2. Assigning areas to the interfaces using the network <network or IP address> <mask> <areaid> command.
The OSPF process-id is a numeric value local to the router. It does not have to match process-ids on other routers. It is possible to run multiple OSPF processes on the same router, but is not recommended
The network command is a way of assigning an interface to a certain area.
The mask contains wild card bits where 0 is a match and 1 is a "do not care" bit, e.g. 0.0.255.255 indicates a match in the first two bytes of the network number. Slide 19: RTA#
ip address 18.104.22.168 255.255.255.0
ip address 22.214.171.124 255.255.255.0
ip address 126.96.36.199 255.255.255.0
router ospf 100
network 188.8.131.52 0.0.255.255 area 0.0.0.0
network 184.108.40.206 0.0.0.0 area 23