The internet is an incredibly impressive technological achievement. It meshes together millions of individual networks and allows communications to flow between them. From almost anywhere in the world, you can now access data from almost anywhere else. Often in just fractions of a second. The way communications happen across all these networks, allowing you to access data from the other side of the planet is through routing. By the end of this lesson, you'll be able to describe the basics of routing and how routing tables work. You'll be able to define some of the major routing protocols and what they do and identify non routable address space and how it's used. You'll also gain an understanding of the RFC system and how it made the internet what it is today. All of these are very important skills in order to troubleshoot the networking issues you might run into as an IT support specialist. Routing is one of those things that is both very simple and very complex, at a very high level what routing is and how routers work is actually pretty simple. But underneath the hood, routing is a very complex and technologically advanced topic. Entire books have been written about the topic. Today, most intensive routing issues are almost exclusively handled by ISPs and only the largest of companies. We'll arm you with the basic overview of routing to give you a well rounded networking education since it's an important topic to understand no matter what. But by no means will our coverage be exhaustive. From a very basic standpoint, a router is a network device that forwards traffic depending on the destination address of that traffic. A router is a device that has at least two network interfaces since it has to be connected to two networks to do its job, basic routing has just a few steps. One, a router receives a packet of data on one of its interfaces. Two, the router examines the destination IP of this packet. Three, the router then looks up the destination network of this IP in its routing table. Four, the router forwards that out through the interface that's closest to the remote network as determined by additional info within the routing table. These steps are repeated as often as needed until the traffic reaches its destination. Let's imagine a router connected to two networks. We'll call the first network network A and give it an address space of 192.168.1.0/24. We'll call the second network network B and give it an address space of 10.0.0.0/20. The router has an interface on each network. On network A, it has an IP of 192.168.1.1 and on network B it has an IP of 10.0.0.254. Remember IP addresses belong to networks, not individual nodes on a network. A computer on network A with an IP address of 192.168.1.100 sends a packet to the address 10.0.0.10. This computer knows that 10.0.0.10, isn't on its local subnets. So it sends this packet to the MAC address of its gateway, the router. The router's interface on network A receives the packet because it sees that destination MAC address belongs to it. The router then strips away the data link layer encapsulation, leaving the network layer content, the IP datagram. Now, the router can directly inspect the IP datagram header for the destination IP field. It finds the destination IP of 10.0.0.10. The router looks at its routing table and sees that network B or the 10.0.0.0/24, network is the correct network for the destination IP. It also sees that this network is only one hop away in fact, since it's directly connected, the router even has the MAC address for this IP in its ARP table. Next, the router needs to form a new packet to forward along to network B, it takes all of the data from the first IP datagram and duplicates it, but it detriments the TTL field by one and calculates a new checksum. Then, it encapsulates this new IP datagram inside of a new Ethernet frame. This time it sets its own MAC address of the interface on network B as the source MAC address. Since it has the MAC address of 10.0.0.10 in its ARP table, it sets that as the destination MAC address. Lastly, the packet is sent out of its interface on network B and the data finally gets delivered to the node living at 10.0.0.10. That's a pretty basic example of how routing works, but let's make it a little more complicated and introduced a third network. Everything else is still the same. We have network A whose address space is 192.168.1.0/24, we have network B whose address space is 10.0.0.0/24. The router that bridges these two networks still has the IPs of 192.168.1.1 on network A and 10.0.0.254 on network B. But let's introduce a third network, network C it has an address space of 172.16.1.0/23. There's a second router connecting network B and network C, its interface on network B has an IP of 10.0.0.1 and its interface on network C has an IP of 172.16.1.1. This time around our computer at 192.168.1.100 wants to send some data to the computer that has an IP of 172.16.1.100. We'll skip the data link layer stuff, but remember that it's still happening of course. The computer at 192.168.1.100 knows that 172.16.1.100 is not on its local network. So it sends the packet to its gateway, the router between network A network B. Again, the router inspects the content of this packet, it sees a destination address of 172.16.1.100. And through a look up of its routing table, it knows that the quickest way to get to the 172.16.1.0 /23 network is via another router with an IP of 10.0.0.1. The router detriments the TTL field and sends it along to the router of 10.0.0.1. This router then goes through the motions, knows that the destination IP of 172.16.1.100 is directly connected and forwards the packet to its final destination, that's the basics of routing. The only difference between our examples and how things work on the internet is scale. Routers are usually connected to many more than just two networks. Very often your traffic may have to cross a dozen routers before it reaches its final destination. And finally, in order to protect against breakages, core internet routers are typically connected in a mesh, meaning that there might be many different paths for a packet to take. Still, the concepts are all the same. Routers inspect the destination IP, look at their routing table to determine which path is the quickest and forward the packet along the path. This happens over and over every single packet, making up every single bit of traffic all over the internet at all times. Pretty cool stuff?