TRAINING OBJECTIVE:The Student will be familiarized with the operation and
programming of the Cisco Router using the OSPF routing protocol.
Conditions:
EQUIPMENT: The student will be given applicable reference material and a Cisco router in an operational network and a student handbook.
REFERENCES:OSPF Design Guide; Cisco IOS IP and IP Routing Configuration Guide: Configuring OSPF
METHOD OF INSTRUCTION: Lecture with practical exercise.
INTRODUCTION: Note: Show slide #1:
Open Shortest Path First (OSPF) is a routing protocol developed for IP networks by the Interior Gateway Protocol (IGP) working group of the Internet Engineering Task Force (IETF). The group was formed in 1988 to design an IGP based on the shortest path first (SPF) algorithm for use in the Internet. OSPF was created because the Routing Information Protocol (RIP) was, in mid-1980, increasingly unable to serve large networks.
As indicated by the acronym, OSPF has two primary characteristics. The first is that it is open, in that its specifications is in the public domain and was originally described in Request for Comments (RFC) 1131. The most recent version, known as OSPF2, is described in RFC 1583. The second principle characteristic is that it is based on the SPF algorithm, which is sometimes referred to as the Dijkstra algorithm, named for the person credited with its creation.
BODY:
1)Static vs Dynamic Routes (show slides #2):
- Refer to static routes class. Point out that with static routes, they must all be maintained manually.
- All routes must be initially entered.
- When changes are made to the network (routes added or deleted), changes must be entered manually.
- When links go down, route must be deleted from router; when link is restored, route must be added back to router.
- Extremely man power intensive; a lot of room for error.
- Virtually impossible to maintain on very large networks.
Static knowledge is administered manually: A network administrator enters it into the router’s configuration. The administrator must manually update this static route entry whenever an internetwork topology change occurs. Static knowledge can be private – by default it is not conveyed to other routers as part of an update process. You can, however, configure the routers to share this knowledge.
Dynamic knowledge works differently. After the network administrator enters configuration commands to start dynamic routing, route knowledge is updated automatically by a routing process whenever new topology information is received from the internetwork. Changes in dynamic knowledge are exchanged between routers as part of the update process.
2)Routing Protocols (show slide 3):
- RIP: Routing Information Protocol - distance vector type, open.
- IGRP: Interior Gateway Routing Protocol - distance vector, Cisco proprietary.
- OSPF: Open Shortest Path First - link state type, open.
- EIGRP: Enhanced IGRP - balanced hybrid type, Cisco proprietary.
- BGP: Border Gateway Protocol - inter-autonomous system protocol, open
3)OSPF History (show slides 4):
The IETF (Internet Engineering Task Force) was looking for a fast, scalable, efficient interior routing protocol that would replace RIP1. In 1987, work was began on OSPF, and in 1989, OSPF V1 was finalized as RFC 1131. OSPF V2 was defined in 1991, and the latest enhancements released in 1997. OSPF V2 is the standard that is addressed in this section. This standard is defined in RFC 2178. OSPF is a work in progress; features will be added and modified on an as-needed basis.
4)OSPFRelated RFC’s (slides 5):
Show slide; provided for reference.
5)OSPF Featureas (slide 6):
- Open, non-proprietary
- Has no hop count limitation
- Supports VLSM
- Uses multicast addressing for updates
- Has fast convergence
- Allows for routing authentication
-Supports hierarchical routing
- OSPF is “in the public domain”. It is not owned by any one entity and can be used by any vendor.
- Unlike RIP, which has a 15-hop count limitation (if a destination is more than 15 routers away it is deemed unreachable), OSPF has no hop count limitation. OSPF uses metrics or cost assigned to individual links to determine the best path.
- Supports Variable Length subnet masking for efficient IP address allocation.
- Uses IP multi-casting for the sending of link-state updates. This ensures less processing on routers that are not listening to OSPF packets. Also, updates are only sent in case routing changes occur, instead of periodically. This ensures better use of bandwidth.
- OSPF has fast convergence in that it sends out routing changes instantaneously and not just periodically.
- Allows routing authentication by using different methods of password authentication and password encryption.
- OSPF allows for logical definition of networks where routers can be divided into areas. This will limit the “explosion” of routing updates across the entire network and ensures better usage of bandwidth. This also allows routers to be divided into different areas of management based such factors as geographical location.
6)OSPF Hierarchical Routing (show slide 5):
- OSPF network consists of areas within an autonomous system (AS).
- Areas must start with "0".
- Assigned by AS network administrator and only pertain to that AS.
- Autonomous Systems are assigned by InterNIC (network information center).
There are two primary elements in the OSPF hierarchy:
Area – An area is a grouping of contiguous OSPF networks and hosts. OSPF areas are logical subdivisions of OSPF autonomous systems. The topology of each area is invisible to entities in other areas, and each area maintains its own topological database.
Autonomous – OSPF autonomous systems are the largest entity within an OSPF internetwork. They consist of a collection of networks that are under a common administration and share a common routing strategy. An autonomous system, sometimes called a domain, is logically subdivided into multiple areas.
The hierarchical topology of OSPF has several important benefits. Because the topology of an area is hidden from the rest of the autonomous system, routing update traffic can be reduced through route summarization, and the topological databases and SPF trees remain manageable and more efficient.
Within each autonomous system, a central area must be defined as area 0. All others areas are connected off of the central, or backbone area. Area 0 is also called the transition area because all other areas communicate through it. The OSPF backbone also distributes routing information between OSPF areas.
The OSPF backbone has all the properties of a normal OSPF area. Backbone routers maintain OSPF routing information using the same procedures and algorithms as internal routers. The backbone topology is invisible to routers in other areas, while the topologies of individual areas are invisible to backbone routers.
7)OSPF Network Types (slide 8):
There are four network types defined for the OSPF routing protocol.
Point-to-Point: Normally found on serial connections. Neighbor relationships are formed only with the other router on the point-to-point link. Both routers can independently communicate with all other OSPF routers.
Broadcast Multi-access: Normally found on LAN connections. There is a potential for many neighbor relationships since several routers can be on the same segment. Through an election process, a Designated Router for the network is selected. The DR communicates with all other routers regarding the LAN network.
Non-broadcast Multi-access: Routers setup in a hub spoke topology using non-broadcast media such as Frame Relay, x.25, and ATM. Special care must be taken when configuring this network. Neighbor relationships may have to be manually configured.
Point-to-Multipoint: Defined as a numbered point to point interface having more than one neighbor. Occurs when there are sub-interfaces on one end of the point-to-point network.
8)Types of OSPF Routers (slide 9):
- Backbone Router: Has an interface to Area 0 (backbone)
- Area Border Router (ABR): Attaches to multiple area, maintains separate topological databases for each area to which they are connected, and routes traffic destined for or arriving from other areas.
- Internal Router: Has all directly connected networks belonging to the same area. It runs a single copy of the routing algorithm.
- Autonomous System Boundary Router (ASBR): Exchanges routing information with routers belonging to other AS's.
9)OSPF Databases (slide 10):
- Adjacencies Database
(1)Lists Neighbors - routers that share a common segment; normally direct connects.
(2)Established by Hello Packets
- Topology Database
(1)Lists all possible routes
(2)Is established by the Link State Advertisements (LSA's)
- Routing Table Database
(1)Lists best routes
(2)Is developed by the SPF algorithm being applied to the Topology DB
10) Establishing Neighbors (slide 11):
- Read slide - what a hello packet consists of.
Routers that share a common segment become neighbors on that segment using the Hello protocol. Hello packets are sent periodically out of each interface using IP multicast addresses. The Hello protocol serves the primary purposes of neighbor discovery, DR & BDR election, and link integrity verification. Two routers will become neighbors if they agree on the following: (1) must have the same area-id and be on the same subnet/mask; (2) they must both use the same type of authentication and password (if any), (3) the hello and dead intervals must be the same – hello is 10 sec by default and dead is 4 times the hello by default, (interface hello and dead intervals or timers can be manipulated under the interface configuration using the “ip ospf” command.), (4) must agree on the stub area flag – a bit in the hello packet that indicates whether the interface is a stub area.
11) Establishing Neighbors (slide 12):
- Read slide - initial exchange between routers.
Adjacency is the next step after the two routers from a neighbor relationship. Adjacent routers go beyond the hello exchange and proceed to the database exchange. This is a one-time swap of the entire OSPF topology database. Once completed, this is updated with only changes occurring to the database.
12) Establishing Adjacencies and Electing the DR &BDR (slide 13):
- Only applies to a multi-access network (LAN).
- Hello packets elect DR & BDR. Router with highest OSPF priority on a segment will become the DR.
- LSA's are only sent to the DR. The DR represents the multi-access network to other networks. It is the only one that sends LSA's outside the network.
On a multi-access segment, two routers are elected, the designated router (DR) and the backup designated router (BDR). These routers act as the central point of contact for all information exchange on the network. The BDR maintains the same information as the DR and replaces it in the event it fails. Instead of each router on the network exchanging LSA’s with every other router, they simply exchange them with the DR/BDR. This significantly reduces the amount of router-related traffic on the segment. Election of the routers is done using the hello protocol. The router with the highest OSPF priority on a segment will become the DR and the process is then repeated for the BDR. OSPF priority must be set on an interface with a number from 0 to 255. The router with the highest priority is elected the DR. The priority default to 1 and in case of a tie, the highest router ID is used. A value of 0 indicates an interface that can’t be elected DR/BDR.
13) The LinkState Database: (slide 14)
- Also known as the Topology DB.
- Consists of link state records including info about all its interfaces and neighbors. It is a picture of how the router sees the network.
- LinkState Advertisement is a reliable (acknowledged) message.
- Occurs when there are changes within the network and every 30 minutes.
Each router maintains link-state records including information about each of its interfaces and reachable neighbors. Through flooding, each router distributes its state to all other routers in the area/autonomous system. As a result, each router possesses an identical database describing the area/autonomous system. All routers run the SPF algorithm in parallel. Using the link state database, each router then constructs a tree of the shortest paths with itself as the root. Each destination within the AS is contained within the SPF tree.
14) Maintaining Routing Information (Flow Chart) (slide 15):
- Lead class through flow chart
(1)Router receives LSA/LSU (update).
(2)Determines if LSA is already in DB
(3)If no, added to database, flooded to network, and then runs SPF to come up with new routing table. END
(4)If yes, is it the same sequence number, if yes, then ignore.
(5)If sequence number is different, is it newer, if no then send back to source with newer information.
(6)If sequence number is newer, send LSA to DR and add to database, flood network, and run SPF.
LSA’s are handled in a very efficient manner between the source router (attached to the link) and the nearest neighboring router. The incoming LSA is checked against existing entries in the topological database. Each database entry has a sequence number (also called a version number), and only the largest number (indicating the most recent record) is kept. If the entries are identical, then there is no need to forward the LSA to other routers. If the incoming LSA is different from the topological database, then the database is updated and the LSA is forwarded through the network until all databases are synchronized. Associating version numbers with LSA’s contributes to the efficiency of link-state routing technology.
15) Types of LinkState Packets/LSA’s (slide 16 & 17): explain slides together; slide 16 depicts location of LSA in network, slide 17 defines each type of LSA.
- Cover diagram and point out each type
(1)Router
(2)Network
(3)Summary
(4)External
- Cover how OSPF routes show up in the routing table
(1)"O" - OSPF derived intra-area (router LSA)
(2)"IA" - Inter-Area (Summary LSA)
(3)"E1" - Type 1 External Route
(4)"E2" - Type 2 External Route
External Routes (Type 5) fall into two categories, type 1 and type 2. The difference between the two is the way the cost is being calculated. A type 2 route is only the external cost; the internal is not added. A type 1 is the external plus the internal cost to reach a specific destination. Type 2 is the default.
16) Routing Table (slide 18):
- It is developed by running the SPF algorithm on the LSA database.
- Preferred routes placed into table; all possible routes still stored in LSA database.
- Discuss routing table
-cover codes listed at top
-gateway set or not set; gateway is where packet is sent if router does not where to send it.
-lists classful address (example has class B), number of subnets, & number of different masks.
-Connected: lists address of distant interface directly connected, mask (/32) and interface connected on local router.
-OSPF: lists network learned via OSPF; lists distance & metric (110/455), learned via what distant address, time route has been in table, and learned via which router interface.
-BGP: lists network learned, via which address, & amount of time route has been in table.
Administrative distance is the first factor used to determine which routes are placed into the table. If routes have the same distance, the cost or metrics is then used.
17) Distance and Metrics (slide 19):
- Point out that the two numbers at the end of the routing table entry in parentheses are the distance and metric.
18) Administrative Distance (slide 20):
- Administrative distance is a rating of the trustworthiness of a routing information source.
- The higher the value, the lower the trust rating.
- A number from 0 - 255
- Can be manually manipulated.
Administrative distance is a rating of the trustworthiness of a routing information source, such as an individual router or a group of routers. Distance is an integer from 0 to 255. In general: the higher the value, the lower the trust rating. A distance of 255 means the routing information source cannot be trusted at all and should be ignored. Specifying distance values enables the router to discriminate between sources of routing information. The router always picks the route whose routing protocol has the lowest distance.
19) Administrative Distance Defaults (slide 21):
- Read Slide
Administrative distance can be manually configured on the router to give certain routing protocols preference over others. Under the desired routing protocol configuration, use the “distance” command.
Metrics (slide 22):
- Called cost in OSPF
- Used to determine best path to a destination when multiple paths exist.
- Can be used to load share if routing protocol supports it.
The cost (also called metric) of an interface in OSPF is an indication of the overhead required to send packets across a certain interface. The cost of an interface is inversely proportional to the bandwidth of that interface. A higher bandwidth indicates a lower cost. The default formula used to calculate the cost is {cost=108 / bandwidth in bps}. If no bandwidth statement is used, serial interfaces default to 1.544 mbs (T1) and Ethernet defaults to 10 mbs. The bandwidth statement has no actual affect on data transfer rate. It is simply used to calculate the cost of the link. The cost of an interface can be set manually which will override the bandwidth statement. Under the interface use the command “ip ospf cost”. Manipulating the cost of links can make them more or less preferential for use by the router. It is recommended cost be manipulated using the bandwidth statement.
20) OSPF Basic Configuration Commands (slide 23):
- Enable an OSPF routing process (turn on OSPF):
(1)At the router (config)# prompt, type router ospf 1.
(2)Router prompt should read router(config-router)#.
(3)The number 1 is the indicates the OSPF process ID. It is arbitrary.
- Select interfaces which will run OSPF:
(1)At the router(config-router)# prompt, type the network address, wildcard-mask, and area ID. Example - network 148.43.200.1 0.0.0.0 area 0.