当前位置:网站首页>Why use BGP?
Why use BGP?
2022-08-02 10:20:00 【forgetful old rookie】
BGP是怎么来的?为什么要使用BGP?
路由协议的分类
分类 | 包含协议 | 说明 |
---|---|---|
IGP:用于域(AS)内路由选择. | RIP | 距离矢量协议,多用于小型网络. |
ISIS | 链路状态协议,Mostly used in carrier networks. | |
OSPF | 链路状态协议,Many large network for enterprises. | |
EIGRP | CISCOprivate routing protocol,Enhanced distance vector protocols. | |
EGP:用于域(AS)inter-routing. | EGP | BGP的前身,目前已经不再使用. |
BGP | In fact the only inter-domain routing protocol. |
ISPA和ISPBconnected together by a high-speed link,两个ISPWant to advertise their routes to each other.
Why not use between regionsRIP协议?
ISPA和ISPBThe border routing device must have a synchronization process,也就是说当R1和R2在建立邻居的时候,You need to transmit your entire routing table to the other party.而传统的RIP协议是使用UDPas its own transport protocol,The biggest disadvantage of this protocol is that it is unreliable,Not suitable for transferring large amounts of data.
缺省情况下,RIPThe sending interval of the routing update message of the protocol is30秒,这样如果ISPA和ISPBThe routing table is very large(达到100000条),30Second time interval did not enough complete routing announcement,It completely for the high-speed linkRIP通告服务,No other data can be forwarded.
Inter-regional problem solving ideas
路由传递,loss of some routing data,The main cause of the problem isRIPThe basis used isUDP,UDPcharacteristics are unreliable.那如果采用TCP,TCPis characterized by reliability.This solves the problem of routing data loss.
其次,由于RIP每隔30The routing table will be synchronized every second,In the case that the number of routes is relatively small before,still manageable.Now face the routing table of this magnitude,inevitably unsustainable.这个问题也好解决,then cancel every30The mechanism of full synchronization routing in seconds,Change to incremental notification rule:If the routing does not change,no notice will be issued;If the route is added,Then advertise the route added to the other party;If the route is deleted,Then advertise the route deleted to the other party;If it is routing modification,then first advertise a route deletion,Advertise another route to add.
这就是BGP协议的由来.在RIPOptimize and improve the protocol.
那么采用TCP是怎么设计的?
TCP面向连接,基于TCPThe protocol must have a process of establishing a connection first.要先建立连接,Devices at both ends must first know each other'sIP地址,and the route is reachable.Then it is statically configured,Or whether the dynamic connection is established?BGPWith the method of the static configuration,As long as the two sides routing can be up to the address specified,就可以建立连接.这样做有以下好处:Can use anyIP地址建立邻居,not limited to a fixed interfaceIP.这样,We can use the loopback address instead of the direct interface address to establishBGP邻居,If the main link between the two devices is interrupted,As long as there is a backup link,You can switch traffic to the backup link,keep neighbors constant,增加了BGP连接的稳定性.Neighborhood can be established across multiple devices.Because of the static configuration,Not necessarily only directly connected devices can be establishedBGP邻居,As long as the two sides routing can be up to the address specified(通过IGP或者静态路由),就可以建立邻居,这在AS内部建立IBGP连接时,It is not necessary to establish between all devicesIBGP连接.IBGPwill be mentioned later in this issue.
知道对方IP地址后,BGP会通过发送openmessage to establish neighbors.如果连接不能建立,Indicates that the state of the peer device is abnormal.,So it will wait for a while before establishing the connection.,这个过程一直重复,直到建立连接.
连接建立后,Routing table can be synchronized,BGP通过发送updateSynchronize the routing table for packets.
After routing table synchronization is complete,Not dismantle the connection immediately,Because there may be routing updates or deletions at any time,建立TCPConnecting is a very resource-intensive process,所以BGP通过定期发送keepalive报文进行TCPconnection maintenance,This way you don't have to re-establish the connection,Routing updates are available immediately.
如果经过一段时间(一般是3个keepalive报文发送周期)haven't receivedkeepalive报文时,We think there is a problem with each other,So it can be removedTCP连接,And removes all the routing in received from each other.
举例说明
这是一个典型的BGP应用组网.图中,有3个AS,AS之间运行BGP协议. AS65008run within the domainOSPF协议.R1和R5上只运行BGP协议,R2和R4上运行OSPF和BGP协议,R3上只运行OSPF协议.这里先解释下EBGP和IBGP.
EBGP:运行于ASbetween the two devicesBGP关系.如图中R1和R2、R4和R5
IBGP:运行于AStwo devices insideBGP关系.如图中R2和R4
ASnot insideIGP么,Why buildIBGP关系?
这是因为如果R2和R4之间不建立BGP关系,那么如果R1to pass the route toR5,经过AS65008时,就只能把BGP路由引入到IGP中,通过IGP进行传递.And put the number by10万计的BGP路由引入到IGPthe consequences are catastrophic.所以上图中,R2和R4之间建立了IBGP的关系.值得一提的是,As mentioned above,由于BGPIs established by means of static configurationTCP连接,So it is not only possible to establish on two directly connected devicesBGP关系,如上图,R2和R4间通过OSPF路由可达,可以建立IBGP关系.
如果R2和R4之间不建立IBGP会怎么样?答案是:packets cannot be delivered toR4、R5.
这里,We analyze the routing transfer process and the data packet transfer process separately..
routing process
R1―R2:Since the two devices are directly connected,并且建立EBGP关系,R1可以直接发送update报文至R2.
R2―R4:Two routing is not directly connected,But two routes are establishedIBGP关系,R2将update报文发送给R4.即该update报文的目的IP是R4,于是R2查询自己的路由表,Since the domain is runningOSPF协议,通过OSPF,R2queryR4的下一跳是R3,于是将该update报文发给R3,R3收到该报文后,Although there is no runningBGP协议,But according to the purpose of the messageIP,将该update报文发送给R4.
R4―R5:同样,Direct connection between two devices,并且建立EBGP关系,R4可以直接发送update报文至R5.
这样,Routing transfer is completed.
数据包的传递过程
R5―R4:R5发送的数据包,源IP是R5,目的IP是R1,于是R5查询路由表,因为从R4收到一条R1的路由,The next-hop logo for chainR4.于是将数据包发送给R4.
R4―R2:当R4收到从R5When sending packets,the source of the packetIP是R5,目的IP是R1.于是,R4查询路由表,发现去往R1的路由下一跳是R2(我们假定R2上配置了peer next-hop-local命令),Because the next hop is not directly connected,于是R4查询去R2的下一跳.Since the domain is runningOSPF,R4发现,去R2的下一跳是R3,So the packet was sent toR3.当R3When the packet is received,Due to the purpose of the packetIP是R1的IP,但是R3并没有运行BGP,所以R3上没有R1的路由.于是R3将该数据包丢弃.
This is what is often referred to as the data level.“路由黑洞”.
peer next-hop-local命令一般在ASBR(Autonomous System Boundary Router)上配置. 当设备通过EBGPNeighbors learn the route and forward it to othersIBGP邻居时,The next hop is not modified by default,但其EBGPThe next hop of the route sent by the neighbor is itsEBGP邻居的Peer地址,The local peer belongs toAS域内的IBGPAfter the neighbor receives such a route,Due to the next-hop unreachable routing cannot be active. 因此,需要在ASBR上对IBGP邻居配置peer next-hop-local命令,to send toIBGPThe next hop of the neighbor's route is its own address,IBGPAfter the neighbor receives such a route(Because of the domain are configuredIGP)find next hop reachable,A route is an active route.
Several methods to solve routing black hole
1:根据BGPThe synchronization mechanism willBGP路由引入到IGP中.(SSeries switches are not enabled by defaultBGP同步机制,但可以通过命令synchronization命令启用),The disadvantages of this scheme have been explained above.
2:Physically fully connected:以上图为例,如果AS65008All three devices are connected by physical lines,则R4packets can be sent directly toR2,而不需要通过R3转发.The disadvantage of this scheme is that the laying of physical lines is very troublesome.
3:All logical connection:以上图为例,如果AS65008All three devices are enabledBGP进程,and build two by twoIBGP连接,则R3上也有R1的路由.data can be successfully forwarded.The disadvantage of this scheme is that if the number of devices is very large,大量IBGPconnections are difficult to manage.
边栏推荐
- List-based queuing and calling system
- Application scenarios of js anti-shake function and function throttling
- 斯皮尔曼相关系数
- 带你认识40G单纤双向光模块-QSFP+ BiDi光模块
- Spearman's correlation coefficient
- Facebook's automated data analysis solution saves worry and effort in advertising
- Facebook自动化数据分析方案,广告投放省心省力
- 软件测试X模型
- DVWA 通关记录 2 - 命令注入 Command Injection
- Rust 从入门到精通03-helloworld
猜你喜欢
21年毕业转行软件测试,从0收入到月薪过万,我真的很幸运...
你好,我的新名字叫“铜锁/Tongsuo”
瑞萨RZ/G2L处理器详细测评
Weak yen turns game consoles into "financial products" in Japan: scalpers make big profits
Shell script realizes multi-select DNS simultaneous batch resolution of domain name IP addresses (new update)
阿里CTO程立:阿里巴巴开源的历程、理念和实践
全新荣威RX5,27寸大屏吸引人,安全、舒适一个不落
MySql tens of millions of paging optimization, fast insertion method of tens of millions of data
QT专题:组合会话框和文本编辑器
李航《统计学习方法》笔记之k近邻法
随机推荐
The heavyweights are coming!Spoilers for the highlights of the Alibaba Cloud Life Science and Intelligent Computing Summit
LayaBox---TypeScript---声明合并
Spearman's correlation coefficient
日元疲软令游戏机在日本变身“理财产品”:黄牛大赚
R language ggplot2 visualization: use the ggtexttable function of the ggpubr package to visualize tabular data (directly draw tabular graphs or add tabular data to images), use tbody_add_border to add
【OpenCV】-霍夫变换
iNFTnews | Seeing the two sides of the metaverse, what is the true Internet and the Internet of value?
QT专题:事件机制event基础篇
LayaBox---TypeScript---Mixins
身为程序猿——谷歌浏览器的这些骚操作你真的废吗!【熬夜整理&建议收藏】[通俗易懂]
c#反射和特性
R语言ggplot2可视化:使用ggpubr包的ggtexttable函数可视化表格数据(直接绘制表格图或者在图像中添加表格数据)、使用tbody_add_border为表格中的表头添加外侧框线
Using the TCP protocol, will there be no packet loss?
Facebook's automated data analysis solution saves worry and effort in advertising
R language ggplot2 visualization: use the ggbarplot function of the ggpubr package to visualize the horizontal column chart (bar chart), use the orientation parameter to set the column chart to be tra
Facebook自动化数据分析方案,广告投放省心省力
软件测试X模型
HikariCP database connection pool, too fast!
行为型模式-策略模式
牛客网项目17节生成验证码 刷新验证码一直没反应