IT

ALL IT Technology Information

CCNA (Cisco Certified Network Associate) Routing protocol OSPF(Open Shortest Path First)

 

CCNA (Cisco Certified Network Associate) 
cisco lab troubleshooting router switch
 
OSPF



(OSPF) Open Shortest Path First

 

ospf

==

Example ospf command

==

R1

Router(config)#router opsf 1

Router(config-router)#network (Router interface neteork)(wildcard mask) area (what area to connect this enterface network)

Router(config-router)#network 10.10.10.0 0.0.0.255 area 0

Router(config-router)#network 20.20.20.0 0.0.0.255 area 0

Router(config-router)#no auto-summary

If this behavior is not wanted then EIGRP's automatic summarization must be disabled. The command to configure this is ‘no auto-summary'

Router(config-router)## passive-interface (only connect pc switch)

With EIGRP running on a network, the passive-interface command stops both outgoing and incoming routing updates, since the effect of the command causes the router to stop sending and receiving hello packets over an interface

Router(config-router)#exit

==

R2

you chang

Router(config)#router opsf 2

Router(config-router)#network (Router interface neteork)(subnet mask) area (what area to connect this enterface network)

Router(config-router)#network 30.30.30.0 0.0.0.255 area 1

Router(config-router)#network 40.40.40.0 0.0.0.255 area 1

Router(config-router)#no auto-summary

If this behavior is not wanted then EIGRP's automatic summarization must be disabled. The command to configure this is ‘no auto-summary'

Router(config-router)# passive-interface g0/1/0

(only connect pc switch)

With EIGRP running on a network, the passive-interface command stops both outgoing and incoming routing updates, since the effect of the command causes the router to stop sending and receiving hello packets over an interface

 

Router(config-router)#exit

 

R5

 

Router#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 1 subnets
O       10.10.10.0/24 [110/65] via 192.168.53.3, 00:01:29, Serial0/2/1
     20.0.0.0/24 is subnetted, 1 subnets
O       20.20.20.0/24 [110/65] via 192.168.54.4, 00:01:39, Serial0/2/0
O    192.168.1.0/24 [110/128] via 192.168.15.1, 00:01:34, Serial0/1/0
O    192.168.2.0/24 [110/128] via 192.168.25.2, 00:01:24, Serial0/1/1
     192.168.15.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.15.0/24 is directly connected, Serial0/1/0
L       192.168.15.5/32 is directly connected, Serial0/1/0
     192.168.25.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.25.0/24 is directly connected, Serial0/1/1
L       192.168.25.5/32 is directly connected, Serial0/1/1
     192.168.53.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.53.0/24 is directly connected, Serial0/2/1
L       192.168.53.5/32 is directly connected, Serial0/2/1
     192.168.54.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.54.0/24 is directly connected, Serial0/2/0
L       192.168.54.5/32 is directly connected, Serial0/2/0

Router#show ip route ospf
     10.0.0.0/24 is subnetted, 1 subnets
O       10.10.10.0 [110/65] via 192.168.53.3, 00:01:52, Serial0/2/1
     20.0.0.0/24 is subnetted, 1 subnets
O       20.20.20.0 [110/65] via 192.168.54.4, 00:02:02, Serial0/2/0
O    192.168.1.0 [110/128] via 192.168.15.1, 00:01:57, Serial0/1/0
O    192.168.2.0 [110/128] via 192.168.25.2, 00:01:47, Serial0/1/1
 
Router#show ip  ospf
 Routing Process "ospf 1" with ID 192.168.54.5
 Supports only single TOS(TOS0) routes
 Supports opaque LSA
 It is an area border router
 SPF schedule delay 5 secs, Hold time between two SPFs 10 secs
 Minimum LSA interval 5 secs. Minimum LSA arrival 1 secs
 Number of external LSA 0. Checksum Sum 0x000000
 Number of opaque AS LSA 0. Checksum Sum 0x000000
 Number of DCbitless external and opaque AS LSA 0
 Number of DoNotAge external and opaque AS LSA 0
 Number of areas in this router is 4. 4 normal 0 stub 0 nssa
 External flood list length 0
    Area 1
        Number of interfaces in this area is 1
        Area has no authentication
        SPF algorithm executed 4 times
        Area ranges are
        Number of LSA 9. Checksum Sum 0x02d3ed
        Number of opaque link LSA 0. Checksum Sum 0x000000
        Number of DCbitless LSA 0
        Number of indication LSA 0
        Number of DoNotAge LSA 0
        Flood list length 0
    Area 2
        Number of interfaces in this area is 1
        Area has no authentication
        SPF algorithm executed 1 times
        Area ranges are
        Number of LSA 9. Checksum Sum 0x025524
        Number of opaque link LSA 0. Checksum Sum 0x000000
        Number of DCbitless LSA 0
        Number of indication LSA 0
        Number of DoNotAge LSA 0
        Flood list length 0
    Area BACKBONE(0)
        Number of interfaces in this area is 1
        Area has no authentication
        SPF algorithm executed 2 times
        Area ranges are
        Number of LSA 8. Checksum Sum 0x029f06
        Number of opaque link LSA 0. Checksum Sum 0x000000
        Number of DCbitless LSA 0
        Number of indication LSA 0
        Number of DoNotAge LSA 0
        Flood list length 0
    Area 3
        Number of interfaces in this area is 1
        Area has no authentication
        SPF algorithm executed 3 times
        Area ranges are
        Number of LSA 9. Checksum Sum 0x034421
        Number of opaque link LSA 0. Checksum Sum 0x000000
        Number of DCbitless LSA 0
        Number of indication LSA 0
        Number of DoNotAge LSA 0
        Flood list length 0

