OSPF

52
Saravanan AR OSPF - STUDY

description

Ospf

Transcript of OSPF

  • Saravanan AROSPF - STUDY

  • INDEXIntroductionMotivationOSPF BasicsDetail in OSPFSummary

  • INTRODUCTION

    Development began in 1987OSPF Working Group (part of IETF)OSPFv2 first established in 1991Many new features added since thenUpdated OSPFv2 specification in RFC 2178

  • MOTIVATION

    Original IGP used was RIPBased on Bellman-Ford AlgorithmWorked well in small systemsSuffered from problems of Distance Vector ProtocolCount to Infinity ProblemSlow ConvergenceProblems with Distance Vector ProtocolLarge update packetsSlow response to topological changesNeed for a Link State ProtocolA long list of functional requirements follows

  • WHAT is OSPFOSPF uses a link-state algorithm in order to build and calculate the shortest path to all known destinations.There are 2 link state routing protocol. Rest all belong to distance vector routing protocol & other.OSPFIS-ISLink state routing protocol maintains 3 tables like eIGRP.Neighbor table track the neighborTopology table roadmap / possible map info.Routing table. Link state routing knows the entire roadmap whereas distance vector routing protocol only know what their neighbor know. So link state routing is more CPU overhead compared to distance vector.The shortest path is calculated using the Dijkstra algorithm.OSPF was designed to support variable-length subnet masking (VLSM) or Classless Inter-Domain Routing (CIDR) addressing models.

  • BASICS of OSPF - Attributes Attributes

    Type - Link-StateAlgorithm - DijkstraMetric - Cost (Bandwidth)AD 110Protocols IPTransport - IP/89Authentication - Plaintext,MD5AllSPF Address - 224.0.0.5AllDR Address - 224.0.0.6

  • BASICS of OSPF - High level view

    Neighbor DiscoveryForming AdjacenciesLink State Advertisements (LSAs) FloodingReliable Transport Shortest Path First Calculations SPF Tree formationBuinling Route Table

  • BASICS of OSPF - High level view High level view on OSPF Operations

    OSPF speaking routers sends hello packets out of all OSPF-enabled interfaces. If routers sharing a common data link agree upon certain parameters, they will become neighbors.Adjacencies, OSPF defines several network types and several router types. It is determined by type of router exchanging Hellos and type of network over which the Hellos are exchanged.Each router sends LSAs(Link State Advertisements)It describes all of the routers links, the routers neighbors, and the state of the link.These links might be STUB, to other OSPF routers, to networks in other areas, or to a external networks.That is why OSPF defines multiple LSA Types.

  • BASICS of OSPF - High level viewEach router receiving an LSA from neighbor records the LSA in its link-state-database and send a copy of it to other neighbors.By flooding LSAs all routers will build identical link-state-database. When the databases are complete, each router uses SPF algorithm to calculate a loop-free graph describing the shortest(lowest cost)path to every known destination, with itself as the root.This graph is the SPF TREE.Each router builds its route table from its SPF TREE.link-state-database have been synchronized and the route tables are built, OSPF is a QUIET PROTOCOL.Hello packets are exchanged as keepalives and LSA are transmitted every 30 minutes.If topology is stable no other activity should occur.

  • Detail in OSPF - Metric - Cost (Bandwidth) The cost of an interface is inversely proportional to the bandwidth of that interface.A higher bandwidth indicates a lower costCost= Cost = Reference / Bandwidth.OSPF uses a Reference Bandwidth of 100 Mbps for cost calculation. The formula to calculate the cost is reference bandwidth divided by interface bandwidth. For example, in the case of Ethernet, it is 100 Mbps / 10 Mbps = 10.Note: If ip ospf cost cost is used on the interface, it overrides this formulated cost. The cost of an interface is calculated based on the bandwidth; you can force the cost of an interface with the ip ospf cost interface sub configuration mode command

  • Detail in OSPF - Metric - Cost (Bandwidth)

  • Detail in OSPF AD PROTOCOL - Authentication Administrative distance is a measure of the trustworthiness of the source. Other application is use Static Routes to backup existing IGP route.Eg: ip route 10.0.0.0 255.0.0.0 Dialer 1 250In the above eg floating static

    route is added and when there is a loss of IGP route dialer will be installed.In order to enable the router to

    prefer RIP routes to OSPF, configure the distance commandR1(config)#router rip R1(config-router)#distance 90

  • Detail in OSPF AD PROTOCOL - Authentication IP PROTOCOL no 89 Network LayerRefer the below link for IP numbers for protocolhttp://www.networkuptime.com/library/ip_protocol.html OSPF does not use a TCP/IP transport protocol (UDP, TCP), but is encapsulated directly in IP datagrams with protocol number 89.This is in contrast to other routing protocols such as BGP,RIP.OSPF handles its own error detection and correction functions.Consider the frame as it goes up the stacktype field says "0800," so it gets handed up to IP.http://www.cavebear.com/archive/cavebear/Ethernet/type.html it will *typically* be 6 or 17 (TCP or UDP respectfully)will be handed up to TCP or UDP accordingly.From there, the port number will be looked at - and will be 23 for Telnet, 69 for TFTP, as you mentioned. In the case of OSPF, the IP protocol number is 89 - neither TCP (6) nor UDP (17), but rather OSPF.It's sometimes referred to as "its own Layer 4 protocol."

  • Detail in OSPF AD PROTOCOL - AuthenticationAuthenticationTypes of Authentication:

    1) Null authentication: Null authentication means that there is no authentication, which is the default on Cisco routers.2) Clear text authentication: In this method of authentication, passwords are exchanged in clear text on the network3) Cryptographic authentication: The cryptographic method uses the open standard MD5 (Message Digest type 5) encryption.OSPF authentication can be enabling in two ways:1) Per interface: Authentication is enabling per interface using the "ip ospf athentication" command.2) Area authentication: Authentication for area can enable using "area authentication" command.

  • Detail in OSPF Multicast IPBroadcast Networks For broadcast networks, OSPF routers use the following two reserved IP multicast addresses:224.0.0.5 - AllSPFRouters: Used to send OSPF messages to all OSPF routers on the same network. The AllSPFRouters address is used for Hello packets. The DR and BDR use this address to send Link State Update and Link State Acknowledgment packets.224.0.0.6 - AllDRouters: Used to send OSPF messages to all OSPF DRs (the DR and the BDR) on the same network. All OSPF routers except the DR use this address when sending Link State Update and Link State Acknowledgment packets to the DR.Point-to-Point Networks Point-to-Point networks use the AllSPFRouters address (224.0.0.5) for all OSPF messages.NBMA Networks NBMA networks have no multicasting capability. Therefore, the destination IP address of any Hello or Link State packets is the unicast IP address.Multicast IP addresses are mapped to MAC-level multicast addresses224.0.0.5 - 01:00:5E:00:00:05224.0.0.6 - 01:00:5E:00:00:06

  • Detail in OSPF Router Types Router TypesInternal RouterAll interfaces reside within the same areaBackbone RouterA router with an interface in area 0 (the backbone)Area Border Router (ABR)Connects two or more areasAS Boundary Router (ASBR)Connects to additional routing domains; typically located in

    the backbone

  • Detail in OSPF Router TypesVODAFONE MPLS 4445ABRASBR

  • Detail in OSPF LSA Types 1Router LSA 2Network LSA 3Network summary LSA 4ASBR summary LSA 5AS external LSA 6Group membership LSA(Multicast LSA)- not supported in CISCO 7NSSA external LSA 8External attributes LSA 9Opaque LSA (link-local scope) 10Opaque LSA (area scope) 11Opaque LSA (AS scope)

  • Detail in OSPF Types of Areas

    Areas are introduced to put a boundary on the explosion of link-state updates. Flooding and calculation of the Dijkstra algorithm on a router is limited to changes within an area.All routers within an area have the exact link-state database.Types of Areas Backbone area (area 0) Standard area Stub area Totally stubby areaNot-so-stubby area (NSSA)

  • Detail in OSPF Backbone area (area 0) Standard Area

    type 1 and 2 LSAs are being flooded between routers sharing a common area.Type 3 and 5 LSAs, which describe internal and external IP routes, respectively, are flooded throughout the backbone and all standard areas. External routes are generated by an ASBR, while internal routes can be generated by any OSPF router.type 4 LSAs contains how to reach the ASBR.

  • Detail in OSPF STUB

    ABR injects a type 3 LSA containing a default route into the stub area.This ensures that routers in the stub area will be able to route traffic to external destinations without having to maintain all of the individual external routes.Stub will not allow type 4 LSA.For an area to become a stub.Router(config-router)# area 10 stub

  • Detail in OSPF Totally Stubby Areas

    Like stub areas, totally stubby areas do not receive type 4 or 5 LSAs from their ABRs.However, they also do not receive type 3 LSAs.all routing out of the area relies on the single default route injected by the ABR.A stub area is extended to a totally stubby area by configuring all of its ABRs with the no-summary parameter:Router(config-router)# area 10 stub no-summary

  • Detail in OSPF Not-so-stubby Areas

    An NSSA makes use of type 7 LSAs, which are essentially type 5 LSAs in disguise.This allows an ASBR to advertise external links to an ABR, which converts the type 7 LSAs into type 5 before flooding them to the rest of the OSPF domain.An NSSA can function as either a stub or totally stubby area. To designate a normal (stub) NSSA, all routers in the area must be so configured:Router(config-router)# area 10 nssa

  • Detail in OSPF Area Types & LSA - summary

  • Detail in OSPF LSA Types LSA 1 (Router LSA)Generated by all routers in an area to describe their directly attached links (Intra-area routes). These do not leave the area.LSA 2 (Network LSA)Generated by the DR of a broadcast or non-broadcast segment to describe the neighbors connected to the segment. These do not leave the area.LSA 3 (Summary LSA)

    Generated by the ABR to describe a route to neighbors outside the area. (Inter-area routes)LSA 4 (Summary LSA)

    Generated by the ABR to describe a route to an ASBR to neighbors outside the area.LSA 5 (External LSA)

    Generated by ASBR to describe routes redistributed into the area. These routes appear as E1 or E2 in the routing table. E2 (default) uses a static cost throughout the OSPF domain as it only takes the cost into account that is reported at redistribution. E1 uses a cumulative cost of the cost reported into theOSPF domain at redistribution plus the local cost to the ASBR.

  • Detail in OSPF LSA Types LSA 6 (Multicast LSA)

    Not supported on Cisco routers.LSA 7 (NSSA External LSA)

    Generated by an ASBR inside a NSSA to describe routes redistributed into the NSSA. LSA 7 is translated into LSA 5 as it leaves the NSSA by the ABR. These routes appear as N1 or N2 in the IP routing table inside the NSSA. Much like LSA 5, N2 is a static cost while N1 is a cumulative cost that includes the cost to the ASBR.

  • Detail in OSPF NETWORK Types Point-to-PointBroadcastNon-BroadcastNon-Broadcast Multi-Access (NBMA)Point-to-Multipoint

    Point-to-Point

    A link between exactly two points (or routers). A packet sent from on of the routers will always have exactly one recipient on the local link.Multicast address - 224.0.0.5BroadcastA much more efficient manner of connecting a large number of devices is to implement a multi-access segment.An Ethernet segment is an example of such a network.Ethernet networks support broadcasts; a single packet transmitted by a device can be multiplied by the medium (in this case an Ethernet switch) so that every other end point receives a copy.

  • Detail in OSPF NETWORK TypesFacilitating automatic neighbor discovery.

    OSPF routers on a multiaccess segment will elect a designated router (DR) and backup designated router (BDR).DR & BDR concept reduces full mesh adjacency.a segment containing ten routers would require 45 adjacencies to form a mesh, but only 17 when a DR and BDR are in place.Non-BroadcastUnfortunately, not all multi-access technologies support broadcast transmissions.Frame relay and ATM are probably the most common examples of non-broadcast transport.

  • Detail in OSPF NETWORK TypesRequiring individual permanent virtual circuits (PVCs) to be configured between end points.

    R1 must craft and transmit an individual packet for every destination he wants to reach.Aside from being horribly inefficient with regard to bandwidth.This limitation requires the router to know the addresses of his neighbors before he can communicate to them.OSPF can operate in one of two modes across a non-broadcast network:non-broadcast multi-access (NBMA)point-to-multipointEach of these topologies tackles the absence of broadcast capability from a different direction.

  • Detail in OSPF NETWORK TypesNon-Broadcast Multi-Access (NBMA)An NBMA segment emulates the function of a broadcast network.Every router on the segment must be configured with the IP address of each of its neighbors. Multiple computers and devices are attached, but data is transmitted directly from one computer to another over a virtual circuit or across a switching fabric.OSPF hello packets are then individually transmitted as unicast packets to each adjacent neighbor.As in a true broadcast network, a DR and BDR are elected to limit the number of adjacencies formed.Point-to-MultipointA point-to-multipoint configuration approaches the non-broadcast limitation in a different manner.Rather than trying to emulate broadcast capability, it seeks to organize the PVCs into a collection of point-to-point networks.Hello packets must still be replicated and transmitted individually to each neighbor. but the multipoint approach offers two distinct advantages: no DR/BDR is needed, and the emulated point-to-point links can occupy a common subnet.

  • Detail in OSPF NETWORK TypesAll routers attached to a non-broadcast network must be manually configured to recognize it as a point-to-multipoint segment.The non-broadcast parameter can be appended to the OSPF network type to force unicasting of packets rather than relying on multicast. This might be necessary when dynamic circuits are in use.

  • Detail in OSPF Adjacency StatesDownAttemptInit2-WayEx-startExchangeLoadingFull

  • Detail in OSPF Adjacency States1. Establish Router Adjacencies Down State No Hello received Init State Hello received, but not with this routers Router ID Two-way State Hello received with this routers Router ID (Ex-Start State unless DR/BDR election needed)

    2. Elect DR and BDR (Broadcast Segments Only) Ex-Start State with DR and BDR Two-way State with all other routers

    3. Discover Routes Ex-Start State Exchange State Loading State Full State

    4. Calculate the Routing Table5.Maintain the LSDB and Routing Table

  • Detail in OSPF Adjacency StatesDown StateAn OSPF router attempts to form an adjacency with at least one neighbor for each IP network to which it is connected.RTB multicasts OSPF Hello packets to 224.0.0.5 (the AllSPFRouters multicast

    address), advertising its own Router ID.

  • Detail in OSPF Adjacency StatesOSPF Necessary ConditionsSpecifically, the following must match before a pair of routers become OSPF neighbors.

    1. Subnet mask used on the subnet.

    2. Subnet number ( as derived using the subnet mask and each router's interface IP address)3. Hello Interval

    4. Dead Interval

    5. OSPF area ID

    Must pass authentication checks ( if used)

    If any of these parameters differs, the routers do not become OSPF neighbors.

  • Detail in OSPF Adjacency StatesRTB Hello packet

  • Detail in OSPF Adjacency StatesAfter initial HELLOWhen a router receives a Hello packet, it will add the neighbors Router ID to its list of neighbors.The router will also transition to the Init state.

  • Detail in OSPF Adjacency StatesMoving Toward the Two-Way StateWhen a router sends or receives its first Hello packet, it enters the init state. Waiting for a Hello packet that contains its own Router ID in the list of neighbors

  • Detail in OSPF Adjacency StatesRTA Hello Packet

  • Detail in OSPF Adjacency StatesEntering the Two-WayStateOnce a router receives a Hello packet and sees its own Router ID in the Neighbor ID field, the router transitions to the two-way state.

    The two-way state indicates bidirectional communication is established.

  • Detail in OSPF Adjacency StatesCompleting the Handshake

  • Detail in OSPF Adjacency StatesFinishing the Two-Way StateOnce a router receives a Hello packet and sees its own Router ID in the Neighbor ID field, the router transitions to the two-way state.

    The two-way state indicates bidirectional communication is established.

  • Detail in OSPF Adjacency StatesReached The Two-way state Need to decide which routers with which to establish a full adjacency. Depends upon the type of network on which the interface resides: Two-way state to Ex-Start state If the interface is on a point-to-point link, the routers Next Steps becomes adjacent with its sole link partner and enters the Ex-Start state. Remaining in the two-way state If the interface is on a multi-access link (Ethernet, Frame Relay, etc.), RTB must enter an election process to see the routers with which it will establish a full adjacency. Remains in the two-way state..

  • Detail in OSPF Adjacency StatesEx-Start StateOnce the DR and BDR are elected, the actual process of exchanging link state information can start between the routers and their DR and BDR. In this state, the routers and their DR and BDR establish a master-slave relationship and choose the initial sequence number for adjacency formation. The router with the higher router ID becomes the master and starts the exchange, and as such, is the only router that can increment the sequence number.Highest router ID will become the master during this process of master-slave relation.It is possible that a DR plays the role of slave. And also note that master/slave election is on a per-neighbor basis.

  • Detail in OSPF Adjacency StatesEx-Start State

  • Detail in OSPF Adjacency StatesExchange StateIn the exchange state, OSPF routers exchange database descriptor (DBD) packets.Database descriptors contain link-state advertisement (LSA) headers onlyEach DBD packet has a sequence number which can be incremented only by master which is explicitly acknowledged by slave.Routers also send link-state request packets and link-state update packets (which contain the entire LSA) in this state.The contents of the DBD received are compared to the information contained in the routers link-state database.

  • Detail in OSPF Adjacency StatesLoadingIn this state, the actual exchange of link state information occurs.Based on the information provided by the DBDs, routers send link-state request packets. The neighbor then provides the requested link-state information in link-state update packets.During the adjacency, if a router receives an outdated or missing LSA, it requests that LSA by sending a link-state request packet.All link-state update packets are acknowledged.

    FullIn this state, routers are fully adjacent with each other. All the router and network LSAs are exchanged and the routers' databases are fully synchronized. The only exception to this is the 2-way state, Routers achieve the full state with their DR and BDR only. Neighbors always see each other as 2-way.

  • Detail in OSPF LAB

  • Detail in OSPF LABFind the below link for command reference with example.http://www.cisco.com/en/US/docs/ios/iproute_ospf/command/reference/iro_osp3.html#wp1012052 Show ip protocols displays all protocols running on the router.Show ip ospf database to show contents of database.show ip ospf neighbour neighbour relationshipsshow ip ospf interface fa0/0 use the specific interfaceshow ip ospf interface brief to show a brief of all interfacesshow ip route ospf filters only ospf routesshow ip ospf virtual-link check virtual linksshow ip ospf displays basic info. about OSPF routing processes.show ip ospf border-routers displays border and boundary router information.Clear ip ospf processes clear ip route tableClear ip route *- clears entire routing tableClear ip ospf counters resets ospf counters.Debug ip ospf events displays all ospf events

  • Detail in OSPF LABBasic Show commandsChecking neighbor shipRoute advertisementRoute injectionLSA based Tshoot

  • Detail in OSPF LSA Commands

    show ip ospf databaseShow ip ospf database router type 1Show ip ospf database network type 2Show ip ospf database summary type 3Show ip ospf database asbr-summary type 4Show ip ospf database externalshow ip ospf database router self-originate