Introduction to Routing and Packet Forwarding

Download Report

Transcript Introduction to Routing and Packet Forwarding

Introduction to Routing
and Packet Forwarding
Routing Protocols and Concepts – Chapter 1
Modified by Tony Chen
1/25/2010
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
1
Notes:

If you see any mistake on my PowerPoint slides or if
you have any questions about the materials, please
feel free to email me at [email protected].
Thanks!
Tony Chen
College of DuPage
Cisco Networking Academy
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
2
Objectives

Identify a router as a computer with an OS and
hardware designed for the routing process.

Demonstrate the ability to configure devices and
apply addresses.

Describe the structure of a routing table.

Describe how a router determines a path and
switches packets
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
3
Router as a Computer
 Describe the basic purpose of a router
-Computers that specialize in sending packets over the data
network.
They are responsible for interconnecting networks by selecting
the best path for a packet to travel and forwarding packets to
their destination
 Routers have many of the same hardware and software
components that are found in other computers
including:
–CPU
–RAM
–ROM
–Operating System
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
4
Router as a Computer
 Router components and their functions”
CPU - Executes operating system instructions
 such as system initialization, routing functions, and switching functions.
Random access memory (RAM) -RAM stores the instructions and data needed
to be executed by the CPU. RAM is used to store these components:
–Operating System: The Cisco IOS (Internetwork Operating System) is copied
into RAM during bootup.
–Running Configuration File: This is the configuration file that stores the
configuration commands that the router IOS is currently using.
–IP Routing Table: This file stores information about directly connected and
remote networks. It is used to determine the best path to forward the packet.
–ARP Cache: This cache contains the IPv4 address to MAC address
mappings, similar to the ARP cache on a PC. The ARP cache is used on
routers that have LAN interfaces such as Ethernet interfaces.
–Packet Buffer: Packets are temporarily stored in a buffer when received on an
interface or before they exit an interface.
RAM is volatile memory and loses its content when the router is powered down or
restarted.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
5
Router as a Computer
 Router components and their functions”
Read-only memory (ROM) - Holds diagnostic software used
when router is powered up. Stores the router’s bootstrap
program.
–ROM is a form of permanent storage.
Cisco devices use ROM to store:
–The bootstrap instructions
–Basic diagnostic software
–Scaled-down version of IOS
ROM uses firmware, which is software that is embedded inside the
integrated circuit.
– Firmware includes the software that does not normally need to
be modified or upgraded, such as the bootup instructions.
– ROM does not lose its contents when the router loses power
or is restarted.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
6
Router as a Computer
 Router components and their functions”
Non-volatile RAM (NVRAM) - Stores startup configuration. This may include IP
addresses (Routing protocol, Hostname of router)
NVRAM (Nonvolatile RAM) does not lose its information when power is turned off. This is in
contrast to the most common forms of RAM, such as DRAM, that requires continual power to
maintain its information.
NVRAM is used by the Cisco IOS as permanent storage for the startup configuration file.
All configuration changes are stored in the running-config file in RAM, and with few
exceptions, are implemented immediately by the IOS.
To save those changes in case the router is restarted or loses power, the running-config
must be copied to NVRAM, where it is stored as the startup-config file. NVRAM retains its
contents even when the router reloads or is powered off.
Flash memory - Contains the operating system (Cisco IOS)
In most models of Cisco routers, the IOS is permanently stored in flash
memory and copied into RAM during the bootup process, where it is then
executed by the CPU.
Flash consists of SIMMs or PCMCIA cards, which can be upgraded to
increase the amount of flash memory.
Interfaces - There exist multiple physical interfaces that are used to connect network.
Examples of interface types:
-Ethernet / fast Ethernet interfaces
-Serial interfaces
-Management interfaces
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
7
Router as a Computer
 Router components
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
8
Internetwork Operating System
 The operating system software used in Cisco routers is known as Cisco
Internetwork Operating System (IOS).
– Cisco IOS is a multitasking operating system that is integrated with routing,
switching, internetworking, and telecommunications functions.
 Although the Cisco IOS may appear to be the same on many routers,
there are many different IOS images.
– An IOS image is a file that contains the entire IOS for that router. Cisco
creates many different types of IOS images, depending upon the model of
the router and the features within the IOS.
– Typically the more features in the IOS, the larger the IOS image, and
therefore, the more flash and RAM that is required to store and load the IOS.
 Although some routers provide a graphical user interface (GUI), the
command line interface (CLI) is a much more common method of
configuring Cisco routers.
– The CLI is used throughout this curriculum.
 Upon bootup, the startup-config file in NVRAM is copied into RAM and
stored as the running-config file.
– IOS executes the configuration commands in the running-config. Any
changes entered by the network administrator are stored in the runningconfig and are immediately implemented by the IOS.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
9
Overview - Managing Cisco IOS Software (cont)
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
10
Router as a Computer
 Major phases to the
router boot-up process
Test router hardware
Power-On Self Test
(POST)
Execute bootstrap loader
Locate & load Cisco IOS
software
-Locate IOS
-Load IOS
Locate & load startup
configuration file or enter
setup mode
-Bootstrap program looks
for configuration file
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
11
Stages of the router power-on boot sequence
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
12
Router as a Computer
 Major phases to the router boot-up process
ITE PC v4.0
Chapter 1
Step 1 and 2: Test router hardware
•Power-On Self Test (POST)
–During this self-test, the router executes
diagnostics from ROM on several hardware
components including the CPU, RAM, and
NVRAM
•Execute bootstrap loader
–The main task of the bootstrap program is
to locate the Cisco IOS and load it into
RAM.
–Note: At this point, if you have a console
connection to the router, you will begin to
see output on the screen.
Step 3 and 4: Locate & load Cisco IOS software
-Locate IOS and Load IOS
–The IOS is typically stored in flash
memory, but can also be stored in other
places such as a TFTP server.
–If a full IOS image can not be located, a
scaled-down version of the IOS is copied
from ROM into RAM. This version of IOS is
used to help diagnose any problems and
can be used to load a complete version of
the IOS into RAM.
–Note: A TFTP server is usually used as a
backup server for IOS but it can also be
used as a central point for storing and
loading the IOS.
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
13
Router as a Computer
Step 5 and 6: Locate & load startup configuration file or enter setup
mode
-After the IOS is loaded, the bootstrap program searches for
the startup configuration file, known as startup-config, in
NVRAM. This parameters including:
•interface addresses
•routing information
•passwords
•any other configurations
–If the startup-config, is located in NVRAM, it is copied into
RAM as the running-config.
•The IOS loads the commands in the file, one line at a
time.
–If the startup configuration file does not exist in NVRAM, the
router may search for a TFTP server.
• If the router detects that it has an active link to another
configured router, it sends a broadcast searching for a
configuration file across the active link. You will eventually
see message like the following one:
•%Error opening tftp://255.255.255.255/network-confg
(Timed out)
ITE PC v4.0
Chapter 1
•%Error opening tftp://255.255.255.255/cisconet.cfg
(Timed out)
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
14
Router as a Computer
 Locate & load startup configuration file or enter setup
