BGP is a dynamic routing Discovery protocol between autonomous systems, and its basic function is to automatically exchange loop-free routing information between autonomous systems. As with OSPF and RIP protocols that operate within autonomous zones, BGP is a class of EGP (Edge Gateway Protocol) protocol, while OSPF and protocol.
BGP was developed on the basis of the application of EGP. In the past, EGP has been used as a routing discovery protocol among autonomous regions and has been widely applied to backbone networks such as nfsnet. However, EGP is plagued by routing loop problems. BGP constructs the topology map of autonomous region by increasing the properties of the Autonomous Region (as) path in the routing information, thereby eliminating routing loops and implementing user-configured policies. At the same time, with the rapid development of Internet, the volume of routing table is increasing rapidly, and the exchange of routing information between autonomous regions is more and more large, which affects the performance of the network. BGP supports no type of interregional routing CIDR (classless interdomain Routing), which can effectively reduce the increasing routing table.
The BGP runtime is connected (using a socket) with the BGP partners outside the autonomous region and in the area respectively. Connections to partners in the region are called IBGP (Internal BGP) connections, and connections to BGP partners outside the autonomous region are called EBGP (External BGP) connections. The local BGP protocol uses different mechanisms for IBGP and EBGP partners.
1, the level of BGP protocol position
BGP uses the socket service to establish a connection with a port number of 179.
2. BGP message structure
BGP has 4 kinds of messages. respectively, Open,update,keepalive and notify. They have the same message header.
⑴ Message Header structure:
Marker: (16 bytes) authentication information
Length: (2 bytes) message lengths
Type: (1 bytes) Types of messages
0:open
1:update
2:notification
3:keepalive
⑵open Message structure:
The message header is structured as follows:
Version: (1 bytes) The originator of the BGP edition number
My autonomous System: (2-byte unsigned integer) local as number
Hold Time: (2-byte unsigned integer) originator recommended retention times
BGP Identifier: (4 bytes) Router identifier of the originator
Optparmlen: (1 bytes) The length of an optional parameter
Optional Parameters: (variable length) optional parameters