single area ospf - lecture
DESCRIPTION
TRANSCRIPT
1
Single Area OSPFSingle Area OSPF Joanne WagnerJoanne Wagner CCAI, CCNP, CSSPCCAI, CCNP, CSSP
2
Reference Material
Jeff Doyle’s “Routing TCP/IP Vol. I,” John Moy’s book on OSPF OSPF RFC 2328 (2740)
3
OSPF Objectives
Describe OSPF Describe the designated router election
process List OSPF network types Configure OSPF in a single area Verify and troubleshoot OSPF
4
OSPF History
Open Shortest Path First (OSPF) was developed by the Internet Engineering Task Force (IETF) as a replacement for the problematic RIP and is now the IETF-recommended Interior Gateway Protocol (IGP).
OSPF is a link state protocol that, as it’s name implies, uses Dijkstra’s Shortest Path First (SPF) algorithm and that is open – that is, it isn’t proprietary to any vendor or organization.
5
OSPF History (cont)
OSPF has evolved through several RFCs. Version 1 of the protocol was specified in RFC
1131; this version never progressed beyond the experimental stage.
Version 2 was first specified in RFC 1247, and the most recent specification is RFC 2328.
Version 3, which is described in RFC 2740, provides support for IPv6 routing prefixes and the larger size of IPv6 addresses.
6
Notes on OSPF v3 IPv6 requires modifications to a protocol; primarily, the
protocol messages must be modified to carry addresses four times as long as IPv4 addresses.
OSPFv3 uses the same fundamental mechanisms as OSPFv2—the SPF algorithm, flooding, DR election, areas, and so on. Constants and variables such as timers and metrics are also the same.
OSPFv3 is not backward-compatible with OSPFv2. So if you want to use OSPF to route both IPv4 and IPv6, you must run both OSPFv2 and OSPFv3.
7
OSPF Overview Link-state protocols
flood link-state information and allow every router to have a complete view of the network topology.
In OSPF, the shortest path first algorithm (discovered by Dijkstra) determines the best path – the lowest cost path to a link
8
OSPF Advantages
Like all link state protocols, OSPF’s major advantages over distance vector protocols are:• fast reconvergence
• support for much larger interetworks
• less susceptibility to bad routing information
9
Other Features of OSPF
The use of areas, which reduces the protocol’s impact on CPU and memory, contains the flow of routing protocol traffic, and makes possible the construction of hierarchical internetwork topologies.
Fully classless behavior, eliminating such classful problems as discontinuous subnets.
Support of classless route table lookups, VLSM, and supernetting for efficient address management.
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.
10
OSPF vs RIP
OSPF is link-state, where RIP is distance-vector. OSPF has faster convergence - Because of RIP’s hold-
down timer, RIP can be quite slow to converge. OSPF has no hop restriction (used for small and large
networks - RIP to limited to 15 hops (small networks). OSPF supports VLSM; RIPv1 doesn’t Cisco’s OSPF metric is based on bandwidth, RIP’s is based
on hop count Update efficiency - RIP sends entire routing table every 30
seconds, where OSPF only sends out changes when they occur.
OSPF also uses the concept of area to implement hierarchical routing
11
OSPF Metric Based on Cost
CostCost: The outgoing cost for packets transmitted from this interface.
Cost is an OSPF metric expressed as an unsigned 16-bit integer, from 1 to 65,535.
12
Cisco’s OSPF’s Metric is Based on Bandwidth
Cisco uses a default cost of 108/BW, where BW is the configured bandwidth (bandwidth command) of the interface and 108 (100,000,000) as the reference bandwidth.
Example: A serial link with a configured bandwidth of 128K would have a cost of: 100,000,000/128,000 = 781
Note: Bay and some other vendors use a default cost of 1 on all interfaces, essentially making the OSPF cost reflect hop counts.
13
OSPF Areas Every OSPF router must
belong to at least one area Every OSPF network must
have an Area 0 (backbone area)
All other Areas should “touch” Area 0
• There are exceptions to this rule
Routers in the same area have the same link-state information
14
OSPF Neighbor Relationships
OSPF is capable of sophisticated communication between neighbors.
OSPF uses 5 different types of packets to communicate.
15
OSPF Packet Header
16
The OSPF Hello Protocol – Broadcast Networks
OSPF routers send Hellos, usually every 10 seconds by default.
HelloInterval - Cisco default = 10 seconds and can be changed with the command ip ospf hello-interval.
RouterDeadInterval - The period in seconds that the router will wait to hear a Hello from a neighbor before declaring the neighbor down. Cisco uses a default of four-times the HelloInterval (4 x 10 sec. = 40 seconds) and can be changed with the command ip ospf dead-interval.
For routers to become adjacent, the Hello, DeadInterval and network types must be identical!
17
The OSPF Hello Protocol – NonBroadcast Networks
OSPF routers send Hellos, usually every 30 seconds by default.
HelloInterval - Cisco default = 30 seconds and can be changed with the command ip ospf hello-interval.
RouterDeadInterval - The period in seconds that the router will wait to hear a Hello from a neighbor before declaring the neighbor down. Cisco uses a default of four-times the HelloInterval (4 x 30 sec. = 120 seconds) and can be changed with the command ip ospf dead-interval.
For routers to become adjacent, the Hello, DeadInterval and network types must be identical!
18
The Hello Packet
19
A Type-1 Hello Packet
20
OSPF Packet Types
OSPF Type-2 (DBD)
OSPF Type-3 (LSR)
OSPF Type-4 (LSU)
OSPF Type-5 (LSAck)
21
OSPF packet types
OSPF Type-4 packets have 7 LSA packets (later)
22
Router Types
23
Route Types
24
Area Types
25
Steps to OSPF Operation
1. Establishing router adjacencies
2. Electing DR and BDR
3. Discovering Routes
4. Choosing Routes
5. Maintaining Routing Information
26
OSPF States
Down State Init State Two-way State ExStart State Exchange State Loading State Full Adjacency State
27
Steps to OSPF Operation with OSPF States
1. Establishing router adjacencies
• Down State
• Init State
• Two-way State
• (ExStart State unless DR/BDR election needed)
2. Electing DR and BDR
• ExStart State with DR and BDR
• Two-way State with all other routers
3. Discovering Routes
• ExStart State
• Exchange State
• Loading State
• Full State
4. Choosing Routes
5. Maintaining Routing Information
28
1. Establishing Adjacencies – Down State
The new OSPF router is in the down state. The router transmits its own hello packets to introduce itself to
the segment and to find any other OSPF configured routers. Sets the DR and BDR in the hello to be 0.0.0.0
29
1. Establishing Adjacencies – Down State
RTB begins multicasts OSPF Hello packets (224.0.0.5, AllSPFRouters), advertising its own Router ID.
224.0.0.5: All OSPF routers should be able to transmit and listen to this address.
30
1. Establishing Adjacencies – Down State
Router ID = Highest loopback address; highest active IP address. Loopback address has the advantage of never going down, thus
diminishing the possibility of having to re-establish adjacencies. (more in a moment)
Use private ip addresses for loopbacks, so you do not inadvertently advertise a route to a real network that does not exist on your router.
31
1. Establishing Adjacencies – Init State
RTA and RTC receive Hello packets from RTB RTA and RTC add RTB’s Router ID to the
Neighbor ID field of the Hello packet its sends back to RTB, at the same time entering the init state.
32
1. Establishing Adjacencies – Init State
Init State Specifies that the router (RTA and
RTC) has received a hello packet from its neighbor (RTB), but the receiving router’s ID (RTA and RTC) was not included in the hello packet (of RTB).
When a router (RTA and RTC) receives a hello packet from a neighbor (RTB), the router (RTA and RTC) will list the sender’s router ID (RTB) in its hello packet as an acknowledgement that it received a valid packet.
It also includes a list of any other routed IDs it knows about in the hello packet before sending it out on the segment as a multicast.
33
1. Establishing Adjacencies – Two-Way State
From init state to the two-way state RTB receives Hello packets from RTA and RTC (its neighbors),
and sees its own Router ID (10.6.0.1) in the Neighbor ID field. RTB declares takes the relationship to a new level, and declares
a two-way state between itself and RTA, and itself and RTC.
34
1. Establishing Adjacencies – Two-Way State
Two-way state Using Type-1 Hello packets every OSPF router tries to establish
a two-way state or bi-directional communication with every neighbor router on the same IP network.
Among other information, these Hello packets include a list of the sender’s known OSPF neighbors.
A router enters the two-way state when it sees itself in a neighbor’s Hello packet.
To learn about other routers’ link states and eventually build a routing table, every OSPF router must form at least one adjacency and involve a series of progressions that will not just rely just on hellos, but the other four kinds of OSPF packets.
35
1. Establishing Adjacencies – ExStart State
Two-way state to ExStart state (maybe) RTB now decides who to establish a full adjacency with depending upon the
type of network that the particular interfaces resides on. If the interface is on a point-to-point link, the routers becomes adjacent with
its sole link partner and take the relationship to the next level by entering the ExStart state.
If the interface is on a multi-access link RTB must enter an election process to see who it will establish a full adjacency with, and, who will remain in the two-way state.
36
Steps to OSPF Operation with OSPF States
1. Establishing router adjacencies
• Down State
• Init State
• Two-way State
• (ExStart State unless DR/BDR election needed)
2. Electing DR and BDR
• ExStart State with DR and BDR
• Two-way State with all other routers
3. Discovering Routes
• ExStart State
• Exchange State
• Loading State
• Full State
4. Choosing Routes
5. Maintaining Routing Information
37
2. Electing a DR and BDR
On point-to-point links adjacencies (don’t get this confused with being “fully adjacent” or the full state) are established with all neighbors, because there is only one neighbor.
On multi-access networks,OSPF elects a DR and BDR to limit the number of adjacencies.
• Reduce routing update traffic
38
DRDR - Designated Router BDRBDR – Backup Designated Router DR’s serve as collection points for
Link State Advertisements (LSAs) A BDR back ups the DR. If the IP network is multi-access,
the OSPF routers will elect 1 DR and 1 BDR (unless there is only 1 router on the network).
2. Electing a DR and BDR
39
2. Electing a DR and BDR The formation of an adjacency between every
attached router would create many unnecessary LSA (Link State Advertisements), n(n-1)/2 adjacencies.
Flooding on the network itself would be chaotic. A router would flood an LSA to all its adjacent
neighbors, which in turn would flood it to all their adjacent neighbors, and so on, creating many copies of the same LSA on the same network.
To prevent this problem, a Designate Router is elected on multi-access networks.
40
2. Electing a DR/BDR
Designated Router A DR (Designated Router) and perhaps a BDR (Backup Designated
Router) is elected for every multi-access network, using Hello packets as “ballots.”
Router with the highest Router ID is elected the DR. But like other elections, this one can be rigged. The router’s priority field can be set to either ensure that it becomes the
DR or prevent it from being the DR. The router can be assigned a priority between 0 and 255, with 0
preventing this router from becoming the DR (or BDR) and 255 ensuring at least a tie. (The highest Router ID would break the tie.)
41
2. Electing a DR/BDR
Backup Designated Router BDR (Backup Designated Router) is elected in addition to the
DR in case the DR fails. The BDR is the router that wins second place in the previous
process. If a multi-access network only has one router, it will be the DR
and there will be no BDR.
42
2. DR/BDR Election Process
The DR election process works as follows, using data transmitted in Hello Packets.
The first OSPF router on an IP subnet ALWAYS becomes DR. When a second router is added, it becomes BDR.
Additional routers added to the segment become “DROthers”.
43
All other routers, “DRother”, establish adjacencies with only the DR and BDR.
DRother routers multicast LSAs to only the DR and BDR• (224.0.0.6 - all DR routers)
DR sends LSA to all adjacent neighbors • (224.0.0.5 - all OSPF routers)
2. Electing a DR/BDR
DRother Routers
44
Backup Designated Router (BDR)
Listens, but doesn’t act. If LSA is sent, BDR sets a
timer. If timer expires before it
sees the reply from the DR, it becomes the DR and takes over the update process.
The process for a new BDR begins.
2. Electing a DR/BDR
45
Once a DR is established, a new router that enters the network with a higher priority or router id will NOT become the DR or BDR.
If DR fails, BDR takes over as DR and selection process for new BDR begins.
State of the relationship
• DRothers enter ExStart state with DR and BDR and two-way state with all other routers
2. Electing a DR/BDR
46
DR Election Router with the highest interface priority (0 = cannot become
DR or BDR) Router with the highest router ID. BDR is the second highestAdjacencies and multicasting All other routers, DRother, establish adjacencies with only the
DR and BDR. All routers continue to multicast Hello packets to AllSPFRouters
(224.0.0.5) so they can track neighbors. But updates (LSAs) are multicast to DR and BDR only
(224.0.0.6 - AllDRrouters) and in turn DR floods updates (LSAs) to all adjacent neighbors (224.0.0.5 -
AllSPFRrouters)
2. Electing a DR/BDR SUMMARY
47
●Real DR and BDR election process ● The first router up on the network is the DR. ● The second router up on the network is the BDR. ● If the DR fails then the BDR becomes DR and another
router is elected the BDR. ● The DR does not change just because another router
comes on line with a higher priority or a higher router id.
● If both the existing DR and BDR fail and a new DR must be elected, the router with the highest priority is elected DR.
● If there's a tie, the router with the highest router id is elected DR.
Summary of – Real World!!!!
48
Steps to OSPF Operation with OSPF States
1. Establishing router adjacencies
• Down State
• Init State
• Two-way State
• (ExStart State unless DR/BDR election needed)
2. Electing DR and BDR
• ExStart State with DR and BDR
• Two-way State with all other routers
3. Discovering Routes
• ExStart State
• Exchange State
• Loading State
• Full State
4. Choosing Routes
5. Maintaining Routing Information
49
3. Discovering Routes and Reaching Full State
“adjacent”
OSPF Type-2 (DBD)
OSPF Type-2 (DBD)
OSPF Type-2 (DBD)
OSPF Type-5 (LSAck)
OSPF Type-3 (LSR)
OSPF Type-4 (LSU)
OSPF Type-5 (LSAck)
50
3. Discovering Routes
ExStart State ExStart state - prepare for initial database exchange Routers now ready to exchange routing information.
• Between routers on a point-to-point network
• On a multi-access network between the DRothers and the DR and BDR.
Routers in ExStart state are characterized as adjacent, but have not yet become full adjacent as they have not exchanged data base information.
But who goes first in the exchange? ExStart is established by exchanging DBD packets. Purpose of ExStart is to establish a master/slave relationship
between the two routers decided by the higher router id. Once the roles are established they enter the exchange state.
51
Notes on ExStart When the master/slave negotiation begins in the ExStart
state, both neighbors will claim to be the master by sending an empty DD packet with the master/slave bit (MS-bit) set to one.
The DD sequence number in these two packets will be set to the originating router’s idea of what the sequence number should be.
The neighbor with the lower Router ID will become the slave and will reply with a DD packet in which the MS-bit is zero and the DD sequence number is set to the master’s sequence number.
This DD packet is the first packet populated with LSA summaries.
52
3. Discovering Routes and reaching Full State
“adjacent”
OSPF Type-2 (DBD)
OSPF Type-2 (DBD)
OSPF Type-2 (DBD)
OSPF Type-5 (LSAck)
OSPF Type-3 (LSR)
OSPF Type-4 (LSU)
OSPF Type-5 (LSAck)
53
Exchange State Exchange state - routers exchange one or more Type-2 DBDs
(Database Description) packets, which is a summary of the link-state database (type field, originating router, advertising router, sequence number, checksum – NOT metric)
• send LSAcks to verify Routers compare these DBDs with information in its own
database. If the router receives information about a link that is not already
in its database, the router requests a complete update from its neighbor.
Complete routing information is exchanged in the loading state.
3. Discovering Routes
54
Notes on ExChange State
In the Exchange state, the neighbors will synchronize their link state databases by describing all entries in their respective link state databases.
The Database Summary List is populated with the headers of all LSAs in the router’s database; Database Description packets containing the listed LSA headers are sent to the neighbor.
55
Notes on ExChange State (cont) If either router sees that its neighbor has an
LSA that is not in its own database, or that the neighbor has a more recent copy of a known LSA, it places the LSA on the Link State Request list and sends a Link State Request packet asking for a complete copy of the LSA in question.
Link State Update packets convey the requested LSAs. As the requested LSAs are received, they are removed from the Link State Request List.
56
Notes on ExChange State (cont) The master controls the synchronization
process and ensures that only one DD packet is outstanding at a time.
When the slave receives a DD packet from the master, the slave acknowledges the packet by sending a DD packet with the same sequence number.
The slave sends DD packets only in response to DD packets it receives from the master.
57
3. Discovering Routes and reaching Full State
“adjacent”
OSPF Type-2 (DBD)
OSPF Type-2 (DBD)
OSPF Type-2 (DBD)
OSPF Type-5 (LSAck)
OSPF Type-3 (LSR)
OSPF Type-4 (LSU)
OSPF Type-5 (LSAck)
58
Loading State Loading state
• If the other router has more updated information, this router sends a LSR (Link-State Request) packet requesting more information
• Remote router sends the requested information in a LSA Type-4 packet
• Router sends LSAck to acknowledge receipt
Full State Full state - after all LSRs have been updated. At this point the routers should have identical link-state databases
3. Discovering Routes and reaching Full State
59
3. Discovering Routes and reaching Full State
“adjacent”
OSPF Type-2 (DBD)
OSPF Type-2 (DBD)
OSPF Type-2 (DBD)
OSPF Type-5 (LSAck)
OSPF Type-3 (LSR)
OSPF Type-4 (LSU)
OSPF Type-5 (LSAck)
60
4. Choosing Routes
The router now has a complete link-state database
Now the router is ready to create a routing table, but first needs to run the Shortest Path First Algorithm on the link state database, which will create the SPF tree.
61
4. Choosing Routes Dijkstra’s algorithm
is used to calculate the Shortest Path Tree from the LSAs in the link state database.
SPF, Shortest Path First calculations places itself as the root and creating a “tree diagram” of the network
62
The LSAs that build the database contain three important pieces of generic information: RouterID of the sender of the LSA, the NeighborID, and cost of the link between the Router and the neighbor (I.e the state of the link or link-state).
Doyle Chapter 4 and Radia Perlman’s book, Interconnections, has some excellent examples on this process.
4. Choosing Routes
63
Cost = 108/BW OSPF basis routing metrics on cost. Cisco routers, cost = 108/BW BW is the configured bandwidth for an interface (See CCNA IGRP
information) Cisco uses a default cost of 108/BW, where BW is the configured
bandwidth (bandwidth command) of the interface and 108 (100,000,000) as the reference bandwidth.
Example: A serial link with a configured bandwidth of 128K would have a cost of: 100,000,000/128,000 = 781
The cost of a route is the sum of the costs of all the outgoing interfaces to a destination.
In general, cost decreases as the speed of the link increases. RTB’s 10 Mbps Ethernet interface has a lower cost than its T-1, 1.544
Mbps interface.
4. Choosing Routes
64
Cisco default interface costs:
56-kbps serial link—Default cost is 1785
64-kbps serial link—Default cost is 1562
T1 (1.544-Mbps serial link)—Default cost is 65
E1 (2.048-Mbps serial link)—Default cost is 48
4-Mbps Token Ring—Default cost is 25
Ethernet—Default cost is 10
16-Mbps Token Ring—Default cost is 6
FDDI—Default cost is 1
Note: Cisco routers default to T1 (1.544 Mbps) on all serial interfaces and require manual modification with the bandwidth command.
4. Choosing Routes
65
Modifying the cost bandwidth command can be used to change the bandwidth metric on an
interface and used in the 108/BW calculation:
RTB(config)# inter s 0
RTB(config-if)# bandwidth 56 (in Kbps)
Note: The metric for this interface is now 1785.
ip ospf cost is used when converting the metric between routers from different vendors. It overrides the default cost and becomes the metric for that interface.
RTB(config)# inter s 0
RTB(config-if)# ip ospf cost 1000
Note: The metric for this interface is now 1000.
Note: For the Cisco IOS cost formula to be accurate it is important to have
appropriate costs on both sides of a link.
4. Choosing Routes
66
SPF Holdtime SPF algorithm is CPU intensive and takes some time depending upon
the size of the area, the number of routers, the size of the link state database.
A flapping link can cause an OSPF router to keep on recomputing a new routing table, and never converge.
To minimize this problem:• SPF calculations are delayed by 5 seconds after receiving an LSU
(Link State Update)• Delay between consecutive SPF calculations is 10 seconds
You can configure the delay time between when OSPF receives a topology change and when it starts a shortest path first (SPF) calculation (spf-delay). You can also configure the hold time between two consecutive SPF calculations (spf-holdtime).
Router(config-router)#timers spf spf-delay spf-holdtime
4. Choosing Routes
67
5. Maintaining Routing Info
Routes are in the routing table (show ip route)Flooding process When there is a change in a link-state, (down link, new
link information,…) OSPF routers use a flooding process to notify other routers about the change.
The Hello protocol uses its dead interval timer for declaring a link partner down.
If a router doesn’t hear from a link state neighbor for a time period exceeding the dead interval (usually 4 x Hello interval = 40 seconds), it declares that neighbor down.
68
5. Maintaining Routing Info
Flooding Process: Sending out LSUs When the router needs to send out an LSU (OSPF Type-
4) containing the new link-state information, it sends it to:• Point-to-point links (No DR/BDR): LSU sent to
224.0.0.5 AllSPFRouters• Multi-access networks: LSU sent to 224.0.0.6
AllDRrouters (DR/BDR)
• When DR receives and acknowledges LSU, it floods the LSU to 224.0.0.5 AllSPFRouters.
• Each router acknowledges the receipt of the of the LSU with a LSAck back to the DR.
Receiving router(s) continue with the flooding of the LSU.
69
Recalculating SPF Upon receiving an LSU with new information,
OSPF router:
• Updates its link-state database
• After SPF hold timer expires (5 seconds), router runs SPF algorithm and creates a new routing table
• Router uses new routing table
5. Maintaining Routing Info
70
Rtr(config)# router ospf process-idRtr(config-router)#network address wildcard-mask area
area-id
Tells OSPF what interfaces to send and receive updates on. Wildcard is necessary because OSPF supports CIDR and VLSM See McGregor p.167 Tech Note 0.0.0.0 255.255.255.255 means all IP interfaces
Rtr(config)# router ospf 10Rtr(config-router)#network 10.5.1.0 0.0.0.255 area 0
Network Command
71
Bandwidth command
Rtr(config-if)# bandwidth 128 (in Kbps)
Set the bandwidth metric on a specific interface.
ip ospf cost command
RTB(config-if)# ip ospf cost 1000
Configures the cost metric for a specific interface
Bandwidth command and ip ospf cost command
72
Loopback interface
Rtr(config)# interface loopback 0Rtr(config-if)# ip add 10.1.1.1 255.255.255.0 Very useful in setting Router IDs.
Configuring OSPF Router Priority (DR/BDR)
Rtr(config)# interface fastethernet 0Rtr(config-if)# ip ospf priority <0-255> Higher priority becomes DR/BDR Default = 1 0 = Ineligible to become DR/BDR
73
Rtr(config-if)# ip ospf authentication-key passwd
or
Rtr(config-if)# ip ospf message-digest-key key-id md5 [encryption-type] password
password = Clear text unless message-digest is used. Key-id = 1 to 255, must match on each router to authenticate. Encryption-type = 0 to 7, 0 is default, 7 is Cisco proprietary encryption After a password is configured, you enable authentication for the area on
all participating area routers with:
Rtr(config-router)# area area authentication [message-digest]
message-digest option must be used if using message-digest-key If optional message-digest is used, a message digest, or hash, of the
password is sent.
Configuring Authentication
74
RouterA
interface Serial1
ip address 192.16.64.1 255.255.255.0
ip ospf authentication-key secret
!
router ospf 10
network 192.16.64.0 0.0.0.255 area 0
network 70.0.0.0 0.255.255.255 area 0
area 0 authentication
RouterB
interface Serial2
ip address 192.16.64.2 255.255.255.0
ip ospf authentication-key secret
!
router ospf 10
network 172.16.0.0 0.0.255.255 area 0
network 192.16.64.0 0.0.0.255 area 0
area 0 authentication
s1 s2
192.16.64.1/24 192.16.64.2/24
70.0.0.0/8 172.16.0.0/16RouterA RouterB
Configuring Authentication – Clear Text
75
RouterA
interface Serial1
ip address 192.16.64.1 255.255.255.0
ip ospf message-digest-key 1 md5 secret
!
router ospf 10
network 192.16.64.0 0.0.0.255 area 0
network 70.0.0.0 0.255.255.255 area 0
area 0 authentication message-digest
RouterB
interface Serial2
ip address 192.16.64.2 255.255.255.0
ip ospf message-digest-key 1 md5 secret
!
router ospf 10
network 172.16.0.0 0.0.255.255 area 0
network 192.16.64.0 0.0.0.255 area 0
area 0 authentication message-digest
s1 s2
192.16.64.1/24 192.16.64.2/24
70.0.0.0/8 172.16.0.0/16RouterA RouterB
Configuring Authentication – MD5 Authentication
76
Rtr(config-if)# ip ospf hello-interval secondsRtr(config-if)# ip ospf dead-interval seconds
For OSPF routers to be able to exchange information, the must have the same hello intervals and dead intervals.
By default, the hello interval is 4 times the dead interval, so the a router has four chances to send a hello packet being declared dead. (not required)
Defaults On broadcast networks hello interval = 10 seconds, dead interval 40
seconds. On non-broadcast networks hello interval = 30 seconds, dead interval
120 seconds.
Configuring Timers
77
Configuring OSPF timers - WarningA network administrator is allowed to choose these timer values.
A justification that OSPF network performance will be improved is needed prior to changing the timers. These timers must be configured to match those of any neighboring router.
Note: For routers to become adjacent, the Hello, DeadInterval and network types must be identical between routers or Hello packets get dropped!
78
OSPF, propagating a default route
Entrance(config)# ip route 0.0.0.0 0.0.0.0 serial 0
Entrance(config)# router ospf 1
Entrance(config-router)# network 10.0.0.0 0.0.0.255 area 0
Entrance(config-router)# network 11.0.0.0 0.0.0.255 area 0
Entrance(config-router)# default-information originate
ISPEntrance
Engineering
Marketing
ip route 0.0.0.0/0
Static Route
0.0.0.0/0
0.0.0.0/0
Automatically Propagateds010.0.0.0/24
11.0.0.0/24
Engineering and Marketing will have 0.0.0.0/0 default routes forwarding packets to the Entrance router.
79
OSPF Routing Protocol Information
Rtr# show ip protocols
OSPF Specific Information
Rtr# show ip ospf
Number of SPF calculations, timers, area information,...
OSPF Routing Table
Rtr# show ip route
OSPF Show Commands
80
OSPF Interface Information
Rtr# show ip ospf interfaceEthernet0 is up, line protocol is up
Internet Address 206.202.2.1/24, Area 1
Process ID 1, Router ID 1.2.202.206, Network Type BROADCAST, Cost: 10
Transmit Delay is 1 sec, State BDR, Priority 1
Designated Router (ID) 2.2.202.206, Interface address 206.202.2.2
Backup Designated router (ID) 1.2.202.206, Interface address 206.202.2.1
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:00
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 2.2.202.206 (Designated Router)
Suppress hello for 0 neighbor(s)
Serial0 is up, line protocol is up
Internet Address 206.202.1.2/24, Area 1
Process ID 1, Router ID 1.2.202.206, Network Type POINT_TO_POINT, Cost: 64
Transmit Delay is 1 sec, State POINT_TO_POINT,
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:04
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 2.0.202.206
Suppress hello for 0 neighbor(s)
81
RouterB#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
1.5.202.206 1 FULL/DROTHER 00:00:33 206.202.0.3 Ethernet0
1.10.202.206 1 FULL/BDR 00:00:32 206.202.0.4 Ethernet0
1.0.202.206 1 FULL/DROTHER 00:00:30 206.202.0.1 Ethernet0
1.2.202.206 1 FULL/ - 00:00:32 206.202.1.2 Serial0
OSPF routers keep a list of all neighbors that they have established bi-directional communication with.
Displaying Adjacencies
82
Rtr# show ip ospf database
Displays the link state database OSPF routers keep track of all other routers in the internetwork.
Displaying the Link State Database
83
NBMA
Non-Broadcast Multi-access Access Networks.• Frame Relay
• X.25
Without broadcasts and multicasts, DR/BDR election is problematic
84
NBMA Networks and OSPF
85
Router# show ip ospf interface interface number
Router(config-if)# ip ospf network ?
• Broadcast
• nonbroadcast
• point-to-point
• point-to-mulitpoint
Network Types
86
Full meshFull mesh
87
Point-to-pointPoint-to-point uses subinterfaces
88
Point-to-multipointPoint-to-multipoint
89
NBMA (Frame Relay, X.25) non-broadcast - (default on Frame Relay) Uses
DR/BDR. Treats network more like an Ethernet network. Must have either a full-mesh network or frame relay map statements , so that every router on the subnet can communicate with each other.
point-to-multipoint - Works like a collection of point-to-point networks. Routers advertise individual links to other routers, no matter how complicated the frame relay network. Increased bandwidth requirements due to router LSAs and no DR/BDR
point-to-point - Does not scale well for large networks
90
Issues with large OSPF nets
Frequent SPF calculations Large routing table Large link-state table
91
Labs:• 2.3.1Configuring the OSPF Routing Process
• 2.3.2Configuring OSPF with Loopback Addresses
• 2.3.3Modifying OSPF Cost Metric
• 2.3.4Configuring OSPF Authentication
• 2.3.5Configuring OSPF Timers
• 2.3.6Propagating Default Routes in an OSPF Domain e-Labs:
• 2.3.1Configuring OSPF
• 2.3.2Configuring OSPF with Loopback Addresses
• 2.3.3Modifying OSPF Cost Metric
• 2.3.4Configuring OSPF Authentication
• 2.3.5Configuring OSPF Timers
• 2.3.6Propagate Default Route Information in an OSPF Domain
Correct the typo in the lab book
92
Labs 2.3.1Configuring the OSPF Routing Process
• Pay attention on the bits of the mask on each interfaces
• When configuring the OSPF one should use wildcard mask but not subnet mask.
2.3.2Configuring OSPF with Loopback Addresses
• Please remember what we covered in the lecture about the DR/BDR election process.
2.3.3Modifying OSPF Cost Metric
• Modify the cost will change the SPF process
• COD has 2 different types of serial cards installed on the router. Please check the label of your serial card.
• If you have the card labeled “2T”, it is a T1 card and the speed is 1.544 Mb and the OSPF cost is 64.
• If you have the card labeled “2A/S”, it is a Two-Port Asynchronous/Synchronous WIC card and the speed is 128 Kb and the OSPF cost is 781.
93
Labs 2.3.4Configuring OSPF Authentication
• Step 7 Setup up OSPF authentication• b. In the interface configuration mode on Serial 0, enter the command
• ip ospf messagedigest-key 1 md5 7 asecret.
If you receive message such as “%OSPF-3-INVALID_ENCR_PASSWORD : Invalid encrypted password [chars]. “ It is telling you that you are suppose to provide encrypted password, but not clear text password. For the purpose of this lab, just remove the word “7” and move on with the rest of the lab.
Explanation The user-specified encrypted password is invalid. If the specified encrypted password is invalid, an error message will be printed during configuration.
Recommended Action Perform one of the following actions: – Ensure that a clear text password is used and that the service password-encryption command is entered for
password encryption. – Ensure that the specified encrypted password is valid.
2.3.5Configuring OSPF Timers• This lab shows you how to change timer, but don’t do this on the real
operational network unless you talk to your boos why do you want to change the timer.
2.3.6Propagating Default Routes in an OSPF Domain
94
Labs2.3.4Configuring OSPF
Authentication• Step 7 Setup up OSPF authentication
• b. In the interface configuration mode on Serial 0, enter the command: ip ospf messagedigest-key 1 md5 7 asecret. This is how it really works
No 7 encryption type
Now you see the 7
Service password-encryption
95
Labs Errata
96
The End Questions?
What will be the result of the DR and BDR elections for this single area OSPF network? (Choose three.)
HQ will be DR for 10.4.0.0/16.
Router A will be DR for 10.4.0.0/16.
HQ will be BDR for 10.4.0.0/16.
Router A will be DR for 10.5.0.0/16.
Remote will be DR for 10.5.0.0/16.
Remote will be BDR for 10.5.0.0/16.
*. Decision process:
1. Which segment will have election?
2. Priority?
3. Router ID (each router will only has 1 ID)?
1. Highest Loopback IP address?
2. Highest physical IP address (include serial interface)?
97
The End Questions?
The routers in the diagram are configured as shown. The loopback interface on router R1 is labeled as lo0. All OSPF priorities are set to the default except for Ethernet0 of router R2, which has an OSPF priority of 2. What will be the result of the OSPF DR/BDR elections on the 192.1.1.0 network? (Choose two.)
R1 will be the DR
R1 will be the BDR
R2 will be the DR
R2 will be the BDR
R3 will be the DR
R3 will be the BDR
*. Decision process:
1. Which segment will have election?
2. Priority?
3. Router ID (each router will only has 1 ID)?
1. Highest Loopback IP address?
2. Highest physical IP address (include serial interface)?
98
Lesson you should have learned from this module
What is link state routing protocol? Know how to setup OSPF route and network statement
with wildcard mask and area ID How to setup and calculate “cost” What are the show commands and what do they do? DR and BDR election process Setup default route Setup authentication