当前位置:网站首页>Data communication foundation - dynamic routing protocol rip
Data communication foundation - dynamic routing protocol rip
2022-07-05 15:36:00 【GALi_ two hundred and thirty-three】
RIP agreement
RIP(Routing Information Protocol, Routing information protocol ) It's an internal gateway protocol (IGP), It is a dynamic routing protocol , For autonomous systems (AS) The transmission of routing information within .RIP The protocol is based on the distance vector algorithm (DistanceVectorAlgorithms), Use “ Hops ”( namely metric) To measure the distance to the destination . The router of this protocol only cares about the world around itself , Only exchange information with your neighbor router , The scope is limited to 15 jump (15 degree ,16 Can't jump ) within , Farther away , It doesn't care .RIP be applied to OSI The application layer of network seven layer model .
RIP(Routing Information Protocols, Routing information protocol ).
It is an earlier internal Gateway Protocol (IGP).
For small networks , It is a typical distance vector protocol .
RIP be based on UDP, port 520.
The priority defined by Huawei is 100, Priority defined by Cisco ( Manage distance ) yes 120.
RIP There are three versions :RIPv1、RIPv2 And RIPng.
Classification of routing protocols
- Direct link routing : The network segment where the router is directly connected , When the physical state and protocol state of the interface are UP Automatically learn the direct connection route to the routing table .
- Static routing : According to data access requirements , Route entries manually configured on the device .
- Dynamic routing : The router automatically updates and synchronizes the routing information , And when the network topology changes , Can automatically converge .
Classification of dynamic routing protocols
Distance vector routing protocol
Routers using distance vector routing protocol do not understand the network topology . The router only knows :
The distance between itself and the destination network .
In which direction or interface should the packet be forwarded .
characteristic :
- Periodically update ( radio broadcast ) The whole routing table .
- distance : The measure of reaching the target network .
- Direction : Go to the next hop router of the target network .
working principle
Route establishment
Router operation RIP after , Route update request will be sent first , The router that receives the request will send its own RIP Route to respond ; When the network is stable , The router will periodically send routing update information .
- At first, there is only direct route
- Initial routing information exchange
- Route convergence is complete
Calculation of distance vector
RIP The unit of measurement is hops , Its unit is 1, That is, the cost of each link is 1, Regardless of the actual bandwidth of the link 、 Delay and other factors ,RIP Most allow 15 jump . The so-called hop count refers to the number of routers that need to pass to the target network .
RIP Use metrics to express the distance between it and all known destinations .
When one RIP When the update message arrives , The receiver router and its own RIP Compare each item in the routing table , And according to the distance vector routing algorithm RIP Modify the routing table .
Timer
Update timer (Update timer): To stimulate RIP Update of router routing table , Every RIP The node has only one update timer , Set to 30s. every other 30s The router will pass udp520 The port broadcasts its own routing table information to its neighbors . Every RIP The timer of the router is independent of other routers in the network , Therefore, they are unlikely to broadcast at the same time .
Aging timer (Age timer): Used to determine whether a route is available . Each route has a timeout timer , Set to 180s. When a route is activated or updated , The timer initializes , If in 180s No update on that route was received within , Set the route metric to 16, And start the garbage collection timer .
Garbage collection timer (Garbage-collect timer): Used to determine whether to clear a route . Each route has a garbage collection timer , Set to 120s. When the router recognizes that a route is invalid , Just initialize a timer , If in 120s I haven't received the update of this route in , Delete the route from the route table .
Inhibit timer (Suppress timer): When RIP The device received the peer route update , measurements cost by 16, Then the corresponding route entry enters the suppression state , And start the suppression timer , default 180s. In order to prevent routing shock ( The route is unstable ), Before the suppression timer times out , Even if the opposite end is received cost Less than 16 The routing , I don't accept it ; Wait for the suppression timer to timeout , Relearn the route entry .
Relationship between three timers
IP The release of update information is controlled by the update timer , Default is every 30 Seconds to send .
Each routing table item corresponds to two timers : Aging timer and garbage collection timer . When you learn a route and add it to the route table , The aging timer starts . If the aging timer times out , The device still hasn't received the update message from the neighbor , Then set the measurement value of the route to 16( Indicates that the route is unreachable ), And start the garbage collection timer . If the garbage collection timer times out , The device still does not receive the update message , Then delete the entry in the routing table .
(1) If the update is not triggered , A routing table entry requires at most 300 Seconds to be deleted ( Aging time + Garbage collection time ).
(2) If there is a trigger update , Then a routing entry needs at most 180 Seconds to be deleted ( It is the aging time ).
The loop
When the network fails ,RIP It is possible for the network to generate routing loops . It can be divided horizontally 、 Toxicity reversal 、 Trigger update 、 Suppression time and other technologies to avoid the generation of loops .
Next jump
The next hop feature makes RIP In the multi access network, the best next hop can be selected . In the diagram above ,R1 take 2.0.0.0/8 Routing in RIP, adopt RIP Inform to R3, Before it sends RIP When routing , Set the next hop field to 192.168.123.2, In this way ,R3 After receiving the route , take 2.0.0.0/8 When installing the routing table , Set the next hop to R2( instead of R1).
Silent-Interface
Silent port
R1 Connected to 192.168.1.0/24 Network segment , The network segment is full of terminal devices , Nothing else RIP Router , Through execution silent-interface command , take GE0/0/1 The interface is configured as a silent interface , So as to suppress RIP The interface sends messages out , In this way , The host will not receive RIP message , Reduce the loss of resources and network bandwidth .
If an interface is suppressed , The direct route of the network segment where the interface is located can still be published to other interfaces .
Message format
RIPv1 Message format
RIPv2 Message format
command Field : Occupy 1 Bytes , The value is 2 It means that the message is a response message . It contains routing information .
version Field : Occupy 1 Bytes , The value is 2 It means RIPv2.
address Family Field : Occupy 2 Bytes ,ipv4 The value is 2.
route tag Field : Occupy 2 Bytes , Mark external redistribution into RIPv2 The routing
ip address Field : Occupy 4 Bytes , Indicates the destination address of the route , This address is the network address .
netmask Field : Occupy 4 Bytes , It's the subnet mask ,RIPv2 There are categories , So there is this field .
next hop Field : Occupy 4 Bytes , It represents a better next hop than announcing the router's address . If this field is set to 0.0.0.0 It shows that the address of the notification router is the best next hop .
metric Field : Occupy 4 Bytes , Refers to the measure , stay RIP Middle is the number of hops .
RIP Version difference
RIPv1
RIPv1 It's a classed routing protocol (ABCED Five types of Networks ), I won't support it VLSM and CIDR
Send a message in the form of broadcast
Authentication is not supported
RIPv2
RIPv2 Classless routing protocol , Support VLSM, Support route aggregation and routing CIDR
Support broadcast or multicast (224.0.0.9) Send a message by
The advantage of multicast sending messages is that those in the same network are not running RIP The network segment of can avoid accepting RIP The network segment of can avoid accepting RIP The broadcast message of ; in addition , Multicast sending messages can also make the operation RIPv1 The network segment of the protocol avoids wrong acceptance and processing RIPv2 Route with subnet mask in
Support external routing tags (Route Tag), The routing policy can be based on Tag Flexible control of routing .
Support to specify the next hop , In the broadcast network, you can select the optimal next hop address to the destination network segment .
Support plaintext and md5 Ciphertext Authentication
The mask is carried in the update
Route Preference
When a router finds a route to the same destination network through a variety of different routing protocols , Will select routing priority (Preference) The route with the lowest value ; If these routes learn from the same routing protocol , Then the preferred measure (Metric) The most optimal .
Huawei manufacturer standard
Routing protocol or routing type | Excellent routing **** First class |
---|---|
DIRECT | 0 |
OSPF | 10 |
IS-IS | 15 |
STATIC | 60 |
RIP | 100 |
OSPF ASE | 150 |
OSPF NSSA | 150 |
IBGP | 255 |
EBGP | 255 |
Loop generation
3.0.0.0/8 Network failure ,R3 Fault message received , Set this route as unreachable , Wait for the update cycle to notify the adjacent R2 Router .
If your update cycle hasn't come yet ,R2 The update cycle of the router comes first ,R1 It will start from R2 Learn again 3.0.0.0/8 The routing , That is, the wrong route . The measure here , That is, the jump count meeting +1.
Then continue to inform each other to learn , Form a loop , Constantly accumulate hops .
Anti ring mechanism
In order to prevent RIP The route is flooded infinitely in the network, so the number of hops is accumulated to infinity ,RIP Regulations : The maximum number of hops of the route is 15 jump , That is, if the measure is greater than or equal to 16 Jumping is considered unreachable ;
Although the setting of the maximum number of hops solves the problem of measuring value technology to infinity , But it also greatly limits RIP The scale of the network that can be supported .
- Horizontal segmentation (Split Horizon), The principle is ,RIP Routes learned from an interface , It will not be sent back to the neighbor router from this interface . This not only reduces bandwidth consumption , It also prevents routing loops .
- Toxicity reversal (Poison Reverse), The principle is ,RIP After learning routing from an interface , Send it back to the neighbor router from the original interface , And set the overhead of the route to 16( Indicates that the route is unreachable ). In this way , You can clear useless routes in the opposite routing table .( Turn on toxicity reversal , Horizontal segmentation failure )
- Toxic routing RoutePoisoning, It refers to when the routing information is invalid in the routing table , First change the measurement value to infinity ,( Wait for aging time ) Instead of deleting this routing information from the routing table immediately .( Understand this sentence , Such as RIP Agreement , Its measure becomes 16, It means that the route is unreachable ) Release its information again , In this way, the adjacent router will know that this route is invalid …
- Trigger update , It refers to when the routing information changes , Send trigger update message to neighbor device immediately , Instead of waiting for the update timer to time out , So as to avoid routing loop .
Basic configuration
start-up RIP process , And enter RIP The configuration view :
[Router] rip 1
Enable... In the specified network segment RIP(RIP Only support classful Network announcement ):
[Router-rip-1] network 192.168.12.0
Appoint RIP Version of ( The default is version 1):
[Router-rip-1] version 2
When declaring the network, it must be a class route , however RIPv2 The packets that send route updates are classless routes and will carry mask information
Such as announcement 10.0.0.0 The routing
To configure :
[AR1]rip 1
[AR1-rip-1]version 2
[AR1-rip-1]network 192.168.1.0
[AR1-rip-1]network 192.168.12.0
[AR2]rip 1
[AR2-rip-1]version 2
[AR2-rip-1]network 192.168.12.0
[AR2-rip-1]network 192.168.23.0
[AR3]rip 1
[AR3-rip-1]version 2
[AR3-rip-1]network 192.168.23.0
[AR3-rip-1]network 192.168.2.0
View route information
pc1 Test connectivity
边栏推荐
- Bubble sort, insert sort
- 可转债打新在哪里操作开户是更安全可靠的呢
- JMeter performance test: serveragent resource monitoring
- Bugku's eyes are not real
- 当代人的水焦虑:好水究竟在哪里?
- Au - delà du PARM! La maîtrise de l'Université de Pékin propose diverse pour actualiser complètement le classement du raisonnement du NLP
- Common MySQL interview questions
- No one consults when doing research and does not communicate with students. UNC assistant professor has a two-year history of teaching struggle
- Your childhood happiness was contracted by it
- SQL Server learning notes
猜你喜欢
Stop B makes short videos, learns Tiktok to die, learns YouTube to live?
lv_font_conv离线转换
MySQL giant pit: update updates should be judged with caution by affecting the number of rows!!!
Crud de MySQL
I spring and autumn blasting-1
P1451 calculate the number of cells / 1329: [example 8.2] cells
把 ”中台“ 的思想迁移到代码中去
Value series solution report
Bugku's eyes are not real
Number protection AXB function! (essence)
随机推荐
lvgl 显示图片示例
Bugku easy_ nbt
Explanation report of the explosion
sql server学习笔记
P6183 [USACO10MAR] The Rock Game S
Database learning - Database Security
The difference between SQL Server char nchar varchar and nvarchar
你童年的快乐,都是被它承包了
[brief notes] solve the problem of IDE golang code red and error reporting
Creation and optimization of MySQL index
How can I quickly check whether there is an error after FreeSurfer runs Recon all—— Core command tail redirection
MySQL 巨坑:update 更新慎用影响行数做判断!!!
Interval DP (gravel consolidation)
Example of lvgl display picture
CSRF, XSS science popularization and defense
CSDN I'm coming
Write a go program with vscode in one article
qt creater断点调试程序详解
Maximum common subsequence
Reproduce ThinkPHP 2 X Arbitrary Code Execution Vulnerability