Introduction to Dynamic Routing

Table of contents

dynamic routing

Division of the agreement:

According to the difference of protocol algorithm, it can be divided into two categories:

RIP

Basic configuration of RIP

Extended configuration:

1. RIP manual authentication - RIPV2 manual authentication

2. Manual summary of RIP

3. RIP silent interface

4. Accelerated convergence of RIP

5. RIP default route

OSPF

Dynamic routing evaluation criteria:

Similarities between RIP and OSPF

Rules for OSPF area division

OSPF packets

       Hello packet - used to periodically discover, establish and keep alive neighbor relationships

        DBD Package - Database Description Package

        LSR packet - link state request packet

        LSU packet - link state update packet

        LSACK packet - link state confirmation packet

OSPF state machine

The working process of OSPF

Basic configuration of OSPF

OSPF overhead algorithm

condition match

Extended configuration of OSPF

1. Certification

2. Manual summary

3. Silent interface

4. Speed ​​up convergence

5. Default route


 

Disadvantages of static routing:

1. A large amount of configuration

2. Unable to adapt to network changes by itself, so as to complete convergence by itself (routing table addition process)

3. Suitable for small and medium-sized networks

Advantage:

1. Ease of management and maintenance - more in line with human needs

2. More secure

3. The resource usage is relatively small

dynamic routing

Devices running the same dynamic routing protocol negotiate the route through the communication of data packets and finally obtain it by themselves

Advantages of Dynamic Routing

1. Can reduce the amount of configuration

2. It can dynamically adapt to network changes and complete routing calculations by itself

3. Use medium and large networks

shortcoming:

1. The calculated route may not be the result we want

Division of the agreement:

Scope division

AS - autonomous system - a kind of thinking of big and small

An AS runs a dynamic routing protocol

AS directly wants to communicate - BGP

According to the difference of protocol algorithm, it can be divided into two categories:

1. Link state routing protocol - OSPF, transfer topology information

2. Distance vector routing protocol - RIP, EIGRP - transfer routing table (pass routing information in the routing table) 

RIP

Neighbor of RIP—the device runs RIP, the device is adjacent, and can transmit RIP data packets through the directly connected network segment

RIP actually only needs to pass two parameters - target network segment, cost value (cost)

cost——The parameter used by the dynamic routing protocol to select the route

The overhead of RIP only depends on the number of hops (the number of routers passed)

Comparing overhead between different routing protocols is meaningless

Route selection comparison priority of different dynamic routing protocols

        The default priority of RIP is 100

        The default priority of OSPF is 10

        The default priority of static routes is 60—the standard specified by Huawei system

Bellman - Ford Algorithm

1. For R2, if I receive a piece of routing information that my local routing table does not have, I will directly refresh the routing information into my local routing table.

2. For R2, if I receive a piece of routing information that already exists in my local routing table, if the source is the same, I will refresh the routing information into my local routing table.

3. For R2, if I receive a piece of routing information that already exists in my local routing table, if the source is inconsistent, I will compare it according to the cost value carried in the passed routing information. If the cost value in the local routing table is small, it will not be refreshed.

4. For R2, if I receive a piece of routing information that already exists in my local routing table, if the source is inconsistent, compare it according to the cost value carried in the passed routing information. If the cost value in the local routing table is large, refresh it.

The cost of routing information transmitted by RIP = cost value in the local routing table + 1

There are two versions of the RIP protocol

RIPV1

RIPV2 - under IPV4 environment

Difference between RIPV1 and RIPV2:

        1. V1 is a classful dynamic routing protocol, and V2 is a classless dynamic routing protocol

                There is a category that does not carry a subnet mask in the process of transmitting data packets

                No category is to carry the subnet mask in the process of transmitting data packets

        2. V1 does not support manual authentication, V2 supports manual authentication

        3. V1 uses broadcast to send data packets, V2 uses multicast to send data packets - multicast address 224.0.0.9 UDP port number 520

                Multicast delivery is more flexible

RIPNG - IPV6 environment - port number 521

RIP packets

request - request package

response package - response package (update package)

work process:

1. Initialization - RIP will send a RIP request packet to each interface running the RIP protocol to request the routing table.

2. Receive——After receiving the RIP request packet, the RIP neighbor will encapsulate its own routing table (routing information) in the RIP response packet, and then send it to the peer through multicast 224.0.0.9

3. Judgment - According to the four situations stipulated by the Bellman-Ford algorithm, choose whether to add a table

RIP has a periodic update mechanism - asynchronous update (reasons: 1. Not easy to operate 2. Staggered peak transmission - avoid a certain moment of delay and occupy a lot of bandwidth)

Reasons for the periodic update mechanism:

RIP has no confirmation mechanism

RIP has no keep-alive mechanism

RIP timer

Periodic update timer - 30S

Invalid timer - 180S

Garbage collection timer - 120S

        When the 180S expiration time expires, the router will delete the network segment information from its own routing table and start the garbage collection timer at the same time, send the network segment information to its neighbors and carry a cost value of 16. The measured surface expresses this network segment unreachable

If RIP wants to completely delete a piece of routing information, it needs to go through a period of 300S

RIP designed working radius - 15 hops

RIP loop problem

- asynchronous update

Solution to the loop

1.16 jumps

2. Trigger update

3. Horizontal split

        When a router receives a route from an interface and updates it, the interface will no longer send the route information

4. Toxic Reversal

        When the router receives a route from an interface, it will send the routing information when updating, but it will carry the cost value and set the cost value to 16

Huawei enables split horizon by default

If both mechanisms are activated, it will be executed according to the logic of poison reversal

Basic configuration of RIP

[R1]rip 1——Start the rip process, the process numbers with different process IDs are equivalent to different protocols (rip 1 is equivalent to one protocol)

[R1-rip-1]version 2 - select the version

[R1-rip-1] network 1.0.0.0 - announced

[R1-rip-1]network  12.0.0.0

The declaration only needs to declare its own directly connected network segment

RIP can only declare the main class

Declaration function : 1. Publish routing

                  2. Activate the interface - only the declared interface can send and receive RIP packets normally

RIP learned from R2

Extended configuration:

1. RIP manual authentication - RIPV2 manual authentication

[R1]interface GigabitEthernet 0/0/0——Enter the interface that needs to be configured

simple—the password in the data packet forwarded by RIP is sent in plain text

Md5 - the password in the data packet forwarded by RIP is sent in ciphertext

cipher - local storage passwords are stored in plain text

plain—the local storage password is stored in ciphertext

[R1-GigabitEthernet0/0/0]rip authentication-mode simple cipher 123456——interface authentication

[R2-GigabitEthernet0/0/0]rip authentication-mode simple cipher 123456

Note: Both ends must be authenticated, and the authentication algorithm must be the same (MD5 or simple)

if md5

[R2-GigabitEthernet0/0/0]rip authentication-mode md5 usual cipher 123456——Encrypt by md5

2. Manual summary of RIP

From which interface packets are aggregated from which interface

[R1-GigabitEthernet0/0/0]rip summary-address 192.168.0.0 255.255.252.0——Configure the location interface, and the mask can only write dotted binary, not decimal

Note: You can't write 22, you should write 255.255.252.0

3. RIP silent interface

Interface 0/0/1 of R1 only accepts RIP packets but does not send RIP packets

[R1]rip 1

[R1-rip-1] silent-interface GigabitEthernet 0/0/1 - silent configuration

4. Accelerated convergence of RIP

Change the RIP timer

[R1-rip-1]timers rip 10 60 40

10 - sending time (formerly 30)

60——Expiration time (formerly 150)

40 - recovery time (formerly 120)

[R2-rip-1]timers rip 10 60 40——R2 also needs to configure R1

5. RIP default route

[R2-rip-1]default-route originate

OSPF

Dynamic routing evaluation criteria:

1. Choose a good route

        Number of hops—the basis for route selection is not reasonable enough, and the selected route may form a loop

        OSPF - open shortest path first algorithm

                (1) Collect LSA (topology information) - form a directed graph - shortest path tree (acyclic structure) - SPF algorithm calculates the route

