HCIP-OSPF summary

OSPF: Open Shortest Path First, an open shortest path first protocol

 Overview of ospf:

OSPF (Open Shortest Path First Open Shortest Path First ) is a IGP (Interior Gateway Protocol, referred IGP), for a single autonomous system (autonomous system, AS) within the decision-making route . It is an implementation of the link state routing protocol , which belongs to the interior gateway protocol (IGP), so it operates within the autonomous system. The famous Dixga algorithm is used to calculate the shortest path tree . OSPF supports load balancing and routing based on service types, as well as multiple routing forms, such as specific host routing and subnet routing, etc.

The biggest disadvantage of OSPF: large amount of updates-->In order to survive on large networks--structured deployment--area division and address planning

Intra-regional agreement

Inter-area routing

OSPF: Open Shortest Path First Protocol

Classless (carrying mask) link state (based on topology) type IGP (internal AS) protocol     

Large amount of updates—"In order to survive in medium and large networks—structured deployment—regional division, address planning

Trigger update, update every 30min period ; multicast update—224.0.0.5—all ospf 224.0.0.6—DR/BDR

There are V1-V3, currently universal V2; V3 is used by IPV6;

 Protocol based on IP encapsulation, the cross-layer encapsulation layer 3 header, protocol No. 89 ; overhead support load balancing;

 

Range of use: IGP

     Protocol algorithm features : link state routing protocol, (SPF algorithm)

     The protocol is a classless network protocol , spreading the network mask

1. OSPF features:
1. OSPF is a typical link-state routing protocol
. 2. The transmission of information is called LSA, LSA link state advertisement, including routing information and topology information.
Routing LSA: describes the routing information of the interface on the router
Topological LSA: describes the link state between routers
3. Update method: trigger update + 30 minutes of link state refresh
4. Update address: multicast and unicast update, multicast address: 224.0.0.5 (ALL SPF router ) 224.0.0.6 (ALL DR router)
5. Support routing authentication
6. Support manual summary
7. Support area division
8. OSPF consumes more equipment resources, a router supports up to 31 OSPF processes

2. OSPF area:
based on interface (link)
division Meaning of area division: 1. Reduce the number of LSA 2. Reduce the spread of LSA
. Marking of the area: 32 binary 1. Decimal 2. Similar to IP address (AB Class)
area classification:
1. Backbone area: area tag bit 0 or 0.0.0.0
2. Non-backbone area: area tag is not equal to 0 or 0.0.0.0
area design principle: sunflower network structure
1. OSPF network must be unique the backbone area
2. If there is a non-backbone area, non-backbone areas must be directly connected to the backbone
role in OSPF routers:
backbone router: a router area of all interfaces belonging Area0 in
non-backbone routers: all interfaces of a router are It belongs to the
ABR in the non-backbone area : area border router, a router in the area between
Area0 and non-Area0, and a router capable of generating Type 3 LSAs. ASBR: autonomous system border router, a router at the boundary of the OSPF network and the non-OSPF network , Introducing the non-OSPF network into the OSPF network, can produce 5 or 7 types

Three, OSPF packet types

Header structure of OSPF packet

Cross-layer encapsulation into IP header, protocol number 89

There are 5 types of packets:

1.Hello package

Multicast periodic sending, used for the discovery, establishment, and periodic keep-alive of neighbors and adjacency relationships;

  There are the RIDs of local known neighbors in the hello packet to keep these neighbors alive; hello time 10s or 30s

Dead time is 4 times of hello time;

2.DBD package

Database description package  

3. LSR packet The
link state request is based on the unknown LSA header of the message in the DBD.
4. LSU package
link status update, carrying LSA information

Number of LSAs: The message contains the number of LSAs
5. LSACK packet
Link status confirmation

LSA header: The message contains the LSA header

Four, OSPF working process

After the startup configuration is completed, the neighbors multicast the hello packet to send and receive, establish a neighbor relationship; generate a neighbor table :

After the condition is matched, the neighbor that fails to match will remain in the neighbor relationship, and only the hello packet can be kept alive periodically;

Neighbors that match successfully will establish an adjacency relationship; DBD is used for directory interaction in the process, and LSR/LSU/LSack is used to obtain locally unknown LSA information; finally the LSDB synchronization between the adjacency relationships is completed; the database table is generated ; Then, locally based on LSDB, generate a directed graph -> tree structure -> shortest path selection SPF algorithm

Calculate the local shortest path to all unknown network segments based on the tree structure, and then load it into the routing table ;

After the convergence is completed, the hello packet is kept alive periodically; the DBD packets are periodically compared between neighbors every 30 minutes;

Structural mutation:

  1. New network segment-directly connect to the device of the new network segment, directly use the update package to inform all local neighbors
  2. Disconnect the network segment-directly connect to the device in the disconnected network segment, directly use the update package to inform all local neighbors
  3. Unable to communicate-After the dead time countdown, the neighbors are disconnected and the information is deleted;

 

noun:

LSA link state notification, different topologies or routes are generated in different environments, one piece of information is one LSA

LSDB Link State Database Collection of LSAs in the entire network

LSDB synchronization OSPF convergence behavior, the entire network LSDB needs to be consistent

LSA flooding OSPF convergence behavior requires the entire network to receive the same LSA

5. OSPF neighbor state mechanism:

1. Down: Did not receive the hello packet from the neighbor
2. Init: Initialization state, once start sending hello packet, enter the initialization state
3. Attempt: Try state
4. Two-way: Two-way communication state (neighbor state)
5. Extart: pre-start state, once the main memory DBD starts to be sent, it will enter the pre-start state
6. exchange: pre-exchange, the main memory election is completed, then send the DBD carrying the LSA header message, enter the pre-exchange state, will send LSR data packet
7. Loading: Loading state, once the LSU data packet is sent, it enters the loading state, and a large number of LSA learning is
performed 8. Full: Adjacent state (all LSAs of both parties are learned)

Six, the basic configuration of OSPF

[r1] ospf 1 router-id 1.1.1.1 needs to define the process number when starting, only has local significance

  It is recommended to configure RID—Unique in the entire network—Manual configuration—Maximum value of local loopback interface—Maximum value of physical interface

[r1-ospf-1]

[r1-ospf-1]area 0 Enter the corresponding area to declare

[r1-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0

[r1-ospf-1-area-0.0.0.0]network 12.1.1.1 0.0.0.0

OSPF area division rules:

  1. Star topology—non-backbone areas need to connect to the backbone area
  2. ABR must exist-area border router-there must be a border device between areas

[r2]display ospf peer View neighbor table

[r2]display ospf peer brief View brief table of neighbor table

         OSPF Process 1 with Router ID 2.2.2.2

                  Peer Statistic Information

 ----------------------------------------------------------------------------

 Area Id          Interface                        Neighbor id      State   

 0.0.0.0          GigabitEthernet0/0/0               1.1.1.1          Full       

 0.0.0.1          GigabitEthernet0/0/1               3.3.3.3          Full   

After the neighbor relationship is established, the conditions are matched; if the matching fails, the neighbor relationship will remain, and only the hello packet will be kept alive periodically;

A successful match will establish an adjacency relationship:

First, use DBD for master-slave election, and use DBD for database directory interaction:

Several parameters about the DBD package:

  1. MTU The OSPF protocol will carry the MTU value of the direct connection with the neighbor in the DBD packet; the neighbor’s MTU value must be exactly the same, otherwise it will be stuck in the exstart state machine; by default, Huawei devices do not detect this MTU value;

[r1]interface GigabitEthernet 0/0/1

[r1-GigabitEthernet0/0/1] ospf mtu-enable enables MTU detection on the interface directly connected between neighbors; if one end is enabled, the other end must also be enabled ;

  1. Hidden confirmation One device uses the same serial number as another device to confirm the data at the opposite end. OSPF always implicitly confirms the master;
  2. Description field I is 1 to identify the first DBD sent locally. M is 0. The last DBD sent locally. MS is 1 for master and S is 0 for slave.

 

After using DBD to interact with each other in the database directory, use LSR/LSU/LSack to obtain unknown LSA information;

Finally, the LSDB of all devices is consistent; the database table is generated :

<r1>display ospf lsdb view database table

 

When the database synchronization is completed, OSPF will be based on the local LSDB, calculated as a directed graph —> tree structure —> the shortest path is loaded into the routing table :

The default priority of Huawei equipment is 10;

<r1>display ospf routing View all local OSPF-related routes, sent + received

The metric is cost value = cost value = reference bandwidth / interface bandwidth

OSPF selects the shortest path with the smallest sum of cost values ​​for the entire path; the default reference bandwidth is 100M

If the interface bandwidth is greater than the reference bandwidth, the cost value is 1; it may lead to poor routing

The reference bandwidth of the device can be modified:

[r1]ospf 1

[r1-ospf-1]bandwidth-reference ?

  INTEGER<1-2147483648>  The reference bandwidth (Mbits/s)

[r1-ospf-1]bandwidth-reference 1000 

Remember: if you modify, all devices in the entire network need to be modified to be consistent;

7. Conditions for OSPF to establish a neighbor relationship from a neighbor relationship to a neighbor relationship

Follow network type

  1. In point-to-point networks, neighbors must become adjacent
  2. In the MA network, OSPF does not support interface split horizon; therefore, if the two devices are adjacent, it will cause a large number of repeated updates; therefore, DR/BDR election must be carried out, and DR/BDR uses multicast 224.0.0.6;

Non-DR/BDR devices in this network segment can only be established as neighbor relationships;

Election rules: first compare the priority of the candidate interface 0-255, which is the best value, 0 means not to participate

The default is 1; if the priority is the same, compare the RID value of the participating devices, the value is better;

Modifying the interface priority can interfere with the election:

[r1]interface GigabitEthernet 0/0/1

[r1-GigabitEthernet0/0/1]ospf dr-priority 2 Modification priority of participating interface

Note: DR election is a non-preemptive behavior; therefore, the OSPF process that needs to be restarted to modify the priority

<r1>reset ospf process

Warning: The OSPF process will be reset. Continue? [Y/N]:y

Topology:

Center to site (hub-spoke-star structure) DR must be located at the central site, no BDR

Part of the mesh structure is based on the actual environment to focus on whether to fix the DR;

Fully connected mesh structure --- DR/BDR election is normal

8. Irregular areas of OSPF

  1. Non-backbone areas away from the backbone
  2. Discontinuous backbone area—After locally learning the route from area x, it cannot share to area X

solution:

  1. Ordinary GRE, tunnel tunnel

Use tunnel to establish a new logical link between legal and illegal ABR; then announce the link to the OSPF protocol

Disadvantages:

  1. Periodic OSPF needs to be actually transmitted through the intermediate area, which greatly increases the resource occupation of the intermediate area
  2. Poor routing---When the ospf device receives two routes to the same network segment, it first pays attention to the area IDs obtained by the two routes; backbone areas are better than non-backbone areas

 

Nine, LSA
1.1 type LSA (router)
cause: need to know the topology information in the same area.
Function: used to transmit routing and topology information in the area where the local device is located.
Scope of propagation: in the area where the local device is located , it terminates at the ABR Boundary routers in different areas of the same protocol generate 3 types of LSA information)
Features:
(1) In the MA network, type 1 LSA only contains the MA interface (transmit conn) and metric values, and the mask and topology information are in type 2. LSA appears
(2) link ID=ADV router = the RID of the router that generates type 1 LSA
(3) link count: the identifier contains several pieces of information