Router#show ip  ospf inter

Serial0/1/0 is up, line protocol is up
  Internet address is 192.168.15.5/24, Area 1
  Process ID 1, Router ID 192.168.54.5, Network Type POINT-TO-POINT, Cost: 64
  Transmit Delay is 1 sec, State POINT-TO-POINT, Priority 0
  No designated router on this network
  No backup designated router on this network
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    Hello due in 00:00:07
  Index 1/1, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 1, maximum is 1
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 1 , Adjacent neighbor count is 1
    Adjacent with neighbor 192.168.15.1
  Suppress hello for 0 neighbor(s)
Serial0/1/1 is up, line protocol is up
  Internet address is 192.168.25.5/24, Area 2
  Process ID 1, Router ID 192.168.54.5, Network Type POINT-TO-POINT, Cost: 64
  Transmit Delay is 1 sec, State POINT-TO-POINT, Priority 0
  No designated router on this network
  No backup designated router on this network
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    Hello due in 00:00:05
  Index 2/2, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 1, maximum is 1
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 1 , Adjacent neighbor count is 1
    Adjacent with neighbor 192.168.25.2
  Suppress hello for 0 neighbor(s)
Serial0/2/1 is up, line protocol is up
  Internet address is 192.168.53.5/24, Area 0
  Process ID 1, Router ID 192.168.54.5, Network Type POINT-TO-POINT, Cost: 64
  Transmit Delay is 1 sec, State POINT-TO-POINT, Priority 0
  No designated router on this network
  No backup designated router on this network
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    Hello due in 00:00:07
  Index 3/3, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 1, maximum is 1
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 1 , Adjacent neighbor count is 1
    Adjacent with neighbor 192.168.53.3
  Suppress hello for 0 neighbor(s)
Serial0/2/0 is up, line protocol is up
  Internet address is 192.168.54.5/24, Area 3
  Process ID 1, Router ID 192.168.54.5, Network Type POINT-TO-POINT, Cost: 64
  Transmit Delay is 1 sec, State POINT-TO-POINT, Priority 0
  No designated router on this network
  No backup designated router on this network
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    Hello due in 00:00:05
  Index 4/4, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 1, maximum is 1
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 1 , Adjacent neighbor count is 1
    Adjacent with neighbor 192.168.54.4
  Suppress hello for 0 neighbor(s)

 

===When configuring any OSPF router, you must establish which area assignment to enable the interface for. OSPF has some basic rules when it comes to area assignment. OSPF must be configured with areas. The backbone area 0, or 0.0.0.0, must be configured if you use more than one area assignment. You can configure OSPF in one area; you can choose any area, although good OSPF design dictates that you configure area 0.

To enable OSPF on a Cisco router and advertise interfaces, the following tasks are required:

Step 1

Use the command router ospf process ID to start OSPF.

Step 2

Use the network command to enable the interfaces.

Step 3

Identify area assignments.

Step 4

(Optional) Assign the router ID.

Example 3-1 displays OSPF with a process ID of 1 and places all interfaces configured with an IP address in area 0. The network command network 0.0.0.0 255.255.255.255 area 0 dictates that you do not care (255.255.255.255) what the IP address is, but if an IP address is enabled on any interface, place it in area 0.

Example 3-1 Configuring OSPF in a Single Area

 

router ospf 1

network 0.0.0.0 255.255.255.255 area 0

The following is a list of reasons OSPF is considered a better routing protocol than RIP:

    OSPF has no hop count limitations. (RIP has 15 hops only.)

    OSPF understands variable-length subnet masks (VLSMs) and allows for summarization.

    OSPF uses multicasts (not broadcasts) to send updates.

    OSPF converges much faster than RIP, because OSPF propagates changes immediately.

    OSPF allows for load balancing with up to six equal-cost paths.

    OSPF has authentication available. (RIPv2 does also, but RIPv1 does not.)

    OSPF allows for tagging of external routes injected by other autonomous systems.

    OSPF configuration, monitoring, and troubleshooting have a far greater IOS tool base than RIP.

NOTE

OSPF does have some disadvantages, including the level of difficulty and understanding required to configure, monitor, and troubleshoot it. The other two factors are the memory and Central Processing Unit (CPU) requirements that can affect even high-end router performance. You can configure more than one OSPF process, but you must be mindful that the SPF calculations associated with multiple OSPF processes can consume a considerable amount of CPU and memory.

 

Router#show ip route 

Router#show ip route ospf  

Router#show ip ospf   

Router#show ip ospf interface      

 

OSPF is not configured on one of the routers.  =                        show ip ospf

OSPF is not enabled on an interface where it is needed. = show ip ospf interface

OSPF HELLO or Dead timer interval values are mismatched.  =   show ip ospf interface

ip ospf network-type mismatch on the adjoining interfaces. =    show ip ospf interface

MTU mismatch between neighboring interfaces.   =                  show interface <int-type><int-num>

OSPF area-type is stub on one neighbor,

but the adjoining neighbor in the same area is not

 configured for stub.   =                                         show running-config show ip ospf interface

OSPF neighbors have duplicate Router IDs.           =          show ip ospf show ip ospf interface

OSPF is configured on the secondary network of the neighbor,

but not on the primary network. This is an illegal

configuration which prevents OSPF from being enabled

on the interface.                                                =  show ip ospf interface show running-config

OSPF HELLOs are not processed due to a lack of resources,

such as high CPU utilization or not enough memory.      =          show memory summary show memory processor

An underlying Layer problem prevents OSPF HELLOs

 from being received.                     =                      show interface

What is Open Shortest Path First (OSPF)?

The OSPF (Open Shortest Path First) protocol is one of a family of IP Routing protocols, and is an Interior Gateway Protocol (IGP) for the Internet, used to distribute IP routing information throughout a single Autonomous System (AS) in an IP network.

The OSPF protocol is a link-state routing protocol, which means that the routers exchange topology information with their nearest neighbors. The topology information is flooded throughout the AS, so that every router within the AS has a complete picture of the topology of the AS. This picture is then used to calculate end-to-end paths through the AS, normally using a variant of the Dijkstra algorithm. Therefore, in a link-state routing protocol, the next hop address to which data is forwarded is determined by choosing the best end-to-end path to the eventual destination.

The main advantage of a link state routing protocol like OSPF is that the complete knowledge of topology allows routers to calculate routes that satisfy particular criteria. This can be useful for traffic engineering purposes, where routes can be constrained to meet particular quality of service requirements. The main disadvantage of a link state routing protocol is that it does not scale well as more routers are added to the routing domain. Increasing the number of routers increases the size and frequency of the topology updates, and also the length of time it takes to calculate end-to-end routes. This lack of scalability means that a link state routing protocol is unsuitable for routing across the Internet at large, which is the reason why IGPs only route traffic within a single AS.

Each OSPF router distributes information about its local state (usable interfaces and reachable neighbors, and the cost of using each interface) to other routers using a Link State Advertisement (LSA) message. Each router uses the received messages to build up an identical database that describes the topology of the AS.

From this database, each router calculates its own routing table using a Shortest Path First (SPF) or Dijkstra algorithm. This routing table contains all the destinations the routing protocol knows about, associated with a next hop IP address and outgoing interface.

  • The protocol recalculates routes when network topology changes, using the Dijkstra algorithm, and minimises the routing protocol traffic that it generates.
  • It provides support for multiple paths of equal cost.
  • It provides a multi-level hierarchy (two-level for OSPF) called "area routing," so that information about the topology within a defined area of the AS is hidden from routers outside this area. This enables an additional level of routing protection and a reduction in routing protocol traffic.
  • All protocol exchanges can be authenticated so that only trusted routers can join in the routing exchanges for the AS.

OSPF Version 3 (OSPFv3)

OSPF version 2 (OSPFv2) is used with IPv4. OSPFv3 has been updated for compatibility with IPv6's 128-bit address space. However, this is not the only difference between OSPFv2 and OSPFv3. Other changes in OSPFv3, as defined in RFC 2740, include

  • protocol processing per-link not per-subnet
  • addition of flooding scope, which may be link-local, area or AS-wide
  • removal of opaque LSAs
  • support for multiple instances of OSPF per link
  • various packet and LSA format changes (including removal of addressing semantics).