2. Fast convergence

        OSPF also has a timer, and the period of the timer is shorter than that of RIP

3. Resource occupation

        (1) A single packet - OSPF packets contain a lot of information

        (2) Overall - RIP is very large

           OSPF uses many methods to solve resource occupation

Similarities between RIP and OSPF

RIP V1 V2 ——IPV4

of

OSPF V1 V2——IPV4

OSPF V3——IPV6

1. Both RIP and OSPF are classless dynamic routing protocols that can be summarized and subnetted

2. Both use multicast to send data packets—— RIP 224.0.0.9       OSPF 224.0.0.5 224.0.0.6

3. Both support equal cost load balancing

The difference: RIP can only be used in small and medium-sized networks

              OSPF can be applied to medium and large networks (80% of the network is implemented by OSPF)

Structured Deployment - Regional Division

AS - Autonomous System

OSPF area

Inside the OSPF area—transfer topology information

          Between Areas - Transfer Routing

Distance Vector Characteristics of Link State Routing Protocols

ABR - Area Border Router ( must belong to both areas ) - Interface

OSPF area division must also be based on the actual situation - there is no specified size

If area division is performed - multi-area OSPF network

If no area division is performed - single area OSPF network

OSPF designed area lD—area lD—32-bit binary structure—identified by dotted decimal—to distinguish and identify different areas, and there must be an interface belonging to area 0

Backbone area - only area 0, area 0=0.0.0.0

Rules for OSPF area division

1. ABR must exist (a router must belong to multiple areas at the same time), and there can be multiple ABRs for backup

2. OSPF area division must be divided according to the star structure

OSPF packets

RIP has two packets

There are five types of OSPF

       Hello packet - used to periodically discover, establish and keep alive neighbor relationships

                Hello time - send once every 10S

                Dead time - the default is equal to four times the hello time - 40S

                OSPF will send a Hello packet every 30S in some special network environments .

                RID - used to distinguish and identify the identity of different OSPF routers, 32-bit binary composition

                        1. Uniqueness

                        2. The format is unified (according to the format of the IP address)

                How the device obtains the RID

                        1. Manual configuration

                        2. Automatic generation - if the router is configured with a loopback address, then it will select the loopback address with the largest value as its own RID; if the router does not have a loopback address, it will select the interface IP address with the largest value as its own RID

        

        DBD Package - Database Description Package

                LSDB database - link state database - used to store LSA (topology information)

        LSR packet - link state request packet

                Used to request LSA information that does not exist

        LSU packet - link state update packet

                The data packet that actually carries the LSA information

        LSACK packet - link state confirmation packet

                

OSPF state machine

 Two-Way—two-way communication state—marks the establishment of a neighbor relationship

Condition matching——Only the device whose condition is successful can enter the next state. If the condition matching fails, it will stay in the neighbor relationship and keep alive every 10S through the Hello packet.

Exstart State - pre-start state

Election of master-slave relationship - election standard depends on the size of RID - staggered sending of data packets

different state

Loading - loading status

full—marks the establishment of an adjacency relationship

Only adjacency states actually share LSA information

The working process of OSPF

Establish neighbor relationship----After the startup configuration is completed, OSPF will periodically send hello packets to all local interfaces running OSPF protocol with multicast 224.0.0.5 (target IP), and the hello packets will carry their own local RID , the neighbor receives the peer's RID and stores this information in the neighbor table .

Condition matching: If the condition matches successfully, it will enter the next state, and if the match fails, it will stay in the neighbor relationship . The hello package needs to be used for periodic keepalive.

Establish an adjacency relationship: To elect a master-slave relationship, first use a DBD packet that does not carry real data (real LSA summary) for election----compared to RID, the one with the larger RID will be the master device, and the master device will share its own priority in the future The database summary information will also be shared by the master device with its own LSA information. Afterwards, LSR/LSU/LSACK is used to obtain local unknown LSA information, and the establishment of local lsdb is completed - forming a local link database table.

Completion of convergence: Based on its own local link state database, relying on the OsPF algorithm to form a directed graph---finally calculate the route---load it into its local routing table .

