5.4 BGP: the Border Gateway Protocol

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] in this section we're going to study bgp the border gateway routing protocol bgp is the de facto inter-domain routing protocol that's used in the internet today for this reason sometimes referred to as the glue that binds together the internet the network of networks together now when we studied ospf we saw that ospf was a fairly straightforward implementation of dijkstra's link state routing algorithm bgp has its origins in the distance vector algorithm but in addition to studying how bgp is implemented and how it operates we're also going to spend a good deal of time looking at how bgp allows network operators to implement routing policy to control how packets that are routed to and from networks customers networks is actually controlled and how a network handles transit traffic we'll see that bgp is much is as much about policy as it is about performance and so i think you're going to find this pretty interesting well let's begin with an overview of bgp basics and bgp is a really important protocol it's really right up there with ip it's arguably one of the two most important internet protocols now as we'll see bgp has its origins in the distance vector protocol it's distributed and it's asynchronous but as we've mentioned bgp ism is as much about policy as it is about computing lease cost paths from sources to destinations bgp allows a network to advertise its existence to the rest of the internet as well as the paths that it has to these destination networks it allows a bgp router to say hey here i am and here's who i can reach and in particular here's the paths that i have to these destinations that i can reach well let's unpack this statement a little bit what this means is that on the receiving side bgp provides each autonomous system with the means to obtain destination network reachability information from its neighbors router can then determine whether or not to actually use these paths based on policy for example a policy might be not to use a path that passes through a given isp or through a given country bgp also provides each autonomous system with the means to propagate reachability information to routers within its own network this communication with routers inside of an autonomous system is done through the ibgp protocol and finally there's a very subtle but also very powerful policy issue of what destination reachability information that an autonomous system wants to pass on to its neighbors if i'm an autonomous system and say i know i can reach destination x do i really want to tell my neighboring networks that i can reach destination x if so they might try to route packets through me to get to x and maybe i don't want that to happen so you can see a policy aspect to which paths an autonomous system advertises as well as which paths it chooses to use this figure shows the two flavors of bgp ebgp runs between two routers that are in different autonomous systems ibgp runs between two routers that are within the same autonomous system and as we see here gateway routers run both ebgp and ibgp so let's take a look at two bgp routers sometimes called bgp piers or bgp speakers that are interacting with each other bgp peers exchange bgp messages over semi-permanent tcp connections using port 179 they advertise paths to different destination network prefixes for example to slash 24 16 networks for this reason because bgp advertised paths bgp sometimes known as a path vector protocol in this example here when network x attaches to as3 as3 now knows it can reach x and so as3 gateway 3a here advertises the path as3 comma x to as2 gateway 2c and in this way as2 learns about the reachability of x through as3 and it's important to note that when as3 advertises a path to x as3 is essentially promising to as2 that it is both able and willing to forward datagrams towards x let's wrap up our discussion of bgp basics by listing the bgp messages that are used by the bgp protocol there's an open and a notification message that are used to open and close a bgp session there's a keep a live message for when not much is happening and then there's the all important update message this is the message that's used to advertise a path or withdraw a previously advertised path you can read all about the bgp messages in rfc 4271 okay so that's it for the basics of bgp next we're going to dive down deeper into some of the details of bgp in particular we're going to look at the notion of paths path advertisement and how path advertisements can be used to control routing policy well let's begin our study of path advertisement by looking at the path advertisement itself when a bgpe router advertises a path it advertises two things first of all it advertises the destination for that path the siterized address slash 24 16 address of the destination where that path is going to terminate and the second thing that's advertised is a set of attributes associated with that path the most important attribute of that path is the a.s path attribute the aspan attribute enumerates the entire list of autonomous systems that would be passed through in routing from the current network to that destination network we've said that bgp is a policy-based routing protocol and now we can see exactly what that means first a router receiving a route advertisement uses policy to decide whether or not to use a path that's just been advertised to it for example as we said earlier a policy might be never to accept a path that passes through ispw or passes through country y a router also uses policy to decide whether or not to advertise a particular path to a neighboring autonomous system if i don't advertise a path to a neighbor that neighbor can never send me traffic that uses that path and maybe that's exactly what i want here's an example showing how a path advertisement propagates among and within autonomous systems let's say that based on policy router 3a decides that it will advertise a path to destination x to autonomous system 2 as2 as2 router 2c receives this path advertisement as3 comma x via egp from router 3a based on as2 policy router 2c then accepts the path as3 comma x and propagates this path via ibgp to all of the as2 routers and then based on as2 policy as2 router 2a can then advertise via ebgp path as2 as3 comma x to as1 router 1c and in this manner autonomous system as1 learns about a path 2x via as2 and as3 now it's possible for a bgp router to learn about multiple different paths to the same destination as we see in this example here and in this example as1 gateway router 1c has learned about a lower path to x via as2 and as3 router 1c also learns about another path as3 comma x this upper path here directly from router 3a and in this example based on policy router 1c say chooses the path as3 comma x and advertises this path within as1 via ibgp now let's take a look at how path advertisements can be used to implement routing policy to make it concrete let's assume that policy is the following and isp only wants to forward datagrams that have either a source or a destination in one of its customer isps and this is actually a real world policy why would an isp want to forward traffic that's just passing through that's called transit traffic transit traffic generates no income it's only the isps customer networks that are actually paying for service from this isp so the isp's policy understandably is to only route traffic that has either a source or a destination in one of the customer networks of that isp here's an example let's say that networks a b and c are provider networks and networks x w and y are customer networks since w is a customer of a a is very happy to advertise the path aw to b and c a is saying hey if you want to route to w route through me a really if a didn't advertise this then no traffic would flow to w through a okay fair enough but now let's look at what happens at b does b really want to tell c that there's a path b a w well maybe not w isn't a customer of b and if b tells c that it b has a path to w then c could route traffic to w via b and b has no desire or economic incentive to serve as a transit network for traffic flowing from b to a and as a result b probably wouldn't advertise the route b-a-w to c and consequently c has no idea that a path actually exists to w via b here's another policy-based path advertisement quandary look at network x it's a customer to both networks b and network c that's called being dual home as a customer it's attached to both b and c but it really has no desire to route traffic between b and c even though it could so x doesn't tell b that it has a path to c and doesn't tell c that it has a path to b and as a result x would never carry transit traffic between b and c well i hope you can really appreciate now how policy is such an important consideration in bgp and how an isp can use path advertisement as a mechanism to implement routing policy it was really an eye-opener for me to see how much issues of policy rather than cost really dominated how inter-domain routing is done in the internet now while inter-domain routing and path advertisements determine the paths that packets take we still have to address the issue of how the forwarding tables going to be populated in order to implement the forwarding policies that are consistent with packets taking a given path let's take a look at that next this example shows how paths to destinations outside of an autonomous system are instantiated in a router's forwarding table using ibgp so recall that routers 1a 1b and 1d learn about how to get to x via an ibgp message from node 1c who says hey the path to x goes through me 1c let's now look at router 1d router 1d knows from its ospf interdomain routing that to forward datagrams to 1c it should forward them via interface 1. and so 1d also knows that to forward datagrams to destination x now should also forward these datagrams via interface 1 because that's the interface used to reach 1c and over here at 1a suppose that ospf intradomain routing says that to get to router 1c 1a should forward datagrams using local interface 2 and so 1a knows that to 4 datagrams towards x it should therefore also forward these datagrams via interface 2. the end result is that traffic from 1a destined to x will first be forwarded from 1a to 1d and then forwarded from 1d to 1c and then forwarded from 1c into autonomous system as3 lastly there's a form of bgp intra domain routing known as hot potato routing hot potato routing says that when routing to an external destination forward this packet to the local gateway that's closest to me without worrying about the overall cost of getting to the destination the goal is simply to get this packet out of my network as quickly as possible in this example here 2d will forward a packet destined to x via 2a rather than via 2c of course this myopic decision isn't always the best global decision in this example here there are more as hops involved in routing via 2a than routing via 2c this is called hot potato routing because you're trying to get the packet out of the network with the least cost possible you may remember the game of hot potato when you were a kid you're past a ball and you want to get rid of it as fast as possible so not to be caught holding the ball when the game ends you just want to get rid of the ball potato ah it's lovely it really makes me think that actually playing hot potato might even be more fun than learning about bgp in hot potato routing well that wraps up our discussion of bgp and i hope it has been fun to learn about bgp and bgp hot potato routing and let's wrap up our larger discussion of the practice of inter-domain routing by reflecting on some of the differences between intra domain routing ospf and inter domain routing like bgp what we've seen is that in inter-domain routing policy considerations really dominate an isp wants to have the policy knobs and able to be able to control how it routes traffic to and from its customers networks and how it handles transit traffic another critical consideration in internet routing is that of scalability concerns about minimizing forwarding table size and the amount of routing update traffic we learned that the separation of intra domain and inter domain routing meant that intra-domain routing information didn't propagate outside of an autonomous system and so the rest of the internet never even saw routing information from within any particular domain it's a good thing given the millions of networks that make up the internet in ospf we learned about the use of hierarchical routing to limit the scope of full topological information even within a single autonomous system and we learned here and also when we studied internet addressing in chapter four about how bgp routes deciderized destination networks and how a single siterized network address can actually represent a large number of networks within an address block and let's wrap up by coming back to performance we saw that at the application and the transport layer and even in intra domain routing that performance matters we've said that milliseconds count it's interesting to note though that for inter-domain routing and bgp we've seen that policy considerations clearly dominate over performance and so that wraps up our discussion of the practice of internet routing taking a look at both the ospf and the bgp protocols in particular i hope you found those interesting i know it's a little jarring actually after studying routing algorithms looking at link state algorithms the distance vector algorithm and seeing those actually implemented in intra domain routing like rip and ospf to see that at the inter domain level how policy rather than path cost so dominates the discussion well coming up next we're going to take a step back and we're going to look at general approaches towards implementing a control plane in particular we've seen that both with bgp and with ospf they take a per router approach towards implementing the control plane we're going to take a look at an alternative way to implementing a control plane where the computations themselves of the paths is actually physically removed from the routers themselves may be implemented in a data center that's placed far away from the routers themselves this is an approach that's come to be known as software defined networking so that's coming up next so stay tuned you
Info
Channel: JimKurose
Views: 49,751
Rating: undefined out of 5
Keywords:
Id: 2rV4tJkP-CQ
Channel Id: undefined
Length: 18min 6sec (1086 seconds)
Published: Sat Jan 15 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.