mode
–Enter Setup Mode (Optional). If the startup
configuration file can not be located, the router
prompts the user to enter setup mode.
•Setup mode is a series of questions prompting
the user for basic configuration information.
Setup mode is not intended to be used to enter
complex router configurations, and it is not
commonly used by network administrators.
–When booting a router that does not contain a
startup configuration file, you will see the following
question after the IOS has been loaded:
•Would you like to enter the initial configuration
dialog? [yes/no]: no
–Setup mode will not be used in this course
to configure the router. When prompted to
enter setup mode, always answer no. If you
answer yes and enter setup mode, you can
press Ctrl-C at any time to terminate the
setup process.
–When setup mode is not used, the IOS creates a
default running-config.
•The default running-config is a basic
configuration file that includes the router
interfaces, management interfaces, and certain
default information.
•The default running-config does not contain any
interface addresses, routing information,
passwords, or other specific configuration
information.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
15
Router as a Computer
show version
 Verify the router boot-up process:
-The show version command is used
to view information about the router
during the bootup process.
Information includes:
Image name & IOS version
IOS (tm) C2600 Software
(C2600-I-M), Version 12.2(28),
RELEASE SOFTWARE (fc5).
Bootstrap version stored in ROM
ROM: System Bootstrap,
Version 12.1(3r)T2, RELEASE
SOFTWARE (fc1)
Image file name & where it was
loaded from
System image file is
"flash:c2600-i-mz.122-28.bin"
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
16
Router as a Computer
show version
 Verify the router boot-up process:
Platform model number
CPU
Amount of RAM
Some series of routers, like the
2600, use a fraction of DRAM as
packet memory. Packet memory is
used for buffering packets.
To determine the total amount of
DRAM on the router, add both
numbers. In this example, the Cisco
2621 router has 60,416 KB
(kilobytes) of free DRAM used for
temporarily storing the Cisco IOS
and other system processes. The
other 5,120 KB is dedicated for
packet memory. The sum of these
numbers is 65,536K, or 64
megabytes (MB) of total DRAM.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
17
Router as a Computer
show version
 Verify the router boot-up process:
Number & type of interfaces
2 FastEthernet/IEEE 802.3
interface(s)
2 Low-speed serial(sync/async)
network interface(s)
Amount of NVRAM
32K bytes of non-volatile
configuration memory.
NVRAM is used to store the
startup-config file.
Amount of flash
16384K bytes of processor board
System flash (Read/Write)
This is the amount of flash memory
on the router. Flash is used to
permanently store the Cisco IOS.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
18
Router as a Computer
show version
 Configuration register
 Configuration register is 0x2102
ITE PC v4.0
Chapter 1
–The last line of the show version
command displays the current
configured value of the software
configuration register in
hexadecimal. If there is a second
value displayed in parentheses, it
denotes the configuration register
value that will be used during the
next reload.
–The configuration register has
several uses, including password
recovery. The factory default setting
for the configuration register is
0x2102. This value indicates that
the router will attempt to load a
Cisco IOS software image from
flash memory and load the startup
configuration file from NVRAM.
–Note: The configuration register is
discussed in more detail in a later
course.
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
19
Configuration register
 The order in which the router looks for system
bootstrap depends on the boot field setting in the
configuration register.
The default configuration register setting can be
changed with the global configuration mode
command config-register.
Use a hexadecimal number as the argument for this
command.
 The configuration register is a 16-bit register in
NVRAM.
The lowest four bits of the configuration register form
the boot field.
To ensure that the upper 12 bits are not changed,
first retrieve the current values of the configuration
register using the show version command.
Then use the config-register command, changing
only the value of the last hexadecimal digit.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
20
Configuration register (cont.)
 To enter the ROM monitor mode, set the configuration
register value to 0xnnn0,
where nnn represents the previous value of the non-boot field
digits.
This value sets the boot field bits to 0000 binary.
From ROM monitor, boot the operating system manually by
using the b command at the ROM monitor prompt.
 To configure the system to boot automatically from ROM,
set the configuration register to 0xnnn1,
This value sets the boot field bits to 0001 binary.
 To configure the system to use the boot system
commands in NVRAM, set the configuration register to
any value from 0xnnn2 to 0xnnnF,
These values set the boot field bits to a value between 0010
and 1111 binary.
Using boot system commands in NVRAM is the default.
Check Configuration Register value (NVRAM)
0 = ROM Monitor mode
1 = ROM IOS
2 - 15 = Boot system from Flash
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
21
How a Cisco device locates and loads IOS
The config-register can be Downloaded from:
 Demo http://www.lilligren.com/cisco/downloads.htm
config-register
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
22
Configuration register: 0, 1, and 2 and above
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
23
Configuration register: 2102 and 2142
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
24
Configuration register
1
Router(config)#config-register value
2
3
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
25
Stages of the router power-on boot sequence
1.
ROM
1, 2
1. POST
2. Bootstrap code executed
3. Check Configuration Register value (NVRAM)
3
0 = ROM Monitor mode
1 = ROM IOS
2 - 15 = Boot system from flash
4
2. Check for IOS boot system commands in startup-config file (NVRAM)
If boot system commands in startup-config
a. Run boot system commands in order they appear in startup-config to locate the IOS
b If boot system commands fail, use default fallback sequence to locate the IOS (Flash, TFTP, ROM)
3. Locate and load IOS, Default fallback sequence: No IOS boot system commands in startup-config
a. Flash (sequential)
b. TFTP server (netboot) - The router uses the configuration register value to form a filename from which to boot a default system image stored
on a network server.
c. ROM (partial IOS) or keep retrying TFTP depending upon router model
- If no IOS located, get partial IOS version from ROM
4. Locate and load startup-config
a. If startup-config found, copy to running-config
b. If startup-config not found, prompt for setup-mode
c. If setup-mode bypassed, create a “skeleton” default running-config (no startup-config)
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
26
How a Cisco device locates and loads IOS
 The router can use its own fallback
