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
Overview
•
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 diference between routing
and routed protocols and how routers track distance
between locations.
Layer 3 Devices
: 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.
Layer 3 Devices
: Layer 3
addresses
•
Bridges and switches use physical, or MAC
addresses, to make data forwarding decisions.
Layer 3 Devices
: Layer 3
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 foor 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.
Layer 3 Devices
: 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.
Layer 3 Devices
: Unique
network numbers
•
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 diferent interface. The IP
addresses of the devices on this
second network are B1, B2, B3, and
B4. The IP address of the router's
Layer 3 Devices
: Unique
network numbers
• 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:
– It strips of the data link header, carried by the frame. (The
data link header contains the MAC addresses of the source and destination.)
– It examines the network layer address to determine the destination network.
– 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
Layer 3 Devices
: Unique
network numbers
Layer 3 Devices :
Router
interface/port
•
A router’s attachment to a network is
called an interface; it may also be
referred to as a port.
Network-to-Network Communications :
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
.
Network-to-Network Communications :
Methods for assigning an IP address
Static Addressing
If you assign IP addresses statically, you must go to each individual device and confgure 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.
Network-to-Network Communications :
Methods for assigning an IP address
•
Dynamic
Addressing
There are a few diferent methods that you can use to
assign IP addresses dynamically. Examples of these
are:
•
Reverse Address Resolution Protocol (RARP)
Network-to-Network Communications :
Methods for assigning an IP address
• 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
Network-to-Network Communications :
Methods for assigning an IP address
•
RARP uses the same packet format as ARP. But in a
RARP request, the MAC headers, IP headers, and
"operation code" are diferent from an ARP request.
•
The RARP packet format contains places for MAC
addresses of both destination and source.
•
The source IP address feld 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
Network-to-Network Communications :
Methods for assigning an IP address
•
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
Network-to-Network Communications :
Methods for assigning an IP address
• If it fnds its own MAC address in the destination address
feld, 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-specifc feld.
• One of the problems with BOOTP is that it was not
designed to provide dynamic address assignment.
• With BOOTP you create a confguration fle that specifes
Network-to-Network Communications :
Methods for assigning an IP address
• Dynamic Host Confguration Protocol (DHCP)
Dynamic host confguration 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 defned 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 confguration can be