TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to...

47
TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration • RIP RIP-1 v.s. RIP-2 RIP for IPv6 • OSPF Review of link state routing Modified Dijkstra’s algorithm for finding multiple paths Packet types LSA (Link state advertisements) Lollipop Sequence number OSPF for IPv6 (Section 6.7. Read on your own)
  • date post

    19-Dec-2015
  • Category

    Documents

  • view

    239
  • download

    3

Transcript of TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to...

Page 1: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-1

Unit 2: Interior Routing Protocols: RIP and OSPF

• Introduction to Cisco Router Configuration

• RIP– RIP-1 v.s. RIP-2

– RIP for IPv6

• OSPF– Review of link state routing

– Modified Dijkstra’s algorithm for finding multiple paths

– Packet types• LSA (Link state advertisements)

• Lollipop Sequence number

• OSPF for IPv6 (Section 6.7. Read on your own)

Page 2: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-2

Cisco Router Configuration

Glossary Of Terms And Acronyms

Cisco IOS - Cisco Internetworking Operating System

CLI - Command Line Interface

EXEC - Command line session to the router (could be console, modem, or telnet)

Flash - Non-Volatile Memory used to store IOS software image

NVRAM- Non-Volatile RAM used to store router configuration

RAM - Random Access Memory

Page 3: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-3

CLI Architecture

• CLI can be accessed through one of the following

• console connection

• modem connection, or

• a telnet session.

• referred to as an EXEC session

• user EXEC level – limited amount of basic monitoring

• privileged EXEC level – access all router commands, including critical commands such as configuration and management.

Router> enable

Password: [enable password]

Router#

disable Router>

Page 4: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-4

Global Command: A single-line command that affects the function of the whole unit

Major Command: A command that indicates a particular interface or process that is being configured. It must be followed by subcommands.

Subcommand: used after a major command to configure a process or interface

Configuration mode

Page 5: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-5

CLI Editor Features

Context Sensitive Help

• question mark (?) to get help

• Word help - obtain a list of commands that begin with a particular character sequence. Example:

Router# co? configure connect copy

• Command syntax help - obtain a list of command, keyword, or argument options that are available based on the syntax the user has already entered. Enter a question mark (?) in the place of a keyword or argument. Example:

Router# configure ? memory Configure from NV memory network Configure from a TFTP network host overwrite-network Overwrite NV memory from TFTP network host terminal Configure from the terminal <cr>

Page 6: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-6

Command Syntax Check

• router will inform the user and indicate where the syntax error has occurred. A caret symbol (^) will appear underneath the incorrect command, keyword, or argument. Example:

Router(config)#interface ethernat ^% Invalid input detected at '^' marker.

Command Abbreviation

Commands and keywords can be abbreviated to the minimum number of characters that identifies a unique selection. For example, you can abbreviate the "configure" command to "conf" because "configure" is the only command that begins with "conf". You could not abbreviate the command to "con" because more than one command could fit this criteria. The router will issue the following error message if you do not supply enough characters.

cisco(config)#I % Incomplete command

Page 7: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-7

Backspace - Removes one character to the left of the cursor.

TAB - Finishes a partial command.

Ctrl-A - Moves the cursor to the beginning of the current line.

Ctrl-R - Redisplays a line.

Ctrl-U - Erases a line.

Ctrl-W - Erases a word.

Ctrl-Z - Ends configuration mode and returns to the EXEC.

Up Arrow - Allows user to scroll forward through former commands.

Down Arrow

- Allows user to scroll backward through former commands.

Hot Keys

(See more on page 13 in the text)

Page 8: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-8

Router> enable - switches to privileged EXEC level Router# configure terminal - switches to global configuration levelRouter(config)# enable secret cisco - configures router with an enable secret (global)Router(config)# ip route 0.0.0.0 0.0.0.0 20.2.2.3 - configures a static IP route (global)Router(config)# interface ethernet0 - switches to configure the ethernet0 interface Router(config-if)# ip address 10.1.1.1 255.0.0.0 - configures an IP address on ethernet0 (interface)Router(config-if)# no shutdown - activates ethernet0 (interface)Router(config-if)# exit - exits back to global configuration levelRouter(config)# interface serial0 - switches to configure the serial0 interfaceRouter(config-if)# ip address 20.2.2.2 255.0.0.0 - configures an IP address on serial0 (interface)Router(config-if)# no shutdown - activates serial0 (interface)Router(config-if)# exit - exits back to global configuration levelRouter(config)# router rip - switches to configure RIP routing engineRouter(config-router)# network 10.0.0.0 - adds network 10.0.0.0 to RIP engine (routing engine)Router(config-router)# network 20.0.0.0 - adds network 20.0.0.0 to RIP engine (routing engine)Router(config-router)# exit - exits back to global configuration levelRouter(config)# exit - exits out of configuration levelRouter# copy running-config startup-config - saves configuration into NVRAMRouter# disable - disables privileged EXEC levelRouter> - indicates user is back to user EXEC level

