1 00:00:00,540 --> 00:00:02,190 Routing fundamentals. 2 00:00:02,190 --> 00:00:05,610 All right, we still haven't left our local area network yet. 3 00:00:05,610 --> 00:00:07,080 Once we're ready to leave our network, 4 00:00:07,080 --> 00:00:08,160 this is where routers 5 00:00:08,160 --> 00:00:10,500 are really going to start coming into play. 6 00:00:10,500 --> 00:00:11,400 When we start talking about 7 00:00:11,400 --> 00:00:13,320 connecting to subnets within our network 8 00:00:13,320 --> 00:00:14,700 or connecting our internal network 9 00:00:14,700 --> 00:00:15,810 and an external network, 10 00:00:15,810 --> 00:00:17,670 we have to use a router. 11 00:00:17,670 --> 00:00:19,050 The first thing you must understand 12 00:00:19,050 --> 00:00:20,520 is the function of a router, 13 00:00:20,520 --> 00:00:22,320 which is to route traffic. 14 00:00:22,320 --> 00:00:23,640 Now, I know that sounds kind of silly, 15 00:00:23,640 --> 00:00:25,410 but essentially that's what it's going to do. 16 00:00:25,410 --> 00:00:27,960 It's going to forward the traffic in one direction or another 17 00:00:27,960 --> 00:00:29,070 between different subnets 18 00:00:29,070 --> 00:00:30,810 or between an internal and external network 19 00:00:30,810 --> 00:00:33,480 or between two different external networks. 20 00:00:33,480 --> 00:00:35,040 Each subnet or external network 21 00:00:35,040 --> 00:00:37,080 is going to be its own broadcast domain 22 00:00:37,080 --> 00:00:40,200 because routers are used to separate broadcast domains. 23 00:00:40,200 --> 00:00:42,300 Unlike switches, which are Layer 2 devices 24 00:00:42,300 --> 00:00:44,880 and therefore can only maintain one broadcast domain 25 00:00:44,880 --> 00:00:46,890 for everything that's connected to the switch, 26 00:00:46,890 --> 00:00:49,020 the routers are going to be Layer 3 devices, 27 00:00:49,020 --> 00:00:50,880 and they're used to separate and break apart 28 00:00:50,880 --> 00:00:53,220 those broadcast domains into smaller portions 29 00:00:53,220 --> 00:00:55,320 to provide additional efficiency and security 30 00:00:55,320 --> 00:00:56,490 to your networks. 31 00:00:56,490 --> 00:00:58,410 Now, before we go too far in this lesson, 32 00:00:58,410 --> 00:01:00,300 it's important to note that there's a difference 33 00:01:00,300 --> 00:01:02,670 between the real world and the exam. 34 00:01:02,670 --> 00:01:03,660 In the real world, 35 00:01:03,660 --> 00:01:06,510 you may often find yourself using a Layer 3 switch, 36 00:01:06,510 --> 00:01:08,700 also known as a multilayer switch. 37 00:01:08,700 --> 00:01:09,540 When you do this, 38 00:01:09,540 --> 00:01:11,850 it can perform routing functions for you. 39 00:01:11,850 --> 00:01:13,710 Many small-office, home-office networks 40 00:01:13,710 --> 00:01:15,480 or small and medium-sized businesses 41 00:01:15,480 --> 00:01:17,670 will often opt to use a Layer 3 switch 42 00:01:17,670 --> 00:01:19,560 because it can handle both functions. 43 00:01:19,560 --> 00:01:21,060 It can handle Layer 2 forwarding 44 00:01:21,060 --> 00:01:22,350 when it's acting like a switch 45 00:01:22,350 --> 00:01:25,200 and Layer 3 routing when it acts as a router. 46 00:01:25,200 --> 00:01:26,820 For the exam though, remember, 47 00:01:26,820 --> 00:01:28,830 if you're using a multilayer switch, 48 00:01:28,830 --> 00:01:30,720 it is functioning as a router, 49 00:01:30,720 --> 00:01:32,580 and so we're going to treat it as a router 50 00:01:32,580 --> 00:01:34,260 or a Layer 3 device. 51 00:01:34,260 --> 00:01:35,910 Now, in this entire section, 52 00:01:35,910 --> 00:01:38,460 we're going to be referring to these devices as a router, 53 00:01:38,460 --> 00:01:42,060 even if I'm using a multilayer switch in the real world. 54 00:01:42,060 --> 00:01:45,000 Now for the exam, if they say switch, 55 00:01:45,000 --> 00:01:47,430 they're talking about a standard Layer 2 switch. 56 00:01:47,430 --> 00:01:50,040 If they say multilayer switch or router, 57 00:01:50,040 --> 00:01:52,080 they're referring to Layer 3 functionality 58 00:01:52,080 --> 00:01:54,600 of a device that we call a router. 59 00:01:54,600 --> 00:01:58,230 So how does the basic router perform this work? 60 00:01:58,230 --> 00:02:00,240 Well, let's consider this diagram here. 61 00:02:00,240 --> 00:02:01,320 I have two networks, 62 00:02:01,320 --> 00:02:02,370 one on the left side 63 00:02:02,370 --> 00:02:04,140 and one on the right side of the screen. 64 00:02:04,140 --> 00:02:04,980 As you can see, 65 00:02:04,980 --> 00:02:07,020 PC1 is connected to our left network 66 00:02:07,020 --> 00:02:09,449 and PC2 is connected to our right network. 67 00:02:09,449 --> 00:02:11,550 Now, to connect these two networks together, 68 00:02:11,550 --> 00:02:13,890 we have two routers in a serial connection 69 00:02:13,890 --> 00:02:16,380 or wide area network connection between them. 70 00:02:16,380 --> 00:02:17,700 This could be a fiber connection, 71 00:02:17,700 --> 00:02:20,520 a serial connection, a satellite connection, a VPN, 72 00:02:20,520 --> 00:02:21,660 or any other kind of link. 73 00:02:21,660 --> 00:02:23,190 It really doesn't matter right now. 74 00:02:23,190 --> 00:02:24,120 As long as you understand 75 00:02:24,120 --> 00:02:26,580 that there is connectivity between these two routers 76 00:02:26,580 --> 00:02:27,870 and they can communicate to each other 77 00:02:27,870 --> 00:02:29,220 over that WAN connection, 78 00:02:29,220 --> 00:02:30,690 that's all we need to know. 79 00:02:30,690 --> 00:02:32,520 Now, if I'm sitting at PC1 80 00:02:32,520 --> 00:02:34,500 and I want to send a message to PC2, 81 00:02:34,500 --> 00:02:37,290 I can't just send it through ARP like I did with a switch. 82 00:02:37,290 --> 00:02:38,610 If you remember back in switching, 83 00:02:38,610 --> 00:02:40,320 we talked about how PC1 84 00:02:40,320 --> 00:02:41,697 would send an ARP packet to the switch, 85 00:02:41,697 --> 00:02:43,620 and if it didn't know where to deliver it, 86 00:02:43,620 --> 00:02:45,780 it would send it out every single switch port 87 00:02:45,780 --> 00:02:47,280 based on that MAC address. 88 00:02:47,280 --> 00:02:50,520 Well, PC1 can and will still do that. 89 00:02:50,520 --> 00:02:51,780 But what's going to happen here 90 00:02:51,780 --> 00:02:54,180 is that our ARP request is going to go up to the switch 91 00:02:54,180 --> 00:02:55,770 and the switch is going to realize 92 00:02:55,770 --> 00:02:57,090 that it doesn't know the MAC address 93 00:02:57,090 --> 00:02:58,620 associated with that request, 94 00:02:58,620 --> 00:03:01,530 so it's going to forward it out its default gateway. 95 00:03:01,530 --> 00:03:03,660 The default gateway is the router. 96 00:03:03,660 --> 00:03:06,480 Now, that router is then going to respond to the ARP request 97 00:03:06,480 --> 00:03:08,610 on behalf of the destination device. 98 00:03:08,610 --> 00:03:09,510 At this point, 99 00:03:09,510 --> 00:03:12,210 we're now going to have to leave MAC addresses behind 100 00:03:12,210 --> 00:03:15,390 because MAC addresses only work internally in our network. 101 00:03:15,390 --> 00:03:16,560 Once we get to the router, 102 00:03:16,560 --> 00:03:18,480 we're going to switch to using IP addresses, 103 00:03:18,480 --> 00:03:21,030 or logical addressing at Layer 3. 104 00:03:21,030 --> 00:03:22,170 This is where we begin to make 105 00:03:22,170 --> 00:03:24,690 our Layer 2 to Layer 3 transitions. 106 00:03:24,690 --> 00:03:27,330 At this point, PC1 has determined the MAC address 107 00:03:27,330 --> 00:03:28,500 for where the router is 108 00:03:28,500 --> 00:03:29,970 because it needs to send the packet 109 00:03:29,970 --> 00:03:31,710 to get out of this local area network 110 00:03:31,710 --> 00:03:34,470 and leave to go find this device. 111 00:03:34,470 --> 00:03:35,820 The left router in this case 112 00:03:35,820 --> 00:03:37,950 wants to send the information to PC2 113 00:03:37,950 --> 00:03:40,230 'cause that's what PC1 told it to do. 114 00:03:40,230 --> 00:03:41,063 To do that, 115 00:03:41,063 --> 00:03:42,900 it's going to pass the information over to Router 2, 116 00:03:42,900 --> 00:03:45,180 and then Router 1 is going to get the data frame, 117 00:03:45,180 --> 00:03:47,640 which is Layer 2, from PC1. 118 00:03:47,640 --> 00:03:50,010 The router will repackage it up as a packet, 119 00:03:50,010 --> 00:03:51,060 which is Layer 3, 120 00:03:51,060 --> 00:03:53,100 and then add an IP header to it. 121 00:03:53,100 --> 00:03:54,360 This allows Router 1 122 00:03:54,360 --> 00:03:56,880 to then push the data over its default connection 123 00:03:56,880 --> 00:03:58,200 as an IP packet, 124 00:03:58,200 --> 00:04:00,510 and the data will then be sent across the serial connection 125 00:04:00,510 --> 00:04:02,070 to get to Router 2. 126 00:04:02,070 --> 00:04:04,350 All right, once that packet gets to Router 2, 127 00:04:04,350 --> 00:04:06,420 Router 2 is going to strip off the IP header 128 00:04:06,420 --> 00:04:08,880 and bring it back down to Layer 2 data frames 129 00:04:08,880 --> 00:04:11,310 by adding a MAC address for PC2. 130 00:04:11,310 --> 00:04:14,010 This way it's going to correlate PC2's MAC address 131 00:04:14,010 --> 00:04:15,870 with the destination IP of the packet 132 00:04:15,870 --> 00:04:17,850 because Router 2 knows who PC2 is, 133 00:04:17,850 --> 00:04:19,230 it's on its network. 134 00:04:19,230 --> 00:04:22,290 Now, since Router 2 knows the MAC address for PC2, 135 00:04:22,290 --> 00:04:25,080 it can call it to PC2 directly over Layer 2 136 00:04:25,080 --> 00:04:27,330 and send that data frame through the switch. 137 00:04:27,330 --> 00:04:28,860 The switch is going to take that information 138 00:04:28,860 --> 00:04:31,770 and push it from Router 2 down to PC2, 139 00:04:31,770 --> 00:04:33,570 just as if the two of them were computers 140 00:04:33,570 --> 00:04:36,480 sitting on the same switch trying to communicate locally. 141 00:04:36,480 --> 00:04:39,090 When PC2 wants to send a response to PC1, 142 00:04:39,090 --> 00:04:41,130 this process is going to be reversed, 143 00:04:41,130 --> 00:04:43,710 and that way the communication can continue back and forth 144 00:04:43,710 --> 00:04:46,320 between PC1, its switch, Router 1, 145 00:04:46,320 --> 00:04:49,890 the WAN connection, Router 2, its switch, and PC2. 146 00:04:49,890 --> 00:04:51,240 All right, so a quick summary 147 00:04:51,240 --> 00:04:53,520 of what we just saw in terms of data flow. 148 00:04:53,520 --> 00:04:55,650 We started out with Layer 2 pieces of information 149 00:04:55,650 --> 00:04:58,260 called a data frame coming from PC1. 150 00:04:58,260 --> 00:04:59,460 When it got to Router 1, 151 00:04:59,460 --> 00:05:01,800 it got packaged up as a Layer 3 packet 152 00:05:01,800 --> 00:05:03,480 to cross the wide area network. 153 00:05:03,480 --> 00:05:04,800 When it got to Router 2, 154 00:05:04,800 --> 00:05:06,840 it stripped it back down to Layer 2 155 00:05:06,840 --> 00:05:08,250 to make it a data frame again, 156 00:05:08,250 --> 00:05:10,890 using MAC addresses to deliver it to PC2 157 00:05:10,890 --> 00:05:12,270 on its local network. 158 00:05:12,270 --> 00:05:14,580 Essentially, this is how routing works. 159 00:05:14,580 --> 00:05:16,500 Now at this point, it's pretty simple, 160 00:05:16,500 --> 00:05:18,450 but it's going to get a lot more complicated 161 00:05:18,450 --> 00:05:20,160 as we start to move packets across 162 00:05:20,160 --> 00:05:22,380 not just a direct WAN link like this one, 163 00:05:22,380 --> 00:05:24,810 but over the world's largest wide area network, 164 00:05:24,810 --> 00:05:25,643 the internet.