OSPF summary

OSPF Concepts
OSPF : the Open Shortest the Path First, Open Shortest Path First protocol is a link state routing protocol is described in RFC 2328. Open means open, public, any standardized equipment manufacturers are able to support OSPF.

The difference between the RIP
※ RIP: running distance vector routing protocol, periodic flooding own routing table, routing through the interaction of each router from a neighbor (directly connected) router to learn routes and loaded into their own the routing table, and for all routers in the network, they do not know the topology of the network, they simply go to a certain purpose should know where to go, how far.
※ OSPF: running link-state routing protocol, the router is the interaction between LSA (link state advertisement), rather than routing information, the router will flood the network LSA collected their LSDB (link state database), the this helps the whole understanding OSPF topology, and on the basis of the calculated itself as the root and reaches every corner of the network, acyclic trees by the SPF shortest path algorithm, eventually, the router routes the calculated loaded into routing table.

OSPF Features
l OSPF link state protocol (Open Shortest Path First), support VLSM (variable length subnet mask), CIDR (classless routing protocol), strong authentication
l using the SPF algorithm (the Dijkstra algorithm) to calculate the optimum path, rapid response network changes
 network change is triggered update
 regularly updated at a lower frequency (every 30 minutes), is referred to as link-state refresh
 compared with the distance vector, link state protocol networks have more information

Three tables OSPF
Neighbor Table (Neighbor table): lists all the neighbors and OSPF router directly connected, through a series of interactive news, the eventual establishment of state relations.
2. topology table (Topology table): comprising link state database (the LSDB), generated listing all their neighbors and that obtained LSA (Flooding / flooding), OSPF routers in the same area, there are exactly the same OSPF Database. OSPF area, corresponding to a OSPF Database.
3. Routing Table (Routing table): In OSPF database by SPF algorithm to calculate the optimal route obtained, also called Forwarding Database.

 

Table construction process:
broadcasting Hello packets to establish neighbor relations → broadcast interactive LSA → LSAs collected and placed LSDB → SPF calculated the optimal path → into the routing table.

OSPF Area
l OSPF hierarchical design, separated by Area router (a router usually is not more than 50 area)
l router storage area in the area of all details of the links and routers
l routers stores only the other regional and chain summary information road
single problem area :

Internal  regional instability will cause the whole network is calculated by the SPF's;

 LSDB huge, excessive consumption of resources, equipment performance degradation, affecting data forwarding;

 Each router needs to maintain routing tables growing, a single routing area can not be aggregated.
Many advantages of the region :

 multi-zone design reduces the scope of LSA flooding, effectively control the topology change in the region, to achieve the purpose of network optimization

 In the border area route summarization can be done, the routing table

 that take advantage of the special area of ​​OSPF, LSA flooding is further reduced, thereby optimizing routing

 Multi-Zone improved network scalability, conducive to the formation of large-scale network

Objective divided:
l improve the routing efficiency: the reduced portion OSPF routers route entry; for certain LSA, may be on the boundary region (ABR / ASBR), summarizing / control / filter (summarized by OSPF routing / default routing achieve full network interworking between OSPF area);
l improve network stability: when an OSPF routing jitter in an area can be effectively controlled by the magnitude of impact (for large routing protocol, is stable a very important factor).

Backbone area:
when deploying OSPF, OSPF requires the whole domain, you must have one and only one Area0, Area 0 is the backbone area, the backbone area is responsible for routing information published summary by area border routers between non-backbone areas (not detailed link state information), in order to avoid inter-area routing loops between non-backbone areas do not allow direct mutual release between regional routes. Thus, all area border routers have at least one interface Area 0, i.e., each region must be connected to the backbone area.
 backbone area: Transit area (backbone or Area 0 ): main functions: for fast, efficient data transfer packet. Not normally connected users.
 non-backbone areas: Regular areas (nonbackbone areas): mainly connected users. And all data must pass through Area 0 transit (including: Stub / Totally Stubby / NSSA)

Role OSPF router

 area within the router (Internal Router / Internal Area Router, IAR)

 ABR (Area Border Router, ABR)

 backbone routers (Backbone Router / Backbone Border Router, BBR)

 AS border router (AS Boundary Router, ASBR)

 

OSPF and IS-IS area scalability comparison:
the algorithm is based on two protocols l SPF algorithm
l OSPF: In Area0 as Backbone (better)
l IS-IS: link to as Level2 BackBone, to chain Road to the boundary area (good)
benefits of using hierarchical design:
 reduce the routing table entries
 LSA stop the flood at the network edge, accelerating convergence
 reduce network instability, a problem area without affecting other areas

