Chapter 4

How Intranet Routers Work


CONTENTS

Routers are the traffic cops of intranets. They make sure that all data gets sent to where it's supposed to go and that it gets sent via the most efficient route. Routers are also useful tools to make the most efficient use of the intranet. Routers are used to segment traffic and provide redundancy of routes. Routers use encapsulation to permit different protocols to be sent across otherwise incompatible networks.

When you sit down at your computer on an intranet and send or receive data, that information generally must first go through at least one router, and often more than one router before it reaches its final destination. Routers can be simple or quite sophisticated. Factors that determine the required complexity of a router include the size of the intranet, the type and quantity of traffic on segments, and security concerns of the intranet. The more complex the intranet, and, in particular, the greater number of possible destinations for data, the greater the need for sophisticated router hardware and software.

Routers open the IP packet to read the destination address, calculate the best route, and then send the packet toward the final destination. If the destination is on the same part of an intranet, the packet would be sent directly to the destination computer by the router. If the packet is destined for another intranet or subnetwork (or if the destination is on the Internet), the router considers factors like traffic congestion and the number of hops-a term that refers to the number of routers or gateways on any given path. The IP packet carries with it a segment that holds the hop count and a router will not use a path that would exceed a predefined number of hops. Multiple routes within an acceptable hop count range are desirable in intranets to provide redundancy and assure that data can get through. For example, if a direct route between San Francisco and New York were unavailable, sophisticated routers would send data to New York via another router probably in another city on the intranet-and this would all be transparent to the users.

Routers have two or more physical ports: receiving (input) ports and sending (output) ports. In actuality, every port is bi-directional and can receive or send data. When a packet is received at an input port, a software routine called a routing process is run. This process looks inside the header information in the IP packet and finds the address where the data is being sent. It then compares this address against an internal database called a routing table that has information detailing to which port packets with various IP addresses should be sent. Based on what it finds in the routing table, it sends the packet to a specific output port. This output port then sends the data to the next router or to the destination itself.

At times, packets are sent to a router's input port faster than it can process them. When this happens, the packets are sent to a special holding area called an input queue, an area of RAM on the router. That specific input queue is associated with a specific input port. A router can have more than one input queue, if several input ports are being sent packets faster than the router can process them. Each input port will process packets from the queue in the order in which they were received.

If the traffic through the router is very heavy, the number of packets in the queue can be greater than the capacity of the queue. (The capacity of the queue is called the queue's length.) When this happens, there is a possibility that packets may be dropped and so will not be processed by the router, and won't be sent to their destination. This doesn't mean, though, that the information has be to lost. The TCP protocol was designed to take into account that packets can be lost en route to their final destination. If not all the packets are sent to the receiving end, TCP at the receiving computer recognizes that and asks that the missing packets be re-sent. It will keep requesting that the packets be re-sent until they are all received. Sophisticated routers can be managed and problems diagnosed and resolved using special software, such as SNMP (Simple Network Management Protocol). TCP can tell what actions to take because there are various flags in the packet, like the hop count in IP, that tell TCP what it needs to know to act. For example, the ack flag, set to "on," indicates that it is responding to (acknowledging) a previous communication.

A wide variety of routing hardware and software is available. In some cases, a variety of different kinds of routing software can be run on a given piece of hardware. For example, Novell's Multi Protocol Router is routing software that runs on router hardware. In other instances-and particularly when routers are high-performance routers-the routing software is built directly into a router's hardware or firmware.

There are several kinds of tables used in routing. In the simplest kind of intranet, an exceedingly simple routing table can be used, called a minimal routing table. When an intranet is composed of a single TCP/IP network, and when that network is not connected to any other TCP/IP network or to the Internet, minimal routing can be used. In minimal routing, a program called ifconfig automatically creates the table, which contains only a few basic entries. Since there are very few places that data can be sent, only a minimal number of routes need to be configured.

If an intranet has only a limited number of other TCP/IP networks, then a static routing table can be used. In this case, packets with specific addresses are sent to specific routers-the routers do not redirect packets to adjust to changing network traffic. Static routing should be used when there is only one route to each given destination. A static routing table allows an intranet administrator to add or take away entries in the routing table.

Dynamic routing tables are the most sophisticated routing tables. They should be used when there is more than one way in which data can be sent from a router to the final destination, and in more complex intranets. These tables constantly change as network traffic and conditions change, so that they always route data the most efficient way possible, taking into account the current state of traffic on the intranet.

Dynamic routing tables are built using routing protocols. These protocols are ways in which routers communicate with one another, giving each other information about the most efficient way of routing data given the current state of the intranet. A router with a dynamic routing table can automatically switch data to a backup route if the primary route is down. It can also always determine the most efficient way of routing data toward its final destination. Routers advertise their IP addresses and know the IP addresses of their neighbors. Routers can use this information in an algorithm to calculate the best route to send packets.

The most common routing protocol that performs these best-case calculations is known as RIP (Routing Information Protocol). When RIP determines the most efficient route for data, it calculates the hop count for the route. RIP always chooses the path with the lowest hop count as the route to send data over. It assumes that the fewer the hops, the more efficient the path. RIP will not allow any path with a hop count of over 16. If there is a hop count of over 16, it will discard the route. On most intranets this shouldn't be a problem.

The Exterior Gateway Protocol (EGP) is used for the Internet where many more routers might have to be traversed before a packet reaches its final destination. It will not be needed on an intranet since it's rare that an intranet would be so large that data would have to pass through more than 16 routers or gateways in order to be sent to the final destination.

The thing to keep in mind about intranets and routing technology is that it is not an either/or situation. Many different kinds of routing technologies can be used on a single intranet, depending on the needs of that particular part of the network. Some parts may be able to use routers with static routing tables, while other parts may require dynamic routing tables. As in anything having to do with intranets, the whole point is flexibility and using the right tool for the job.

How Intranet Routers Work

Just as routers direct traffic on the Internet, sending information to its proper destination, routers on an intranet perform the same function. Routers-equipment that is a combination of hardware and software-can send the data to a computer on the same subnetwork inside the intranet, to another network on the intranet, or outside to the Internet. They do this by examining header information in IP packets, and then sending the data on its way. Typically, a router will send the packet to the next router closest to the final destination, which in turn sends it to an even closer router, and so on, until the data reaches its intended recipient.

  1. A router has input ports for receiving IP packets, and output ports for sending those packets toward their destination. When a packet comes to the input port, the router examines the packet header, and checks the destination in it against a routing table-a database that tells the router how to send packets to various destinations.
  2. Based on the information in the routing table, the packet is sent to a particular output port, which sends the packet to the next closest router to the packet's destination.
  3. If packets come to the input port more quickly than the router can process them, they are sent to a holding area called an input queue. The router then processes packets from the queue in the order they were received. If the number of packets received exceeds the capacity of the queue (called the length of the queue), packets may be lost. When this happens, the TCP protocol on the sending and receiving computers will have the packets re-sent.
  4. In a simple intranet that is a single, completely self-contained network, and in which there are no connections to any other network or the intranet, only minimal routing need be done, and so the routing table in the router is exceedingly simple with very few entries, and is constructed automatically by a program called ifconfig.
  5. In a slightly more complicated intranet which is composed of a number of TCP/IP-based networks, and connects to a limited number of TCP/IP-based networks, static routing will be required. In static routing, the routing table has specific ways of routing data to other networks. Only those pathways can be used. Intranet administrators can add routes to the routing table. Static routing is more flexible than minimal routing, but it can't change routes as network traffic changes, and so isn't suitable for many intranets.
  6. In more complex intranets, dynamic routing will be required. Dynamic routing is used to permit multiple routes for a packet to reach its final destination. Dynamic routing also allows routers to change the way they route information based on the amount of network traffic on some paths and routers. In dynamic routing, the routing table is called a dynamic routing table and changes as network conditions change. The tables are built dynamically by routing protocols, and so constantly change according to network traffic and conditions.
  7. There are two broad types of routing protocols: interior and exterior. Interior routing protocols are typically used on internal routers inside an intranet that routes traffic bound only for inside the intranet. A common interior routing protocol is the Routing Information Protocol (RIP). Exterior protocols are typically used for external routers on the Internet., AÊcommon exterior protocol is the Exterior Gateway Protocol (EGP).