111 Open Shortest Path First OSPF OSPF Overview OSPF Operation By Grace Deng Oct.16.2003.
Ospf
-
Upload
deen-khan -
Category
Technology
-
view
263 -
download
2
description
Transcript of Ospf
![Page 1: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/1.jpg)
Introduction to OSPF
• Open Shortest Path First (OSPF) is a link-state routing protocol based on open standards
– The Open in OSPF means that it is open to the public and is non-proprietary
![Page 2: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/2.jpg)
More on OSPF…• OSPF can be used and configured as a single area for small
networks
– can also be used for large networks if hierarchical network design principles are used (multi-area OSPF)
• What does a hierarchical design mean?
– Multiple areas connect to a distribution area, area 0, also called the backbone
– Allows for extensive control of routing updates
– Defining areas…
• reduces routing overhead, speeds up convergence, confines network instability to an area and improves performance.
![Page 3: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/3.jpg)
Multi-Area OSPF
![Page 4: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/4.jpg)
OSPF Terms - Link
![Page 5: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/5.jpg)
OSPF Terms – Link-State
![Page 6: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/6.jpg)
OSPF Terms –Link-State Database
Every router in the same OSPF area will have the same link-state database
![Page 7: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/7.jpg)
OSPF Terms - Area
Internal Routers
Border Router
![Page 8: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/8.jpg)
OSPF Terms – Cost
![Page 9: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/9.jpg)
OSPF Terms – Forwarding Database (Routing Table)
The lowest cost path is added to the routing table
![Page 10: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/10.jpg)
OSPF Terms –Adjacencies Database
![Page 11: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/11.jpg)
OSPF Terms – Designated Router (DR) and Backup Designated Router (BDR)
The DR and BDR serve as focal points for routing information exchange
DROTHERs
![Page 12: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/12.jpg)
Establishing a Neighbor Relationship with Other Routers
• A neighbor relationship is required for OSPF routers to share routing information
• A router will try to become adjacent, or neighbor, to at least one other router on each IP network to which it is connected (Some routers may try to become adjacent to all their neighbor routers)
• Other routers may try to become adjacent to only one or two neighbor routers
• OSPF routers determine which routers to become adjacent to based on the type of network they are connected to
• Once an adjacency is formed between neighbors, link-state information is exchanged
![Page 13: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/13.jpg)
Types of OSPF Networks
![Page 14: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/14.jpg)
Election of DR and BDR
•The DR acts as the spokesperson for the segment
•All other routers on the segment send their link-state information to the DR
![Page 15: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/15.jpg)
DR and BDR Election as it relates to network types
• The DR sends link-state information to all other routers on the segment using the multicast address of 224.0.0.5
• Disadvantage of DR election…the DR represents a single point of failure…therefore:– A second router is elected as a backup (BDR) in case of DR failure– To ensure that both the DR and the BDR see the link states all routers send on
the segment, the multicast address for all designated routers, 224.0.0.6, is used.
• On point-to-point networks only two nodes exist and no DR or BDR is elected (routers become fully adjacent with each other)
![Page 16: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/16.jpg)
The Hello Protocol
• When a router starts an OSPF routing process on an interface, it sends a hello packet and continues to send hellos at regular intervals– The rules that govern the exchange of OSPF hello packets
are called the Hello protocol– Type field is set to 1 to indicate packet contains hello
information
![Page 17: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/17.jpg)
More on Hello Packets…
• Hello packet timing…– sent every 10 seconds by default on broadcast multi-
access and point-to-point networks– 30 seconds by default on interfaces that connect to
NBMA networks, such as Frame Relay
![Page 18: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/18.jpg)
Single Area OSPF Operations – Step 1: Neighbor Discovery
![Page 19: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/19.jpg)
Single Area OSPF Operations – Step 2: Elect DR & BDR on Multi-Access Networks
We’ll get to what determines which router becomes the DR and which becomes the BDR later…
![Page 20: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/20.jpg)
Single Area OSPF Operations – Step 3: Selecting the Best Route
![Page 21: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/21.jpg)
Single Area OSPF Operations – Step 4: Maintaining Routing Information
![Page 22: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/22.jpg)
Basic OSPF Configuration• To enable OSPF routing, use the global configuration
command syntax:– Router(config)#router ospf process-id
• The process ID is a number that is used to identify an OSPF routing process on the router– Multiple OSPF processes can be started on the same router
– Process ID can be any value between 1 and 65,535
– Most network administrators keep the same process ID throughout an autonomous system (not a requirement)
– It is rarely necessary to run more than one OSPF process on a router
![Page 23: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/23.jpg)
Basic OSPF Configuration• IP networks are advertised as follows in OSPF:
– Router(config-router)#network address wildcard-mask area area-id
• Each network must be identified with the area to which it belongs– The network address can be…
• a whole network
• a subnet
• or the address of the interface
• The wildcard mask represents the set of host addresses that the segment supports
![Page 24: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/24.jpg)
OSPF Priority & DR and BDR Election
• A router with the highest OSPF priority will be selected as the DR– If the network type of an interface is broadcast, the default
OSPF priority is 1– The priorities can be set to any value from 0 to 255– Router with the second highest priority will be the BDR– When OSPF priorities are the same, the OSPF election for DR is
decided on the router ID (highest ID wins)• To modify the OSPF priority on an interface…
– Router(config-if)#ip ospf priority number
• To verify OSPF operation…– Router#show ip ospf interface type number
![Page 25: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/25.jpg)
OSPF Router ID
• When the OSPF process starts, the Cisco IOS uses the highest local active IP address as its OSPF router ID
– If there is no active interface, OSPF process will not start
– If the active interface goes down, the OSPF process has no router ID and therefore ceases to function until the interface comes up again
![Page 26: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/26.jpg)
Loopback Interface• To ensure OSPF stability there should be an active interface for the
OSPF process at all times.– A loopback interface, which is a logical rather than a physical interface,
can be configured for this purpose• When a loopback interface is configured, OSPF uses this address as the
router ID, regardless of the value• On a router that has more than one loopback interface, OSPF takes the
highest loopback IP address as its router ID.
![Page 27: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/27.jpg)
Modifying the Cost Metric• OSPF uses cost as the metric for determining the best
route• Cost is calculated using the formula:
– 108/bandwidth (bandwidth is expressed in bps)
• The Cisco IOS automatically determines cost based on the bandwidth of the interface– You must set the correct interface bandwidth by:
• Router(config)#interface serial 0/0Router(config-if)#bandwidth 64
• The default bandwidth for Cisco serial interfaces is 1.544 Mbps, or 1544 kbps.
![Page 28: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/28.jpg)
More on OSPF Cost• Cost can be changed to influence the outcome of the OSPF cost
calculation
• Use the following interface configuration command to set the link cost:– Router(config-if)#ip ospf cost number
• The cost number can be between 1 and 65,535
![Page 29: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/29.jpg)
Configuring OSPF Authentication
• Each OSPF interface can present an authentication key for use by routers sending OSPF information to other routers on the segment
• The authentication key, known as a password, is a shared secret between the routers
• This key is used to generate the authentication data in the OSPF packet header
• Passwords can be sent as plain text or encryted
![Page 30: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/30.jpg)
For Simple Authentication – Plain Text
• Use the following command syntax to configure OSPF authentication:
– Router(config-if)#ip ospf authentication-key password
• After the password is configured, authentication must be enabled:
– Router(config-router)#area area-number authentication
• Simple Authentication can be easily decoded if a packet sniffer captures an OSPF packet
![Page 31: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/31.jpg)
Encrypted Authentication
• Use the interface configuration command mode syntax:
– Router(config-if)#ip ospf message-digest-key key-id md5 encryption-type key
• The following is configured in router configuration mode:
– Router(config-router)#area area-id authentication message-digest
![Page 32: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/32.jpg)
OSPF Timers (Hello Interval and Dead Interval)
• OSPF routers must have the same hello intervals and same dead intervals to exchange information (very important!)
• By default, the dead interval is four times the value of the hello interval– Means a router has four chances to send a hello packet before
being declared dead• On broadcast OSPF networks…
– the default hello interval is 10 seconds and the default dead interval is 40 seconds
• On nonbroadcast networks…– the default hello interval is 30 seconds and the default dead interval
is 120 seconds• These default values result in efficient OSPF operation and
seldom need to be modified
![Page 33: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/33.jpg)
Configuring OSPF Timers
• To configure the hello and dead intervals on an interface, use the following commands: – Router(config-if)#ip ospf hello-interval secondsRouter(config-if)#ip ospf dead-interval seconds
![Page 34: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/34.jpg)
Configuring a Default Route
• A configured default route is used by a router to generate a gateway of last resort:– Router(config)#ip route 0.0.0.0 0.0.0.0 [interface | next-hop address]
• The following configuration statement will propagate this route to all the routers in a normal OSPF area:– Router(config-router)#default-information originate
![Page 35: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/35.jpg)
Verifying OSPF Configuration
![Page 36: Ospf](https://reader033.fdocuments.us/reader033/viewer/2022042713/546cacfbaf7959294f8b45ff/html5/thumbnails/36.jpg)
Debug & Clear Commands