Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Detailed explanation of basic knowledge of dynamic routing protocol RIP,OSPF and experimental verification of configuration

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Dynamic routing: do not need to write routes by hand, declare their directly connected network segments, routers can learn from each other, and update and announce to neighboring routers if there is a change in the routing table.

Advantages of static routing: accurate forwarding, manual control by administrators, disadvantages: poor flexibility

Dynamic routing features:

(1) reduced management tasks

(2) occupy the network bandwidth

(3) dynamic routing is based on a certain routing protocol.

Metrics: hop count, bandwidth, load, delay, reliability, cost

Classify according to the algorithm performed by the route

(1) distance vector routing protocol: routing is based on the number of routers passing from the source network to the destination network; RIP, IGRP

(2) Link-state routing protocol: route selection considering all paths from source network to destination network; OSPF, IS-IS

RIP introduction

RIP is a distance vector routing protocol

The basic concept of RIP

1) regular updates

2) neighbor

3) broadcast updates

4) Update the whole routing table

The RIP metric is hop count: the maximum hop count is 15 hops, and 16 hops is unreachable.

RIP update time: send routing update information every 30s, UDP520 port, send the entire routing table information

Administrative distance / metric administrative distance: the trustworthiness of routing protocols

(1) static routing

(2) RIP; 120

(3) OSPF;110

There are two versions of RIP, VI and V2, and v2 is generally chosen.

Start the RIP process

Router (config) # router rip

Enable version 2 (support variable length subnetting, you can turn off network summarization and use multicast for updates)

Router (config-router) # version 2

Turn off automatic summarization of RIPv2 routes

Router (config-router) # no auto-summary

Announce the main network number

Router (config-router) # network 192.168.30.0

Router (config-router) # network 12.0.0.0

View the configuration of the routing protocol

Router#show ip protocols

OSPF

Internal Gateway Protocol and external Gateway Protocol

Autonomous system (AS)

Interior Gateway Protocol (IGP)

External Gateway Protocol (EGP)

OSPF is a link-state routing protocol

OSPF region

1) in order to adapt to large networks, ospf is divided into multiple areas within the AS

2) each ospf router only maintains information about the full link state of the area in which it is located

Regional ID

1) the region ID can be expressed as a decimal number

2) it can also be expressed as an IP

Backbone area area 0

The backbone area of Area0 is responsible for the transmission of inter-regional routing information, and other areas have to forward the information in this area with the help of area0.

Non-backbone areas: standard area

Router ID: the IP address that uniquely identifies the router in the ospf area

Router ID selection rules

1) first, select the IP address with the highest value on the router loopback interface

2) if there is no loopback interface, select the one with the highest IP address in the physical port

3) you can also use the router-id command to specify router id

DR master route, commander in chief

BDR from Deputy Commander in Chief of routing

Other routers only form adjacencies with DR,BDR

The election method of DR and BDR

(1) automatically elect DR and BDR

The largest router id router on the network segment will be elected DR, and the second largest router will be elected BDR.

(2) manually select DR and BDR

The priority range is 0-255. The higher the value, the higher the priority. The default is 1.

If the priority is the same, you need to compare router ID

If the priority of the router is set to 0, it will not participate in the election of DR and BDR

In real applications, which router is turned on first, which router is selected as DR or BDR

The election process of DR and BDR

The priority of the router can affect an election process, but it cannot force the replacement of existing DR and BDR routers

The measure of OSPF is COST

1) COST=108BW

2) the shortest path is calculated based on the cost specified by the interface (cost)

OSPF packet

Carried in an IP packet, using protocol number 89

OSPF's multicast address 224.0.0.5 is responsible for listening. 224.o.o.6 is responsible for sending DR. BDR is responsible for announcing.

Depends on interface bandwidth

5 packets: hello package, DBD package, LSR,LSU contains multiple LSA,LSACK

The first stage of OSPF startup is the process of establishing two-way communication using Hello messages.

1.down status, shutdown status does not know any other routers

2jinit can only accept hello messages.

37.2Matheway: electing DR,BDR. It is not possible to determine the master-slave identity of DR and BDR.

4 the quasi-start status of Magi ExStart sends DBD messages and selects the master-slave identity.

