1 00:00:00,000 --> 00:00:03,776 [AUDIO LOGO] 2 00:00:03,776 --> 00:00:08,039 3 00:00:08,039 --> 00:00:12,780 So now that we understand that MPLS is all about label 4 00:00:12,780 --> 00:00:14,790 switching-- it's right in the name-- 5 00:00:14,790 --> 00:00:17,160 it's time to actually jump in and take a look 6 00:00:17,160 --> 00:00:19,470 at what these labels look like. 7 00:00:19,470 --> 00:00:22,650 Where are they actually carried in the packet structure? 8 00:00:22,650 --> 00:00:25,810 And what's the structure of the label itself? 9 00:00:25,810 --> 00:00:29,230 So that's what we're going to be exploring in this video. 10 00:00:29,230 --> 00:00:31,140 So let's just go ahead and jump in 11 00:00:31,140 --> 00:00:33,550 and start talking about those details. 12 00:00:33,550 --> 00:00:36,510 And then we're also going to jump in to Wireshark 13 00:00:36,510 --> 00:00:39,300 and see what an MPLS packet actually 14 00:00:39,300 --> 00:00:40,810 looks like on the wire. 15 00:00:40,810 --> 00:00:44,530 So let's go ahead and get started. 16 00:00:44,530 --> 00:00:45,100 OK. 17 00:00:45,100 --> 00:00:47,260 So the MPLS label-- 18 00:00:47,260 --> 00:00:50,800 first, this is a 32-bit header. 19 00:00:50,800 --> 00:00:53,890 And we refer to it as a shim header. 20 00:00:53,890 --> 00:00:56,680 The reason for this is it doesn't exactly 21 00:00:56,680 --> 00:01:01,360 fit into the OSI model in any of the particular layers, 22 00:01:01,360 --> 00:01:07,150 because it actually goes between layer 2 and layer 3. 23 00:01:07,150 --> 00:01:11,110 So I've heard it referred to as layer 2 and 1/2. 24 00:01:11,110 --> 00:01:14,170 Or again, the more common term is a shim header. 25 00:01:14,170 --> 00:01:18,340 But again, it goes between the original layer 2 26 00:01:18,340 --> 00:01:19,810 and layer 3 headers. 27 00:01:19,810 --> 00:01:23,320 Now, the complication with that is 28 00:01:23,320 --> 00:01:25,660 if we're going between layer 2 and layer 3, 29 00:01:25,660 --> 00:01:30,170 remember that layer 2 has an EtherType field. 30 00:01:30,170 --> 00:01:31,820 Now, that is assuming, of course, 31 00:01:31,820 --> 00:01:33,250 we're running on Ethernet. 32 00:01:33,250 --> 00:01:36,040 But regardless of the layer 2 transport, 33 00:01:36,040 --> 00:01:39,940 there is some type of a field that identifies 34 00:01:39,940 --> 00:01:42,190 what protocol comes next. 35 00:01:42,190 --> 00:01:45,130 Typically, this would be to indicate 36 00:01:45,130 --> 00:01:50,110 that the next header is, say, for example, IPv4 or IPv6. 37 00:01:50,110 --> 00:01:52,150 However, that's not the case here, 38 00:01:52,150 --> 00:01:55,990 because the next header is now an MPLS label. 39 00:01:55,990 --> 00:01:58,630 And we're going to focus, of course, on Ethernet here. 40 00:01:58,630 --> 00:02:02,890 But therefore, we need to change the EtherType field to indicate 41 00:02:02,890 --> 00:02:05,050 that the next thing in the header 42 00:02:05,050 --> 00:02:07,780 is actually the MPLS label. 43 00:02:07,780 --> 00:02:13,990 To do that, we use EtherType 0x8847. 44 00:02:13,990 --> 00:02:16,880 So any time we see this-- or more importantly, 45 00:02:16,880 --> 00:02:18,820 the devices see this-- 46 00:02:18,820 --> 00:02:22,600 in the original layer 2 header, it's 47 00:02:22,600 --> 00:02:25,840 going to know that the next thing in the header 48 00:02:25,840 --> 00:02:31,190 is an MPLS label and know to translate it as such. 49 00:02:31,190 --> 00:02:34,060 So what's actually in this shim header? 50 00:02:34,060 --> 00:02:38,680 Well, the first thing is, of course, a 20-bit label. 51 00:02:38,680 --> 00:02:41,050 The label, of course, is the main purpose 52 00:02:41,050 --> 00:02:43,070 for doing this to begin with. 53 00:02:43,070 --> 00:02:46,480 However, we do have some other fields that go along with this. 54 00:02:46,480 --> 00:02:52,660 First is a 3-bit EXP field, or Experimental field. 55 00:02:52,660 --> 00:02:56,170 Most vendors actually use this field 56 00:02:56,170 --> 00:02:58,780 to carry QoS, or Quality of Service, 57 00:02:58,780 --> 00:03:02,560 information inside the MPLS header. 58 00:03:02,560 --> 00:03:04,600 Then there's 1 bit which is referred 59 00:03:04,600 --> 00:03:07,210 to as the bottom-of-stack indicator 60 00:03:07,210 --> 00:03:09,280 or, more commonly, because, well, it's 61 00:03:09,280 --> 00:03:11,920 easier to say, the S-bit. 62 00:03:11,920 --> 00:03:14,500 Now, we'll get more into what this bit is 63 00:03:14,500 --> 00:03:17,020 actually for in our next video, when 64 00:03:17,020 --> 00:03:18,850 we talk about label stacks. 65 00:03:18,850 --> 00:03:21,520 But the quick version, it's a way 66 00:03:21,520 --> 00:03:24,610 to indicate if there's more than one label, because there 67 00:03:24,610 --> 00:03:29,230 can be, it's to indicate which one is the last label. 68 00:03:29,230 --> 00:03:30,850 And why do we need that? 69 00:03:30,850 --> 00:03:34,150 Because after the last label, it knows 70 00:03:34,150 --> 00:03:38,680 to go back and look for that original layer 3 header again. 71 00:03:38,680 --> 00:03:44,020 Last but not least, we have the 8-bit TTL field. 72 00:03:44,020 --> 00:03:47,560 And just like the TTL field in the IP header, 73 00:03:47,560 --> 00:03:50,830 this is used to mitigate loops. 74 00:03:50,830 --> 00:03:54,550 I hear people say a lot that it's there for loop prevention. 75 00:03:54,550 --> 00:03:56,800 That's actually not entirely correct. 76 00:03:56,800 --> 00:04:01,780 It's there in case a loop does occur so that the packets don't 77 00:04:01,780 --> 00:04:03,050 loop forever. 78 00:04:03,050 --> 00:04:06,850 So again, I prefer to refer to it as loop mitigation. 79 00:04:06,850 --> 00:04:10,120 But either way, this is there for that reason. 80 00:04:10,120 --> 00:04:13,720 If a loop were to occur in the MPLS environment, 81 00:04:13,720 --> 00:04:16,899 we don't want this packet to loop forever. 82 00:04:16,899 --> 00:04:20,110 The reason we need this here we actually 83 00:04:20,110 --> 00:04:23,230 sort of indicated in our previous video 84 00:04:23,230 --> 00:04:25,010 but not directly. 85 00:04:25,010 --> 00:04:28,690 Remember we talked about the FIB and the LFIB? 86 00:04:28,690 --> 00:04:31,780 When we're forwarding packets that are labeled, 87 00:04:31,780 --> 00:04:36,850 rather than just standard IP packets, we use that LFIB. 88 00:04:36,850 --> 00:04:38,270 Well, guess what. 89 00:04:38,270 --> 00:04:41,020 If we're forwarding based on the LFIB and the label, 90 00:04:41,020 --> 00:04:44,360 that means we never look at the IP header. 91 00:04:44,360 --> 00:04:47,620 So is there still a TTL in the IP header? 92 00:04:47,620 --> 00:04:49,490 Yes, of course there is. 93 00:04:49,490 --> 00:04:53,720 But if the routers in the middle never look at that-- so say, 94 00:04:53,720 --> 00:04:56,860 for example, our service provider core, if they never 95 00:04:56,860 --> 00:04:59,410 look at the IP header, then they're 96 00:04:59,410 --> 00:05:01,210 never going to see that TTL. 97 00:05:01,210 --> 00:05:04,760 That TTL doesn't get decremented, and so on. 98 00:05:04,760 --> 00:05:08,800 So we need this other TTL in the label field 99 00:05:08,800 --> 00:05:13,000 that we're going to be using for loop mitigation in the middle 100 00:05:13,000 --> 00:05:16,420 of the MPLS core for those devices that aren't even 101 00:05:16,420 --> 00:05:19,100 looking at the IP header. 102 00:05:19,100 --> 00:05:20,950 So now that we've covered a little bit here 103 00:05:20,950 --> 00:05:25,030 about where these labels ride and what they contain, 104 00:05:25,030 --> 00:05:27,280 let's take a look at our topology 105 00:05:27,280 --> 00:05:31,150 that we're going to be using for most of the MPLS skills. 106 00:05:31,150 --> 00:05:34,900 And we'll jump into Wireshark and see what these labels 107 00:05:34,900 --> 00:05:37,610 actually look like on the wire. 108 00:05:37,610 --> 00:05:40,120 So for a good deal of our MPLS skills, 109 00:05:40,120 --> 00:05:43,630 we will be using MPLS Topology 1. 110 00:05:43,630 --> 00:05:45,220 Although, we do have a few others 111 00:05:45,220 --> 00:05:48,370 we'll use with some minor modifications. 112 00:05:48,370 --> 00:05:52,592 But generally speaking, this is going to be our MPLS topology. 113 00:05:52,592 --> 00:05:54,550 The only reason I'm really bringing it up right 114 00:05:54,550 --> 00:05:57,250 now is to explain what we're going to be looking 115 00:05:57,250 --> 00:06:00,100 at as we go into Wireshark. 116 00:06:00,100 --> 00:06:02,830 We already have MPLS up and running right now 117 00:06:02,830 --> 00:06:07,222 in the MPLS Core, which is shown here by this light-green box. 118 00:06:07,222 --> 00:06:08,680 And what we're going to do is we're 119 00:06:08,680 --> 00:06:12,100 going to jump on to one of the either PE or P routers. 120 00:06:12,100 --> 00:06:15,280 And we'll examine traffic that's flowing 121 00:06:15,280 --> 00:06:18,520 from one of the customer routers to another customer router 122 00:06:18,520 --> 00:06:20,900 and just take a look at one of the labels. 123 00:06:20,900 --> 00:06:23,080 So for now, we don't have to be incredibly 124 00:06:23,080 --> 00:06:24,550 familiar with this topology. 125 00:06:24,550 --> 00:06:27,460 But this is the general idea of what we're going to be doing. 126 00:06:27,460 --> 00:06:29,127 So what we're going to do is we're going 127 00:06:29,127 --> 00:06:30,820 to set up a Wireshark capture. 128 00:06:30,820 --> 00:06:32,620 Then we're going to generate traffic 129 00:06:32,620 --> 00:06:34,270 going through the environment. 130 00:06:34,270 --> 00:06:36,040 And then we'll jump into Wireshark 131 00:06:36,040 --> 00:06:39,660 and take a look at that traffic. 132 00:06:39,660 --> 00:06:44,600 So I've started the Wireshark capture on gigabit 0/0/0/1 133 00:06:44,600 --> 00:06:46,740 on router 1, which is, of course, 134 00:06:46,740 --> 00:06:48,410 an MPLS-enabled interface. 135 00:06:48,410 --> 00:06:51,680 And now here on router 6, let's go ahead 136 00:06:51,680 --> 00:06:53,780 and generate some traffic. 137 00:06:53,780 --> 00:06:57,290 Let's just, for example, trace over to router 8. 138 00:06:57,290 --> 00:07:00,810 Now, a couple of things here, right away on the trace, 139 00:07:00,810 --> 00:07:03,830 we can already see that it's going through MPLS. 140 00:07:03,830 --> 00:07:06,530 We see our labels being swapped as it 141 00:07:06,530 --> 00:07:08,160 goes through the environment. 142 00:07:08,160 --> 00:07:10,850 So we know it's doing MPLS label switching, 143 00:07:10,850 --> 00:07:13,100 based on the output of the trace command. 144 00:07:13,100 --> 00:07:14,930 But now let's go over to Wireshark 145 00:07:14,930 --> 00:07:17,520 and actually examine one of the packets. 146 00:07:17,520 --> 00:07:19,460 So here's our Wireshark capture. 147 00:07:19,460 --> 00:07:22,670 And it's simply filtered by UDP. 148 00:07:22,670 --> 00:07:26,060 But we want to look at a packet specifically going 149 00:07:26,060 --> 00:07:28,160 from router 6 to router 8. 150 00:07:28,160 --> 00:07:32,320 So we're going to take a look here at packet 109. 151 00:07:32,320 --> 00:07:35,210 Now, if we look down here in the decoding window, 152 00:07:35,210 --> 00:07:38,020 we see the Ethernet II header. 153 00:07:38,020 --> 00:07:40,840 And then we see the MultiProtocol Label Switching 154 00:07:40,840 --> 00:07:45,140 Header, followed by the Internet Protocol Version 4 header. 155 00:07:45,140 --> 00:07:49,090 So we can see how this is clearly being inserted 156 00:07:49,090 --> 00:07:52,135 between layer 2 and layer 3. 157 00:07:52,135 --> 00:07:55,180 If we open up that layer 2 header, 158 00:07:55,180 --> 00:07:59,110 inside the layer 2 header, notice the MPLS EtherType 159 00:07:59,110 --> 00:07:59,860 field. 160 00:07:59,860 --> 00:08:06,400 It's set to MPLS label switched packet 0x8847, just 161 00:08:06,400 --> 00:08:08,720 as we would be expecting it to. 162 00:08:08,720 --> 00:08:11,380 So let's go ahead and shrink that back down. 163 00:08:11,380 --> 00:08:15,430 And next, let's open up the MPLS header itself. 164 00:08:15,430 --> 00:08:18,400 First thing to note is that Wireshark nicely 165 00:08:18,400 --> 00:08:23,200 breaks down all the fields right on the MPLS header line. 166 00:08:23,200 --> 00:08:26,620 It tells us that the label is 24012. 167 00:08:26,620 --> 00:08:29,050 The experimental bits are 0. 168 00:08:29,050 --> 00:08:33,799 The bottom-of-stack indicator, or the S-bit, is set to 1. 169 00:08:33,799 --> 00:08:35,799 That would, of course, be set to 1 because there 170 00:08:35,799 --> 00:08:36,940 is only one label. 171 00:08:36,940 --> 00:08:39,980 Therefore, it is inherently the bottom of the stack. 172 00:08:39,980 --> 00:08:43,360 And then of course, it's showing us that the TTL is currently 173 00:08:43,360 --> 00:08:44,730 set to 2. 174 00:08:44,730 --> 00:08:48,250 However, we can also see that it breaks down 175 00:08:48,250 --> 00:08:51,730 each one of these fields for us down below. 176 00:08:51,730 --> 00:08:55,640 And it shows us how many bits are associated with each one. 177 00:08:55,640 --> 00:08:57,760 So we can see our 20 bits right here 178 00:08:57,760 --> 00:09:01,420 for the MPLS label, our three bits right here 179 00:09:01,420 --> 00:09:04,790 for the EXP bits, one bit, of course, 180 00:09:04,790 --> 00:09:08,050 the flag bit for the bottom-of-stack indicator, 181 00:09:08,050 --> 00:09:11,770 and of course, that MPLS TTL. 182 00:09:11,770 --> 00:09:14,640 Now, if we were to open up the IP header as well-- 183 00:09:14,640 --> 00:09:17,530 and let's just close the MPLS header-- 184 00:09:17,530 --> 00:09:21,370 as we mentioned previously, the IP header of course 185 00:09:21,370 --> 00:09:25,460 still has its own TTL shown right here. 186 00:09:25,460 --> 00:09:27,400 And notice that it's a 2. 187 00:09:27,400 --> 00:09:29,680 And the reason for this is simply 188 00:09:29,680 --> 00:09:33,100 that the default behavior on a Cisco router 189 00:09:33,100 --> 00:09:38,710 is to copy the TTL from the IP header to the MPLS header 190 00:09:38,710 --> 00:09:41,210 when it imposes the label. 191 00:09:41,210 --> 00:09:43,930 Now, that may or may not be desirable behavior. 192 00:09:43,930 --> 00:09:49,380 And we'll discuss that in some future videos and skills. 193 00:09:49,380 --> 00:09:53,030 So in this video, we jumped in and we took a look 194 00:09:53,030 --> 00:09:55,100 at the actual label itself. 195 00:09:55,100 --> 00:09:58,580 We talked about where it rides inside of the header. 196 00:09:58,580 --> 00:10:01,040 And we took a look at the different fields 197 00:10:01,040 --> 00:10:05,060 in the MPLS header, including that 20-bit label. 198 00:10:05,060 --> 00:10:10,010 Now, as we mentioned, you can have more than one label. 199 00:10:10,010 --> 00:10:12,480 And a lot of our applications need that. 200 00:10:12,480 --> 00:10:15,000 So that's what we're going to be discussing next. 201 00:10:15,000 --> 00:10:18,380 Until then, I hope this has been informative for you, 202 00:10:18,380 --> 00:10:21,490 and I'd like to thank you for viewing. 203 00:10:21,490 --> 00:10:25,000