Early entry BGP protocol

1. What is the bgp?

    BGP is called: Border Gateway Protocol, mainly for transmitting the selected route. BGP uses TCP as the transport layer protocol (port number: 179), since the use of TCP connections, so the reliability of the network has been a huge guarantee.

2. Once you have IGP, BGP why need it?

    First, we use the enterprise network as IGP, such as: ISIS, ospf, RIP, is to advertise reachability protocol network, than with BGP, but their shortcomings are obvious.

  (1) IGP suited for small networks, and for large BGP network (e.g., network operator);

  (2) IGP mainly used for: calculating and find routes, the primary control and BGP route selection;

  (3) BGP can be directly connected between the non-working neighbors and use the TCP protocol as a transport medium to improve the stability of its network;

3, establish BGP neighbor relations

     BGP neighbor relationship is divided into two kinds: IBGP and EBGP.

  (1) IBGP: BGP work in the same AS.

  (2) EBGP: BGP operate between different AS.

     So what is the AS number, IBGP relationship, EBGP with it? FIG from the analysis:




   Seen by the figure, the AS number Autonomous systems (AS), the yellow and the red line drawing respectively represent two different the AS, the relationship between R1 and R2 of AS200 and AS100 is from the EBGP, and in AS200, 3 relationship router for IBGP.

 4, BGP state machines and packets

  BGP state machine a total of 6: idle, connect, active, opensent, openconfirm, established.

       Packet total of five kinds: open, update, keepalive, notification, refresh.

BGP packet types
open message For establishing a BGP connection
update packets For advertising routes
keepalive报文 For holding the BGP connection
notification messages Used to treat a variety of errors BGP process
refresh messages BGP dynamic routing of requests for the publisher to republish UPDATE packet routing updates.




5, BGP interaction principles

 (1) EBGP peer routing received from and sent out to all BGP routers.

 (2) routing IBGP peers received from EBGP will be sent to all routers.

 (3) BGP device sends the optimal route.

 (4) routing updates, only send routing updates.


6, BGP path attributes




Compliance will be accepted (All routers must recognize this property, and must be included with the update message): origin, as-path, next-hop.

Accepted any (all routers must recognize this property, there is a need to update based on the packet): local-preference, atomic-aggregate.

Optional excessive (all routers do not need to recognize this attribute, but this attribute router can forward packets): aggregator, community.

Optional non-excessive (all routers do not need to recognize this property, and the property routers do not need to forward this message): med.


7, BGP routing principles

(1) If the next hop is unreachable, it discards the route
(2) Preferred-Valnue higher the numerical value of the priority, Huawei private property, only locally significant
(3) Local-Preference value of the route with the highest priority
(4 ) aggregation routing preference to route non-polymeric (manual aggregation> Auto polymerization> Network> learning from the peer to). Understood as:> Neighbor
(5) Local manual polymerisation route priority than the local routing automatic aggregation
(6) introduced by the local Network command routing priority than the route through the local Import-route incoming command
(7) the length of the shortest AS path path First
(8) Origin attribute comparison, IGP than EGP, EGP superior in Incomplete state
(. 9) to select a smaller MED routing
(10) EBGP IBGP route than the route
(11) BGP priority selecting a next hop to the lowest path metric IGP BGP
when all of the above the same, for the equal-cost routes, load balancing can be (note: AS_Path must be consistent, when load balancing, the following three principles inactive)
(12) Comparative Cluster_list length, shorter priority
(13) comparing the Originator_ID (if not the Originator_ID, the comparative Router_ID), selecting a small value path.
IP address (14) comparing the peer, the IP address of the path selecting a minimum value.


Guess you like

Origin www.cnblogs.com/jyb0824/p/11534201.html