Both OSPFv2 and OSPFv3 are fully supported by DC-OSPF.

                                   

Operation

OSPF packet format

OSPF was designed as an interior gateway protocol (IGP), for use in an autonomous system such as a local area network (LAN). It implements Dijkstra's algorithm, also known as the shortest path first (SPF) algorithm. As a link-state routing protocol it was based on the link-state algorithm developed for the ARPANET in 1980 and the IS-IS routing protocol. OSPF was first standardized in 1989 as RFC 1131, which is now known as OSPF version 1. The development work for OSPF prior to its codification as open standard was undertaken largely by the Digital Equipment Corporation, which developed its own proprietary DECnet protocols.

Routing protocols like OSPF calculate the shortest route to a destination through the network based on an algorithm. The first routing protocol that was widely implemented, the Routing Information Protocol (RIP), calculated the shortest route based on hops, that is the number of routers that an IP packet had to traverse to reach the destination host. RIP successfully implemented dynamic routing, where routing tables change if the network topology changes. But RIP did not adapt its routing according to changing network conditions, such as data-transfer rate. Demand grew for a dynamic routing protocol that could calculate the fastest route to a destination. OSPF was developed so that the shortest path through a network was calculated based on the cost of the route, taking into account bandwidth, delay and load. Therefore OSPF undertakes route cost calculation on the basis of link-cost parameters, which can be weighted by the administrator. OSPF was quickly adopted because it became known for reliably calculating routes through large and complex local area networks.

As a link-state routing protocol, OSPF maintains link-state databases, which are really network topology maps, on every router on which it is implemented. The state of a given route in the network is the cost, and OSPF algorithm allows every router to calculate the cost of the routes to any given reachable destination. Unless the administrator has made a configuration, the link cost of a path connected to a router is determined by the bit rate (1 Gbit/s, 10 Gbit/s, etc) of the interface. A router interface with OSPF will then advertise its link cost to neighboring routers through multicast, known as the hello procedure. All routers with OSPF implementation keep sending hello packets, and thus changes in the cost of their links become known to neighboring routers. The information about the cost of a link, that is the speed of a point to point connection between two routers, is then cascaded through the network because OSPF routers advertise the information they receive from one neighboring router to all other neighboring routers. This process of flooding link state information through the network is known as synchronization. Based on this information, all routers with OSPF implementation continuously update their link state databases with information about the network topology and adjust their routing tables.

An OSPF network can be structured, or subdivided, into routing areas to simplify administration and optimize traffic and resource utilization. Areas are identified by 32-bit numbers, expressed either simply in decimal, or often in the same dot-decimal notation used for IPv4 addresses. By convention, area 0 (zero), or 0.0.0.0, represents the core or backbone area of an OSPF network. While the identifications of other areas may be chosen at will; administrators often select the IP address of a main router in an area as the area identifier. Each additional area must have a connection to the OSPF backbone area. Such connections are maintained by an interconnecting router, known as an area border router (ABR). An ABR maintains separate link-state databases for each area it serves and maintains summarized routes for all areas in the network.

OSPF detects changes in the topology, such as link failures, and converges on a new loop-free routing structure within seconds.

OSPF has become a popular dynamic routing protocol. Other commonly used dynamic routing protocols are the RIPv2 and the Border Gateway Protocol (BGP).  Today routers support at least one interior gateway protocol to advertise their routing tables within a local area network. Frequently implemented interior gateway protocols besides OSPF are RIPv2, IS-IS, and EIGRP (Enhanced Interior Gateway Routing Protocol). 

Router relationships

OSPF supports complex networks with multiple routers, including backup routers, to balance traffic load on multiple links to other subnets. Neighboring routers in the same broadcast domain or at each end of a point-to-point link communicate with each other via the OSPF protocol. Routers form adjacencies when they have detected each other. This detection is initiated when a router identifies itself in a Hello protocol packet. Upon acknowledgment, this establishes a two-way state and the most basic relationship. The routers in an Ethernet or Frame Relay network select a Designated Router (DR) and a Backup Designated Router (BDR) which act as a hub to reduce traffic between routers. OSPF uses both unicast and multicast transmission modes to send "Hello" packets and link-state updates.

As a link-state routing protocol, OSPF establishes and maintains neighbor relationships for exchanging routing updates with other routers. The neighbor relationship table is called an adjacency database. Two OSPF routers are neighbors if they are members of the same subnet and share the same area ID, subnet mask, timers and authentication. In essence, OSPF neighborship is a relationship between two routers that allow them to see and understand each other but nothing more. OSPF neighbors do not exchange any routing information – the only packets they exchange are Hello packets. OSPF adjacencies are formed between selected neighbors and allow them to exchange routing information. Two routers must first be neighbors and only then, can they become adjacent. Two routers become adjacent if at least one of them is Designated Router or Backup Designated Router (on multiaccess type networks), or they are interconnected by a point-to-point or point-to-multipoint network type. For forming a neighbor relationship between, the interfaces used to form the relationship must be in the same OSPF area. While an interface may be configured to belong to multiple areas, this is generally not practiced. When configured in a second area, an interface must be configured as a secondary interface.

Adjacency state machine

Each OSPF router within a network communicates with other neighboring routers on each connecting interface to establish the states of all adjacencies. Every such communication sequence is a separate conversation identified by the pair of router IDs of the communicating neighbors. RFC 2328 specifies the protocol for initiating these conversations (Hello Protocol) and for establishing full adjacencies (Database Description Packets, Link State Request Packets). During its course, each router conversation transitions through a maximum of eight conditions defined by a state machine:

  1. Down: The state down represents the initial state of a conversation when no information has been exchanged and retained between routers with the Hello Protocol.
  2. Attempt: The Attempt state is similar to the Down state, except that a router is in the process of efforts to establish a conversation with another router, but is only used on NBMA networks.
  3. Init: The Init state indicates that a HELLO packet has been received from a neighbor, but the router has not established a two-way conversation.
  4. 2-Way: The 2-Way state indicates the establishment of a bidirectional conversation between two routers. This state immediately precedes the establishment of adjacency. This is the lowest state of a router that may be considered as a Designated Router.
  5. ExStart: The ExStart state is the first step of adjacency of two routers.
  6. Exchange: In the Exchange state, a router is sending its link-state database information to the adjacent neighbor. At this state, a router is able to exchange all OSPF routing protocol packets.
  7. Loading: In the Loading state, a router requests the most recent Link-state advertisements (LSAs) from its neighbor discovered in the previous state.
  8. Full: The Full state concludes the conversation when the routers are fully adjacent, and the state appears in all router- and network-LSAs. The link state databases of the neighbors are fully synchronized.

OSPF messages

Unlike other routing protocols, OSPF does not carry data via a transport protocol, such as the User Datagram Protocol (UDP) or the Transmission Control Protocol (TCP). Instead, OSPF forms IP datagrams directly, packaging them using protocol number 89 for the IP Protocol field. OSPF defines five different message types, for various types of communication:

Hello

Hello messages are used as a form of greeting, to allow a router to discover other adjacent routers on its local links and networks. The messages establish relationships between neighboring devices (called adjacencies) and communicate key parameters about how OSPF is to be used in the autonomous system or area. During normal operation, routers send hello messages to their neighbors at regular intervals (the hello interval); if a router stops receiving hello messages from a neighbor, after a set period (the dead interval) the router will assume the neighbor has gone down.

Database Description (DBD)

Database description messages contain descriptions of the topology of the autonomous system or area. They convey the contents of the link-state database (LSDB) for the area from one router to another. Communicating a large LSDB may require several messages to be sent by having the sending device designated as a master device and sending messages in sequence, with the slave (recipient of the LSDB information) responding with acknowledgments.

Link State Request (LSR)

Link state request messages are used by one router to request updated information about a portion of the LSDB from another router. The message specifies the link(s) for which the requesting device wants more current information.

Link State Update (LSU)

Link-state update messages contain updated information about the state of certain links on the LSDB. They are sent in response to a Link State Request message, and also broadcast or multicast by routers on a regular basis. Their contents are used to update the information in the LSDBs of routers that receive them.

Link State Acknowledgment (LSAck)

Link-state acknowledgment messages provide reliability to the link-state exchange process, by explicitly acknowledging receipt of a Link State Update message.

OSPF areas

An OSPF network can be divided into areas that are logical groupings of hosts and networks. An area includes its connecting router having interfaces connected to the network. Each area maintains a separate link-state database whose information may be summarized towards the rest of the network by the connecting router. Thus, the topology of an area is unknown outside the area. This reduces the routing traffic between parts of an autonomous system.

Areas are uniquely identified with 32-bit numbers. The area identifiers are commonly written in the dot-decimal notation, familiar from IPv4 addressing. However, they are not IP addresses and may duplicate, without conflict, any IPv4 address. The area identifiers for IPv6 implementations (OSPFv3) also use 32-bit identifiers written in the same notation. When dotted formatting is omitted, most implementations expand area 1 to the area identifier 0.0.0.1, but some have been known to expand it as 1.0.0.0.

OSPF defines several special area types:

Backbone area

The backbone area (also known as area 0 or area 0.0.0.0) forms the core of an OSPF network. All other areas are connected to it, either directly or through other routers. Inter-area routing happens via routers connected to the backbone area and to their own associated areas. It is the logical and physical structure for the 'OSPF domain' and is attached to all nonzero areas in the OSPF domain. Note that in OSPF the term Autonomous System Boundary Router (ASBR) is historic, in the sense that many OSPF domains can coexist in the same Internet-visible autonomous system, RFC 1996.

The backbone area is responsible for distributing routing information between non-backbone areas. The backbone must be contiguous, but it does not need to be physically contiguous; backbone connectivity can be established and maintained through the configuration of virtual links.

All OSPF areas must connect to the backbone area. This connection, however, can be through a virtual link. For example, assume area 0.0.0.1 has a physical connection to area 0.0.0.0. Further assume that area 0.0.0.2 has no direct connection to the backbone, but this area does have a connection to area 0.0.0.1. Area 0.0.0.2 can use a virtual link through the transit area 0.0.0.1 to reach the backbone. To be a transit area, an area has to have the transit attribute, so it cannot be stubby in any way.

Stub area

A stub area is an area that does not receive route advertisements external to the AS and routing from within the area is based entirely on a default route. An ABR deletes type 4, 5 LSAs from internal routers, sends them a default route of 0.0.0.0 and turns itself into a default gateway. This reduces LSDB and routing table size for internal routers.

Modifications to the basic concept of stub area have been implemented by systems vendors, such as the totally stubby area (TSA) and the not-so-stubby area (NSSA), both an extension in Cisco Systems routing equipment.

Not-so-stubby area

A not-so-stubby area (NSSA) is a type of stub area that can import autonomous system external routes and send them to other areas, but still cannot receive AS-external routes from other areas. NSSA is an extension of the stub area feature that allows the injection of external routes in a limited fashion into the stub area. A case study simulates an NSSA getting around the Stub Area problem of not being able to import external addresses. It visualizes the following activities: the ASBR imports external addresses with a type 7 LSA, the ABR converts a type 7 LSA to type 5 and floods it to other areas, the ABR acts as an "ASBR" for other areas. The ASBRs do not take type 5 LSAs and then convert to type 7 LSAs for the area.

Proprietary extensions

Several vendors (Cisco, Allied Telesis, Juniper, Alcatel-Lucent, Huawei, Quagga), implement the two extensions below for stub and not-so-stubby areas. Although not covered by RFC standards, they are considered by many to be standard features in OSPF implementations.

Totally stubby area

A totally stubby area is similar to a stub area. However, this area does not allow summary routes in addition to not having external routes, that is, inter-area (IA) routes are not summarized into totally stubby areas. The only way for traffic to get routed outside the area is a default route which is the only Type-3 LSA advertised into the area. When there is only one route out of the area, fewer routing decisions have to be made by the route processor, which lowers system resource utilization.

Occasionally, it is said that a TSA can have only one ABR.

NSSA totally stubby area

An addition to the standard functionality of an NSSA, the totally stubby NSSA is an NSSA that takes on the attributes of a TSA, meaning that type 3 and 4 summary routes are not flooded into this type of area. It is also possible to declare an area both totally stubby and not-so-stubby, which means that the area will receive only the default route from area 0.0.0.0, but can also contain an autonomous system boundary router (ASBR) that accepts external routing information and injects it into the local area, and from the local area into area 0.0.0.0.

Redistribution into an NSSA area creates a special type of LSA known as type 7, which can exist only in an NSSA area. An NSSA ASBR generates this LSA, and an NSSA ABR router translates it into type 5 LSA which gets propagated into the OSPF domain.

A newly acquired subsidiary is one example of where it might be suitable for an area to be simultaneously not-so-stubby and totally stubby if the practical place to put an ASBR is on the edge of a totally stubby area. In such a case, the ASBR does send externals into the totally stubby area, and they are available to OSPF speakers within that area. In Cisco's implementation, the external routes can be summarized before injecting them into the totally stubby area. In general, the ASBR should not advertise default into the TSA-NSSA, although this can work with extremely careful design and operation, for the limited special cases in which such an advertisement makes sense.

By declaring the totally stubby area as NSSA, no external routes from the backbone, except the default route, enter the area being discussed. The externals do reach area 0.0.0.0 via the TSA-NSSA, but no routes other than the default route enter the TSA-NSSA. Routers in the TSA-NSSA send all traffic to the ABR, except to routes advertised by the ASBR.

Transit area

A transit area is an area with two or more OSPF border routers and is used to pass network traffic from one adjacent area to another. The transit area does not originate this traffic and is not the destination of such traffic.

Router types

OSPF defines the following overlapping categories of routers:

Internal router (IR)

