You are on page 1of 9

Content-Type: text/x-zim-wiki

Wiki-Format: zim 0.4
Creation-Date: 2015-07-22T16:23:02+03:00
====== 1. OpenShortestPathFirst ======
Created Wednesday 22 July 2015
OSPF is a link-state routing protocol designed for use within an autonomous syst
em (AS). As a link-state interior gateway protocol (IGP), OSPF allows for faster
reconvergence, supports larger internetworks, and is less susceptible to bad ro
uting information than distance-vector protocol.
________________________________________________________________________________
_______________________________________
**Summary:**
- OSPF is IP protocol 89
- OSPF uses all routers multicast address 224.0.0.5 and 224.0.0.6 is use
d by Designated routers
- Hello and Dead Timers must match to form adjacency
- OSPF timers : hello timer 10s and dead timer 40 (dead timer = 4* hello
timer)
- Interface MTU is not checked during formation of neighbor adjacencies
, MTU missmatch will prevent the successful exchange of DD packets and prevent n
eighbor from reaching FULL state
- DD packets are acknowledge by sending back an identical DD packet
- for the Databased Exchange process (ExStart) the router with the highe
r RID is designated the Master and responsible for seting the sequence number of
the DD packets
- DD exchange contains LSA headers and seq number for each LSA
- if a router does not have a LSA described in DD or has the LSA but wit
h a lower sequence number , it will request a full copy of the LSA with LSA Requ
est
- a router receiveing a LSA Req reply with a LSA Update
- each LSA Update is acknowledged by sending back a duplicate LSA Req or
LSA Update or a LSA Ack
- a OSPF router keeps track of which routers owe it an ACK , and will re
transmit the LSA to that neighbor wha have not sent an ACK
- once the LSA updates finish and the LSDB are syncronizae the OSPF tran
sit from "Loading" into "Full"
- the DR/BDR election is hapening at the initial Hello packets exchange
, and the election is based on the higher priority value received in the Hello p
acket and the local one or higher RID
- each LSA is re-flooded every 30 min by default (LSR Reflesh timer)
- the LSA reflood timer is per LSA , so not all LSA in the LSDBB will ne
cessary be re-flooded all the same time
- each LSA has a MaxAge timer that it must be refreshed within 60 minute
s by default
- we disable the LSA aging process by setting the LSA with a bit that sa
ys "Do Not Age"
- LSA Type 2 are only created for network where a DR has been elected:
- DR/BRD is only elected in NBMA and Broadcast network type
- configuring broadcast lins as point-to-point , OSPF prevents D
R election , the link will allow only 2 neighbors on that segment
- LSA Type 2 are only flooded within the area by the DR of the network
- Type 1 LSA are created by each router in the area describing itself ,
its interfaces and neigbhors
- LSA Type 1 and 2 contains most topology details and are confined to th
e area
- LSA Type 3 provide summary info about Type 1 and 2 LSA for other areas
- LSA Type 3 has simple information - the subnet , the mask , and the co

Area Border Router : Connects two or more areas . typicall y located in the backbone ________________________________________________________________________________ _______________________________________ **OSPF States :** .when something changes with a LSA Type 3 only partial SPF run is neede d .OSPF link local signalling LLS .it uses 3 Timers : Initial .When a router receives a hello packet from a neighbor .OSPF Graceful Restart.This state specifies that the router has started to send hello packets .The initial state indicates that OSPF is waiting for a start e vent . from which hellos have not been receiv ed whithin the dead interval .LSA exponential backoff: .AS Boundary Router : Connects to additional routing domains .a change in the format of the OSPF hello from fix length to use TLV .No hellos has been received from this neighbor .st as known by the ABR .send a "Grace LSA" prior to restart informing ne ighbor .Once hello messages were exchanged the __DR and BDR is elected on the Multiaccess link.Internal Router : All interfaces resides within the same area .Backbone Router : a router with an interface in area 0 (the backbone) .In this state the routers sends onver sends unicast hello pack etes every poll interval to the neigbhor.It remains in this state as long as it doesn't find its RID in the received hello packets . 2 different metods: .Durring full Adjacency neigbhor state .Opaque LSAs .a flapping link can cause excessive LSA updates and cause rout ers to be consumedwith processing LSA .This state is valid only for manualy configured neigbhors in a n NBMA environment . if a router doesnt rec eive hello packet from a neigbor within the the RouteDeadInterva (=4xHelloInterv al) or if the manualy configured neighbor is removed the state changes from Full to Down .__ .**Down:** .**Attempt:** .OSPF virtual link cannot exist in a stub area .and the hello packet is valid the router will update is Hello packets and include that neigbor RID in the new Hello packets as acknowledgement . Incremental and Maximum timer .LLS used by default .**Init:** .if a hello packet is received from a neigbor on that link .when the link is stable for 2xMaximum timer the LSA update tim er resets to start from scratch ________________________________________________________________________________ _______________________________________ **OSPF Router Types:** .Receiving a Database Descriptor packet from a neighbor in the . but hello pac kets can still be send on the line to the Multicast .It indicates that there has not been established a bidirection al communication between neighbours .