After the convergence is completed, the hello packet will be used to keep alive periodically, and periodic updates will be performed every 30 minutes (related to LSA).


Basic configuration of OSPF

——configuration process id

1. Start the OSPF process to configure RID

[R1] ospf 1 router-id 1.1.1.1—— Start OSPF process to configure RID

2. Create a zone

[R1-ospf-1]area 0 - create area

3. Declare

[R1-ospf-1-area-0.0.0.0] network 1.1.1.0 0.0.0.255 - range announcement

0.0.0.255 - anti-mask (32-bit binary composition, continuous 0 or continuous 1 composition)

The part with a mask of 1 is a network bit, which is equivalent to immutable

Anti-mask 0 means immutable, 1 means mutable

[R1-ospf-1-area-0.0.0.0]network 12.0.0.1 0.0.0.0—— Accurate announcement , which is equivalent to only announcing one IP

to R2

[R2]ospf 1 router-id 2.2.2.2

2.2.2.2 is written casually

[R2-ospf-1]area 0

[R2-ospf-1-area-0.0.0.0]network  12.0.0.0 0.0.0.255

[R2]display ospf peer - view neighbor table

[R2]display ospf peer brief——view neighbor brief list

[R2-ospf-1]area 1

[R2-ospf-1-area-0.0.0.1]network 23.0.0.0 0.0.0.255

to R3

[R3]ospf 1 router-id 3.3.3.3

[R3-ospf-1]area 1

[R3-ospf-1-area-0.0.0.1]network 23.0.0.0 0.0.0.255

OSPF overhead algorithm

Reference Bandwidth/True Bandwidth

The default reference bandwidth is 100M

Ways to Change the Default Bandwidth

[R3-ospf-1]bandwidth-reference 10000——configuration command

How does OSPF handle when the network structure changes?

When the network is newly added, a network segment is missing or the network is unreachable,

Added - Announcement

Missing - Deletion Announcement

Network unreachable - wait for death time

OSPF also exists to trigger updates, and this update packet needs to be replied

condition match

DR - designated router (refers to the interface)

The DR establishes adjacencies with all routers in other broadcast domains

BDR - Backup Designated Router - is in adjacency with all other routers

DRother - a broadcast domain, other routers, except DR and BDR other routers are in the neighbor state

The one with the largest RID in the broadcast domain will be selected as the DR, the one with the second largest RID will be the BDR, and the remaining devices will be Drothers

DR and BDR elections are non-preemptive

Election time max is death time

Priority: 1 - the priority of DR, the one with the larger value becomes DR

[R1-GigabitEthernet0/0/0]ospf dr-priority 0——Change the priority, interfere with the election of DR and BDR, 0 means not to participate in the election

<R1>reset ospf process - restart ospf

Extended configuration of OSPF

1. Certification

Interface authentication:

[R1-GigabitEthernet0/0/0]ospf authentication-mode md5 1 plain 123456

Regional certification: the essence is still interface certification

[R4-ospf-1-area-0.0.0.0]authentication-mode md5 1 plain 123456

2. Manual summary

Area summary - configure on ABR

[R4-ospf-1]area 0——Enter the corresponding area (summarized area)

[R4-ospf-1-area-0.0.0.0]abr-summary 172.16.0.0 255.254.0.0——summary (the mask can only write dotted decimal)

Before summary

After summary

3. Silent interface

[R5-ospf-1] silent-interface GigabitEthernet 0/0/1——configuration location

4. Speed ​​up convergence

[R5-GigabitEthernet0/0/0]ospf timer hello 5 ——only need to change the hello time on the interface, and the death time will be automatically modified according to the quadruple relationship by default

If one interface is changed, the time of the other neighbor interface must also be changed, otherwise the neighbor interface cannot be established.

Conclusion: All interfaces need to be modified

5. Default route

[R5-ospf-1]default-route-advertise——configuration location, OSPF process

There must be a default in itself to deliver the default to other devices

[R5-ospf-1]default-route-advertise always ——Forcibly deliver the default route

Guess you like

Origin blog.csdn.net/m2282475145/article/details/131611689