Router Configuration

Entering Configurations: An example

Page 9: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-9

Command Description

Configure terminal

Executes configuration commands from the terminal. Use this command to make changes to the configuration file from the console port or a telnet session. Once changes are entered, press <Ctrl-Z> to end the update mode session.  

Configure memory

Executes configuration commands stored in NVRAM 

Configure network

Retrieves configuration commands are stored in a network server and load that configuration into memory. You will be prompted for the IP address of the TFTP (Trivial FTP) server to connect to, as well as the configuration filename.

Table 3.1 in text

Page 10: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-10

Removing Commands / Resetting Default Values

navigate to the proper location and type "no" followed by the command to be removed.

Router> enable - switches to privileged EXEC levelRouter# configure terminal - switches to global configuration level Router(config)# interface ethernet0 - switches to configure the ethernet0 interfaceRouter(config-if)# no ip address - removes IP addressRouter(config-if)# exit - exits back to global configuration levelRouter(config)# exit - exits out of configuration levelRouter# disable - disables privileged EXEC levelRouter> - prompt indicates user is back to user EXEC level

Some configuration commands in IOS are enabled by default and assigned a certain default value. When left at the default value, these commands will not be displayed when the configuration is listed. If the value is altered from the default setting, issuing a "no" form of the command will restore the value to the default setting.

Page 11: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-11

Saving Configurations

•configurations in two locations - RAM and NVRAM. •The running configuration is stored in RAM.

•Any configuration changes to the router are made to the running-configuration and take effect immediately after the command is entered.

•The startup-configuration is saved in NVRAM and is loaded into the router's running-configuration when the router boots up.

• To save the running-configuration to the startup configuration, type the following from privileged EXEC mode (i.e. at the "Router#" prompt.)

Router# write mem

Page 12: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-12

Router Management

Some common commands for displaying information.

Displaying Configurations

Router#sh conf - show NVRAM configuration

Router#wri term - Display running

configurationDisplaying Software Version And More

Software Version - IOS software version (stored in flash)Bootstrap Version - Bootstrap version (stored in Boot ROM)System up-time - Time since last rebootSystem restart info - Method of restart (e.g. power cycle, crash)Software image name - IOS filename stored in flashRouter Type and Processor type - Model number and processor typeMemory type and allocation (Shared/Main) - Main = Processor RAM - Shared = Packet I/O bufferingSoftware Features - Supported protocols / feature setsHardware Interfaces - Interfaces available on routerConfiguration Register - Bootup specifications, console speed setting, etc.

Page 13: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-13

Example output of Router#wri term

Page 14: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-14

Page 15: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-15

Displaying Interface StatesTo view information about a particular interface, use the show interface command. The show interface command provides the following list of important information:

Interface State (e.g. UP, DOWN, LOOPED)

Protocol addresses

Bandwidth

Reliability and Load

Encapsulation type

Packet Rates

Error Rates

Signaling Status (i.e. DCD,DSR,DTR,RTS,CTS)

Page 16: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-16

Page 17: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-17

RIP1 (RFC 1058) and (RFC 1388) RIP2

       distance-vector protocol using hop-count as metric

       infinity value is 16 hops

       announces (distance vectors) sent to neighbors every 30 seconds; time out in 180 sec every

       split horizon with poisoned reverse

       encapsulated in UDP: Well known port 520       Included in RIP-maintained routing table:

- address of (net/subnet/host) destination

- metric associated with destination 2

- address of next hop router

- recently-updated flag-updated flag

- several timers several timers FC

Page 18: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-18

RIP-1 Message Format

Figure 13-8 Response message

Supposed to support a variety of protocols. But in practice only TCP/IP uses it.

Page 19: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-19

RIP-2

•compatible upgrade to RIP v1 including subnet routing, authentication, CIDR aggregation, route tags and multicast transmission t

•RFC 2453 includes background and protocol definition

Subnet Support

•RIP-1 supports subnet routes only within the subnetted network (suing single subnet mask)

•RIP-2 includes subnet mask in the messages. This allows for subnet knowledge outside subnet