sequence to load the software.
The router looks to the boot system
commands saved in NVRAM.
(Tony) The router has its own default
fallback sequence. This default sequence
can be interrupted by using the boot
system command and/or config register.
 The settings in the configuration register
enable the following alternatives:
Global configuration mode boot system
commands can be specified to enter
fallback sources.
If NVRAM lacks boot system commands
the system by default uses the Cisco IOS
software in flash memory.
(Tony) No boot system commands
(Tony) IOS specified in the boot
system does not exist
If flash memory is empty, the router then
attempts to use TFTP to load an IOS
image from the network.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
27
How a Cisco device locates and loads IOS
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
28
Using the boot system command
 The three examples show boot system
entries which specify that a Cisco IOS
software image will load
First from flash memory,
Flash memory – A system image from
flash memory can be loaded.
Then from a network server, and
Network server – In case flash
memory becomes corrupted, a system
image can be loaded from a TFTP
server.
Finally from ROM:
ROM – If flash memory is corrupted
and the network server fails to load the
image, booting from ROM is the final
bootstrap option in software.
However, the system image in ROM is
a subset of the Cisco IOS that lacks the
protocols, features of the full Cisco IOS.
Also, if the software has been updated,
the router may have an older version
stored
in ROM.
•The command
copy
running-config startup-config saves the commands in NVRAM.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
29
How a Cisco device locates and loads IOS
• What happen when both config-register and boot
system both exist in the startup-config?
• Which one has the priority?
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
30
Management Ports
 Routers have physical connectors that are
used to manage the router. These connectors
are known as management ports.
–Unlike Ethernet and serial interfaces,
management ports are not used for packet
forwarding.
 The most common management port is the
console port.
–The console port is used to connect a terminal,
or most often a PC running terminal emulator
software, to configure the router without the
need for network access to that router.
–The console port must be used during initial
configuration of the router.
 Another management port is the auxiliary port.
–Not all routers have auxiliary ports.
–At times the auxiliary port can be used in ways
similar to a console port. It can also be used to
attach a modem.
–Auxiliary ports will not be used in this
curriculum.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
31
Routers determine the best path
 Router Interface is a physical connector that
enables a router to send or receive packets
–Each interface connects to a separate network
•different IP network
 Typically, the interfaces connect to various
types of networks, which means that different
types of media and connectors are required.
Types of router interfaces:
-Ethernet
-Fastethernet
-Serial
-DSL
-ISDN
-Cable
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
32
Two major groups of Router Interfaces: LAN & WAN
 LAN Interfaces: such as Ethernet and
FastEthernet
Are used to connect router to LAN
network
Has a layer 2 MAC address
a router Ethernet interface
participates in the ARP process for
that LAN.
Can be assigned a Layer 3 IP address
Usually consist of an RJ-45 jack
When a router is connected to a
switch, a straight-through cable is
used.
When two routers are connected
directly through the Ethernet
interfaces, or when a PC NIC is
connected directly to a router
Ethernet interface, a crossover
cable is used.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
33
Two major groups of Router Interfaces: LAN & WAN
 WAN Interfaces- such as serial, ISDN, and
Frame Relay
Are used to connect routers to external
networks that interconnect LANs,
usually over a larger geographical
distance..
Depending on the WAN technology, a
layer 2 address may be used.
Uses a layer 3 IP address
Similar to LAN interfaces, each WAN
interface has its own IP address and
subnet mask, which identifies it as a
member of a specific network.
The Layer 2 encapsulation can be of
different types,
PPP, Frame Relay, and HDLC (HighLevel Data Link Control).
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
34
Two major groups of Router Interfaces: LAN & WAN
 The router in the figure has four
interfaces.
–Each interface has a Layer 3 IP address
and subnet mask that configures it for a
different network.
–The Ethernet interfaces also have Layer 2
Ethernet MAC addresses.
 The WAN interfaces are using different
Layer 2 encapsulations.
–Serial 0/0/0 is using HDLC
–Serial 0/0/1 is using PPP.
–Both of these serial point-to-point
protocols use a broadcast address for the
Layer 2 destination address when
encapsulating the IP packet into a data link
frame.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
35
Routers determine the best path
 A router connects multiple networks.
This means that it has multiple interfaces that each belong to a
different IP network.
When a router receives an IP packet on one interface, it
determines which interface to use to forward the packet onto its
destination.
The interface that the router uses to forward the packet may be
the network of the final destination of the packet (the network with
the destination IP address of this packet), or it may be a network
connected to another router that is used to reach the destination
network.
 Routers are the network center
-Routers generally have 2 connections:
-WAN connection (Connection to ISP)
-LAN connection
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
36
Routers determine the best path
 Routers examine a packet’s destination IP address and
determine the best path by enlisting the aid of a routing
table
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
37
Routers determine the best path
 The primary responsibility of a router is to direct packets destined for local
and remote networks by:
–Determining the best path to send packets
–Forwarding packets toward their destination
 The router uses its routing table to determine the best path to forward the
packet.
–When the router receives a packet, it examines its destination IP address and
searches for the best match with a network address in the router's routing table.
–The routing table also includes the interface to be used to forward the packet.
Once a match is found, the router encapsulates the IP packet into the data link
frame of the outgoing or exit interface, and the packet is then forwarded toward
its destination.
 It is very likely that a router will receive a packet that is encapsulated in
one type of data link frame, such as an Ethernet frame and when
forwarding the packet, the router will encapsulate it in a different type of
data link
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
38
Routers determine the best path
 Routers Operate at Layers 1, 2 & 3
–A router makes its primary forwarding
decision at Layer 3, but as we saw earlier, it
participates in Layer 1 and Layer 2
processes as well.
Router receives a stream of encoded bits
Bits are decoded and passed to layer 2
Router de-encapsulates the frame
Remaining packet passed up to layer 3
-Routing decision made at this layer by
examining destination IP address
Packet is then re-encapsulated & sent out
outbound interface
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
39
Routers determine the best path
 PC1 operates at all seven layers, encapsulating the data and sending the frame out as a stream
