当前位置:网站首页>Day 10 notes
Day 10 notes
2022-07-23 13:22:00 【Ma ordinary】
BGP--- Border gateway protocol
1、AS--- Autonomous systems --- A series managed by a single institution or organization IP A collection of networks and their devices .
(1) The network range is too large , The agreement can't run , It needs to be divided ;
(2) Autonomous Management
In order to distinguish and calibrate different AS System , We have designed a number for each autonomous system ---AS Number ---16 Bit binary structure ---0-65535; among 0 and 65535 For reserved value , no need , all AS The real value range of No. is 1-65534; take 64512-65534AS Known as private AS Number .--- Because of the traditional AS The number is not enough , So there is also an expanded version AS Number ---32 A composition --- At present, the vast majority of devices have supported the expanded version AS Number .
EGP There was an agreement before the agreement ---EGP, But because of its limited function , Later, it was optimized and improved on its basis , Generate the current BGP agreement . at present AS The most widely used agreement between is BGP agreement .
In the present ipv4 The most widely used in the environment BGP The version is BGPV4. At present, there are already BGPV4+(BGPplus).BGPV4+ Also called MP-BGP--- It can support the application of various address families .
In the absence of BGP In the case of an agreement , It can also be achieved by using only republishing Technology AS Sharing of routing information between , However, the reasons why this scheme is not adopted are as follows :
(1) Republishing technology itself has defects --- Because in multi-point republishing , Because of the seed measurement problem , It will inevitably lead to poor road selection .
(2)ASBR The ownership of the equipment
BGP The way to transfer routing information between must be and RIP be similar , By passing the routing entry information --- The reason why topology information is not used , Mainly because :① Topology information resources are too large , and BGP The quantity to be delivered is huge ② Passing topology information will expose this AS Internal topology connection .
2、BGP--- Classless path vector protocol
Distance vector --- In Distance Vector Protocol , Distance is the embodiment of cost , Take the hops as the evaluation standard of the cost value . Consider a router as a unit to calculate distance . Distance vector is the concept of algorithm , because IGP The protocol itself needs to calculate the routing information of the unknown network segment by algorithm .
Path vector --- Is the one AS As a whole
The path vector does not involve the algorithm , because BGP Just will IGP The calculated routing information is sent to other AS In , It is equivalent to only delivering the ready-made route without calculation .
IGP--- Lu Jia Xuan , Fast convergence , Less occupied resources
BGP The focus of the agreement :
(1) Controllability ---AS A lot of routing information needs to be transmitted between , The so-called controllable , It is more convenient to interfere with the route selection , It is easier to make routing strategies .
To ensure controllability ,BGP The cost value is discarded . In its place BGP Many path attributes are attached to each routing information . After that, you can choose the route through these attributes . Because the existence of multiple attributes will lead to more flexible and convenient route selection . bring BGP The protocol has strong control .
because BGP The protocol needs to transmit a lot of routing information , therefore , There is no periodic update mechanism in itself .BGP Only trigger updates exist .
(2) reliability --- It is necessary to ensure the reliability of data transmission .BGP In order to ensure the reliability of transmission , Its transport layer protocols choose to use TCP agreement , Use TCP Of 179 Port No .
IGP The agreement does not choose to use TCP Why :
①TCP Low transmission efficiency
②TCP Transmission takes a lot of resources
③TCP The protocol can only realize unicast , therefore , Cannot send via multicast or broadcast , Will result in IGP The protocol cannot automatically discover neighbors , Can only be specified manually .
because BGP The choice is TCP agreement , therefore BGP You need to establish a neighbor relationship manually .
BGP Because the transport layer uses TCP agreement , So as long as TCP The protocol can be completed on the basis of normal session establishment BGP Building neighbors ---BGP Support non direct connection and neighbor building ( The network can reach )---BGP The indirect neighbor building of is established in IGP( static state ) above .
stay BGP in , We call neighbor relationship peer relationship .
EBGP Peer relationship --- If the two routers that establish the peer are located in different locations AS in , Then their relationship is called EBGP Peer relationship .
IBGP Peer relationship --- If the two routers establishing the peer are located in the same AS in , Then their relationship is called IBGP Peer relationship .
because EBGP Peers generally use direct connection to build neighbors , therefore ,EBGP In packets sent between peers TTL Value we set it to 1. If you encounter EBGP Non direct connection and neighbor building are required between peers , You need to modify it manually TTL value .IBGP Peer relationship is AS The interior is generally non direct connection and neighbor building , therefore ,TTL Value is set to 255.
(3)AS-BY-AS--- stay BGP among , We will AS As a whole .
BGP The protocol does not support load balancing .--- stay BGP among , If there are multiple paths to the same target network segment ,BGP An optimal path will be selected and loaded into the routing table according to the path attribute , Without load balancing .
3、BGP Data packets of
BGP The transmission reliability of all data packets of the protocol is determined by TCP Agreement to guarantee , all BGP Packets are based on TCP The established session channel is sent .
OSPF Of hello--- It can be found periodically , Building and keeping neighborhoods alive .
stay BGP in , The process of discovering neighbors becomes manually specified by people . Mainly because TCP The protocol needs to establish a session channel , Then the data packets will be sent based on the channel .
Open package --- establish BGP Peer relationship .--- The establishment of neighbor relationship is nothing more than the process of parameter negotiation .BGP Building neighborhoods requires OPEN Package to carry parameters , Compare and negotiate .
AS Number --- When creating a neighbor relationship, you need to specify the location of the neighbor AS Number , This parameter will be carried in OPEN Send to the other party in the message , The other side will compare this AS Number and local AS Whether the numbers are consistent , If the same , Then you can establish a normal neighbor relationship .
authentication ---BGP Jianlin can also do authentication , After authentication, you will carry the authentication password , Both sides of the authentication password need to compare , If you are consistent, you can establish a neighbor relationship with the normal one .
ROUTE-ID--- Distinguish and calibrate the router , Also by 32 Bit binary structure , according to IP Address format .---① Manual configuration ② Automatic access to ( First, check whether the device has a loopback interface , If it exists, it will select loopback interface IP The address with the largest address is RID, If there is no loopback interface , Select... In the physical interface IP The biggest address is RID)
This RID Will be in OPEN Carry... In your bag , After sending to the opposite end , The opposite end will detect this RID, If with local RID Different , Will be able to establish normal neighborhood relations .
When building a neighbor relationship manually , Designated neighbor building IP The address must match the received open The source in the bag IP Only when the address is the same can the neighbor relationship be established normally . otherwise , Neighborhood relations will fail .
Holdtime--- Time to live --- The default time is 180s, During the life guarantee period , If you don't receive the message sent by the other party Keeplive Packages or update package , Will disconnect BGP Neighborhood . This parameter is in open The message will be carried , however , Inconsistency between the two sides will not affect the establishment of neighbor relations , But in execution , This time must be consistent , The smaller of the two parties will be used .
Whether the router supports the refresh function will also become OPEN A negotiation parameter carried in the message .
Keeplive package --- Life cycle --- The cycle sending time is equal to the keeping alive time 1/3, Default keep alive time 180s, The default cycle sending time is 60s.
Besides keeping alive ,Keeplive The bag will also be open The message temporarily acts as a confirmation packet when negotiating parameters .
TCP The purpose of protocol confirmation is to ensure the reliability of data transmission , and Keeplive The purpose of message sending confirmation is to confirm and recognize the message sent by the other party open Parameters in the message .
Update package --- Update package --- A packet that carries the routing information that needs to be passed . The parameters that a route entry information needs to carry are mainly the target network number and subnet mask information , And path attributes .
There is an undo route entry field in the update package , The routing entries under this field will need to be deleted at the opposite end , It no longer needs to be expressed by means of toxic transmission .
Notification package ---BGP An alarm mechanism designed in .
Route-refresh package --- It is used to change the routing policy and request the peer to resend the routing information .( The prerequisite is that both parties support the route refresh function .)
4、BGP State machine
BGP The state machine of describes BGP Changes in state during peer establishment . because BGP This protocol can separate the neighbor establishment process from the routing sending and receiving process .
BGP State machine ---6 Kind of

