Routing

Unit 3 : Let’s Route
Lesson 3-2: Routing
At a Glance
Routers perform many functions on a network, from segmenting large
networks so that they work more efficiently to interconnecting networks
that use different LAN or WAN transmission technologies. The job that
routers are best know for, however, is forwarding data from a host on one
network to a host on another network. Whether the data is an email
message, a huge video file, or a simple ping, a router will read the data’s
destination, determine how it should get there, and send it onward.
This lesson will introduce the basics of the routing procedure and examine
a typical data packet and a routing table.
What You Will Learn
After completing this lesson, you will be able to do the following:
•
Describe the basic process of IP routing.
•
Explain the process by which routers forward packets.
•
Describe the components of a Nortel Networks routing table.
•
Explain the difference between dynamic and static routing table.
•
Configure a static route.
ST0025804A
137
Lesson 3-2: Routing
138
ST0025804A
Routing
Unit 3 : Let’s Route
Tech Talk
•
Datagram—A packet of data at the network layer.
•
Frame—A packet of data at the data link layer.
•
Packet—A package of data transmitted over a communications link.
•
Time to Live—The amount of time in seconds that a packet is allowed
to try to reach its destination before being thrown away.
•
Hop—A jump that a datagram takes from one router to the next.
•
Routing Table—A table that tells a router the next hop a packet should
take toward its destination.
•
Gateway Router—A router that functions as the connection between a
network and the Internet.
•
Static Route—An entry in a routing table manually entered by a
network administrator.
•
Default Route—An entry in a routing table that directs a router where
to send packets for which there is no other table entry.
ST0025804A
139
Lesson 3-2: Routing
Basic Router Operation
Routers find paths to forward data packets from a device on one network to
a device that may be on a network nearby or far away. Routers discover
paths, figure out which is the best one to use, and remember that
information in a routing table. This ability sets routers apart from bridges.
Routers are intelligent and they use this intelligence to find routes.
A router listens to the LAN transmission media and accepts frames that
are addressed to a port on the router or that are addressed to the entire
network (called a broadcast address). Once it receives all the bits that
make up a frame, the router, operating at Layer 2, strips off the framing
that was added by the LAN protocol (for example, Ethernet) to reveal the
IP packet inside.
The router performs three basic operations on the IP packet.
•
Operating at Layer 3, the router uses the IP protocol to get the
destination address from the IP packet.
•
The router looks up that address in its routing table. If the router finds
the destination address in its routing table, it looks up which of its
ports is connected to the machine or network with that address.
If the router checks its routing table and does not find the destination
address of the packet then it looks up which of its ports is connected to
the default route.
•
140
Then, the IP protocol switches the packet to the port connected to the
destination or the port connected to the default route. If the router has
not found the destination address in its routing table and does not have
a default route defined, it discards the packet.
ST0025804A
Routing
Unit 3 : Let’s Route
IP Datagrams
Routers forward data in the form of IP packets, which are more
appropriately called datagrams. The most important parts of an IP
datagram are the data it contains and the source and destination address.
The addresses are the IP addresses that you studied in the previous lesson.
The table below includes a complete list of all the parts of an IP datagram
header.
32
bits
32
bits
031
bits
Var.
Data
16
bits
Padding
Time to Live
8
bits
Destination IP
Address
8
bits
Header
Checksum
Source IP
Address
13
bits
Protocol IP
3x1
bits
Fragment Offset
16
bits
Packet ID
16
bits
Total Length
8x1
bits
Service Flags
4
bits
Header Length
IP Version *
4
bits
Flags
IP Datagram Header
•
IP Version—There are two versions of IP: IPv4 and IPv6. All nodes and
gateways must agree on the version to use.
•
Header Length—The length of the header.
•
Service Flags—These flags can be used to specify special treatment for
the packet.
•
Total Length—The total length of the packet in octets. Packets can be
up to 65,535 octets long.
•
Packet ID—For faster transmission, sometimes a datagram is broken
into fragments. A packet identifier is assigned to each fragment so that
they can be reassembled correctly.
•
Flags—These three bits are used to manage fragmentation of a
datagram. The first bit is always 0. The second bit is used by the
sending node. It is 1 if the datagram is fragmented and 0 if it is not.
The third bit is used by the receiving node. It is 1 if there are more
fragments following this one or 0 if this is the last fragment.
•
Fragment Offset—This number tells where the fragment fits in the
reassembled packet.
ST0025804A
141
Lesson 3-2: Routing
•
Time To Live—This specifies how many seconds the packet can remain
in the Internet. Routers that forward a packet will decrease this time to
live counter by one. If the counter reaches zero, the packet is discarded
and an Internet Control Message Protocol (ICMP) message is sent back
to the source host. Time to Live ensures that packets that cannot get to
their destinations do not hang around and clog up the Internet.
•
Protocol ID—Specifies the upper layer protocol, such as TCP or UDP,
which is encapsulated in the packet.
•
Header Checksum—Used to verify that the header (not the actual data,
just the header) has not been corrupted during transmission.
•
Source IP Address—The address of the machine that sent the packet.
•
Destination IP Address—The address of the machine to which the
packet is going.
•
Padding—Extra zeroes are added to the packet so that its length is a
multiple of 32 bits.
•
Data—This portion of the datagram is variable in length to
accommodate the actual information being transmitted.
The data carried by an IP datagram is most often contained in a TCP
segment or a UDP datagram. These two data structures are important to
recognize for what they have in common and for how they are different.
They are similar in that both contain an even more specific address than
the destination IP address of the datagram. TCP and UDP addresses
include a port number that identifies a particular process on the host. Port
numbers are not standardized but usually a particular process will have
the same port number on most hosts. For example, a web server usually
has a port number of 80.
TCP and UDP are different in that TCP is connection-oriented while UDP
is connectionless.
Routing Tables
When a datagram arrives at the router on its way to another host, the
router looks up that destination in its routing table, finds the correct port
for that destination, and sends the packet out via that port. A routing table
contains entries that specify the next hop in the transmission path a
packet must follow to get to a particular destination address.
If the router had to keep a table of routes to every computer on the
Internet, it would have to hold millions and millions of possible routes.
This would cause several major problems.
•
142
The router would need a huge amount of memory to store the table
with all the routes.
ST0025804A
Routing
Unit 3 : Let’s Route
•
Each time a packet arrived, the router would have to search through a
huge table to find the best route for that packet.
•
The router would have to spend a lot of time checking those possible
routes to make sure they were open.
Scalability is the problem of how to make routers continue to work quickly
even as the number of destinations grows. As you learned in the IP
Addressing lesson, to solve the scalability problem, the job of routing is
distributed among routers. Instead of remembering the address and the
route to every host on the Internet, some routers remember only the
address and the route to other networks.
Once the packet gets to the correct network, a router on that network
sends the packet to the correct host. This way, a router in one part of the
Internet does not have to know the route to every machine on a network in
another part of the Internet. It only has to know how to get a packet to
that network. In fact, the router does not necessarily need to know how to
get the packet all the way to the other network. It only needs to know how
to send the packet toward its destination.
Check Your Understanding
♦ List three possible problems that might occur if a router had to keep
all the addresses of all the computers attached to the Internet.
ST0025804A
143
Lesson 3-2: Routing
Routing Table Fields
A routing table has several fields. The routing table for a Nortel Networks
router has seven fields.
144
•
Destination—The dotted decimal address of the destination network.
•
Metric—Cost to the destination network. Depending on the protocol
that learned the route, this may be a simple hop count or a user
assigned cost value.
•
Next Hop—The dotted-decimal IP address of the next hop interface used to
forward a packet through the network.
•
Type—The type of route. Direct indicates that the destination network for
this route is directly connected to the router. Indirect indicates that the
destination network is not directly connected to the router.
•
Protocol—The way the router learned this route. Routers have the ability
to learn routes on their own.
•
Age—The number of seconds since this route was last updated.
•
Index—This number is assigned by the router to the circuit over which the
next hop can be reached.
ST0025804A
Routing
Unit 3 : Let’s Route
How a Router Consults a Routing Table
Router
A
Table
IP
Diagram
A 1
B 1
C 2
D 3
E 1
F 2
G 3
H 3
Port
1
Port
2
Port
3
Router
B
Router
E
Router
C
Router
F
Router
D
Router
G
Router
H
Router
When a router receives an IP datagram, it checks the destination address
and consults the routing table to find a next hop that is associated with
that address.
The next hop address is the critical piece of information that a router must
contain. For destination machines that are connected to the same network
as the router, the routing table includes the Layer 3 address (the IP
address) of the machine and the number of the port on the router that it is
connected to.
For destination machines or networks that are not directly connected to
the router, the table includes the Layer 3 address of the machine and the
number of the port on the router that will send the data in the right
direction.
Cost is another critical piece of information. It specifies the number of
router hops a datagram can traverse before reaching the destination IP
address. The router uses the cost value when determining the best route
for a datagram to follow.
ST0025804A
145
Lesson 3-2: Routing
Static Routing
A router acquires routes in two primary ways: Through dynamic routing,
the router can use any of a number of protocols to learn routes. Through
static routing, a network administrator can enter the routes directly into
the table.
A network administrator might define a static route to:
•
Control the path that a datagram follows.
•
Decrease the amount of traffic exchanged between routers. In future
lessons you will learn that routers must communicate with other
routers about routes and the status of those routes. This
communication can take up valuable bandwidth. With a static route,
updates do not need to be broadcast to other servers as frequently.
•
Define a default route.
•
Improve network security. The route into and out of a network can be
limited to one predefined path.
•
Improve the efficiency of the network. When a router is given the route
to use, it does not have to make calculations, which speeds up its
performance. Using a limited number of static routes, a router also does
not need to store the incoming data while it figures out where it should
go, it already knows the correct route when it receives the data. This
means the router needs less buffer memory.
When configuring static routes, consider the following:
146
•
A static route can be assigned a preference from 1 to 16, with 16 being
the most preferred. When the router must choose between multiple
routes to the same destination, it will choose the route with the highest
preference.
•
Routing protocols such as RIP assign the routes they discover a routing
preference of 1.
•
Static routes remain in IP routing tables until you remove them. Note,
however, that if the interface that was used to reach the next hop in the
static route becomes disabled, the static route disappears from the IP
routing table.
ST0025804A
Routing
Unit 3 : Let’s Route
Static Route Example 1
In the example below, there are two connections between Router A and
Router B: a 1.544 Mbps T1 line and a backup connection that uses one
channel on a dial-up ISDN line. The path a datagram will take to get from
host A to host B cannot be predicted. The path can be controlled so that the
T1 line is used all the time and the dial-up line is reserved for emergencies:
1. At router A, build a static route:
a. Destination Network 128.128.5.0.
b. Next Hop Address 128.128.3.2.
c. Preference 16.
2. At router C, build a static route:
a. Destination Network 128.128.1.0.
b. Next Hop Address 128.128.3.1.
c. Preference 16.
Static Route Example 1
128.128.1.0
Host A
.2
.1
Router A
.1
T1
128.128.3.0
128.128.2.0 64K
Host B
.2
.2
.1
128.128.5.0
.1
.2
Router C
Network 128.128.0.0
Subnet Mask = 255.255.255.0
ST0025804A
147
Lesson 3-2: Routing
Static Route Example 2
Static routes can be used to override the routes that routing protocols
mistakenly select. In the second example, IP communication between host
A and host C might occur over the 64K synchronous link because it has the
lowest cost, that is, the fewest hops. But in this case, the T1 links would
have a higher bandwidth even though they have an additional hop.
It is possible to force Router A to connect to Router C via the T1 by
configuring a static route in the router table of each router as follows:
1. At router A, build a static route:
a. Destination Network 128.128.5.0.
b. Next Hop Address 128.128.3.2.
c. Preference 16.
2. At router B, build two static routes:
d. Destination Network 128.128.5.0.
e. Next Hop Address 128.128.4.2.
f.
Preference 16.
g. Destination Network 128.128.1.0
h. Next Hop Address 128.128.3.1
i.
Preference 16.
3. At router C, build a static route:
j.
Destination Network 128.128.1.0.
k. Next Hop Address 128.128.4.1.
l.
Preference 16.
The significant problem with static routes is that they must be planned
carefully. If they are not, the network administrator may need to
reconfigure the routing table whenever a failure occurs.
148
ST0025804A
Routing
Unit 3 : Let’s Route
Static Route Example 2
128.128.1.0
Host A
Router A
.1
.2
.1
.1
128.128.2.0
T1
.2
Router B
64K
Host B
.1
.2
.2
.1
128.128.3.0
T1
128.128.4.0
Router C.2
.2
128.128.5.0
Network 128.128.0.0
Subnet Mask = 255.255.255.0
Because there is an additional hop in this diagram, the simple static route
from the previous example will not be sufficient in case of a failure. If the
T1 connected to router A fails, Router A will fall back on the route over the
64K line. Router C, however, will still have a viable static route with a
high preference and would not switch over to the 64K line unless there
were another static route for the lower preference 64K line. Then once
router A failed over to the 64K line and router C received ICMP messages
stating that the destination network over the T1 line was unavailable it too
would switch over to the 64K ISDN backup link.
Another solution to the stated problem would be through use of a static
route as follows:
•
Define a static route to network 128.128.5.0 on Router A, using a
preference of 1 and a next hop address of 128.128.2.2.
•
Define a static route to network 128.128.1.0 on Router C, using a
preference of 1 and a next hop address of 128.128.2.1.
ST0025804A
149
Lesson 3-2: Routing
Default Route
The address 0.0.0.0 is used to point to a default gateway. It can be used:
•
On a station for directing communications to nodes not on the same
physical network.
•
On a router to direct requests for unknown networks to a gateway
router.
Example: Defining a Default Route
Address 0.0.0.0 is used to signify a default route. If it is in a routing table,
it can be interpreted to mean any network to which the path is not known.
Therefore, it is possible to define a static default route to point to some
type of gateway router. This gateway router might be the entry point to the
Internet.
Defining a default route allows a router to still forward packets even
though it does not have any routing information about the destination
network.
Default Route Example
Host A
Router A
.2
.1
.1
T1
.3
.1
128.128.3.0
64K
128.128.2.0
.4
Gateway
Router B
Host B
.2
.2
140.250.128.0
.1
T1
128.128.4.0
.2
Router C
Static Route Definition
(Default Route)
Destination Address: 0.0.0.0
Subnet Mask: 0.0.0.0
Next Hop Address: 140.250.128.4
Next Hop Mask: 255.255.255.252
128.128.5.0
Network 128.128.0.0
Subnet Mask = 255.255.255.0
150
ST0025804A
Routing
Unit 3 : Let’s Route
Dynamic Routing
The key to routing lies in routers’ ability to build and maintain their own
routing tables.
As a router monitors all the packets that are being transmitted on the
networks attached to its ports, it learns about the network and host IP
addresses that can be reached from each port. In its routing table the
router keeps track of these addresses and the ports they are connected to.
Routing is a complex job. There is usually more than one way to get a
packet from its source to its destination, routers must determine which
route is best. As machines are added or removed from networks, routers
must keep track of which ones are there and how to get to them. As new
networks are created or subdivided from other networks, routers must
keep track of which addresses belong to which networks and how to send
data to those addresses. As paths between networks get congested or clear
up, routers must keep track of their status so the fastest route can always
be found.
Routing Protocols
Routers use routing protocols to perform the tasks described above. Such
routing protocols as RIP and OSPF allow routers to find available routes,
to communicate to other routers what those routes are and their status, to
select the best route for any particular packet, and to send data packets
along that route.
Routers use routing protocols to:
•
Discover routes to specific destinations.
•
Calculate the best route to a specific destination.
•
Monitor the network for changes or interruptions in the routes.
•
Communicate information about routes to other routers.
Check Your Understanding
♦ Briefly distinguish between a static routing table and a dynamic
routing table.
ST0025804A
151
Lesson 3-2: Routing
Try it Out
Adding a Static Route
Site Manager allows a network administrator to add a static route to the
ARN.
Materials Needed:
•
Classroom Network
•
Windows 95 PC
•
Site Manager
•
Any Word Processor (e.g., MS Word)
•
Pen/Pencil and Paper
•
Student Portfolio
In this lab you will learn how to:
•
Configure a static route.
During this lab, work in teams of three. Record your experiences, results,
speculations, and conclusions in your portfolio.
1. In the Configuration Manager window in Site Manager, click Protocols.
2. Click IP.
3. Click Static Routes.
4. Click Add.
152
ST0025804A
Routing
Unit 3 : Let’s Route
The table below describes the parameters to add a static route.
Parameter
Default
Options
Destination IP Address
None
Any valid IP network address
Address Mask
None
Based on the network class of
the IP address you specified at
the Destination IP Address
parameter.
Cost (Specifies the number
of router hops that will be
traversed before reaching
the destination IP address.
This cost is also
communicated to other
routers by a routing
protocol).
1
1 to the value of the RIP
Diameter parameter.
Next Hop Address (Specifies
the address of the next-hop
router).
0.0.0.0
Any valid IP address.
Next Hop Mask (Specifies
the subnet mask of the next
hop router).
0.0.0.0
Any valid subnet mask
address.
Preference (Specifies a
weighted value (from 1 to
16, with 16 being the most
preferred) that the IP router
uses to select a route when
its routing table contains
multiple routes to the same
destination.)
16
1 to 16
ST0025804A
153
Lesson 3-2: Routing
5. In the Configuration Manager window, enter values from your
classroom network topology map for:
a. Destination
b. IP Address.
c. Address Mask.
d. Next Hop Addr.
e. Next Hop Mask.
Rubric: Suggested Evaluation Criteria and Weightings
154
Criteria
%
Complete record of procedural results.
25
Summary, analysis, synthesis and conclusions
50
Organization and summary in format suitable for
reproduction
25
TOTAL
100
ST0025804A
Your Score
Routing
Unit 3 : Let’s Route
Stretch Yourself
Comparing Datagrams
Materials Needed:
•
Windows 95 PC
•
Internet Connection
•
Sniffer Basic Software
•
Any Word Processor (e.g., MS Word)
•
Pen/Pencil and Paper
•
Student Portfolio
1. Use Snifffer Basic to examine the difference between an IP datagram
containing a TCP segment and one containing a UDP datagram.
2. Monitor the IP Protocols while operating a process that sends a TCP
segment (i.e., Telnet) and one that sends a UDP datagram (i.e., SNMP).
3. Record your observations.
4. In addition to differences you notice between TCP and UDP, be sure to
also note the following:
a. How did you determine which application uses TCP and which uses
UDP?
b. Why do you think the applications have been set up this way?
5. Participate in a class discussion on the results of this activity.
Rubric: Suggested Evaluation Criteria and Weightings
Criteria
%
Successful completion of the activity.
20
Analysis and synthesis of information.
50
Insightful and enthusiastic participation in class
discussion.
30
TOTAL
100
ST0025804A
Your Score
155
Lesson 3-2: Routing
Network Wizards
VisualRoute
VisualRoute  is an inexpensive software package that allows the user to
trace the route of a packet from its source to a specified destination, such
as a web site’s router. There is a demo version available on Data Metric’s
web site that allows the user to try out the product. This activity uses the
demo version only.
Materials Needed:
•
Windows 95 PC
•
Internet Connection
•
VisualRoute Software Demo downloaded
•
Any Word Processor (e.g., MS Word) (optional)
•
Pen/Pencil and Paper
•
Student Portfolio
1. Access the demo version by entering http://visualroute.datametrics.com
into your web browser.
2. To first experience the demo, enter the Nortel Networks URL,
www.nortelnetworks.com, into the Enter Host/URL box.
156
ST0025804A
Routing
Unit 3 : Let’s Route
3. Note the route the packet took from your workstation to Nortel
Networks.
ST0025804A
157
Lesson 3-2: Routing
4. Now find a destination that takes only a few hops.
5. Note the path of the packet.
6. Find a destination that takes more than 25 hops.
7. Note the path of the packet.
8. Pick one of the traces, and make a screen shot (Alt + PrntScrn) for your
portfolio.
9. Analyze the IP address of each hop. What the class is of each hop. Are
some hops on the same network? Speculate why, in some cases, it
takes the packet longer to get from one hop to another.
10. In your portfolio, write a summary of this activity, including the
answers to step 9.
Rubric: Suggested Evaluation Criteria and Weightings
Criteria
%
Thorough summary in portfolio
50
Correct identification of IP classes
50
TOTAL
100
Your Score
Summary
In this unit, you learned the following:
158
•
The routing function of the IP protocol stack.
•
The components of an IP packet header.
•
The process by which routers forward packets.
•
The components of a Nortel Networks routing table.
•
The difference between dynamic and static routes.
•
How to configure and edit a static route.
ST0025804A
Routing
Unit 3 : Let’s Route
Review Questions
Name___________________
Lesson 3-1: Routing
Part A
1. Describe the three basic operations a router performs on an IP packet.
Part B
1. Put the following steps in the IP routing sequence into order
a. Receive frame
b. Check destination IP address against routing table
c. Switch packet to correct port
d. Put packet into frame
e. Strip frame
f.
Check MAC address
2. What does a router do with a packet when it can’t find the destination
address in its router table?
a. Discard it
b. Send it to the default route
c. Store it until it’s told the route
d. Send it to a static route
e. a or b
f.
c or d
ST0025804A
159
Lesson 3-2: Routing
Part C
1. Describe the components of a Nortel Networks routing table.
Part D
1. Explain one advantage and one disadvantage to static routing.
2. Describe the difference between a dynamic and a static routing table.
Scoring
Rubric: Suggested Evaluation Criteria and Weightings
Criteria
%
Part A: Describe the basic process of IP
routing.
25
Part B: Explain the process by which routers
forward packets.
25
Part C: Explain the components of a Nortel
Networks routing table.
25
Part D: Explain the difference between
dynamic and static routes.
25
TOTAL
100
Try It Out: Configure a static route.
100
Stretch Yourself
100
Network Wizards
100
FINAL TOTAL
400
160
ST0025804A
Your Score
Routing
Unit 3 : Let’s Route
Resources
Bay Networks. (1999). Accelerated Router Configuration, Bay Networks,
Inc., Billerica, Massachusetts.
ST0025804A
161
Download PDF