An internal router has all its interfaces belonging to the same area.

Area border router (ABR)

An area border router is a router that connects one or more areas to the main backbone network. It is considered a member of all areas it is connected to. An ABR keeps multiple instances of the link-state database in memory, one for each area to which that router is connected.

Backbone router (BR)

A backbone router has an interface to the backbone area. Backbone routers may also be area routers, but do not have to be.

Autonomous system boundary router (ASBR)

An autonomous system boundary router is a router that is connected by using more than one routing protocol and that exchanges routing information with routers autonomous systems. ASBRs typically also run an exterior routing protocol (e.g., BGP), or use static routes, or both. An ASBR is used to distribute routes received from other, external ASs throughout its own autonomous system. An ASBR creates External LSAs for external addresses and floods them to all areas via ABR. Routers in other areas use ABRs as next hops to access external addresses. Then ABRs forward packets to the ASBR that announces the external addresses.

The router type is an attribute of an OSPF process. A given physical router may have one or more OSPF processes. For example, a router that is connected to more than one area, and which receives routes from a BGP process connected to another AS, is both an area border router and an autonomous system boundary router.

Each router has an identifier, customarily written in the dotted-decimal format (e.g., 1.2.3.4) of an IP address. This identifier must be established in every OSPF instance. If not explicitly configured, the highest logical IP address will be duplicated as the router identifier. However, since the router identifier is not an IP address, it does not have to be a part of any routable subnet in the network, and often isn't to avoid confusion.

Router attributes

In addition to the four router types, OSPF uses the terms designated router (DR) and backup designated router (BDR), which are attributes of a router interface.

Designated router

A designated router (DR) is the router interface elected among all routers on a particular multiaccess network segment, generally assumed to be broadcast multiaccess. Special techniques, often vendor-dependent, may be needed to support the DR function on non-broadcast multiaccess (NBMA) media. It is usually wise to configure the individual virtual circuits of an NBMA subnet as individual point-to-point lines; the techniques used are implementation-dependent.

Backup designated router

A backup designated router (BDR) is a router that becomes the designated router if the current designated router has a problem or fails. The BDR is the OSPF router with the second-highest priority at the time of the last election.

A given router can have some interfaces that are designated (DR) and others that are backup designated (BDR), and others that are non-designated. If no router is a DR or a BDR on a given subnet, the BDR is first elected, and then a second election is held for the DR. The DR is elected based on the following default criteria:

  • If the priority setting on an OSPF router is set to 0, that means it can NEVER become a DR or BDR.
  • When a DR fails and the BDR takes over, there is another election to see who becomes the replacement BDR.
  • The router sending the Hello packets with the highest priority wins the election.
  • If two or more routers tie with the highest priority setting, the router sending the Hello with the highest RID (Router ID) wins. NOTE: a RID is the highest logical (loopback) IP address configured on a router, if no logical/loopback IP address is set then the router uses the highest IP address configured on its active interfaces (e.g. 192.168.0.1 would be higher than 10.1.1.2).
  • Usually the router with the second-highest priority number becomes the BDR.
  • The priority values range between 0 – 255, with a higher value increasing its chances of becoming DR or BDR.
  • If a higher priority OSPF router comes online after the election has taken place, it will not become DR or BDR until (at least) the DR and BDR fail.
  • If the current DR 'goes down' the current BDR becomes the new DR and a new election takes place to find another BDR. If the new DR then 'goes down' and the original DR is now available, still previously chosen BDR will become DR.

DR's exist for the purpose of reducing network traffic by providing a source for routing updates. The DR maintains a complete topology table of the network and sends the updates to the other routers via multicast. All routers in a multi-access network segment will form a slave/master relationship with the DR. They will form adjacencies with the DR and BDR only. Every time a router sends an update, it sends it to the DR and BDR on the multicast address 224.0.0.6. The DR will then send the update out to all other routers in the area, to the multicast address 224.0.0.5. This way all the routers do not have to constantly update each other, and can rather get all their updates from a single source. The use of multicasting further reduces the network load. DRs and BDRs are always setup/elected on OSPF broadcast networks. DR's can also be elected on NBMA (Non-Broadcast Multi-Access) networks such as Frame Relay or ATM. DRs or BDRs are not elected on point-to-point links (such as a point-to-point WAN connection) because the two routers on either side of the link must become fully adjacent and the bandwidth between them cannot be further optimized. DR and non-DR routers evolve from 2-way to full adjacency relationships by exchanging DD, Request, and Update.

Routing metrics

