Вы находитесь на странице: 1из 16

OSPF

Link state routing protocol


Condition for becoming neighbor
OSPF tables (databases)
possible states of neighbor relationship
OSPF hello packets
OSPF Routers
Hello interval and Dead interval
OSPF configuration
cost in OPSF
Multiarea configuration
Router-id
LSA Types
Challenges in multi-access network (DR/BDR)
understating special OSPF area Types
How to do summarization in OSPF
Virtual link
OSPF authentication
propagating default route in OSPF
verifying OSFP

1
OSFP
• open standard
• link state routing protocol
• AD=110
• classless,FLSM,VLSM,CIDR
• Metric=cost 10^8/BW(bps)
• support cost load balancing, doesn't support unequal cost load balancing.

Link state routing protocol:

• maintain the complete database of the routing structure.


• Like the whole map of the certain city (for eg. )
• So router should be more efficient in
terms of memory and processing
power.

Like EIGRP it maintain 3 tables:

• Neighbor Table (Adjacency Table)


• Topology Table (Link state database)
• Routing Table

Condition for becoming neighbor:


1. Same Hello and Dead interval.
2. Same Area ID
3. Same Authentication
password.
4. Must have same stub area
flag.
5. Must fall in same subnetwork.

OSPF routers sends out hello packets


every 10 seconds on a broadcast and
every 30 secs on a non broadcast link.

Area: Collection of routers and networks. Interfaces falls into area not Router. Neighboring is not formed
between routers but between interfaces.

condition for OSFP Network:


• Area 0 is must.
• Its position must be in such a way that it connects all existing area.
• Area 0 is called backbone area.
• No two area other than Area0 should be directly connected.

Possible states of neighbor relationship:

• Down--->first ospf neighbor state. no hellos has been exchanged.


• Attempt ----> valid only for NBMA.
• Init---> received the hello but the receiving router id was not included.
• 2-Way-->bi-directional comm. has been established.
• Exstart---->After selection of DR and BDR actual process of exchanging link state info. can begin.

2
• Exchange--->In this state router exchange the DDB (Data base description packet)
• Loading---> In this state actual exchange of link-state information occurs.
• Full----> In this state routers are fully adjacent with each other.

Contents of Hello Packets:

• Router ID
• Hello and Dead inerval
• Neighbor list
• Area Id
• priority
• DD and BDR
• Authentication
• Stub Area flag

ospf protocol exchange the following packets.

These packet types interact


to build OSPF neighbor
adjacencies and maintain the
OSPF topology database.

1. Hello - Hello packets are


used to establish and
maintain adjacency with
other OSPF routers. The
hello protocol is discussed in
detail in the next topic.

2. DBD - The Database Description (DBD) packet contains an abbreviated list of the sending router's link-state
database and is used by receiving routers to check against the local link-state database.

3. LSR - Receiving routers can then request more information about any entry in the DBD by sending a Link-
State Request (LSR).

4. LSU - Link-State Update (LSU) packets are used to reply to LSRs as well as to announce new information.
LSUs contain seven different types of Link-State Advertisements (LSAs). LSUs and LSAs are briefly discussed
in a later topic.

5. LSAck - When an LSU is received,


the router sends a Link-State
Acknowledgment (LSAck) to confirm
receipt of the LSU.

OSPF Routers:

1. Internal Router:
2. Backbone Router
3. ABR
4. ASBR

OSPF Multiple Areas:


An ospf area is a logical grouping of

3
routers that are running OSPF with identical topological databases. An area is a subdivision of the ospf routing
domain. Each area runs SPF separately and summaries are passed between each Area.

Problems with OSPF in a single Area:


1. SPF alog runs more frequently. The larger the Area greater the probability of the network changes.
2. The larger the Area the greater the size of the routing table.
3. Large LSDB
4. During SPF calculations:
○ no updates and data will be communicated

Advantages of OSPF multiple Area:


1. reduced frequency of SPF calculations.
2. Localised the problem within the area
3. Create the summarization point, (Summarization can be done only in ABR and ASBR)
4. Smaller Routing tables.
5. Reduced LSU overhead.

OPSF Hello Interval and Dead Interval:


The OSPF Hello interval indicates how often an OSPF router transmits its Hello packets. By default, OSPF Hello
packets are sent every 10 seconds on multiaccess and point-to-point segments and every 30 seconds on non-
broadcast multiaccess (NBMA) segments (Frame Relay, X.25, ATM).
OSPF Hello packets are sent as multicast to an address reserved for ALLSPFRouters at 224.0.0.5. sing a
multicast address allows a device to ignore the packet if its interface is not enabled to accept OSPF packets.
This saves CPU processing time on non-OSPF devices.