5 exchange status DBD information exchange

6pm loading status, LSR LSU LSAck

7FULL status

OSPF divides networks into four types

1) Point-to-point network

2) broadcast multi-access network

3) non-broadcast multiaccess network

4) Point-to-multipoint network

Consider the use of OSPF from the following aspects

1) Network scale, if the whole city wants to set up a citizen card system, it only needs one ospf.

2) Network Topology

3) other special requirements

4) requirements of the router itself

Characteristics of OSPF

1) can adapt to large-scale network

2) Fast convergence of route changes

3) No routing ring

4) support variable length subnet mask VLSM

5) support zoning

6) support sending protocol packets in multicast mode

Start the ospf routing process

Router (config) # router ospf process number

Specify the interface and region on which the ospf protocol is running

Router (config-router) # network 192.168.30.0 0.0.0.255 area 0

View the list of neighbors and their status

Router#show ip ospf neighbor

View the configuration of ospf

Routershow ip ospf

Specific ospf configuration example

Router (config) # router ospf 1

Router (config-router) # router-id 2.2.2.2

Router (config-router) # network 192.168.30.0 0.0.0.255 area 0

Router (config-router) # network 192.168.10.0 0.0.0.255 area 0

Reasons for generating ospf Multiregions

1) improve the scalability of the network

2) Fast convergence

Intra-domain traffic

Traffic formed by the exchange of packets between routers in a single area

Inter-domain traffic

Traffic for exchanging packets between multiple areas

External traffic

Traffic between AS

ABR: area boundary routing, responsible for routing forwarding between regions, area 1 and area 0 between regions

ASBR: the AS used to connect the ospf to other external routes. Diplomat, autonomous system border router, generated in the backbone area, area 0. ASBR is responsible for injecting external routes into OSPF's network, commonly known as injections.

Non-backbone areas-distinguish according to the types of routes that can be learned

1 standard area

2) stub area

3) complete stub area

4) impure terminal region

Type1; router LSA, sent by a route in the area

Type2; network lsa, issued by area dr

Type3; network summary lsa,ABR issues, summary link advertisements for other areas

Type4;asbr summary lsa,ASBR sent out to advertise ASBR information

Issued by Type5;AS external LSA,ASBR to advertise external rout

Issued by ASBR within the external lsa,NSSA area of Type7;nssa

Show ip route ospf

Stub area: no LSA4,5,7 advertisements

OSPF Advanced configuration

Route redistribution

Factors for consideration: 1. Metric, 2 administrative distance, degree of trust

Comparison between OSPF and RIP

Next, set up a topology diagram for experimental verification, using static routing protocol, default routing protocol and RIP,OSPF to achieve interconnection of the whole network.

Experimental environment; GNS3 simulator, the beginning of the network segment marked by the topology diagram is 192.168.

Description of the topology diagram: R2 Magi R3 applies OSPF, which belongs to area 1 area; R3 Magi R4 applies OSPF, which belongs to area 0 area; R4 Magi R5 applies RIP

R1 configuration; interface with ip, default route, next hop address 192.168.20.2

R2 configuration; interface with ip, configure static route to next hop 192.168.20.1, configure OSPF, add 192.168.30.0 network segment to area 1 area, and inject static routing protocol into OSPF, and directly connect with its own network segment.

R3 configuration; interface with ip, configure OSPF, add 192.168.30.0 network segment to area 1 area, 192.168.40.0, 192.168.70.0, 192.168.90.0 network segment to area 0 area, and configure default route to point to ISP, next hop address is 192.168.70.2. Finally, the default routing protocol is injected into OSPF.

R4 configuration; interface with ip, configure OSPF, add network segments 192.168.40.0 and 192.168.50.0 to area 0 area, configure RIP protocol, select version 2, turn off network summary function, and add network segment 192.168.50.0 to RIP.

R5 configuration; interface with ip, configure RIP, add network segments 192.168.50.0 and 192.168.60.0 to RIP to select version 2, and turn off network summary feature.

ISP configuration; interface with ip, default route to R3, next hop address 192.168.70.1

Open the VPC in the GNS3 to match the corresponding ip to the pc, and ping each other to verify the test results (the whole network interconnection of the target)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report