Friday, April 06, 2007

Day 13 & 14 : OSPF

OSPF uses bandwidth to calculate shortest path. The formula for OSPF cost is 100Mbps/bandwidth.

Every router in OSPF autonomous system advertise link state. Link state advertisement (LSA) contains IP address of the link (interface), netmask, cost, network type. Unlike DV protocols, intermediate router relay LSA to the neighbors without modifying it.

There are 4 OSPF network types.
1. point-to-point (e.g HDLC)
2. broadcast (e.g Ethernet)
3. NBMA
4. virtual-link

Before neighboring OSPF routers exchange LSA, they have to become neighbor first using Hello protocol. To become an OSPF neighbor, both routers must agree on certain criteria (IP address/mask, OSPF area, network type etc.)
OSPF router maintains neighbors in adjacency database. Neighbor routers exchange Hello packets to make sure neighbors are alive. If a neighbor router does not send Hello for a while (Dead timer), the router is marked as dead and removed from adjacency database.
(10 seconds Hello, 40 seconds Dead - for Broadcast and point-to-point network)
(30 seconds Hello, 120 seconds Dead - for NBMA network)
** Dead timer is 4 times of Hello interval.

All LSA are kept in link-state database.
OSPF router runs SPF algorithm against link-state database and produce shortest path tree. The shortest route from the tree is used in routing table.

Once the LSAs are exchanged and SPF algorithm is computed on all the routers, all OSPF routers stopped exchanging LSA except for low overhead Hello between neighbor. OSPF routers refresh LSA database every 30 minutes.
Bandwidth requirement for OSPF routing protocol traffic is minimal as compared to DV protocols.

To minimize OSPF link-state database size, OSPF routers can be separated into different areas. Area 0 is required and it is called backbone area. Non-backbone areas MUST touch backbone area.
A router in area 0 is called a backbone router.
A router which is configured with more than 1 area is called ABR (area border router).
A router inside a router is called an internal router.

In broadcast network and NBMA topology, OSPF elect DR (designated router) and BDR (backup designated router) to minimize number of neighbor relationships which in turn minimize Hello protocol updates and LSA updates.
All routers establish adjacency with only DR and BDR regardless of number of routers.
DR/BDR election a tie breaker process is based on OSPF priority value and highest routerID. OSPF priority value 0 means the router will not participate in DR/BDR election process.

Loopback addresses are prefered over physical address for routerID and it is a good practice to configure loopback interface on the router running OSPF.

0 Comments:

Post a Comment

<< Home