Routers: Understanding The Basics

Routers

 

router 3

A router is a layer 3 (Network) device. Unlike hubs and switches that connect computers, servers, printers, or other peripheral systems together, a router connects networks together. Therefore, you can connect 2 or more LANs together and even connect two or more larger networks together in a WAN. There are several types of routers you can deploy on a network, such as access routers, distribution routers, edge routers, gateway routers, dual-band routers, but let’s keep it simple. Let’s take a look at the diagram below to see how a router works.

Router Network Example.png

Notice in the diagram how the edge gateway router in the center is connecting 4 networks together. Follow along with me. On one interface is the connection out to the Internet, which is likely connecting to the ISP’s router. The next interface connects to a server inside the network, likely protected by a firewall. The third interface is connecting to a switch with 4 workstations connected to it inside its own broadcast domain. And, connected to that same switch is another switch, which is connecting two workstations, a couple VoIP phones, a printer, and a scanner. The last network connecting to the router is a wireless network, via a wireless router or access point. The router that’s in the center can route IP packets back and forth to each one of these 4 networks. Because that router has 4 networks connected to it, that router technically has 4 IP addresses (the network IDs of each network).

Routers differ extensively from a switch because a switch can only send traffic to the devices connected to it based on layer 2 Ethernet MAC addresses. There are some exceptions to this rule if you’re using interVLAN routing and layer 3 switches. However, routers always route packets to another network based on their destination IP address.

Router Features

It seems today that we’re putting many different devices and squeezing their features all into just one device. If you happen to be using a cable modem in you home network, then it’s likely that your cable modem also doubles as a wireless gateway router, a firewall, a switch, a wireless access point (WAP), and a DHCP server (maybe I should have said quintuples?). Routers can also perform NAT, a very important feature that I’ll discuss in another post. With all these features, the router just becomes this inconsistent “box” with no universally accepted shape or form.

This slideshow requires JavaScript.

As you can see above, we have a couple of cable modems doubling as a router. I threw in a Cisco router in there as well to highlight just how different routing devices can look. Because many routers today are also wireless routers, most routers are going to have antennas sticking out of it or built within them. This will be pretty common when you have wireless routers as standalone devices, as you can see below.

This slideshow requires JavaScript.

How many antennas you have built within or outside of the router will depend on the wireless 802.11 protocol that you use. If you’re using 802.11n or 802.11ac, you can expect to see two or more antennas since the use either MIMO or MU-MIMO technology.

Routing and Routing Tables

In order to route traffic to and from different networks, the router interfaces must be assigned a network ID. The network ID is the actual network address for a network, which ends in in a “0”. Every router has a “routing table” that stores the network IDs it knows about or is connected to. Review the image below.

routing example.png

There are two routers (Router A and Router B). Connected to Router A are two networks, which are 10.10.10.0 and 192.168.10.0. Not only can you correctly assume this from the diagram, but if you look at the routing table for Router A, you’ll see that the metric for these two networks is “0.” These routers are using “hop counts” as the metric, meaning it analyzes how many hops it takes from router-to-router to get to a specific network. Therefore, it takes 0 hops to get to these two networks. However, as you can also see, Router A knows about the 10.10.20.0 network from a Router B advertisement. It only takes 1 hop to get to the 10.10.20.0 network from Router A.

So, using this overly-simplified routing table example, if a workstation in the 10.10.10.0 network wanted to send information to another workstation in the 10.10.20.0 network, it would have to send it to its local router (Router A), which would then make one hop to Router B. This router would examine the IP packet for the IP address and send it down the correct interface with the corresponding network ID. From then on, a switch passes on the information to the workstation.

Dynamic Routing Protocols

How do routers get their “smarts” to make all these complicated routing decisions? The answer of course lies in special dynamic routing protocols, which are split into on of two broad categories: “Interior Gateway Protocol (IGP)” or “Exterior Gateway Protocol (EGP).” Let’s first focus on IGP first.

Interior Gateway Protocol (IGP)

IGP is just a broad name that covers all the dynamic routing protocols we use INSIDE our networks. Of the different IGPs, there are distance vector protocols, link-state routing protocols, and hybrid protocols.

Distance Vector Protocols

Distance vector protocols were the first dynamic routing protocols to appear on our TCP/IP networks. In order for a router using a distance vector protocol to determine the best path to a destination network, it chooses the route with the smallest hop count, which would also be the shortest distance to the destination network. The only two distance vector dynamic routing protocols for IGP are RIPv1 and RIPv2. RIPv1 is perhaps the worst dynamic routing protocol to use. It has many limitations, including no authentication and a long convergence time. Even with RIPv2 addressing some of these limitations, most people would rather use something like OSPF.

Link-State Protocols

As their name suggests, link-state protocols are concerned with the state of the link or route. Not only are these protocols considering the hop distance, but they are also considering other metrics, such as connectivity, link utilization, and speed/bandwidth. The only two link-state dynamic routing protocols for IGP are OSPF and IS-IS. OSPF is what most router administrators are using on their routers. IS-IS, on the other hand, is typically used by ISPs on their routers.

Hybrid Protocols

Hybrid protocols are a mix of both distance vector and link-state protocols. Cisco’s proprietary EIGRP is the only hybrid IGP protocol that uses both distance vector and link-state aspects.

Exterior Gateway Protocol (EGP)

When we’re not installing and managing routers on our own individual networks and start connecting networks spread out over larger distances, we begin moving into “Exterior Gateway Protocol (EGP).” There is only one type of EGP that has suited us for many years.

ASs.gif

Border Gateway Protocol version 4 (BGP-4)

The Internet is HUGE; in fact, you can think of the Internet as just a bunch of interconnected networks and routers connecting different “Autonomous Systems.” For example, all ISPs, such as Comcast (Xfinity), Verizon, AT&T, and BrightHouse are classified as an autonomous system. But, you don’t, have to be an ISP to be classified as an autonomous system. If your network is big enough, for example, like a University campus WAN like Stanford or, a large company like Apple, you too are an autonomous system existing on the Internet. On the border of these large autonomous systems are powerful gateway BGP routers, which are called “edge routers.” These edge routers are manually configured and do not typically go down often. These edge routers are configured to locate other autonomous systems by recording different “Autonomous System Numbers (ASNs).” ASNs are assigned to large autonomous systems by IANA. Take a look below. BGP.png

 

Imagine these autonomous systems are large ISP networks or WAN-equivalent companies. These autonomous systems above all use different IGPs on their internal network (e.g., RIPv1, RIPv2, EIGRP, OSPF, and RIPv2). But, their gateway is using an EGP called BGP-4. BGP-4 allows each autonomous systems or company above to communicate with each other, but still use their own, different internal IGP routing protocols.

BGP-4 is a distance-vector dynamic routing protocol; however, CompTIA insists it is a hybrid protocol.

Static Routing

We just discussed dynamic routing protocols, which create routes automatically, but there exists another way routers decide the best routes to take. With “static routing,” network and router techs configure the routes manually and control each route precisely. The best thing about static routing is that your routers know longer advertise their existence or send routing information to other routers, effectively reducing the amount of overhead on your network.

So, now you know

These are just the fundamentals of routers. As you saw, I spared much of the detail surrounding how each routing protocol specifically works, how we install routers, configure them, and much more. I feel putting it all into one post is too much, so I’ll have to divide this topic as I did with switches.

 

References

Meyers, M. (2015). All in One CompTIA Network+ Certification Exam N10-006. McGraw-Hill Education: New York, NY.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: