Quickly understand BGP basics

1. Introduction to BGP

BGP: Border Gateway Routing Protocol

Belongs to the classless path vector protocol ; the most popular technology in the EGP protocol, working between ASs;

EGP: Exterior Gateway Routing Protocol —BGP

IGP: Interior Gateway Routing Protocol —RIP OSPF EIGRP

IGP protocol pursuit

1. No loop (good path selection) 2. Fast convergence 3. Less resources occupied

The pursuit of EGP protocol

1: High controllability (administrators can easily carry out policy intervention in route selection)

2. High reliability (BGP protocol devices need to exchange a large number of routing entries, but they cannot choose periodic updates to occupy link resources, so they can only perform triggered updates; and in order to save costs in the BGP protocol working environment, indirect routing will inevitably occur. Connections need to establish neighbor relationships - unicast neighbors) --- Work based on TCP - three-way handshake and four disconnections 4 reliable transmission mechanisms - TCP can only work based on unicast

Unicast - requires IP reachability - relies on IGP, BGP is carried on IGP   

3. AS-BY-AS uses one AS as one hop;

AS—autonomous system global network—scope, administrative domain   

AS number – standard 16-bit binary composition 0-65535, of which 1-64511 are public and 64512-65535 are private

        Extended 32-bit binary configuration

The BGP protocol itself does not generate routes, but forwards routing entries generated by other protocols in the local routing table;

There are normally a large number of BGP neighbor relationships between ASs, and the BGP protocol does not calculate the best path; therefore, the administrator needs to implement policies to interfere with route selection in the BGP protocol;

2. BGP characteristics

1) Classless path vector is an upgraded version of distance vector---AS--BY--AS

2) Use unicast updates to send all information; works based on TCP port 179

3) Incremental update--only triggers no cycle

4) It has rich attributes to replace the metrics in IGP for route selection, and multiple parameters control the protocol.

5) Powerful strategies can be implemented on the flow of input and output items - controllability

6) Not used for load balancing by default - only one best path is generated through various routing rules

7) BGP supports authentication and aggregation (aggregation)

3. BGP data packet   

 It works based on TCP port 179; therefore, all data packets in the BGP protocol need to be transmitted and reliability guaranteed based on the TCP session after the TCP session is established;

First, find neighbors through TCP's three-way handshake;

Open Neighborhood is only responsible for the establishment of neighbor relationships. It can be sent and received normally once; it carries route-id;

Keeplive keeps alive. Check whether the neighbor relationship exists every 1 minute; actually keep the TCP session alive; the hold time defaults to 3 minutes.

Update carries routing entries, target network number + various attributes

Notification sends     and receives error data when error occurs;

4. The working process of BGP

1. After the configuration is completed, unicast TCP three-way handshake between neighbors, target port 179, establishes a TCP session; all subsequent BGP protocol packets are transmitted based on this session;

After the session is established, the neighbors normally send and receive an open message to establish the BGP neighbor relationship and generate a neighbor table ;

The open message of the BGP protocol will carry the local RID—the generation method is the same as OSPF; it only needs to be unique for the local and all local neighbors;

After the neighbor relationship is established, the keeplive cycle is used to keep the neighbor relationship alive every 1 minute by default (cycle keepalive TCP session)

2. After the neighbor relationship is established, the administrator selectively announces routing entries obtained from any source in the local routing table to the BGP protocol; uses updata packets to share routes between neighbors; and then generates a B GP table ; --- Load all routing entries sent and received locally;

The optimal path is loaded into the routing table by default (optimal - only based on BGP routing rules, not necessarily the best path; BGP does not support load balancing by default)

3. Convergence is completed and only the keeplive cycle is required;

4. If an error message occurs, neighbors will use Notification messages to report the error.

5. Structural mutation

1) Newly added  --- Use updata locally to notify all local neighbors, provided that the route is not included in the aggregate route that has been sent out

2) Disconnect  --- Use updata locally to notify all local neighbors, provided that the route is not included in the aggregate route that has been sent out

             Neighbors are not notified to delete an aggregation entry until all detailed routes contained in the aggregation entry are locally invalid.

3) Unable to communicate --- the hold time is 3 minutes, and the neighbor's keeplive is not received for 3 consecutive times; the neighbor relationship and TCP session are disconnected , and all routes learned from the neighbor are deleted; 

5. Explanation of terms

Neighbors --- Directly connected Because there is a requirement for non-directly connected neighbors in the BGP protocol, BGP neighbors are called adjacency relationships;

EBGP neighbor relationship----external BGP neighbor relationship, the two devices establishing neighbor relationships are in different ASs

IBGP neighbor relationship ---- Internal BGP neighbor relationship, the two devices establishing neighbor relationships are in the same AS

Guess you like

Origin blog.csdn.net/2301_77475090/article/details/132000825