You challenge with an annual salary of 20W WAN protocol --- BGP protocol

An overview of the principles of BGP

BGP protocol is a distance vector (Distance vector) routing protocol, but compared to a typical distance vector protocols such as RIP, there are many enhanced performance. BGP uses TCP as the transport protocol, using port 179. In the communication, first establishing the TCP session, such reliability of data transmission can be guaranteed by TCP protocol, while the BGP protocol will not need to use the error control and retransmission mechanisms, and thus simplify the degree of complexity. Further, the use of the BGP increment triggered routing update, the routing table is generally not the entire distance vector protocol, periodic update, which saves bandwidth occupied update. BGP also use the "reserved" connection signal (the Keepalive) to monitor TCP session. Moreover, BGP as well as a variety of metrics to measure routing paths (called a routing attributes), we can more accurately determine the optimal path.
BGP uses TCP as its bearer protocol to establish a connection. Therefore, the IGP-by-hop router to create different neighbors, BGP across multi-hop router establishes neighbor relations.
You challenge with an annual salary of 20W WAN protocol --- BGP protocol

Comparative BGP and IGP protocol

Classification agreement

IGP (Interior gateway protocols) - Interior Gateway Protocol, defined as the routing protocol used within an autonomous system (including static and dynamic routing protocol routes). IGP routing function is completed within an AS packet, or that is about how the packet through the AS. RIPv1 & v2, OSPF, ISIS are typical IGP.
EGP (Exterior gateway protocols) - Exterior Gateway Protocol, defined as the routing protocol between a plurality of autonomous systems. It is mainly the packet routing in the inter-AS, or that about the IP packet to reach the destination, which requires AS through. BGP is a kind of EGP.
AS Number 2 bytes in length, i.e. 1-65535. 1-64511 which is public AS, 64512-65534 private AS. After January 2009, IANA decided to use a 4-byte AS, the range 65536-4294967295

Scenarios

IGP to act only on the local internal AS, AS and other ignorant. It is responsible for the data packet sent to the network segment where the host (segment)

EGP acting between the AS, the AS only understand the overall structure, and do not understand the topology of the respective inside each AS. It is only responsible for the data packet is sent to the appropriate AS, the remaining work will be done to the IGP.

BGP packet type of comprehensive analysis

1, open the message: and responsible peer neighbor relationship
2, update messages: are used between peer routing information is transmitted (including routes reachable or not reachable routes)
. 3, the Notification message: detected errors, the message is sent to the peer
4, Keepalive packets: periodically sent every 60 seconds to maintain the TCP / IP connection
5, route-refresh packet: indicates the route refreshment capability
You challenge with an annual salary of 20W WAN protocol --- BGP protocol

BGP message types

You challenge with an annual salary of 20W WAN protocol --- BGP protocol

Open messages

You challenge with an annual salary of 20W WAN protocol --- BGP protocol
Inside the more important field
version v4 version of
My AS on behalf of my AS number of the device's
router id BGP representatives of the device's router id
the Hold Time from the beginning of time has been increased to 0 180s, the minimum can be 0, BGP connection in this case is considered to always be up, between peer
does not send keepalive packets to detect whether the neighbor is
optional fields and variable length fields

Keepalive报文

You challenge with an annual salary of 20W WAN protocol --- BGP protocol
By default, KeepAlive transmission time interval is 60 seconds, Hold Time 180 seconds. Each time it receives from the neighbors to KeepAlive packets will be reset Hold Time timer, if the Hold Time timer expires, it is considered a peer is Down.

KeepAlive messages mainly used for confirmation of the availability and operating state of the link between the peer routers. KeepAlive message only consists of a BGP header data.

Update packets

You challenge with an annual salary of 20W WAN protocol --- BGP protocol
前面两部分表示路由撤销信息,后面三部分表示路由可达信息
路由可达信息携带各种属性
但是路由撤销信息就不需要携带各种属性了,因为这时候是撤销了

Notification报文

You challenge with an annual salary of 20W WAN protocol --- BGP protocol
Notification报文主要在发生错误或对等体连接被关闭的情况下使用,该消息携带各种错误码(如定时器超时等),以及错误子码和错误信息。
You challenge with an annual salary of 20W WAN protocol --- BGP protocol

Route-refresh报文

You challenge with an annual salary of 20W WAN protocol --- BGP protocol
可以在不中断BGP连接的情况下,对BGP路由表进行动态刷新,并应用新的路由策略

BGP协议当中IBGP邻居关系建立

运行在相同AS内的BGP路由器建立的邻居关系为IBGP(Internal BGP)邻居关系
You challenge with an annual salary of 20W WAN protocol --- BGP protocol

RTB的配置

bgp 345
 router-id 1.1.1.1
 peer 2.2.2.2 as-number 345 
 peer 2.2.2.2 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization        ###默认配置
  peer 2.2.2.2 enable            ###默认生成

RTC的配置

bgp 345
 router-id 2.2.2.2
 peer 1.1.1.1 as-number 345 
 peer 1.1.1.1 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization
  peer 1.1.1.1 enable      ###默认生成

注意点:

IBGP的关系 一般建议用loopback建立
loopback比较稳定
可以实现冗余备份

BGP协议当中EBGP邻居关系建立

运行在不同AS之间的BGP路由器建立的邻居关系为EBGP(External BGP)邻居关系
You challenge with an annual salary of 20W WAN protocol --- BGP protocol

RTB的配置

bgp 345
 router-id 1.1.1.1
 peer 12.1.1.2 as-number 200 
 #
 ipv4-family unicast
  undo synchronization
  peer 12.1.1.2 enable   ###默认生成
#

RTD的配置

#
bgp 200
 peer 12.1.1.1 as-number 345 
 #
 ipv4-family unicast
  undo synchronization
  peer 12.1.1.1 enable    ###默认生成
#

注意点:

一般建立ebgp关系的时候 建议大家用物理接口建立 如果用loopback的话 需要修改ttl的数值
peer 1.1.1.1 ebgp-max-hop 2
默认情况下建立ebgp的时候,我们发送数据包的TTL值为1

BGP协议的状态机的详细概述

You challenge with an annual salary of 20W WAN protocol --- BGP protocol
Idle:空闲状态,BGP系统发出start事件(就是管理员配置BGP的过程),BGP初始化资源,复位连接计时器(32s),发起TCP连接,同时转入Connect状态
 
Connect:在此状态,BGP发起第一个TCP连接,如果TCP连接成功,就转入OpenSent状态,如果TCP连接失败,就转入Active状态。(TCP连接失败两种情况:1.收到TCP参数协商失败的回复,则进入Active状态,2.对方长时间没有回复,超时,则保持在Connect状态
 
Active:BGP总是在试图建立TCP连接,如果连接计时器超时,就退回到Connect状态,如果TCP连接成功,就转入OpenSent状态,如果TCP连接失败,就继续保持在Active状态,并继续发起TCP连接。
 
OpenSent:BGP也已经发送了第一个Open报文,BGP就在等待其对等体发送Open报文。并对收到的Open报文进行正确性检查,如果有错误,系统就会发送一条出错通知消息并退回到Idle状态,如果没有错误,BGP就开始发送Keepalive报文,并复位Keepalive计时器(180s),开始计时。同时转入OpenConfirm状态。
 
OpenConfirm:BGP等待一个Keepalive报文,如果收到了一个Keepalive报文,就转入Established阶段

Established:BGP对等体交换update、keepalive、route-refresh报文

以后会周期性发送keepalive报文(60s)

如果收到notification报文或者收到TCP拆除链接通知,BGP转至idle状态

BGP的路由生成方式network

Network命令是逐条将IP路由表中已经存在的路由引入到BGP路由表中
You challenge with an annual salary of 20W WAN protocol --- BGP protocol
通过display命令在RTC上查看是否学到BGP发布的路由条目
You challenge with an annual salary of 20W WAN protocol --- BGP protocol

BGP route generation mode import

The Import command is run routing protocols (RIP, OSPF, ISIS etc.) routes to the BGP routing table, and may also be introduced directly import command and static routes
You challenge with an annual salary of 20W WAN protocol --- BGP protocol
display commands to check whether learned BGP on routing RTC entry
You challenge with an annual salary of 20W WAN protocol --- BGP protocol

Guess you like

Origin blog.51cto.com/13817711/2455057