init state will aslo cause a transition to 2-way .Consist of the following fields: . all rou ters must agree on the subnet mask of the link .This state designates that bi-directional communication has be en established between two routers . .Hello interval .**Full:** .the router received a packet with the router's ID listed in th e neighbor section .Network mask .The actual exchange of link state informaiton occurs . the router with the highest ID will be Master .the two routers must agreee on how of ten to send hello packets which this field determins .5 . with the rest will remain in 2-Way .it uses Database Description OSPF packets and random sequence number .Indicates that the routers exchange LSA headers describing the ir own database . .used on broadcast media links .**Exchange:** .0.**2-Way:** .Indicates that the routers finished transmitting its databaase to its peer but is still receiving database information.DD packets has a sequence number incremented by the master and ACK by the slave .Used to establish and maintain OSPF relationship . routers send link-state request packets .Are multicasted over All OSPF routers Address : 224.LSAs are exchanged and database are fully syncronized .the keepalive .0. it can transmit a Link State Request for complete information .In Ethernet network a router will become full only with the D R and BDR .DD contain LSA headers and describe the contents of the entire LS Database .Options: 8-bit field represents such things as ability .**ExStart:** . .Hello :** . and the slave will conf irm this by sinding a DD with the Master sequence number .Routers are fully adjacent with each other.Neighbors provide th requested link state information in links -state update packets .Dead interval .If a router doesn't know about a received LSA header . states how long to wai t before removing the adjacency from a neighbor .Each routers has seen the others hello packet .It uses Database Description OSPF packets to exchange LSA head ers .At this state the router decide to become adjacent with this n eigbor . both end must agree on this ti mer .Normal state of the OSPF router ________________________________________________________________________________ _______________________________________ **OSPF Packets Type :** **.All link state updates packets are ACK .This state indicates that the routers negotiate between themse lves to determine which router is in charge of the __database syncronization pro cess__ .based on the inforamiton providede by the DBD s.OSPF routers send hello packets on all their links on a regula r cycle 1 second with a RouterDeadInterval set to 3 seconds .**Loading:** .

