Overview A router is a type of internetworking device that passes

advertisement
Overview
A router is a type of internetworking device that passes data packets between networks based
on Layer 3 addresses. A router has the ability to make intelligent decisions regarding the best
path for delivery of data on the network. In this chapter, you will learn how routers use a Layer
3 addressing scheme to make forwarding decisions.
In addition, you will learn how devices on local-area networks (LANs) use Address Resolution
Protocol (ARP) before forwarding data to a destination. You will learn what happens when a
device on one network does not know the MAC address of a device on another network. You
will learn that Reverse Address Resolution Protocol (RARP) is the protocol a device uses
when it does not know its own IP address. Lastly, you will learn the difference between routing
and routed protocols and how routers track distance between locations. You will also learn
about distance-vector, link-state, and hybrid routing approaches and how each resolves
common routing problems.
11.1 Layer 3 Devices
11.1.1 Routers
In networking, there are two addressing schemes: one uses the MAC address, a data link
(Layer 2) address; the other uses an address located at the network layer (Layer 3) of the OSI
model. An example of a Layer 3 address is an IP address. A router is a type of internetworking
device that passes data packets between networks, based on Layer 3 addresses. A router has
the ability to make intelligent decisions regarding the best path for delivery of data on the
network.
11.1.2 Layer 3 addresses
Bridges and switches use physical, or MAC addresses, to make data forwarding decisions.
Routers use a Layer 3 addressing scheme to make forwarding decisions.
They use IP, or
logical addresses, rather than MAC addresses. Because IP addresses are implemented in
software, and refer to the network on which a device is located, sometimes these Layer 3
addresses are referred to as protocol addresses, or network addresses.
Physical, or MAC addresses, are usually assigned by the NIC manufacturer and are
hard-coded into the NIC. The network administrator usually assigns IP addresses. In fact, it is
not unusual for a network administrator to group devices together in the IP addressing scheme,
according to their geographical location, department, or floor within a building. Because they
are implemented in software, IP addresses are fairly easy to change. Finally, bridges and
switches are primarily used to connect segments of a network. Routers are used to connect
separate networks and to access the worldwide Internet.
They do this by providing
end-to-end routing.
11.1.3 Unique network numbers
Routers connect two or more networks, each of which must have a unique network number in
order for routing to be successful. The unique network number is incorporated into the IP
address that is assigned to each device attached to that network.
Example:
A network has a unique network number - A. It has four devices attached to it. The IP
addresses of the devices are A2, A3, A4, and A5. Since the interface where the router
connects to a network is considered to be part of that network, the interface where the router
connects to network A has an IP address of A1.
Example:
Another network, with a unique network number - B - has four devices attached to it. This
network is also attached to the same router, but at a different interface. The IP addresses of
the devices on this second network are B2, B3, B4, and B5. The IP address of the router's
second interface is B1.
Example:
You want to send data from one network to another. The source network is A; the destination
network is B; and a router is connected to networks A, B, C, and D. When data (frames),
coming from network A, reaches the router, the router performs the following functions:
1. It strips off the data link header, carried by the frame. (The data link header contains
the MAC addresses of the source and destination.)
2. It examines the network layer address to determine the destination network.
3. It consults its routing tables to determine which of its interfaces it will use to send the
data, in order for it to reach its destination network.
In the example, the router determines that it should send the data from network A to network B,
from its interface, with address B1. Before actually sending the data out interface B1, the
router would encapsulate the data in the appropriate data link frame.
11.1.4 Router interface/port
A router’s attachment to a network is called an interface; it may also be referred to as a port. In
IP routing, each interface must have a separate, unique network (or subnetwork) address.
11.2 Network-to-Network Communications
11.2.1 Methods for assigning an IP address
After you have determined the addressing scheme for a network, you must choose the method
for assigning addresses to hosts.
There are essentially two methods for assigning IP
addresses - static addressing and dynamic addressing. Regardless of which addressing
scheme you use, no two interfaces can have the same IP address.
Static Addressing
If you assign IP addresses statically, you must go to each individual device and configure it
with an IP address. This method requires you to keep very meticulous records, because
problems can occur on the network if you use duplicate IP addresses. Some operating
systems, such as Windows 95 and Windows NT, send an ARP request to check for a duplicate
IP address when they attempt to initialize TCP/IP. If they discover a duplicate, the operating
systems will not initialize TCP/IP and will generate an error message. Record keeping is
important too, because not all operating systems identify duplicate IP addresses.
Dynamic Addressing
There are a few different methods that you can use to assign IP addresses dynamically.
Examples of these are:

Reverse Address Resolution Protocol (RARP)
Reverse address resolution protocol (RARP) binds MAC addresses to IP addresses.
This binding allows some network devices to encapsulate data before sending them
out on the network. A network device such as a diskless workstation might know its
MAC address, but not its IP address. Devices using RARP require that a RARP server
be present on the network to answer RARP requests.
Let's look at an example where a source device wants to send data to another
device. In our example the source knows its own MAC address, but is unable
to locate its own IP address in its ARP table. In order for the destination device
to retrieve the data, pass it to higher layers of the OSI model, and respond to
the originating device, the source must include both its MAC address and IP
address. Therefore, the source initiates a process called a RARP request,
which helps it detect its own IP address. The device builds a RARP request
packet and sends it out on the network. To ensure that all devices see the
RARP request on the network, it uses a broadcast IP address.
RARP uses the same packet format as ARP. But in a RARP request, the MAC
headers, IP headers, and "operation code" are different from an ARP request.
The RARP packet format contains places for MAC addresses of both
destination and source. The source IP address field is empty. The broadcast
goes to all devices on the network; therefore the destination IP address will be
set to all binary 1s. Workstations running RARP have codes in ROM that
direct them to start the RARP process, and locate the RARP server.

BOOTstrap Protocol (BOOTP)
A device uses BOOTstrap protocol (BOOTP) when it starts up, to obtain an IP address.
BOOTP uses UDP to carry messages; the UDP message is encapsulated in an IP
datagram. A computer uses BOOTP to send a broadcast IP datagram (using a
destination IP address of all 1s - 255.255.255.255). A BOOTP server receives the
broadcast and then sends a broadcast. The client receives a datagram and checks the
MAC address. If it finds its own MAC address in the destination address field, then it
takes the IP address in that datagram. Like RARP, BOOTP operates in a client-server
environment, and only requires a single packet exchange. However, unlike RARP,
which only sends back a 4 octet IP address, BOOTP datagrams can include the IP
address, the address of a router (default gateway), the address of a server, and a
vendor-specific field. One of the problems with BOOTP is that it was not designed to
provide dynamic address assignment. With BOOTP you create a configuration file that
specifies the parameters for each device.

Dynamic Host Configuration Protocol (DHCP)
Dynamic host configuration protocol (DHCP) has been proposed as a successor to
BOOTP. Unlike BOOTP, DHCP allows a host to obtain an IP address quickly and
dynamically. All that is required using DHCP is a defined range of IP addresses on a
DHCP server. As hosts come online they contact the DHCP server and request an
address. The DHCP server chooses an address and allocates it to that host. With
DHCP, the entire computer’s configuration can be obtained in one message (e.g.
along with the IP address, the server can also send a subnet mask).
11.2.2 DHCP initialization sequence
When a DHCP client boots, it enters an initialize state. It sends DHCPDISCOVER broadcast
messages, which are UDP packets with the port number set to the BOOTP port. After sending
the DHCPDISCOVER packets, the client moves into the select state and collects
DHCPOFFER responses from DHCP server. The client then selects the first response it
receives and negotiates lease time (the length of time it can keep the address without
renewing it) with the DHCP server by sending a DHCPREQUEST packet. The DHCP server
acknowledges a client request with a DHCPACK packet. The client can now enter the bound
state and begin using the address.
11.2.3 IP key components
In order for devices to communicate, the sending devices need both the IP addresses and the
MAC addresses of the destination devices. When they try to communicate with devices whose
IP addresses they know, they must determine the MAC addresses. The TCP/IP suite has a
protocol, called ARP, that can automatically obtain the MAC address. ARP enables a computer
to find the MAC address of the computer that is associated with an IP address.
Note: The basic unit of data transfer in IP is the IP packet. Packet processing occurs in
software, which means that content and format are not hardware dependent. A packet is
divided into two major components: the header, which includes source and destination
addresses; and the data. Other types of protocols have their own formats. The IP packet is
unique to IP.
Note: Another major component of IP is Internet Control Message Protocol (ICMP). This
protocol is used by a device to report a problem to the sender of a message. For example, if a
router receives a packet that it cannot deliver, it sends a message back to the sender of the
packet. One of the many features of ICMP is echo-request/echo-reply, which is a component
that tests whether a packet can reach a destination by pinging the destination.
11.2.4 Function of the address resolution protocol (ARP)
Layer 3 protocols determine whether data passes beyond the network layer to higher levels of
the OSI model. A data packet must contain both a destination MAC address and a destination
IP address.
If it lacks one or the other, the data will not pass from Layer 3 to the upper layers.
In this way, MAC addresses and IP addresses act as checks and balances for each other.
After devices determine the IP addresses of the destination devices, they can add the
destination MAC addresses to the data packets.
There are a variety of ways that devices can determine the MAC addresses they need to add
to the encapsulated data. Some keep tables that contain all the MAC addresses and IP
addresses of other devices that are connected to the same LAN. They are called Address
Resolution Protocol (ARP) tables, and they map IP addresses to the corresponding MAC
addresses. ARP tables are sections of RAM memory, in which the cached memory is
maintained automatically on each of the devices. It is a rare occasion when you must make an
ARP table entry manually. Each computer on a network maintains its own ARP table.
Whenever a network device wants to send data across a network, it uses information provided
by its ARP table.
When a source determines the IP address for a destination, the source consults its ARP table
in order to locate the MAC address for the destination. If the source locates an entry in its table
(destination IP address to destination MAC address), it binds, or associates, the IP address to
the MAC address and uses it to encapsulate the data. The data packet is then sent out over
the networking media to be picked up by the destination.
11.2.5 ARP operation within a subnet
If a host wants to send data to another host, it must know the destination IP address. If it is
unable to locate a MAC address for the destination in its own ARP table,
the host initiates a
process called an ARP request. An ARP request enables it to discover the destination MAC
address.
A host builds an ARP request packet and sends it to all devices on the network. To ensure that
all devices see the ARP request, the source uses a broadcast MAC address. The broadcast
address in a MAC addressing scheme has all places set to hexadecimal F. Thus, a MAC
broadcast address would have the form FF-FF-FF-FF-FF-FF.
Because ARP request packets travel in a broadcast mode, all devices on the local network
receive the packets and pass them up to the network layer for further examination. If the IP
address of a device matches the destination IP address in the ARP request, that device
responds by sending the source its MAC address. This is known as the ARP reply.
Example:
Source device 197.15.22.33 is asking for the MAC address of the destination with IP address
197.15.22.126,
Destination device 197.15.22.126 picks up the ARP request and responds
with an ARP reply containing its MAC address.
Once the originating device receives the ARP reply, it extracts the MAC address from the MAC
header, and updates its ARP table. The originating device can then properly address its data
with both a destination MAC address and a destination IP address. It uses this new information
to perform Layer 2 and Layer 3 encapsulations of the data before it sends them out over the
network.
When the data arrives at the destination, the data link layer makes a match, strips off the MAC
header, and transfers the data up to the network layer. The network layer examines the data
and finds that the IP address matches the destination IP address carried in the IP header. The
network layer strips off the IP header and transfers the encapsulated data to the next highest
layer in the OSI model, the transport layer (Layer 4). This process is repeated until the rest of
the packet's partially decapsulated data reaches the application, where the user data may be
read.
11.3 Advanced ARP Concepts
11.3.1 Default gateway
In order for a device to communicate with another device on another network, you must supply
it with a default gateway. A default gateway is the IP address of the interface on the router that
connects to the network segment on which the source host is located. The default gateway’s
IP address must be in the same network segment as the source host.
If no default gateway is defined, communication is possible only on the device’s own logical
network segment. The computer that sends the data does a comparison between the IP
address of the destination and its own ARP table. If it finds no match, it must have a default IP
address to use. Without a default gateway, the source computer has no destination MAC
address, and the message is undeliverable.
11.3.2 Problems with sending data to nodes on different subnets
One of the major problems in networking is how to communicate with devices that are not on
the same physical network segment. There are two parts to the problem. The first is obtaining
the MAC address of the destination host, and the second is transferring the data packets from
one network segment to another, to get to the destination host.
11.3.3 How ARP sends data to remote networks
ARP uses broadcast packets to accomplish its function. Routers, however, do not forward
broadcast packets. In order for a device to send data to the address of a device that is on
another network segment, the source device sends the data to a default gateway. The default
gateway is the IP address of the router interface that is connected to the same physical
network segment as the source host. The source host compares the destination IP address
and its own IP address to determine if the two IP addresses are located on the same segment.
If the receiving host is not on the same segment, the source host sends the data to the default
gateway.
11.3.4 Proxy ARP
Proxy ARP is a variation of the ARP protocol. In this case an intermediate device (e.g. router)
sends an ARP response, on behalf of an end node, to the requesting host. Routers running
proxy ARP capture ARP packets. They respond with their MAC addresses for those requests
in which the IP address is not in the range of addresses of the local subnet.
In the previous description of how data is sent to a host on a different subnet, the default
gateway is configured. If the source host does not have a default gateway configured, it sends
an ARP request. All hosts on the segment, including the router, receive the ARP request. The
router compares the IP destination address with the IP subnet address to determine if the
destination IP address is on the same subnet as the source host.
If the subnet address is the same, the router discards the packet. The reason that the packet is
discarded is that the destination IP address is on the same segment as the source's IP
address. This means another device on the segment should respond to the ARP request. The
exception to this is that the destination IP address is not currently assigned, which will
generate an error response on the source host.
If the subnet address is different, the router will respond with its own MAC address for the
interface that is directly connected to the segment on which the source host is located. This is
the proxy ARP. Since the MAC address is unavailable for the destination host, the router
supplies its MAC address in order to get the packet. Then the router can forward the ARP
request (based on the destination IP address) to the proper subnet for delivery.
11.3.5 Four Layer 3 flowcharts
Create flowcharts for the following processes:
1. ARP
2. RARP
3. BOOTP
4. DHCP
11.4 Routable Protocols
11.4.1 Routed protocols
IP is a network layer protocol, and because of that, it can be routed over an internetwork,
which is a network of networks. Protocols that provide support for the network layer are called
routed or routable protocols.
11.4.2 Other routed protocols
The focus of this course is on the most commonly used routable protocol, which is IP. Even
though you will concentrate on IP, it is important to know that there are other routable protocols.
Two of them are IPX/SPX and AppleTalk.
11.4.3 Routable and non-routable protocols
Protocols such as IP, IPX/SPX and AppleTalk provide Layer 3 support and are, therefore,
routable. However, there are protocols that do not support Layer 3; these are classed as
non-routable protocols. The most common of these non-routable protocols is NetBEUI.
NetBEUI is a small, fast, and efficient protocol that is limited to running on one segment.
11.4.4 Characteristics of a routable protocol
In order for a protocol to be routable, it must provide the ability to assign a network number, as
well as a host number, to each individual device. Some protocols, such as IPX, only require
that you assign a network number, because they use a host's MAC address for the physical
number. Other protocols, such as IP, require that you provide a complete address, as well as a
subnet mask. The network address is obtained by ANDing the address with the subnet mask.
11.5 Routing Protocols
11.5.1 Examples of routing protocols
Routing protocols (Note: Do not confuse with routed protocols.) determine the paths that
routed protocols follow to their destinations. Examples of routing protocols include the Routing
Information Protocol (RIP), the Interior Gateway Routing Protocol (IGRP), the Enhanced
Interior Gateway Routing Protocol (EIGRP), and Open Shortest Path First (OSPF).
Routing protocols enable routers that are connected to create a map, internally, of other
routers in the network or on the Internet. This allows routing (i.e. selecting the best path, and
switching) to occur. Such maps become part of each router's routing table.
11.5.2 Definition of routing protocol
Routers use routing protocols to exchange routing tables and to share routing information.
Within a network, the most common protocol used to transfer routing information between
routers, located on the same network, is Routing Information Protocol (RIP). This Interior
Gateway Protocol (IGP) calculates distances to a destination host in terms of how many hops
(i.e. how many routers) a packet must pass through. RIP enables routers to update their
routing tables at programmable intervals, usually every 30 seconds. One disadvantage of
routers that use RIP is that they are constantly connecting to neighboring routers to update
their routing tables, thus creating large amounts of network traffic.
RIP allows routers to determine which path to use to send data. It does so by using a concept
known as distance-vector. Whenever data goes through a router, and thus, through a new
network number, this is considered to be equal to one hop. A path which has a hop count of
four indicates that data traveling along that path would have to pass through four routers
before reaching the final destination on the network. If there are multiple paths to a destination,
the path with the least number of hops would be the path chosen by the router.
Because hop count is the only routing metric used by RIP, it doesn’t necessarily select the
fastest path to a destination. A metric is a measurement for making decisions. You will soon
learn that other routing protocols use many other metrics besides hop count to find the best
path for data to travel. Nevertheless, RIP remains very popular, and is still widely implemented.
This may be due primarily to the fact that it was one of the earliest routing protocols to be
developed.
One other problem posed by the use of RIP is that sometimes a destination may be located
too far away to be reachable. When using RIP, the maximum number of hops that data can be
forwarded through is fifteen. The destination network is considered unreachable if it is more
than fifteen router hops away.
11.5.3 Routing encapsulation sequence
At the data link layer, an IP datagram is encapsulated into a frame. The datagram, including
the IP header, is treated as data. A router receives the frame, strips off the frame header, then
checks the destination IP address in the IP header. The router then looks for that destination IP
address in its routing table, encapsulates the data in a data link layer frame, and sends it out to
the appropriate interface. If it does not find the destination IP address, it may drop the packet.
11.5.4 Multi-protocol routing
Routers are capable of concurrently supporting multiple independent routing protocols, and of
maintaining routing tables for several routed protocols. This capability allows a router to deliver
packets from several routed protocols over the same data links.
11.6 Other Network Layer Services
11.6.1 Connectionless network services
Most network services use a connectionless delivery system. They treat each packet
separately, and send it on its way through the network. The packets may take different paths to
get through the network, but are reassembled when they arrive at the destination. In a
connectionless system the destination is not contacted before a packet is sent. A good analogy
for a connectionless system is a postal system. The recipient is not contacted before a letter is
sent from one destination to another. The letter is sent on its way, and the recipient learns of
the letter when it arrives.
11.6.2 Connection-oriented network services
In connection-oriented systems, a connection is established between the sender and the
recipient before any data is transferred. An example of a connection-oriented network is the
telephone system. You place a call, a connection is established, and then communication
occurs.
11.6.3 Comparing connectionless and connection-oriented network processes
Connectionless network processes are often referred to as packet switched. In these
processes, as the packets pass from source to destination, they can switch to different paths,
as well as (possibly) arrive out of order. Devices make the path determination for each packet
based on a variety of criteria. Some of the criteria (e.g. available bandwidth) may differ from
packet to packet.
Connection-oriented network processes are often referred to as circuit switched. These
processes establish a connection with the recipient, first, and then begin the data transfer. All
packets travel sequentially across the same physical circuit, or more commonly, across the
same virtual circuit.
The Internet is one huge connectionless network in which all packet deliveries are handled by
IP. TCP (Layer 4) adds connection-oriented services on top of IP (Layer 3). TCP segments are
encapsulated into IP packets for transport across the Internet. TCP provides
connection-oriented session services to reliably deliver data.
11.6.4 IP and the transport layer
IP is a connectionless system; it treats each packet independently. For example, if you use an
FTP program to download a file, IP does not send the file in one long stream of data. It treats
each packet independently. Each packet can travel different paths. Some may even get lost. IP
relies on the transport layer protocol to determine whether packets have been lost, and to
request retransmission. The transport layer is also responsible for reordering the packets.
11.7 ARP Tables
11.7.1 Internetworking devices that have ARP tables
You have learned that the port, or interface, where a router connects to a network, is
considered part of that network; therefore, the router interface connected to the network has
an IP address for that network. Routers, just like every other device on the network, send and
receive data on the network, and build ARP tables that map IP addresses to MAC addresses.
11.7.2 Comparing router ARP tables with ARP tables kept by other networking devices
Routers can be connected to multiple networks, or subnetworks. Generally speaking, network
devices map the IP addresses and MAC addresses that they see on a regular and repeated
basis. This means that a typical device contains mapping information pertaining only to
devices on its own network. It knows very little about devices beyond its LAN.
Routers build tables that describe all networks connected to them. ARP tables kept by routers
can contain IP addresses and MAC addresses of devices located on more than one network.
In addition to mapping IP addresses to MAC addresses, router tables also map ports.
Can
you think of a reason why routers would need to do this? (Note: Examine the router's ARP
table below.)
Destination Network
Router Port
201.100.100.0
201.100.100.1
201.100.101.0
201.100.101.1
201.100.120.0
201.100.120.1
201.100.150.0
201.100.150.1
11.7.3 Other router table addresses
What happens if a data packet reaches a router that is destined for a network to which it is not
connected? In addition to IP addresses and MAC addresses of devices located on networks to
which it connects, a router also possesses IP addresses and MAC addresses of other routers.
It uses these addresses to direct data toward its final destination. If a router receives a packet
whose destination address is not in its routing table, it forwards it to the address of another
router that most likely does contain information about the destination host in its routing table.
11.7.4 ARP requests and ARP replies
ARP is used only on a local network. What would happen if a local router wanted to ask a
non-local router to provide indirect routing (next-hop) services, but did not know the MAC
address of the non-local router?
When a router does not know the MAC address of the next-hop router, the source router
(router that has the data to be sent on) issues an ARP request. A router that is connected to
the same segment as the source router receives the ARP request. This router issues an ARP
reply to the router that originated the ARP request. The reply contains the MAC address of the
non-local router.
11.7.5 Proxy ARP
A device on one network cannot send an ARP request to a device on another network. Can
you think of a reason why this is so?
What happens in the case of subnetworks? Can a device on one subnetwork find the MAC
address of a device on another subnetwork? The answer is yes, provided the source directs its
question to the router. Working through a third party is called proxy ARP, and it allows the
router to act as a default gateway.
11.7.6 Indirect routing
Sometimes a source resides on a network that has a different network number than the
desired destination. If the source doesn't know the MAC address of the destination it must use
the services of a router. With the router's aid, the source's data can reach its destination. A
router that is used for this purpose is called a default gateway.
To obtain the services of a default gateway, a source encapsulates the data so that it contains
the destination MAC address of the router. A source uses the destination IP address of the
host device, and not that of a router, in the IP header, because it wants the data delivered to
the host device and not to a router.
When a router picks up data, it strips off the data link layer information that is used in the
encapsulation. It then passes the data up to the network layer where the router examines the
destination IP address. It compares the destination IP address with information contained in its
routing tables. If the router locates the mapped destination IP address and the MAC address,
and learns that the location of the destination network is attached to one of its ports, it
encapsulates the data with the new MAC address information, and forwards it to the correct
destination. If the router cannot locate the mapped destination address and MAC address of
the device of the final target device, it locates the MAC address of another router that can
perform this function, and forwards the data to that router. This type of routing is referred to as
indirect routing.
11.8 Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP)
11.8.1 Routed protocols and routing protocols
You have learned that protocols are like languages. One protocol that you have been learning
about is IP, or the Internet Protocol. You know that IP is a network layer protocol. Because IP
is routed over an internetwork, it is called a routed protocol. Examples of other types of routed
protocols include Novell's IPX, and Appletalk.
-
Routers use routing protocols to exchange routing tables and share routing information. In
other words, routing protocols determine how routed protocols are routed. Examples of routing
protocols include the following:

RIP - Routing Information Protocol

IGRP - Interior Gateway Routing Protocol

EIGRP - Enhanced Interior Gateway Routing Protocol

OSPF - Open Shortest Path First
11.8.2 IGPs and EGPs
Two types of routing protocols are the Exterior Gateway Protocols (EGPs) and the Interior
Gateway Protocols (IGPs). Exterior Gateway Protocols route data between autonomous
systems. An example of an EGP is BGP (Border Gateway Protocol), the primary exterior
routing protocol of the Internet.
Can you think of an example where an Exterior Gateway Protocol would be used?
Interior Gateway Protocols route data in an autonomous system. Examples of IGPs are:

RIP

IGRP

EIGRP

OSPF
Can you think of an example where an Interior Gateway Protocol would be used?
11.8.3 RIP
The most common method to transfer routing information between routers that are located on
the same network is RIP. This Interior Gateway Protocol calculates distances to a destination.
RIP allows routers that use this protocol to update their routing tables at programmable
intervals, typically every thirty seconds. However, because it is constantly connecting
neighboring routers, this can cause network traffic to build.
RIP allows the router to determine which path it will use to send data, based on a concept
known as distance-vector. Whenever data travels on a router, and thus through a new network
number, it is considered to have traveled one hop. A path that has a hop count of four indicates
that data traveling along that path must have passed through four routers before reaching its
final destination on the network.
If there are multiple paths to a destination, the router, using RIP, selects the path with the least
number of hops. However, because hop count is the only routing metric used by RIP in
determining best path, it is not necessarily the fastest path. Nevertheless, RIP remains very
popular, and is widely implemented. This is primarily because it was one of the earliest routing
protocols to be developed.
Another problem with using RIP is that a destination may be located too far away for the data
to reach it. With RIP, the maximum number of hops that data can travel is fifteen. Because of
this, if the destination network is more than fifteen routers away, it is considered unreachable.
11.8.4 IGRP and EIGRP
IGRP and EIGRP are routing protocols that were developed by Cisco Systems, Inc., therefore,
they are considered proprietary routing protocols.
IGRP was developed specifically to address problems associated with routing in large
multi-vendor networks that were beyond the scope of protocols such as RIP. Like RIP, IGRP is
a distance-vector protocol; however, when determining the best path, it also takes into
consideration such things as bandwidth, load, delay, and reliability. Network administrators
can determine the importance given to any one of these metrics, or, allow IGRP to
automatically calculate the optimal path.
EIGRP is an advanced version of IGRP. Specifically, EIGRP provides superior operating
efficiency and combines the advantages of link-state protocols with those of distance-vector
protocols.
11.8.5 OSPF
OSPF means "open shortest path first". A better description, however, might be "determination
of optimum path", because this Interior Gateway Protocol actually uses several criteria to
determine the best route to a destination. These criteria include cost metrics, which factor in
such things as route speed, traffic, reliability, and security.
11.8.6 How routers recognize networks
So how does route information get into a routing table in the first place? The network
administrator can manually enter the information in the router. Routers can learn the
information from each other on the fly. Manual entries in routing tables are called "static routes".
Routes learned automatically are called "dynamic routes".
11.8.7 Examples of static routing
If routers can learn routing information automatically, it might seem pointless to manually enter
information into a router's routing table. However, such manual entries can be useful whenever
a network administrator wants to control which path a router will select. For example, routing
tables that are based on static information could be used to test a particular link in the network,
or to conserve wide area bandwidth. Static routing is also the preferred method for maintaining
routing tables when there is only one path to a destination network. This type of network is
referred to as a stub network. There is only one way to get to this network, so it is important to
indicate this situation to prevent routers from trying to find another way to this stub network if
its connection fails.
11.8.8 Example of dynamic routing
Adaptive, or dynamic, routing occurs when routers send periodic routing update messages to
each other. Each time a router receives a message containing new information, it recalculates
the new best route, and sends the new updated information to other routers. By using dynamic
routing, routers can adjust to changing network conditions.
Before the advent of dynamic updating of routing tables, most vendors had to maintain router
tables for their clients. This meant that vendors had to manually enter network numbers, their
associated distances, and port numbers into the router tables of all the equipment they sold or
leased. As networks grew larger, this became an increasingly cumbersome, time-consuming,
and expensive task. Dynamic routing eliminates the need for network administrators or
vendors to manually enter information into routing tables. It works best when bandwidth and
large amounts of network traffic are not issues. RIP, IGRP, EIGRP, and OSPF are all
examples of dynamic routing protocols because they allow this process to occur. Without
dynamic routing protocols, the Internet would be impossible.
11.8.9 How routers use RIP to route data through a network
You have a Class B network that is divided into eight subnetworks that are connected by three
routers. Host A has data it wants to send to host Z. It passes the data down through the OSI
model, from the application layer to the data link layer, where host A encapsulates the data
with information provided by each layer. When the data reaches the network layer, source A
uses its own IP address and the destination IP address of host Z, because that is where it
wants to send the data. Then, host A passes the data to the data link layer.
At the data link layer, source A places the destination MAC address of the router, to which it is
connected, and its own MAC address in the MAC header. Source A does this because it sees
subnetwork 8 as a separate network. It knows that it cannot send data directly to a different
network, but must pass such data through a default gateway. In this example, the default
gateway for source A is router 1.
The data packet travels along subnetwork 1. The hosts do not copy the frame because the
destination MAC address in the MAC header will not match their own. The data packet
continues along subnetwork 1 until it reaches router 1. Like the other devices on subnetwork 1,
router 1 sees the data packet, and picks it up, because it recognizes that its own MAC address
is the same as the destination MAC address.
Router 1 strips off the MAC header of the data and passes the data up to the network layer
where it looks at the destination IP address in the IP header. The router then searches its
routing tables in order to map a route for the network address of the destination, to the MAC
address of the router that is connected to subnetwork 8. The router is using RIP as its routing
protocol, therefore, it determines that the best path for the data is one that places the
destination only three hops away. Then, the router determines that it must send the data
packet through the port attached to subnetwork 4, in order for the data packet to reach its
destination via the selected path. The router passes the data down to the data link layer, where
it places a new MAC header on the data packet. The new MAC header contains the
destination MAC address of router 2, and the MAC address of the first router that became the
new source. The IP header remains unchanged. The first router passes the data packet
through the port that it selects, and on to subnetwork 4.
The data passes along subnetwork 4. The hosts do not copy the frame because the
destination MAC address in the MAC header will not match their own. The data packet
continues along subnetwork 4 until it reaches router 2. Like the other devices on subnetwork 4,
the router 2 sees the data packet. This time it picks it up because it recognizes that its own
MAC address is the same as the destination MAC address.
At the data link layer, the router strips off the MAC header and passes the data up to the
network layer. There, it examines the destination network IP address and looks in its routing
table. The router, using RIP as its routing protocol, determines that the best path for the data is
one that places the destination only two hops away. Then, the router determines that it must
send the data packet through the port attached to subnetwork 5, in order for the data packet to
reach its destination via the selected path. The router passes the data down to the data link
layer where it places a new MAC header on the data packet. The new MAC header contains
the destination MAC address of router 2, and the MAC address of the first router becomes the
new source MAC. The IP header remains unchanged. The first router passes the data packet
through the port that it selects and on to subnetwork 5.
The data passes along subnetwork 5. The data packet continues along subnetwork 5 until it
reaches router 3. Like the other devices on subnetwork 5, router 3 sees the data packet. This
time it picks it up because it recognizes that its own MAC address is the same as the
destination MAC address.
At the data link layer, the router strips off the MAC header and passes it up to the network
layer. There, it sees that the destination IP address in the IP header matches that of a host that
is located on one of the subnetworks to which it is attached. Then, the router determines that it
must send the data packet through the port attached to subnetwork 8, in order for the data
packet to reach its destination address. It places a new MAC header on the data. This time,
the new MAC header contains the destination MAC address of host Z, and the source MAC
address of router 3. As before, the IP header remains unchanged. Router 3 sends the data
through the port that is attached to subnetwork 8.
The data packet travels along subnetwork 8. The hosts do not copy the frame because the
destination MAC address in the MAC header will not match their own. Finally, it reaches host Z,
which picks it up because it sees that its MAC address matches the destination MAC address
carried in the MAC header of the data packet. Host Z strips off the MAC header and passes
the data to the network layer. At the network layer, host Z sees that its IP address, and the
destination IP address carried in the IP header, match. Host Z strips off the IP header and
passes the data up to the transport layer of the OSI model. Host Z continues to strip off the
layers that encapsulate the data packet and then passes the data to the next layer of the OSI
model. This continues until the data finally arrives at the application layer of the OSI model.
11.9 Protocol Analyzer Software
11.9.1 Using protocol analyzer software for ARPs and broadcasts
Lab Activity
In this lab, you will use Protocol Inspector (or its equivalent) software to view the many
mini-conversations that occur on a network, including ARPs and broadcasts.
Summary
In this chapter, you learned that:

internetworking functions of the network layer include network addressing and best
path selection for traffic

all devices on the LAN are required to look at an ARP request, but only the device
whose IP address matches the destination IP address carried in the ARP request must
respond by providing its MAC address to the device that originated the request

when a source is unable to locate the destination MAC address in its ARP table, it
issues an ARP request in broadcast mode to all devices on the local network

when a device does not know its own IP address, it uses RARP or BootP

when the device that originated a RARP request receives a RARP reply, it copies its IP
address into its memory cache, where it will reside for as long as the session lasts.

routers, like every other device on the network, send and receive data on the network,
and build ARP tables that map IP addresses to MAC addresses

if the source resides on a network that has a different network number than the
desired destination, and if the source does not know the MAC address of the
destination, it will have to use the router as a default gateway for its data to reach the
destination

routed protocols direct user traffic, whereas routing protocols work between routers to
maintain path tables

network discovery for distance-vector routing involves exchange of routing tables
The next chapter discusses the functions of the transport layer.
Download