The Routing Process


When a router needs to forward a packet to another router for delivery to a remote network, it consults a database of information known as the routing table. This database is stored in the router's random access memory (RAM) to ensure that this lookup process can be performed quickly. As the packet travels across the network toward its destination, each router along the way makes a decision about where to forward the packet by consulting its routing table. When a destination host sends a reply packet, it is possible that the same path may not be used to reach the original sender. This depends on the metrics of each path along the route. In other words, the way to the destination host may not be the best path back. The following sections discuss the two types of routing: static and dynamic.

Static Routing

Objective:

Manage TCP/IP routing.

  • Manage routing tables.

Manually configuring the routing table of a host with the routes for each destination network is known as static routing. Static routing is best suited to small environments where the amount of information to configure is small and the overhead of generating the routing information is unacceptable. Static routers do not scale well to large or frequently changing internetworks because of their manual administration.

Using the route Command to Configure Static Routes

The route command is primarily used to configure static routes within a network. It can also be used to troubleshoot by listing all the routes that the computer knows about.

The syntax of the route command is as follows:

ROUTE [-f] [-p] [command [destination] [MASK netmask] [gateway] [METRIC metric] [IF interface]


Table 7.1 describes the parameters that can be used with the route command.

Table 7.1. Parameters of the route Command

Parameter

Description

-f

Clears the routing tables of all gateway entries. If this is used in conjunction with one of the commands, the tables are cleared before the command is run.

-p

When this parameter is used with the add command, it makes a route persistent across boots of the system. By default, routes are not preserved when the system is restarted. This parameter is ignored for all other commands, which always affect the appropriate persistent routes. This option is not supported in Windows 95.

PRINT

Prints a route.

ADD

Adds a route.

DELETE

Deletes a route.

CHANGE

Modifies an existing route.

destination

Specifies the destination. The destination parameter can contain a host address, subnet address, network address, or default gateway.

MASK

Specifies that the next parameter is the netmask value.

netmask

Specifies a subnet mask value for this route entry. If not specified, it defaults to 255.255.255.255.

gateway

Specifies the gateway.

MEtrIC

Specifies that the next parameter is the meTRic value.

meTRic

Specifies the metricfor example, cost for the destination.

IF

Specifies that the next parameter is the interface value.

interface

Specifies the interface number for the route.


Note: The mask Parameter

The mask parameter defines what portion of the destination address must match for the route to be used. When the mask is written in binary, a 1 is significant (that is, must match), and a 0 need not match. For example, say that a 255.255.255.255 mask is used for a host entry. The mask of all 255s (that is, all 1s) means that the destination address of the packet to be routed must exactly match the network address for this route to be used. As another example, say the network address 157.57.8.0 has a netmask of 255.255.248.0. This netmask means that both of the first two octets must match, the first 5 bits of the third octet must match (that is, 248 must equal 11111000), and the last octet does not matter. Thus, any address of 157.57 and the third octet of 8 through 15 (that is, 15=00001111) will use this route.


The gateway parameter specifies where the packet needs to be sent. This can be the local NIC or a router on the local subnet.

The meTRic parameter specifies a cost that is to be associated with the route. This cost is used in the decision about how packets should be routed. Packets are routed through the route that has the lowest cost.

Step by Step 7.3 shows how to add a static route for the network 10.100.10.0.

Step By Step
7.3. Adding a Static Route to Windows Server 2003

1.

Open the command prompt by selecting Start, Programs, Accessories, Command Prompt. The Command Prompt window opens.

Display the system's existing routing table by typing route print and pressing Enter. Make note of the routes listed so that you can check them against the routes listed after you add the static route. You should see information similar to the following (which will vary from computer to computer, based on your computer's interfaces, network addresses, and existing routes):

IPv4 Route Table =========================================================================== Interface List 0x1 ........................... MS TCP Loopback interface 0x10003 ...00 13 72 0e 98 7e ...... Broadcom NetXtreme Gigabit Ethernet =========================================================================== =========================================================================== Active Routes: Network Destination        Netmask          Gateway       Interface  Metric           0.0.0.0          0.0.0.0      192.168.0.1    192.168.0.156     20         127.0.0.0        255.0.0.0        127.0.0.1        127.0.0.1      1       192.168.0.0    255.255.255.0    192.168.0.156    192.168.0.156     20     192.168.0.156  255.255.255.255        127.0.0.1        127.0.0.1     20     192.168.0.255  255.255.255.255    192.168.0.156    192.168.0.156     20         224.0.0.0        240.0.0.0    192.168.0.156    192.168.0.156     20   255.255.255.255  255.255.255.255    192.168.0.156    192.168.0.156      1 Default Gateway:       192.168.0.1 =========================================================================== Persistent Routes:   None


3.

In the Command Prompt window, type the following command and then press Enter: route add 10.100.10.0 mask 255.255.255.0 192.168.0.156 metric 2.

A successful entry returns you to the command prompt, with no message. If the entry addition is unsuccessful, you receive an error message. The gateway value (in italics in this example entry) must match an interface IP address on the server for this to be successful.

4.

To display the system's routing table with the newly added route, type route print and press Enter. This displays information similar to the following (note the newly added route, in bold in the text shown):

IPv4 Route Table =========================================================================== Interface List 0x1 ........................... MS TCP Loopback interface 0x10003 ...00 13 72 0e 98 7e ...... Broadcom NetXtreme Gigabit Ethernet =========================================================================== =========================================================================== Active Routes: Network Destination        Netmask          Gateway       Interface  Metric           0.0.0.0          0.0.0.0      192.168.0.1    192.168.0.156     20       10.100.10.0    255.255.255.0    192.168.0.156    192.168.0.156      2        127.0.0.0        255.0.0.0        127.0.0.1        127.0.0.1       1      192.168.0.0    255.255.255.0    192.168.0.156    192.168.0.156      20 192.168.0.156  255.255.255.255        127.0.0.1        127.0.0.1      20    192.168.0.255  255.255.255.255    192.168.0.156    192.168.0.156      20        224.0.0.0        240.0.0.0    192.168.0.156    192.168.0.156      20  255.255.255.255  255.255.255.255    192.168.0.156    192.168.0.156       1 Default Gateway:       192.168.0.1 =========================================================================== Persistent Routes:   None


Dynamic Routing

Generating routing table information by learning the routes from information on the network is called dynamic routing. This is done by using a dynamic routing protocol such as RIP or OSPF. Let's examine what a routing protocol is: A general definition of protocol is "an agreed-on method for exchanging data between two devices." A routing protocol defines the method for exchanging routing information between two routing devices. A dynamic routing protocol is used to exchange routing information that is built and maintained automatically. When you are using a dynamic routing protocol, routing information is exchanged between routers to update the information kept in their routing tables. This can be done either periodically (at scheduled intervals) or on demand. If they are set up correctly at the outset, dynamic routers require little administration after they have been configured. Because they learn routing information dynamically, and have the ability to route around failures when the network architecture will support it, dynamic routers are generally used in large network environments where it would not be practical to use static routing. The two dynamic routing protocols that are supported by Windows Server 2003 are RIP and OSPF.




MCSA(s)MCSE 70-291(c) Implementing, Managing, and Maintaining a Microsoft Windows Server 2003 Network Infrastructure
MCSA/MCSE 70-291: Implementing, Managing, and Maintaining a Microsoft Windows Server 2003 Network Infrastructure (Exam Prep)
ISBN: 0789736497
EAN: 2147483647
Year: 2006
Pages: 196
Authors: Will Schmied

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net