Introduction To Routing and Packet Forwarding
Introduction To Routing and Packet Forwarding
Introduction to Routing
and Packet Forwarding
CCNA2-1 Chapter 1
Note for Instructors
CCNA2-2 Chapter 1
Introduction to Routing and Packet Forwarding
2811 Router
CCNA2-3 Chapter 1
Routers are Computers
? ?
CCNA2-6 Chapter 1
Routers Determine the Best Path
L2 IP TCP DATA L2
CCNA2-8 Chapter 1
Routers Determine the Best Path
Data for Host
192.168.3.22 / 24
L2 IP
IP TCP DATA L2
L2 IP
IP TCP DATA L2
CCNA2-11 Chapter 1
Router CPU and Memory
CCNA2-13 Chapter 1
Router CPU and Memory
CCNA2-14 Chapter 1
Router CPU and Memory
CCNA2-15 Chapter 1
Internetwork Operating System (IOS)
• Responsible for
managing the
hardware and software
resources of the router.
• Allocating memory.
• Managing the file
system and
processes.
• Security.
• There are many different IOS images.
• An IOS image is a file residing on flash that contains the
entire IOS for that router.
• The image itself will vary depending on the model and the
features within the IOS.
CCNA2-16 Chapter 1
Router Bootup Process
CCNA2-17 Chapter 1
Router Bootup Process
CCNA2-18 Chapter 1
Router Bootup Process
CCNA2-19 Chapter 1
Router Bootup Process
CCNA2-21 Chapter 1
Router Bootup Process (FYI)
6. Execute the
Configuration File
or enter “Setup”
mode.
• Step 6: Loading the Startup Configuration
or Entering Setup Mode.
• If a startup configuration file is found in NVRAM, the
IOS loads it into RAM as the running-config file and
executes the commands.
• If the startup configuration file cannot be located, the
IOS prompts the user to enter setup mode.
• If setup mode not used, a default running-config file is
created and input accepted from the console.
CCNA2-23 Chapter 1
Router Bootup Process
CCNA2-25 Chapter 1
Router Interfaces
• Port:
• Normally means one of the management ports used for
administrative access.
• Interface:
• Normally refers to interfaces that are capable of sending and
receiving user traffic.
However, these terms are often used interchangeably in the industry
and even with IOS output.
CCNA2-26 Chapter 1
Router Interfaces
Console
Auxiliary
• Console Port:
• Used to connect a terminal or most likely a PC running
terminal emulator software,
• Must be used during initial configuration of the router.
• Auxiliary (AUX) Port:
• Not all routers have auxiliary ports.
• At times, can be used similarly to a console port and can
also be used to attach a modem.
CCNA2-27 Chapter 1
Router Interfaces
Ethernet
Serial
CCNA2-29 Chapter 1
Interfaces Belonging to Different Networks
• LAN Interfaces:
• Ethernet
• Fast Ethernet
• Used to connect the router to the LAN.
• Similar to the connection to a PC’s Ethernet NIC.
• Layer 2 MAC address
• Participates in the Ethernet LAN like any other host.
• Typically an RJ-45 jack (UTP).
• Router to Switch: straight-through cable.
• Router to Router: cross-over cable.
• PC to Router: cross-over cable.
CCNA2-30 Chapter 1
Interfaces Belonging to Different Networks
• WAN Interfaces:
• Serial
• ISDN
• Frame Relay
• Used to connect routers to external networks, usually over a
larger geographical distance.
• The Layer 2 encapsulation can be different types (PPP,
Frame Relay, HDLC).
• Similar to LAN interfaces, each WAN interface has its own IP
address and subnet mask, making it a member of a specific
network.
MAC addresses are used only on Ethernet interfaces
and are not on WAN interfaces.
CCNA2-31 Chapter 1
Routers and The Network Layer
CLI Configuration
and Addressing
CCNA2-35 Chapter 1
Populating an Address Table
Default
Device Interface IP Address Subnet Mask
Gateway
Fa0/0 192.168.1.1 255.255.255.0 N/A
R1
S0/0/0 192.168.2.1 255.255.255.0 N/A
CCNA2-37 Chapter 1
Basic Router Configuration
CCNA2-38 Chapter 1
Basic Router Configuration
CCNA2-39 Chapter 1
Basic Router Configuration
CCNA2-40 Chapter 1
Basic Router Configuration
• Configure Passwords:
Privilege password:
Router(config)# enable secret [password]
Console password:
Router(config)# line console 0
Router(config-line)# password [password]
Router(config-line)# login
Telnet password:
Router(config)# line vty 0 4
Router(config-line)# password [password]
Router(config-line)# login
CCNA2-41 Chapter 1
Basic Router Configuration
CCNA2-42 Chapter 1
Basic Router Configuration
• Configure Interfaces:
Router(config)# interface [type][number]
Router(config-if)# ip address [address] [mask]
Router(config-if)# description [description]
Router(config-if)# no shutdown
CCNA2-44 Chapter 1
Basic Router Configuration
Default
Device Interface IP Address Subnet Mask
Gateway
Fa0/0 192.168.1.1 255.255.255.0 N/A
R1
S0/0/0 192.168.2.1 255.255.255.0 N/A
CCNA2-46 Chapter 1
Basic Router Configuration – R1
CCNA2-47 Chapter 1
Basic Router Configuration – R1
• Configure Passwords:
R1(config)#line console 0
R1(config-line)#password cisco
R1(config-line)#login
R1(config)#line vty 0 4
R1(config-line)#password cisco
R1(config-line)#login
R1(config-line)#exit
CCNA2-48 Chapter 1
Basic Router Configuration – R1
CCNA2-49 Chapter 1
Basic Router Configuration – R1
CCNA2-50 Chapter 1
Basic Router Configuration – R1
CCNA2-51 Chapter 1
Basic Router Configuration – R1
CCNA2-52 Chapter 1
Basic Router Configuration – R1
CCNA2-56 Chapter 1
Introducing the Routing Table
CCNA2-57 Chapter 1
Introducing the Routing Table
CCNA2-58 Chapter 1
Directly Connected Networks
Codes:
Indicate how the route was learned.
CCNA2-59 Chapter 1
Directly Connected Networks
CCNA2-60 Chapter 1
Directly Connected Networks
CCNA2-62 Chapter 1
Static Routing
CCNA2-65 Chapter 1
Routing Table Principles
CCNA2-66 Chapter 1
Routing Table Principles
Path Determination
and Switching Functions
CCNA2-69 Chapter 1
Internet Protocol (IP) Packet Format
• Layer 3 addresses:
• Source Address: Source host address
• Destination Address: Destination host address
• Does not change during the forwarding of the data.
CCNA2-70 Chapter 1
MAC Layer Frame Format
• Layer 2 addresses:
• Source address: Sending interface.
• Destination address: Destination interface.
• Interface-to-Interface on the same network.
• Changes from network to network.
CCNA2-71 Chapter 1
Best Path and Metrics
CCNA2-72 Chapter 1
Comparing Hop count and Bandwidth Metrics
Using RIP:
The lowest hop count is 2.
The packet will be forwarded
from R1 to R3.
Using OSPF:
Based on the bandwidth, the
packet will be forwarded from R1
to R2 to R3. More hops, but
faster lines.
CCNA2-74 Chapter 1
Equal Cost Load Balancing
• Two Functions:
• Path Determination
• Switching
CCNA2-76 Chapter 1
Path Determination
CCNA2-77 Chapter 1
Path Determination
CCNA2-78 Chapter 1
Path Determination
• Remote Network:
• R1 receives a packet from PC1 whose ultimate
destination is PC2.
• R1 looks in the routing table and determines that the path
to the destination network is via its WAN port.
• The packet is forwarded to another router. Remote
networks can only be reached by forwarding packets to
another router.
CCNA2-79 Chapter 1
Path Determination
• No Route Determined:
• R1 receives a packet from PC1 whose ultimate
destination is PC2.
• R1 looks in the routing table and cannot find a path to a
directly connected network or remote network.
• If the router does not have a default route, the packet is
discarded. The router sends an Internet Control Message
Protocol (ICMP) Unreachable message to the source IP
address of the packet.
CCNA2-80 Chapter 1
Switching Function
CCNA2-81 Chapter 1
Switching Function
Layer 2 Layer 2 Layer 3 Layer 3
Destination Source Destination Source
HowHow
does
does
HostHOST
X know
X obtain
to forward
Router
the packet
A’s to
Layer
Router
2 address?
A and not
directly to Host Y?
Host Xthe
Queries determines
router forthat
the the
router’s
destination is NOT(more
MAC address on thelater).
same
network. (More Later)
The packet is forwarded to the
default gateway.
CCNA2-82 Chapter 1
Switching Function
Layer 2 Layer 2 Layer 3 Layer 3
Destination Source Destination Source
CCNA2-83 Chapter 1
Switching Function
Layer 2 Layer 2 Layer 3 Layer 3
Destination Source Destination Source
CCNA2-84 Chapter 1
Switching Function
Layer 2 Layer 2 Layer 3 Layer 3
Destination Source Destination Source
B111
A111 A222
H111 192.168.4.10
192.168.4.10 192.168.1.10
192.168.1.10
CCNA2-85 Chapter 1
Switching Function
Layer 2 Layer 2 Layer 3 Layer 3
Destination Source Destination Source
CCNA2-86 Chapter 1
Switching Function
Layer 2 Layer 2 Layer 3 Layer 3
Destination Source Destination Source
CCNA2-87 Chapter 1
Switching Function
Layer 2 Layer 2 Layer 3 Layer 3
Destination Source Destination Source
CCNA2-89 Chapter 1
Switching Function
Layer 2 Layer 2 Layer 3 Layer 3
Destination Source Destination Source
FFFF
B111 B222
A222 192.168.4.10
192.168.4.10 192.168.1.10
192.168.1.10
CCNA2-90 Chapter 1
Switching Function
Layer 2 Layer 2 Layer 3 Layer 3
Destination Source Destination Source
CCNA2-91 Chapter 1
Switching Function
Layer 2 Layer 2 Layer 3 Layer 3
Destination Source Destination Source
H222
FFFF C222
B222 192.168.4.10
192.168.4.10 192.168.1.10
192.168.1.10
CCNA2-95 Chapter 1