Introduction To Routing and Packet Forwarding
Introduction To Routing and Packet Forwarding
Introduction To Routing and Packet Forwarding
Spring 2010
This Presentation
2
Note
This chapter contains mostly introductory material.
Most of not all of this information will be explained in more detail
in later chapters or later courses.
The bootup process and the IOS are examined in a later
course.
Do not worry or focus too much on the details for now.
This will all be examined and explained in the following chapters.
3
For further information
This presentation is an
overview of what is
covered in the
curriculum/book.
For further explanation
and details, please read
the chapter/curriculum.
Book:
Routing Protocols
and Concepts
By Rick Graziani and
Allan Johnson
ISBN: 1-58713-206-0
ISBN-13: 978-58713-
206-3
4
Topics
Inside the Router CLI Configuration and Addressing
Routers are computers
Implementing Basic
Router CPU and Memory
Addressing Schemes
Internetwork Operating
Basic Router Configuration
System
Building the Routing Table
Router Bootup Process
Router Ports and Interfaces Introducing the Routing
Routers and the Network Table
Layer Directly Connected
Path Determination and Networks
Switching Function Static Routing
Packet Fields and Frame Dynamic Routing
Formats
Routing Table Principles
Best Path and Metrics
Equal Cost Load Balancing
Path Determination
Switching Function
5
Inside the Router
Routers are computers
Router CPU and Memory
Internetwork Operating System
Router Bootup Process
Router Ports and Interfaces
Routers and the Network Layer
Routers are Computers
A router is a computer:
The first router (ARPANET):
IMP (Interface Message Processor)
Honeywell 516 minicomputer
August 30, 1969.
7
Router physical characteristics
8
Routers forwarding packets (packet switching):
From the original source to the final destination.
Selects best path
A router connects multiple networks:
Interfaces on different IP networks
9
Router interfaces:
LAN
WAN
10
Routers Determine the Best Path
Routing table
Determines best path.
Best match between destination IP address and network
12
address in routing table
Router
CPU and
Memory
14
Router Bootup Process (more in later course)
15
Bootup Process
16
Where is the permanent configuration file stored used during boot-up? NVRAM (B)
Where is the diagnostics software stored executed by hardware modules? ROM (D)
Where is the backup (partial) copy of the IOS stored? ROM (D)
Where is IOS permanently stored before it is copied into RAM? FLASH (C)
Where are all changes to the configuration immediately stored? RAM (A)
A B C D
A B C D
19
Router Boot Process –
Details (later)
1. ROM
1. POST
2. Bootstrap code executed
3. Check Configuration Register value (NVRAM)
0 = ROM Monitor mode
1 = ROM IOS
2 - 15 = startup-config in NVRAM
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
21
Ports and Interfaces
22
Management
Ports
Console port
Terminal
PC running terminal emulator software
No need for network access
Used for initial configuration
29
Path Determination and
Switching Functions
Ethernet Frame IPv4 (Internet
Protocol)
31
Best Path Which is path is
my “best path”?
OSPF’s metric is
bandwidth
?
Equal Cost ?
Load
Balancing ?
192.168.1.0/24
33
? T1
Equal-Cost Paths ?
Versus Unequal- T3
Cost Paths
192.168.1.0/24
34
Packet Forwarding
Directly connected
network
Remote
network
37
Path Determination Router receives packet.
Destination IP address does NOT match any
network in the router’s routing table.
Packet is dropped.
No route determined
Path
Forwarding
192.168.1.10
What does a router do with a packet received from one network and destined for another
network?
1. Decapsulates the Layer 3 packet by removing the Layer 2 frame header and trailer
2. Examines the destination IP address of the IP packet to find the best path in the
routing table
3. Encapsulates the Layer 3 packet into a new Layer 2 frame and forwards the frame
out the exit interface 40
Remember: Encapsulation
These addresses
do not change!
41
Layer 2 Data Link Frame Layer 3 IP Packet
Dest.
Dest.Add
MAC
MAC Source Add
MAC Type Dest. IP Source IP IP Data Trailer
0B-31
FF-FF
00-10 0A-10
00-20 800 192.168.4.10 192.168.1.10 fields
42
Layer 2 Data Link Frame Layer 3 IP Packet
Dest. MAC Source MAC Type Dest. IP Source IP IP Data Trailer
00-10 0A-10 800 192.168.4.10 192.168.1.10 fields
43
Layer 2 Data Link Frame Layer 3 IP Packet
Dest. MAC Source
Source MAC
MAC Type
Type Dest. IP Source IP IP Data Trailer
Trailer
0B-31
00-10 00-20
0A-10 800
800 192.168.4.10 192.168.1.10 fields
44
Layer 2 Data Link Frame Layer 3 IP Packet
Dest. MAC
Add Source MAC
Add Type Dest. IP Source IP IP Data Trailer
FF-FF
0B-31 00-20 800 192.168.4.10 192.168.1.10 fields
45
Layer 2 Data Link Frame Layer 3 IP Packet
Dest.
Dest.Add
MAC Source
SourceAdd
MAC Type
Type Dest. IP Source IP IP Data Trailer
FF-FF
0B-20 0C-22 800
800 192.168.4.10 192.168.1.10 fields
46
Layer 2 Data Link Frame Layer 3 IP Packet
Dest. MAC Source MAC Type Dest. IP Source IP IP Data Trailer
0B-20 0C-22 800 192.168.4.10 192.168.1.10 fields
47
Layer 2 Data Link Frame Layer 3 IP Packet
Dest.
Dest.Add
MAC
MAC Source Add
MAC Type Dest. IP Source IP IP Data Trailer
0B-31
FF-FF
00-10 0A-10
00-20 800 192.168.4.10 192.168.1.10 fields
48
CLI Configuration and Addressing
Before we begin:
Download: Packet Tracer File:
http://netacad.cabrillo.edu/curricul
um/graziani/cis82/labs-e2/e2-1-5-
2.pkt
Download and Install Packet Tracer
you have not done so already:
http://www.cabrillo.edu/~rgraziani/
courses/cis81.html
Download Lab:
http://netacad.cabrillo.edu/curricul
um/graziani/cis82/labs-e2/en_ER
outing_ILM_v4050.pdf
49
Hands-on Labs
Networking Lab: Room 2504 and CTC NetLab
50
Establishing a HyperTerminal session (next week)
Router
Console port
Terminal or a
PC with
Rollover cable
terminal
emulation
software
Take the following steps to connect a terminal to the console port on the router:
Connect the terminal using the RJ-45 to RJ-45 rollover cable and an RJ-45 to DB-9 or
RJ-45 to DB-25 adapter.
Configure the terminal or PC terminal emulation software for 9600 baud, 8 data bits,
no parity, 1 stop bit, and no flow control.
51
Establishing a Terminal session
Tera Term
HyperTerminal (comes with Windows)
Putty
What cable and ports do you use? PC: Serial port & Router: Console Port
Rollover or Console Cable
Terminal Connection
No network connection needed Console Port
Serial
53
C:\> ping
C:\> telnet
Ethernet Connection
Network connection needed
NIC
When can you use a network connection to
the router? When there is a network connection to the
router (telnet).
What software/command do you need? TCP/IP, Terminal prompt (DOS),
Tera Term, etc.
What cable and ports do you use? PC & Router: Ethernet NIC
Ethernet straight-through cable
When should you not use a network When the change may
54
connection to configure the router? disconnect the telnet connection.
C:\> ping
C:\> telnet
Ethernet Connection
Network connection needed
55
Serial Connectors
Smart “Older”
Serial Serial
56
Serial Cables
DCE Cable DTE Cable
57
WAN Interface Configuration
R1(config)# interface Serial0/0
R1(config-if)# ip address 192.168.2.1 255.255.255.0
R1(config-if)# description Link to R2
R1(config-if)# clock rate 64000 DCE Only
R1(config-if)# no shutdown
58
Let’s do Lab 1.5.2 using Packet Tracer
60
Command Overview (partial list from lab)
Router> user mode
Router> enable
Router# privilege mode
Router# configure terminal
Router(config)# exit
Router# config t
Router(config)# hostname name
Router(config)# enable secret password privilege password
Router(config)# line console 0 console password
Router(config-line)# password password
Router(config-line)# login
Router(config)# line vty 0 4 telnet password
Router(config-line)# password password
Router(config-line)# login
Router(config)# banner motd # message # banner
Router(config)# interface type number configure interface
Router(config-if)# ip address address mask
Router(config-if)# description description
Router(config-if)# no shutdown
61
Other Commands
Router# copy running-config startup-config
Router# show running-config
Router# show ip route
Router# show ip interface brief
Router# show interfaces
62
Different Modes
Router# hostname R1
^
% Invalid input detected at '^' marker.
Router# configure terminal
Router(config)# hostname R1
R1(config)#
64
Serial Connectors
DCE Cable
DTE Cable
Router is typically a DTE device.
The DTE cable is connected to the serial interface on the router to a
CSU/DSU device (DCE).
65
WAN Interface Configuration
R1(config)# interface Serial0/0
R1(config-if)# ip address 192.168.2.1 255.255.255.0
R1(config-if)# description Link to R2
R1(config-if)# clock rate 64000 DCE Only
R1(config-if)# no shutdown
66
Unsolicited Messages from IOS
R1(config)# interface fastethernet0/0
R1(config-if)# ip address 172.16.3.1 255.255.255.0
R1(config-if)# no shutdown
R1(config-if)# descri
*Mar 1 01:16:08.212: %LINK-3-UPDOWN: Interface
FastEthernet0/0, changed state to up
*Mar 1 01:16:09.214: %LINEPROTO-5-UPDOWN: Line protocol on
Interface
FastEthernet0/0, changed state to upption
R1(config-if)#
The IOS often sends unsolicited messages
Does not affect the command
Can cause you to lose your place when typing.
67
Unsolicited Messages from IOS
R1(config)# line console 0
R1(config-line)# logging synchronous
R1(config-if)# descri
*Mar 1 01:28:04.242: %LINK-3-UPDOWN: Interface
FastEthernet0/0, changed state to up
*Mar 1 01:28:05.243: %LINEPROTO-5-UPDOWN: Line protocol on
Interface
FastEthernet0/0, changed state to up
R1(config-if)# description
To keep the unsolicited output separate from your input, enter line
configuration mode for the console port and add the logging
synchronous
68
LAN Interface Configuration
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
Fa0/1
69
Each Interface Belongs to a Different Network
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
R1(config-if)# no shutdown
192.168.1.0 overlaps with FastEthernet0/0
FastEthernet0/1: incorrect IP address assignment
Fa0/1
192.168.1.1/24
192.168.1.2/24
Same Network!
70
Each Interface Belongs to a Different Network
R1# show ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 192.168.1.1 YES manual up up
Serial0/0 192.168.2.1 YES manual up up
FastEthernet0/1 192.168.1.2 YES manual administratively
down down
Serial0/1 unassigned YES unset administratively
down down
Fa0/1
71
Verifying Interfaces
R1# show interfaces
<some interfaces not shown>
FastEthernet0/0 is up, line protocol is up (connected)
Hardware is Lance, address is 0007.eca7.1511 (bia 00e0.f7e4.e47e)
Description: R1 LAN
Internet address is 192.168.1.1/24
MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec, rely 255/255, load 1/255
Encapsulation ARPA, loopback not set
ARP type: ARPA, ARP Timeout 04:00:00,
Last input 00:00:08, output 00:00:05, output hang never
Last clearing of “show interface” counters never
Queueing strategy: fifo
Output queue :0/40 (size/max)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
0 packets input, 0 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
<output omitted>
Serial0/0 is up, line protocol is up (connected)
Hardware is HD64570
Description: Link to R2
Internet address is 192.168.2.1/24
MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec, rely 255/255, load 1/255
Encapsulation HDLC, loopback not set, keepalive set (10 sec)
Last input never, output never, output hang never
72
<output omitted>
Verify Router Configuration
R1# show running-config
!
version 12.3
!
hostname R1
!
interface FastEthernet0/0
description R1 LAN Note: shutdown is the
ip address 192.168.1.1 255.255.255.0
! default. no shutdown does
interface Serial0/0 not show in the configuration.
description Link to R2
ip address 192.168.2.1 255.255.255.0
clock rate 64000
!
banner motd ^C
******************************************
WARNING!! Unauthorized Access Prohibited!!
******************************************
^C
!
line con 0
password cisco
login
line vty 0 4
password cisco
login
!
end
73
Save Configuration
R1# copy running-config startup-config
R1# show startup-config
Using 728 bytes
!
version 12.3
!
hostname R1
!
interface FastEthernet0/0
description R1 LAN
ip address 192.168.1.1 255.255.255.0
!
interface Serial0/0
description Link to R2
ip address 192.168.2.1 255.255.255.0
clock rate 64000
!
banner motd ^C
******************************************
WARNING!! Unauthorized Access Prohibited!!
******************************************
^C
line con 0
password cisco
login
line vty 0 4
password cisco
login
!
end 74
Building the Routing Table
76
Introducing the Routing Table
R1# show ip route
77
Introducing the Routing Table
R1# show ip route
<output omitted>
Exit Interfaces
78
Introducing the Routing Table
R1# show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
<output omitted>
Directly Connected
Networks
Remote Network
81
NetLab
Basic Router
Pod
82
Chapter 1
Introduction to Routing and
Packet Forwarding
CIS 82 Routing Protocols and Concepts
Rick Graziani
Cabrillo College
[email protected]