Database syncronization follows the following steps : 1. .Information block in SPF and carry multiple LSAs .The header contains enough informaiton to uniq uely identify the LSA and the particulare instance of the LSA. .Are used only durring the adjacency formation process between two OSPF routers .DD packets are acknowledge with a identical packet sen t in return. .0.Note: if for router A the Hello interval and Dead interval set .Database Description:** .Slave relationsh ip is forgotten.after an adjacency is formed/lost or a redistributio .Link State Type : the LSA type number ( Router / Netwo rk LSA ) .Used to request precise version of database .6) .it contains the following list of details : . the router with the lowest ID sends a DD with the neighbor sequence n umber ackowledging the neighbor __(with higher ID )__ as the Master router 3.Link State Update** .Sequence number : .0. . no interference with routers B intervals **.This field ensures that the full seq of DD is received in the database sync process .the process will sent at packets at interface MTU leng th .Header lists all of the headers of the LSA in the originator's link state database. it does this by transmitting the LSA ID and the Advertising router . .The slave it will always reply with the last s equence number received from the Master .to be a stub area . Once the database transfer has finished the Master . options must match between neighbors. .Link-State ID : is type dependent on the LSA header .transfering LSA headers between two systems .The sequence is the Master's sequence number i ncremented in subsequent packets. it uses in the DD description field the __M bit (More)__ specify that mo re DD description will come. .determining who is in charge of the database syncroniz ation . .LSA header: .in response to a link-state request packet during th e adjacency database syncronization __ __. each router exchange DD with a random sequence number 2.OSPF header .OSPF sends link-state update packets in two different ways __. then its neighbor router B will used this values advertised to maintain his a djiacence to router A .OSPF header .OSPF uses DD to transfer the LSA headers between systems .Link-State Request:** . **.if the Database needs more DD packets to send the LSA header.Transmitted using multicast All OSPF routers address or the A ll DR address (224.__Serves two purposes :__ .Advertising router : contains the router ID of the rou ter that originated the LSA **. it uses the following fields: .Used by an OSPF router when that router detects its database h as missing LSA information .

.Each LSA has initially its own Sequence number . and neighboring ro uters and the cost associated with thos networks or neighbor .it stores the LSAs as a series of records . and we will send an LSA Update with the local n ewer LSA to OSPF neighbor **The Link State Database :** . .OSPF header . its attached networks . setting the "Do Not Age" bit in LSA .Link State Ack** .Number of advertisment : the number of LSA included in this packet .a single ACK can include responses to multipe update packets a nd consist of the OSPF header and the LSA header .If the LSA is already in the LSDB and the seq number i s the same the LSA is ignore . its neighbors will withdraw the route from their LSDB and propag ate the change to sync all LSDB on the area .the Max Age : .It acknowledge Link State Updates .data structures which contains routing informations .each router in an OSPF area must have an identical LSDB to ensure accu rate routing knowledge .if sequence number is higher it means this inf ormation is newer and we have to add it to LSDB . each update can c arry multiple LSA up to __Maximum Packet size (Links MTU)__ **.n is withdrawned . the originator rout er will increase the LSA seq number and reflood the LSA . by default 30 minutes .it is used in case of withdraw routes . if this timer expire t he LSA will be removed from LSDB .is the basis for the reliable fooding in OSPF ________________________________________________________________________________ _______________________________________ **Link State Advertisements** .to reduce excessive traffic from LSA re-flooding .when the Link State Update contiains the LSA and the age is se t the Max Age . we can disable LSA aging proess .if the LSA is already in the LSDB and the seq number i s different then we have to take action: .when an LSA LS age field reaches Max Age .if the sequence number is lower then the adver tising router has an older LSA .LSA ages out .OSPF uses LSA to reliably flood information about their network links and the state of those links to their neighboring OSPF routers . every change on the LSA is marked with an increment of the Sequence Number.it is the maximum age that a LSA can be retained in LSDP . based on the sequence number we will hav e the following case : .OSPF uses the Link state database to run the SPF algorithm and determi ne the shortes routes from his side .are sent in unicast fashion back to the originator .details include routers ID.Link State Update has the following fields: .if a LSA is receive .each OSPF router it creates and maintains a link state database LSDB . the Max Age of a LSA is 60 min .LSA Refresh_timer is the timer used by the originator of the LSA to re -flood the specific LSA .Link-State Advertisment : Full LSA . routes where the Max A ge is reached are not used in the routing table calculation . if information about that link state changes__ .

each OSPF router elected to be the DR on a broadcast link gene rates a Type 2 LSA . it will remove the link to the neigbor and the neigbor floods it to the rest of the routers in the area .Network ( Type 2):** .this LSA list each router connected to the broadcast segment .Transit : connection to a broadcast segment .this LSA is flooded to each router in that OSPF area .when the subnet does not connect to any OSPF n eigbhors . and the to a network will be picked up and placed in routing table.each OSPF speaking router generates a Type 1 LSA to describe t he status and cost of all interfaces on the router .its neighbors will generate a new LSA type 1 .If a router fails : .LSA Type 1 are not flooded across an area boundary . . including the DR itself .the following link types are supported .Point-to-point . **Note:** The withdraw mechanism for LSA Type 1 covers two scena rios with different mechanism: .once the LSA has aged out it is removed from t he LSDB .Network mask: it denotes the IP subnet mask for the in terface connected to the broadcast . The link State Databased has a substructure dictated by the type of LS - Router LSA Network LSA Summary LSA ASBR LSA External LSA ________________________________________________________________________________ _______________________________________ **LSA Packet Types:** **.the IP subnet for any ptp interface is adverti sed as a stub .Virtual : used when we have a virtual link operating b etween an ABR connected to Area 0 and an ABR not connected to Area 0. with a higher Seq No .Stub : . . the ID f ield is the IP address of the segments DR .LSA Type 2 are flooded in that particular area not across an a rea boundary .at one point one router observese that the new topology can't route traffic to the failed router (the SPF alghoritm fails) the n the LSA will be marked with no route to Adv Router .the adjiacent routers of the link will generat e a new LSA Type 1 with an higher Seq No and reflooded into the network and with out the missing link in the LSA. multiple LSA will be creat ed an forwarded over the network causing different unpredictable behavior.Router (Type 1 ):** .it contains the following extra fields: . it occures for loopback and passive interfaces .If a link will fail: . **.ulate the best path As : the information recorded in the database is used as input data to calc shortest path first for all destination prefixes Dijkstra algorithm is used to buid a tree of shortest paths .if link will flap .

Summary (Type 3):** ..ASBR Summary (Type 4)** .LSA Type 4 has an area scope .by default this LSA are marked with Type E2 designation . an ABR will create a separate Summa ry LSA which will be flooded in area B.the LSA is reflooded to each nonstub router in the entire OSPF domain . .as these LSA are re-injected into different areas .the Old LSA will be Age Out .Each ASBR generates a Type 5 LSA to advertise any networks ext ernalt to the OSPF domain.the DR will generate a new LSA Type 1 and LSA Type 2 .External (Type 5) :** .each ABR that must transmit information about an ASBR from one OSPF area into another generates a Type 4 LSA .Network mask : has no meaning to a Type 4 LSA .this LSA is flooded to each router in the OSPF area.at any point a router receiving the new LSA Type 2 it will install it along the old LSA Type 2 . .the DR will Age Out its LSA Type 2 . .Metric : this field provides the cost of the router to ASBR` **Note:** A LSA type 4 is withdrawned from LSDB by the ABR using a LSA Update with a higher Seq No and the Age set to maximum 3600s (Age out) **.Once the link recoveres .it contains the following extra fields: . but the cost and advertising router details do change . it is set to 0. **Note:** The withdraw mechanism for LSA Type 1 covers three sce narios with different mechanism: . the LSA ty pe never change . **.For each LSA form area A .If a DR router will Fail: . he old DR it will increment the Seq No of the LSA Type 2 .the . whitout the failed router .Metric : this field provides the cost of the router to the nearest ABR **Note:** A LSA type 5 is withdrawned from LSDB using a LSA Upda te with a higher Seq No and the Age set to maximum 3600s (Age out) **.0 .the SPF now with the new LSAs will not find a path to the failed DR so the route will be marked with No Routing Bit.If a DR link will fail and recovers: .and set the Age to MAX to age it out over the net work. and floods it into the area .as extra header: .Attached router : this field is repeated for each rout er connected to the broadcast segment.it describe IP prefixes redistributed from other routing prot ocols .each ABR that transmits information from one OSPF area to anot her .0. .Network Mask : this field represents the subnet mask a ssociated with the network advertised. and retain it in the LSDB . it generates Type 3 LSA .Advertising Router : is the ABR address .the BDR will generate a new LSA Type 1 and LSA Type 2 and flood it over the network . .If a non DR router Fails : . .as ASBR summary LSAs are re-injected into different areas the LSA type never changes but the cost and advertising router details do change . so it is not reflooded by anote r ABR acros area boundary .0.Each redistributed prefix will generate its own LSA .

E2 routes have a default cost of 20 while E1 route starts with a cost of 20 and cumulates along the path .LSA 3 .only when E2 routes have the same external metric will OSPF check the internal cost to the advertising ASBR . ABR will prefer its dirrect connection to area 0 ________________________________________________________________________________ _______________________________________ **OSPF Area Types :** .cost specified by the redistributingrouter in thee Metric will be used as metric all over the OSPF domain .Standard Area: .ABR will ignore LSA Type 3-5 from other ABR over links in the same non backbone area .default OSPF area type .Not So Stubby Area (NSSA) .when all else is equal between a LSA Type 5 and LSA Type 7 (metric .ex ternal metric .used for Traffic Engineering ________________________________________________________________________________ _______________________________________ **OSPF Selection Rules:** .Metric : is the cost of the route set by the ASBR .these LSAs are translated to type 5 LSA by the ABR attached to NSSA area in which the type 7 LSAs originated **.Down Bit :__ .Stub Area: . do esn't change . .if LSA Type 5 are marked with Type 1 .Opaque LSA (Type 10)** .External Tag **Note:** A LSA type 5 is withdrawned from LSDB by the ABR using a LSA Update with a higher Seq No and the Age set to maximum 3600s (Age out) **. internal cost) the OSPF route will prefer the LSA Type 5 . but the routers will ad d to the encoded value of the external route cost the cost to reach the ASBR .these LSA are sent by ASBR in NSSA areas .Inter area routes .E1 external routes .a stub area containing an ASBR type 5 LSA are converted to typ e 7 within the area ________________________________________________________________________________ _______________________________________ **OSPF Down Bit and Domain Tag:** __.Intra area routes .as extra header : .Similar to Type 5 in that they describe IP prefixes redistribu ted from other routing protocols .Metric type : 2 (default ) or 1 .4 and 5 are replaced with a default route .OSPF has the following order of route preference before route cost is even considered: . .E2 external routes .Forward Address : the address to the other area ASBR / in case NSSA it is the address of the nearest ABR .Totally Stubby Area: .External link LSA 5 are replaced witha defaul route .NSSA External (Type 7) :** .a bit set in Option field of OSPF LSA type 3 .

it can be set manually on the PE routers .if the OSPF route has been advertised from a PE router into OS PF the down bit will be set .serves the same purpose as the down bit but for OSPF external routes .Domain Tag (VPN Tag)__ .if not set it will take the BGP AS Number value by default . the PE does not even include the rout e in the SPF .if another PE in the same area receive the LSA with Down Bit s et it will not redistribute it into iBGP .it is used to avoid rooting loops in multihomed scenario or ba ck door __.the tag will be present redistributed LSA 5 .. external LSA .