Border Gateway Protocol (BGP)

The child of EGP is the Border Gateway Protocol (BGP-4). This protocol has been through a number of versions, and the most current is BGP-4. All references to BGP in this chapter are to this fourth version. One of the primary issues that BGP-4 adds to the mix is that EGP was unable to handle some of IP version 6’s capabilities, which are covered in depth in Chapter 4, “IPv4 and IPv6 Addressing.”

BGP is another case in which you tell the AS border router who its neighbors are, and it has to get the information itself. In the BGP Active state, the AS border router opens a TCP connection with the new neighbor. After this connection is established, your machine does the following:

  • Sets the ConnectRetry timer to zero. This timer typically counts from zero to 120 seconds. If it reaches this value, the AS border router assumes its TCP connection was lost and tries to reassert it.

  • Creates the framework within which BGP will store information about this new neighbor. This framework includes creating all of the variables that need to be set.

  • Sets the Hold Timer to four minutes. This timer sets how long the system waits between regularly exchanged messages before closing the connection with its neighbor.

After this, a sequence of messages passes between the two machines. First, your machine sends an OPEN message to the neighbor. This message contains:

  • The BGP version number. We’re talking about BGP-4 here.

  • The sender’s AS number. As mentioned earlier, every autonomous system has a unique identification number assigned by a central authority.

  • The setting to use for the Hold Timer. If the two AS border routers have different settings, they agree upon the shorter time span of the two. If the Hold Timer value already set does not match the new choice, it is reset to match.

  • The IP address of the sender. This also is referred to as the BGP Identifier.

When the neighbor receives this message, it stores the information given and returns a KEEPALIVE message back to your machine.When the KEEPALIVE message arrives, the Hold Timer is reset back to zero. From then on, KEEPALIVE messages pass back and forth at a rate of around one-third the length of the maximum Hold Timer time. It is the absence of these messages for the entire Hold Timer length that tells a machine that its neighbor is unavailable.

Finally, your AS border router changes to the OpenSent state relative to this neighbor. Here is where the machine waits for an OPEN message. It needs to receive one of these from its neighbor even though they have a connection because it’s the only way to get the basic information about this neighbor. After the message arrives, the BGP AS border router ensures that the values it might already have for this neighbor are the same as given in the OPEN message. If not, they are updated.

After this is complete, the machine transitions to the OpenConfirm state. It remains there until it receives a KEEPALIVE message from the neighbor.After this arrives, the router now changes to the Established state. BGP AS border routers in this state regularly exchange UPDATE messages. These messages contain different information depending on their purpose. For example, an UPDATE message advertising a new route contains:

  • The ORIGIN Type code. This code tells BGP whether the route it’s dealing with is inside the AS that the UPDATE message came from or from outside of it. AS border routers do share information about paths outside of their control as well as internal paths.

  • The AS_PATH segment type. This code specifies whether the list of autonomous systems the new route information passed through to get to this AS border router is in a specific order or unordered.

  • The ASs that this route information passed through. The ordered or unordered list of AS numbers.

  • The IP address for the AS border router this one must send data to get packets to the specified new route. This is called also the Next Hop attribute.

  • The number of bits in the following IP address portion. Because routing is done for networks and subnetworks, not individual IP addresses, the information sent between AS border routers is a collection of IP address prefixes or the portion of the address that identifies the network or subnetwork in question.

  • The IP prefix that identifies the network or subnetwork to which this route applies. This prefix has to end at one of the dots in the IP address. If the definition applies to 192.14.14.51, and it’s a full unsubnetted class C network, the entry would be 192.14.14.

There can be only one new route per UPDATE message. However, BGP can withdraw as many existing routes as it likes in the same UPDATE message. Each of these route withdrawals includes all or part of the following information:

  • The total length of the withdrawn routes section. This item ensures that there is no confusion from section to section, given that withdrawn routes can be any length. A zero means that there are no routes to remove.

  • The number of bits in the IP address portions. Once again, the information sent between AS border routers is a collection of IP address prefixes, or the portion of the address that identifies the network or subnetwork in question.

  • The IP prefix that identifies the network or subnetwork to which this route applies. Again, the prefix has to end at one of the dots in the IP address.

  • The total length of the Path Attributes section. Once again, including this information avoids misread data.

How does the BGP AS border router decide about which routes to notify its neighbors? Each of these machines has a Policy Information Base (PIB) containing rules that the administrator sets by hand. Each machine also has a set of separate databases, each with a specific function. All of the routes this router is aware of are listed in its AdjRIB-In database. Routing Information Base (RIB) is another term for the routing table.The BGP AS border router takes its PIB and applies the rules to every route in Adj-RIB-In. Anything that fits the rules is copied to the Adj-RIB-Out database.

One piece of data calculated using the PIB rules is the preference rating for each particular route. After this information is put together, the BGP AS border router looks at each destination it has routing information for and chooses the best route to each according to its PIB rules and preference ratings. The best routes are all stored in the Loc-RIB database.

There is still one more chunk of processing to do. Keep in mind that these databases are maintained from moment to moment. Each time new information goes into Adj-RIB-In or Loc-RIB, there’s a trickle-down effect. Adj-RIB-Out relies on both of these databases and so must change whenever one or both of them does. Adj-RIBOut is trimmed further than Loc-RIB in some BGP implementations. Duplicate routes are removed from this version of the database so that there is only one way for data to get from point A to B. This ensures that the databases don’t get too large or redundant.Whenever there is a change to Adj-RIB-Out, that change is sent as an UPDATE message to the BGP neighbors.

Perhaps now you have an idea of why BGP is preferred over EGP in many situations. It is simply a smarter protocol with more internal checks and balances for route tuning.The programs under Linux that implement this protocol are zebra and the unicast version of gated. Once again, BGP is a unicast border protocol.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset