The Interface State Machine
An OSPF-enabled interface will transition through several states before it becomes fully functional.
Those states are Down, Point-to-Point, Waiting, DR, Backup, DRother, and Loopback.
This is the initial interface state. The interface is not functional, all interface parameters are set to their
initial values, and no protocol traffic is transmitted or received on the interface.
This state is applicable only to interfaces connected to point-to-point, point-to-multipoint, and virtual link
network types. When an interface transitions to this state, it is fully functional. It will begin sending Hello
packets every HelloInterval and will attempt to establish an adjacency with the neighbor at the other end
of the link.
This state is applicable only to interfaces connected to broadcast and NBMA network types. When an
interface transitions to this state, it will begin sending and receiving Hello packets and will set the wait
timer. The router will attempt to identify the network’s DR and BDR while in this state.
In this state, the router is the DR on the attached network and will establish adjacencies with the other
routers on the multi-access network.
In this state, the router is the BDR on the attached network and will establish adjacencies with the other
routers on the multi-access network.
In this state, the router is neither the DR nor the BDR on the attached network. It will form adjacencies
only with the DR and BDR, although it will track all neighbors on the network.
In this state, the interface is looped back via software or hardware. Although packets cannot transit an
interface in this state, the interface address is still advertised in router LSAs (described later) so that test
packets can find their way to the interface.
The outgoing cost for packets transmitted from this interface. Cost is the OSPF metric, expressed as an
unsigned 16-bit integer in the range of 1 to 65535. Cisco uses a default cost of 10^8/BW, expressed in
whole numbers, where BW is the configured bandwidth of the interface and 10^8 is the reference
bandwidth.If an interface is configured with a configured bandwidth of 128K , so
the cost is 10^8/128K = 781.
The cost can be changed with the command ip ospf cost. This command is especially important when
configuring Cisco routers in a multivendor environment. If all routers do not
assign costs in the same manner, OSPF can route improperly.
1. Logging into router console using Telnet
Connected to 192.168.1.1.
Escape character is ‘^]’.
2. Moving to ENABLE mode. You cannot do any configuration on ENABLE mode but can only view different show outputs and configurations.
3. “show ip int b” to see all the interfaces on the router
MY_ROUTER#show ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0/0 192.168.1.1 YES NVRAM up up
GigabitEthernet1/0/0 unassigned YES unset up up
GigabitEthernet1/1/0 unassigned YES unset down down
ATM3/0/0 unassigned YES unset up up
ATM3/0/1 unassigned YES unset up up
ATM3/0/2 unassigned YES unset up up
ATM3/0/3 unassigned YES unset up up
GigabitEthernet4/0/0 unassigned YES unset up up
ATM5/0/0 unassigned YES unset up up
ATM6/0/0 unassigned YES unset down down
ATM6/0/1 unassigned YES unset down down
ATM6/0/2 unassigned YES unset down down
ATM6/0/3 unassigned YES unset down down
GigabitEthernet7/0/0 unassigned YES unset up up
FastEthernet7/1/0 unassigned YES unset up up
FastEthernet7/1/1 unassigned YES unset down down
FastEthernet7/1/2 unassigned YES unset down down
FastEthernet7/1/3 unassigned YES unset down down
FastEthernet7/1/4 unassigned YES unset down down
FastEthernet7/1/5 unassigned YES unset down down
FastEthernet7/1/6 unassigned YES unset down down
FastEthernet7/1/7 unassigned YES unset down down
ATM8/0/0 unassigned YES unset down down
DR & BDR
DR and BDR are elected in Broadcast and NBMA (Non-Broadcast Multiaccess Network)
Pre-Conditions for electing DR adn BDR
- Each multi-access interface of each router has a Router Priority, which is an 8-bit unsigned
integer ranging from 0 to 255. The default priority on Cisco routers is 1 and can be changed on a
per multi-access-interface basis with the command ip ospf priority. Routers with a priority of 0
are ineligible to become the DR or BDR.
- Hello packets include fields for the originating router to specify its Router Priority and for the IP
addresses of the connected interfaces of the routers it considers the DR and BDR.
- When an interface first becomes active on a multi-access network, it sets the DR and BDR to
0.0.0.0. It also sets a wait timer with a value equal to the RouterDeadInterval.
- Existing interfaces on a multi-access network record the addresses of the DR and the BDR in the
interface data structure.
The election procedure of the DR and BDR is as follows:
- After 2-Way communication has been established with one or more neighbors, examine the
Priority, DR, and BDR fields of each neighbor’s Hello. List all routers eligible for election (that is,
routers with priority greater than 0 and whose neighbor state is at least 2-Way); all routers
declaring themselves to be the DR (their own interface address is in the DR field of the Hello
packet); and all routers declaring themselves to be the BDR (their own interface address is in the
BDR field of the Hello packet). The calculating router will include itself on this list unless it is
- From the list of eligible routers, create a subset of all routers not claiming to be the DR (routers
declaring themselves to be the DR cannot be elected BDR).
- If one or more neighbors in this subset include its own interface address in the BDR field, the
neighbor with the highest priority will be declared the BDR. In a tie, the neighbor with the highest
Router ID will be chosen.
- If no router in the subset claims to be the BDR, the neighbor with the highest priority will become
the BDR. In a tie, the neighbor with the highest Router ID will be chosen.
- If one or more of the eligible routers include their own address in the DR field, the neighbor with
the highest priority will be declared the DR. In a tie, the neighbor with the highest Router ID will
- If no router has declared itself the DR, the newly elected BDR will become the DR.
- If the router performing the calculation is the newly elected DR or BDR, or if it is no longer the
DR or BDR, repeat steps 2 through 6.
OSPF Network Types :
Point-to-point networks : such as a T1 or subrate link, connect a single pair of routers. Valid neighbors on
point-to-point networks will always become adjacent. The destination address of OSPF packets on these
networks will always be the reserved class D address 184.108.40.206, known as AllSPFRouters.
Broadcast networks : such as Ethernet, Token Ring, and FDDI, might be better defined as broadcast multiaccess
networks to distinguish them from NBMA networks. Broadcast networks are multi-access in that
they are capable of connecting more than two devices, and they are broadcast in that all attached devices
can receive a single transmitted packet. OSPF routers on broadcast networks will elect a DR and a BDR. Hello packets are
multicast with the AllOSPFRouters destination address 220.127.116.11, as are all OSPF packets originated by the
DR and BDR. The destination Media Access Control (MAC) identifier of the frames carrying these
packets is 0100.5E00.0005. All other routers will multicast link state update and link state
acknowledgment packets to the reserved class D address 18.104.22.168, known as
AllDRouters. The destination MAC identifier of the frames carrying these packets is 0100.5E00.0006.
NBMA networks : such as X.25, Frame Relay, and ATM, are capable of connecting more than two routers
but have no broadcast capability. A packet sent by one of the attached routers would not be received by
all other attached routers. As a result, extra configuration may be necessary for routers on these networks
to acquire their neighbors. OSPF routers on NBMA networks elect a DR and BDR, and all OSPF packets
Point-to-multipoint networks : are a special configuration of NBMA networks in which the networks are
treated as a collection of point-to-point links. Routers on these networks do not elect a DR and BDR, and
because the networks are seen as point-to-point links, the OSPF packets are multicast.
Below are the few main points to remember in OSPF.
- Open Shortest Path First – (OSPF)
- OSPF is a link-state protocol IGP
- Uses Dijkstra’s Shortest Path First (SPF) algorithm.
- Like all link state protocols, OSPF’s major advantages over distance vector protocols are fast
reconvergence, support for much larger internetworks, and less susceptibility to bad routing information.
- OSPF does not use a TCP/IP transport protocol (UDP, TCP), but is encapsulated directly in IP datagrams with protocol number 89. This is in contrast to other routing protocols, such as the Routing Information Protocol (RIP), or the Border Gateway Protocol (BGP). OSPF handles its own error detection and correction functions.
- Features of OSPF are:
- Use of areas reduces the protocol’s impact on CPU and memory
- Fully classless behavior, eliminating such classful problems as discontiguous subnets.
- Support of classless route table lookups, VLSM, and supernetting for efficient address
- A dimensionless, arbitrary metric
- Equal-cost load balancing for more efficient use of multiple paths
- The use of reserved multicast addresses to reduce the impact on non-OSPF-speaking devices
- Support of authentication for more secure routing
- The use of route tagging for the tracking of external routes
OPERATION OF OSPF
- OSPF-speaking routers send Hello packets out all OSPF-enabled interfaces. If two routers sharing
a common data link agree on certain parameters specified in their respective Hello packets, they
will become neighbors.
- Adjacencies, which may be thought of as virtual point-to-point links, are formed between some
neighbors depending on the network type and router type.
- Each router sends link state advertisements (LSAs) over all adjacencies.
- Each router receiving an LSA from a neighbor records the LSA in its link state database and
sends a copy of the LSA to all of its other neighbors.
- By flooding LSAs throughout an area, all routers will build identical link state databases.
- When the databases are complete, each router uses the SPF algorithm to calculate a loop-free
graph describing the shortest (lowest cost) path to every known destination, with itself as the root.
This graph is the SPF tree.
- Each router builds its route table from its SPF tree.
Note: Before any LSAs can be sent, OSPF routers must discover their neighbors and establish adjacencies.
Selection Process of Router ID
1. The router chooses the numerically highest IP address on any of its loopback interfaces.
2. If no loopback interfaces are configured with IP addresses, the router chooses the numerically
highest IP address on any of its physical interfaces. The interface from which the Router ID is
taken does not have to be running OSPF.
Hello Packets : OSPF routers sends hello packets to discover neighbors.
DR & BDR : Designated Routers (DRs) and Backup Designated Routers (BDRs) on Broadcast and
Nonbroadcast Multiaccess (NBMA) networks which will make the communication easy and less overhead.
HelloInterval : The period at which two OSPF routers sends Hello packets and is configured on a per interface basis. Cisco uses a default HelloInterval of 10 seconds. The default is 30 seconds on NBMA interfaces. The value can be changed with the command ip ospf hello-interval.
Contents of Hello Packets
- The Router ID of the originating router
- The Area ID of the originating router interface
- The address mask of the originating interface
- The authentication type and authentication information for the originating interface
- The HelloInterval of the originating interface
- The RouterDeadInterval of the originating interface
- The Router Priority
- The DR and BDR
- Five flag bits signifying optional capabilities
- The Router IDs of the originating router’s neighbors. This list contains only routers from which
Hellos were heard on the originating interface within the last RouterDeadInterval.
Fields to Match in Hello Packets to establish Adj : Area ID, Authentication, Network Mask, HelloInterval, RouterDeadInterval, and Options values.
show ip ospf interface – used to observe the components of an interface data structure.
Welcome to “4 Techies” from BobinMottiThomas.com. This is a sub-domain to my personal website. I started this blog not because I am having lots of knowledge to share with everyone. But I felt , even though little, whatever tips or tricks I came to know will be good if I can share with you also.
Also I am sure that you also will be having such lots of tips which will be good to share among us. So feel free to send you tips to firstname.lastname@example.org So that I can post it . Apart from that, if you really wish to become a part of this blog, feel free to use your facebook login to post your tips. If you dont have facebook login, I will help you by providing you a dedicated username/password for this blog.In that case, please send a mail to email@example.com with your details,for getting a username/password.
So let’s start and make our work easy by sharing our knowledge each other.