WEBVTT

1
00:00.000 --> 00:06.840
Next up, let's talk a little bit here about AS path filtering.

2
00:06.840 --> 00:12.240
Again, this is going to be specific to BGP because it is looking at that AS

3
00:12.240 --> 00:13.280
path, which

4
00:13.280 --> 00:16.520
is one of our attributes in BGP.

5
00:16.520 --> 00:22.120
This is simply a list of all the AS numbers that a particular update has passed

6
00:22.120 --> 00:23.160
through.

7
00:23.160 --> 00:26.540
Just like any other access list, we're going to be doing a permitting or

8
00:26.540 --> 00:27.320
denying of the

9
00:27.320 --> 00:31.600
routes based on the contents of the AS path.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

9
00:27.320 --> 00:31.600
routes based on the contents of the AS path.

10
00:31.600 --> 00:36.230
But it's a permit or deny condition, and the way we're going to match on the AS

11
00:36.230 --> 00:36.680
path

12
00:36.680 --> 00:42.040
is using something called a regular expression or a red jacks.

13
00:42.040 --> 00:47.710
Now regular expressions use a bunch of special characters to do certain types

14
00:47.710 --> 00:49.000
of matching,

15
00:49.000 --> 00:52.530
and I certainly don't think that you need to have all of these memorized, but

16
00:52.530 --> 00:53.120
you should

17
00:53.120 --> 00:55.800
at least be familiar with some of them.

18
00:55.800 --> 01:00.140
First off, we have an underscore, which will match any white space characters,
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

18
00:55.800 --> 01:00.140
First off, we have an underscore, which will match any white space characters,

19
01:00.140 --> 01:00.600
such as

20
01:00.600 --> 01:02.800
a space, a tab, etc.

21
01:02.800 --> 01:07.070
In the case of the AS path, it's really only going to be either the space or

22
01:07.070 --> 01:08.000
the beginning

23
01:08.000 --> 01:10.400
or the ending of a string.

24
01:10.400 --> 01:12.080
We have the carrot symbol.

25
01:12.080 --> 01:15.280
This is going to anchor to the beginning of the line.

26
01:15.280 --> 01:16.440
We have the dollar sign.

27
01:16.440 --> 01:19.400
This is going to anchor to the end of the line.

28
01:19.400 --> 01:20.800
We have a dot.

29
01:20.800 --> 01:28.240
This is going to match any single character, but not a new line and not a blank

30
01:28.240 --> 01:29.280
space.

31
01:29.280 --> 01:32.520
So it basically indicates the requirement of a character.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

31
01:29.280 --> 01:32.520
So it basically indicates the requirement of a character.

32
01:32.520 --> 01:41.060
So just as a quick example, if I were to say carrot three dot two dollar, this

33
01:41.060 --> 01:42.520
would match

34
01:42.520 --> 01:50.400
on three two two or three seven two or three nine two, because that dot

35
01:50.400 --> 01:52.080
indicates any

36
01:52.080 --> 01:59.280
single character, but what it will not match on is three space two.

37
01:59.280 --> 02:04.680
It will not match on that because this is not a match for the dot.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

37
01:59.280 --> 02:04.680
It will not match on that because this is not a match for the dot.

38
02:04.680 --> 02:07.720
So that's what we mean by it has to be a single character.

39
02:07.720 --> 02:12.340
And of course, the case of a new line isn't really going to exist in an AS path

40
02:12.340 --> 02:12.760
, but it

41
02:12.760 --> 02:15.360
can't be a space.

42
02:15.360 --> 02:17.320
Next we have some wild cards.

43
02:17.320 --> 02:22.640
You have an asterisk, which will match zero or more of the previous character.

44
02:22.640 --> 02:27.020
We have a plus, which will match one or more of the previous character and a

45
02:27.020 --> 02:28.240
question mark,

46
02:28.240 --> 02:32.920
which will match zero or more of the previous character.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

46
02:28.240 --> 02:32.920
which will match zero or more of the previous character.

47
02:32.920 --> 02:34.880
You can also do ranges.

48
02:34.880 --> 02:39.800
So in this case, they're using letters in this example, ABC or like a through G

49
02:39.800 --> 02:40.360
, but it's