ID-Router
l-Router OSPF area ID for uniquely represents an OSPF router, OSPF domain banned full two routers have the same Router-ID.
 Router-ID setting may be configured manually, or automatically selected by agreement. The actual network deployment taking into account the Stability Pact, the proposed manual configuration.
 running OSPF router automatically selected by the system after Router-ID, a larger IP Router-ID if the corresponding interface is down, or while, still maintaining the original OSPF Router-ID (i.e., non-Router-ID value preemption, a first stable), even if the reset ospf process restart the OSPF process, Router-ID is not changed; unless manually re-configure the Router-ID (manual knocking router-id xxx under OSPF process), and restart the OSPF process before. Further, if the IP address of the interface corresponding to the RouterID disappear, e.g. undo ip address, after the reset ospf process, RouterID change also occurs.

COST
l OSPF use cost "cost" as a routing metric. Each active OSPF interface has a cost value. OSPF interface cost = 100M / interface bandwidth, wherein the OSPF 100M reference bandwidth (reference-bandwidth).
L OSPF route cost of the route from the local to reach all the way to the sum of all the interfaces from the origin of the cost value of the route.
 Since the default reference bandwidth 100M, which means higher bandwidth transmission medium (greater than 100M) will calculate a score of less than 1 in the OSPF protocol, which is not allowed in the OSPF protocol (as will be rounded 1).

OSPF interface types of network
1. Network point (Point To Point, P2P): one network only two interfaces using HDLC or PPP encapsulation, without addressing, the address field is fixed to FF.
2. Broadcast Multi-access network (Broadcast): a broadcast multiple access, for now refers to the Ethernet link, involving IP and Mac, realize two and three maps with ARP.
3. The non-broadcast multiple access network type (NonBroadcast MultiAccess, NBMA): allowing the network there are a plurality Router, the shared physical link, to establish a logical connection through the virtual link Layer (VC).
4. Network multipoint (Point To MultiPoint, PTMP / P2MP ): by means of a specific communication connection of many types, there is provided a plurality of channels from a single location to multiple locations.
Different  OSPF network type, OSPF operation on the interface will differ.
 OSPF network type interface can be modified by the command.
 MA including Broadcast and NBMA.
 NBMA network types need to specify a static neighbor rest of the network type automatic neighbor discovery.  Broadcast, on NBMA interfaces, the need for elections DR / BDR election.  on P2P, P2MP type of interface, without DR / BDR election.
 on P2P and Broadcast networks, Hello packets to the multicast address (224.0.0.5) to send, Hello packets sent to a unicast address on NBMA VL (Virtual-Link).

Default network type corresponding to the common link layer protocol:

 

DR and BDR
meaning: Access Network (Multi Access, MA) in a multi-channel, if all router interfaces twenty-two OSPF relations are established, then there are n (n-1) / 2 neighbor relationship, not just consume additional equipment resources , it is to increase the number of LSA flooding the network. Therefore, to reduce multi-access network in OSPF traffic, OSPF will (network access multiplexer) in each election MA network a designated router (DR) and a backup designated router (BDR).
1. Designated Router (Designated Router, DR): DR responsible Sense Multiple Access network topology change information and change information to the other routers, on behalf of the MA is also responsible for sending LSA type 2 network. MA network, all the OSPF routers to establish full OSPF adjacencies with neighboring DR.

2. backup designated router (backup Designated Router, BDR): BDR monitors the DR of the state and take over its role in the current DR fails.

3. DRothers: other routers in addition to the DR and BDR.

DR election rules :

  DR and BDR are all from the same network segment of the router according to the router priority, Router ID through Hello packets elected, priorities higher than 0, the router that has the qualifications to select priority 0 does not participate in the elections.

  When DR / BDR election Each router writes the elected DR Hello packets, sent to each router running OSPF protocol on the segment. When multiple routers on the network at the same time declare themselves DR, the interface with the highest priority is the winner; if the same priority (default is 1), Router-ID up to the winner.

  DR has a non-preemption, that is to say if the MA network, the elections have been completed, and elect a DR, then the follow-up even if there is a new, higher-priority device is added, it will not affect DR election, unless DR hang.

Process :

   When the election is initialized, all routers will own router ID is written at the beginning of Hello packets DR_ID and BDR_ID field, claiming to be DR and BDR. Highest priority becomes BDR router, but this time has not DR, immediately followed by the BDR to update DR, and Hello bag DR_ID field has changed the selected DR's ID. The rest of the router continues to choose BDR, still writes BDR_ID field its own ID, a high priority of the last times become router BDR.