IDLE--- Idle state --- The router starts BGP After the process , Will be in IDLE state , When manually specifying the neighbor to close After the Department ,BGP Will enter the inspection link , Check the specified IP Whether the address is reachable in the local routing table . Such as Guoda , Will enter the next state (connect).
Connect--- Connection status , This status is complete TCP The establishment of conversation .
If TCP Session successfully established , Will enter opensent state , send out open message .
If TCP Session establishment failed , Will enter active state , Try to rebuild TCP conversation .
In establishment TCP During conversation , Because both parties will actively initiate the process of establishing a session , And the final establishment is a two-way conversation . therefore , Finally, you only need to maintain a session channel , The selection method is through follow-up open In the message RID Compare , Choose to keep RID Initiated by large devices TCP conversation .
Opensent--- Send local open message . Received from the opposite end open message , Check the parameters , after , If you confirm that the parameters are correct . Will reply Keeplive Message as acknowledgement .
Openconfirm---open Message confirmation status --- The opposite end also receives a message sent locally open After the message , According to the inside Confirm the parameters of , If there is no mistake , Will be sent Keeplive message , Received at this end Sent by the other party Keeplive After the message , Will enter the next state .
Established--- Build state --- Mark the BGP Establishment of peer relationship .

5、BGP Working process of
(1) be based on IGP Protocol implementation IP Can be up to
(2) Specify neighbor relationship , Establish by shaking hands three times TCP Session channel , After all BGP All packets will be based on TCP Session channel for delivery .
(3) Use open Message and Keeplive The message establishes the neighbor relationship . Then collect a picture of the neighborhood relationship In the table --- Neighborhood watch .
(4) adopt update Message transmission routing information . The routing entry information transmitted mainly includes the target network number , Mask Code information , And various path attributes . After that, the device will send all the routing information sent and received by itself Record in a table ---BGP surface .
(5) After the BGP The optimal path in the table is loaded into the routing table .
(6) After convergence ,BGP Will be used periodically Keeplive Keep the message alive . The live time is... By default 180s, Zhou The default sending time of the period is 1/3, namely 60s.
(7) If an error message appears , Will use notification Send an alarm message .
(8) If there is a structural mutation , Will use update Trigger and update the message .
6、BGP The routing black hole of

