Routing Protocol
Routing Protocol
Routing Protocol
A routing protocol specifies how routers communicate with each other to distribute
information that enables them to select routes between any two nodes on a computer network.
Routers perform the "traffic directing" functions on the Internet,data packets are forwarded
through the networks of the internet from router to router until they reach their destination
computer.
4.Ability to find a new best path if the current path is no longer available
Types
Distance vector
Distance Vector algorithms calculate the best path to each destination prefix separately,
usually trying to find paths that minimize a simple metric, such as the number of router hops to the
destination.
At each intermediate step in the algorithm, each router has its current best path to the
destination prefix. The router then notifies all of its neighbors of its current path; concurrently the
router's neighbors are also notifying the router of their path choices. The router, seeing the paths
being used by all of itsneighbors, may find a better (that is, lower-cost) path through one of its
neighbors. If so,the router updates its next hop and cost for the destination and notifies its
neighbors of its new choice of route, and the procedure iterates.
Disadvantages:
Ex: RIP
Link state
The linkstate advertisements are then distributed to all other routers.every node constructs
a map of the connectivity to the network, in the form of a graph, showing which nodes are
connected to which other nodes.
Each node then independently calculates the next best logical path from it to every possible
destination in the network. Each collection of best paths will then form each node's routing table.
Advantages:
No routing loops.
Dis-Advantanges
Path vector
Each entry in the routing table contains the destination network, the next router and the
path to reach the destination.
Border Gateway Protocol (BGP) is an example of a path vector protocol. In BGP, the
autonomous system boundary routers (ASBR) send path-vector messages to advertise the
reachability of networks.
Each router that receives a path vector message the router modifies its routing table and
the message before sending the message to the next neighbor.
Autonomous system:
AS consists of a collection of routers under the control of a single administrative entity for
example, all the routers belonging to a particular Internet Service Provider, corporation,or university.
An interior gateway protocol (IGP) is a type of protocol used for exchanging routing
information between gateways (commonly routers) within an autonomous system
Ex: RIP,OSPF,IS-IS
Ex: BGP,EGP.
OSPF runs directly over the Internet Protocol's network layer. IP protocol number 89
AllSPFRouters - 224.0.0.5. All routers running OSPF should be prepared to receive packets
sent to this address. Hello packets are always sent to this destination
AllDRouters - 224.0.0.6. Both the Designated Router and Backup Designated Router must
be prepared to receive packets destined to this address
Basic operation
2.Database synchronization
4.Change in topology
The CPU processes the neighbor and topology tables using Dijkstra’s SPF algorithm. The SPF
algorithm is based on the cumulative cost to reach a destination.
The SPF algorithm creates an SPF tree by placing each router at the root of the tree and
calculating the shortest path to each node.
The SPF tree is then used to calculate the best routes. OSPF places the best routes into the
forwarding database, which is used to make the routing table.
Link-State Operation
To maintain routing information, OSPF routers complete the following generic link-state
routing process to reach a state of convergence:
OSPF-enabled routers must recognize each other on the network before they can share
information.An OSPF-enabled router sends Hello packets out all OSPF-enabled interfaces to
determine if neighbors are present on those links.
After adjacencies are established, routers then exchange link-state advertisements (LSAs).
LSAs contain the state and cost of each directly connected link. Routers flood their LSAs to adjacent
neighbors.
Adjacent neighbors receiving the LSA immediately flood the LSA to other directly connected
neighbors, until all routers in the area have all LSAs.
After LSAs are received, OSPF-enabled routers build the topology table (LSDB) based on the
received LSAs. This database eventually holds all the information about the topology of the network
Routers then execute the SPF algorithm. The SPF algorithm creates the SPF tree, program
the routes in the hardware.
Topology Maintenance & Change Notification:
Every change in topology triggers an Link state update and sends the updated
information.Neighbourship down triggers remove of routes from that router.
Size
Field Name Description
(bytes)
Type 1
AuType 2
Authentication: A 64-bit field used for authentication of the message, as
Authentication 8
needed.
Type Description
________________________________
1 Hello
2 Database Description
Hello Packet
The OSPF Type 1 packet is the Hello packet. Hello packets are used to:
Elect the Designated Router (DR) and Backup Designated Router (BDR) on
multiaccess networks like Ethernet and Frame Relay. Point-to-point links do not require DR or BDR.
Fields in the Hello packet:
Type - Identifies the type of packet. A one (1) indicates a Hello packet. A value 2 identifies a
DBD packet, 3 an LSR packet, 4 an LSU packet, and 5 an LSAck packet.
Router ID - A 32-bit value expressed in dotted decimal notation (an IPv4 address) used to
uniquely identifying the originating router.
Hello Interval - Specifies the frequency, in seconds, at which a router sends Hello packets.
The default Hello interval on multiaccess networks is 10 seconds. This timer must be the same on
neighboring routers; otherwise, an adjacency is not established.
Router Priority - Used in a DR/BDR election. The default priority for all OSPF routers is 1, but
can be manually altered from 0 to 255. The higher the value, the more likely the router becomes the
DR on the link. Priority 0 excludes the router from DR and BDR election.
Dead Interval - Is the time in seconds that a router waits to hear from a neighbor before
declaring the neighboring router out of service. This timer must be the same on neighboring routers;
otherwise, an adjacency is not established.
List of Neighbors - List that identifies the router IDs of all adjacent routers.
OSPF Hello packets are transmitted to multicast address 224.0.0.5 in IPv4 and FF02::5 in IPv6
(all OSPF routers) every:
The Dead interval is the period that the router waits to receive a Hello packet before declaring the
neighbor down.
If the Dead interval expires before the routers receive a Hello packet, OSPF removes that
neighbor from its LSDB. The router floods the LSDB with information about the down neighbor out
all OSPF-enabled interfaces.
Init state
Two-Way state
ExStart state
Exchange state
Loading state
LSRs and LSUs are used to gain additional route information
Routes are processed using the SPF algoritm. Transition to Full state
Flags 1
DD
DD Sequence Number: Used to number a sequence
Sequence 4
of Database Description messages so they are kept in order.
Number
LSA Headers: Contains link-state advertisement headers,
LSA
Variable which carry information about the LSDB. See near the end of
Headers
the topic for more information on LSAs.
LINK STATE UPDATE (LSU) - PACKET STRUCTURE
A Link State Update (LSU) packet can contain one or more LSAs inside it and when an LSU is
sent between OSPF routers, it floods the LSA information through the network. destination IP
address is multicast address 224.0.0.6
The LSA header is a 20 byte (32x5 = 160 bits) section that consists of the following fields:
LS Age (2 Bytes): Time passed since the LSA was generated (in seconds).
Options (1 Byte): Indicates the OSPF features and options the origin can support.
LS Type (1 Byte): Defines the LSA type (all types will be explained later).
Link State ID (4 Bytes): Identifies the network link between OSPF routers (usually IP
address).
LS Sequence Number (4 Bytes): A specific digit on each LSA packet to filter old and repeated
These messages have a Type value of 3 in the header. Following the header comes one or
more sets of three fields that each identify a link state advertisement (LSA) for which the router is
requesting an update, as shown in Figure 187. Each LSA identification has the format described
in Table 129.
Size
Field Name Description
(bytes)
The following packet capture shows the LSR sent for Router-LSA (Type-1) to an OSPF neighbor
after DBD packet exchange process is over.
These messages have a Type value of 5 in the header. They then contain a list of LSA headers
corresponding to the LSAs being acknowledged, as shown in Table 131 and Figure 189.
Size
Field Name Description
(bytes)
LSA Header
The LSA header contains sufficient information to identify the link. It uses
the subfield structure in Table 132 and Figure 190.
Link State ID: Identifies the link. This usually is the IP
Link State
4 address of either the router or the network the link
ID
represents.
Advertising
4 Advertising Router: The ID of the router originating the LSA.
Router
LS
LS Sequence Number: A sequence number used to detect
Sequence 4
old or duplicate LSAs.
Number
LS LS Checksum: A checksum of the LSA, for data corruption
2
Checksum protection.
Length: The length of the LSA, including the 20 bytes of the
Length 2
header.
LSA Body
Following the LSA header comes the body of the LSA, the specific fields of
which depend on the value of the LS Type field.
LSA Types:
LSA Type 1 (Router LSA) packets are sent between routers within the same area of origin and
do not leave the area. An OSPF router uses. LSA Type 1 packets to describe its own interfaces but
also carries information about its neighbors to adjacent routers in the same area.
LSA Type 2 (Network LSA) packets are generated by the Designated Router (DR) to describe
all routers connected to its segment directly. LSA Type 2 packets are flooded between neighbors in
the same area of origin and remain within that area.
LSA Type 3 (Summary LSA) packets are generated by Area Border Routers (ABR) to
summarize its directly connected area, and advertise inter-area router information to other areas
the ABR is connected to, with the use of a summary prefix (e.g 192.168.0.0/22). LSA Type 3 packets
are flooded to multiple areas throughout the network and help with OSPF’s scalability with the use
of summary prefixes.
LSA Type 4 (ASBR Summary LSA) packets are the LSAs that advertise the presence of an Autonomous
System Border Router (ASBR) to other areas. In the example below when R2 (ABR) receives the LSA
Type 1 packet from R1 it will create a LSA Type 4 (Summary ASBR LSA) packet, which advertises
the ASBR route received from Area 1, and inject it into Area 0.
Opaque LSA.
Area :
Areas are a logical collection of routers that carry the same Area ID.
1.Smaller routing tables - Fewer routing table entries because network addresses can be
summarized between areas.Route summarization is not enabled by default.
3.Reduced frequency of SPF calculations - Localizes the impact of a topology change within
an area. For instance, it minimizes routing update impact because LSA flooding stops at the
area boundary.
Routers located on the borders of each Area connect to more than one OSPF area, are
called ABR Routers. ABR Routers are responsible for summarizing IP addresses of each area
and suppressing updates among areas to prevent fault containment.
An ASBR is a router that has interfaces connected to one or more OSPF areas, similarly as
the ABR, however the difference with an ASBR is that it also connects to other routing systems such
as BGP, EIGRP, Internet and others. An ASBR router normally advertises routes from other routing
systems into the OSPF area to which it belongs.
These areas do not accept routes belonging to external autonomous systems (AS); however,
these areas have inter-area and intra-area routes. In order to reach the outside networks, the
routers in the stub area use a default route which is injected into the area by the Area Border Router
(ABR).
Ex: A stub area is typically configured in situations where the branch office need not know
about all the routes to every other office, instead it could use a default route to the central office
and get to other places from there. Hence the memory requirements of the leaf node routers is
reduced, and so is the size of the OSPF database.
You cannot configure an area as both a stub area and an not-so-stubby area (NSSA).
A stub area that only allows routes internal to the area and restricts Type 3 LSAs from
entering the stub area is often called a totally stubby area. The ABR injects a default route into the
area and all the routers belonging to this area use the default route to send any traffic outside the
area.
In stub and totally stub areas, the ABR to the stub area generates a summary LSA with the
link-state ID 0.0.0.0. This is true even if the ABR doesn't have a default route of its own.
NotSoStubbyArea (NSSA)
This type of area allows the flexibility of importing a few external routes into the area while
still trying to retain the stub characteristic. Assume that one of the routers in the stub area is
connected to an external AS running a different routing protocol, it now becomes the ASBR, and
hence the area can no more be called a stub area.
However, if the area is configured as a NSSA, then the ASBR generates a NSSA external link-
state advertisement (LSA) (Type-7) which can be flooded throughout the NSSA area. These Type-7
LSAs are converted into Type-5 LSAs at the NSSA ABR and flooded throughout the OSPF domain
Backbone area:
The first and main Area is called the backbone area “Area 0”, all other areas must connect
to Area 0
Virtual Links:
All areas in an OSPF autonomous system must be physically connected to the backbone area
(area 0). In some cases where this physical connection is not possible, you can use a virtual link to
connect to the backbone through a non-backbone area.
Virtual links can also be used to connect two parts of a partitioned backbone through a non-
backbone area. The area through which you configure the virtual link, known as a transit area, must
have full routing information. The transit area cannot be a stub area.
Area Restriction
Normal None
Stub No Type 5 AS-external LSA allowed
Totally Stub No Type 3, 4 or 5 LSAs allowed except the default summary route
No Type 5 AS-external LSAs allowed, but Type 7 LSAs that convert to Type 5 at the
NSSA NSSA ABR can traverse
NSSA Totally No Type 3, 4 or 5 LSAs except the default summary route, but Type 7 LSAs that
Stub convert to Type 5 at the NSSA ABR are allowed
This table shows the differences between the types of areas defined in this document:
Max Age
LS Aging.
Premature aging.
Demand circuit
Options Field
E bit
MC
NP
EA
DC
OSPF V3
Features:
Graceful restart.
OSPF BFD
MultiArea adjacency
Sham link
Autoroute exclude
Inbound filtering
SPF Throttling
Incremental SPF
crytographic authentication.
IPD implementation:
Tasks :
OspfHello
OspfPublic
Ospf private
Tables
General Table
Area Table
IfTable
VirtIfTable
ShamIfTable
TunnelTable
IfMD5 Table
StdIfTable
Neighbor table
This table is unique for each router.It Can be viewed using the "show router ospf
neighbor"
Link State DB
LsdbNbr
LocalLsdbNbr
virtLocalLsdbNbr
Each router's routing table is unique and contains information on how and where to
send packets to other routers.
pipIomRouteInfoChanged -> pipIomUpdateRt -> pipIomAddRouteInfo -> Send a ICC message to iom
ip Q
scenarios
1.ABR
2.DR
3.BDR
4.ASBR
5.new addition