The Dead interval is the period, expressed in seconds, that the router will wait to receive a Hello packet before
declaring the neighbor "down." Cisco uses a default of four times the Hello interval.

Setting Hello and Dead Interval:


Router(config)# int fa0/0
Router(config-if)# ip ospf hello-interval 5
Router(config-if)# ip ospf dead-interval 20

OSPF configuration:

Router(config)# router ospf <pid>


Router(config-router) # network <Network-address> <Wildcard -mask> area <area-id>

process id: Local signifcant can rage form 1 to 65535 (2^16)


area-id: 0 to 2^32.

Router(config-router)# network 192.168.5.1 0.0.0.0 area 0


or
Router(config-router)# network 192.168.5.1 0.0.0.255 area 0

4
cost in OSPF:
Cost=108/BW(bps). The cost is applied to the outgoing interface. The routing process will select the cumulative
cost to a remote network.
Changing the default cost:
cost command manually overrides the default.
Router(config)# int s0/0
Router(config-if)# ip ospf cost <cost> (cost is a 16 bit value 0 – 65,535).
you can mange the cost by setting the bandwidth command or setting the reference BW.
Bandwidth command set the BW in kbps (it is used only in cost calculations not the actual BW)
Router(config-router)# auto-cost reference-bandwidth 1000

Multi-area OSPF Configuration:

Router-ID:
The router is known to OSPF by
the OSPF router ID number.
LSDBs use the route id to
differentiate one router from
another.

Choosing Router-Id.
• router-id assigned with
router-id ospf configuration
command.
• Highest IP address of all
configured loopback
interfaces
• Highest IP address of all
configured physical
interfaces.

5
LSA Types:
LSA are the building blocks of LSDB. Individually, they act as database records. In combination, they describe
the entire topology of an OSPF network or area.Link-state updates (LSUs) are the packets used for OSPF
routing updates. An LSU packet can contain ten different types of Link-State Advertisements (LSAs),

1. LSA Type 1- Router LSA: Most common types of LSA.


There is one router LSA Type:1 for every router within
an area. Describe the collective states of the directly
connected links of the router. These LSAs are flooded
only within the area in which they are originated.

2. LSA Type 2 -Network LSA: A type 2 LSA is generated


for every transit broadcast and NBMA network within an
area. Ethernet is an eg of transit network. Type-2 LSA
is sent out by DR and lists all the routers on the
segment it is adjacent to.
3. LSA: Type 3 – Summary LSA (ABR): The ABR
sends type 3 LSAs. Type 3 LSA advertise any
network owned by an area to the rest of the areas
in the OSPF AS. Summary LSAs are flooded
throughout a single area only, but are regenerated
by ABRs to flood into other areas. By default don't
contain any summarization.

6
4. LSA: Type-4 -Summary LSA (ASBR ): ASBR produce this LSA to advertise their presence. It contains
the router id of the ASBR. A type 4 summary LSA is generated by an ABR only when an ASBR exists
within an area. A type 4 LSA identifies the ASBR and provides a route to it. They are regenerated by the

subsequent ABRs to flood throughout the AS. The ASBR sends the Type 1 LSA to with an external bit
set, the ABR then builds LSA Type 5 and flood to the backbone area 0. Its the IP address of the ASBR.
It advertise the location of ASBR.

5. LSA Type 5 – External LSA: This LSA is originated by the ASBR and flooded throughout the AS. It
describe routes to the network outside the AS.

The advertising router-id (ASBR) is unchanged throughout the As. Type 4 LAS is needed to find the
ASBR. By default routes are not summarised.
6. LSA Type- 6: They are specialised LSA and are used in multicast ospf applications.
7. LSA Type -7: type -7 LSA are used in NSSA (not so stubby area). They are originated by ASBR within
NSSA and are flooded only within the NSSA in which they are originated. NSSA ABR translates it into
type 5 LSA, which then propagated into the OSPF domain.

7
Challenges in Multi-access Network:
DR and BDR:
OSPF defines five network types:

1. Point-to-point
2. Broadcast Multiaccess
3. Nonbroadcast Multiaccess (NBMA)
4. Point-to-multipoint
5. Virtual links

A multi-access network is a network with more than two


devices in the same shared media. Ethernet is an
example of broadcast multi-access.
no. of adjacency: n(n-1)/2
Multiaccess networks can create two challenges for OSPF regarding the flooding of LSAs:

1. Creation of multiple adjacencies, one adjacency for every pair of routers.


2. Extensive flooding of LSAs (Link-State Advertisements).

(To illustrate this point, imagine that you are in a room with a large number of people. What if everyone had to
introduce themselves individually to everyone else?)

Solution:
Designated Router/Backup Designated Router:
On multiaccess networks, OSPF elects a Designated Router (DR) to be the collection and distribution point for
LSAs sent and received. A Backup Designated Router (BDR) is also elected in case the Designated Router fails.
All other routers become DROthers (this indicates a router that is neither the DR or the BDR).

DR uses 224.0.0.5 multicast address , while DR other uses 224.0.0.6

The idea behind DR/BDR is that , router have a central point of contact for information exchange. Instead of
each router exchanging updates with every routers on the segment, every router exchanges information with DR
and BDR. The DR and BDR then relay the information to everyone else.

The routers which are neither DR nor BDR are called DR/Other. DROther will only maintain adjacencies with DR
and BDR ( Full State) while it maintain 2-way with other DROther.

DR/BDR Election:
• The router with the highest OSPF priority is selected as DR. The router with the second highest priority value
is the BDR.
• Uses the router ID as the tie-breaker
• The DR election is non-preemptive. I.e If a router with highest priority is added to the network then it doesn't
change the DR/BDR. The only time that a DR or BDR changes is when one of them is out of service.

Note: DR and BDRs are elected on a per network basis. An ospf area can contain more than one IP network, so
each area can (& usually does) have multiple DR and BDR.A router can be configured to win an election on one

8
interface and lose an election on other.

Changing OSPF Priority:


use “ip ospf priority <vlaue>” interface configuration command to change the priority of the interface.
Priority value can be any between 0 to 255. priority 0 indicates that router will not take part in the election and
255 indicates at least a tie.

Router(config)# int fa0/0


Router(cofig-if)# ip ospf priority 100

Routing Table Entries:


O -----> Intra Area
OIA----> Inter Area
OE1---> OSPF external routes
OE2----> OSPF external routes
ON1----> NSSA external routes show up as N1 and N2 instead of E1 and
ON2

OSPF supports two classification of external routes.


E1-cost of routes increments as it passes thru the AS.
E2-(Default) cost of route remains same as it passes thru AS.
Uses:
E2 :is used when there is a single exit point.
E1: is used if there is are multiple path(Have to find the best path)

Understating Special OSPF Area Types:

1. Standard Area
2. Backbone Area
3. Stub Area
4. Totally Stubby Area
5. Not So stubby Area
(NSSA)
6. Not so stubby totally
stubby area

9
1. Standard Area: Accepts link updates, route summaries, and external routes (the default).
2. Backbone Area (Area 0, Transit Area): The OSPF backbone includes all the properties of a standard
OSPF area.
3. Stub area: Doesn't accept routes external to the AS, such as routes from non OSPF source. I.e no type
5 and type 4 LSAs are known inside the AS. LSA Type 4 and 5 are blocked. ABR at the edge of the
stub area use type 3 LSA to advertise a single default route (0.0.0.0) into the area. Stub area can't
contain ASBR expect that ABR itself is ASBR.
Configuration:
Router1(config-router)# area 2 stub
Router2(config-router)# area 2 stub

4. Totally Stubby Area: Doesn't accept external AS routes and summary routes from other areas internal
to the AS. ABR of the Totally Stubby Area block Type 4 and 5 LSAs as well as Type 3 summary LSA
with an exception of a single type 3 LSA to advertise the default route.
Configuration:
Router1(config-router)# area 1 stub no-summary (ABR)
Router2(config-router)# area 1 stub

5. Not-so-Stubby-Area: ASBR can't be located in the stub area. NSSA allows ASBR which is against the
rule of stub area. The ASBR originates type 7 LSAs to advertise the external destinations. The type 7
LSAs are flooded throughout the NSSA but are blocked by the ABR. The ABR converts the type 7 LSA
into a type 5 LSA, which is then propagated through the remainder of the autonomous system.
Configuration:
Router1(config-router)# area 1 nssa
Router2(config-router)# area 1 nssa

Router1(config-router)# area 1 nssa no-summary (NSSA totally stubby area)

10
LAB Example:

Stubby Area”
blocks type 4 and 5 LSA from entering

R1(config-router)# area 2 stub


