CCIE chapter 9 OSPF Resources used: Cisco Press CCNP Self-Study BSCI Official Exam Certification Guide 3th Edition CCIE Professional Development Routing TCP-IP Volume I CCIE Routing and Switching Exam Certification Guide 3rd Edition Is a link state protocol, link state each router has a detailed view of all links and there current states. Runs the Dijkstra algorithm to find the best path. OSPF terms, Neighbours are routers that are directly connected ( share a subnet) Adjacency , when two routers have exchanged routing information and have the same topology table Area, a group of routers that all have the same Area id, area is defind on a per interface basis. Is a 32 bit number can be decimal or octets, 257 is the same as 0.0.1.1 Back up designated router, a backup DR (designated router) it does none of the DR roles while the DR is active. DR, a router that is responsible for forming adjancies with all routers on a LAN segment , DRother, a normal router, neither DR or BDR Cost, metric used by ospf, higher the speed, lower the cost. Database descriptor packet(DDP), used during the exchange of topology information during the forming of an adjacency, they are a cut down LSA (link state advertisement) Init state, a state when hello packets are being sent by the router and it is waiting for a reply so it can start to forum a relationship. Internal router, a router that has all its interfaces in the same area. Link-state database, also known as topology map, contains the information about all know links and all known networks. Link state request (LSR), when a router get a database descriptor that doesn’t match any of its known links it will send a link state request, to ask for a full LSA of that link to be sent. Link state update (LSU) , sent in response to the LSR Loading state, the state where LSR’s and LSU’s are sent and received is known as the loading state. Link state Advertisement ( LSA) sent when something in the topology changes ( link up/link down) there are many types of LSA and they must be acknowledged by the receiving router(Hello is acknowledged by been seen as a neighbour in that neighbours hello packets: 1 Hello 2 Database Description 3 Link State Request 4 Link State Update 5 Link State Acknowledgment Neighbour table, a list of neighbours that have been found via hello multicasts, the hello packet also has a list of all known neighbours from the router that sent it. Priority, thing, that allows for control of the DR/BDR election from 0 to 255 (1 is default, 0 cant be elected DR or BDR) SPF (shortest path first) tree , created after the dijkstra algorithm has been run, it is a tree of the world with the router as the root. RxmtInterval, how long a router will wait to retransmit a packet that hasn’t been acknowledged, by default 5 seconds. Hello packets, are sent every 10 seconds on multicast address 224.0.0.5 Hello packets are sent every 30 seconds on NBMA networks via unicast Dead interval 40 seconds ( 4 hello’s) on multicast and 120 ( 4 hello’s) on NBMA Equal cost load balancing, up to 6 links. Timed updates, ospf will send DDPs of all its routes to its neighbours once every 30mins if there have been no changes. Maxage timer, how long an LSA can stay in the topology table before being aged out unless refreshed default 3600 seconds LS-Refresh timer, how long is waited until an LSA refreshed, makes the maxage timer reset, default 1800. lsa-group-pacing, 240 seconds , use to hold back LSA’s from refreshing so more can be sent as once. So refreshing LSU’s are sent every 240 secs containing many LSA. Poll internal, on NBMA( neighbour statement)how long the interval between hellos when a Neighbour down. Flood pacing, min interval between flooding an LSA , default 33ms Retransmission pacing, min interval between sending a retransmission The designated router: If more then one router is connected to a segment the there must be a DR router election, the election can be controlled by used a priority command on a per interface basis. Default priority is 1 If the priority command isn’t used and the election isn’t controlled then the default is to use high router id ( ip address). 224.0.0.6, is the destination ip address used by non DR/BDR routers when sending LSA’s ( LSU,LSR,ACK ) known as AllDRouters (note: hello’s still via .5) 224.0.0.5 all packets originating from the DR/BDR routers have this destination known as AllSPFRouters The DR and BDR election, The neighbour with the highest priority becomes the BDR, If there is no DR then the BDR is promoted to DR and the first step repeats for the BDR. Routing tables are built in two different ways. Either established databases have to adjust to a change in the network, or a new router has to create the topology and forwarding databases when it enters the network. Different techniques are used for these different routing table requirements. Essentially, the difference between the two techniques is simple: ■ If a new router connects to a network, it will find a neighbour using the Hello protocol and will exchange routing information. ■ If a change occurs in an existing network, the router that sees the change will flood the area with the new routing information. Both of these events must occur as stated because, although the new router must learn the network topology, its addition is a change to the rest of the network. The sates a router goes though when forming neighbour relationships 1. The down state —The new router is in a down state. The 2500 router transmits its own hello packets to introduce itself to the segment and to find any other OSPFconfigured routers. This is sent out as a hello to the multicast address 224.0.0.5 (AllSPFRouters). It sets the DR and BDR in the hello to be 0.0.0.0. 2. The init state —The new router waits for a reply. Typically this is four times the length of the hello timer. The router is in the init state. Within the wait time, the new router hears a hello from another router and learns the DR and the BDR. If there is no DR or BDR stated in the incoming hello, an election takes place. However, in accordance with the description of the Hello protocol, the DR has been elected: It is the 7200 router, which connects the campus to the campus backbone. Upon hearing the Hello protocol from the 2500 router, a router on the segment adds the router ID of the 2500 and replies as a multicast (224.0.0.5) with its own ID and a list of any other neighbors. 3. The two-way state—The new router sees its own router ID in the list of neighbors, and a neighbor relationship is established. The new router changes its status to the two-way state. The different stages or states that the router goes through while exchanging routing information with a neighbour are shown in the following list: 1. The exstart state —One of the routers will take seniority, becoming the master router. This is the exstart state. The two neighbors determine a master/slave relationship based on highest IP interface address. This designation is not significant; it just determines which router starts the communication. The exchange state —Both routers will send out database description packets, changing the state to the exchange state. Each link will have an interface ID for the outgoing interface, a link ID, and a metric to state the value of the path. The database description packet will not contain all the necessary information, but just a summary (enough for the receiving router to determine whether more information is required or whether it already contains that entry in its database). The loading state The LSR will prompt the master router to send the LSU packet. For example, if there is a discrepancy between the information in the received DDPs and the router’s topology database, the router requests more detailed information from its neighbor about those routes of which it was unaware. The full state —When these LSRs are received and the databases are updated and synchronized, the neighbors are fully adjacent. Acknowledgements of LSA’s Implicit acknowledgment A neighbor can implicitly acknowledge the receipt of an LSA by including a duplicate of the LSA in an update back to the originator. Implicit acknowledgments are more efficient than explicit acknowledgments in some situations, for instance, when the neighbor was intending to send an update to the originator anyway. Explicit acknowledgment A neighbor explicitly acknowledges the receipt of an LSA by sending a Link State Acknowledgment packet. A single Link State Acknowledgment packet is capable of acknowledging multiple LSAs. The packet carries only LSA headers—enough to completely identify the LSA—not the complete LSA. When a router first sends an LSA, a copy of the LSA is entered into the Link State Retransmission list of every neighbor to which it was sent. The LSA is retransmitted every RxmtInterval until it is acknowledged or until the adjacency is broken. The Link State Update packets containing retransmissions are always unicast, regardless of the network type What happens when a route is lost. The connected router send an LSU to either the DR ( multicast) or adjacent ( p2p,) routers, from there the DR or adjacent router will send an LSA to all neighbours about the change in the routing state. If an LSA is received from either an adjacent or DR router it is flooded out all OSPF interfaces. What happens when a new route is found. The router takes the first entry from the update—the first network with information about the state of its link. 2. The router verifies that the type of LSA is one that can be accepted by this router. 3. Having ascertained that it is a valid LSA which it can receive, the router issues a lookup to its topological database. 4. If the LSA entry is not in the topological database, it is flooded immediately out all the OSPF interfaces, except for the receiving interface. 5. If the LSA entry is in the topological database, further questions are required. 6. The router determines whether the new LSA has a more recent (higher) sequence number. 7. If the sequence numbers are the same, the router calculates the checksum for the LSAs and uses the LSA with the higher checksum. 8. If the checksum numbers are the same, the router checks the MaxAge field to ascertain which is the most recent update. 9. Having found that the latest LSU is the one that was received, the router determines whether it has arrived outside the wait period, before another computation is allowed (minsLSarrival). 10. If the new LSA entry passes these tests, it is flooded out all the OSPF interfaces, except for the receiving interface. 11. The current copy replaces the old LSA entry. If there was no entry, the current copy is just placed in the database. 12. The received LSA is acknowledged. 13. If the LSA entry was in the database, but the LSA that has just been received has an older sequence number, the router asks whether the information in the database is the same. 14. If the information is the same and the new LSA has an older sequence number, the process discards the packet. It might be old news, but there is no inconsistency in the database. 15. If the information is different and the newly received LSA has an older sequence number, however, the receiving router discards the LSA update. It issues a copy of the LSA it has in its database, sending it out of the receiving interface to the source address of the out-of-date LSA. The logic is that the sending router has bad or old information and must be updated because its topological database is obviously not synchronized with the rest of the area. OSPF Operation in a Single Area 201 This ensures that any packets that get out of sequence will be verified before action is taken. It also attempts to rectify a problem that it sees—that of multiple routers offering different paths because their topological databases are completely confused. 16. After the initial flood, things calm down, and updates are sent only when there are changes in the area or when the 30-minute timer goes off. This timer ensures that the databases stay synchronized. How an OSPF protocol communicates via the Hello protocol to its neighbors depends on the physical medium being used. OSPF identifies five distinct network types or technologies: ■ Broadcast multi-access, uses multicast HELLO’s ■ Point-to-point, uses multicast hello but there is no DR/BDR ■ Point-to-multipoint, treats each connection to a router as a point to point circuit and forwards HELLO for each circuit individually. ■ Nonbroadcast multiaccess (NBMA), requires manual configuration , will use unicast for hello ■ Virtual links, are links to an area that doesn’t connect to the backbone( area 0) and are sent via unicast. OSPF over NBMA networks, For serial interfaces with HDLC encapsulation, the default network type is point-to-point. Timers: hello 10, dead 40. ■ For serial interfaces with Frame Relay encapsulation, the default network type is nonbroadcast. Timers: hello 30, dead 120. ■ For serial interfaces with Frame Relay encapsulation and using point-to-point subinterfaces, the default network type is point-to point. Timers: hello 10, dead 40. ■ For serial interfaces with Frame Relay encapsulation and using point-to-multipoint subinterfaces, the default network type is nonbroadcast. Timers: hello 30, dead 120. Each Hello packet contains the following information: The Router ID of the originating router The Area ID of the originating router interface The address mask of the originating interface The authentication type and authentication information for the originating interface The HelloInterval of the originating interface The RouterDeadInterval of the originating interface The Router Priority The DR and BDR Five flag bits signifying optional capabilities The Router IDs of the originating router's neighbors. This list contains only routers from which Hellos were heard on the originating interface within the last RouterDeadInterval. If everything matches, the Hello packet is declared valid. If the ID of the originating router is already listed in the neighbor table for that receiving interface, the RouterDeadInterval timer is reset. If the Router ID is not listed, it is added to the neighbor table. It is advisable to use loopback addresses for the Router ID When designing a network, consider whether to include the loopback interface address in the network commands. There are both advantages and disadvantages to this, and they should be researched in any network design. If the organization is running out of valid addresses, it might be advisable to use the loopback address only as an RID and not to insert it into the routing table. The disadvantage of this configuration is that it cannot be pinged for testing. This is known as a bogus RID. The preferred configuration would be to have an address in the routing table. These addresses are assigned a /32 subnet mask. It is also possible to control how OSPF calculates default metrics for the interface. Use the ospf auto-cost reference-bandwidth router global configuration command to change the numerator of the previous OSPF cost formula: Router(config-router)# ospf auto-cost reference-bandwidth reference-bandwidth Here, reference-bandwidth is in megabytes per second. The range is 1 to 4,294,967; the default is 100. This means that a cost of 1 = 100 Mbps, and a cost of 10 = 100/10 = 10 Mbps. If you are moving to gigabit, you would want 1000 Mbps = 1 Gbps. Any change using the ospf auto-cost reference-bandwidth command should be done on all routers in the autonomous systems so that they all use the same formula to calculate cost. The value set by the ip ospf cost command overrides the cost resulting from the auto-cost reference-bandwidth command. STUB networks If there are stub networks connected to a router, it is useful to issue the command redistribute connected subnets . This command is issued as part of the router process configuration, and it includes the connected subnets in OSPF advertisements without actually running OSPF on them. This is very useful for real OSPF configurations, particularly those that involve WAN pay-per-packet, low-bandwidth links. Types of OSPF routers, Internal , is internal to one area only Backbone, has atleast one interface in area 0 ABR, area boarder router, has atleast 2 interfaces on different areas ASBR, autonomous system Boarder router, connects between AS’s show be placed in area 0 but doesn’t have to be. Link state advertisements LSA type 1, router link LSA, is generated for each area the router is in and is flooded within that area. LSA type 2, network link LSA, is sent out by the DR and lists all neighbours in that area it has a relationship with LSA type 3, network summary LSA, is sent between areas by ABR’s. it summarizes ip addressing between areas. LSA type 4, AS external ASBR summary link, is send from ABR’s to ASBR’s contains the metric cost from the ABR to the ASBR. LSA type 5, external link LSA, is sent by the ASBR and contains all routes to networks in other AS’s ( default route as well). This LSA is flooded thought-out the entire OSPF AS LSA type 7, NSSA external LSA, created by an ASBR that is in a NSSA ( not so stubby area) . this LSA stays local to the area except that ab ABR will convert it to a type 5 and send it into the other area’s. Different types of area’s Normal area, this is an area that connects to the back bone, every router knows about every network in the area and each has the same topology database. Stub area, type 5 SLA is blocked, this means to get to other AS’s a default routing must be used. Generally used in a hub and spoke topology. A totally stubby area, LSA types 3 ,4 5 are blocked so the only way out of the area is via a default route. Not so stubby area, this area is primarily used to connect to isp or where router redistribution occurs. It doesn’t allow type 4 or 5 LSA’s. it is a stub area but can receive external routes but it will not propagate them into the backbone area and thus the rest of the AS doesn’t know about them. Backbone area, it propagates all LSA types bar type 7 which is will change into a type 5 at an ABR. Some restrictions govern creating a stub area or a totally stubby area. Because no external routes are allowed in these areas, the following restrictions are in place: ■ No external routes are allowed. ■ No virtual links are allowed. ■ No redistribution is allowed. ■ No ASBR routers are allowed. ■ The area is not the backbone area. ■ All the routers are configured to be stub routers The ABRs and ASBR Propagation of LSAs When a router is configured as an ABR, it generates summary LSAs and floods them into the backbone area. Routes generated within an area are Type 1 or Type 2, and these are injected as Type 3 summaries into the backbone. These summaries are then injected by the other ABRs into their own areas, unless they are configured as totally stubby areas. Any Type 3 or Type 4 LSA received from the backbone are forwarded into the area by the ABR. The backbone also forwards external routes both ways unless the ABR is a stub router, in which case they are blocked. If a summary is received from within the area, it cannot be forwarded. Summaries received from the backbone cannot be further summarized. The flow and propagation of LSAs within and between areas is illustrated in Figure 83. Certain conditions need to be met before any LSAs can be flooded out of all interfaces. The conditions that each interface must meet before an LSA can be transmitted out of that interface are given in the following list: ■ The LSA was not received through the interface. ■ The interface is in a state of exchange or full adjacency. ■ The interface is not connected to a stub area (no LSA Type 5 will be flooded). ■ The interface is not connected to a totally stubby area (no Type 3, 4, or 5 will be propagated). The router will process the LSAs in this order: 1. The internal LSA (Type 1 and 2). 2. The LSAs of the AS (Type 3 and 4). If there is a route to the chosen network within the area (Type 1 or 2), this path will be kept. 3. The external LSAs (Type 5). Path calculation to net in another area Firs the lowest cost to the ABR is chosen, then the lowest cost from the ABR to the nextwork. External routes, E1, the cost to the external AS is considered as well as the cost to the ASBR E2, only the cost to the ASBR si considered ( default) Two types of summary routes, Internal ( type 3,4) in router table O IA External ( type 5) in routing table E1 or E2 OSPF design considerations Recommendations: No morethen 3 area’s per router No more then 50 router per area No more then 60 neighbours per router A router should only be a DR or BDR for 1 lan Virtual link allows for an area not to be physically connected to the backbone ( area 0) Multiple Area OSPF Over an NBMA Network Another design consideration is the design of the NBMA network as part of the OSPF domain. There are two main ways to approach the inclusion of an NBMA network: ■ The NBMA network can be defined as Area 0. The reasoning is that if the NBMA is used to connect all remote sites, all traffic will have to traverse this network. If the remote sites are made satellite areas, all traffic will have to traverse the NBMA, so it makes sense to make it the backbone area. This works well in a full-mesh environment, although it results in a large number of LSAs being flooded into the WAN and puts extra demands on the routers connecting to the NBMA network. ■ In a hub-and-spoke NBMA network, it makes sense to assign the hub network as Area 0 with the other remote sites and the NBMA network as other areas. This is a good design if the satellite areas are stub areas because it means that the routing information—and, thus, network overhead—is kept to a minimum over the NBMA cloud. Depending on the design, the rest of the network might constitute one other area or multiple areas. This will depend on the size and growth expectations of the OSPF domain. LSA group pacing IOS 11.3AA introduced a mechanism known as LSA group pacing to reach a compromise between the problems of individual refresh timers and a single monolithic timer. Each LSA has its own refresh timer, but as the individual refresh timers expire, a delay is introduced before the LSAs are flooded. By delaying the refresh, more LSAs can be grouped together before being flooded, so that Update packets are carrying a larger number of LSAs. By default, the group-pacing interval is 240 seconds (4 minutes), and it can be changed with the command timers lsa-grouppacing. If the database is very large, decreasing the group pacing interval is beneficial; if the database is small, increasing the interval can be useful. The range of the group pacing timer is 10 to 1800 seconds Router SLA (type 1) LS age: 933 Options: (No TOS-capability, DC) LS Type: Router Links Link State ID: 10.1.4.1 ##router ID Advertising Router: 10.1.4.1 LS Seq Number: 80000004 Checksum: 0xE0DF Length: 48 Number of Links: 2 Link connected to: a Transit Network ##connected network type (Link ID) Designated Router address: 10.1.4.2 (Link Data) Router Interface address: 10.1.4.1 Number of TOS metrics: 0 TOS 0 Metrics: 1 Link connected to: a Transit Network (Link ID) Designated Router address: 10.1.2.2 (Link Data) Router Interface address: 10.1.2.2 Number of TOS metrics: 0 TOS 0 Metrics: 1 Network SLA (type 2) Routing Bit Set on this LSA LS age: 514 Options: (No TOS-capability, DC) LS Type: Network Links Link State ID: 10.1.2.2 (address of Designated Router) Advertising Router: 10.1.4.1 ## peer that advertised the route LS Seq Number: 80000001 Checksum: 0x8E6D Length: 32 Network Mask: /24 Attached Router: 10.1.4.1 ## router ID’s of DROUTERS a DR router Attached Router: 10.1.3.1 ## has a relationship with + length of ## network mask To figure out what networks are attached to what routers first look up the router SLA ( show ip ospf database router *RID*). This will show connected links, from there look up the network SLA based off the designated router address, this contains the prefix length. Summary Net Link States (Area 6) LS age: 1177 Options: (No TOS-capability, DC, Upward) LS Type: Summary Links(Network) Link State ID: 10.1.1.0 (summary Network Number) Advertising Router: 10.1.7.3 LS Seq Number: 80000001 Checksum: 0x5EBB Length: 28 Network Mask: /24 TOS: 0 Metric: 2 Pretty self expiatory advertising router is ABR Type-5 AS External Link States TYPE 2 Routing Bit Set on this LSA LS age: 225 Options: (No TOS-capability, DC) LS Type: AS External Link Link State ID: 1.2.3.0 (External Network Number ) Advertising Router: 222.222.222.222 LS Seq Number: 80000001 Checksum: 0x839B Length: 36 Network Mask: /24 Metric Type: 2 (Larger than any link state path) TOS: 0 Metric: 20 Forward Address: 0.0.0.0 External Route Tag: 0 TYPE 1 Routing Bit Set on this LSA LS age: 8 Options: (No TOS-capability, DC) LS Type: AS External Link Link State ID: 1.2.3.0 (External Network Number ) Advertising Router: 222.222.222.222 LS Seq Number: 80000002 Checksum: 0x6232 Length: 36 Network Mask: /24 Metric Type: 1 (Comparable directly to link state metric) TOS: 0 Metric: 30 Forward Address: 0.0.0.0 External Route Tag: 0 Summary ASB Link States (Area 1) Adv Router is not-reachable LS age: 446 Options: (No TOS-capability, DC, Upward) LS Type: Summary Links(AS Boundary Router) Link State ID: 222.222.222.222 (AS Boundary Router address) Advertising Router: 10.1.3.1 LS Seq Number: 80000001 Checksum: 0x1A93 Length: 28 Network Mask: /0 TOS: 0 Metric: 4 first the type 5 is looked up, the advertising router (222.222.222.222) address is then used to lookup the link state for ASBR. Type 2 just look at cost to the ASBR when choosing which router to forward to. Type 1 looks at total cost.