50
02:40.360 --> 02:44.600
really any character out of that specified range.

51
02:44.600 --> 02:50.060
Once again, in a S paths, these will be numbers, but nonetheless, you can do a

52
02:50.060 --> 02:51.760
range or a grouping.

53
02:51.760 --> 02:56.000
You can use the pipe for an or operation.

54
02:56.000 --> 02:59.240
This will combine several different options.

55
02:59.240 --> 03:04.880
There's parentheses that we can use to group characters to form sub expressions
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

55
02:59.240 --> 03:04.880
There's parentheses that we can use to group characters to form sub expressions

56
03:04.880 --> 03:05.360
and or

57
03:05.360 --> 03:07.360
actionable groups.

58
03:07.360 --> 03:13.890
And you can use a backspace to escape special characters, making them operate

59
03:13.890 --> 03:14.400
opposite of

60
03:14.400 --> 03:17.520
how they would in a regular expression.

61
03:17.520 --> 03:26.000
So for example, let's say I literally wanted to match on the word, hi question

62
03:26.000 --> 03:26.920
mark.

63
03:26.920 --> 03:30.000
How could I match on that with a regular expression?
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

64
03:30.000 --> 03:34.540
Because I can't match on the question mark, because the question mark matches

65
03:34.540 --> 03:35.040
zero or

66
03:35.040 --> 03:38.600
more occurrences of the previous character.

67
03:38.600 --> 03:43.780
So the default behavior in a regular expression, this would be saying, well,

68
03:43.780 --> 03:44.720
maybe the I is

69
03:44.720 --> 03:46.960
there, maybe it's not.

70
03:46.960 --> 03:56.190
So in other words, as it is right now, it would match on H I or just H. That's

71
03:56.190 --> 03:56.360
zero

72
03:56.360 --> 03:59.920
or more occurrences of the I.

73
03:59.920 --> 04:02.400
But that's not what you were trying to match on.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

73
03:59.920 --> 04:02.400
But that's not what you were trying to match on.

74
04:02.400 --> 04:06.640
You literally want to match on H I question mark.

75
04:06.640 --> 04:10.040
To do this, you would do that.

76
04:10.040 --> 04:13.320
You're escaping the special meaning of the question mark.

77
04:13.320 --> 04:18.280
And instead of say, no, literally a question mark.

78
04:18.280 --> 04:20.360
That's what the backslash does.

79
04:20.360 --> 04:23.480
So let's jump in and take a look at a few examples.

80
04:23.480 --> 04:30.050
So what I've put together here are some examples of very commonly used AS path
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

80
04:23.480 --> 04:30.050
So what I've put together here are some examples of very commonly used AS path

81
04:30.050 --> 04:31.240
filters.

82
04:31.240 --> 04:35.040
So the first one here is underscore $500.

83
04:35.040 --> 04:40.320
Well, remember the dollar anchors it to the end of the line.

84
04:40.320 --> 04:45.840
Then there's a 500 clearly and an underscore meaning there has to be a space.

85
04:45.840 --> 04:51.520
So what we're trying to say there is this can't match on 3500 because there's

86
04:51.520 --> 04:52.600
no opportunity

87
04:52.600 --> 04:54.160
for the three.

88
04:54.160 --> 04:56.320
There has to be a space in it.

89
04:56.320 --> 05:01.480
Now it could match on three space 500.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

89
04:56.320 --> 05:01.480
Now it could match on three space 500.

90
05:01.480 --> 05:06.380
That would be okay because there's a space and there's nothing to denote where

91
05:06.380 --> 05:06.960
the line

92
05:06.960 --> 05:08.320
starts.

93
05:08.320 --> 05:14.880
So there could be as much stuff in front of this as we want as long as it ends

94
05:14.880 --> 05:17.120
in a 500.

95
05:17.120 --> 05:23.230
The way we generally express this in terms of AS path filtering is to permit

96
05:23.230 --> 05:24.160
any update

97
05:24.160 --> 05:28.360
that originated in a 500.

98
05:28.360 --> 05:33.860
The reason it would be originated is it would be at the end of the AS path
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

98
05:28.360 --> 05:33.860
The reason it would be originated is it would be at the end of the AS path

99
05:33.860 --> 05:34.200
string.

100
05:34.200 --> 05:40.280
Similarly, yet the opposite would be our next example because now what we're

101
05:40.280 --> 05:41.240
doing is we're

102
05:41.240 --> 05:47.680
anchoring to the beginning of the string then saying it has to be 3221 then

103
05:47.680 --> 05:49.760
another underscore.

104
05:49.760 --> 05:55.880
So for example, this could not match 32227.

105
05:55.880 --> 06:04.160
That would be a no but a yes would be 32117.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

105
05:55.880 --> 06:04.160
That would be a no but a yes would be 32117.

106
06:04.160 --> 06:07.740
Once again, as long as there's a space and this one has to be at the beginning

107
06:07.740 --> 06:08.120
of the

108
06:08.120 --> 06:09.880
string.

109
06:09.880 --> 06:17.870
The way of wording this permit any paths that came from neighboring a yes, 32

110
06:17.870 --> 06:19.400
221.

111
06:19.400 --> 06:22.360
So in other words, anything can be behind it.

112
06:22.360 --> 06:25.970
It could be halfway across the internet, but it has to be coming from my

113
06:25.970 --> 06:27.120
directly connected

114
06:27.120 --> 06:29.320
neighbor, 32221.

115
06:29.320 --> 06:33.640
And I just noticed I missed a two in here.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

115
06:29.320 --> 06:33.640
And I just noticed I missed a two in here.

116
06:33.640 --> 06:35.640
So there should be another two in there.

117
06:35.640 --> 06:41.320
So 32221 and then the space would be allowed.

118
06:41.320 --> 06:46.740
Another example that we use quite commonly is an underscore then an AS number

119
06:46.740 --> 06:47.320
in this

120
06:47.320 --> 06:52.360
example, I just happened to use 750 and then another underscore.

121
06:52.360 --> 06:57.860
So understand this could be at the beginning of the string at the end of the

122
06:57.860 --> 06:59.200
string anywhere

123
06:59.200 --> 07:00.960
in the middle.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

123
06:59.200 --> 07:00.960
in the middle.

124
07:00.960 --> 07:05.920
But it does have to be 750 by itself.

125
07:05.920 --> 07:08.120
Again, there could be something in front of it.

126
07:08.120 --> 07:13.640
375921 83 all fine.

127
07:13.640 --> 07:21.380
As long as 750 is by itself in there somewhere what I mean by itself, it can't

128
07:21.380 --> 07:23.440
be 7501.

129
07:23.440 --> 07:27.310
That's not going to match because there has to be a space before the seven and

130
07:27.310 --> 07:27.800
a space

131
07:27.800 --> 07:29.960
after the zero.

132
07:29.960 --> 07:35.460
And the way we say this in a path filtering land, we would say we're permitting
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

132
07:29.960 --> 07:35.460
And the way we say this in a path filtering land, we would say we're permitting

133
07:35.460 --> 07:36.160
any path

134
07:36.160 --> 07:40.880
that has passed through a seven 50.

135
07:40.880 --> 07:45.440
Two more very common ones, although the first one's a little bit complicated.

136
07:45.440 --> 07:48.840
We have to probably talk about this one just a little bit.

137
07:48.840 --> 07:53.840
First, yes, we have our beginning and our end of string.

138
07:53.840 --> 07:58.440
This is important because we're sort of using these like book ends.

139
07:58.440 --> 08:00.880
We're saying there can't be anything in front of this.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

139
07:58.440 --> 08:00.880
We're saying there can't be anything in front of this.

140
08:00.880 --> 08:03.120
There can't be anything after this.

141
08:03.120 --> 08:06.760
So we're containing our as path.

142
08:06.760 --> 08:09.760
Next, we have a plus sign.

143
08:09.760 --> 08:14.030
Now, I remember that the plus sign indicates one or more instance of the

144
08:14.030 --> 08:15.120
character in front

145
08:15.120 --> 08:16.440
of it.

146
08:16.440 --> 08:20.080
But the character in front of it is a range.

147
08:20.080 --> 08:24.840
It's a grouping of zero through nine using parentheses.

148
08:24.840 --> 08:29.680
Let me put this in terms that might be easier to understand.

149
08:29.680 --> 08:34.160
This will permit three seven nine one.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

149
08:29.680 --> 08:34.160
This will permit three seven nine one.

150
08:34.160 --> 08:38.040
This will permit eight two three.

151
08:38.040 --> 08:45.800
This will permit seven nine eight three two seven one nine three eight four.

152
08:45.800 --> 08:47.560
You're never going to see that in an as path.

153
08:47.560 --> 08:49.600
I'm just saying.

154
08:49.600 --> 08:55.040
This will match on any single as number.

155
08:55.040 --> 09:03.360
What this will not match on three seven nine one eight two three in one string.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

155
08:55.040 --> 09:03.360
What this will not match on three seven nine one eight two three in one string.

156
09:03.360 --> 09:08.560
When I wrote them up above, those were three separate examples in one string.

157
09:08.560 --> 09:14.730
You can't have these together because notice what's not allowed in our range,

158
09:14.730 --> 09:15.480
our ranges

159
09:15.480 --> 09:21.960
zero through nine and we have to have at least one or more zero through nine's.

160
09:21.960 --> 09:25.640
However, we can't have anything in front of it because we have a beginning of

161
09:25.640 --> 09:26.640
string.

162
09:26.640 --> 09:30.640
We can't have anything after it because we have an end of string and there's
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

162
09:26.640 --> 09:30.640
We can't have anything after it because we have an end of string and there's

163
09:30.640 --> 09:31.160
nothing

164
09:31.160 --> 09:34.520
in here that allows for a space.

165
09:34.520 --> 09:43.080
So the way we refer to this in a as path land permit any single as number.

166
09:43.080 --> 09:48.020
This one would be very, very common with service providers when connecting to

167
09:48.020 --> 09:49.000
customers.

168
09:49.000 --> 09:52.280
They don't want to have to write a separate as path for every single one of

169
09:52.280 --> 09:53.720
their 28 million

170
09:53.720 --> 09:58.760
customers, but they also don't want their customers to become a transit area.

171
09:58.760 --> 10:05.800
So this way we can say you can send me any as you want, but only one.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

171
09:58.760 --> 10:05.800
So this way we can say you can send me any as you want, but only one.

172
10:05.800 --> 10:08.920
The presumption, of course, is they would use their own.

173
10:08.920 --> 10:13.400
If they didn't, well, then we probably wouldn't have a neighborhood with them,

174
10:13.400 --> 10:13.760
but this is

175
10:13.760 --> 10:16.040
a very common example.

176
10:16.040 --> 10:22.510
Now another very common example and this one's far easier is permit caret

177
10:22.510 --> 10:23.560
dollar.

178
10:23.560 --> 10:28.320
Now, as you can plainly see, that's an empty string.

179
10:28.320 --> 10:31.800
Essentially what this means is none.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

179
10:28.320 --> 10:31.800
Essentially what this means is none.

180
10:31.800 --> 10:37.120
We're not allowed to have anything in our as path to match this.

181
10:37.120 --> 10:40.200
And at first that might seem like a silly thing.

182
10:40.200 --> 10:47.760
However, incredibly common for a customer to use this outbound towards a

183
10:47.760 --> 10:50.080
service provider,

184
10:50.080 --> 10:54.320
because the only updates that you would be trying to send to your service

185
10:54.320 --> 10:55.280
provider should

186
10:55.280 --> 10:58.600
have nothing in the as path.

187
10:58.600 --> 11:03.290
Now ultimately, it's going to have your as in the as path when we send it to
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

187
10:58.600 --> 11:03.290
Now ultimately, it's going to have your as in the as path when we send it to

188
11:03.290 --> 11:04.240
the service

189
11:04.240 --> 11:11.320
provider, but understand that the as path that we prepend when we send updates

190
11:11.320 --> 11:11.840
to our

191
11:11.840 --> 11:16.960
neighbors happens after filtering.

192
11:16.960 --> 11:23.000
So at the filtering part, when we're choosing what updates to send to our

193
11:23.000 --> 11:23.400
neighbors, your

194
11:23.400 --> 11:26.560
own as will not be counted.

195
11:26.560 --> 11:32.310
Therefore, it would still be an empty string if these are routes that you are
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

195
11:26.560 --> 11:32.310
Therefore, it would still be an empty string if these are routes that you are

196
11:32.310 --> 11:33.480
originating.

197
11:33.480 --> 11:37.680
That way you can't accidentally learn a route from somebody else and then pass

198
11:37.680 --> 11:38.360
it through

199
11:38.360 --> 11:41.800
and try to send it back up to your service provider.

200
11:41.800 --> 11:46.740
Just to make this a little clearer, you don't want to learn the path to get to

201
11:46.740 --> 11:48.600
Cisco.com

202
11:48.600 --> 11:54.980
from Verizon and then turn around and advertise that to AT&T and have AT&T

203
11:54.980 --> 11:56.440
decide that you

204
11:56.440 --> 11:59.880
look like a pretty good way to get to Cisco.

205
11:59.880 --> 12:04.780
And all of a sudden, every customer of AT&T going to Cisco.com starts coming
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

205
11:59.880 --> 12:04.780
And all of a sudden, every customer of AT&T going to Cisco.com starts coming

206
12:04.780 --> 12:05.400
through

207
12:05.400 --> 12:07.320
your network.

208
12:07.320 --> 12:12.150
That's called becoming a transit as and that is the last thing that you as a

209
12:12.150 --> 12:13.080
customer would

210
12:13.080 --> 12:14.600
want to happen.

211
12:14.600 --> 12:18.320
By the way, the service providers don't want it either.

212
12:18.320 --> 12:23.190
That's why they probably implemented this to prevent you from accidentally

213
12:23.190 --> 12:23.760
doing that.

214
12:23.760 --> 12:31.130
So this line is the service provider protecting you from becoming a transit as
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

214
12:23.760 --> 12:31.130
So this line is the service provider protecting you from becoming a transit as

215
12:31.130 --> 12:32.320
this line is

216
12:32.320 --> 12:38.730
generally used by the customer to prevent themselves from becoming a transit as

217
12:38.730 --> 12:38.760
.

218
12:38.760 --> 12:43.740
So again, when we start running protocols like BGP, we have to be very careful

219
12:43.740 --> 12:44.160
with

220
12:44.160 --> 12:50.000
our filtering and we can't always do it based on prefix because we may not know

221
12:50.000 --> 12:50.240
what the

222
12:50.240 --> 12:51.240
prefix is.

223
12:51.240 --> 12:55.970
You're not going to sit there and try and deny every single internet route with

224
12:55.970 --> 12:56.560
a prefix

225
12:56.560 --> 12:57.840
list.

226
12:57.840 --> 13:03.040
At that point, AS path filters become a better choice.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

226
12:57.840 --> 13:03.040
At that point, AS path filters become a better choice.

227
13:03.040 --> 13:07.090
So in this video, we spent some time looking at some of the caveats and

228
13:07.090 --> 13:08.520
attributes of prefix

229
13:08.520 --> 13:09.760
lists.

230
13:09.760 --> 13:14.540
And then we also talked about AS path filters, two different very powerful

231
13:14.540 --> 13:15.560
methods that we

232
13:15.560 --> 13:22.080
have for filtering updates, prefix lists really with any protocol, but as path

233
13:22.080 --> 13:23.880
filters, particularly

234
13:23.880 --> 13:25.680
with BGP.

235
13:25.680 --> 13:30.090
Now as soon as we have more than one protocol in the mix, we talked about OSPF
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

235
13:25.680 --> 13:30.090
Now as soon as we have more than one protocol in the mix, we talked about OSPF

236
13:30.090 --> 13:31.040
in the previous

237
13:31.040 --> 13:32.040
scale.

238
13:32.040 --> 13:34.600
We're talking about BGP in this scale.

239
13:34.600 --> 13:38.710
Anytime there's more than one protocol involved, we're almost always with, of

240
13:38.710 --> 13:39.280
course, a few

241
13:39.280 --> 13:42.520
exceptions going to have to do redistribution.

242
13:42.520 --> 13:46.930
So let's talk about some details and caveats to watch out for in redistribution

243
13:46.930 --> 13:47.200
in the

244
13:47.200 --> 13:47.960
next video.

245
13:47.960 --> 13:57.300
[BLANK_AUDIO]