2.2 Types of LSA (network)
causes:
(1) If there is an MA network in a type of LSA, the number and connection of the equipment in the MA network are unknown
(2) Only the DR router in the MA network will produce type 2 LSA
function: describe all routers in the MA network, and what is the network mask of the MA network.
Propagation range: transmit in this area and terminate at ABR (regardless of whether there is an MA interface).
Features:
(1) Link-id: DR interface address ADV in the MA network: router-id of the router to which the DR interface belongs
(2) describes the mask information and topology information of the MA (which routers are connected to this MA network segment)

3.3 Types of LSA (summary)
cause: routing needs to be transferred between domains, in order to reach the entire network.
Function: used to transfer routing within different areas (only routing information).
Propagation range: transfer between areas (by default, only in a certain area). Transmission in the area, it must be regenerated by a new ABR when entering other areas), the entire OSPF domain (not belonging to any router)
Features:
(1) Link-id: routing network number (transmitting an area to routers in other areas the IP interface, the physical interface)
(2) ADV: for the region of ABR default router-ID is changed at different areas across (if transmitted to a particular region, the region which region contains an ABR, the change ADV)

Type 4.4 LSA: summary ASBR LSA
function: In addition to generating the area where Type 5 LSA is located, it is used to advertise the location of ASBR.
Link id: router-id of ASBR.
ADV router: default router-id of ABR in the area where ASBR is located.
Features: when traversing different areas , A new ABR is regenerated. (Consistent with Type 3 LSA)

Type 5.5 LSA (external)
Reason for external LSA : different protocols exist in the same network, for the whole network to be reachable.
Function: Import external routes into OSPF domain.
Features:
(1) Link-id: external routing network number (external The interface IP of the router in the area) ADV: ASBR router-ID
(2) Seed metric: When other protocols are republished to OSPF, there will be a default metric of 20 (type 2 transfer metric is unchanged). Type 1 is changed
(3) Forwarding address: Forward address

WAN technology
Data link level: Different encapsulation is defined for different physical links.
LAN encapsulation: Ethernet 2, IEEE802.3
WAN encapsulation: PPP HDLC FR ATM
HDLC: Advanced data link control protocol, default Cisco serial link encapsulation It is HDLC, which is divided into industry standard HDLC and Cisco proprietary HDLC. The two are different and common. Cisco proprietary HDLC adds some control characters to identify the upper layer protocol. There are three layers of transmission
PPP: point-to-point encapsulation protocol, Huawei serial chain The default encapsulation of the road is PPP. The PPP link needs to establish an end-to-end link. The establishment of a PPP session is divided into: 1. LCP
2.
PPP authentication
3. NCP
LCP: link control protocol, which sends LCP data for physical link and Encapsulated confirmation
PPP authentication: to increase the security of PPP sessions, PAP CHAP
NCP: network control protocol, encapsulate the upper layer protocol by sending NCP, IPCP negotiation, during the NCP negotiation process, it will automatically route its own local IP address Sent to the other party. When the PPP session is established, a 32-bit host route to the IP address of the other party’s interface will be generated.
PAP: Password authentication protocol is a one-time simple plaintext authentication

 

 

  

Guess you like

Origin blog.csdn.net/weixin_45802686/article/details/112996712