1 00:00:16,370 --> 00:00:22,150 So just a brief announcement, on this Friday 2 00:00:22,150 --> 00:00:24,200 you guys have a writing tutorial. 3 00:00:24,200 --> 00:00:25,230 It's at 2 p.m. 4 00:00:25,230 --> 00:00:27,180 there's only one tutorial this week at 2 p.m., 5 00:00:27,180 --> 00:00:28,596 and it's going to be in this room. 6 00:00:28,596 --> 00:00:30,080 So make sure you come. 7 00:00:30,080 --> 00:00:34,320 We're going to talk about issues involved with preparing 8 00:00:34,320 --> 00:00:35,620 and presenting your DP2. 9 00:00:35,620 --> 00:00:40,220 And it's really important that you come to pay attention. 10 00:00:40,220 --> 00:00:43,940 So today we're going to continue our discussion of networking 11 00:00:43,940 --> 00:00:45,090 and network layering. 12 00:00:45,090 --> 00:00:48,710 If you remember last time, we talked 13 00:00:48,710 --> 00:00:54,340 about the three layers that are in any typical network stack. 14 00:00:54,340 --> 00:00:57,870 And these three layers we said were the end-to-end layer, 15 00:00:57,870 --> 00:01:03,790 the network layer, and the link layer. 16 00:01:06,860 --> 00:01:10,539 And we went to the example of how these three layers interact 17 00:01:10,539 --> 00:01:12,080 with each other as, say, a message is 18 00:01:12,080 --> 00:01:14,280 sent through a network. 19 00:01:14,280 --> 00:01:20,890 So, on a typical sender node, we said there are these three 20 00:01:20,890 --> 00:01:22,148 layers -- 21 00:01:28,934 --> 00:01:30,600 And there might also be a receiver node. 22 00:01:34,730 --> 00:01:36,510 And then there could be several. 23 00:01:36,510 --> 00:01:40,780 Each time a message is sent through the network, 24 00:01:40,780 --> 00:01:45,270 it might pass through any number of intermediate gateway nodes, 25 00:01:45,270 --> 00:01:47,840 or intermediate switches. 26 00:01:47,840 --> 00:01:50,560 So when a packet gets sent in, it 27 00:01:50,560 --> 00:01:52,760 gets sent through the end-to-end layer 28 00:01:52,760 --> 00:01:55,850 in through the network layer, down into the link layer. 29 00:01:55,850 --> 00:01:57,360 The link layer chooses the next link 30 00:01:57,360 --> 00:01:59,960 to send the packet out over, since it's 31 00:01:59,960 --> 00:02:01,280 one of these switches. 32 00:02:01,280 --> 00:02:05,880 The switch looks at the packet, sends it up to its own network 33 00:02:05,880 --> 00:02:09,419 layer, which is in charge of determining the next link 34 00:02:09,419 --> 00:02:12,060 that the message will take. 35 00:02:12,060 --> 00:02:15,280 On the next hop, the message goes up to the link layer. 36 00:02:15,280 --> 00:02:18,580 The link layer determines yet another link 37 00:02:18,580 --> 00:02:19,820 for the message to take. 38 00:02:19,820 --> 00:02:22,870 The network layer determines yet another message, link, 39 00:02:22,870 --> 00:02:23,870 for the message to take. 40 00:02:23,870 --> 00:02:25,710 And then finally, the message reaches 41 00:02:25,710 --> 00:02:29,510 the receiver or the message propagates up through the link 42 00:02:29,510 --> 00:02:31,220 layer into the network layer, and then 43 00:02:31,220 --> 00:02:34,120 finally to the end-to-end layer, and out to the user. 44 00:02:34,120 --> 00:02:36,900 So we talked a little bit last time 45 00:02:36,900 --> 00:02:39,580 about various things that happen in this architecture. 46 00:02:39,580 --> 00:02:46,060 We said that there's this process of encapsulation 47 00:02:46,060 --> 00:02:49,090 that happens at each step along the way. 48 00:02:49,090 --> 00:02:52,340 So the end-to-end layer may attach headers 49 00:02:52,340 --> 00:02:55,370 on to the packet, a header or trailer onto the packet; 50 00:02:55,370 --> 00:02:57,470 the network layer may attach a header and trailer, 51 00:02:57,470 --> 00:02:59,610 and the link layer may attach a header and trailer. 52 00:02:59,610 --> 00:03:01,568 But at no point does any layer look at the data 53 00:03:01,568 --> 00:03:03,520 that a higher layer sent. 54 00:03:03,520 --> 00:03:08,330 And you also notice that in this architecture, what we've 55 00:03:08,330 --> 00:03:10,580 shown here is that only the link layer and the network 56 00:03:10,580 --> 00:03:13,340 layer of the switches that are forwarding packets 57 00:03:13,340 --> 00:03:16,310 are actually processing the packets. 58 00:03:16,310 --> 00:03:18,431 So the end-to-end layer, by definition, 59 00:03:18,431 --> 00:03:20,430 is not involved in the forwarding of the packet. 60 00:03:20,430 --> 00:03:22,290 The end-to-end layer is only involved 61 00:03:22,290 --> 00:03:25,794 when one of the endpoints of the communication is involved. 62 00:03:25,794 --> 00:03:27,460 So what we're going to talk about today, 63 00:03:27,460 --> 00:03:29,501 we're going to finish very briefly our discussion 64 00:03:29,501 --> 00:03:30,400 of the link layer. 65 00:03:30,400 --> 00:03:32,600 And then we're going to turn and focused mostly 66 00:03:32,600 --> 00:03:33,810 on the networking layer. 67 00:03:36,540 --> 00:03:40,620 So do you remember last time? 68 00:03:40,620 --> 00:03:42,750 We got as far as saying that the link layer is 69 00:03:42,750 --> 00:03:45,940 in charge of a number of sort of important issues 70 00:03:45,940 --> 00:03:49,400 with the transmission of data across one link of the network. 71 00:03:49,400 --> 00:03:51,640 And we talked for awhile at the end of class 72 00:03:51,640 --> 00:03:56,030 last time about this analog, to digital, 73 00:03:56,030 --> 00:04:00,630 sorry, got that backwards digital to analog 74 00:04:00,630 --> 00:04:01,780 to digital conversion. 75 00:04:01,780 --> 00:04:03,729 We are going to talk about the other issue, 76 00:04:03,729 --> 00:04:05,270 though, that I said we needed to talk 77 00:04:05,270 --> 00:04:07,190 about in the context of the network layer 78 00:04:07,190 --> 00:04:11,400 or the link layer is the issue of framing. 79 00:04:11,400 --> 00:04:14,060 So the idea with framing is when you're sending a message out 80 00:04:14,060 --> 00:04:17,070 over a network link, the receiver on the other end 81 00:04:17,070 --> 00:04:18,850 needs to have some way of knowing 82 00:04:18,850 --> 00:04:21,850 that a packet is starting or a packet is ending, right? 83 00:04:21,850 --> 00:04:23,830 So as we call these packets when they 84 00:04:23,830 --> 00:04:25,620 are at the link layer, frames. 85 00:04:25,620 --> 00:04:28,970 So, the issue with framing is to identify the sort of beginning 86 00:04:28,970 --> 00:04:31,440 and end of every one of these frames 87 00:04:31,440 --> 00:04:33,010 as it transmits over the network. 88 00:04:33,010 --> 00:04:35,660 And there is a sort of fairly obvious way 89 00:04:35,660 --> 00:04:38,374 to do this is, well, attach some special symbol, 90 00:04:38,374 --> 00:04:40,040 but some special symbol at the beginning 91 00:04:40,040 --> 00:04:41,040 and end of every packet. 92 00:04:43,880 --> 00:04:45,880 So, for example, if we were looking at Ethernet, 93 00:04:45,880 --> 00:04:48,270 the payload of an Ethernet packet 94 00:04:48,270 --> 00:04:51,280 might contain the destination address, 95 00:04:51,280 --> 00:04:53,380 the source address, the type. 96 00:04:53,380 --> 00:04:55,570 So we'll talk more about what the type field means 97 00:04:55,570 --> 00:04:59,830 in a minute, the data, and some checksum information that 98 00:04:59,830 --> 00:05:03,040 can be used to detect errors. 99 00:05:03,040 --> 00:05:06,206 And the preamble is a special code 100 00:05:06,206 --> 00:05:07,580 that is attached to the beginning 101 00:05:07,580 --> 00:05:09,070 of every one of these messages. 102 00:05:09,070 --> 00:05:11,880 And this is used to make the Manchester encoding, which 103 00:05:11,880 --> 00:05:15,410 you remember we talked about last class. 104 00:05:15,410 --> 00:05:18,130 This is used, sorry, to allow the phase lock 105 00:05:18,130 --> 00:05:20,790 loop to lock into the message, which we talked about 106 00:05:20,790 --> 00:05:22,080 at last class. 107 00:05:22,080 --> 00:05:24,100 And it might be, in the case of Ethernet, 108 00:05:24,100 --> 00:05:27,050 it's a well-defined sequence: one, zero, one, zero, one, 109 00:05:27,050 --> 00:05:28,076 zero, one, zero. 110 00:05:28,076 --> 00:05:29,450 But remember that with Manchester 111 00:05:29,450 --> 00:05:32,740 encoding that the data that's actually transmitted 112 00:05:32,740 --> 00:05:34,790 looks a little bit different. 113 00:05:34,790 --> 00:05:36,430 And then following the preamble, there 114 00:05:36,430 --> 00:05:38,270 is this start of frame symbol. 115 00:05:38,270 --> 00:05:39,820 And then at the end of the message, 116 00:05:39,820 --> 00:05:42,290 there's this end symbol. 117 00:05:42,290 --> 00:05:44,260 So, one thing we might be concerned about 118 00:05:44,260 --> 00:05:47,050 is, say, for example what if the network 119 00:05:47,050 --> 00:05:48,820 layer tries to send a message that 120 00:05:48,820 --> 00:05:51,110 contains the end symbol in it? 121 00:05:51,110 --> 00:05:57,020 that would be a problem, right, because then the end 122 00:05:57,020 --> 00:05:59,840 layer would have inadvertently terminated the message, 123 00:05:59,840 --> 00:06:02,090 even though this wasn't really the end of the message, 124 00:06:02,090 --> 00:06:03,590 this is just something that happened 125 00:06:03,590 --> 00:06:06,930 to be the same code as whatever the link layer had chosen 126 00:06:06,930 --> 00:06:09,580 for its end of code symbol. 127 00:06:09,580 --> 00:06:12,186 And the reason that this is a concern is, remember, 128 00:06:12,186 --> 00:06:13,810 we don't want the network layer to have 129 00:06:13,810 --> 00:06:16,750 to understand lots of details about how the link layer 130 00:06:16,750 --> 00:06:18,140 operates underneath it, right? 131 00:06:18,140 --> 00:06:20,690 The network layer shouldn't have to make any assumptions 132 00:06:20,690 --> 00:06:23,300 about what our valid symbols for it to transmit, 133 00:06:23,300 --> 00:06:26,090 and what are invalid symbols for it to transmit. 134 00:06:26,090 --> 00:06:27,820 So the way that we're going to solve this 135 00:06:27,820 --> 00:06:29,300 is through one of two techniques. 136 00:06:29,300 --> 00:06:33,550 One: so the first technique that will talk about 137 00:06:33,550 --> 00:06:36,290 for a moment is this idea of bit stuffing. 138 00:06:39,942 --> 00:06:41,150 I'll get to that in a minute. 139 00:06:41,150 --> 00:06:42,860 Another simple thing that we could do 140 00:06:42,860 --> 00:06:46,800 would be to simply use a code that can't possibly 141 00:06:46,800 --> 00:06:49,450 be generated by, say for example, the Manchester 142 00:06:49,450 --> 00:06:50,430 encoding scheme. 143 00:06:50,430 --> 00:06:53,940 So if the network layer sends a message like one, one, one, 144 00:06:53,940 --> 00:06:57,080 one, the link layer is going to convert that 145 00:06:57,080 --> 00:06:59,070 into some sequence of ones and zeros 146 00:06:59,070 --> 00:07:00,700 once it applies Manchester coding. 147 00:07:00,700 --> 00:07:03,530 So if the link layer on the receiver 148 00:07:03,530 --> 00:07:05,960 sees a message like one, one, one, one, one, 149 00:07:05,960 --> 00:07:08,820 that can't possibly be a valid code. 150 00:07:08,820 --> 00:07:12,930 That can't possibly be a valid message 151 00:07:12,930 --> 00:07:15,100 that could have been generated by the network layer. 152 00:07:15,100 --> 00:07:17,766 Only the link layer can actually send that sequence of bits out. 153 00:07:17,766 --> 00:07:20,840 So we could tell that would be a terminating symbol. 154 00:07:20,840 --> 00:07:23,840 Another simple way, though, to send one of these end codes 155 00:07:23,840 --> 00:07:26,030 is using this technique called bit stuffing. 156 00:07:26,030 --> 00:07:27,655 And the idea is pretty simple, and it's 157 00:07:27,655 --> 00:07:32,580 kind of a neat technique that can be used in general when 158 00:07:32,580 --> 00:07:35,830 you have to do this kind of encoding a lower layer. 159 00:07:35,830 --> 00:07:37,470 So the idea is, suppose we set our end 160 00:07:37,470 --> 00:07:43,270 code was equal to some bit string like one, one, one, one. 161 00:07:43,270 --> 00:07:46,900 And, the solution in bit stuffing is very simple. 162 00:07:46,900 --> 00:07:50,580 What it says is that when you receive a sequence of bytes 163 00:07:50,580 --> 00:07:54,100 or sequence of bits from the network layer at the link 164 00:07:54,100 --> 00:07:57,510 layer, it says that you should convert any sequence of bytes 165 00:07:57,510 --> 00:08:00,300 that look like one, one, one, three ones in a row, 166 00:08:00,300 --> 00:08:03,420 into three ones in a row followed by a zero. 167 00:08:03,420 --> 00:08:07,020 So this happens at the center. 168 00:08:07,020 --> 00:08:10,560 And then the receiver just reverses this, 169 00:08:10,560 --> 00:08:14,310 says any sequence of one, one, one, zero, gets converted 170 00:08:14,310 --> 00:08:15,680 to one, one, one, one. 171 00:08:15,680 --> 00:08:17,790 OK, so you could see that this means, 172 00:08:17,790 --> 00:08:19,980 and this transform is only applied 173 00:08:19,980 --> 00:08:22,250 to the payload of data packets that it's 174 00:08:22,250 --> 00:08:24,930 coming from the network layer down into the link layer. 175 00:08:24,930 --> 00:08:27,740 OK, so you can see that there is no way for the link layer, 176 00:08:27,740 --> 00:08:31,000 now, to send a sequence, or for the network layer 177 00:08:31,000 --> 00:08:35,929 to actually cause four one's in a row 178 00:08:35,929 --> 00:08:38,809 to be sent out over the wire because of this transformation. 179 00:08:38,809 --> 00:08:43,100 So if the network layer tries to send a message that 180 00:08:43,100 --> 00:08:46,520 contains a sequence with four ones, what the link layer is 181 00:08:46,520 --> 00:08:51,940 going to send is three ones followed 182 00:08:51,940 --> 00:08:53,759 by a zero followed by a one. 183 00:08:53,759 --> 00:08:55,300 Notice, however, that this also means 184 00:08:55,300 --> 00:08:58,270 that if the network layer tries to send a sequence of three 185 00:08:58,270 --> 00:09:03,100 ones followed by a zero, the link layer will transmit three 186 00:09:03,100 --> 00:09:05,920 ones followed by two zeros, OK? 187 00:09:05,920 --> 00:09:08,000 And then at the receiving end, we 188 00:09:08,000 --> 00:09:10,840 can just trivially apply this reverse transformation. 189 00:09:10,840 --> 00:09:12,450 So this idea of bit stuffing allows 190 00:09:12,450 --> 00:09:19,340 us to guarantee that any time that the link 191 00:09:19,340 --> 00:09:20,840 layer on the receiving side actually 192 00:09:20,840 --> 00:09:23,732 sees four ones in a row, this is really the end symbol as 193 00:09:23,732 --> 00:09:25,690 opposed to the network layer trying to transmit 194 00:09:25,690 --> 00:09:28,260 four ones in a row, OK? 195 00:09:28,260 --> 00:09:32,170 So that's all I want to say about the network layer 196 00:09:32,170 --> 00:09:34,230 or about the link layer. 197 00:09:34,230 --> 00:09:35,730 And what I want to do now is to move 198 00:09:35,730 --> 00:09:37,430 on to a discussion of the network layer. 199 00:09:52,390 --> 00:09:54,188 So the network layer -- 200 00:09:56,940 --> 00:10:02,720 -- has two primary functions that we're going to talk about 201 00:10:02,720 --> 00:10:03,740 today. 202 00:10:03,740 --> 00:10:05,165 The first was forwarding. 203 00:10:09,817 --> 00:10:10,900 And the second is routing. 204 00:10:15,180 --> 00:10:16,980 So the idea was forwarding is as follows. 205 00:10:20,300 --> 00:10:22,550 So the idea was forwarding is basically 206 00:10:22,550 --> 00:10:28,110 to allow nodes to decide, given a particular packet 207 00:10:28,110 --> 00:10:31,120 to allow them to decide what the next hop for that packet 208 00:10:31,120 --> 00:10:33,850 should be by looking at the destination address 209 00:10:33,850 --> 00:10:36,346 deaths in the message that they are trying to transmit. 210 00:10:36,346 --> 00:10:38,470 So they're going to look at the destination address 211 00:10:38,470 --> 00:10:41,045 and make some decision about where to send this packet next. 212 00:10:41,045 --> 00:10:42,670 And they're going to do that by keeping 213 00:10:42,670 --> 00:10:44,860 a table that basically maps every address 214 00:10:44,860 --> 00:10:48,742 into the next link to send to. 215 00:10:48,742 --> 00:10:50,450 So let's look at a really simple example. 216 00:10:58,510 --> 00:11:03,880 Suppose we have five machines, A, B, C, D, and E -- 217 00:11:03,880 --> 00:11:08,230 -- connected as follows. 218 00:11:14,030 --> 00:11:16,480 And let's number these links. 219 00:11:16,480 --> 00:11:20,010 Let's number this link from E to B. 220 00:11:20,010 --> 00:11:21,150 We're going to call it L1. 221 00:11:21,150 --> 00:11:25,710 We're going to letter this link E to D L2. 222 00:11:25,710 --> 00:11:27,870 And then, I'm going to number all the links sort 223 00:11:27,870 --> 00:11:28,820 of in the same way. 224 00:11:28,820 --> 00:11:29,950 So, B's link to A. 225 00:11:29,950 --> 00:11:31,120 I'll number L1. 226 00:11:31,120 --> 00:11:34,500 B's link to D I'll number L2, and B's link to E I'll 227 00:11:34,500 --> 00:11:35,390 number L3. 228 00:11:35,390 --> 00:11:39,199 So, notice that this link, I've given two names to this link 229 00:11:39,199 --> 00:11:40,990 depending on whether we're talking about it 230 00:11:40,990 --> 00:11:42,560 from a perspective of B or E. 231 00:11:42,560 --> 00:11:46,385 OK, so now we can do the same numbering 232 00:11:46,385 --> 00:11:47,510 for all of the other links. 233 00:11:47,510 --> 00:11:49,160 So, call this L1. 234 00:11:49,160 --> 00:11:50,120 Call this L2. 235 00:11:50,120 --> 00:11:51,570 Call this L3. 236 00:11:51,570 --> 00:11:55,990 And, this one is L1, L2 from C's perspective. 237 00:11:55,990 --> 00:11:59,180 And this is L1 and L2 from A's perspective. 238 00:11:59,180 --> 00:12:01,380 So now we have this labeled graph here. 239 00:12:01,380 --> 00:12:04,570 And now let's look and see what the forwarding table for one 240 00:12:04,570 --> 00:12:05,880 of these nodes might look like. 241 00:12:05,880 --> 00:12:07,820 So, for example, if we look at the forwarding 242 00:12:07,820 --> 00:12:11,450 table for node A, what we'll see is 243 00:12:11,450 --> 00:12:17,610 one entry for each of the other nodes that are in the network. 244 00:12:17,610 --> 00:12:21,180 And this entry will tell us, given a message destined 245 00:12:21,180 --> 00:12:25,170 for this, whatever address is in, this is the destination 246 00:12:25,170 --> 00:12:26,540 address. 247 00:12:26,540 --> 00:12:28,760 So given a particular destination address, 248 00:12:28,760 --> 00:12:33,850 it will tell us what the next link we should use is. 249 00:12:33,850 --> 00:12:39,060 OK so, and this is the forwarding table 250 00:12:39,060 --> 00:12:40,320 for a particular node. 251 00:12:40,320 --> 00:12:42,320 So in this case, we're looking at the forwarding 252 00:12:42,320 --> 00:12:43,080 table for node A. 253 00:12:43,080 --> 00:12:46,720 So, if A sees a node destined to node A, what should 254 00:12:46,720 --> 00:12:47,330 it do with it? 255 00:12:52,050 --> 00:12:53,784 Well, it's destined to its local mode. 256 00:12:53,784 --> 00:12:56,200 So it's going to do the obvious thing, which is send it up 257 00:12:56,200 --> 00:12:57,199 to the end to end layer. 258 00:12:57,199 --> 00:12:59,710 So I'll just write E to E. 259 00:12:59,710 --> 00:13:07,620 So if it receives a node destined for B, it's going to, 260 00:13:07,620 --> 00:13:10,200 presumably it wants to send it along whatever the shortest 261 00:13:10,200 --> 00:13:10,750 path is. 262 00:13:10,750 --> 00:13:13,369 And we'll talk about how the next step, routing is actually 263 00:13:13,369 --> 00:13:14,910 deciding which thing should be there. 264 00:13:14,910 --> 00:13:18,640 But, for example, it might have L2 as the next link. 265 00:13:18,640 --> 00:13:20,430 OK, and if it wants to send to C, 266 00:13:20,430 --> 00:13:22,100 it might have L1 as the next link. 267 00:13:22,100 --> 00:13:26,440 So, A to B is using, it's using L2, and A to C it's using L1. 268 00:13:26,440 --> 00:13:30,760 OK, now, node D is, say if it wants to route to D, 269 00:13:30,760 --> 00:13:34,290 it's going to have to route through either B or C. 270 00:13:34,290 --> 00:13:37,010 And so, for now, let's just say it routes to L1. 271 00:13:37,010 --> 00:13:39,330 And so, it routes to C, and then it's 272 00:13:39,330 --> 00:13:42,120 going to allow C to go ahead and forward the packet onto D. 273 00:13:42,120 --> 00:13:44,720 If it wants to route to E, well, again, it 274 00:13:44,720 --> 00:13:46,432 can either route through B or through C. 275 00:13:46,432 --> 00:13:48,390 But let's say maybe it wants to route through B 276 00:13:48,390 --> 00:13:50,300 because it has a shorter path. 277 00:13:50,300 --> 00:13:54,580 So, we'll write L2 here. 278 00:13:54,580 --> 00:14:00,320 OK, so this is just a very simple example. 279 00:14:00,320 --> 00:14:03,200 Now you can see that any time that A wants to send a packet, 280 00:14:03,200 --> 00:14:05,900 it has a next hop that it should use for every destination 281 00:14:05,900 --> 00:14:07,300 address within the network. 282 00:14:07,300 --> 00:14:08,700 So, this is very simple. 283 00:14:08,700 --> 00:14:14,070 And this is sort of a high level the way that forwarding works. 284 00:14:14,070 --> 00:14:15,720 Of course, there are some other details 285 00:14:15,720 --> 00:14:19,550 associated with getting forwarding to work properly. 286 00:14:19,550 --> 00:14:22,880 In order to sort of talk about how forwarding actually works, 287 00:14:22,880 --> 00:14:27,970 the interaction between these layers, what I want to do 288 00:14:27,970 --> 00:14:31,090 is just give you some examples of what the packet headers look 289 00:14:31,090 --> 00:14:33,840 like for different kinds of protocols that 290 00:14:33,840 --> 00:14:35,100 are used in the real world. 291 00:14:35,100 --> 00:14:38,280 So we're talking about here, this is the IPV4 header. 292 00:14:38,280 --> 00:14:43,054 So, remember, IP is a protocol that runs at the network layer. 293 00:14:43,054 --> 00:14:45,220 And this header has the following information in it. 294 00:14:45,220 --> 00:14:48,310 So, what I've shown here down the left side 295 00:14:48,310 --> 00:14:50,350 is a sequence of words. 296 00:14:50,350 --> 00:14:54,150 So these are 32-bit words. 297 00:14:54,150 --> 00:14:57,100 And I'd just broken up the bits by number along the top. 298 00:14:57,100 --> 00:15:03,179 So, the first sort of word has information 299 00:15:03,179 --> 00:15:05,470 about the version of the protocol that's running in it. 300 00:15:05,470 --> 00:15:07,550 So in this case the version would be four 301 00:15:07,550 --> 00:15:09,040 because this is IPV4. 302 00:15:09,040 --> 00:15:11,460 There's a new IP protocol that is 303 00:15:11,460 --> 00:15:13,450 in the process of being deployed called 304 00:15:13,450 --> 00:15:16,450 IPV6, which you'll sometimes see referenced. 305 00:15:16,450 --> 00:15:18,369 There's a header length field. 306 00:15:18,369 --> 00:15:20,160 It just specifies the length of the header. 307 00:15:20,160 --> 00:15:21,800 There's a TOS field. 308 00:15:21,800 --> 00:15:22,920 This is type of service. 309 00:15:22,920 --> 00:15:25,544 It's typically not used in most packets. 310 00:15:25,544 --> 00:15:26,960 And then there's the packet length 311 00:15:26,960 --> 00:15:28,660 which is the entire length of the whole packet, 312 00:15:28,660 --> 00:15:30,076 not just the length of the header. 313 00:15:30,076 --> 00:15:32,320 So this should be fairly straightforward 314 00:15:32,320 --> 00:15:33,820 except for the type of service field 315 00:15:33,820 --> 00:15:42,580 which you guys don't need to pay any attention to. 316 00:15:42,580 --> 00:15:44,930 So the next field, so there's this identification. 317 00:15:44,930 --> 00:15:49,980 The next [word?] has identification, flags, 318 00:15:49,980 --> 00:15:51,350 and fragment offset. 319 00:15:51,350 --> 00:15:53,060 Let's just look at the next one. 320 00:15:53,060 --> 00:15:55,000 And the next one has time delay of end 321 00:15:55,000 --> 00:15:56,520 to end protocol and checksum. 322 00:15:56,520 --> 00:16:02,510 So the important fields, I'm blanking 323 00:16:02,510 --> 00:16:05,200 on what the identification field contains, 324 00:16:05,200 --> 00:16:08,140 which is why I'm stalling. 325 00:16:08,140 --> 00:16:12,340 So the identification field, so let's 326 00:16:12,340 --> 00:16:14,090 just talk about the other fields and we'll 327 00:16:14,090 --> 00:16:18,460 come back to identification if I remember it. 328 00:16:18,460 --> 00:16:21,530 So the flag's field simply contains some information 329 00:16:21,530 --> 00:16:24,980 about whether this packet has been fragmented 330 00:16:24,980 --> 00:16:25,980 or should be fragmented. 331 00:16:25,980 --> 00:16:29,900 So fragmentation is something that this packet can be split 332 00:16:29,900 --> 00:16:31,510 into multiple sub packets. 333 00:16:31,510 --> 00:16:34,470 You don't need to worry about it too much. 334 00:16:34,470 --> 00:16:36,500 And the fragment offset as if this packet has 335 00:16:36,500 --> 00:16:38,930 been split into these sub packets, these fragments. 336 00:16:38,930 --> 00:16:41,060 Then this is the number of the fragment that's 337 00:16:41,060 --> 00:16:43,780 being transmitted so, the interesting ones 338 00:16:43,780 --> 00:16:44,930 now come in this next row. 339 00:16:44,930 --> 00:16:46,520 So, we have the time to live flag, 340 00:16:46,520 --> 00:16:48,980 the end to end protocol, and then the checksum. 341 00:16:48,980 --> 00:16:54,640 So, the time to live field is sometimes abbreviated TTL. 342 00:16:54,640 --> 00:16:58,107 And time to live is a little bit of a strange name for it. 343 00:16:58,107 --> 00:17:00,440 Basically what this says is that as this packet is being 344 00:17:00,440 --> 00:17:02,000 forwarded through the network, we're 345 00:17:02,000 --> 00:17:04,584 going to decrement the time to live by one on every step 346 00:17:04,584 --> 00:17:06,250 that it's forwarded through the network. 347 00:17:06,250 --> 00:17:07,960 And if the time to live reaches zero, 348 00:17:07,960 --> 00:17:09,589 we're going to stop forwarding this. 349 00:17:09,589 --> 00:17:11,470 So the reason that we care about time to live 350 00:17:11,470 --> 00:17:16,250 is that there can sometimes be loops and are fording routes. 351 00:17:16,250 --> 00:17:18,030 So suppose that we had set this up 352 00:17:18,030 --> 00:17:23,300 so that A sends messages destined for, say, A sent 353 00:17:23,300 --> 00:17:26,920 messages destined for E through C. 354 00:17:26,920 --> 00:17:30,752 But C sent messages destined through E through A, right? 355 00:17:30,752 --> 00:17:32,960 So that would be a loop, and that would be a problem. 356 00:17:32,960 --> 00:17:36,210 So, we're going to try and avoid forming these loops 357 00:17:36,210 --> 00:17:38,142 when we do our routing protocol. 358 00:17:38,142 --> 00:17:40,100 But they're going to be certain situations when 359 00:17:40,100 --> 00:17:42,730 those fail, for example, that loops can occasionally occur. 360 00:17:42,730 --> 00:17:44,605 And we're going to use the time to live field 361 00:17:44,605 --> 00:17:46,350 to eliminate those. 362 00:17:46,350 --> 00:17:48,100 The next thing is the end to end protocol. 363 00:17:48,100 --> 00:17:54,410 So the end to end protocol is the specification 364 00:17:54,410 --> 00:17:57,040 of which end to end protocol we should 365 00:17:57,040 --> 00:17:59,200 forward this message onto. 366 00:17:59,200 --> 00:18:01,009 So I'll talk about that more in a second. 367 00:18:01,009 --> 00:18:02,550 And then there's this checksum field, 368 00:18:02,550 --> 00:18:06,730 which can be used to determine whether the message was fully 369 00:18:06,730 --> 00:18:11,060 formed, although it turns out that in most cases in IP, 370 00:18:11,060 --> 00:18:13,104 this field probably isn't used. 371 00:18:13,104 --> 00:18:14,770 So, and then there is the source address 372 00:18:14,770 --> 00:18:15,853 and a destination address. 373 00:18:15,853 --> 00:18:18,020 So these are IP addresses that identify 374 00:18:18,020 --> 00:18:21,180 the endpoints of the packet and then, finally, there 375 00:18:21,180 --> 00:18:23,920 is some additional, optional information 376 00:18:23,920 --> 00:18:27,900 which can specify a huge range of different things. 377 00:18:27,900 --> 00:18:29,190 It can be up to 44 bytes. 378 00:18:29,190 --> 00:18:31,530 In this case, you don't need to worry about it. 379 00:18:31,530 --> 00:18:33,080 And then finally there's the payload, 380 00:18:33,080 --> 00:18:35,340 which is the actual message that was sent from the end 381 00:18:35,340 --> 00:18:38,209 to end layer into the IP layer. 382 00:18:38,209 --> 00:18:39,750 So what you see happening here, if we 383 00:18:39,750 --> 00:18:51,600 look at a diagram of what the interface between the end 384 00:18:51,600 --> 00:18:55,160 to end layer, what the interface between the network layer 385 00:18:55,160 --> 00:18:56,400 and link layer is. 386 00:18:56,400 --> 00:19:01,240 So let's just look at our three layers again. 387 00:19:01,240 --> 00:19:02,910 We have our end to end layer. 388 00:19:02,910 --> 00:19:05,640 We have our network layer. 389 00:19:05,640 --> 00:19:08,840 And we have our link layer. 390 00:19:08,840 --> 00:19:11,630 And one of the things that we can pick out here 391 00:19:11,630 --> 00:19:13,310 is that notice that we have this end 392 00:19:13,310 --> 00:19:15,680 to end protocol that's actually in our IP packet 393 00:19:15,680 --> 00:19:19,250 so what this means is that if I have a network protocol like IP 394 00:19:19,250 --> 00:19:23,270 that's running here, when it receives a packet destined 395 00:19:23,270 --> 00:19:26,270 for its local address, say, destined to itself where it's 396 00:19:26,270 --> 00:19:28,490 supposed to forward it up to the end to end layer, 397 00:19:28,490 --> 00:19:31,120 it can actually dispatch this packet to a number 398 00:19:31,120 --> 00:19:33,020 of different end to end layers. 399 00:19:33,020 --> 00:19:36,800 So, for example, we talked last time about the TCP protocol. 400 00:19:36,800 --> 00:19:38,660 But there are a number of other end 401 00:19:38,660 --> 00:19:41,234 to end layers that can be used in the Internet. 402 00:19:41,234 --> 00:19:42,900 So we'll talk in this class a little bit 403 00:19:42,900 --> 00:19:44,756 about a different protocol called UDP. 404 00:19:44,756 --> 00:19:45,880 We'll talk about this more. 405 00:19:45,880 --> 00:19:48,230 We'll talk about the end to end layer more next time. 406 00:19:48,230 --> 00:19:51,390 But the point is that this up call to the layer above us 407 00:19:51,390 --> 00:19:55,560 is controlled by the contents of this header that we have. 408 00:19:55,560 --> 00:20:01,440 So similarly, if we look an Ethernet header, what 409 00:20:01,440 --> 00:20:06,190 the Ethernet header has on it is the destination address, which 410 00:20:06,190 --> 00:20:09,760 is 48 bits, and the source address which are 48 bits, 411 00:20:09,760 --> 00:20:12,920 followed by a link protocol. 412 00:20:12,920 --> 00:20:15,710 So the link protocol says, and so the Ethernet, remember, 413 00:20:15,710 --> 00:20:18,140 is a link layer protocol. 414 00:20:18,140 --> 00:20:23,840 And what happens is, so if we have Ethernet here, 415 00:20:23,840 --> 00:20:28,060 it has a protocol ID that specifies the protocol 416 00:20:28,060 --> 00:20:30,970 that it's supposed to send messages back up to. 417 00:20:30,970 --> 00:20:35,380 OK, so these fields, one question you might ask 418 00:20:35,380 --> 00:20:38,490 is, well, how does the Ethernet layer know which link protocol 419 00:20:38,490 --> 00:20:40,530 it should send messages to? 420 00:20:40,530 --> 00:20:43,380 Or how does the network protocol know which end to end protocol 421 00:20:43,380 --> 00:20:45,520 to send its messages to? 422 00:20:45,520 --> 00:20:50,480 So it's kind of interesting and it's worth 423 00:20:50,480 --> 00:20:53,382 looking at the pseudocode for one of these protocols 424 00:20:53,382 --> 00:20:54,840 just quickly in order to understand 425 00:20:54,840 --> 00:20:56,280 this a little bit better. 426 00:20:56,280 --> 00:21:00,010 So let's look at the pseudocode for the function 427 00:21:00,010 --> 00:21:04,350 which we're going to call Net Handle that accepts messages 428 00:21:04,350 --> 00:21:07,310 either from the end to end layer to be sent out 429 00:21:07,310 --> 00:21:10,240 across the network, or from the link layer 430 00:21:10,240 --> 00:21:12,147 when a message is sort of received 431 00:21:12,147 --> 00:21:13,230 as it's forwarded through. 432 00:21:13,230 --> 00:21:15,660 So we can use this procedure both for down calls 433 00:21:15,660 --> 00:21:18,370 and up calls, and it accepts a packet 434 00:21:18,370 --> 00:21:21,632 which, say for example, has this format that I've shown here, 435 00:21:21,632 --> 00:21:23,340 which is the same as the format that I've 436 00:21:23,340 --> 00:21:25,097 shown on the other page. 437 00:21:25,097 --> 00:21:26,680 So the first thing this is going to do 438 00:21:26,680 --> 00:21:28,721 is it's going to check and see if the destination 439 00:21:28,721 --> 00:21:31,054 of the packet, for example, is the local address. 440 00:21:31,054 --> 00:21:33,470 And if the destination of the packet is the local address, 441 00:21:33,470 --> 00:21:35,910 then we know what we should do with it, right? 442 00:21:35,910 --> 00:21:38,920 We're going to pass it up to the end and layer. 443 00:21:38,920 --> 00:21:42,320 And we're going to send, so what we're going to do 444 00:21:42,320 --> 00:21:44,800 is we're going to de-encapsulate this packet, right? 445 00:21:44,800 --> 00:21:46,200 We are going to strip the header off of it. 446 00:21:46,200 --> 00:21:48,783 So we're just going to send the payload up to the layer above, 447 00:21:48,783 --> 00:21:50,489 but we're going to need to dispatch 448 00:21:50,489 --> 00:21:52,030 to the appropriate layer, which we're 449 00:21:52,030 --> 00:21:54,097 going to do by sort of saying and naming 450 00:21:54,097 --> 00:21:56,680 what the end to end protocol is that we would like to dispatch 451 00:21:56,680 --> 00:21:58,230 to. 452 00:21:58,230 --> 00:22:00,220 And there may be some other options 453 00:22:00,220 --> 00:22:02,130 that we pass along with this as well. 454 00:22:02,130 --> 00:22:04,780 So that's what the three dots there mean. 455 00:22:04,780 --> 00:22:07,510 So now, if this isn't for the local packet, 456 00:22:07,510 --> 00:22:10,330 for the local node, then we need to send this packet out again, 457 00:22:10,330 --> 00:22:10,830 right? 458 00:22:10,830 --> 00:22:12,246 So what we're going to do is we're 459 00:22:12,246 --> 00:22:16,100 going to check the time to live on this packet. 460 00:22:16,100 --> 00:22:18,030 And if the time to live is greater than zero, 461 00:22:18,030 --> 00:22:22,310 then we are going to decrement the time to live. 462 00:22:22,310 --> 00:22:24,780 If the time to live is less than or equal to zero, 463 00:22:24,780 --> 00:22:28,080 then we know that we're not going to forward this packet 464 00:22:28,080 --> 00:22:28,580 anymore. 465 00:22:28,580 --> 00:22:29,746 We're just going to drop it. 466 00:22:29,746 --> 00:22:31,410 So the time to live gets set initially 467 00:22:31,410 --> 00:22:33,160 by the first guy who sends the packet out. 468 00:22:33,160 --> 00:22:35,680 He initializes it to some value, which 469 00:22:35,680 --> 00:22:38,150 is the maximum number of hops that he wants this message 470 00:22:38,150 --> 00:22:40,150 to be propagated for. 471 00:22:40,150 --> 00:22:43,260 And so, after we decrement the time to live, 472 00:22:43,260 --> 00:22:46,290 we're going to look up in our forwarding table 473 00:22:46,290 --> 00:22:48,450 the next link that we want to use. 474 00:22:48,450 --> 00:22:52,299 OK, and what I've shown here is that we're 475 00:22:52,299 --> 00:22:53,840 going to look up the sort of protocol 476 00:22:53,840 --> 00:22:57,600 to use and the name of the next link. 477 00:22:57,600 --> 00:23:02,450 So, for example, this IP layer might 478 00:23:02,450 --> 00:23:05,000 have Ethernet underneath it, which might be one protocol. 479 00:23:05,000 --> 00:23:08,560 But there might also be a WiFi layer 480 00:23:08,560 --> 00:23:11,320 that's here that we could also send messages out. 481 00:23:11,320 --> 00:23:17,080 So we could send out through either one of these protocols. 482 00:23:17,080 --> 00:23:18,830 So we look up the one we want to send out, 483 00:23:18,830 --> 00:23:20,700 and then we call this link send routine, 484 00:23:20,700 --> 00:23:22,910 which actually does the transmission out 485 00:23:22,910 --> 00:23:26,470 over the appropriate named link. 486 00:23:26,470 --> 00:23:30,740 Notice now what I've specified, I have this [NETPROT?] in all 487 00:23:30,740 --> 00:23:31,360 caps here. 488 00:23:31,360 --> 00:23:34,710 So in this case, this should be, for example, IP. 489 00:23:34,710 --> 00:23:36,400 It's the name of the network protocol. 490 00:23:36,400 --> 00:23:38,890 So when the network protocol sends the message to the link 491 00:23:38,890 --> 00:23:41,480 layer below it, it specifies what the network protocol 492 00:23:41,480 --> 00:23:44,730 is that wants to have returned, that it 493 00:23:44,730 --> 00:23:46,150 wants to be called on return. 494 00:23:46,150 --> 00:23:48,674 So it says, please link layer; when 495 00:23:48,674 --> 00:23:50,840 you have received a message that needs to be sent up 496 00:23:50,840 --> 00:23:53,640 to the network layer, dispatch it to the network layer named 497 00:23:53,640 --> 00:23:54,900 NETPROT. 498 00:23:54,900 --> 00:24:00,020 OK, and then for example the TTL we 499 00:24:00,020 --> 00:24:02,760 can't transmit the message out. 500 00:24:02,760 --> 00:24:04,196 TTL has expired. 501 00:24:04,196 --> 00:24:05,820 If we've sent it too many hops already, 502 00:24:05,820 --> 00:24:08,278 then we're going to need to do some kind of error handling. 503 00:24:08,278 --> 00:24:11,600 In this case, error handling might be, send a message back 504 00:24:11,600 --> 00:24:14,300 to the source address of this message, 505 00:24:14,300 --> 00:24:16,440 and tell them that the TTL ran out on this message. 506 00:24:16,440 --> 00:24:17,940 That will be one thing you could do. 507 00:24:17,940 --> 00:24:20,106 Another thing you might do is simply drop the packet 508 00:24:20,106 --> 00:24:21,810 or ignore the error. 509 00:24:21,810 --> 00:24:23,870 OK, so this is just a simple example 510 00:24:23,870 --> 00:24:28,432 of how forwarding might work. 511 00:24:28,432 --> 00:24:30,140 And what I wanted to use it to illustrate 512 00:24:30,140 --> 00:24:33,300 is the fact that there can be multiple different link 513 00:24:33,300 --> 00:24:35,680 layers at the bottom that can be dispatched to. 514 00:24:35,680 --> 00:24:37,740 And these link layers can, in fact, 515 00:24:37,740 --> 00:24:41,230 dispatch up to multiple different network layers 516 00:24:41,230 --> 00:24:41,770 as well. 517 00:24:41,770 --> 00:24:44,970 So in today's Internet, it's uncommon to see, 518 00:24:44,970 --> 00:24:47,220 you'll rarely interact with anything 519 00:24:47,220 --> 00:24:50,900 that's not using IP at some layer or some network layer. 520 00:24:50,900 --> 00:24:52,570 But there have, in the past, been 521 00:24:52,570 --> 00:24:55,230 a variety of different network layers that have been proposed. 522 00:24:55,230 --> 00:24:57,400 You guys may have seen an old protocol 523 00:24:57,400 --> 00:24:59,650 from Novell called IPX, or you may 524 00:24:59,650 --> 00:25:04,040 have used AppleTalk, which is an Apple protocol that 525 00:25:04,040 --> 00:25:07,585 in some varieties also runs at the IP layer. 526 00:25:07,585 --> 00:25:08,960 Finally, I just want to point out 527 00:25:08,960 --> 00:25:12,260 that the last little layering detail that I want to get to 528 00:25:12,260 --> 00:25:16,740 is that if you think about the link layer 529 00:25:16,740 --> 00:25:18,690 from the perspective of the network layer, 530 00:25:18,690 --> 00:25:21,680 the link layer is simply, the link 531 00:25:21,680 --> 00:25:24,280 just looks like one hop to one more connection. 532 00:25:24,280 --> 00:25:27,540 But in fact, these links can, themselves, be networks. 533 00:25:27,540 --> 00:25:29,549 So it's just kind of a weird statement. 534 00:25:29,549 --> 00:25:31,340 But here's a simple example of what I mean. 535 00:25:31,340 --> 00:25:35,380 Suppose that this link layer, that one of the link 536 00:25:35,380 --> 00:25:37,530 layers that the IP layers can send a message to 537 00:25:37,530 --> 00:25:40,457 is a modem connection, OK? 538 00:25:40,457 --> 00:25:42,540 But if you think about what a modem connection is, 539 00:25:42,540 --> 00:25:45,060 right, it's a connection out over a phone line. 540 00:25:45,060 --> 00:25:46,596 And a phone line is, itself, right, 541 00:25:46,596 --> 00:25:48,470 as we talked about at the beginning of class, 542 00:25:48,470 --> 00:25:50,732 a phone line is, itself, a kind of the network. 543 00:25:50,732 --> 00:25:52,690 Right, it's this kind of circuit-switched thing 544 00:25:52,690 --> 00:25:55,310 that goes through multiple ones of these circuit 545 00:25:55,310 --> 00:25:57,150 switches as opposed to going through these. 546 00:25:57,150 --> 00:26:00,710 So underneath the modem, the modem layer, 547 00:26:00,710 --> 00:26:05,340 which looks like a link to the network layer, 548 00:26:05,340 --> 00:26:08,850 there's actually, these link layers can actually themselves 549 00:26:08,850 --> 00:26:10,370 be composed of a number of links, 550 00:26:10,370 --> 00:26:12,780 and they can, themselves, be a type of a network. 551 00:26:12,780 --> 00:26:14,767 So it's sort of worth realizing that there 552 00:26:14,767 --> 00:26:16,600 is a kind of hierarchical relationship, one, 553 00:26:16,600 --> 00:26:21,010 but the link layer may actually itself 554 00:26:21,010 --> 00:26:24,065 be a network consisting of multiple links, 555 00:26:24,065 --> 00:26:26,440 but from the point of view of the higher-level link layer 556 00:26:26,440 --> 00:26:28,830 here, it's just a single link, a modem connection 557 00:26:28,830 --> 00:26:32,590 to some endpoint that we can send a message over. 558 00:26:32,590 --> 00:26:39,740 OK, so what I want to do now is take you through, 559 00:26:39,740 --> 00:26:41,550 we're going to switch gears a little bit 560 00:26:41,550 --> 00:26:44,746 and talk about the sort of next piece 561 00:26:44,746 --> 00:26:46,120 that I said we needed to address, 562 00:26:46,120 --> 00:26:48,732 which is this issue of routing. 563 00:26:48,732 --> 00:26:50,690 So I said we're going to talk about forwarding, 564 00:26:50,690 --> 00:26:52,340 and then we're going to talk about something else called 565 00:26:52,340 --> 00:26:53,040 routing. 566 00:26:53,040 --> 00:27:01,810 So routing is the process by which we build up 567 00:27:01,810 --> 00:27:03,090 our forwarding tables. 568 00:27:03,090 --> 00:27:05,210 OK, so what I showed you here was I 569 00:27:05,210 --> 00:27:06,800 just sort of told you what the values 570 00:27:06,800 --> 00:27:08,570 that should go in these forwarding tables should be. 571 00:27:08,570 --> 00:27:10,361 But I didn't tell you how they were derived 572 00:27:10,361 --> 00:27:11,517 or where they came from. 573 00:27:11,517 --> 00:27:13,100 So in this case of the simple network, 574 00:27:13,100 --> 00:27:15,670 it was relatively easy for us to, by hand, 575 00:27:15,670 --> 00:27:19,900 sort of come up with a set of possible forwarding paths 576 00:27:19,900 --> 00:27:21,470 that seem reasonable. 577 00:27:21,470 --> 00:27:24,010 But you can imagine that if this network had scaled up 578 00:27:24,010 --> 00:27:25,790 to a million nodes, that's not something 579 00:27:25,790 --> 00:27:27,864 that we want any individual to have to do. 580 00:27:27,864 --> 00:27:29,280 No person should have to configure 581 00:27:29,280 --> 00:27:32,854 all these routing tables or all these forwarding tables. 582 00:27:32,854 --> 00:27:34,270 So instead, what we're going to do 583 00:27:34,270 --> 00:27:36,321 is we're going to use this process called 584 00:27:36,321 --> 00:27:38,070 routing in order to build these forwarding 585 00:27:38,070 --> 00:27:40,320 tables automatically. 586 00:27:40,320 --> 00:27:44,820 And we really want our routing protocol to be three things. 587 00:27:44,820 --> 00:27:47,540 First, we wanted to be scalable. 588 00:27:47,540 --> 00:27:49,860 And the obvious way in which we want it to be scalable 589 00:27:49,860 --> 00:27:51,026 is the way that I just said. 590 00:27:51,026 --> 00:27:53,570 We don't want to have to have people, 591 00:27:53,570 --> 00:27:55,414 we want this thing to scale up to, say, 592 00:27:55,414 --> 00:27:57,080 a million nodes or several million nodes 593 00:27:57,080 --> 00:27:58,413 and be able to continue to work. 594 00:27:58,413 --> 00:28:00,600 We shouldn't have to have people sort of involved 595 00:28:00,600 --> 00:28:03,520 with configuring, building up these forwarding tables 596 00:28:03,520 --> 00:28:05,210 at every step of the way. 597 00:28:05,210 --> 00:28:06,590 We also want it to be robust. 598 00:28:06,590 --> 00:28:11,140 So by that, I mean it should be tolerant of faults. 599 00:28:11,140 --> 00:28:14,150 If a node fails in the network, the network 600 00:28:14,150 --> 00:28:16,410 should eventually discover that that node has failed 601 00:28:16,410 --> 00:28:18,720 and be able to forward packets around the failure 602 00:28:18,720 --> 00:28:22,470 or be able to compensate for the failure if at all possible. 603 00:28:22,470 --> 00:28:24,159 Finally, we want this routing protocol 604 00:28:24,159 --> 00:28:25,325 hopefully to be distributed. 605 00:28:30,250 --> 00:28:32,970 So we don't want to have to have one machine that's 606 00:28:32,970 --> 00:28:35,800 responsible for setting up the forwarding table on all 607 00:28:35,800 --> 00:28:36,910 the other machines. 608 00:28:36,910 --> 00:28:38,730 We don't want to have one machine that 609 00:28:38,730 --> 00:28:41,174 needs to contact all of the other nodes 610 00:28:41,174 --> 00:28:43,590 and collect information about what all of their links are, 611 00:28:43,590 --> 00:28:45,631 and assemble all of those links together into one 612 00:28:45,631 --> 00:28:47,100 global forwarding scheme. 613 00:28:47,100 --> 00:28:51,460 And this really gets at the scalability again. 614 00:28:51,460 --> 00:28:54,050 So what I want to do is to take you 615 00:28:54,050 --> 00:28:55,460 through the process of routing. 616 00:28:55,460 --> 00:28:58,530 Before I do that, I just want to take a quick digression. 617 00:28:58,530 --> 00:29:01,260 We're going to start off with very tiny networks on this, 618 00:29:01,260 --> 00:29:03,782 and just talking about a very simple baby network. 619 00:29:03,782 --> 00:29:05,240 It just so that you guys don't feel 620 00:29:05,240 --> 00:29:07,080 like this is completely unrealistic, 621 00:29:07,080 --> 00:29:10,120 I want to show you that in fact the Internet at some level 622 00:29:10,120 --> 00:29:11,620 started out like this, too. 623 00:29:11,620 --> 00:29:13,020 What we're going to do it in the course of this class 624 00:29:13,020 --> 00:29:16,000 is sort of build up from these very simple networks that maybe 625 00:29:16,000 --> 00:29:19,260 look the way the Internet did at first, the schemes that 626 00:29:19,260 --> 00:29:21,740 are more like what is actually used in today's production 627 00:29:21,740 --> 00:29:22,650 Internet. 628 00:29:22,650 --> 00:29:28,010 So, sorry I went back on you guys. 629 00:29:30,730 --> 00:29:34,070 OK, so this is a picture of what the Internet look like in 1969. 630 00:29:34,070 --> 00:29:37,570 So you may not be able to read the labels on these things, 631 00:29:37,570 --> 00:29:41,330 but we're looking at three nodes here. 632 00:29:41,330 --> 00:29:47,650 This is UC Santa Barbara on the coast of California. 633 00:29:47,650 --> 00:29:49,290 It's southern central California. 634 00:29:49,290 --> 00:29:52,450 This is Stanford Research Institute, SRI, 635 00:29:52,450 --> 00:29:54,130 which is the Bay Area. 636 00:29:54,130 --> 00:29:56,990 This is Utah, and this is UCLA. 637 00:29:56,990 --> 00:30:00,180 So, this was the ARPANET, which was a precursor 638 00:30:00,180 --> 00:30:02,890 to the Internet, and was sort of one of the very first 639 00:30:02,890 --> 00:30:07,341 of these large wide-area networks 640 00:30:07,341 --> 00:30:08,340 that was ever developed. 641 00:30:08,340 --> 00:30:10,530 And each of these little square nodes 642 00:30:10,530 --> 00:30:13,630 here is a machine that's on this. 643 00:30:13,630 --> 00:30:16,810 So there were four machines on the ARPANET in 1969. 644 00:30:16,810 --> 00:30:22,290 And there were these four routers that were being used. 645 00:30:22,290 --> 00:30:24,640 So, this is 1971. 646 00:30:24,640 --> 00:30:27,410 So by 1971, there still is a cluster 647 00:30:27,410 --> 00:30:29,100 of these machines in California. 648 00:30:29,100 --> 00:30:33,122 But you notice that Illinois, Carnegie Mellon, and Boston 649 00:30:33,122 --> 00:30:34,580 have suddenly appeared on this map. 650 00:30:34,580 --> 00:30:37,650 So, MIT is here, Lincoln Labs is here, 651 00:30:37,650 --> 00:30:41,940 Harvard is here, BBN, which is another large company that 652 00:30:41,940 --> 00:30:44,670 does a lot of networking research in this area is here. 653 00:30:44,670 --> 00:30:46,300 So, the network has started to evolve. 654 00:30:46,300 --> 00:30:48,300 And in particular, you notice that there are now 655 00:30:48,300 --> 00:30:50,649 these sort of two clusters, these two regions, one 656 00:30:50,649 --> 00:30:52,440 on the West Coast and one on the East Coast 657 00:30:52,440 --> 00:30:54,360 that have a number of nodes. 658 00:30:54,360 --> 00:30:56,180 So, it just keeps growing and growing. 659 00:30:56,180 --> 00:30:58,380 So, by 1980, you see the network has 660 00:30:58,380 --> 00:30:59,840 gotten substantially larger. 661 00:30:59,840 --> 00:31:01,673 And one of the interesting things about this 662 00:31:01,673 --> 00:31:03,740 is you are starting to see a diversity of links. 663 00:31:03,740 --> 00:31:08,470 So notice that Hawaii is now connected into California 664 00:31:08,470 --> 00:31:13,220 by way of a satellite connection, as is London. 665 00:31:13,220 --> 00:31:16,410 So, we now have not only just these wires that are running, 666 00:31:16,410 --> 00:31:18,130 but in fact we have wireless links. 667 00:31:18,130 --> 00:31:20,331 But at the same time this was happening, 668 00:31:20,331 --> 00:31:22,080 all the protocols we've been talking about 669 00:31:22,080 --> 00:31:23,130 were being developed. 670 00:31:23,130 --> 00:31:24,300 And one of the whole goals of this 671 00:31:24,300 --> 00:31:26,633 was to be able to support these multiple different kinds 672 00:31:26,633 --> 00:31:29,450 of links on top of the standard networking protocol. 673 00:31:29,450 --> 00:31:32,650 OK, so by 1987, this thing has really 674 00:31:32,650 --> 00:31:36,640 become, turned into a number of decentralized networks. 675 00:31:36,640 --> 00:31:38,630 There's this large network called the ARPANET. 676 00:31:38,630 --> 00:31:41,210 There is something smaller called the NSF backbone, 677 00:31:41,210 --> 00:31:43,230 and a number of other networks that are 678 00:31:43,230 --> 00:31:44,970 military networks, and so on. 679 00:31:44,970 --> 00:31:46,910 These are all connected together, 680 00:31:46,910 --> 00:31:49,130 and they're all being, by 1987 they 681 00:31:49,130 --> 00:31:51,800 were all running this TCP/IP protocol that 682 00:31:51,800 --> 00:31:54,390 was being used to exchange information between all 683 00:31:54,390 --> 00:31:56,030 of these things. 684 00:31:56,030 --> 00:31:59,140 So roundabout a few years after this, right, 685 00:31:59,140 --> 00:32:01,460 the sort of World Wide Web suddenly happened, 686 00:32:01,460 --> 00:32:03,510 and there became this huge commercial interest 687 00:32:03,510 --> 00:32:05,290 in the Internet. 688 00:32:05,290 --> 00:32:10,490 And that has really just sparked this explosion of nodes, 689 00:32:10,490 --> 00:32:12,950 and made the network just huge and incredibly vast. 690 00:32:12,950 --> 00:32:15,710 So it's hard to see this, but in the middle of this 691 00:32:15,710 --> 00:32:18,410 you notice that there is a little orange node here. 692 00:32:18,410 --> 00:32:21,420 This bar on the left side is showing the out degree 693 00:32:21,420 --> 00:32:22,690 of the nodes in the network. 694 00:32:22,690 --> 00:32:25,005 So this number is 2,977. 695 00:32:25,005 --> 00:32:27,630 So that means there's a node at the center of the Internet that 696 00:32:27,630 --> 00:32:31,770 has 2,977 links to other nodes in it. 697 00:32:31,770 --> 00:32:35,160 OK, so this is a really incredibly large network. 698 00:32:35,160 --> 00:32:38,400 And you notice that all of these 20 or 30 699 00:32:38,400 --> 00:32:41,320 bright pink red nodes here have hundreds 700 00:32:41,320 --> 00:32:43,210 to thousands of outgoing connections 701 00:32:43,210 --> 00:32:44,099 on each one of them. 702 00:32:44,099 --> 00:32:45,640 So there is this core of the Internet 703 00:32:45,640 --> 00:32:48,580 that is very highly connected to a very 704 00:32:48,580 --> 00:32:49,850 large part of the network. 705 00:32:49,850 --> 00:32:51,840 And now, down or out around the edges 706 00:32:51,840 --> 00:32:53,570 are these much smaller networks that 707 00:32:53,570 --> 00:32:56,020 have much lower collectivity. 708 00:32:56,020 --> 00:32:57,950 And these are things like service providers, 709 00:32:57,950 --> 00:33:01,569 for example, that consumers might pay some money 710 00:33:01,569 --> 00:33:02,610 to get a connection from. 711 00:33:02,610 --> 00:33:04,443 So this is the sort of core of the Internet. 712 00:33:04,443 --> 00:33:06,781 These are the people who are not so much the end-users 713 00:33:06,781 --> 00:33:08,530 on the Internet, but the service providers 714 00:33:08,530 --> 00:33:10,682 that are providing connectivity for the end-users. 715 00:33:10,682 --> 00:33:12,390 Each one of these little nodes represents 716 00:33:12,390 --> 00:33:13,970 one of those service providers. 717 00:33:13,970 --> 00:33:15,480 This was as of 2003. 718 00:33:15,480 --> 00:33:21,477 OK, so what I want to do now is to start as I said. 719 00:33:21,477 --> 00:33:23,310 We're going to sort of start off with a baby 720 00:33:23,310 --> 00:33:24,185 version of a network. 721 00:33:24,185 --> 00:33:26,590 In particular, we're going to look how forwarding, 722 00:33:26,590 --> 00:33:29,650 or how routing might work in this very simple network 723 00:33:29,650 --> 00:33:30,620 that I've shown here. 724 00:33:30,620 --> 00:33:32,774 So let's see what happens. 725 00:33:32,774 --> 00:33:34,440 So we're going to use a protocol that we 726 00:33:34,440 --> 00:33:36,366 call path vector routing. 727 00:33:36,366 --> 00:33:37,990 And the idea behind path vector routing 728 00:33:37,990 --> 00:33:41,870 is that we're going to build up the paths from, that is, 729 00:33:41,870 --> 00:33:46,880 the sequence of nodes that we should forward messages through 730 00:33:46,880 --> 00:33:50,386 in order to reach a particular destination. 731 00:33:50,386 --> 00:33:51,760 And the way this is going to work 732 00:33:51,760 --> 00:33:54,140 is we're going to have two steps. 733 00:33:54,140 --> 00:33:58,890 So, let's put it over here. 734 00:33:58,890 --> 00:34:10,699 So routing is going to consist of two steps: an advertisement 735 00:34:10,699 --> 00:34:17,914 phase or an advertisement step, and an integration step. 736 00:34:21,995 --> 00:34:24,120 And the idea is that during the advertisement step, 737 00:34:24,120 --> 00:34:26,310 each node is going to advertise what other 738 00:34:26,310 --> 00:34:28,549 nodes it knows how to reach. 739 00:34:28,549 --> 00:34:30,090 And then during the integration step, 740 00:34:30,090 --> 00:34:33,530 each node is going to take all of the advertisements that 741 00:34:33,530 --> 00:34:36,600 heard during the previous advertisement step, 742 00:34:36,600 --> 00:34:38,560 and integrate them into a new set of routes 743 00:34:38,560 --> 00:34:41,699 that identifies the new set of nodes that this node can reach. 744 00:34:41,699 --> 00:34:45,020 OK, so this'll be very clear when I show you the example. 745 00:34:45,020 --> 00:34:47,330 So let's just look at the case of all the nodes, 746 00:34:47,330 --> 00:34:49,704 figuring out how they can reach node E. 747 00:34:49,704 --> 00:34:51,620 So what's going to happen is that first node E 748 00:34:51,620 --> 00:34:53,370 is going to send out an advertisement that 749 00:34:53,370 --> 00:34:55,940 says that node E knows how to reach node E, right, 750 00:34:55,940 --> 00:34:57,234 which it obviously does. 751 00:34:57,234 --> 00:34:58,650 And the way that it reaches node E 752 00:34:58,650 --> 00:35:00,190 is simply by forwarding a message up 753 00:35:00,190 --> 00:35:01,720 to its end to end layer. 754 00:35:01,720 --> 00:35:03,530 So it says, to reach node E, come this way. 755 00:35:03,530 --> 00:35:05,640 And it sends it out over the two links 756 00:35:05,640 --> 00:35:07,640 that it has to node C and D. 757 00:35:07,640 --> 00:35:09,550 So when node C and D hear this advertisement, 758 00:35:09,550 --> 00:35:11,800 during this integration step what they are going to do 759 00:35:11,800 --> 00:35:16,612 is to add this information about this connection to node E, 760 00:35:16,612 --> 00:35:18,820 and they're going to store which link it is that they 761 00:35:18,820 --> 00:35:21,500 send that message out over. 762 00:35:21,500 --> 00:35:24,460 They should send messages out over in order to reach node E. 763 00:35:24,460 --> 00:35:27,690 So node C is going to store link one, 764 00:35:27,690 --> 00:35:29,389 and node D is going to store link two. 765 00:35:29,389 --> 00:35:30,930 But in addition to that link, they're 766 00:35:30,930 --> 00:35:33,300 going to store the path that they use. 767 00:35:33,300 --> 00:35:36,300 But now what's going to happen is that each of C and D, 768 00:35:36,300 --> 00:35:38,320 during the next advertisement step, 769 00:35:38,320 --> 00:35:40,520 C and D are going to also advertise the information 770 00:35:40,520 --> 00:35:43,780 that they have about the nodes that they 771 00:35:43,780 --> 00:35:45,260 can reach in the network. 772 00:35:45,260 --> 00:35:48,100 So, I'm only showing the advertisements for node E here. 773 00:35:48,100 --> 00:35:49,935 But of course, at the same time, C and D 774 00:35:49,935 --> 00:35:51,560 are also advertising the fact that they 775 00:35:51,560 --> 00:35:53,710 can reach themselves, and maybe their ability 776 00:35:53,710 --> 00:35:55,800 to reach other nodes in the network that we haven't shown. 777 00:35:55,800 --> 00:35:57,320 So we're just looking at E, but bear in mind 778 00:35:57,320 --> 00:35:59,403 that all the advertisements are being done for all 779 00:35:59,403 --> 00:36:00,960 the nodes at the same time. 780 00:36:00,960 --> 00:36:05,310 So, C sends out an advertisement that says I can reach node E, 781 00:36:05,310 --> 00:36:08,240 and the way to do it is to send, and I can 782 00:36:08,240 --> 00:36:12,100 reach node E via C and then E. 783 00:36:12,100 --> 00:36:13,720 And similarly, D sends out a message 784 00:36:13,720 --> 00:36:17,000 that says I can reach node E by a D and then E. 785 00:36:17,000 --> 00:36:19,289 So, OK, up to this point we haven't really 786 00:36:19,289 --> 00:36:20,580 seen anything very interesting. 787 00:36:20,580 --> 00:36:22,430 But now during the next integration step, 788 00:36:22,430 --> 00:36:26,510 we see that these two nodes, B and A, 789 00:36:26,510 --> 00:36:29,890 now have heard an advertisement that gives them a path that 790 00:36:29,890 --> 00:36:33,030 allows them to reach node E. 791 00:36:33,030 --> 00:36:35,180 So now, every node has a path that 792 00:36:35,180 --> 00:36:36,730 allows them to reach node E. 793 00:36:36,730 --> 00:36:40,227 But this advertisement and integrations process 794 00:36:40,227 --> 00:36:41,310 is going to keep going on. 795 00:36:41,310 --> 00:36:44,190 So, for example, nodes A and B are 796 00:36:44,190 --> 00:36:46,140 going to advertise that they can, also, reach 797 00:36:46,140 --> 00:36:48,100 node E to their neighbors. 798 00:36:48,100 --> 00:36:52,560 And in this case, it's probably unlikely that any of the nodes 799 00:36:52,560 --> 00:36:54,930 would like to switch to a new route. 800 00:36:54,930 --> 00:37:00,140 So, for example, it's not clear, there's no reason, for example, 801 00:37:00,140 --> 00:37:02,634 that A would want to forward its message. 802 00:37:02,634 --> 00:37:04,050 It's probably unlikely that A will 803 00:37:04,050 --> 00:37:07,960 want to forward its messages through B to reach E, 804 00:37:07,960 --> 00:37:12,550 right, because that's going to be a longer path than for A 805 00:37:12,550 --> 00:37:14,930 to send its messages simply through C and then to E. 806 00:37:14,930 --> 00:37:17,660 But B doesn't actually know whether or not 807 00:37:17,660 --> 00:37:19,260 A knows about E yet or not. 808 00:37:19,260 --> 00:37:23,110 So it needs to continue to broadcast this information out. 809 00:37:23,110 --> 00:37:25,530 So this is pretty simple. 810 00:37:25,530 --> 00:37:27,050 It's pretty clear how this works. 811 00:37:27,050 --> 00:37:29,210 And once this process has been running for a while, 812 00:37:29,210 --> 00:37:32,220 you can see that the network is going to converge into a state 813 00:37:32,220 --> 00:37:36,910 where every node has, as long as the network is connected, 814 00:37:36,910 --> 00:37:39,760 it will converge into a state where every node has a path 815 00:37:39,760 --> 00:37:41,766 to node E, right? 816 00:37:41,766 --> 00:37:44,140 And the amount of time that it'll take for that to happen 817 00:37:44,140 --> 00:37:47,670 is equal to the maximum number of hops 818 00:37:47,670 --> 00:37:50,160 that any node is away from node E. 819 00:37:50,160 --> 00:37:52,180 So, once this node has converged, 820 00:37:52,180 --> 00:37:55,200 now we can trivially build up our forwarding table simply 821 00:37:55,200 --> 00:37:59,480 by pulling out the link number from each one of these nodes. 822 00:37:59,480 --> 00:38:03,920 So, for example, we can see that E's forwarding table simply 823 00:38:03,920 --> 00:38:06,970 says: to reach node E, you send it to my end to end layer. 824 00:38:06,970 --> 00:38:09,510 D's forwarding table would say, to reach node E, 825 00:38:09,510 --> 00:38:11,680 you send it over my link, L2. 826 00:38:11,680 --> 00:38:14,130 C's forwarding table would say, to reach node E, 827 00:38:14,130 --> 00:38:15,870 you send it over L1. 828 00:38:15,870 --> 00:38:18,500 B's forwarding table would say, to reach node E, 829 00:38:18,500 --> 00:38:21,420 you send it out over my L1, and so on, OK? 830 00:38:21,420 --> 00:38:24,560 So, once we've done this path vector routing, 831 00:38:24,560 --> 00:38:27,254 at the end of this process we will know which links, 832 00:38:27,254 --> 00:38:28,920 we'll have built up the forwarding table 833 00:38:28,920 --> 00:38:32,150 that we can use for sending our links. 834 00:38:32,150 --> 00:38:33,972 OK, so this is a very simple process. 835 00:38:33,972 --> 00:38:35,430 But now, let's look at what happens 836 00:38:35,430 --> 00:38:38,260 when something, so what we said here 837 00:38:38,260 --> 00:38:42,770 is that each advertisement step, and after each advertisement, 838 00:38:42,770 --> 00:38:44,620 we're going to go ahead and do integration. 839 00:38:44,620 --> 00:38:46,060 Integration, basically what we're going to do 840 00:38:46,060 --> 00:38:48,610 is we're going to try and pick the best path in some way. 841 00:38:48,610 --> 00:38:49,900 What we've shown here is just simply picking 842 00:38:49,900 --> 00:38:50,760 the shortest path. 843 00:38:50,760 --> 00:38:53,310 So we've picked the shortest possible path 844 00:38:53,310 --> 00:38:55,880 for every node to reach node E. 845 00:38:55,880 --> 00:38:58,360 And in case it wasn't clear, I didn't explicitly 846 00:38:58,360 --> 00:39:01,400 state this, it's important to realize that nodes are going 847 00:39:01,400 --> 00:39:03,470 to ignore advertisements with their own address 848 00:39:03,470 --> 00:39:04,530 in the vector. 849 00:39:04,530 --> 00:39:11,490 OK so if, for example, when node E hears node D advertising 850 00:39:11,490 --> 00:39:14,030 that it can reach node E, node E is going to say, 851 00:39:14,030 --> 00:39:17,030 oh, well, I am node E. 852 00:39:17,030 --> 00:39:18,840 I don't actually need to pick up this path. 853 00:39:18,840 --> 00:39:21,530 I don't need to send my packets to myself through node D. 854 00:39:21,530 --> 00:39:22,960 That would be a silly thing to do. 855 00:39:22,960 --> 00:39:24,100 That would create a routing loop, 856 00:39:24,100 --> 00:39:26,210 which is something that we presumably don't want to do. 857 00:39:26,210 --> 00:39:28,020 So, this is a simple way using these path 858 00:39:28,020 --> 00:39:32,600 vectors we can use to avoid creating routing loops. 859 00:39:32,600 --> 00:39:34,770 OK, so now let's look at what happens, something 860 00:39:34,770 --> 00:39:35,750 a little bit more interesting. 861 00:39:35,750 --> 00:39:37,880 Let's look and see what happens when, for example, there's 862 00:39:37,880 --> 00:39:38,430 a failure. 863 00:39:38,430 --> 00:39:41,560 So this is just exactly the same network that I showed you. 864 00:39:41,560 --> 00:39:45,560 But, suppose for example that the link between D and E fails. 865 00:39:45,560 --> 00:39:52,327 OK, so now node D no longer has a route to node E. 866 00:39:52,327 --> 00:39:53,910 But remember, the way that I described 867 00:39:53,910 --> 00:39:56,700 this is that this advertisement process is just 868 00:39:56,700 --> 00:39:58,890 going to continue going on in the background, right? 869 00:39:58,890 --> 00:40:01,230 So what's going to happen is that at some point node 870 00:40:01,230 --> 00:40:04,810 D is going to realize that its link to node E went down. 871 00:40:04,810 --> 00:40:09,150 And, node D is going to cross this table out of its entry. 872 00:40:09,150 --> 00:40:12,980 So, node D is going to basically stop hearing advertisements 873 00:40:12,980 --> 00:40:13,980 from node E. 874 00:40:13,980 --> 00:40:16,560 When it stops hearing advertisements from node E, 875 00:40:16,560 --> 00:40:18,340 eventually it's going to do something. 876 00:40:18,340 --> 00:40:22,050 It's basically going to expire that entry from its link table. 877 00:40:22,050 --> 00:40:23,850 So after it hasn't heard advertisements 878 00:40:23,850 --> 00:40:26,350 from node E for a while, it'll expire that entry. 879 00:40:26,350 --> 00:40:29,330 And then, sometime later it will hear an advertisement 880 00:40:29,330 --> 00:40:33,617 from node C saying I know how to get to node E. 881 00:40:33,617 --> 00:40:35,950 And now, node D can go ahead and integrate this new path 882 00:40:35,950 --> 00:40:37,860 into its routing table. 883 00:40:37,860 --> 00:40:39,460 Now, notice that this process is just 884 00:40:39,460 --> 00:40:41,085 going to propagate through the network. 885 00:40:41,085 --> 00:40:43,350 So, once node D stops hearing advertisements 886 00:40:43,350 --> 00:40:45,310 for how to reach node E, it's going 887 00:40:45,310 --> 00:40:48,050 to stop sending advertisements for how to reach node E. 888 00:40:48,050 --> 00:40:53,140 And so, similarly, because B is also routing its information 889 00:40:53,140 --> 00:40:57,270 through, had previously been routing its packets 890 00:40:57,270 --> 00:40:59,680 to reach node E by way of D, it's 891 00:40:59,680 --> 00:41:02,850 going to say, oh, well, I stop hearing about this route, DE, 892 00:41:02,850 --> 00:41:03,560 from node D. 893 00:41:03,560 --> 00:41:05,470 So I'm going to stop using this. 894 00:41:05,470 --> 00:41:08,080 And instead, then sometime later, it's 895 00:41:08,080 --> 00:41:10,050 going to hear about this new route, DCE, 896 00:41:10,050 --> 00:41:12,050 and it's going to integrate that into its table. 897 00:41:12,050 --> 00:41:13,730 So, it's this process where there 898 00:41:13,730 --> 00:41:19,670 is this sort of process whereby nodes continually advertise 899 00:41:19,670 --> 00:41:22,270 and integrate routes. 900 00:41:22,270 --> 00:41:24,270 And there's this sort of interesting thing which 901 00:41:24,270 --> 00:41:26,686 happens, which is that nodes forget about routes that they 902 00:41:26,686 --> 00:41:28,180 haven't heard about for awhile when 903 00:41:28,180 --> 00:41:29,650 they miss an advertisement. 904 00:41:29,650 --> 00:41:33,980 So this, forgetting about routes is an important sort 905 00:41:33,980 --> 00:41:36,180 of principle that's often employed in networking 906 00:41:36,180 --> 00:41:37,200 called soft state. 907 00:41:40,580 --> 00:41:44,640 And the idea with soft state is that you should only 908 00:41:44,640 --> 00:41:48,200 keep information when that information gets refreshed. 909 00:41:48,200 --> 00:41:51,599 So all the information that you have has some time limit on it. 910 00:41:51,599 --> 00:41:53,390 And when you haven't heard that information 911 00:41:53,390 --> 00:41:55,510 refreshed after some time limit, you throw it out. 912 00:41:55,510 --> 00:41:57,510 So that's what we're doing with the routes here. 913 00:41:57,510 --> 00:42:00,790 And so we only keep routes that we have heard 914 00:42:00,790 --> 00:42:03,460 advertised recently, basically. 915 00:42:03,460 --> 00:42:05,420 And that has this nice property that it 916 00:42:05,420 --> 00:42:07,980 allows us to adapt to faults within the network, right? 917 00:42:07,980 --> 00:42:09,390 So we saw a failure happen. 918 00:42:09,390 --> 00:42:11,720 We saw that sometime after that failure, 919 00:42:11,720 --> 00:42:13,840 this soft state property would cause 920 00:42:13,840 --> 00:42:15,900 the information about the link between D and E 921 00:42:15,900 --> 00:42:18,360 to disappear from the network, and then nodes 922 00:42:18,360 --> 00:42:20,850 would rediscover their new links that allow 923 00:42:20,850 --> 00:42:23,560 them to connect to node E. 924 00:42:23,560 --> 00:42:29,140 OK, so what I want to do now, so this 925 00:42:29,140 --> 00:42:30,372 is sort of the basic process. 926 00:42:30,372 --> 00:42:32,580 And, path vector routing is fairly similar to the way 927 00:42:32,580 --> 00:42:36,052 that routing in the Internet actually works. 928 00:42:36,052 --> 00:42:37,510 For next time in recitation, you're 929 00:42:37,510 --> 00:42:39,843 going to talk about a protocol called the border gateway 930 00:42:39,843 --> 00:42:40,460 protocol. 931 00:42:40,460 --> 00:42:42,330 And you're going to actually study in much more detail 932 00:42:42,330 --> 00:42:43,680 how Internet routing works. 933 00:42:43,680 --> 00:42:46,180 But this is a nice simple model of how routing 934 00:42:46,180 --> 00:42:49,660 in a small network might act. 935 00:42:49,660 --> 00:42:53,890 So the problem with what we've discussed so far, 936 00:42:53,890 --> 00:43:01,680 while we are here, is that if this is a very large network, 937 00:43:01,680 --> 00:43:03,199 these number of routes that you're 938 00:43:03,199 --> 00:43:04,990 going to have to hear about is really huge. 939 00:43:04,990 --> 00:43:07,406 So suppose that this, instead of being a five node network 940 00:43:07,406 --> 00:43:08,640 was a million node network. 941 00:43:08,640 --> 00:43:13,120 Well, now every node is going to have a table that's 942 00:43:13,120 --> 00:43:14,620 a million entries long, right? 943 00:43:14,620 --> 00:43:15,580 That's going to be really big, and it's 944 00:43:15,580 --> 00:43:17,640 going to have to hear a million advertisements. 945 00:43:17,640 --> 00:43:19,315 And every time there's a failure, well, 946 00:43:19,315 --> 00:43:20,940 that's going to be a pain because we're 947 00:43:20,940 --> 00:43:22,920 going to have to wait for that information about that failure 948 00:43:22,920 --> 00:43:24,544 to propagate through the whole network. 949 00:43:24,544 --> 00:43:28,590 So in some sense, this simple path vector routing protocol 950 00:43:28,590 --> 00:43:31,089 we have doesn't really meet the scalability goal 951 00:43:31,089 --> 00:43:32,630 that we want to scale this network up 952 00:43:32,630 --> 00:43:34,270 to a very large size. 953 00:43:34,270 --> 00:43:38,320 So we have an issue with path vector routing 954 00:43:38,320 --> 00:43:39,540 and its scalability. 955 00:43:39,540 --> 00:43:45,970 OK, so the solution is a solution that is often 956 00:43:45,970 --> 00:43:49,070 used when we have a scalability problem in a computer system: 957 00:43:49,070 --> 00:43:51,306 its hierarchy, OK? 958 00:43:51,306 --> 00:43:52,680 So let's see what I mean by that. 959 00:43:56,710 --> 00:43:58,810 So, you remember when I was showing those pictures 960 00:43:58,810 --> 00:44:03,670 of the Internet, there are these different kind of subnetworks 961 00:44:03,670 --> 00:44:06,360 that were forming over time on the West Coast, 962 00:44:06,360 --> 00:44:09,750 on the East Coast, or there was the ARPANET, and the NSFNET, 963 00:44:09,750 --> 00:44:12,120 and the MILNET [SP?] that were these sort of different 964 00:44:12,120 --> 00:44:14,500 networks that were all a part of the Internet as a whole. 965 00:44:14,500 --> 00:44:16,660 But they were these sort of different regions 966 00:44:16,660 --> 00:44:18,300 that were separately administered, 967 00:44:18,300 --> 00:44:21,470 and that often corresponded to a specific organization 968 00:44:21,470 --> 00:44:24,740 like the NSF or like the military. 969 00:44:24,740 --> 00:44:29,270 So, oftentimes these regions, so it's 970 00:44:29,270 --> 00:44:31,550 very common when you look at any network 971 00:44:31,550 --> 00:44:33,610 to have these kinds of regions in them. 972 00:44:33,610 --> 00:44:36,170 So, for example, clearly there's a network 973 00:44:36,170 --> 00:44:37,950 that is MIT's network, right? 974 00:44:37,950 --> 00:44:40,310 And Harvard, for example, has a network that's 975 00:44:40,310 --> 00:44:41,540 Harvard's network, right? 976 00:44:41,540 --> 00:44:45,100 And those two things are sort of logical regions 977 00:44:45,100 --> 00:44:49,180 that define different parts or different groups 978 00:44:49,180 --> 00:44:50,490 within a network. 979 00:44:50,490 --> 00:44:52,340 So if you were to look at any network, 980 00:44:52,340 --> 00:44:54,700 you would see that sort of almost any large network 981 00:44:54,700 --> 00:44:57,302 is organized in this way into these regions. 982 00:44:57,302 --> 00:44:58,760 In the paper next time, we're going 983 00:44:58,760 --> 00:45:09,520 to call these regions autonomous systems or AS's, OK, 984 00:45:09,520 --> 00:45:12,610 so autonomous as in sort of operating on its own, 985 00:45:12,610 --> 00:45:15,546 operating without being dependent 986 00:45:15,546 --> 00:45:16,920 on the other parts of the system. 987 00:45:16,920 --> 00:45:19,830 So for example, if MIT's Internet connection went down, 988 00:45:19,830 --> 00:45:21,610 connection to the outside world went down, 989 00:45:21,610 --> 00:45:24,100 that wouldn't stop you from being able to connect 990 00:45:24,100 --> 00:45:26,250 to machines within MIT, right? 991 00:45:26,250 --> 00:45:27,770 So MIT is autonomous in the sense 992 00:45:27,770 --> 00:45:30,311 that it continues to operate in the absence of its connection 993 00:45:30,311 --> 00:45:32,200 to the rest of the Internet. 994 00:45:32,200 --> 00:45:36,880 So let's look at a simple example of a network that 995 00:45:36,880 --> 00:45:38,442 has this hierarchy property, and see 996 00:45:38,442 --> 00:45:40,650 how we would modify the routing algorithm that I just 997 00:45:40,650 --> 00:45:41,810 talked about. 998 00:45:41,810 --> 00:45:45,150 So suppose I have two small networks, 999 00:45:45,150 --> 00:45:47,220 each with three nodes in them. 1000 00:45:47,220 --> 00:45:51,550 Let's call them A, B, C, and D, E, and F, OK? 1001 00:45:55,642 --> 00:45:57,350 So, these are each going to be autonomous 1002 00:45:57,350 --> 00:46:01,320 systems, which I'll draw by drawing a circle around them. 1003 00:46:01,320 --> 00:46:03,450 OK, so one way we could be routing 1004 00:46:03,450 --> 00:46:05,740 would be to do what I had shown before, 1005 00:46:05,740 --> 00:46:08,640 which is that each node within, say, this autonomous 1006 00:46:08,640 --> 00:46:11,010 region which I'll label one, or autonomous system 1007 00:46:11,010 --> 00:46:13,745 one, and this one two, would have information 1008 00:46:13,745 --> 00:46:16,120 about all the other nodes everywhere else in the network. 1009 00:46:16,120 --> 00:46:19,300 But that has the scalability problem that we mentioned. 1010 00:46:19,300 --> 00:46:21,010 So instead, what we want to do is 1011 00:46:21,010 --> 00:46:25,710 we want to make it so that only a few of the nodes in here, 1012 00:46:25,710 --> 00:46:27,640 so that we don't have to have information 1013 00:46:27,640 --> 00:46:31,210 about all of the nodes that are anywhere within the network. 1014 00:46:31,210 --> 00:46:33,880 We only have to know about a few nodes 1015 00:46:33,880 --> 00:46:36,527 we say are on the edge of each one of these networks. 1016 00:46:36,527 --> 00:46:37,610 So the idea is as follows. 1017 00:46:37,610 --> 00:46:39,692 Suppose these are connected in this way. 1018 00:46:39,692 --> 00:46:41,150 And what we're going to do is we're 1019 00:46:41,150 --> 00:46:43,900 going to appoint one node within each one of these regions. 1020 00:46:43,900 --> 00:46:45,630 For example, it could be several modes. 1021 00:46:45,630 --> 00:46:48,160 One of these regions to be a so-called border 1022 00:46:48,160 --> 00:46:50,875 node that sort of sits on the edge of these two regions. 1023 00:46:50,875 --> 00:46:53,250 And we're going to connect just those two nodes together. 1024 00:46:53,250 --> 00:46:57,360 So we're only going to have a small number of links between 1025 00:46:57,360 --> 00:46:58,910 our two AS's. 1026 00:46:58,910 --> 00:47:01,990 And now, if we look at the forwarding table for one 1027 00:47:01,990 --> 00:47:06,050 of these nodes within, say, AS1, it's going to look as follows. 1028 00:47:06,050 --> 00:47:07,550 So what I'm going to do is I'm going 1029 00:47:07,550 --> 00:47:09,750 to write the addresses for these different AS's 1030 00:47:09,750 --> 00:47:11,210 as hierarchical addresses. 1031 00:47:11,210 --> 00:47:15,500 So, we're going to call node A's address 1.A. 1032 00:47:15,500 --> 00:47:21,070 And, we'll call node E's address 2.E, OK? 1033 00:47:21,070 --> 00:47:23,910 So, what our forwarding table looks like 1034 00:47:23,910 --> 00:47:32,200 is a list of addresses, and then a link to use. 1035 00:47:32,200 --> 00:47:35,140 OK, so this is going to be the forwarding table, again, 1036 00:47:35,140 --> 00:47:36,280 for node A. 1037 00:47:36,280 --> 00:47:38,190 So, A is going to have an address. 1038 00:47:38,190 --> 00:47:40,771 It's going to have an address 1.A in it. 1039 00:47:40,771 --> 00:47:43,020 And, the link to use, in that case, we've already said 1040 00:47:43,020 --> 00:47:44,180 is end-to-end. 1041 00:47:44,180 --> 00:47:50,140 OK, it's going to have an address 1.B. So, to get to B, 1042 00:47:50,140 --> 00:47:53,110 A is going to route by this link here, 1043 00:47:53,110 --> 00:47:56,780 which let's call this link number one, OK? 1044 00:47:56,780 --> 00:47:59,060 So, it's going to route to link one. 1045 00:47:59,060 --> 00:48:01,529 And it's going to have a connection to 1.C, which 1046 00:48:01,529 --> 00:48:03,070 is going to route via this link here, 1047 00:48:03,070 --> 00:48:07,820 which let's label that two, OK? 1048 00:48:07,820 --> 00:48:09,580 So now, we don't have any information 1049 00:48:09,580 --> 00:48:11,610 about how to reach network two. 1050 00:48:11,610 --> 00:48:14,200 So what we're going to do is rather than storing information 1051 00:48:14,200 --> 00:48:16,330 about every machine and network two, 1052 00:48:16,330 --> 00:48:18,820 we're going to store just information about how 1053 00:48:18,820 --> 00:48:20,460 to reach the edge of network two, 1054 00:48:20,460 --> 00:48:23,020 and then trust that network two is going to be able to route 1055 00:48:23,020 --> 00:48:25,200 to anybody whose address begins with two. 1056 00:48:25,200 --> 00:48:27,800 So what we're going to do is we're going to say two dot 1057 00:48:27,800 --> 00:48:30,470 star, right, two dot everybody. 1058 00:48:30,470 --> 00:48:34,450 So, [we'll star?] the character that says anybody whose address 1059 00:48:34,450 --> 00:48:36,150 has this prefix two dot. 1060 00:48:36,150 --> 00:48:37,910 So, anybody whose address has prefix two 1061 00:48:37,910 --> 00:48:40,790 dot, we are just going to send to node C. 1062 00:48:40,790 --> 00:48:44,960 So, we're just going to send that over link two, OK? 1063 00:48:44,960 --> 00:48:46,780 And so, similarly on the other side, 1064 00:48:46,780 --> 00:48:48,110 we're going to have a table. 1065 00:48:48,110 --> 00:48:51,010 Each of these nodes is going to have an entry, one dot star, 1066 00:48:51,010 --> 00:48:53,870 that specifies that it should route messages for network one 1067 00:48:53,870 --> 00:48:55,470 through node D. 1068 00:48:55,470 --> 00:48:57,132 OK, so you see in this way now what 1069 00:48:57,132 --> 00:48:58,590 we've been able to do is to make it 1070 00:48:58,590 --> 00:49:02,410 so that each one of these autonomous systems, sort 1071 00:49:02,410 --> 00:49:04,790 of each node only knows how to route to other nodes 1072 00:49:04,790 --> 00:49:09,810 within its sort of group, and that in order to cross groups, 1073 00:49:09,810 --> 00:49:15,200 you route through one of these special sort of border routers 1074 00:49:15,200 --> 00:49:18,107 or border nodes, OK? 1075 00:49:18,107 --> 00:49:19,690 And, we're going to talk about the way 1076 00:49:19,690 --> 00:49:21,640 that this border routing protocol actually 1077 00:49:21,640 --> 00:49:24,310 works in the Internet in recitation. 1078 00:49:24,310 --> 00:49:25,810 But you can see that what we've done 1079 00:49:25,810 --> 00:49:30,290 is we've accomplished this sort of hierarchy 1080 00:49:30,290 --> 00:49:32,370 so we can make this system, you can 1081 00:49:32,370 --> 00:49:35,070 make these tables much smaller by including these star 1082 00:49:35,070 --> 00:49:36,720 entries in them. 1083 00:49:36,720 --> 00:49:39,200 It's worth just mentioning as a final caveat 1084 00:49:39,200 --> 00:49:42,580 that we have given up something for doing this. 1085 00:49:42,580 --> 00:49:45,940 OK, what we've done is we've forced every node that's 1086 00:49:45,940 --> 00:49:48,000 within one of these regions. 1087 00:49:48,000 --> 00:49:53,350 Now, this node's address, in order for this node 1.A 1088 00:49:53,350 --> 00:49:55,630 to be able to continue to operate, 1089 00:49:55,630 --> 00:49:58,880 it can only be connected to somebody 1090 00:49:58,880 --> 00:50:02,160 like C who can advertise information about all the nodes 1091 00:50:02,160 --> 00:50:03,795 whose names begin with one. 1092 00:50:06,780 --> 00:50:11,030 So, we've basically forced this sort of network to have this. 1093 00:50:11,030 --> 00:50:12,640 By imposing this kind of a hierarchy 1094 00:50:12,640 --> 00:50:15,440 on the network we've limited, to some extent, the ability 1095 00:50:15,440 --> 00:50:19,150 of these nodes to move between networks because node A can 1096 00:50:19,150 --> 00:50:22,740 only be advertised by way of node C. 1097 00:50:22,740 --> 00:50:25,700 So in the Internet today, there's 1098 00:50:25,700 --> 00:50:27,337 actually multiple layers of hierarchy. 1099 00:50:27,337 --> 00:50:29,420 So you may have noticed that Internet IP addresses 1100 00:50:29,420 --> 00:50:33,280 have the form A.B.C.D. So, it's a four layer 1101 00:50:33,280 --> 00:50:34,960 hierarchy that we have in the Internet. 1102 00:50:34,960 --> 00:50:38,680 You guys will learn more about this on Thursday in recitation. 1103 00:50:38,680 --> 00:50:40,880 And what we'll do next time is talk 1104 00:50:40,880 --> 00:50:44,730 about the end-to-end layer, and eliminating 1105 00:50:44,730 --> 00:50:48,600 some of the limitations of the best effort network.