R2(config-router)# area 2 stub

Default route is automatically inserted into the routing table of R1 by R2 (ABR) for external routes coming from
RIP via redistribution.

O*IA 0.0.0.0/0------------

Totally Stubby Area:


Blocks type 3,4 and 5 LSA from entering.
Totally stubby Area is a cisco proprietary. This restricts routing table to internal routes plus a default routes.

R4(config-router)# area 1 stub no-summary


R5(config-router)# area 1 stub

Not-so-Stubby-Area:
Allows the ASBR in the stub area, which is against the rule. It allows the external routes to the area, since type 5
LSA are blocked, NSSA ASBR produce type 7 LSA which is propagated throughout the area, and the NSSA
ABR translates this LSA to type 5 LSA which then propagated into the OSPF domain.

11
Configuration:
R4(config-router)# area 1 nssa no-summary
R5(config-router)# area 1 nssa

Still R4 has a default route, as of stub area.

How to do summarization in OSPF:

there is no auto summarization in the OSPF. Manual Summarization can occur only in the ABR and ASBR.

12
Summarisation in ABR (R2)
R2(config-router)# area 1 range 192.168. 0.0 255.255.0.0
The command is little feneky. Don't do mistake to type either area 1 or area 2. Area that we want to summarize
should appear in the range command.

OSPF automatically suppresses any routes from area 1 that matches the range command above. So all the
advertisements 192.168.1.0, 2.0,3.0 --------- are going to be suppresses by R2 and advertised only 192.168.0.0
to other Area.

R2# show ip route


0 192.168.0.0/16 is a summary --------------------Null0

Summarisation in ASBR(R4)
R2(config-router)# summary-address 172.16.0.0 255.255.0.0
There is no any area to be included in the summary-address command since it is not the OSPF domain, its the
RIP domain.

13
Virtual Link:

As you first look into the topology you say, impossible.


This condition arises due the bad design of the network. But provides the working environment. This should be
changed in next design.

R2(config)# router ospf 1


R2(config-router)# area 1 virtual-link 3.3.3.3
R2(config-router)# router-id 3.3.3.3

R3(config-router)#area 1 virtual-link 2.2..2


R3(config-router)# router-id 3.3.3.3

Virtual link creates a tunnel interfaces. Area should be given where virtual link belongs. Note that there can be
other router exists between R2 and R3. In spite of it, the configuration is same.

When designing a multi-area OSPF network, all areas should be connected to the backbone area. However,
there may be instances when an area will need to cross another area to reach the backbone area like area 2 in
this case. A virtual link has the following two requirements:
+ It must be established between two routers that share a common area and are both ABRs.
+ One of these two routers must be connected to the backbone.

14
Syntax:

R3(config-router)# area <area-id> virtual-link <router-id>

area-id-----> transit area


router-id --->RID of other ABR

R3# show ip ospf virtual-links

Configuring OSPF authentication:


• null Authentication
• plaintext authentication
• Message Digest (md5 )Authentication

Cisco IOS supports interface based authentication.

Plain text Authentication


Router(config-if)# ip ospf authentication-key <password>
other routers connected through this interface should share the password.

Next enable authentication with the following command.


Router(config)# ip ospf authentication

Message Digest Authentication


Router(config-if)# ip ospf message-digest-key <key> md5 <password>
<key> can be any value between 1-255. must be same in both routers.
Next enable the authentication using the message-digest keyword.

Router(config-if)# ip ospf authentication message-digest

To debug Authentication:
Router# debug ip ospf adj

15
Propagating default route in OSPF domain:

To propagate the default route configured on R3 into the OSPF domain, use the default-information originate
OSPF configuration command.

R3(config)# router ospf 1


R3(config-router)# default-information originate

This propagate the default route as R3 to the other routing domain if and only if default route is cofigured in the
router R3 . If you want to propagate the route in spite of default route configuration in R3 use the always
command at the last.

R3(config-router)# default-information originate always

Verifying OSPF:
1. show ip route
2. show ip protocols -->show ip routing protocol configuration on the router
3. show ip ospf-----> shows ospf process details. For eg. How many times the router has run SPF alog
4. show ip ospf database---> shows the content of topological databases
5. show ip ospf interface---> shows the information how ospf is configured in each of the interfaces also
shows the information about DR/BDR, costs etc.
6. show ip ospf neighbor--->
7. clear ip ospf process

Debug commands:
1. debug ip ospf adj
2. debug ip ospf events

16

Вам также может понравиться