of encoded bits to R1, its default gateway.
 R1 receives the stream of encoded bits on its interface. The bits are decoded and passed up to
Layer 2, where R1 decapsulates the frame. The router examines the destination address of the
data link frame to determine if it matches the receiving interface, including a broadcast or
multicast address. If there is a match with the data portion of the frame, the IP packet is passed
up to Layer 3, where R1 makes its routing decision. R1 then re-encapsulates the packet into a
new Layer 2 data link frame and forwards it out the outbound interface as a stream of encoded
bits.
 R2 receives the stream of bits, and the process repeats itself. R2 decapsulates the frame and
passes the data portion of the frame, the IP packet, to Layer 3 where R2 makes its routing
decision. R2 then re-encapsulates the packet into a new Layer 2 data link frame and forwards it
out the outbound interface as a stream of encoded bits.
 This process is repeated once again by router R3, which forwards the IP packet, encapsulated
inside a data link frame and encoded as bits, to PC2.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
40
Configure Devices and Apply Addresses
 Implementing Basic Addressing Schemes
 When designing a new network or mapping an existing
network you must provide the following information in
the form of a document:
-Topology drawing that Illustrates physical connectivity
–Address table that provides the following information:
Device name
Interfaces used
IP addresses
Default gateway
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
41
Configure Devices and Apply Addresses
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
42
Configure Devices and Apply Addresses
 Basic Router Configuration
 A basic router configuration should contain the following:
-Router name - Host name should be unique
-Banner - At a minimum, banner should warn against unauthorized use
-Passwords - Use strong passwords
-Interface configurations –
•Specify interface type,
•IP address and subnet mask.
•Describe purpose of interface.
•Issue no shutdown command.
•If DCE serial interface issue clock rate command.
 After entering in the basic configuration the following tasks should be
completed
-Verify basic configuration and router operations.
-Save the changes on a router
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
43
Configure Devices and Apply Addresses
brief review from CCNA1
Router>
Router>enable
Router#
Router#config t
Router(config)#enable secret class
Router(config)#enable password cisco
Router(config)#hostname R1
R1(config)#
R1(config)#line console 0
R1(config-line)#password cisco
R1(config-line)#login
R1(config-line)#exit
R1(config)#line vty 0 4
R1(config-line)#password cisco
R1(config-line)#login
R1(config-line)#exit
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
44
Configure Devices and Apply Addresses
brief review from CCNA1
Configuring a Banner
From the global configuration mode, configure the
message-of-the-day (motd) banner. A delimiting
character, such as a "#" is used at the beginning and
at the end of the message. The delimiter allows you to
configure a multiline banner, as shown here.
R1(config)#banner motd #
Enter TEXT message. End with the character '#'.
******************************************
WARNING!! Unauthorized Access Prohibited!!
******************************************
#
Configuring an appropriate banner is part of a good
security plan. At a very minimum, a banner should
warn against unauthorized access. Never configure a
banner that "welcomes" an unauthorized user.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
45
Limiting Device Access – Enable and Enable Secret Passwords
 To provide additional security, use enable password
or enable secret command to establish
authentication before accessing privileged EXEC
(enable) mode.
Always use the enable secret command, not the older
enable password command, if possible.
 The following commands are used to set the
passwords:
Router(config)#enable password password
Router(config)#enable secret password
 If no enable password or enable secret password is
set, the IOS prevents privileged EXEC access from a
Telnet session.
Without an enable password having been set, a Telnet
session would appear this way:
Switch>enable
% No password set
Switch>
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
46
Limiting Device Access – Enable and Enable Secret Passwords
 Example of enable password and enable secret:
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
47
Limiting Device Access –Enable Secret Passwords
 Example of enable secret and the encryption
string
 On the same console section enter the
command “enable secret class” 3 times and
get the 3 different encrypted strings.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
48
Limiting Device Access – VTY Password
 The vty lines allow access to a router via Telnet.
By default, many Cisco devices support 5 VTY lines that are
numbered 0 to 4.
A password needs to be set for all available vty lines.
The same password can be set for all connections.
However, it is often desirable that a unique password be set for
one line to provide a fall-back for administrative entry to the
device if the other connections are in use.
 The following commands are used to set a password:
Router(config)#line vty 0 4
Router(config-line)#password password
Router(config-line)#login
 By default, the IOS includes the login command on the VTY
lines. This prevents Telnet access to the device without first
requiring authentication.
If, by mistake, the no login command is set, which removes the
requirement for authentication, unauthorized persons could
connect to the line using Telnet. This would be a major security
risk.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
49
Encrypting Password Display
 Another useful command prevents passwords from
showing up as plain text when viewing the
configuration files.
This is the service password-encryption command.
This command causes the encryption of passwords to
occur when a password is configured.
 The service password-encryption command applies
weak encryption to all unencrypted passwords.
This encryption does not apply to passwords as they are
sent over media only in the configuration.
The purpose of this command is to keep unauthorized
individuals from viewing passwords in the configuration
file.
 Once the encryption has been applied, removing the
encryption service does not reverse the encryption.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
50
Configuring router passwords (cont.)
WARNING
 service password-encryption uses a Cisco Level 7 encryption which is very
easy to decrypt.
 For the GetPass! software www.boson.com
 However, the enable secret <password> uses a stronger encryption method and
cannot be easily hacked.
and !
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
51
Configuring router passwords (cont.)
Doesn’t work for enable secret!
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
52
Configure Devices and Apply Addresses
R1(config)#interface Serial0/0/0
R1(config-if)#ip address 192.168.2.1 255.255.255.0
R1(config-if)#description Ciruit#VBN32696-123 (help desk:1-800-555-1234)
R1(config-if)#no shutdown
R1(config-if)#clock rate 64000
Note: When cabling a point-to-point serial link in our lab environment, one end of
the cable is marked DTE and the other end is marked DCE.
The router that has the DCE end of the cable connected to its serial interface will
need the additional clock rate command configured on that serial interface.
This step is only necessary in a lab environment
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
53
Configure Devices and Apply Addresses
 the FastEthernet interface needs to be configured
R1(config)#interface FastEthernet0/0
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#description R1 LAN
R1(config-if)#no shutdown
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
54
Configure Devices and Apply Addresses
 Each interface must belong to a different network.
–Although the IOS allows you to configure an IP address
from the same network on two different interfaces, the router
will not activate the second interface.
–For example, what if you attempt to configure the
FastEthernet 0/1 interface on R1 with an IP address on the
192.168.1.0/24 network? FastEthernet 0/0 has already been
assigned an address on that same network. you will get the
following message:
R1(config)#interface FastEthernet0/1
R1(config-if)#ip address 192.168.1.2 255.255.255.0
192.168.1.0 overlaps with FastEthernet0/0
–If there is an attempt to enable the interface with the no
shutdown command, the following message will appear:
R1(config-if)#no shutdown
192.168.1.0 overlaps with FastEthernet0/0
FastEthernet0/1: incorrect IP address assignment
 The output from the show ip interface brief command
shows that the second interface configured for the
192.168.1.0/24 network, FastEthernet 0/1, is still down.
 R1#show ip interface brief
<output omitted>
FastEthernet0/1 192.168.1.2 YES manual administratively down down
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
55
Configure Devices and Apply Addresses
 Verify Basic Router Configuration
-Issue the show running-config command
•displays the current running configuration that is stored in RAM.
-Issuing the copy running-config startup-config command
•Save the basic router configuration
-Additional commands that will enable you to further verify
router configuration are:
Show startup-config - Displays configuration file NVRAM
Show IP route - Displays routing table
Show interfaces - Displays all interface configurations
Show IP int brief - Displays abbreviated interface
configuration information
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
56
Configure Devices and Apply Addresses
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
57
Configure Devices and Apply Addresses
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
58
Routing Table Structure
 The primary function of a router is to forward a packet toward its
destination network, which is the destination IP address of the packet.
–To do this, a router needs to search the routing information stored in its routing table.
 Routing Table is stored in ram and contains information:
Directly connected networks - this occurs when a device is connected to
another router interface
Remotely connected networks - this is a network that is not directly
connected to a particular router
network/next hop associations - about the networks include source of
information, network address & subnet mask, and Ip address of next-hop
router
 Show ip route command is used to view a routing table
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
59
Routing Table Structure
 The network/exit-interface association can also represent the destination network
address of the IP packet.
This association occurs on the router's directly connected networks.
 A directly connected network is a network that is directly attached to one of the
router interfaces.
When a router interface is configured with an IP address and subnet mask, the interface
becomes a host on that attached network. The network address and subnet mask of the
interface, along with the interface type and number, are entered into the routing table as a
directly connected network. When a router forwards a packet to a host, such as a web
server, that host is on the same network as a router's directly connected network.
 A remote network is a network that is not directly connected to the router.
In other words, a remote network is a network that can only be reached by sending the
packet to another router. Remote networks are added to the routing table using either a
dynamic routing protocol or by configuring static routes. Dynamic routes are routes to
remote networks that were learned automatically by the router, using a dynamic routing
protocol. Static routes are routes to networks that a network administrator manually
configured.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
60
Routing Table Structure
 As shown in the figure the routing table is displayed with the show ip route
command. At this point, there have not been any static routes configured
nor any dynamic routing protocol enabled. Therefore, the routing table for
R1 only shows the router's directly connected networks. For each network
listed in the routing table, the following information is included:
–C - The information in this column denotes the source of the route information,
directly connected network, static route or a dynamic routing protocol. The C
represents a directly connected route.
–192.168.1.0/24 - This is the network address and subnet mask of the directly
connected or remote network. In this example, both entries in the routing table,
192.168.1./24 and 192.168.2.0/24, are directly connected networks.
–FastEthernet 0/0 - The information at the end of the route entry represents the
exit interface and/or the IP address of the next-hop router. In this example, both
FastEthernet 0/0 and Serial0/0/0 are the exit interfaces used to reach these
networks.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
61
Routing Table Structure
 PCs also have a routing table.
In the figure, you can see the route print command output. The
command reveals the configured or acquired default gateway,
connected, loopback, multicast, and broadcast networks.
The output from route print command will not be analyzed
during this course. It is shown here to emphasize the point that
all IP configured devices should have a routing table.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
62
Routing Table Structure
 The following analogies may help clarify
the concept of connected, static, and
dynamic routes:
 Directly Connected Routes - To visit a
neighbor, you only have to go down the
street on which you already live. This
path is similar to a directly-connected
route because the "destination" is
available directly through your
"connected interface," the street.
 Static Routes - A train uses the same
railroad tracks every time for a specified
route. This path is similar to a static
route because the path to the
destination is always the same.
 Dynamic Routes - When driving a car,
you can "dynamically" choose a
different path based on traffic, weather,
or other conditions. This path is similar
to a dynamic route because you can
choose a new path at many different
points on your way to the destination.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
63
Routing Table Structure
 Adding a connected network to the routing table
-Router interfaces
Each router interface is a member of a different network
Activated using the no shutdown command
In order for static and dynamic routes to exist in routing
table you must have directly connected networks
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
64
Routing Table Structure
 Remote networks are added to the
routing table either by configuring
static routes or enabling a dynamic
routing protocol.
 Static routes in the routing table
-Includes: network address and
subnet mask and IP address of next
hop router or exit interface
-Denoted with the code S in the
routing table
-Routing tables must contain directly
connected networks used to connect
remote networks before static or
dynamic routing can be used
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
65
Routing Table Structure
 When to use static routes
-When network only consists of a few
routers
•Using a dynamic routing protocol in such a
case does not present any substantial
benefit.
-Network is connected to internet only
through one ISP
• There is no need to use a dynamic routing
protocol across this link because the ISP
represents the only exit point to the Internet.
-Hub & spoke topology is used on a large
network
•A hub-and-spoke topology consists of a
central location (the hub) and multiple branch
locations (spokes), with each spoke having
only one connection to the hub.
•Using dynamic routing would be
unnecessary because each branch has only
one path to a given destination-through the
central location.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
66
Routing Table Structure
 Dynamic routing protocols
-Are used to add remote networks to a routing table
-Are used to discover networks
-Are used to update and maintain routing tables
 Automatic network discovery
–-Network discovery is the ability of a routing protocol to share information
about the networks that it knows about with other routers that are also using the
same routing protocol.
–Instead of configuring static routes to remote networks on every router, a
dynamic routing protocol allows the routers to automatically learn about these
networks from other routers.
–These networks - and the best path to each network - are added to the router's
routing table and denoted as a network learned by a specific dynamic routing
protocol.
 Maintaining routing tables
-Dynamic routing protocols are used to share routing information with other router & to
maintain and up date their own routing table.
–Dynamic routing protocols not only make a best path determination to various networks,
they will also determine a new best path if the initial path becomes unusable (or if the
topology changes)
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
67
Routing Table Structure
•R1 has learned about two remote
networks:
•A route that dynamically used RIP
•In the figure, R1 has automatically
learned about the 192.168.4.0/24
network from R2 through the dynamic
routing protocol, RIP (Routing
Information Protocol).
•A static route that was configured
manually.
•This is an example of how routing
tables can contain routes learned
dynamically and configured
statically and is not necessarily
representative of the best
configuration for this network.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
68
Routing Table Structure
 IP routing protocols. Example of routing protocols include:
–RIP (Routing Information Protocol) - - CCNA
–IGRP (Interior Gateway Routing Protocol) - - ignore it
–EIGRP (Enhanced Interior Gateway Routing Protocol) - - CCNA & NP
–OSPF (Open Shortest Path First) - - CCNA & CCNP
–IS-IS (Intermediate System-to-Intermediate System) - - CCNP
–BGP (Border Gateway Protocol) - - CCNP
RIP (versions 1 and 2), EIGRP, and OSPF are discussed in this course. EIGRP
and OSPF are also explained in more detail in CCNP, along with IS-IS and BGP.
IGRP is a legacy routing protocol and has been replaced by EIGRP. Both IGRP
and EIGRP are Cisco proprietary routing protocols, whereas all other routing
protocols listed are standard, non-proprietary protocols.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
69
Routing Table Structure
 Routing Table Principles
-3 principles regarding routing tables:
Every router makes its decisions alone, based on the
information it has in its routing table.
Different routing table may contain different information
 A routing table can tell how to get to a destination but not
how to get back (Asymmetric Routing)
Routing information about a path from one network to another
does not provide routing information about the reverse, or
return, path.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
70
Router Paths and Packet Switching
 Internet Protocol (IP) packet format contains fields that
provide information about the packet and the sending
and receiving hosts
 Fields that are importance for CCNA students:
-Version
Layer 3
-IP header length
-TTL
-Precedence & type of service
-Packet length
-Source IP address
-Destination IP address
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
71
Router Paths and Packet Switching
 The Layer 2 data link frame usually contains header information with a data link
source and destination address, trailer information, and the actual transmitted
data.
–The data link source address is the Layer 2 address of the interface that sent the data link frame.
 MAC Layer Frame Format
As a packet is forwarded from router to router, the Layer 3 source and destination IP
addresses will not change; however, the Layer 2 source and destination data link
addresses will change.
 MAC Frames are also divided into fields. They include:
-Preamble
Layer 2
•Seven bytes of alternating 1s and 0s, used to synchronize signals
-Start of frame delimiter
•1 byte signaling the beginning of the frame
-Destination MAC address
•6 byte
-Source MAC address
•6 byte
-Type/length
•2 byte
-Data and pad
•46 to 1500 bytes of data; zeros used to pad any data packet less than 46 bytes
-Frame check sequence
ITE PC v4.0
Chapter 1
•4 byte
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
72
Ethernet frame fields (cont.)
 The original Ethernet standards defined the
minimum frame size as 64-bytes and the
maximum as 1518-bytes.
These numbers include all bytes from the
Destination MAC Address field through the
Frame Check Sequence field.
The Preamble and Start Frame Delimiter fields
are not included when quoting the size of a
frame. z
A Start Frame Delimiter
10101011.
 The IEEE 802.3ac standard released in 1998
extended the maximum allowable frame size
to 1522-bytes to allow a "VLAN tag" to be
inserted into the Ethernet frame format.
http://www.techfest.com/networking/lan/ethernet2.htm
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
73
•
•
•
ITE PC v4.0
Chapter 1
Peer to Peer Communication is really communication between the headers at
each layer.
Layers 2 and 3 are best effort or connectionless.
Layer 4 Transport is connection oriented. The ‘connection’ is in the header.
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
74
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
75
Router Paths: Best Path
 Whenever multiple paths to reach the same network
exist, each path uses a different exit interface on
the router to reach that network.
– The best path is selected by a routing protocol based
on the value or metric it uses to determine the distance
to reach a network.
•Metrics can be based on either a single
characteristic or several characteristics of a path.
•Some routing protocols can base route selection
on multiple metrics, combining them into a single
metric.
•The smaller the value of the metric, the better the
path.
–Routing protocols, such as RIP, use simple hopcount, which the number of routers between a router
and the destination network.
• For example, a router will prefer a path that is 5
hops away over a path that is 10 hops away.
–Other routing protocols, such as OSPF, determine
the shortest path by examining the bandwidth of the
links, and using the links with the fastest bandwidth
from a router to the destination network.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
76
Router Paths and Packet Switching
 A Metric is a numerical value used by routing protocols help determine the
best path to a destination
–The smaller the metric value the better the path
 2 types of metrics used by routing protocols are:
-Hop count - this is the number of routers a packet must travel through to
get to its destination
• Hop count of four indicates that a packet must pass through four routers to
reach its destination.
• If multiple paths are available to a destination, the routing protocol, such as
RIP, picks the path with the least number of hops.
-Bandwidth - this is the “speed” of a link also known as the data capacity of
a link
•OSPF routing protocol uses bandwidth as its metric. The best path to a network
is determined by the path with an accumulation of links that have the highest
bandwidth values, or the fastest links.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
77
Router Paths: Equal Cost Load Balancing
 You may be wondering what happens if a routing table has
two or more paths with the same metric to the same
destination network.
–When a router has multiple paths to a destination network and the value of that
metric (hop count, bandwidth, etc.) is the same, this is known as an equal cost
metric, and the router will perform equal cost load balancing.
 Equal cost metric is a condition where a router has multiple paths
to the same destination that all have the same metric
–The router will forward packets using the multiple exit interfaces listed in the
routing table.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
78
Router Paths: Equal Cost Load Balancing
 To solve this dilemma, a router will use Equal Cost Load