•More convenient partitioning using variable-length subnets

Distinguish multiple domains running on the same wire/subnet

Page 20: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-20

10.1.0.0(255.255.0.0)

10.2.0.0(255.255.0.0)

10.0.0.0 (255.0.0.0)

10.0.0.0 (255.0.0.0)

C

FE

A

D

B

Routing per subnet

Page 21: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-21

Next Hop

Authentication

RIP-1 is completely not secure; anyone can act as a router just by sending RIP-1 messages (e.g. advertise cost 0 and everyone will use that route)

RIP-2 supports generic notion of authentication, but only “password” is defined so far. Still not very secure.

At least prevents some “accidents” reasonably well

Page 22: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-22

Authentication

Page 23: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-23

Variable-length subnetting

Page 24: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-24

Multicasting

Broadcast on a local link will be sent to all nodes including hostsRIP-2 uses 224.0.0.9 – Multicast address to routers only3 modes:

oSend RIP-1 packets in broadcast mode - When most routers are not yet upgraded)oSend RIP-2 packets in broadcast mode - When some routers are still RIP-1)oSend RIP-2 packets in multicast mode – When all routers are upgraded to RIP-2

RIPng for IPv6Almost the same as IPv6 exceptThe use of Ipv6 security instead of RIPv2 authentication entriesChange in the packet formats in order to carry the longer Ipv6 addresses

(Skip section 5.6)

Page 25: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-25

Some Cisco commands related to configuration of RIP

• router1 (config)# router rip enable rip routing process

router1 (config-router) network A.B.C.D

• router1 (config-router)# passive interface S0 stop router sending updates

through this interface

• router1 (config-router)#neighbor W.X.Y.Z allow updates to be sent to a

neighbor connected by a

non-broadcast network

• router1# show ip route

• router1# show ip protocol

Page 26: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-26

Link State Routing• Dynamic

• Sharing knowledge about the neighborhood- link states: who I am directly connected to and the distance (based on minimum delay, maximum throughput, cost, hop counts etc.)

• Sharing with every other router – broadcast by flooding

• Sharing when there is a change

• OSPF (Open Shortest Path First), the newer Internet routing protocol is an example.

• General steps– Hello: discovering reachability

– Build link state packets (advertisements)

– Broadcast the link state packets: initially and when there are changes

– Build a map from the received link state packets

– From the map calculate the shortest path

Page 27: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-27

Multiple metricsCan support fine-grained metrics (vs. RIP)Multiple metrics

oThroughput, Delay, Cost, ReliabilityCan computer a different routing table for each metric.OSPFv2 supports an extension that allows the metric to be used specified in the packet.

OSPF: Areas within an AS

•Backbone router: connect only to the backbone area (Area 0)

•Area border router: attaches to multiple areas.

•Internal router: all interfaces connected to the same area.

•AS boundary router: connect to other ASes

Page 28: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-28

Example Cisco configuration:

Router1 e0/0 120.1.1.1

Router2 e0/0 120.1.1.2

Router2 e0/1 150.1.1.1

Router3 e0/0 150.1.1.2

Router1:Router1(config)# router ospf 10Router1(config-router)# network 120.0.0.0 0.255.255.255 area 0

Router2:Router2(config)# router ospf 10Router2(config-router)# network 120.0.0.0 0.255.255.255 area 0

Router2(config-router)# network 150.1.0.0 0.0.255.255 area 1

Router3:Router3(config)# router ospf 10Router3(config-router)# network 150.1.0.0 0.0.255.255 area 1

Area 0

Area 1

OSPF process ID

Wildcard mask: like an inverse subnet mask

Page 29: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-29

Point-to-point link

Page 30: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-30

Virtual link: When the link between two routers is broken, a virtual link can be created to go through other routers (usually more than one).

Stub link

Transient link

Page 31: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-31

An Example Internet

Graphical representation of the internet

5 5

Page 32: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-32

Dijkstra’s Algorithm

1. Initialize the set E to contain only the source node S and R to contain all other nodes. Initialize the list of paths O to contain the one segment paths starting from S. Each of these paths has a cost equal to the corresponding link’s metric. Sort list O by increasing metrics.

2. If list O is empty, or if the first path in O has an infinite metric, mark all nodes left in R as unreachable. The algorithm has terminated.

3. First examine P. the shortest path in list O. Remove P from O. Let V be the last node in P. If V is already in set E, continue at step 2. Otherwise, P is the shortest path to V. Move V from R to E.

