AWS · Advanced Networking Specialty

网络课程笔记

Lecture 096 · 2 张幻灯片

幻灯片、双语总结及 Transcript · 图片已内嵌,可离线阅读。

原文默认收起
lecture-096.md

Lecture 96: How Border Gateway Protocol (BGP) works?

  • 课程:[NEW] AWS Certified Advanced Networking Specialty 2026
  • 视频时长:11:59
  • 来源:Udemy Lecture 26077150
  • Slide 数量:2
  • 画面切换:04:05

扫描说明

逐条检查了 Udemy 页面中的 270 条 Transcript cue,并对全长约 11:59 的视频画面逐段扫描。依据 BGP 基础概念与属性总览、How BGP works 路由传播示例两张独立 Slide,共划分出 2 个小节。

Transcript 来自 Udemy 页面自带的英文自动字幕,没有使用 ASR。下面保留页面原文,包括其中的语法或识别错误。

1. BGP、iBGP、eBGP 与关键属性

时间范围:00:00–04:05

BGP overview slide explaining path vector iBGP eBGP and route attributes

总结 / Summary

中文

边界网关协议(Border Gateway Protocol, BGP)是基于路径向量(path-vector)的动态路由协议,自治系统(Autonomous System, AS)之间通过它交换到达目标前缀的路径。内部 BGP(internal BGP, iBGP)负责同一 AS 内的路由交换,外部 BGP(external BGP, eBGP)负责不同 AS 之间的路由交换。选路可受权重(Weight)、自治系统路径(AS Path, AS_PATH)、本地优先级(Local Preference, LOCAL_PREF)和多出口鉴别器(Multi-Exit Discriminator, MED)影响;其中 Weight 为 Cisco 特有属性,LOCAL_PREF 在 AS 内生效,而 AS_PATH 与 MED 可影响跨 AS 的路径选择。

English

Border Gateway Protocol is a path-vector dynamic routing protocol used to exchange reachability between autonomous systems. Internal BGP exchanges routes within one AS, while external BGP exchanges routes between different ASes. Route selection can be influenced by Weight, AS_PATH, LOCAL_PREF, and MED. Weight is Cisco-specific, LOCAL_PREF operates within an AS, and AS_PATH and MED affect inter-AS path selection.

Transcript

00:00 Hello, and welcome to this lecture,

00:01 Dynamic Routing using Border Gateway Protocol.

00:04 So in the earlier lecture,

00:05 we understood the difference between the static routing

00:08 and the dynamic routing.

00:09 And we understood that in case of static routing,

00:11 you have to modify the route entries in your route table,

00:14 and you have to add the new routes

00:15 that you want to send traffic to manually.

00:19 And we also understood that in dynamic routing,

00:21 these routes are propagated automatically.

00:24 Now in this lecture,

00:25 we are really going to understand how that propagation

00:27 happens and for doing that,

00:29 you need to use a different protocol in this case,

00:32 and that would be a border gateway protocol.

00:34 Now border gateway protocol is a backbone of internet as

00:38 well because you know,

00:39 internet is all mesh off a lot of networks.

00:41 And then all these networks needs to exchange the dynamic

00:45 routes with each other,

00:46 and that's where you can hit any IP address

00:49 and your packet reaches to the destination.

00:51 Now, border gateway protocol is also important

00:54 with respect to your exam.

00:56 And in case of AWS,

00:58 both AWS side to side to VPN, as well as direct connect,

01:02 both support the border gateway protocol.

01:04 So let's understand that.

01:05 And in that case let's get started.

01:08 Okay, so what is border gateway protocol or in short PGP?

01:13 It's a dynamic routing protocol using path-vector.

01:16 Now what that means is,

01:18 in case of border gateway protocol,

01:20 there is something called AS, autonomous systems,

01:23 and we learned about that in the last lecture.

01:25 So any network,

01:26 you can call it as like AS

01:28 and this AS is interchange

01:30 the routing information between each other.

01:32 So in case of BGP, they work on path-vector protocol,

01:36 which means they exchange the best part

01:37 to reach to the destination.

01:40 So if I know the parts of other AS's,

01:43 how to reach them, what is the next stop?

01:45 I will exchange that information with my neighbor BGP,

01:49 and that's where the routes gets exchanged.

01:52 Now, there are two types of the BGP.

01:54 One is iBGP, or you can call it internal BGP.

01:58 So it is like routing within one autonomous system.

02:02 And what we are interested in, in eBGP,

02:05 which is routing between the different AS's

02:08 because we are connecting multiple networks, right?

02:11 And that's where the routing would happen between

02:13 two different AS's.

02:15 So that's called eBGP.

02:17 Now, how is this routing decision is influenced?

02:19 Now what that means is,

02:21 if I want to reach to a destination,

02:24 what parameters I need to consider.

02:26 Can I influence the routing?

02:29 Suppose there are multiple

02:30 routes to reach to the same destination.

02:32 So through BGP can influence that I want to take one route

02:35 or the other.

02:37 Now there are certain parameters or features,

02:40 or you can say attributes using which you can influence this

02:43 routing mechanism.

02:45 So one is called weight.

02:46 So you can define the weight on the different paths,

02:50 and then the routing would be taken to the highest weight,

02:54 but that only works in the Cisco routers.

02:56 And that's where we are not really going too deep into

02:59 this weight attribute.

03:01 But there is something called AS PATH,

03:03 which is like how many hops are there

03:05 to reach to the destination.

03:07 Ultimately that is called ASPATH.

03:09 So ASPATH would contain the number of the hops or which

03:12 AS's I need to cross in order to reach to the destination.

03:16 So we'll see how AS PATH influences that.

03:18 Then there is something called local preference.

03:20 Now this works within the AS.

03:23 And we'll talk more about that.

03:25 So if you have multiple exit points to reach to the target

03:30 destination from your source network,

03:32 then within your source network,

03:34 which router you will choose to go to that destination,

03:36 that is basically a local preference.

03:40 And then there is something called MED,

03:41 Multi Exit Discriminator.

03:43 Now similar situation, like a local path.

03:46 But in this case, the MED value is external.

03:51 That means the values are exchanged

03:53 between the AS's as well.

03:55 And it will be more clear as we see the scenario,

03:59 how it works.

04:00 So let's try to understand how everything works in the BGP.

2. BGP 邻居如何传播路由与 AS_PATH

时间范围:04:05–11:59

How BGP works diagram with four autonomous systems links and BGP routing tables

总结 / Summary

中文

示例把四个网络分别标记为 AS 100、200、300 和 400,并通过不同带宽的链路连接。每个 BGP 表(BGP table)保存目标前缀(destination)、下一跳(next hop)和自治系统路径(AS_PATH)。直接相连的 eBGP 邻居(eBGP neighbor)先交换各自已知路由,再把新学到的前缀连同经过的 AS 序列继续通告给其他邻居。这样 AS 100 可以同时学到经 AS 400 或经 AS 200 到达 AS 300 的多条路径;当 AS 400 连接新网络时,该路由也会逐级传播到其余 AS。

English

The example labels four networks as AS 100, 200, 300, and 400 and connects them with links of different bandwidths. Each BGP table records a destination prefix, next hop, and AS_PATH. Directly connected eBGP neighbors exchange their known routes and then advertise newly learned prefixes together with the sequence of ASes traversed. AS 100 can therefore learn multiple paths to AS 300, such as through AS 400 or AS 200, and a new network attached to AS 400 is propagated throughout the topology.

Transcript

04:05 So let's assume you have the whole world at your disposal.

04:09 And we are now trying to set up a network connectivity

04:12 between the data centers at various locations.

04:16 So there is one network you can call it one AS and it has

04:21 IP range ten, ten, zero, zero, zero, 16

04:23 and AS value as 100.

04:26 Now you understood that there is private AS and public AS,

04:29 anything works here.

04:30 But we are taking the number as 100.

04:32 However, the actual number, you know,

04:34 there is some range that you can look at

04:37 in the last lecture.

04:39 Similarly, there are other networks like one maybe Africa,

04:43 and which has AS 200

04:46 with a CID arranged 10, 20, zero, zero, 16.

04:49 And then there is somewhere in India

04:52 and maybe somewhere in the Europe.

04:54 So we have four networks here

04:55 and we have given them different AS numbers: 100, 200,

04:58 300 and 400.

05:00 Now every AS would be consist of multiple routers.

05:03 That's what is shown here.

05:05 And then there will be one router,

05:07 which is connected to other networks,

05:09 but that router has a private IP address from the network

05:14 address range, and that's what is shown here.

05:17 Now what we have done is,

05:18 we have connected this network or

05:21 either a MPLS link or other links.

05:25 And there is a connectivity between AS 100 and AS 400,

05:30 similarly between 400 and 300, 300 and 200,

05:33 and then 100 and 200.

05:35 So all these are connected

05:37 and there is a different network

05:38 bandwidth that they are connected with,

05:41 and we will show you why that is so, as an example.

05:45 And additionally,

05:46 there is one more link between AS 400 and 200.

05:49 So this is how the network is laid down.

05:52 And now let's look at how BGP works in this scenario.

05:56 In terms of the BGP neighbors.

05:58 As I said,

05:59 if the traffic is going between AS's, different As's,

06:04 they are called E BGP neighbors.

06:06 So these two guys are E BGP neighbors versus,

06:09 if you're talking about router within the same AS,

06:12 and they exchange the routing information,

06:14 they are called I BGP neighbors.

06:16 And as I said,

06:16 what we are interested in is E BGP neighbors.

06:20 Okay, so this is a network and now let's see

06:23 how the routing information is exchanged.

06:25 So every AS would have their own routing table.

06:30 We also call it BGP table.

06:33 Now in that BGP table,

06:34 there will be three things: the destination, the next hop,

06:37 and the path, you can call it AS PATH.

06:40 Now if you look at this AS,

06:41 the destination is itself ten, dot, ten, dot, zero, zero 16.

06:45 The next hop in that case would be zero, zero, zero,

06:48 and the path would be I, I for internal.

06:50 That means all this traffic is internal traffic.

06:53 Now, every AS at initial level,

06:56 it would have this kind of route table where the entry

06:59 would be for itself.

07:01 The CID actually will be the self CID address.

07:04 Now what happens, as you know this,

07:06 all AS's are connected to each other.

07:08 They learn the route from the other AS,

07:12 like if from AS 100, I want to reach to AS 400,

07:16 then what route entry I should have.

07:18 So they would exchange those routes

07:20 and that's where all these route entries are here.

07:24 Now let's take an example from AS 100,

07:26 if I were to go to AS 200

07:28 which is this one, with the destination IP address of

07:31 10, 20, zero, zero, 16, the next hop is this router,

07:35 which is 10, 20, zero, one.

07:36 And in this case, my AS path would be 200.

07:39 So I'm adding that 200 and there will always be this

07:42 internal entry.

07:44 So AS PATH is 200 comma I.

07:46 Now if I'm to reach to 400, of course,

07:48 my next destination is 10, 40, zero, one,

07:52 which is this router.

07:53 And the AS PATH would be 400 comma I.

07:56 Likewise, we added

07:58 or it gets automatically added all the AS entries

08:01 out table entries for all other AS's.

08:04 Now if you see specially, this AS 400 and 200,

08:07 they're connected to rest of the three AS's.

08:09 That's where there are self entry and three more entries for

08:12 all these three AS's.

08:14 So this is very basic to start with.

08:16 The route table would have this kind of entries.

08:19 And now if you can see, if I want to reach to AS 400,

08:22 any IP address 400, it will take that path.

08:25 And if I were to go to AS 200 from AS 100,

08:29 it will take this path.

08:31 Now, what if I want to reach to ASA 300 IP address?

08:36 Now, if you look at this route table,

08:37 there is no route entry for that.

08:39 That means right now,

08:40 I can't reach to that destination.

08:42 And that's where the BGP comes to the rescue, right?

08:45 What it does is,

08:47 whatever path you or other neighboring AS's understand

08:51 or learn, they will pass that counting information

08:55 to other AS's.

08:56 So in this example,

08:57 if you see my AS 400 knows how to reach to AS 300

09:03 using the hop 10, 30, zero, one, right?

09:06 What it does, it just upends its own AS number here 400,

09:12 and sends this information back AS 100.

09:15 Now, if you see AS hundred got the destination address,

09:19 10, 30, zero, zero, 16.

09:21 And in this case, the next hop is 10, 40, zero, one

09:25 because this directly does not understand the,

09:28 it does not have direct connectivity with AS 300.

09:32 So next hop will be a 10, 40, zero, one

09:34 and as packet reaches this destination,

09:37 it knows how to route traffic to AS 300.

09:41 So it will learn that entry here.

09:43 Similarly, it will also get the same entry or similar entry

09:47 from AS 200 as well.

09:49 That's because AS 200 also connected to AS 300

09:53 and it has its own entry.

09:55 So now, AS 100 has multiple destination entries for AS 300.

10:02 And that's what the BGP is.

10:04 What it does, it exchanges routing information with all

10:07 neighboring AS's.

10:09 And in this case, we are just showing AS 100 path,

10:12 but this AS 400 will also receive similar entries

10:15 from AS 100 and likewise.

10:18 So it will be a lot of route getting exchanged

10:20 between all these AS's.

10:22 Now what's the benefit of this?

10:23 Like AS 100 has now two entries to reach to AS 300.

10:27 So what would happen?

10:29 Suppose by default BGP chooses the,

10:33 this path that is through AS 400 to reach to the AS 300

10:37 and somehow this link goes down,

10:39 that means there is some problem with that network.

10:43 Now, BGP can't take other path because in routing table,

10:46 it knows that there is one more path exists to reach to

10:48 the target destination.

10:50 And that's where BGP can be used for fail-over

10:54 kind of scenarios.

10:55 So that's one of the possibilities and we are going to talk

10:57 more about such scenarios.

10:59 But what I want you to understand from this

11:02 is that a BGP is all about exchanging

11:05 this routing information dynamically.

11:08 Now what do I mean by dynamically?

11:09 Suppose tomorrow this AS 400 gets connected to a new,

11:13 say, AS 500 and then it would learn about that route

11:18 and there will be a route table entry

11:20 in the AS 400 route table.

11:22 Now it would also publish that route table information to

11:25 AS 100 and AS 200 and AS 300.

11:28 So that now all these neighbors also understand about

11:31 the new network,

11:33 which got connected to AS 400 and that's where they can

11:36 route the traffic to, even that destination.

11:38 So BGP is all about that.

11:40 Internet is all about that.

11:42 Okay, so that's basics of BGP.

11:45 And now let's get into the attributes of the BGP

11:49 that we talked about.

11:50 Specifically, the AS PATH, local preference,

11:54 and then multi exit discriminator.

11:57 So stay tuned.

整讲总结 / Overall Summary

中文

边界网关协议(Border Gateway Protocol, BGP)通过路径向量(path-vector)在自治系统(Autonomous System, AS)之间传播前缀。iBGP(internal BGP)用于 AS 内部,eBGP(external BGP)用于 AS 之间。BGP 路由包含目标、下一跳和自治系统路径(AS_PATH),并可通过 Weight、LOCAL_PREF、AS_PATH 与 MED 等属性影响选路。邻居持续通告新学到的可达性,使大型互联网络能够动态适应新增前缀和拓扑变化。

English

BGP is a path-vector protocol that propagates prefixes between autonomous systems. iBGP operates within an AS, while eBGP operates between ASes. BGP routes include a destination, next hop, and AS_PATH, and best-path decisions can be influenced by attributes such as Weight, LOCAL_PREF, AS_PATH, and MED. Continuous neighbor advertisements allow large interconnected networks to adapt dynamically to new prefixes and topology changes.

返回顶部 ↑