System :

   1. Election system: DR is elected each router, rather than manually specify, although administrators can intervene in the election process by configuring priority.

  2. tenure: DR if elected, unless the router failure, it would not be replaced, even if subsequent router higher priority.

   3. patrimonial: DR elected at the same time also elect to BDR, DR after the failure to replace the BDR becomes the new DR DR.

Characteristics :

   All DRother routers establish adjacencies only with the DR and adjoining full BDR, does not establish a full adjacency between adjacent DRother.

   DR is based on the interface, not the router. A router, it may be DR on an interface, the interface is on the other BDR, DROther, or because of a P2P link does not participate in DR election.

   DR must exist on the broadcast network to be able to work normally, but the BDR is not required.

   a MA segment even if only a router, have to elect a DR.

   DR not be the router with the highest priority router interface; Similarly, BDR is not necessarily the router with the second highest priority of the router interface (there may be a new, higher add to the mix).

   In broadcast multi-access, on a non-broadcast multiple access type interface, will conduct elections DR / BDR election.

   on P2P, P2MP type of interface, without DR / BDR election.

   DR / BDR belong to a multicast group address of 224.0.0.6, listens and receives the multicast data packet to the destination address of 224.0.0.6, and updates to the DR sends the multicast address 224.0.0.5 to inform the other routers (including origin and BDR DROther).

   All OSPF routers (including DR / BDR) to listen to this multicast address 224.0.0.5 to send update notifications DR and BDR to 224.0.0.6.

   BDR sends updates to the DR address is 224.0.0.5, DR reply LSAck address is 224.0.0.5.

With the presence of DR / BDR after, LSA flooding :

  

 

 

OSPF header

  Version 1. : version field, 1 byte indicating the version number of OSPF protocol used, the highest version of OSPF V4, i.e., the value 4 (that corresponds to binary 0100).

  The Message the Type 2. : packet type field, 5 corresponding to the packet type identifier.

  The Length Packet 3. : the packet length field, 2 bytes. It refers to the entire packet (including the packet content portion and a rear header portion OSPF) byte length.

  Router ID 4. : Router ID field, 4 bytes, specifies the source router ID transmitted packets.

  Area ID 5. The : ID field area, 4 bytes, OSPF area designated router sends packets corresponding.

  Checksum 6. The : a checksum field, 2 bytes, is whole message (including header and OSPF each message details, below excluding Authentication field) checksum, end router for correction test packet completeness and correctness.

  The Auth the Type 7. The : Authentication type field, 2 bytes, specify the type of authentication used, no authentication is 0, 1 is a simple authentication, using the MD5 authentication 2.

  The Authentication 8. The : authentication field 8 bytes long, depending on the values specific types of authentication: the authentication type is not certified, this field has no data, the authentication type is a simple authentication, this field is a password authentication, the authentication type when MD5 authentication, this field is MD5 message digest.

  

 

 