4. Build a set of new candidate paths by concatenating P and each of the links starting from V. The cost of these paths is the sum of the cost of P and the metric of the link appended to P. Insert the new links in the ordered list O, each at the rank corresponding to its cost. Continue at step 2.

Page 33: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-33

Permanent (E) (each cell includes the entries in the previous rows)

Tentative (R) Paths (O)

A B, C, D, E, F, N1, N2, N3, N4, N5

A N1 (5) A D (8)

N1 [A N1 (5)] B, C, D, E, F, N2, N3, N4, N5 AN1B (5) AN1C (5) AD (8)

B [A N1B (5)] C, D, E, F, N2, N3, N4, N5 AN1C (5) AD (8) AN1BE (10)

C [A N1C (5)] D, E, F, N2, N3, N4, N5 AN1CN2 (7) AD (8) AN1BE (10)

N2 [AN1CN2 (7)]

D, E, F, N3, N4, N5 AD (8) AN1BE (10)

D [AD (8)] E, F, N3, N4, N5 AN1BE (10) ADN3 (10)

E [AN1BE (10)] F, N3, N4, N5 ADN3 (10) AN1BEN4 (12) AN1BEN3 (15)

N3 [ADN3 (10)] F, N4, N5 ADN3E (10) ADN3F (10) AN1BEN4 (12) AN1BEN3 (15)

Shortest path already exists to E F, N4, N5 ADN3F (10) AN1BEN4 (12) AN1BEN3 (15)

F [ADN3F (10)] N4, N5 AN1BEN4 (12) AN1BEN3 (15) ADN3FN5 (15)

N4 [AN1BEN4 (12)] N5 AN1BEN3 (15) ADN3FN5 (15)

Shortest path already exists to N3

N5 ADN3FN5 (15)

N5[ADN3FN5 (15)]

Page 34: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-34

Multiple paths using a modification of Dijkstra’s Algorithm (Equal Cost)

1. Initialize the set E to contain only the source node S and R to contain all other nodes. Initialize the list of paths O to contain the one segment paths starting from S. Each of these paths has a cost equal to the corresponding link’s metric. Sort list O by increasing metrics.

2. If list O is empty, the algorithm has terminated.

3. First examine P. the shortest path in list O. Remove P from O. Let V be the last node in P. If V is already in set E, check continue at step 4. Otherwise, P is the shortest path to V. Move V from R to E. Continue at step 5.

4. If the metric of path P between S and V is equal to the previously computed distance between S and V, we have found an “equal cost path” to V. If it is larger, we should ignore P. In all cases, continue at step 2.

5. Build a set of new candidate paths by concatenating P and each of the links starting from V. The cost of these paths is the sum of the cost of P and the metric of the link appended to P. Insert the new links in the ordered list O, each at the rank corresponding to its cost. Continue at step 2.

Page 35: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-35

Permanent (E) (each cell includes the entries in the previous rows)

Tentative (R) Paths (O)

A B, C, D, E, F, N1, N2, N3, N4, N5

A N1 (5) A D (8)

N1 [A N1 (5)] B, C, D, E, F, N2, N3, N4, N5 AN1B (5) AN1C (5) AD (8)

B [A N1B (5)] C, D, E, F, N2, N3, N4, N5 AN1C (5) AD (8) AN1BE (10)

C [A N1C (5)] D, E, F, N2, N3, N4, N5 AN1CN2 (7) AD (8) AN1BE (10)

N2 [AN1CN2 (7)]

D, E, F, N3, N4, N5 AD (8) AN1BE (10)

D [AD (8)] E, F, N3, N4, N5 AN1BE (10) ADN3 (10)

E [AN1BE (10)] F, N3, N4, N5 ADN3 (10) AN1BEN4 (12) AN1BEN3 (15)

N3 [ADN3 (10)] F, N4, N5 ADN3E (10) ADN3F (10) AN1BEN4 (12) AN1BEN3 (15)

E [ADN3E (10)] (An additional shortest path. Do not expand)

F, N4, N5 ADN3F (10) AN1BEN4 (12) AN1BEN3 (15)

F [ADN3F (10)] N4, N5 AN1BEN4 (12) AN1BEN3 (15) ADN3FN5 (15)

N4 [AN1BEN4 (12)] N5 AN1BEN3 (15) ADN3FN5 (15)

The above path to N3 is longer than the existing shortest path ignore

N5 ADN3FN5 (15)

N5[ADN3FN5 (15)]

Page 36: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-36

OSPF Packet Types

•Hello: Establishes and maintains neighbor relationships.

•Database Description: When a router just came up, it cannot wait for all link state packets. Neighbors will send it a database description (not the full database but like an outline). From this, the router can then ask for information it does not have. Describes the contents of the topological database.

•Link-state Request: Requests pieces of the topological database from neighbor routers. These messages are exchanged after a router discovers (by examining database-description packets) that parts of its topological database are out of date.

•Link-state Update: Responds to a link-state request packet. These messages also are used for the regular dispersal of LSAs. Several LSAs can be included within a single link-state update packet.

•Link-state Acknowledgment: Acknowledges link-state update packets.

Page 37: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-37

Link-state advertisement types

•Router Links (RL) are generated by all routers. These links describe the state of the router interfaces inside a particular area. These links are only flooded inside the router's area.

•Network Links (NL) are generated by a DR (Designated Router) of a particular segment; these are an indication of the routers connected to that segment.

•Summary Links (SL) are the inter-area links (type 3); these links will list the networks inside other areas but still belonging to the autonomous system. Summary links are injected by the ABR (Area Border Router) from the backbone into other areas and from other areas into the backbone. These links are used for aggregation between areas.

•Asbr-summary links are type 4 links that point to the ASBR (Autonomous System Boundary Router). This is to make sure that all routers know the way to exit the autonomous system.

•External Links (EL), these are injected by the ASBR into the domain.

Page 38: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-38

Router Link LSA (6.5.2 in text)

(Details later)

= 1 ExternalRoutingCapability (eg. Non-stop area, backbone etc.) = 1 Border Router

(Depends on type of link)(Depends on type of link)

(Type of Service)

(Default)

Router Link – defines the links of a true router

Page 39: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-39

Link Type Link Identification Link Data Type 1: Point-to-point connection to another router

Address of neighbor router

Interface number

Type 2: Connection to any-to-any network

Address of designated router

Router address

Type 3: Connection to stub network

Network address Network mask

Type 4: Virtual link

Address of neighbor router

Router address

Page 40: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-40

Network link – defines the links of a network.

Network links (6.5.3 in text)

(All attached routers)

Page 41: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-41

Summary link to network

Summary link to AS boundary router

Page 42: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-42

Summary links (6.5.4 in text) to network or to AS boundary router

or Type: 4

(All 0’s for type 4)

External link

Page 43: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-43

External links (6.5.5 in text)

(May provide a better route)

(Used by other protocols)

Multiple Areas: Example

Page 44: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-44

LSA (Link State Advertisement) header

Link state age: # of sec since the message is generated

E flag: set to 0 for a stub area. E stands for external capability

T flag: set if the router can handle multiple types of service

Link state ID: Depends on the link state type. Usually an IP address of a router or network.

Advertising router: IP address of the advertising router

Link state checksum: cover the entire packet except for the age field

Length: Length of the whole packet in bytes

Page 45: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-45

Problem: router failure

• A failed router and comes up but does not remember the last sequence number it used before it crashed

• New LSPs may be ignored if they have lower sequence number (sequence number wraps around)

One solution: LSP Aging

• Nodes periodically decrement age of stored LSPs

• LSPs expire when TTL reaches 0

– LSP is re-flooded once TTL = 0

• Rebooted router waits until all LSPs have expired

• Trade-off between frequency of LSPs and router wait after reboot

– Age too small frequent updates

– Age too large router wait long time on rebooting

Page 46: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-46

A better solution: Lollipop sequence space

Let N = 232/2 = 231. Divide sequence space into 3 spaces:

– -N + 1 to 0 (negative space)

– 0 to N-2 (positive space)

– -N and N-1 (illegal)

• Router comes up and starts with –N+1, then –N+2 etc.

• When seq number becomes positive, wrap around and stay in the positive space

• Suppose a < b:

a is older than b if:

– a < 0

– a > 0 and b - a < (N-1)/2, (i.e., smaller than a half circle)

a is newer otherwise

Page 47: TDC 563-98-301/302, Spring 2002 2-1 Unit 2: Interior Routing Protocols: RIP and OSPF Introduction to Cisco Router Configuration RIP –RIP-1 v.s. RIP-2 –RIP.

TDC 563-98-301/302, Spring 2002

2-47

Lollipop cont.

• Newly booted router always starts with oldest seq num (-N + 1)

• New rule:

– if router R1 gets older LSP from router R2, R1 informs R2 of the seq number in R1’s LSP

• Newly booted router discovers its seq number before it crashed and resumes

• Aging still needed to flush out old states:

– suppose a router is down but not detected

– net partitions and then heals