OSPF uses path cost as its basic routing metric, which was defined by the standard not to equate to any standard value such as speed, so the network designer could pick a metric important to the design. In practice, it is determined by the speed (bandwidth) of the interface addressing the given route, although that tends to need network-specific scaling factors now that links faster than 25 Mbit/s are common. Cisco uses a metric like (108 bit/s)/bandwidth (the reference value, 108 bit/s by default, can be adjusted). So, a 100 Mbit/s link will have a cost of 1, a 10 Mbit/s a cost of 10 and so on. But for links faster than 100 Mbit/s, the cost would be <1.

Metrics, however, are only directly comparable when of the same type. Four types of metrics are recognized. In decreasing preference, these types are (for example, an intra-area route is always preferred to an external route regardless of metric):

  1. Intra-area
  2. Inter-area
  3. External Type 1, which includes both the external path cost and the sum of internal path costs to the ASBR that advertises the route,
  4. External Type 2, the value of which is solely that of the external path cost,

OSPF v3

OSPF version 3 introduces modifications to the IPv4 implementation of the protocol. Except for virtual links, all neighbor exchanges use IPv6 link-local addressing exclusively. The IPv6 protocol runs per link, rather than based on the subnet. All IP prefix information has been removed from the link-state advertisements and from the hello discovery packet making OSPFv3 essentially protocol-independent. Despite the expanded IP addressing to 128-bits in IPv6, area and router identifications are still based on 32-bit numbers.

OSPF Extensions

Traffic engineering

OSPF-TE is an extension to OSPF extending the expressivity to allow for traffic engineering and use on non-IP networks. Using OSPF-TE, more information about the topology can be exchanged using opaque LSA carrying type-length-value elements. These extensions allow OSPF-TE to run completely out of band of the data plane network. This means that it can also be used on non-IP networks, such as optical networks.

OSPF-TE is used in GMPLS networks as a means to describe the topology over which GMPLS paths can be established. GMPLS uses its own path setup and forwarding protocols, once it has the full network map.

In the Resource Reservation Protocol (RSVP), OSPF-TE is used for recording and flooding RSVP signaled bandwidth reservations for label switched paths within the link-state database.

Optical routing

RFC 3717 documents work in optical routing for IP based on extensions to OSPF and IS-IS.

Multicast Open Shortest Path First

The Multicast Open Shortest Path First (MOSPF) protocol is an extension to OSPF to support multicast routing. MOSPF allows routers to share information about group memberships.

OSPF in broadcast and non-broadcast networks

In broadcast multiple-access networks, neighbor adjacency is formed dynamically using multicast hello packets to 224.0.0.5. A DR and BDR are elected normally, and function normally.

For non-broadcast multiple-access networks (NBMA), the following two official modes are defined

  • non-broadcast
  • point-to-multipoint

Cisco has defined the following three additional modes for OSPF in NBMA topologies

  • point-to-multipoint non-broadcast
  • broadcast
  • point-to-point

Notable Implementations

    Applications

    OSPF is a widely deployed routing protocol that can converge a network in a few seconds and guarantee loop-free paths. It has many features that allow the imposition of policies about the propagation of routes that it may be appropriate to keep local, for load sharing, and for selective route importing. IS-IS, in contrast, can be tuned for lower overhead in a stable network, the sort more common in ISP than enterprise networks. There are some historical accidents that made IS-IS the preferred IGP for ISPs, but ISPs today may well choose to use the features of the now-efficient implementations of OSPF, after first considering the pros and cons of IS-IS in service provider environments.

    OSPF can provide better load-sharing on external links than other IGPs. When the default route to an ISP is injected into OSPF from multiple ASBRs as a Type I external route and the same external cost specified, other routers will go to the ASBR with the least path cost from its location. This can be tuned further by adjusting the external cost. If the default route from different ISPs is injected with different external costs, as a Type II external route, the lower-cost default becomes the primary exit and the higher-cost becomes the backup only.

    The only real limiting factor that may compel major ISPs to select IS-IS over OSPF is if they have a network with more than 850 router


    OSPF troubleshooting 
    solve this lab and comment what is error

     

     



    1st OSPF Error  topology: Downlaod OSPF Error lab

    2ed OSPF Error  topology:Download OSPF Error Lab

    3rd OSPF Error  topology:Download OSPF Error Lab

    4th OSPF Error  topology:Download OSPF Error Lab

    5th OSPF Error  topology: Download OSPF Error Lab


    Give me ANS 5 labs in youtube channel

     what is error in lab and comment my youtube chennal

     

     click to go my youtube channel

                  
      solve this lab and comment what is error

    2 comments:

    1. thanks for t-shot lab very help full all time

      ReplyDelete
    2. i like for ospf and all other t-shoot labs upload and solve and advance knowledge ccan and router and switch thanks sir you are good

      ReplyDelete