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 identifying 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 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 though 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/24. 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.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 subnet. 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 trips 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 it's 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 arc 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 decrements 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 arc 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 introduce 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/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 is a second router connecting network B and network C. It's 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 a packet to its gateway, the router between Network A and Network B. Again, the router inspects the content of this packet. It sees a destination address of 172.16.1.100 and through a lookup 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 decrements 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 the routing table to determine which path is the quickest and forward the packet along the path. This happens over and over. Every single pocket making up every single bit of traffic all over the Internet at all times. Pretty cool stuff?