Balancing. This means the router sends packets over the multiple
exit interfaces listed in the routing table.
–per-packet load balancing
•( Process Switching)
–per-destination load balancing.
•(Fast Switching)
Router(config-if)# ip route-cache
ping 10.0.0.2
ITE PC v4.0
Chapter 1
ping 10.0.0.1
Router(config-if)#no ip route-cache
ping 10.0.0.2
© 2007 Cisco Systems, Inc. All rights reserved.
ping 10.0.0.1
Cisco Public
79
Load balancing with RIP
per-packet
load balancing
debug ip packet
IP packet debugging is on
GAD#
*Mar 1 19:10:29.646: IP: tableid=0, s=192.168.14.2 (FastEthernet0/0), d=192.168.16.2 (Serial0/1), routed via RIB
*Mar 1 19:10:29.646: IP: s=192.168.14.2 (FastEthernet0/0), d=192.168.16.2 (Serial0/1), g=192.168.13.2, len 60, forward
*Mar 1 19:10:30.654: IP: tableid=0, s=192.168.14.2 (FastEthernet0/0), d=192.168.16.2 (Serial0/0), routed via RIB
*Mar 1 19:10:30.654: IP: s=192.168.14.2 (FastEthernet0/0), d=192.168.16.2 (Serial0/0), g=192.168.15.2, len 60, forward
*Mar 1 19:10:31.654: IP: tableid=0, s=192.168.14.2 (FastEthernet0/0), d=192.168.16.2 (Serial0/1), routed via RIB
*Mar 1 19:10:31.654: IP: s=192.168.14.2 (FastEthernet0/0), d=192.168.16.2 (Serial0/1), g=192.168.13.2, len 60, forward
*Mar 1 19:10:32.218: IP: s=0.0.0.0 (FastEthernet0/0), d=255.255.255.255, len 604, rcvd 2
*Mar 1 19:10:32.654: IP: tableid=0, s=192.168.14.2 (FastEthernet0/0), d=192.168.16.2 (Serial0/0), routed via RIB
*Mar 1 19:10:32.654: IP: s=192.168.14.2 (FastEthernet0/0), d=192.168.16.2 (Serial0/0), g=192.168.15.2, len 60, forward
*Mar 1 19:10:33.654: IP: tableid=0, s=192.168.14.2 (FastEthernet0/0), d=192.168.16.2 (Serial0/1), routed via RIB
*Mar 1 19:10:33.654: IP: s=192.168.14.2 (FastEthernet0/0), d=192.168.16.2 (Serial0/1), g=192.168.13.2, len 60, forward
*Mar 1 19:10:34.654: IP: tableid=0, s=192.168.14.2 (FastEthernet0/0), d=192.168.16.2 (Serial0/0), routed via RIB
*Mar 1 19:10:34.654: IP: s=192.168.14.2 (FastEthernet0/0), d=192.168.16.2 (Serial0/0), g=192.168.15.2, len 60, forward
*Mar 1 19:10:35.654: IP: tableid=0, s=192.168.14.2 (FastEthernet0/0), d=192.168.16.2 (Serial0/1), routed via RIB
*Mar 1 19:10:35.654: IP: s=192.168.14.2 (FastEthernet0/0), d=192.168.16.2 (Serial0/1), g=192.168.13.2, len 60, forward
*Mar 1 19:10:35.974: IP: s=192.168.13.1 (local), d=255.255.255.255 (Serial0/1), len 72, sending broad/multicast
*Mar 1 19:10:36.654: IP: tableid=0, s=192.168.14.2 (FastEthernet0/0), d=192.168.16.2 (Serial0/0), routed via RIB
*Mar 1 19:10:36.654: IP: s=192.168.14.2 (FastEthernet0/0), d=192.168.16.2 (Serial0/0), g=192.168.15.2, len 60, forward
RIB:
Router(config-if)#no ip route-cache
http://www.cisco.com/en/US/products/ps5763/products_configuration_guide_chapter09186a00802a1fae.html#wp1045020
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
80
Load balancing with RIP
per-destination load balancing
debug ip packet
IP packet debugging is on
GAD#
*Mar 1 19:14:36.006: IP: tableid=0, s=192.168.14.2 (FastEthernet0/0), d=192.168.16.2 (Serial0/0), routed via RIB
*Mar 1 19:14:36.006: IP: s=192.168.14.2 (FastEthernet0/0), d=192.168.16.2 (Serial0/0), g=192.168.15.2, len 60, forward
*Mar 1 19:14:36.026: IP: tableid=0, s=192.168.16.2 (Serial0/1), d=192.168.14.2 (FastEthernet0/0), routed via RIB
*Mar 1 19:14:36.026: IP: s=192.168.16.2 (Serial0/1), d=192.168.14.2 (FastEthernet0/0), g=192.168.14.2, len 60, forward
*Mar 1 19:14:37.978: IP: s=0.0.0.0 (FastEthernet0/0), d=255.255.255.255, len 604, rcvd 2
*Mar 1 19:14:44.122: IP: s=0.0.0.0 (FastEthernet0/0), d=255.255.255.255, len 604, rcvd 2
*Mar 1 19:14:46.562: IP: s=192.168.14.1 (local), d=255.255.255.255 (FastEthernet0/0), len 92, sending broad/multicast
*Mar 1 19:14:47.278: IP: s=192.168.15.1 (local), d=255.255.255.255 (Serial0/0), len 72, sending broad/multicast
*Mar 1 19:14:50.266: IP: s=0.0.0.0 (FastEthernet0/0), d=255.255.255.255, len 604, rcvd 2
*Mar 1 19:14:51.958: IP: s=192.168.13.2 (Serial0/1), d=255.255.255.255, len 72, rcvd 2
*Mar 1 19:14:51.962: IP: s=192.168.15.2 (Serial0/0), d=255.255.255.255
Router(config-if)# ip route-cache
RIB:
http://www.cisco.com/en/US/products/ps5763/products_configuration_guide_chapter09186a00802a1fae.html#wp1045020
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
81
Router Paths: Un-Equal Cost Load Balancing
 Just in case you are wondering, a router can send packets over
multiple networks even when the metric is not the same if it is
using a routing protocol that has this capability. This is known as
unequal cost load balancing. EIGRP (as well as IGRP) are the only
routing protocols that can be configured for unequal cost load
balancing.
 Unequal cost load balancing in EIGRP is not discussed in this
course but is covered in CCNP.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
82
 Unequal Cost Load Balancing with EIGRP
What is unequal cost load balancing?
 EIGRP Load Balancing
Every routing protocol supports equal cost
path load balancing.
In addition to that, IGRP and EIGRP also
support unequal cost path load balancing.
Use the variance command to instruct
the router to include routes with a metric
less than n times the minimum metric
route for that destination, where n is the
number specified by the variance
command.
Example: E-C-A: 20 * 2 = 40. Therefore,
E-C-A and E-B-A will be used for load
balancing.
router eigrp 1
network x.x.x.x
variance 2
http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a008009437d.shtml
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
83
Router Paths and Packet Switching
 Packet forwarding involves two functions:
–Path determination function
–Switching function
 Path determination is a process used by a router to
pick the best path to a destination
 One of 3 path determinations results from searching
for the best path
–Directly connected network
•The destination IP address of the packet is a host
address on the same network as this router's
interface
–Remote network
• If the destination IP address of the packet belongs
to a remote network, then the packet is forwarded
to another router.
–No route determined
•the packet is discarded
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
84
Router Paths and Packet Switching
 Switching Function of Router is the process used by a router to switch
a packet from an incoming interface to an outgoing interface on the
same router.
 What does a router do with a packet received from one network and
destined for another network?
-A packet received by a router will do the following:
Strips off layer 2 headers.
Examines destination IP address located in Layer 3 header to find
best route to destination.
Re-encapsulates layer 3 packet into layer 2 frame.
Forwards frame out exit interface.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
85
Router Paths and Packet Switching
 As a packet travels from one networking device to another
-The Source and Destination IP addresses NEVER change
-The Source & Destination MAC addresses CHANGE as packet is forwarded from
one router to the next.
•The Layer 2 data link source address represents the Layer 2 address of the outbound
interface. The Layer 2 destination address represents the Layer 2 address of the next-hop
router. If the next hop is the final destination device, it will be the Layer 2 address of that
device.
•It is very likely that the packet will be encapsulated in a different type of Layer 2 frame
than the one in which it was received. For example, the packet might be received by the
router on a FastEthernet interface, encapsulated in an Ethernet frame, and forwarded out
a serial interface encapsulated in a PPP frame.
-TTL field decrement by one until a value of zero is reached at which point router
discards packet (prevents packets from endlessly traversing the network)
•Demo
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
86
Router Paths and Packet Switching
 Path determination and switching function details. PC1
Wants to send something to PC 2 here is part of what
happens
Step 1 - PC1 encapsulates packet into a frame. Frame
contains R1’s destination MAC address
Ethertypes
The 13th and 14th octets of an Ethernet
or IEEE802.3 packet (after the
preamble) consist of the "Ethernet
Type" or "IEEE802.3 Length" field. The
"Ethernet Type" values are managed by
XEROX. Some assignments are public
(see + below), others private.
http://www.cavebear.com/archive/cav
ebear/Ethernet/type.html
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
87
Router Paths and Packet Switching
Step 2 - R1 receives Ethernet frame.
R1 sees that destination MAC address matches its own MAC.
R1
R1 then strips off Ethernet frame.
R1 Examines destination IP.
R1 consults routing table looking for destination IP.
After finding destination IP in routing table, R1 now looks up next hop IP address.
R1 re-encapsulates IP packet with a new Ethernet frame.
f the entry is not in the ARP cache, R1 sends an ARP request out its FastEthernet 0/1
interface. R2 sends back an ARP reply.
R1 forwards Ethernet packet out Fa0/1 interface.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
88
Router Paths and Packet Switching
 Path determination and switching function details. PC1 Wants to send something
to PC 2 here is part of what happens
Step 3 - Packet arrives at R2
R2 receives Ethernet frame
R2 sees that destination MAC address matches its own MAC
R2 then strips off Ethernet frame
R2 Examines destination IP
R2 consults routing table looking for destination IP
After finding destination IP in routing table, R2 now looks up next hop IP
address
R2 re-encapsulates IP packet with a new data link frame
R2 forwards Ethernet packet out S0/0 interface
R2
When the interface is a point-to-point serial connection, R2 encapsulates the IP packet into
the proper data link frame format used by the exit interface (HDLC, PPP, etc.). In this case,
the Layer 2 encapsulation is PPP; therefore, the data link destination address is set to a
broadcast. Remember, there are no MAC addresses on serial interfaces.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
89
Router Paths and Packet Switching
 PC1 Wants to send something to PC 2 here is part of what happens
Step 4 - Packet arrives at R3
R3 receives PPP frame
R3 then strips off PPP frame
R3 Examines destination IP
R3 consults routing table looking for destination IP
After finding destination IP in routing table, R3 is directly connected to
destination via its fast Ethernet interface
If the entry is not in the ARP cache, R3 sends an ARP request out its
FastEthernet 0/0 interface. PC2 sends back an ARP reply with its MAC address.
R3 re-encapsulates IP packet with a new Ethernet frame
R3 forwards Ethernet packet out Fa0/0 interface
Step 5 - IP packet arrives at PC2. Frame is decapsulated & processed by
upper layer protocols.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
90
Packet propagation and switching within a router
1
91
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
91
2
Packet propagation and switching within a router
92
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
92
3
Packet propagation and switching within a router
4
93
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
93
Packet propagation and switching within a router
4
94
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
94
5
Packet propagation and switching within a router
95
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
95
Packet propagation and switching within a router
6
7
96
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
96
Packet propagation and switching within a router
7
97
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
97
Packet propagation and switching within a router
8
98
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
98
Packet propagation and switching within a router
9
99
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
99
Summary
 Routers are computers that specialize in sending data over a network.
 Routers are composed of:
-Hardware i.e. CPU, Memory, System bus, Interfaces
-Software used to direct the routing process
IOS
Configuration file
 Routers need to be configured. Basic configuration consists of:
-Router name
-Router banner
-Password(s)
-Interface configurations i.e. IP address and subnet mask
 Routing tables contain the following information
-Directly connected networks
-Remotely connected networks
-Network addresses and subnet masks
-IP address of next hop address
100
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
Summary
 Routers determine a packets path to its destination by
doing the following
Receiving an encapsulated frame & examining destination
MAC address.
If the MAC address matches then Frame is de-encapsulated
so that router can examine the destination IP address.
If destination IP address is in routing table or there is a static
route then Router determines next hop IP address. Router will
re-encapsulate packet with appropriate layer 2 frame and send
it out to next destination.
Process continues until packet reaches destination.
Note - only the MAC addresses will change the source and
destination IP addresses do not change.
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
101
ITE PC v4.0
Chapter 1
© 2007 Cisco Systems, Inc. All rights reserved.
Cisco Public
102