Tuesday, February 2, 2010

OSPF

OSPF was written to address the needs of large, scalable internetworks that RIP could not. The issues it addresses are:

Speed of convergence:
In large networks, RIP convergence can take several minutes. With OSPF, convergence is much faster as routing changes are flooded immediately and computed in parallel.

Support for VLSM:
RIP v1 does not support VLSM. OSPF does support VLSM.

Network reachability:
RIP networks cannot span more than 15 routers, while OSPF has virtually no reachability limitations.

Use of bandwidth: RIP broadcasts its routing table out each interface every 30 seconds. OSPF multicasts link-state updates and only sends the updates when there is a change in the network. OSPF does perform a full update every 30 minutes to ensure that all routers are synchronized.

Method for path selection:
RIP has no concept of network delays or link costs. It routes packets purely on hop count. OSPF uses a cost value (speed of connection) for its path selection.

OSPF relies on IP packets for delivery of routing information, and uses protocol 89 in the transport layer.

We learned the three basic OSPF topologies:

Broadcast Multi-access:
Networks supporting multiple attached routers, together with the capability of addressing a single physical message to all of the attached routers (broadcast). Ethernet would be an example.

Point-to-point: A network that joins a single pair of routers. A T1 dedicated serial line would be an example.

NBMA (Non-broadcast Multi-access): Networks supporting multiple routers, but having no broadcast capability. Frame-relay and X.25 are examples of NBMA networks.

In a broadcast multi-access topology such as Ethernet, Hello packets are sent periodically out each OSPF enabled interface using IP multicast address 224.0.0.5. The information contained in the hello packet is:

Router ID: A 32-bit number (usually an IP address) that uniquely identifies a router in an AS (autonomous system).

Hello and Dead intervals: The default Hello interval is 10 seconds. The Dead interval is 4 times the hello interval or 40 seconds by default.

Neighbors: The neighbors with which bi-directional communication has been established.

Area-ID: To communicate, two routers must share a common segment and have their interfaces belong to the same area on that segment.

Router priority: An 8-bit number that indicates the priority of this router when selecting a Designated Router (DR) and Backup Designated Router (BDR).

DR and BDR IP addresses: The IP address of the current DR and BDR are listed.

Authentication password:
If authentication is enabled, the password is listed here.

Stub area flag: A stub area is a special area that has only one exit to the backbone.

DR/BDR Election

To elect a DR and BDR on a broadcast multi-access network, the routers view each other’s priority value during the hello packet exchange process, and then use the following conditions to determine which is elected:

The router with the highest priority value is the DR.

The router with the second highest priority value is the BDR.

The default priority is 1 on an OSPF interface, in case of a tie, the router ID is used. The router with the highest router ID then becomes the DR, and the router with the second highest router ID becomes the BDR. The router ID is the highest IP address on the router, unless a loopback is configured, in which case the highest loopback IP address will be the router ID.

Loopback interfaces are logical interfaces that never go down. In other words they will always be in an UP, UP state. Because they can never go down, they are excellent references to use for router processes. Cisco is well aware of this and uses them in many ways. For instance, remember how OSPF chooses its Router ID. The highest active IP address is used, unless a Loopback interfaces is configured. If so, the highest Loopback IP address is chosen as the Router ID. BGP uses Loopbacks in the very same way. Also, Loopbacks are great for simulating networks connected to a router.

A router with the priority set to 0 is ineligible to become DR or BDR. If a router with a higher priority value gets added to the network, the DR and BDR do NOT change. The only time a DR or BDR change is if one goes down. If the DR goes down, the BDR takes its place. If the BDR goes down, a new BDR is elected. Basically the first two routers powered up on a segment will become the DR and BDR.

An adjacency is the relationship that exists between a router and its DR and BDR. Adjacent routers will have synchronized link-state databases. Once a DR and BDR are elected, any router added to the network will establish adjacencies only with the DR and BDR.


OSPF neighbor process


When a router is first powered on, it goes through several states, each with its own function.

The router (let's call it RouterA) begins in the DOWN state- It begins to send hello packets out its OSPF enabled interfaces.

When routers receive this hello packet, they add it to their list of neighbors. This is the INIT state.

The neighbors that received the hello packet will reply with their own hello packet. The neighbor field will include RouterA as a neighbor.

When RouterA receives these packets, it adds all the routers that had its router ID in their hello packet to its own neighbor database. This is referred as the TWO-WAY state.

The routers determine who the DR and BDR will be. After the DR and BDR election, the routers are considered to be in the EXSTART state (ready to start exchanging link-state information).

In the EXSTART state, the DR and BDR establish adjacencies with each router in the network. When the routers have exchanged one or more DBD (Database Description) packets, they are in the EXCHANGE state.

The routers exchange link-state information using LSR (Link State Requests) and LSU (Link State Update) packets. A router will issue a LSAck in response when a LSU is received. The process of sending LSRs is referred to as the LOADING state.

All routers add the new link-state entries into their link-state databases.

Once all LSRs have been satisfied for a given router, the adjacent routers are considered synchronized and in a FULL state. The routers must be in a full state before they can route traffic. At this point, the routers should all have identical link-state databases.

Routers in a point-to-point topology dynamically detect their neighbors by using the hello protocol. There is no election: adjacency is automatic as soon as the two routers can communicate. All OSPF packets are sent to multicast address 224.0.0.5. The default OSPF hello and dead intervals on non-NBMA topologies are 10 seconds and 40 seconds, respectively.

We learned that the OSPF operation is in an NBMA topology. With NBMA networks, a single interface interconnects multiple sites. NBMA topologies support multiple routers but without broadcast capabilities. Frame relay, ATM, and X.25 are examples of NBMA networks. The default OSPF hello and dead intervals on NBMA topologies are 30 seconds and 120 seconds, respectively.

No comments: