February 21, 2019

A Gentle Introduction to Routing

Routing Fundamentals

  • October 8, 2008
  • By Charlie Schluting

To understand something in the networking world, you have to understand the problem it�s trying to solve. Memorizing the configuration options for a certain routing protocol won�t help you until you understand what it�s really doing. This installment of Networking 101 is designed to be a gentle introduction into the world of routing issues and concepts, arguably the most interesting and important part of networking, explaining the problems routing protocols address so you can understand why they do what they do.

Before we get into the details, a clarification. When you hear people refer to "non-routable addresses," they are talking about RFC 1918 IP addresses, i.e. private addresses. Despite the misleading label, they certainly are routable. You can and should have some 10.x.x.x networks for local access and management. They can even be co-mingled with your real routers. They are called �non-routable� because the Internet routers will drop them. You should drop these packets at your border, as was pointed out in this Border Security article last year. This is a point of confusion for a lot of people.

On to the topic at hand.

Routing, in essence, is the act of finding a path from one place to another on which a packet can travel. To find this path, we need algorithms. They will generally be distributed among many routers, allowing them to jointly share information. Routing is said to contain three elements:

  • Routing protocols, the things that allow information to be gathered and distributed
  • Routing algorithms, to determine paths
  • Routing databases to store information that the algorithm has discovered. The routing database sometimes corresponds directly to routing table entries, sometimes not.

Our installment on layers actually introduces a bit of routing by talking about the paths an IP packet takes through operating systems and routers. What may not have been clear, though, is how the routing table lookup step works.

More Networking 101

  • IP Addresses
  • Subnets and CIDR
  • Subnets
  • Layers
  • the Data Link Layer
  • Spanning Tree
  • ICMP
  • The Internet Protocol
  • TCP, the Protocol
  • TCP In More Depth
  • Internet Governance
  • Remember subnetting? Most routers will simply find the shortest prefix in the routing table when it looks for a path for your packet. If there�s a �host route,� or /32 entry, that is always preferred. Any more specific routes, like the one that says what subnet you�re on, will also be preferred before the default route is chosen.

    We also need to understand some really basic problems with routing. Just like in Layer 2, routers need to be redundant. Redundancy always introduces the possibility of a loop, and every routing protocol has to deal with this. As we�ll see in future Networking 101 articles about specific protocols, this is pretty much a solved problem.

    Most Popular LinuxPlanet Stories