Вы находитесь на странице: 1из 100

Introduction to Routing

and Packet Forwardingg


Routing Protocols and Concepts Chapter 1
2007 Cisco Systems, Inc. All rights reserved. Cisco Public
ITE PC v4.0
Chapter 1 1
Objectives
Identify a router as a computer with an OS and de y a ou e as a co pu e a OS a d
hardware designed for the routing process.
Demonstrate the ability to configure devices and Demonstrate the ability to configure devices and
apply addresses.
Describe the structure of a routing table Describe the structure of a routing table.
Describe how a router determines a path and
switches packets switches packets
ITE PC v4.0
Chapter 1 2 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Router as a Computer
Describe the basic purpose of a router esc be e bas c pu pose o a ou e
-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 p p
including:
CPU
RAM
ROM
ITE PC v4.0
Chapter 1 3 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Operating System
Router as a Computer
Router components and their functions p
CPU - Executes operating system instructions
such as system initialization, routing functions, and switching functions.
Random access memory (RAM) RAMstores the instructions and data needed 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. g p
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 g y
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
h h LAN i f h E h i f 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.
ITE PC v4.0
Chapter 1 4 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
RAM is volatile memory and loses its content when the router is powered down or
restarted.
Router as a Computer
Router components and their functions ou e co po e s a d e u c o s
Read-only memory (ROM) - Holds diagnostic software used
when router is powered up. Stores the routers bootstrap
program. p g
ROM is a form of permanent storage.
Cisco devices use ROM to store:
The bootstrap instructions
Basic diagnostic software
Scaled-downversion of IOS 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
ITE PC v4.0
Chapter 1 5 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
or is restarted.
R t C t 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) 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.
NVRAMis usedby the Cisco IOS as permanent storage for the startupconfigurationfile 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 copiedto NVRAM where it is storedas the startup-configfile NVRAM retains its 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 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
ITE PC v4.0
Chapter 1 6 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
-Serial interfaces
-Management interfaces
Router as a Computer
Router components ou e co po e s
ITE PC v4.0
Chapter 1 7 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Internetwork Operating System
The operating system software used in Cisco routers is known as Cisco
Internetwork Operating System(IOS) 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, 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. 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
d li i t f (CLI) i h th d f 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 NVRAMis copied into RAMand 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 running-
config and are immediately implemented by the IOS
ITE PC v4.0
Chapter 1 8 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
config and are immediately implemented by the IOS.
Overview - Managing Cisco IOS Software (cont) Overview Managing Cisco IOS Software (cont)
ITE PC v4.0
Chapter 1 9 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Router as a Computer
Major phases to the ajo p ases o e
router boot-up process
Test router hardware
Power-On Self Test
(POST)
Execute bootstrap loader p
Locate & load Cisco IOS
software
Locate IOS -Locate IOS
-Load IOS
Locate & load startup
configuration file or enter
setup mode
-Bootstrap program looks
ITE PC v4.0
Chapter 1 10 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
p p g
for configuration file
Stages of the router power-on boot sequence
ITE PC v4.0
Chapter 1 11 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
R t C t Router as a Computer
Major phases to the router boot-up process
Step 1 and 2: Test router hardware
P O S lf T t (POST) 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 andLoadIOS -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 g ,
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.
ITE PC v4.0
Chapter 1 12 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
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.
R t C t 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 interface addresses
routing information
passwords
any other configurations y g
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 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 openingtftp://255.255.255.255/network-confg
ITE PC v4.0
Chapter 1 13 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
%Error opening tftp://255.255.255.255/network confg
(Timed out)
%Error opening tftp://255.255.255.255/cisconet.cfg
(Timed out)
Router as a Computer Router as a Computer
Locate & load startup configuration file or enter setup
mode
Enter Setup Mode (Optional). If the startup
configurationfile can not be located the router 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
complexrouter configurations andit is not 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 e te setup ode, a ays a s e o 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. default running config.
The default running-config is a basic
configuration file that includes the router
interfaces, management interfaces, and certain
default information.
Th d f lt i fi d t t i
ITE PC v4.0
Chapter 1 14 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
The default running-config does not contain any
interface addresses, routing information,
passwords, or other specific configuration
information.
Router as a Computer
Verify the router boot-up process:
show version
-The show version command is used
to view information about the router
during the bootup process.
Information includes: Information includes:
Image name & IOS version
IOS (tm) C2600 Software
(C2600 I M) V i 12 2(28) (C2600-I-M), Version 12.2(28),
RELEASE SOFTWARE (fc5).
Bootstrap version stored in ROM
O S ROM: System Bootstrap,
Version 12.1(3r)T2, RELEASE
SOFTWARE (fc1)
Image file name &where it was 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 15 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
flash:c2600 i mz.122 28.bin
Router as a Computer
Verify the router boot-up process:
show version
Platform model number
CPU
Amount of RAM Amount of RAM
Some series of routers, like the
2600, use a fraction of DRAM as
packet memory. Packet memory is
d f b ff i k t used for buffering packets.
To determine the total amount of
DRAM on the router, add both
numbers. In this example, the Cisco 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 y p
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 16 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Router as a Computer
Verify the router boot-up process:
show version
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 startup-config file.
Amount of flash
16384K bytes of processor board
Systemflash (Read/Write) 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 17 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Router as a Computer
Configuration register
show version
Configuration register is 0x2102
The last line of the show version
command displays the current
fi d l f th ft configured value of the software
configuration register in
hexadecimal. If there is a second
value displayed in parentheses, it
denotes the configuration register denotes the configuration register
value that will be used during the
next reload.
The configuration register has
l i l di d
g g
several uses, including password
recovery. The factory default setting
for the configuration register is
0x2102. This value indicates that
th t ill tt t t l d the router will attempt to load a
Cisco IOS software image from
flash memory and load the startup
configuration file from NVRAM.
ITE PC v4.0
Chapter 1 18 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Note: The configuration register is
discussed in more detail in a later
course.
C fi ti i t Configuration register
The order in which the router looks for system
bootstrap depends on the boot field settingin the
configuration register. g g
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. 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 19 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Configuration register (cont ) 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
di it 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 systemto boot automaticallyfromROM 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 configurationregister to 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 =ROMIOS
ITE PC v4.0
Chapter 1 20 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
1 ROM IOS
2 - 15 =Boot system from Flash
How a Cisco device locates and loads IOS
The config-register can be Downloaded from:
http:// lilligrencom/cisco/do nloadshtm
Demo
config-register
http://www.lilligren.com/cisco/downloads.htm
ITE PC v4.0
Chapter 1 21 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Configuration register: 0, 1, and 2 and above
ITE PC v4.0
Chapter 1 22 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Configuration register: 2102 and 2142 Configuration register: 2102 and 2142
ITE PC v4.0
Chapter 1 23 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Configuration register Configuration register
Rout er ( conf i g) #config-register value
1
2
3
ITE PC v4.0
Chapter 1 24 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Stages of the router power-on boot sequence Stages of the router power-on boot sequence
1. ROM
1. POST
2. Bootstrap code executed
1, 2
3. Check Configuration Register value (NVRAM)
0 =ROM Monitor mode
1 =ROM IOS
2 - 15 =Boot system from flash
3
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
4
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 modebypassed create a skeletondefault running config (no startup config)
ITE PC v4.0
Chapter 1 25 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
c. If setup-mode bypassed, create a skeleton default running-config (no startup-config)
How a Cisco device locates and loads IOS How a Cisco device locates and loads IOS
The router can use its own fallback
sequence to load the software. q
The router looks to the boot system
commands saved in NVRAM.
(Tony) The router has its own default
fallback sequence This default sequence fallback sequence. This default sequence
can be interrupted by using the boot
system command and/or config register.
The settings in the configuration register g g g
enable the following alternatives:
Global configuration mode boot system
commands can be specified to enter
fallback sources. fallback sources.
If NVRAM lacks boot system commands
the system by default uses the Cisco IOS
software in flash memory.
(T ) N b t t d (Tony) No boot system commands
(Tony) IOS specified in the boot
system does not exist
If flash memory is empty, the router then
ITE PC v4.0
Chapter 1 26 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
If flash memory is empty, the router then
attempts to use TFTP to load an IOS
image from the network.
How a Cisco device locates and loads IOS
ITE PC v4.0
Chapter 1 27 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
U i th b t t d Using the boot system command
The three examples show boot system
entries which specify that a Cisco IOS
ft i ill l d software image will load
First from flash memory,
Flash memory A system image from
flash memory can be loaded flash memory can be loaded.
Then from a network server, and
Network server In case flash
memory becomes corrupted, a system
i b l d d f TFTP image can be loaded from a TFTP
server.
Finally from ROM:
ROM If flash memory is corrupted 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 systemimage in ROMis 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
ITE PC v4.0
Chapter 1 28 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
the router may have an older version
stored in ROM.
The command copy running-config startup-config saves the commands in NVRAM.
How a Cisco device locates and loads IOS
What happenwhenbothconfig-register andboot What happen when both config-register and boot
system both exist in the startup-config?
Which one has the priority? p y
ITE PC v4.0
Chapter 1 29 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Management Ports
Routers have physical connectors that are
d t th t Th t used to manage the router. These connectors
are known as management ports.
Unlike Ethernet and serial interfaces,
management ports are not used for packet
f di forwarding.
The most common management port is the
console port.
The console port is used to connect a terminal 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 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. y p
At times the auxiliary port can be used in ways
similar to a console port. It can also be used to
attach a modem.
Auxiliaryports will not be used in this
ITE PC v4.0
Chapter 1 30 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Auxiliary ports will not be used in this
curriculum.
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 different IP network
Typically, the interfaces connect to various
types of networks, which means that different yp
types of media and connectors are required.
Types of router interfaces:
-Ethernet Ethernet
-Fastethernet
-Serial
-DSL
-ISDN
Cable
ITE PC v4.0
Chapter 1 31 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
-Cable
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 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 switch, a straight through cable is
used.
When two routers are connected
directly through the Ethernet
interfaces or when a PC NIC is 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 32 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
f f & Two major groups of Router Interfaces: LAN & WAN
WAN Interfaces- such as serial, ISDN, and
F R l 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 p g gy,
layer 2 address may be used.
Uses a layer 3 IP address
Similar to LAN interfaces each WAN 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 (High-
ITE PC v4.0
Chapter 1 33 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
, y, ( g
Level Data Link Control).
f f & Two major groups of Router Interfaces: LAN & WAN
The router in the figure has four
i t f 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.
S 0/0/0 C Serial 0/0/0 is using HDLC
Serial 0/0/1 is using PPP.
Both of these serial point-to-point 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
ITE PC v4.0
Chapter 1 34 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
frame.
Routers determine the best path
A router connects multiple networks. p
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 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 ro ter ses to for ard the packet ma be 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 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)
ITE PC v4.0
Chapter 1 35 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
-LAN connection
Routers determine the best path
Routers examine a packets destination IP address and ou e s e a e a pac e s des a o add ess a d
determine the best path by enlisting the aid of a routing
table
ITE PC v4.0
Chapter 1 36 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Routers determine the best path
The primary responsibility of a router is to direct packets destined for local
and remote networks by: 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 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 37 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Routers determine the best path
Routers Operate at Layers 1, 2 & 3 ou e s Ope a e a aye s , &3
A router makes its primary forwarding
decision at Layer 3, but as we saw earlier, it
participates in Layer 1 and Layer 2 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 examining destination IP address
Packet is then re-encapsulated & sent out
outbound interface
ITE PC v4.0
Chapter 1 38 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Routers determine the best path
PC1 operates at all seven layers, encapsulating the data and sending the frame out as a stream
of encodedbits to R1 its default gateway 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 39 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Configure Devices and Apply Addresses
Implementing Basic Addressing Schemes pe e g as c dd ess g Sc e es
When designing a new network or mapping an existing
network you must provide the following information in network you must provide the following information in
the form of a document:
-Topology drawing that Illustrates physical connectivity p gy g p y y
Address table that provides the following information:
Device name
Interfaces used
IP addresses
Default gateway
ITE PC v4.0
Chapter 1 40 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Configure Devices and Apply Addresses
ITE PC v4.0
Chapter 1 41 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
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 -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 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 42 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
-Save the changes on a router
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( fi )#li l 0 R1(config)#line console 0
R1(config-line)#password cisco
R1(config-line)#login
R1(config-line)#exit R1(config-line)#exit
R1(config)#line vty 0 4
R1(config-line)#password cisco
R1(config-line)#login
ITE PC v4.0
Chapter 1 43 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
( g ) g
R1(config-line)#exit
Configure Devices and Apply Addresses
brief reviewfromCCNA1
Configuring a Banner
From the global configuration mode, configure the
brief review from CCNA1
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
ITE PC v4.0
Chapter 1 44 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
banner that " welcomes" an unauthorized user.
Limiting Device Access Enable and Enable Secret Passwords Limiting Device Access Enable and Enable Secret Passwords
To provide additional security, use enable password
or enable secret command to establish
h i i b f i i il d EXEC authentication before accessing privileged EXEC
(enable) mode.
Always use the enable secret command, not the older
bl d d if ibl 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 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 Without an enable password having been set, a Telnet
session would appear this way:
Switch>enable
%No password set
ITE PC v4.0
Chapter 1 45 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
% No password set
Switch>
Limiting Device Access Enable and Enable Secret Passwords Limiting Device Access Enable and Enable Secret Passwords
Example of enable password and enable secret:
ITE PC v4.0
Chapter 1 46 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Limiting Device Access VTY Password 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
b d0 t 4 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 oftendesirable that a unique passwordbe set for 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: g p
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 47 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Encrypting Password Display Encrypting Password Display
Another useful command prevents passwords from
showing up as plain text when viewing the
fi i fil 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. yp yp p
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 p p p
individuals from viewing passwords in the configuration
file.
Once the encryption has been applied, removing the yp pp , g
encryption service does not reverse the encryption.
ITE PC v4.0
Chapter 1 48 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Configuring router passwords (cont ) 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.
ITE PC v4.0
Chapter 1 49 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
and !
Configuring router passwords (cont.) g g ( )
Doesnt work for enable secret!
ITE PC v4.0
Chapter 1 50 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Configure Devices and Apply Addresses
R1(config)#interface Serial0/0/0 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 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 This step is only necessary in a lab environment
ITE PC v4.0
Chapter 1 51 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Configure Devices and Apply Addresses
th F tEth t i t f d t b fi d the FastEthernet interface needs to be configured
R1(config)#interface FastEthernet0/0
R1( fi if)#i dd 192 168 1 1 255 255 255 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 R1(config-if)#no shutdown
ITE PC v4.0
Chapter 1 52 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Configure Devices and Apply Addresses
Each interface must belong to a different network.
Alth hth IOS ll t fi IP dd 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 t k? F tEth t 0/0h l d b 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)#ipaddress 192 168 1 2255 255 255 0 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 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#showipinterface brief
ITE PC v4.0
Chapter 1 53 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
R1#show ip interface brief
<output omitted>
FastEthernet0/1 192.168.1.2 YES manual administratively down down
Configure Devices and Apply Addresses
Verify Basic Router Configuration e y as c ou e Co gu a o
-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:
Showstartup-config- Displays configuration file NVRAM Show startup config Displays configuration file NVRAM
Show IP route - Displays routing table
Show interfaces - Displays all interface configurations p y g
Show IP int brief - Displays abbreviated interface
configuration information
ITE PC v4.0
Chapter 1 54 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Configure Devices and Apply Addresses
ITE PC v4.0
Chapter 1 55 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Configure Devices and Apply Addresses
ITE PC v4.0
Chapter 1 56 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
S 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 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 ramand contains information: Routing Table is stored in ram and contains information:
Directly connected networks - this occurs when a device is connected to
another router interface
R t l t d t k thi i t k th t i t di tl 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
i f ti t k dd & b t k d I dd f t h information, network address & subnet mask, and Ip address of next-hop
router
Show ip route command is used to view a routing table p g
ITE PC v4.0
Chapter 1 57 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
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 configuredwith an IP address andsubnet mask, the interface 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 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
t l St ti t t t t k th t t k d i i t t ll protocol. Static routes are routes to networks that a network administrator manually
configured.
ITE PC v4.0
Chapter 1 58 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Routing Table Structure
As shown in the figure the routing table is displayed with the show ip route
d At thi i t th h t b t ti t fi d 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: g , g
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 Thi i th t k dd d b t k f th di tl 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 y p
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 59 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Routing Table Structure
PCs also have a routing table. Cs aso a e a ou g abe
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 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 g p p
all IP configured devices should have a routing table.
ITE PC v4.0
Chapter 1 60 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Routing Table Structure
The following analogies may help clarify
the concept of connected static and the concept of connected, static, and
dynamic routes:
Directly Connected Routes - To visit a
neighbor, you only have to go down the
hi h l d li Thi
g y y g
street on which you already live. This
path is similar to a directly-connected
route because the "destination" is
available directly through your
" t d i t f " th t t "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. This path is similar to a static
route because the path to the
destination is always the same.
Dynamic Routes - When driving a car,
"d i ll " h 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 newpath at many different
ITE PC v4.0
Chapter 1 61 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
choose a new path at many different
points on your way to the destination.
Routing Table Structure 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 In order for static and dynamic routes to exist in routing
table you must have directly connected networks
ITE PC v4.0
Chapter 1 62 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Routing Table Structure
Remote networks are added to the
routing table either by configuring
static routes or enabling a dynamic
routing protocol. g p
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 63 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
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 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 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 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 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 64 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
central location.
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 p
routing table and denoted as a network learned by a specific dynamic routing
protocol.
Maintaining routing tables
Dynamic routingprotocols are usedto share routinginformationwith other router &to -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 65 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Routing Table Structure
R1 has learned about two remote R1 has learned about two remote
networks:
A route that dynamically used RIP
In the figure R1 has automatically In the figure, R1 has automatically
learned about the 192.168.4.0/24
network from R2 through the dynamic
routing protocol, RIP (Routing g p , ( g
Information Protocol).
A static route that was configured
manually.
This is an example of how routing
tables can contain routes learned
dynamically and configured dynamically and configured
statically and is not necessarily
representative of the best
fi ti f thi t k
ITE PC v4.0
Chapter 1 66 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
configuration for this network.
Routing Table Structure
IP routing protocols. Example of routing protocols include: g p p g p
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
d OSPF l l i d i d t il i CCNP l ith IS IS d BGP 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 67 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
protocols listed are standard, non proprietary protocols.
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 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 g g
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 does not provide routing information about the reverse, or
return, path.
ITE PC v4.0
Chapter 1 68 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Router Paths and Packet Switching
Internet Protocol (IP) packet format contains fields that e e o oco ( ) pac e o a co a s eds a
provide information about the packet and the sending
and receiving hosts
Fields that are importance for CCNA students:
-Version
L 3
-IP header length
-TTL
Layer 3
-Precedence & type of service
-Packet length
S -Source IP address
-Destination IP address
ITE PC v4.0
Chapter 1 69 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
The Layer 2 data link frame usually contains header information with a data link
source and destination address, trailer information, and the actual transmitted
d t
Router Paths and Packet Switching
data.
The data link source address is the Layer 2 address of the interface that sent the data link frame.
MAC Layer Frame Format
A k t i f d d f t t t th L 3 d d ti ti IP 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: y
-Preamble
Seven bytes of alternating 1s and 0s, used to synchronize signals
-Start of frame delimiter
1 b te signalingthe beginning of the frame
Layer 2
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
ITE PC v4.0
Chapter 1 70 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Data and pad
46 to 1500 bytes of data; zeros used to pad any data packet less than 46 bytes
-Frame check sequence
4 byte
Ethernet frame fields (cont.)
The original Ethernet standards defined the
i i f i 64 b t d th 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
10101011
A Start Frame Delimiter
g
Frame Check Sequence field.
The Preamble and Start Frame Delimiter fields
are not included when quoting the size of a
frame. z
10101011.
frame. z
The IEEE 802.3ac standard released in 1998
extended the maximum allowable frame size
to 1522-bytes to allow a "VLAN tag" to be
i t d i t th Eth t f f t inserted into the Ethernet frame format.
ITE PC v4.0
Chapter 1 71 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
http://www.techfest.com/networking/lan/ethernet2.htm
Peer to Peer Communication is really communication between the headers at
each layer.
Layers 2 and 3 are best effort or connectionless
ITE PC v4.0
Chapter 1 72 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Layers 2 and 3 are best effort or connectionless.
Layer 4 Transport is connection oriented. The connection is in the header.
ITE PC v4.0
Chapter 1 73 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
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 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 g p
on multiple metrics, combining them into a single
metric.
The smaller the value of the metric, the better the
path path.
Routing protocols, such as RIP, use simple hop-
count, 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
ITE PC v4.0
Chapter 1 74 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
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.
Router Paths and Packet Switching
A Metric is a numerical value used by routing protocols help determine the
best path to a destination 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 -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 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 75 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
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 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
t i d th t ill f l t l d b l i 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 76 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
C 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 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) (Fast Switching)
Rout er ( conf i g- i f ) # ip route-cache Rout er ( conf i g- i f ) #no ip route-cache
ping 10.0.0.1
ping 10.0.0.2
ping 10.0.0.1
ping 10.0.0.2
ITE PC v4.0
Chapter 1 77 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Load balancing with RIP Load balancing with RIP
debug ip packet
IP k t d b i i
per-packet load balancing
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
ITE PC v4.0
Chapter 1 78 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
( ), ( ), g , ,
http://www.cisco.com/en/US/products/ps5763/products_configuration_guide_chapter09186a00802a1fae.html#wp1045020
RIB:
Rout er ( conf i g- i f ) #no ip route-cache
Load balancing with RIP Load balancing with RIP
debug ip packet
IP k d b i i
per-destination load balancing
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
Rout er ( conf i g- i f ) # ip route-cache
ITE PC v4.0
Chapter 1 79 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
http://www.cisco.com/en/US/products/ps5763/products_configuration_guide_chapter09186a00802a1fae.html#wp1045020
RIB:
Router Paths: Un-Equal Cost Load Balancing
J ust in case you are wondering, a router can send packets over y g p
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 q g ( ) y
routing protocols that can be configured for unequal cost load
balancing.
Unequal cost load balancing in EIGRP is not discussed in this Unequal cost load balancing in EIGRP is not discussed in this
course but is covered in CCNP.
ITE PC v4.0
Chapter 1 80 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Unequal Cost Load Balancing with EIGRP
EIGRP Load Balancing
E ti t l t l t
What is unequal cost 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
variance2
ITE PC v4.0
Chapter 1 81 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
variance 2
http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a008009437d.shtml
Router Paths and Packet Switching
Packet forwarding involves two functions: g
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
f h b h for the best path
Directly connected network
The destination IP address of the packet is a host
dd th t k thi t ' address on the same network as this router's
interface
Remote network
If th d ti ti IP dd f th k t b l If the destination IP address of the packet belongs
to a remote network, then the packet is forwarded
to another router.
No route determined
ITE PC v4.0
Chapter 1 82 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
the packet is discarded
R t P th d P k t S it hi Router Paths and Packet Switching
Switching Function of Router is the process used by a router to switch
a packet froman incoming interface to an outgoing interface on the 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 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 83 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
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 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 verylikely that the packet will be encapsulatedin a different type of Layer 2 frame 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 y p
discards packet (prevents packets from endlessly traversing the network)
Demo
ITE PC v4.0
Chapter 1 84 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Router Paths and Packet Switching
Path determination and switching function details. PC1 a de e a o a d s c g u c o de a s C
Wants to send something to PC 2 here is part of what
happens
Step 1 - PC1 encapsulates packet into a frame. Frame
contains R1s destination MAC address Ethertypes
The 13th and 14th octets of an Ethernet
or IEEE802 3 packet (after the 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. ( ), p
ITE PC v4.0
Chapter 1 85 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
http://www.cavebear.com/archive/cav
ebear/Ethernet/type.html
Router Paths and Packet Switching Router Paths and Packet Switching
Step 2 - R1 receives Ethernet frame.
R1 sees that destination MAC address matches its own MAC.
R1 then strips off Ethernet frame.
R1 Examines destination IP.
R1 consults routing table looking for destination IP.
R1
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 86 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Router Paths and Packet Switching 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 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
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 nowlooks up next hop 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
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 87 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Router Paths and Packet Switching 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
f 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 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 p
Step 5 - IP packet arrives at PC2. Frame is decapsulated & processed by
upper layer protocols.
ITE PC v4.0
Chapter 1 88 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Packet propagation and switching within a router Packet propagation and switching within a router
1
ITE PC v4.0
Chapter 1 89 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
89
Packet propagation and switching within a router
2
ITE PC v4.0
Chapter 1 90 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
90
Packet propagation and switching within a router
3
44
ITE PC v4.0
Chapter 1 91 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
91
Packet propagation and switching within a router
4
ITE PC v4.0
Chapter 1 92 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
92
Packet propagation and switching within a router
5
ITE PC v4.0
Chapter 1 93 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
93
P k t ti d it hi ithi t Packet propagation and switching within a router
6
7
ITE PC v4.0
Chapter 1 94 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
94
P k i d i hi i hi Packet propagation and switching within a router
77
ITE PC v4.0
Chapter 1 95 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
95
Packet propagation and switching within a router
8
ITE PC v4.0
Chapter 1 96 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
96
P k t ti d it hi ithi t Packet propagation and switching within a router
9
ITE PC v4.0
Chapter 1 97 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
97
Summary 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 Software used to direct the routing process
IOS
Configuration file
Routers need to be configured. Basic configuration consists of:
-Router name
-Router banner 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
ITE PC v4.0
Chapter 1 98 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Remotely connected networks
-Network addresses and subnet masks
-IP address of next hop address
Summary
Routers determine a packets path to its destination by
doing the following
Receiving an encapsulated frame & examining destination
MAC address 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 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 99 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
ITE PC v4.0
Chapter 1 100 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Вам также может понравиться