because BGP The agreement supports indirect connection and neighbor building , Therefore, there may be BGP Protocol spanning is not running BGP Protocol router . Lead to BGP After routing , The control level can reach , But at the data level , After not running BGP The router of the protocol cannot pass , Form a routing black hole .
① stay R3 On , take BGP The routing information of the protocol is republished to IGP among .
② Directly in R4 Up operation BGP agreement .
③MPLS
To avoid routing black holes ,BGP A synchronization mechanism is proposed --- That is, when a router from its own IBGP The peer learns a BGP When routing , He will not be able to tell himself BGP peers , Unless he comes back from IGP We learned this route from the protocol .
7、BGP My guard ring
BGP The anti ring mechanism used --- Horizontal segmentation mechanism

EBGP The horizontal division of --- A special application in EBGP Between peers , Used to solve EBGP Between peers Possible loop problems .

BGP The protocol will record the route in the routing entry AS Number ---AS_PATH--- Record AS A property of the path .( This attribute can be completed in addition to EBGP Outside the horizontal division of , It can also be used as the basis for choosing the road )--- The received BGP In the routing entry , Among them AS_PATH Properties of the , If there is a local AS Number , Will be rejected .
IBGP The horizontal division of --- A special application in IBGP Between peers , Used to solve IBGP Peers can Possible loop problems .
IBGP Horizontal segmentation --- When a router from a IBGP Learn something from the peer BGP When routing , He will not be able to announce this routing information to others IBGP Peer relationship .
because IBGP Limitations of horizontal segmentation , Lead to IBGP Between peers Only one hop of routing information can be transmitted , In this case , May cause communication obstacles . Solution :
1, Build a company IBGP Peer relationship --- The drawback of this method is ① Building a whole neighborhood will lead to resource consumption increase ;② It may reduce the scalability of the network .
2, Routing reflectors
3, The federal
边栏推荐
- 聊聊研发团队中的“人”
- Evaluation of classification model
- com.mysql.cj.jdbc.exceptions. MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value:
- OpenCV图像处理(上)几何变换+形态学操作
- 深入理解微信小程序的底层框架(一)
- OpenVPN deployment
- 【NOI模拟赛】不知是哪一道CF的论文题(概率期望,鞅的停时定理)
- Communicate 11 tips for poor performance 
- Beifu PLC and C transmit bool array variables through ads communication
- Beifu PLC and C transmit int type variables through ads communication
猜你喜欢

Numpy: quick start to basic operations

Redis如何实现持久化?详细讲解RDB的三种触发机制及其优缺点,带你快速掌握RDB
JVM内存模型简介

0722~线程池扩展

第七天筆記

Opencv image processing (medium) image smoothing + histogram

Compilation and preprocessing

Functional testing to automated testing, sharing ten years of automated testing experience

给1万帧视频做目标分割,显存占用还不到1.4GB | ECCV2022

Opencv image processing (Part 2): edge detection + template matching + Hough transform
随机推荐
倍福PLC和C#通过ADS通信传输结构体类型变量
How does redis implement persistence? Explain in detail the three triggering mechanisms of RDB and their advantages and disadvantages, and take you to quickly master RDB
当输入网址后,到网页显示,期间发生了什么
Beifu PLC and C transmit string array type variables through ads communication
[noi simulation race] I don't know which CF paper title it is (probability expectation, martingale's stop time theorem)
【日常训练】814. 二叉树剪枝
射击 第 1-01 课:入门
Beifu PLC and C transmit bool array variables through ads communication
Opencv image processing (Part 2): edge detection + template matching + Hough transform
沟通绩效业绩不佳的 11 个提示
Beifu and C transmit real type through ads communication
北汇信息12岁啦|Happy Birthday
Quelle est la raison pour laquelle la plate - forme easygbs ne peut pas lire l'enregistrement vidéo et a un phénomène de streaming répété rtmp?
【JZOF】08 二叉树的下一个结点
功能测试转自动化测试,十年自动化测试经验分享
第十一天笔记
In the Internet era, how to refine user operations?
射击 第 1-3 课:图像精灵
Beifu PLC and C transmit bool type variables through ads communication
“算力猛兽”浪潮NF5468A5 GPU服务器开放试用免费申请