rip_ospf

Upload: sathis-kumar-shanmugam

Post on 09-Apr-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/8/2019 RIP_OSPF

    1/17

  • 8/8/2019 RIP_OSPF

    2/17

    Routing Information Protocol ( RIP) is an Interior Gateway Protocol (IGP), meaning it is used within anautonomous system. A distance-vector protocol, RIP was designed to work with small to medium-sizednetworks.

    The original version of RIP is based on the program routed(pronounced "route dee"), distributed with the 4.3Berkeley Software Distribution. RIP was in widespread use as arouting protocolbefore it was formallydefined in RFC 1058. RIP Version 2, defined in RFC 2453, added some additional features and functionalityto the original version. Both versions of RIP are discussed in this module. RFC 2091 specified additionalextensions for RIP to allow support for demand circuits (Triggered RIP). Support for Triggered RIP wasadded in 12.0(1)T and will not be discussed here.

    Some advantages of using RIP, especially in small networks, is that there is very little overhead, in terms ofbandwidth used and configuration and management time. RIP is also easy to implement, compared tonewer IGPs, and has been implemented in networks around the world.

    RIP is a distance-vector protocol. As you learned in the "Cisco Interactive Mentor: Basic IP RoutingConcepts" module, a distance-vector protocol is based on the exchange of routing-table information. Eachrouter using a distance-vector protocol maintains information about all the destinations within the system. Ingeneral, the information about all the entities connected to one network (or subnet) is summarized within a

    single entry. This entry includes the next destination to which datagramsare destined, a metricmeasuringthe total distance to the entity, the time delayin sending the messages, and the costof sending themessages. Distance-vector protocols compute the optimal routes from this information and then share thatinformation with adjacent entities on the same network. Routers running RIP may participate as eitheractiveorpassive devices. A device running in active mode will advertise its routes, while a passive device willsilently listen to advertisements. For obvious reasons, routers generally run in active mode while hosts oftenrun in passive mode when running RIP.

    RIP is used to convey information about routes to destinations. RIP relies on access to information about itsdirectly connected networks. An active RIP device accomplishes this access by periodically advertising itsrouting information. The information that RIP uses to construct these updates is taken from therouting table(or the RIP database in Cisco IOS 12.0T and later). The routing table contains one entry for everydestination that is reachable within the system. Each entry has the following information:

    IP address of the destination

    A metric that represents the total cost of getting a datagram from the host to the destination

    The IP address of the next router along the path to the destination

    Timers associated with the router

    http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/
  • 8/8/2019 RIP_OSPF

    3/17

    The route change flag that indicates that the information about the route has changed recently

    The following is an example of a RIP routing table:

    RIP maintains only the best route to a destination. In order to prevent routing information from oscillating

    between two or more equal-cost paths, the RFC specifies that updates from different next hops should beused only if the reported metric is less than the currently installed route. Metric changes received from theexisting gateway are installed immediately. The Cisco implementation allows routes with identical metrics forthe same network to be simultaneously installed forload balancing.Network topology changes can cause changes in routes. These changes can result in a new route becomingthe best route to a particular destination. When network topology changes occur, they are reflected inrouting update messages. For example, when a router detects a link or router failure, it recalculates itsroutes and sendsrouting update messages. Each router receiving a routing update message that includes achange updates its tables and propagates the change.

    RIP uses a single routing metric, hop count, to measure the distance between the source and destinationnetworks. Each hop in this path is assigned a hop-count value, which with RIP is usually 1. When a routerreceives a routing update that contains a new or changed destination-network entry, the router adds one tothe metric value indicated in the update and enters the network in the routing table. The IP address of thesender is used as the next hop. This method for incrementing the routing metric will theoretically provideloop-free routing information in a perfectly stable environment, but when the topology changes or whennetworks become inaccessible, it can lead to two classic problems faced by traditionaldistance-vectorrouting algorithms:slowconvergenceorcount to infinity.Routing information about topology changes propagates slowly throughout a network because ofinconsistencies between the routing tables of the routers in the network. Limiting the number of hops in anetwork helps to improve this convergence problem. Limiting the number of hops allowed also preventsrouting loopsfrom continuing indefinitely. RIP is limited to networks whose longest path involves 15 hops.With RIP, if a router receives a routing update that contains a new or changed entry, and if increasing themetric by one causes the metric to be 16, the network destination is considered unreachable. In other words,16 is equivalent to "infinity" in a RIP network. If a network becomes completely inaccessible, then routerscould mutually deceive each other and "count to infinity," as shown in the following example:

    http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/
  • 8/8/2019 RIP_OSPF

    4/17

    Router_C is advertising the network 192.100.10.x with a cost of one. Router_A is advertising the network192.100.10.x with a cost of two. If the connection between Router_C and the network 192.100.10.x is lost,then Router_C will advertise it with a cost of 16 (infinity). If Router_A advertises the network 192.100.10.xback to Router_C before the "infinite" metric is received, then Router_C may incorrectly believe thatRouter_A can still reach the target network with a cost of two. Router_C will advertise the network192.100.10.x back to Router_A with a cost of three. This routing loop will continue until both routerseventually "count to infinity." RIP designers chose 16 to be infinity because they wanted the number to be

    small enough that when networks become completely inaccessible, the counting would stop as soon aspossible. The choice of 16 as infinity is a tradeoff between network size and the speed of convergence. Thedesigners of RIP believed that it would be impractical to implement RIP in networks with diameters largerthan 15.

    RIP also uses timers both to regulate its performance and to help prevent routing loops like those shownabove. All routers that use RIP send an update message to all of their neighbors approximately every 30seconds; this process is termed advertising. The RFC specifies that advertisements should be randomizedby up to +/ five seconds in order to prevent synchronization of routing updates. The Cisco implementationsends updates every 30 seconds minus up to 15 percent, or 4.5 seconds.If a neighborhas not responded in 180 seconds, it is assumed that the neighboring router is unavailable orthe network connecting it to the router has become unusable. When the neighbor has not responded for 180seconds, the route is marked invalid; 180 seconds is long enough that a route won't be invalidated by a

    single missed update message. The neighbor is shown to be unreachable by sending a normal updatemessage with a metric of "infinity;" in the case of RIP, this number is 16. If an advertisement is received froma neighbor with a metric of infinity, then the route is placed into holddown state, advertised with a distance of16, and kept in the routing table. No updates from other neighbors for the same route are accepted while theroute is in holddown state. If other neighbors are still advertising the same route when the holddown timerexpires, then their updates will then be accepted. The route will be advertised with an infinity metric for aperiod of time after the holddown state if no alternate paths are found.The actual timers used to accomplish the above tasks are a routing-update timer, a route-invalid timer, aroute-holddown timer, and a route-flush timer. The RIP routing-update timer is generally set to 30 seconds,ensuring that each router will send a complete copy of its routing table to all neighbors every 30 seconds.The route-invalid timer determines how much time must expire without a router having heard about aparticular route before that route is considered invalid. When a route is marked invalid or put in holddownstate, neighbors are notified of this fact. This notification must occur prior to expiration of the route-flushtimer. When the route flush-timer expires, the route is removed from the routing table. Typical initial valuesfor these timers are 180 seconds for the route-invalid and route-holddown timers and 240 seconds for theroute-flush timer.The values for each of these timers can be adjusted with the timers basicrouter configuration command.Information concerning the RIP process, including the timers, can be seen with the show ip protocolcommand. A sample output from this command is shown in the following example:

    Router-1#show ip protocolRouting Protocol is "rip"Sending updates every 30 seconds, next due in 18 secondsInvalid after 180 seconds, hold down 180, flushed after 240Outgoing update filter list for all interfaces isIncoming update filter list for all interfaces isOutgoing routes will have 10 added to metric if on list 1Redistributing: rip

    Default version control: send version 1, receive any versionInterface Send Recv Triggered RIP Key-chainEthernet0/0 1 1 2

    Routing for Networks:172.16.0.0

    Routing Information Sources:Gateway Distance Last Update172.16.4.1 120 00:00:20

    Distance: (default is 120)

    http://void%20donothing%28%29/http://opencmdrefwindow%28%27timers%20basic%27%29/http://opencmdrefwindow%28%27timers%20basic%27%29/http://opencmdrefwindow%28%27show%20ip%20protocols%27%29/http://void%20donothing%28%29/http://opencmdrefwindow%28%27timers%20basic%27%29/http://opencmdrefwindow%28%27show%20ip%20protocols%27%29/
  • 8/8/2019 RIP_OSPF

    5/17

    Router-1#

    To adjust for rapid network-topology changes, RIP specifies numerous stability features that are common tomany routing protocols. RIP implements split horizon withpoison-reverse and holddownmechanisms toprevent incorrect routing information from being propagated. Split horizon prevents incorrect messages from

    being propagated by not advertising routes over an interface that the router is using to reach the route.Implementing split horizon helps avoid routing loops. Poison reverse operates by advertising routes that areunreachable with a metric of infinity back to the original source of the route. Holddown is a method ofmarking routes invalid (expired). As discussed above, no updates from other neighbors for the same routeare accepted while the route is in holddown state.Triggered updates are also an included convergence and stability feature. Updates are triggered whenever ametric for a route changes. Triggered updates may also contain only information regarding routes that havechanged, unlike scheduled updates. There is a minimum delay of five seconds between triggered updates toprevent update storms.

    RIP is a User Datagram Protocol (UDP)-based protocol. Each router that uses RIP has a routing processthat sends and receives datagrams on UDP port number 520, the RIP port. All communications for the RIPprocess of the router use this port. All routing update messages are sent from the RIP port and unsolicitedrouting update messages have both the source and destination port equal to this port. RIP V1 traffic is sentas abroadcast to the 255.255.255.255 IP address by default.The following is the packet format for the original version of RIP, defined in RFC 1058:

    The Commandfield indicates whether the packet is a request or a response. The request asks a router tosend all or part of its routing table. The response can be an unsolicited update message or a reply to arequest. Responses contain routing-table entries. Multiple RIP packets are used to contain information forlarge routing tables.The Version Numberfield specifies the RIP version used. This field can signal potentially incompatibleversions.The Zero field is not used.TheAddress-Family Identifier (AFI) specifies the address family used. RIP is designed to carry routinginformation for several different protocols. Each entry has an AFI to indicate the type of address beingspecified. The AFI for IP is 2.The Metric, as stated earlier, indicates how many hops have been traversed in the trip to the destination.The value is between 1 and 15 for a valid route, or 16 for an unreachable route.The RIP V1 packet format does not distinguish among different types of addresses. Fields that are labeled"address" can contain any of the following:

    Host address

    Subnet number

    Network number

    Zero (default route)

    Entities that use RIP V.1 are supposed to use the most specific information availablewhen routing a datagram. First, the destination address of the datagram is checkedagainst the list of node addresses. Then it is checked to determine whether it matchesany known subnet or network number. If none of these match, the default route is used.

    http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://openpopwinurl%28%27quizzes/qframeset_1.html')http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/
  • 8/8/2019 RIP_OSPF

    6/17

    Note: All routes received on an interface are assumed to have the subnet mask of that interface. Because ofthis, if the subnet masking is different on interfaces within the same major network, updates will not beexchanged between these interfaces because of the possible resulting ambiguity. Updates that do not fitwith the assumedsubnet maskare considered to be host routes. If an update including a route from adifferent major network is received on an interface, the router must assume that the update is for the entiremajor network. For this reason, there is no way to disable autosummarization with RIP V.1.

    Default Routes in RIP

    As mentioned above, a default route will be used to route packets if a longer match is not found in therouting table. When RIP is used to advertise the default route, the address field in the packet contains zero,referring to the 0.0.0.0 IP network address. Unlike other protocols, RIP will automatically advertise thedefault route as long as a default route from any source is installed in the routing table on the router; noadditional redistributioncommands are necessary. In versions prior to 12.0(1)T, a default can be forciblyadvertised using the default-information originate command even though no default route is known by therouter.

    RIP Version 2, or RIP V.2, was created to add additional functionality to the original RIP and also cope withsome new issues that arose after RIP was defined. RIP V.2 uses the same basic algorithms as RIP V.1, butsupports external route tags, subnet masks, next-hop addresses, and authentication. RIP V.2 is backwardcompatible with RIP V.1.

    External Route TagsRIP V.2 includes a Route Tag field, which is an attribute assigned to a route that must be preserved andreadvertised with a route. This field provides a mechanism to separate "internal" RIP routes (routes fornetworks within the RIP routing domain) from "external" RIP routes, which may have been imported from anExterior Gateway Protocol (EGP) or another IGP.

    Subnet MaskRIP V.2 allows the use of variable subnet masks on the network. In RIP V.1, there is a subnet/hostambiguity because nodes do not know the subnet masks, so evaluating the address can be ambiguous. InRIP V.2 there is a Subnet Mask field, which is applied to the IP address to yield the nonhost portion of theaddress. If this field is zero, then no subnet mask has been applied.

    Next-Hop AddressesRIP V.2 supports next-hop addresses; this setup allows for optimization of routes in an environment that

    uses multiple routing protocols. For example, if RIP V.2 was running on a network with Enhanced InteriorGateway Routing Protocol (EIGRP) and one router ran both protocols, then the router could indicate if abetter next hop than itself exists for a given destination. This setup eliminates packets from being routedthrough extra hops in the system.The Next-Hop field is an "advisory" field, and if the provided information is ignored, another suboptimal routemay be taken. If the received next hop is not directly reachable, it should be treated as 0.0.0.0.

    AuthenticationRIP V.2 offers an authentication mechanism, which is a per-message function. With RIP V.2, there is only a2-octet field available in the message header and since 2 octets are obviously not enough, theauthentication scheme uses the space of an entire RIP entry.To identify if the entry contains authentication, check to see if the AFI of the first entry is 0xFFFF. If it is,there can be a maximum of 24 RIP entries in the remainder of the message. The AFI or 0xFFFF should notbe used if authentication is not being used.The authentication type for RIP V.2 is a simple password, and it is type 2. The remaining 16 octets contain aplaintext password. If the password is under 16 octets, it must be left-justified to the right with nulls (0x00).

    MulticastingRIP V.2 packets may be multicastinstead of being broadcast. The multicast address is 224.0.0.9.Multicasting reduces the load on hosts that do not support routing protocols, and also allows RIP V.2 routersto share information that RIP V.1 routers cannot hear. This feature is useful since a router running theoriginal version of RIP may misinterpret route information because it cannot apply the subnet mask.

    http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://opencmdrefwindow%28%27default-information%20originate%27%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://opencmdrefwindow%28%27default-information%20originate%27%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/
  • 8/8/2019 RIP_OSPF

    7/17

  • 8/8/2019 RIP_OSPF

    8/17

    This tutorial provides information on the fundamentals of the Open Shortest Path First (OSPF) routingprotocol. After you have reviewed the material in this introductory section, proceed to the Configuration andTroubleshooting sections, which include hands-on lab exercises.

    Remember: Use the Pop Quiz feature to test your understanding throughout this course.

    At the end of this tutorial, you will be able to:

    Describe the differences between link-state and distance-vector routing protocols.

    Visualize how OSPF operates.

    Understand the hello protocol and its role in forming neighbors and adjacencies.

    Display an OSPF link-state database and interpret its contents.

    Understand various OSPF extensions, such as stub areas, totally stubby areas, not-so stubbyareas, and on-demand circuits.

    Configure OSPF.

    Redistribute external routes into OSPF, and configure an ASBR to advertise a default route into anOSPF domain.

    Monitor OSPF processes with show commands.

    Use debugging commands to monitor and debug OSPF processes.

    Configure OSPF over NBMA networks.

    Configure stub, totally stubby, and not-so stubby areas.

    Configure virtual links.

    Propagate multiple routes into external areas.

    Begin with Understanding Open Shortest Path First.

    http://www.cisco.com/E-Learning/bulk/subscribed/tac/cim/iprouting/ospf/ospf_content.htmhttp://www.cisco.com/E-Learning/bulk/subscribed/tac/cim/iprouting/ospf/ospf_content.htmhttp://www.cisco.com/E-Learning/bulk/subscribed/tac/cim/iprouting/ospf/ospf_content.htm
  • 8/8/2019 RIP_OSPF

    9/17

    The Open Shortest Path First (OSPF)routing protocol is based on link-state technology, as opposed todistance-vector protocols such as Interior Gateway Routing Protocol (IGRP) and Routing InformationProtocol (RIP). OSPF offers several advantages over distance-vector protocols. It has fasterconvergence,supports largerinternetworks, and is less susceptible to bad routing information. Some of the features of

    OSPF follow:

    Hierarchical routing

    Classless behavior, allowing support of variable-length subnet masks(VLSMs) and discontiguousnetworks

    The use ofmulticast addressesin order to reduce the effect of non-OSPF routing devices

    Authentication for secure routing

    OSPF is a routing protocol that calls for the sending oflink-state advertisements (LSAs) to all otherrouterswithin the same hierarchical area. An area is a group of contiguous networks and attached hosts. OSPF

    LSAs include information on attached interfaces, metrics used, and other variables. As OSPF routersaccumulate information, the routers use the SPFalgorithm to calculate the shortest path to each node. Thisis different from the way distance-vector protocols work. Distance-vector protocols send all or a portion oftheirrouting tables in routing-update messages to theirneighbors. Configuring and troubleshooting OSPFnetworks is more complex than with its distance-vector counterparts.

    The following is an overview on how OSPF operates:

    Routers running OSPF will send OSPFhello packets to all OSPF-enabled interfaces.

    Routers sharing a commondata link will become OSPF neighbors if their hello packets containcertain information that is mutually agreed upon.

    OSPF neighboring routersmay form an OSPF adjacencyif it is determined that there are certaincommonalties between the routers exchanging hellos and the network over which the hellos areexchanged. Not all neighboring routers will form adjacencies.

    Routers will send (flood) LSAs over all adjacencies.

    All routers will build identical databases the LSAs.

    Shortest-path trees are calculated from the newly assembled routing tables.

    HellosOSPF neighbors are identified by their router IDs. A router ID is anIP addressby which the router isuniquely identified within the OSPFdomain. A Cisco router selects its router ID as the highest IP address onany loopback interfaces configured on the router. If no loopback interfaces are configured on the router, the

    router chooses the highest IP address of any of its physical interfaces.Routers that share a common segment may become neighbors on that segment. Neighbors are discoveredvia the OSPF Hello protocol and are recorded in a neighbor table.The Hello protocol:

    Provides a way to discover OSPF neighbors

    Acts as a keepalive between neighbors

    Ensures bi-directional communication between neighbors

    http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/
  • 8/8/2019 RIP_OSPF

    10/17

    Is used fordesignated router(DR) andbackup designated router(BDR) election on certain types ofnetworks

    Hello packets are sent out all OSPF-enabled interfaces. They are sent out periodically with a specialmulticast address as the destination. Routers will become neighbors when they see themselves (their ownrouter ID) in their neighbors hello packets and they agree upon certain parameters included in the hellopackets. Neighbor negotiation will take place on the primary IP address only, not over secondary addresses.

    If secondary addresses are configured on the interface, they are restricted to be in the same OSPF area asthe primary address.Two routers will become neighbors if the following parameters are agreed upon:

    Area ID The two routers sharing a common network segment must have their interfacesconfigured to be in the same area.

    Authentication OSPF allows for configuration of a password for a specified area. Routers thatwant to become neighbors must exchange the same password over the common segment.

    Hello and Dead intervals The hello interval is the amount of time between hello packets that arouter sends out on an OSPF-enabled interface. The dead interval is the amount of time, inseconds, that a router will wait for a hello packet from a neighbor before declaring the neighbordown. These interval times are included in the hello packet and must be agreed upon by neighbors.

    Stub area flag Two neighboring routers must also agree on the stub area flag in the hello

    packets in order to become neighbors. (Stub areas will also be discussed later.)

    All of the above parameters are included in hello packets. Also included in hello packets are the following:

    The router ID of the originating router

    The address and mask of the originating interface

    Router priority, which is used for DR election (discussed later)

    The DR and BDR

    Flag bits for option capabilities; one of these is the stub area flag mentioned above

    Router IDs of the originating router neighbors

    Network TypesAfter two-way communication between neighbors is established, OSPF routers move on to the next step,

    which is building adjacencies. Adjacent routers are routers that go beyond the hello protocol exchange andproceed into the database exchange process.As previously mentioned, not all neighboring routers become adjacent. Whether or not an adjacency isformed depends on the type of network to which the neighboring routers are connected.The types of networks that OSPF defines follow:

    Point-to-point networks

    Broadcast networks

    Non-Broadcast Multi-Access networks (NBMA)

    Point-to-multipoint networks

    Point-to-point networks, such as seriallines, connect a single pair of routers. OSPF will always form anadjacency with the neighbor on the other side of a point-to-point interface. There is no concept of DR or

    BDR on point-to-point networks. Thedestination addressof OSPF packets on these networks will always besent to 224.0.0.5, otherwise known as the ALLSPFRouters multicast address.Broadcast networks, such asEthernet, Token Ring, and Fiber Distributed Data Interface (FDDI), are multi-access, meaning they are able to connect more than two devices; a packet sent by one router will bereceived by all connected routers. On broadcast networks, OSPF will elect a DR and a BDR. Hello packetson broadcast networks are sent to the destination address of 224.0.0.5. All packet originated by the DR andBDR are also sent to the this address. All other non-DR and non-BDR routers will send link-state updates tothe address 224.0.0.6, also known as AllDRouters.NBMA networks, such as Frame Relay, ATM, andX.25, can connect multiple devices, but they have nobroadcast capability. (For more information on Frame Relay, please read theFrame Relay document.) Apacket sent by a router will not be received by all the other routers attached to the network. Special care

    http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://openlinked%28/http://openlinked%28/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://openlinked%28/
  • 8/8/2019 RIP_OSPF

    11/17

    should be taken when configuring OSPF over NBMA networks. OSPF considers these mediato be just likeany other broadcast media such as Ethernet or Token Ring. As a result, extra configuration may be requiredfor NBMA networks. OSPF routers elect a DR and BDR, and all OSPF packets areunicast.Point-to-multipoint networks are NBMA networks in which the networks are treated as a collection of point-to-point links. Routers on these networks do not elect a DR and BDR because the network is seen as point-to-point links. OSPF packets aremulticast on these networks.

    Designated Router and Backup Designated Router

    The DR and BDR are elected on broadcast networks in order to prevent certain problems. First, if everyrouter attached to a broadcast network formed an adjacency with every other router attached to the network,there would be n(n - 1)/2 adjacencies. Second, if a router flooded its LSAs to all of the router neighbors andall routers in turn flooded the LSA to their neighbors, there would be multiple copies of the same LSA on thesame network.The idea behind the DR is that every router attached to the network would form an adjacency with the DR.Only the DR would send LSA to the rest of the attached network. OSPF also elects a BDR in the event thatthe DR fails. This prevents routers from having to reelect a DR and reforming adjacencies with the new DR.Instead, the routers attached to the network form an adjacency with both the DR and BDR. If the DR goesdown, the BDR becomes the DR; since the other routers already have a formed adjacency with the BDR,there is little, if any, network unavailability.DR and BDR election is done via the Hello protocol. Hello packets are exchanged via IP multicast packetson each segment. The router with the highest OSPF priority on the segment will become the DR. Defaultpriority is one for Cisco router interfaces. This process is repeated for the BDR. If the priorities are the same,the router with the highest router ID will become the DR. A single DR/BDR pair is elected on each attached

    segment. A router that is the DR of one segment may not be the DR or BDR of another attached segment.Setting the OSPF priority of an interface can be done with the interface subcommand:

    ip ospf priority [value]A priority value of zero indicates that the interface will not be elected as the DR or BDR.Note that once a DR and a BDR have been elected, a new router coming on line that has a higher prioritywill not override the DR and BDR. When the new OSPF router becomes active and discovers its neighbors,it checks for valid DR and BDR. If the DR and BDR exist, the new router will accept them. Routers that arenot the DR or BDR are known as DRother.

    In the diagram above, the router that will be elected DR for Segment 1 will be Router_F. This is because thepriorities of all the router interfaces are equal (P = 1 on all the interfaces). This results in the router with the

    highest router ID (RID) as being elected the designated router. Router_F has the highest RID and is,therefore, the DR.On segment 2, Router_C does not have the highest RID, but it still is elected the DR because its OSPFinterface priority, which is 2, is higher than all the rest.The diagram below shows the resulting adjacencies that will be formed on segment 1 of the diagram above.Note that the routers that are not DR will form adjacencies only with the DR. In this illustration, the BDR isnot shown, but adjacencies would also be formed with the BDR.

    http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/
  • 8/8/2019 RIP_OSPF

    12/17

    Building AdjacenciesAfter neighbor discovery takes place and bi-directional communication is established (a router sees its ownrouter ID in neighbor hello packet), neighboring routers attempt tosynchronizetheirlink-state databases.When database synchronization in successful, the neighbors are fully adjacent.

    Neighbors on point-to-point and point-to-multipoint networks always become adjacent unless the parametersof the hello packets are not agreed upon. On broadcast networks and NBMA networks, the DR and BDRbecome adjacent with all neighbors. No adjacencies will be formed between the DRothers.The following are states through which OSPF routers will transition neighbors before being considered fullyadjacent:

    Down This is the initial state of the neighbor, indicating no information has been received fromany router on the segment.

    Attempt On NBMA networks, where neighbors are manually configured, this state indicates thatno recent information has been received from the neighbor. An effort is made to contact theneighbor by sending hello packets.

    Init This state indicates that a hello is received from a neighbor; however, bi-directionalcommunication is not yet established.

    Two-way The router has seen itself in the neighbor hello packets. Bi-directional communicationis now established. On broadcast networks DR and BDR are elected at the end of this state. Whenthis state ends, a decision is made whether or not to proceed in building an adjacency. Thedecision is based on whether the neighbor is a DR or BDR or the network link is point-to-point.

    ExStart The router and its neighbor establish a master/slave relationship and determine theinitial sequence number that is going to be used in the exchange of database description packets.

    Exchange Routers will describe their entire link-state database by sending databasedescription packet to neighbors that are in the exchange state.

    Loading Routers build a link-state request list and retransmission list. Any information thatlooks outdated or incomplete will be put on the request list. Any update that has not beenacknowledged will be put on the retransmission list.

    Full The adjacency is now complete. Adjacent routers will have identical link-state databases.

    Flooding

    The OSPF link-state database consists of all the LSAs the router has received. Each node in the networkmaintains an identical link-state database. A change in the topology means a change in one or more of theLSAs.Flooding is the process by which these new LSAs are sent throughout the network in order to ensurethat the databases in all routers remain identical.

    AreasBecause of its complexity with multiple databases and flooding algorithms, OSPF can be memory andprocessor intensive. The demand for memory and processor utilization grows as the network grows.OSPF uses areas to reduce the strain on router memory and processor utilization. An area is a logicalgrouping of routers that break the OSPF network into subdomains. Routers must share identical databaseswith routers in its area only, not with the entire network. This reduces the memory demand. The smaller

    http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/
  • 8/8/2019 RIP_OSPF

    13/17

    database results in a smaller number of LSAs to process, thereby reducing the demand of processingpower. Most flooding is also limited within an area.Areas are interface specific and are identified with an area ID. The introduction of areas also introduces adifferent type of traffic. Intra-area traffic consists of packets that are contained within an area; inter-areapackets travel between routers in different areas. External traffic consists of packets that travel betweenrouters belonging to an OSPF domain and anotherautonomous system.

    Backbone

    If more than one area is configured, one of these areas must be defined as area 0. Area 0 is known as thebackbone area. All other areas must be logically connected to area 0 either physically or through a virtual-link. Virtual-links are explained below. Each area gives routing information to area 0 which in turndisseminates that information to all other connected areas. For this reason, all inter-area traffic must passthrough area 0. Non-backbone areas cannot exchange packets directly with one another.

    Virtual LinksAs mentioned above, all other areas must be physically connected to the backbone area, area 0. In somecases where this is not possible, a virtual link can be used. The virtual link will provide a link to the backbonethrough a nonbackbone area. Virtual links are also used to connect two parts of a partitioned backbonethrough a nonbackbone area.

    As shown in the above diagram, virtual links can be established between two area border routers (ABRs)that have a common area, with one ABR connected to the backbone.The transit area is defined as the area between two ends of a virtual link. The transit area must beconnected to area 0 to have full routing information and cannot be a stub area.OSPF classifies virtual links as point-to-point networks with no IP subnets associated with them.

    Router TypesAs mentioned above, areas are interface specific, meaning that a router can have one interface configuredin one area and a second interface configured in a second area. Therefore, routers can be categorized inrelation to areas. There are three types of OSPF routers.

    Internal routers (IRs) An internal router is a router with all of its interfaces in the same area.

    Area border routers (ABRs) An ABR is a router that has interfaces in multiple areas. An ABRmust always have at least one interface in the backbone area.

    Autonomous system boundary routers (ASBRs) ASBRs are routers that act asgateways

    between OSPF and other routing protocols or other OSPF routing processes. In other words,redistributiontakes place on the ASBRs.

    http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/
  • 8/8/2019 RIP_OSPF

    14/17

    All valid LSAs received by a router are stored in a link-state database. These LSAs describe the topology ofan area. Routers use the LSAs to calculate the shortest path tree.The list of LSAs in the database can be viewed with the commandshow ip ospf database. This list showsonly the information in the LSAheader, but it also contains LSAs from multiple areas if the router were anABR. More detailed information of each LSA can be viewed with different commands, which will beexplained later. An example output of theshow ip ospf database command follows:

    Router_B#show ip ospf databaseOSPF Router with ID (170.170.3.2) (Process ID 7)

    Router Link States (Area 0)Link ID ADV Router Age Seq# Checksum Link count

    170.170.3.2 170.170.3.2 17 0x80000002 0x8B6 1170.170.8.4 170.170.8.4 217 0x80000003 0xAA02 1170.170.13.3 170.170.13.3 218 0x80000002 0x5156 1Net Link States (Area 0)Link ID ADV Router Age Seq# Checksum170.170.3.3 170.170.13.3 18 0x80000002 0xA0B2Summary Net Link States (Area 0)Link ID ADV Router Age Seq# Checksum170.170.7.0 170.170.8.4 240 0x80000001 0x6ED0Summary ASB Link States (Area 0)Link ID ADV Router Age Seq# Checksum170.170.11.6 170.170.8.4 129 0x80000001 0xF73CType-5 AS External Link StatesLink ID ADV Router Age Seq# Checksum Tag

    200.200.200.0 170.170.11.6 135 0x80000001 0xE4FA 0Router_B#

    As can be seen from the information in the database in the above diagram, there are different types of LSAsdefined by OSPF. Each type describes a different portion of the OSPF network. The table below lists thedifferent LSA types and type codes and how the link-state is identified. Following the table is a description ofthe LSAs.

    Different LSA Types

    Type Code LSA Link-State ID

    http://opencmdrefwindow%28%27show%20ip%20ospf%20database%27%29/http://opencmdrefwindow%28%27show%20ip%20ospf%20database%27%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://opencmdrefwindow%28%27show%20ip%20ospf%20database%27%29/http://opencmdrefwindow%28%27show%20ip%20ospf%20database%27%29/http://opencmdrefwindow%28%27show%20ip%20ospf%20database%27%29/http://void%20donothing%28%29/http://opencmdrefwindow%28%27show%20ip%20ospf%20database%27%29/
  • 8/8/2019 RIP_OSPF

    15/17

    1 Router LSA Originating router ID of the router

    2 Network LSA Interface IP address of the DR

    3 Network summary LSA Destination network number

    4 ASBR summary LSA Router ID of AS boundary router

    5 AS external LSA External network number

    7 NSSAexternal LSA External network number

    Router LSAs are generated by every router. The router LSA is a list of links attached to the router, as well asthe state of the link and the outgoing OSPF costassociated with the link. To view details of the router LSA,use the show ip ospf database routercommand.

    Router LSA

    Network LSAs are generated by the DR on a multi-access segment. They are the representation of themulti-access segment and all the routers attached to the segment. Segments that do not have a DR, suchas point-to-point, will not have a network LSA. To view detailed information of the network LSA, use theshow ip ospf database networkcommand.

    Network LSA

    Network summary LSAs are generated by ABRs. This is how network reachability information is advertised.

    ABRs are responsible for injecting information into the backbone and the backbone will pass the informationon to other areas. The show ip ospf database summarycommand can be used to view detailedinformation of the summary LSA.

    Network Summary LSA

    http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://opencmdrefwindow%28%27show%20ip%20ospf%20database%27%29/http://opencmdrefwindow%28%27show%20ip%20ospf%20database%27%29/http://opencmdrefwindow%28%27show%20ip%20ospf%20database%27%29/http://opencmdrefwindow%28%27show%20ip%20ospf%20database%27%29/http://opencmdrefwindow%28%27show%20ip%20ospf%20database%27%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://opencmdrefwindow%28%27show%20ip%20ospf%20database%27%29/http://opencmdrefwindow%28%27show%20ip%20ospf%20database%27%29/http://opencmdrefwindow%28%27show%20ip%20ospf%20database%27%29/
  • 8/8/2019 RIP_OSPF

    16/17

    ASBR summary LSAs are also generated by the ABR. This LSA describes the location of an ASBR, not anetwork. The details can be viewed with the show ip ospf database asbr-summary command.

    ASBR Summary LSA

    Autonomous System (AS) External LSAs are originated by the ASBRs and describe a network outside of theAS. They can be viewed with theshow ip ospf database external command.

    AS External LSA

    Not-So-Stubby Area (NSSA) external LSAs are originated by the ASBR within the NSSA. These types ofLSAs are flooded only throughout the NSSA. These are unlike external LSAs, which are flooded throughoutthe entire network.

    http://opencmdrefwindow%28%27show%20ip%20ospf%20database%27%29/http://opencmdrefwindow%28%27show%20ip%20ospf%20database%27%29/http://opencmdrefwindow%28%27show%20ip%20ospf%20database%27%29/http://void%20donothing%28%29/http://opencmdrefwindow%28%27show%20ip%20ospf%20database%27%29/http://opencmdrefwindow%28%27show%20ip%20ospf%20database%27%29/http://void%20donothing%28%29/
  • 8/8/2019 RIP_OSPF

    17/17

    Stub AreasASBR routers will flood external routes throughout the OSPF domain. For this reason, OSPF allows certainareas to be configured as stub areas. Stub areas are areas into which external LSAs are not flooded.Routing from these areas to other parts of the OSPF network is done via the default route. The advantage tousing stub areas is that the reduction of the link-state database reduces the requirements for memory.

    All OSPF routers inside a stub area must be configured as stub routers. Since all interfaces belonging to thearea will start exchanging hello packets, the stub flag must be set in order to successfully form a neighborrelationship.Also, virtual links cannot be configured within or transit a stub area.Examples of stub areas and how to configure them will be shown in the "Configuring OSPF" section.

    Totally Stubby AreasTotally stubby areas are areas into which external LSAs and summary LSAs (inter-area routes) are notflooded. The only thing injected into the totally stubby area are intra-area routes and the default route(0.0.0.0). The default route is the only type 3 (summary) LSA that the ABR will allow into the totally stubbyarea.An example of totally stubby areas and their configuration is discussed in the "Configuring OSPF" section.

    Not-So Stubby AreasIn some cases, it may be necessary to connect a stub area to an external AS and redistribute the externalroutes into OSPF. Unfortunately, this means that the stub area router will become an ASBR, meaning the

    area can no longer be a stub area.NSSAs allow external routers to be advertised into the OSPF AS while retaining the characteristics of a stubarea. The ASBR in the NSSA will originate type 7 LSAs. These external NSSA LSAs are flooded throughoutthe NSSA but are blocked at the ABR. The ABR will translate this into a type 5 LSA and flood it into theother areas.An example of NSSAs and their configuration is discussed in the "Configuring OSPF" section.

    OSPF On-Demand CircuitsOSPF demand circuit is an enhancement to the OSPF protocol that allows efficient operation over on-demand circuits such as ISDNand dial-up lines. Prior to this feature, periodic hellos and LSA updates wouldbe exchanged between routers that connected the on-demand link, even when there were no changes in theHello or LSA information.With this feature, periodic Hellos are suppressed and periodic refresh of LSAs are not flooded over demandcircuits. These packets bring up the link only when they are exchanged for the first time, or when there is achange in the information they contain.

    You have now learned the fundamentals of the OSPF routing protocol. This protocol incorporates many ofthe basic concepts taught in the "Cisco Interactive Mentor: Basic IP Routing Concepts" module. Next youwill learn the basic steps involved in configuring OSPF.

    Now proceed toConfiguring OSPF.

    http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://www.cisco.com/E-Learning/bulk/subscribed/tac/cim/iprouting/ospf/ospf_configuration.htmhttp://www.cisco.com/E-Learning/bulk/subscribed/tac/cim/iprouting/ospf/ospf_configuration.htmhttp://www.cisco.com/E-Learning/bulk/subscribed/tac/cim/iprouting/ospf/ospf_configuration.htmhttp://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://void%20donothing%28%29/http://www.cisco.com/E-Learning/bulk/subscribed/tac/cim/iprouting/ospf/ospf_configuration.htm