当前位置:网站首页>So this is the BGP agreement
So this is the BGP agreement
2022-07-04 20:22:00 【Programmer cxuan】
See for the last article Ten thousand words long text burst liver routing protocol !
We talked above RIP 、OSPF Agreements are based on AS That is, the agreement within the autonomous system , They can be considered as intra domain routing protocols ; Now we are going to talk about AS The agreement between , This is also called Inter domain routing protocol , Or external gateway protocol , One of its most famous agreements is BGP agreement , At present, the most used protocol version is BGP The fourth version of BGP - 4, Referred to as BGP ( Border Gateway Protocol ).
stay RIP and OSPF Among these agreements , By IP Network address for routing control , and BGP The protocol requires routing control through the entire Internet , The scope is much larger .
BGP The environment and RIP、OSPF The environment is different , The main reason is that the scale of the Internet is too large , It makes the routing between autonomous systems more difficult . The router on the Internet is right for any IP The address can find its destination network through the routing table . This is a very large collection , If link state protocol is used RIP and OSPF Words , You must maintain a very large set of routes , On the one hand, the efficiency of routing table retrieval is very low , And such a huge data item is not easy to maintain . Another point is for each router metric Dissimilarity , It's possible that this metric It's through 100 Routes , And that link arrives 100 A route may directly report an error .
And the routing between autonomous systems must consider the policy problem , These strategies need to put politics 、 regional 、 Safety or economic considerations .
Due to the existence of these special circumstances ,BGP The protocol is just to choose a better route to the destination network , Instead of choosing the best route ,BGP Adopted Path vector routing protocol , It is associated with RIP and OSPF There's a big difference .
stay BGP Agreement , Every AS There are many within the autonomous system BGP Border router , This BGP The border router is quite a spokesman within the autonomous system . Different AS Between BGP If the border router wants to exchange routing information , You need to establish TCP Connect , And then switch on this connection BGP Message to establish BGP conversation , adopt TCP Able to provide reliable service . Two exchange messages BGP Border routers are called each other's temporary stations ( The angel ) Or peer station .
The following figure is a use BGP Border router and AS Diagram of the relationship :
BGP The network accessibility information exchanged is a series of routes to reach a certain network . When each BGP Once the border router exchanges reachability information , You will choose one to reach each AS Better routing path .
BGP Support classless inter domain routing CIDR, therefore BGP The routing table of should also include the current destination network prefix 、 Next hop router , And what it takes to reach the destination network AS .
stay BGP Just running ,BGP The next stop is to exchange the whole BGP Routing table , In the future, just update the part with new changes when changes occur . This will save network bandwidth and reduce router overhead , This feature and OSPF Very similar .
BGP - 4 There are mainly the following types of messages :
- OPEN ( open ) message , Used with adjacent BGP Area boundary routers establish relationships , Perform communication initialization .
- UPDATE ( to update ) message , Used to announce routing information , And list multiple routes that need to be updated .
- KEEPALIVE ( Keep alive ) message , It is used to periodically verify the connectivity of adjacent stations .
- NOTIFICATION ( notice ) message , Used to send detected errors .
If two adjacent stations belong to two different autonomous systems , And when one of the temporary stations plans to exchange routes with other temporary stations , At this time, there should be a process of route negotiation . The negotiation process includes whether the temporary router can also accept additional routing information . Therefore, you should send it first when you start the negotiation OPEN message , If the temporary station can accept this relationship , Just use KEEPALIVE Message response . After response , Two temporary stations are even established .
After the relationship is established , We need to maintain each other , This is after establishing the relationship with the couple , As masters, you can't ignore others for three days or two ? As the saying goes , Feelings need to be maintained , Then this routing relationship also needs to be maintained . Each of the two communicating parties needs to be sure whether the other party already exists , So two BGP Border routers need to be switched regularly KEEPALIVE message , Generally, this regular time is 30 s.
BGP Border routers can use UPDATE Message to update the route : Including removing previously notified routes and adding new routes . You can undo multiple routes at a time , But add a new route UPDATE Only one message can be added .
Of course. BGP Does not exist in the “ Good news spreads fast, bad news spreads slowly ” The problem of ( Feeling RIP The problem of was played out ). because BGP There is not only one border router , And when a router or link fails , because BGP The border router can obtain routing information from more than one adjacent station , So it's easy to choose a new route .
Here is BGP The message format of :
The four message types introduced above have common message headers , The first one is 19 byte , The general header is mainly divided into three fields .
- Mark marker Field is 16 Byte length , Used to identify received BGP message , If you don't use authentication , The marking field should be set to all 1.
- The length field indicates the entire length, including the generic header BGP The length of the message , In bytes , The minimum is 19, The maximum is 4096.
- The value of the type field is 1 To 4, Corresponding to the introduction sequence of the above messages .
OPEN There are 6 A field , As shown in the following picture
The first three fields are BGP General message header , The following fields are Version edition ( 1 byte , The value is 4 ), My AS This autonomous system number ( 2 byte , It is the only one in the world 16 Bit system number ) , Hold Time Retention time ( 2 byte , The time in seconds to maintain the relationship as a temporary station ),BGP Identifier BGP identifier ( 4 byte , The router IP Address ), Here are optional lengths and optional parameters .
KEEPALIVE Message only BGP 19 General header of bytes .
UPDATE The message has five fields , As shown in the figure below
In the message Unfeasible routes length Indicates infeasible route length , There is a field message behind that is not listed , Namely Withdrawn Routes , List of routes to undo , hinder Total Path Attribute Length Indicates the total length of path attributes , hinder Path attributes It means path attribute , final NLRI Identify the network that sent this message .
NOTIFICATION The message has three fields , As shown in the figure below
Mainly including error codes ( 1 byte ), Error subcode ( 1 byte ) , There are error data behind .
Link to the original text :6 Minutes to watch BGP agreement .
边栏推荐
- Optimize if code with policy mode [policy mode]
- PHP pseudo original API docking method
- c# .net mvc 使用百度Ueditor富文本框上传文件(图片,视频等)
- Process of manually encrypt the mass-producing firmware and programming ESP devices
- Actual combat simulation │ JWT login authentication
- 多表操作-外连接查询
- 黑马程序员-软件测试--09阶段2-linux和数据库-31-43修改文件权限字母发的说明,-查找链接修改文件,查找文件命令,链接文件,压缩解压方式,vi编辑器基本使用,
- Installation and use of VMware Tools and open VM tools: solve the problems of incomplete screen and unable to transfer files of virtual machines
- Employment prospects of neural network Internet of things application technology [welcome to add]
- Swagger突然发癫
猜你喜欢
Actual combat simulation │ JWT login authentication
BCG 使用之CBCGPProgressDlg进度条使用
什么叫内卷?
输入的查询SQL语句,是如何执行的?
Chrome development tool: what the hell is vmxxx file
JVM系列之对象的创建
Actual combat simulation │ JWT login authentication
Free soldier
实战模拟│JWT 登录认证
Dark horse programmer - software testing - 09 stage 2-linux and database -31-43 instructions issued by modifying the file permission letter, - find the link to modify the file, find the file command,
随机推荐
Cbcgpprogressdlg progress bar used by BCG
Detailed explanation of Audi EDI invoice message
Cbcgpprogressdlgctrl progress bar used by BCG
泰山OFFICE技术讲座:关于背景(底纹和高亮)的顺序问题
Cann operator: using iterators to efficiently realize tensor data cutting and blocking processing
What financial products can you buy with a deposit of 100000 yuan?
Swagger突然发癫
2022 Health Exhibition, health exhibition, Beijing Great Health Exhibition and health industry exhibition were held in November
2022 version of stronger jsonpath compatibility and performance test (snack3, fastjson2, jayway.jsonpath)
B2B mall system development of electronic components: an example of enabling enterprises to build standardized purchase, sale and inventory processes
In operation (i.e. included in) usage of SSRs filter
C # use stopwatch to measure the running time of the program
[QNX Hypervisor 2.2用户手册]6.3.1 工厂页和控制页
Chrome开发工具:VMxxx文件是什么鬼
Kotlin condition control
黑马程序员-软件测试--07阶段2-linux和数据库-09-24-linux命令学习步骤,通配符,绝对路径,相对路径,文件和目录常用命令,文件内容相关操作,查看日志文件,ping命令使用,
多表操作-外连接查询
YOLOv5s-ShuffleNetV2
kotlin 条件控制
Pythagorean number law (any three numbers can meet the conditions of Pythagorean theorem)