OSPF Packets (OSPF five packets)

  Because it is based on IP development, so the protocol number is 89, but also means that it is not reliable. Depending on the field values ​​of OSPF packet type, OSPF packets divided into 5 types, different type, the content of which is different from the latter. Forming the routing table these five closely interact with the packet.

  type = 1: Hello packet

  type = 2: database description packets --DBD (only in Exstart / Exchange Phase)

  type = 3: link state request packet --- the LSR (Loading stage occurs only)

  type = 4: link state update packet the LSU ---

  type = 5: the LSAck of link state acknowledgment packets ---

  1. Hello (establish and maintain neighbor / Neighbor Relationship): the multicast address (224.0.0.5), DB and BDR use 224.0.0.6, Hello packet transmission interval default is 10 seconds.

  2. the DBD (Database Description / Database Description): comprising routing digest information (described in the LSDB LSA header information), using the unicast mode, the sequence number incremented by an implicit acknowledgment.

  3. the LSR (link state request / LinkStatus Request): link state information request to complete a particular route to neighboring routers, unicast addresses.

  The LSU 4. (update / LinkStatus Update): complete information in response to LSR of the route. In OSPF, LSU needs only a confirmation. LSU contains one or more the LSA.

  The LSAck of 5. The (acknowledgment): LSU to make confirmation of LSA.

  

 

 

   LSA (Link-State Advertisement) is a PDU (protocol data unit), the package passed the LSU, generally have a serial number.

   DBD (a la carte menu), a list of only simple database above, the receiver and use it to compare local DBD, if different LSR will send a request, the request is something LSA (specific food); and in response to LSA it is hosted by LSU, which complete information on LSA in the LSU (filled with food dish); LSAck (diners acknowledge the receipt of food) is to acknowledge receipt of LSU in the LSA.

   LSAck confirmed two ways:

  ① implicit acknowledgment: DBD packets sent each other, not only do respond do confirm (Master by increasing serial number, Slave by copying and follows the serial number);

  ② explicit acknowledgment: packets transmitted LSAck acknowledgment of the LSU (LSU copy the LSA header with similar DBD) alone.

  1.hello package ----- cycle 10s Function: find and maintain neighbor relations, and the DR / BDR Election (2way)

  2. The database description link state packet ------- DBD

  Ospf network topology is described

  During packet data exchange link-state database is generated, three main functions:

   ① exchange link state database electoral process in the master-slave relationship

   Determining an initial sequence number ② exchange link-state database of the process

   ③ exchange all LSA packet header

  3. The link state request packet ------ LSR routers discovered in the present DBD exchange process details are not LSA packet for requesting or obsolete

  4. link state update packet --- the LSU functions: transmission path and for storing information for a plurality of LSA flooding, but also for the link state updates received response

  The link state acknowledgment packets ----- LSU for the LSAck of the received acknowledgment. If DR / BDR sends an acknowledgment, LSAck packet to multicast address 224.0.0.5 OSPF If acknowledgment is sent DROther, LSAck packet to multicast address 224.0.0.6 OSPF

OSPF seven states and the process of establishing adjacencies

  1. Down: each router is not exchanging information with any neighbor, starts sending Hello packet from the OSPF interface to multicast address 224.0.0.5.

  2. Init: After each router receives the first Hello packet, add the router to its neighbor Neighbor list.

  3. Two-Way (belongs to neighbor relations): Hello packets received its own Router ID, the router add your own neighbor list, go to the 2-Way state. In this process, at the same time elect the DR and BDR. If the adjacency relationship is stuck in the state.

  4. Exstart (registration start): DROther with DR / BDR packet transmission DBD determines Master / Slave relationship, RID becomes large Master (not necessarily DR).

  5. Exchange: Master and Slave between each unicast transmission to one or more database description packets DBD (SEQ ID NO Master Slave follows the first), for the DBD synchronized. DBD have a serial number, serial number DBD is determined by the Master. After each received DBD, implicitly confirmed by sequence number has been received DBD. Exchange-state end last Slave DBD packet is sent.

  6. Loading: the received information is compared with information in the LSDB. If the updated link state entry has the DBD is transmitted to a counterpart LSR, a new LSA request, other reply corresponding LSU, LSR when all responses have been to the other LSU LSAck response confirmation display.

  7. The Full (belonging to the abutting relationship): After completion of the synchronization of adjacent routers into the Full state Loading, starts forward data. At this time, each link in the region should have the same data link state database. Subsequently, only the Hello packets, LSU packet, LSAck package.

   unfamiliar → → contiguous neighbors.

   Attempt state exists only in the NBMA network (Frame Relay), between Down and Init (HELLO sent to the other party can not receive the response has been stuck in this state). NBMA network neighbors are specified manually, Hello packets sent to a neighbor at intervals of HelloInterval.

  Object  DBD packet transmission state in ExStart 224.0.0.5 (all OSPF routers), or 224.0.0.6 (All the DR), depending on whether the role of DR / BDR exists between OSPF routers. If there is no DR / BDR, the former; if there is DR / BDR, it is the latter.

   If the adjacent router side is Exstart, the other side is the Exchange, it can be concluded that MTU does not match.

   network type Broadcast / P2MP, Hello packet is multicast, DBD unicast and LSR, LSU and LSAck also have multicast unicast.

   When running OSPF within two Ethernet router priority 0 are not elected DR / BDR, neighbor state will always be in 2 way state.

    

 

 

   

     

OSPF seven types of the LSA : . 1
  type router LSA (Router LSA)
  is generated by all routers in the area, and only broadcast flooding within the regions.
  The basic list of advertised router LSA all links and interfaces, and indicating their status and cost of each link in the outbound direction.
  Type 2 network LSA (Network LSA)
  is generated by a router within the DR region, including link information packet router connected to the DR and BDR.
  LSA network is only produced in the region of this internal network flooding the LSA.
  Type 3 Network Summary LSA (Network summary LSA)
  is generated by the ABR, notification information of a route to the router within the region outside the region.
  In the outer region but still in a default route in an OSPF autonomous system can also be used to advertise this LSA.
  If a router through the backbone area ABR receive more than one network summary LSA from the other routers ABR, then this originating ABR router will choose the lowest LSA LSA advertised price, and the lowest cost of this notice to the LSA non-backbone area connected to it.
  Type 4 ASBR Summary LSA (ASBR summary LSA)
  is generated by the ABR, but it is a host route, the route to the ASBR router address.
  External Autonomous System type 5 LSA (AS external LSA)
  is generated by ASBR, tell the router path leading to the outside of the autonomous region of the same autonomous region.
  AS external LSA is not unique and specific LSA advertisement associated with the area, flooding the entire autonomous system.
  Type 7 NSSA external LSA (NSSA External LSA)
  From an ASBR, and almost the same advertisement. 5 LSA, but only advertised NSSA external LSA flooding in the interior of the distal region impure originating outside the NSSA LSA advertised.
  In an NSSA, when there is a router ASBR, the LSA 5 packets have to produce, but can not have NSSA LSA 5 packets, thus generating ASBR LSA 7 packets, sent to the router in the region.
  6 types of group members LSA (LSA Group Membership) * currently does not support multicast OSPF (MOSPF protocol)
  allows flooding the LSA types each region:

  

  With one exception, the use of a Type 3 default route is advertised on each ABR router.

  

 

 

   Wherein a type of the router LSA (Router LSA) was divided into four types:

   

Expand :
  Why four categories LSA?

  To answer this question, there are several concepts need to involve OSPF, detailed as follows:

  1, and the role of Router-ID Reach;

  2,1-LSA propagation range, LINK-ID, were advertised;

  What 3,3-LSA notice, notice who is who;

  4,5-LSA's advertisement, the advertisement ABR different happen.

  First, think the first question, what is the role of Router-ID is whether the scope of his spread across the region?

  Answer: Each router OSPF Router-ID uniquely identifies network. Router-ID determined not say how this should all know about the propagation range of Router-ID, OSPF routers in different regions, Router-ID is not known, can also be understood as Router-ID will not be cross-regional transfer. This means that, Router-ID will only be understood in the region where.

  The second problem, class 1 LSA propagation range is limited to within the region, i.e. it does not cross the area, LINK-ID flag and the flags are advertised by the advertisement's Router-ID.

  The third question, 3 LSA advertised by the ABR, the content of the announcement is actually a content type 1 LSA, the LSA category 3 Notice who is currently ABR, ABR announce who is the current mark of Router-ID

  

 

   As can be seen from the picture type 1 LSA ABR turned into three categories after the LSA.

  The fourth problem, 5 LSA is advertised by ASBR, when external routes ASBR is introduced, propagated to the other routers over the entire current region 5 LSA, i.e. the region in FIG. 2, the entire area of ​​2 All routers has been informed that the area of ​​class 1 LSA ASBR the router-ID, so the other ASBR router does not need four types area LSA.

  Now the question is, when external routes receives a Type 5 LSA spread ABR2 of other regions after the router, and then continue to spread by ABR1 out to other regions Category 5 LSA, LSA class 5 but notice who is always received ASBR the router-ID, and the front and said router-ID will only be understood in the region, the then non-ASBR area 1 and area 0 router ASBR will know how the router-ID it?

  So the solution is to tell the specific information they ASBR's Router-ID in order to Area 0 and Area 1 All routers know how to reach the ASBR.

  

 

   Summary: 5 LSA initial advertised by the ASBR, is advertised by the ASBR Router-ID, 5 LSA still spread, LSA in the ASBR Router-ID remains unchanged continues to propagate, but this will only Router-ID area where is understanding, so other areas (zone 0 and 1) do not know who ASBR's Router-ID is that it can not reach the ASBR, the actual situation, the entire OSPF autonomous systems are interconnected, and how there will not be reached ASBR this is due to the action of 3 LSA, when spread by ABR 3 LSA, will become advertised by the current propagating ABR Router-ID, the same area can reach the ABR, then the ABR arrival ASBR. (E.g. R4 without introducing external routes, is a conventional ordinary routers in the area, R1 may reach R4, as R1 may reach ABR1, and ABR1 and can reach ABR2, finally ABR2 understanding R4, which is achieved by 3 LSA .)

 

Guess you like

Origin www.cnblogs.com/xinghen1216/p/11712602.html