NET 102 - Networking Essentials II

Chapter 8, Routing


This lesson goes into more detail about some concepts we have touched on already. Objectives important to this lesson:

  1. Select appropriate Network Devices for a given situation
  2. Select the appropriate LAN connectivity hardware for a given network design
  3. Map the functions of various network devices to their associated protocols and OSI layers
  4. How routers work
  5. Dynamic routing
  6. Installing and configuring a router
Chapter 8

The author spends the first page describing the basic purpose of a router: to connect two or more networks. He provides us with a small photo of ports on a commercial router (a Cisco 2611, which went out of production in 2003). He points out a difference between home routers and commercial routers: home routers typically only connect two networks (yours and your ISP's) but they typically incorporate a switch, which commercial routers do not. Think about it like this. A switch is a networking device: it allows hosts to connect to your network. A router is an internetworking device: is allows your network to connect to another network. As we have discussed before, the home router also typically includes software to act as a DHCP server, and my include firewall software.

The text and the LabSim videos both discuss the idea that a router receives a frame from its local network, unwraps the frame and examines the Network layer information to determine whether this message has to stay on this network or be passed on to another one. We discussed this last week. The router clears the MAC addresses from the frame, reads the information in the IP addresses, writes what needs to be written in the frame, and passes the frame to another router, or a switch if the network address is local.

The text continues with a discussion of routing tables. A router keeps a table that is really a set of rules. It says what to do with incoming packets, based on the network addresses in those packets. The rules in this table can be set set automatically, set by an administrator, set by a protocol, or can be set by all three methods. Each line has a rule that describes some kind of packets, and a route to use for packets that are described by that rule. The example on page 185 is a bit small to read clearly. It is meant to explain a routing table used by a home router. As such, it only references two routes on three rules. The table shown in the text has three lines and four columns. It looks like this:

Destination LAN address Subnet Mask Gateway Interface LAN WAN WAN

To understand the table you need to know several things:

  • A router automatically puts a rule in its routing table for every network it is attached to. This is what happened on the first two lines.
  • The first line represents the home network this router is part of. It says, "If I see a message for an address on network, I do not need to hand off to another router, and I will pass it as a frame to my LAN port."
    If the message being examined is not described by this rule, the next rule is evaluated.
  • The second line represents the ISP network that this router is part of. It says, "If I see a message for an address on network, I do not need to hand off to another router, and I will pass it as a frame to my WAN port."
    If the message being examined is not described by this rule, the next rule is evaluated.
  • The third line has a new meaning for The rule means, "If I see a message for an address on any network, I will pass it to the gateway router on my ISP's network, as a frame to my WAN port."
    This rule is only evaluated if the message being considered did not meet the requirements of either the first or second rule.

The first two rules are placed in the table automatically when those two networks are detected. They essentially say to pass along any message for hosts on those networks on those networks. No other router is mentioned in the Gateway column for those rules. There is no next hop, because the message is already being handled by a router on the correct network. On the third rule, a catch all filter is used: for a host on any network, the next hop is my ISP's gateway, which is on the network connected to my WAN port. This is the router's default rule: unless I have already told you otherwise, do this with any packet you see.

The text explains that all hosts on an IP network keep routing tables as well. We see how to display the routing table of a Windows XP PC on page 187. In another page or so, the text finally mentions how to see the routing table on most devices:

Operating System Commands
Linux or OS X netstat -r


(two possible commands)

netstat -r

route print

Cisco OS show ip route

There are several differences in the Windows table we are shown. The first is that the default route is shown as the rule at the top of the table instead of the bottom. This is because Windows routing tables are evaluated from the bottom up, instead of from the top down.

Some columns are different as well. The first four columns are called by some different names, but they mean the same thing: the network the message is sent to, the subnet mask for that network, the gateway (if any) to hand it to, and the port that is used to reach that gateway. The fifth column shows metrics. These are values the device will use to choose a route whenever it has two or more active routes to the same network. A route is active if there are live devices up and running, for every hop to destination. If a route goes down, it is good to have an alternate route available.

In the Interface column of the Windows routing table, we see only two values: one is the IP address of the only NIC in this machine, and the other is the local loopback address. When a route leads to the local loopback, the signal does not need to leave the device. When it leads to the NIC, it does.

For the routes that lead to the NIC, there are two possible values in the Gateway column. When the signal is handed off to a device on the local LAN, the address of our NIC appears in the Gateway column. (If the PC was running Windows Vista or later, this would say on-link instead of the NIC's IP address.) When the signal is going outside our LAN, the address of the router for the LAN (default Gateway) is in the Gateway column.

On page 190, the text shows us a portion of a Cisco router's routing table. Note that when the command is given to show IP routes, the first several lines of output are a list of codes used to tell the reader how the router learned about that route. There are only three lines in the actual table in this example. Two routes were learned by direct connection (code C), and one was a static route set by an administrator (code S). Most of the other codes refer to routing protocols that might be used by one router to request or to tell another router about routes.

The text spends a great many words telling you that all the possible IPv4 addresses have been assigned. Even so, it tells you that once upon a time, if you were setting up a network you would make an application to IANA to get some. Now, it is easier: you set up a private address network, and use Network Address Translation to connect to the Internet through your ISP. The text explains variants of NAT:

  • basic NAT - each device on your network could be assigned a specific public address to use; the drawback to this is that it does not provide any economy: you still need as many public addresses as you have private addresses; might be called Source NAT, Destination NAT, Static NAT, Dynamic NAT, or pooled NAT
  • Port Address Translation (PAT) - in this version, your private addressees all share one public address, but each is assigned a port number so the routers can tell which device the responses are for; this works for sessions that originate inside your network, but not for sessions that originate outside it
  • Port Forwarding - for incoming traffic, requests are examined and mapped to predetermined local addresses (e.g. a request for a web page goes to your web server); specific ports can be used in URLs to route traffic more automatically

The text turns to a discussion of dynamic routing on page 196.In this context, dynamic means anything other than the static routes that are learned from local connections and from routes entered by administrators. Some familiar concepts are offered up again. On page 198, the text discusses several different ways to calculate a metric for a route:

  • MTU - a route might be preferred if it has a larger Maximum Transmission Unit size, simply because that means fewer fragments for each transmission; the text has already explained that transmission from one router to another is probably not done by Ethernet rules
  • cost - this may be an actual monetary cost, if you are being billed by message unit, or it may be an arbitrary value assigned to different types of routes
  • bandwidth - a wider bandwidth is desirable in most cases, but heavy traffic may require a mix of wider and narrower channels for best effect
  • latency - the text offers several metaphors, and only one real example: the speed of light sounds great until you consider the time it takes to send a signal to a satellite, process it, and get a response; networks can slow down for other reasons, which points out that the metric for a particular route may change over time

A dynamic protocol is usually one of two types:

  • Distance Vector - (Think Distance Vector... DV... Darth Vader: bad) a verbose algorithm, in which tables are sent in their entirety to other routers, routers calculate route costs based on second hand information, and convergence (routers sharing information with each other) is slow. Tables are constantly in flux, and updates are sent at intervals ranging from 10 seconds to two minutes.
    • RIP (now called RIP 1 or RIPv1) is the oldest Distance Vector protocol used in IP networks. It will not use a route that is longer than 15 hops. RIP is the only protocol we consider that is classful.
    • RIP 2 (RIPv2) supports Variable Length Subnet Masking (VLSM), which means you are not restricted to classful subnet masks. Still has a maximum hop count of 15 for routes it will use. Why use it? It is built in and easy to configure.
    • BGP - Border Gateway Protocol is a special case: it is the name of protocol and also the name of a category of protocols
      • the Internet is divided into many Autonomous Systems (ASs)
      • each AS is assigned an AS Number (ASN) by IANA, which is currently expressed as two bytes
      • the routers that connect one AS to another communicate with BGP
      • BGP is more of a composite protocol, but CompTIA calls it a Distance Vector protocol
      • The text mentions that we are probably using BGP-4
  • Link State - (Think Link State... LS... Luke Skywalker: good) tables are sent in their entirety when a router is booted, but only first hand information is sent after that. This avoids the count-to-infinity problem. The routers send Link State Packets (LSPs) which contain only information about networks the routers connect to directly.
    • IP networks use the OSPF protocol or OSI's Link State protocol called Intermediate System to Intermediate System (IS-IS)
    • OSPF stands for Open Shortest Path First. It calculates a cost based on the bandwidth of the route

Some protocols are best used for specific purposes.

  • Exterior Gateway Protocols are used for signals from one AS to another. BGP is an EGP. .
  • Interior Gateway Protocols are used for signals within an AS. The following are IGPs:
    • EIGRP - Enhanced Interior Gateway Routing Protocol is from Cisco, does not fit either category
    • Autonomous Systems are divided into Areas, each router represents one area, and is given an address that looks like an IP address. OSPF requires an Area 0 (address that all other areas pass signals through on their way to the Internet;
    • IS-IS does not require an Area 0, but works like OSPF

The text mentions console cables on page 210, and shows an example of a Yost cable, which has a serial connector on one end and an RJ-45 on the other. We have also talked about rollover cables, which are used for the same purpose: connecting from a host to the console port on a router. You do that to sign in as an administrator and configure your router. You use a terminal emulation program on the host to make the connection to the router. Two terminal emulators are mentioned in the text: PuTTY and HyperTerminal. A few pages later, the text also mentions Secure Shell. The settings for the terminal emulator are listed on page 210 as well. They are like the settings you use in a modem program:

  • 9600 baud (which means the signal can change 9600 times per second)
  • 8 data bits (which is what you would expect your data to look like)
  • 1 stop bit (an extra bit to mark each byte)
  • No parity (an early form of error checking)

The text continues to introduce you to Cisco IOS, the operating system used on commercial Cisco equipment. The author observes that you need to know a lot about the Cisco IOS for the Cisco certifications, but not so much for the Network+ certification.

There are other ways to configure a router. If you own a home router from Linksys, you own a Cisco router that does not have a console port. You use a web interface to configure it instead, and you can do the same thing with their larger routers. However, there is a warning on page 212 that you should consider. The text tells us never to plug a new router into an existing network. That's a little strong. I think the author means that we should directly connect one host to the router and configure it first before making it a physical part of our network. Teach it about our rules first, then install it in its intended place.

The text continues with a larger concept. If we only have one router to worry about, the methods above are fine. If we have dozens to manage, we are better off using some kind of Network Management Software. Note the example screen shots on page 213 and 214 of network management tools. Vendor tools are recommended for a larger feature set.

On page 215, the text discusses basic setup of a router, and mentions that you will typically connect the WAN port of the router to your ISP's connection device (such as a cable modem) and will typically use DHCP to obtain an address for the router that fits on the ISP's network.

You will want to set up your LAN on the router as well. If you use the router to assign addresses on your network, decide whether you will use the router's default address scheme. You will want to change that if you already have an address scheme that you must match, which is often the case on a business network.

Assignment 1: Chapter 8

  1. Do the multiple choice questions for chapter 8.

Assignment 2: Chapter 8 and LabSim

  1. Review LabSim items 5.4.2 (Routing Facts), 5.4.4 (Routing Protocol Characteristics Facts) and 5.4.6 (Routing Protocol Facts).
  2. Take LabSim test 5.4.8 to review your knowledge of routing