Routing Protocols and Concepts
Trang 1Introduction to Routing
and Packet Forwarding
Routing Protocols and
Concepts – Chapter 1
Trang 22
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Objectives
Identify a router as a computer with an OS and
hardware designed for the routing process
Demonstrate the ability to configure devices and
apply addresses
Describe the structure of a routing table
Describe how a router determines a path and
switches packets
Trang 3Router as a Computer
Describe the basic purpose of a router
network
the best path for a packet to travel and forwarding packets to
their destination
Routers are the network center
Trang 44
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Router as a Computer
Data is sent in form of packets between 2 end devices
Routers are used to direct packet to its destination
Trang 5Router as a Computer
Routers examine a packet’s destination IP address and determine the best path by enlisting the aid of a routing table
Trang 66
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Router as a Computer
configuration file Stores routing table RAM contents lost
when power is off
when router is powered up Stores the router’s bootstrap
program
This may include IP addresses (Routing protocol, Hostname of router)
used to connect network Examples of interface types:
• Ethernet / fast Ethernet interfaces
• Serial interfaces
• Management interfaces
Trang 7Router as a Computer
Router components
Trang 88
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Router as a Computer
Major phases to the router boot-up process
Trang 9Router as a Computer
Verify the router boot-up process:
the router during the bootup process Information includes:
Trang 1010
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Router as a Computer
Trang 11Router as a Computer
Router Interface is a physical connector that enables a
router to send or receive packets
Each interface connects to a separate network
Consist of socket or jack found on the outside of a
Trang 12• Are used to connect router to LAN network
• Has a layer 2 MAC address
• Can be assigned a Layer 3 IP address
• Usually consist of an RJ-45 jack
• Are used to connect routers to external networks that interconnect LANs
• Depending on the WAN technology, a layer 2 address may be used
• Uses a layer 3 IP address
Trang 13Router as a Computer
Routers and the Network Layer
consults information in the routing table
Trang 1414
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Router as a Computer
Routers Operate at Layers 1, 2 & 3
destination IP address
Trang 15Configure Devices and Apply Addresses
Implementing Basic Addressing Schemes
When designing a new network or mapping an existing network you must provide the following information in
the form of a document:
– Topology drawing that Illustrates physical connectivity
– Address table that provides the following information:
• Device name
• Interfaces used
• IP addresses
• Default gateway
Trang 1616
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Configure Devices and Apply Addresses
Basic Router Configuration
• Router name - Host name should be unique
• Banner - At a minimum, banner should warn against unauthorized use
• Passwords - Use strong passwords
• Interface configurations - Specify interface type, IP address and subnet mask Describe purpose of interface Issue no shutdown command If DCE serial interface issue clock rate command
should be completed:
• Verify basic configuration and router operations
• Save the changes on a router
Trang 17Configure Devices and Apply Addresses
Trang 1818
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Configure Devices and Apply Addresses
Verify Basic Router Configuration
running-config startup-config command
router configuration are:
• Show running-config - Displays configuration currently in RAM
• Show startup-config - Displays configuration file NVRAM
• Show IP route - Displays routing table
• Show interfaces - Displays all interface configurations
• Show IP int brief - Displays abbreviated interface configuration information
Trang 19Routing Table Structure
Routing Table is stored in ram and contains information about:
– Directly connected networks - this occurs when a device is
connected to another router interface
– Remotely connected networks - this is a network that is not
directly connected to a particular router
– Detailed information about the networks include source of
information, network address & subnet mask, and Ip address
of next-hop router
Show ip route command is used to view a routing table
Trang 2020
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Routing Table Structure
Adding a connected network to the routing table
table you must have directly connected networks
Trang 21Routing Table Structure
Static routes in the routing table
next hop router or exit interface
to connect remote networks before static or dynamic routing
can be used
When to use static routes
Trang 2222
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Routing Table Structure
Connected and Static routes
Trang 23Routing Table Structure
Dynamic routing protocols
Automatic network discovery
table information
Trang 2424
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Routing Table Structure
Maintaining routing tables
information with other router & to maintain and up date their
own routing table
IP routing protocols - example of routing protocols
Trang 25Routing Table Structure
Routing Table Principles
• Every router makes its decisions alone, based on the information it has in its routing table
how to get back
Trang 2626
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Routing Table Structure
Effects of the 3 Routing Table Principles
another, on a hop by hop basis
“Y” (Asymmetric routing)
Trang 27Router Paths and Packet Switching
Internet Protocol (IP) packet format contains fields that
provide information about the packet and the sending
and receiving hosts
Fields that are importance for CCNA students:
Trang 2828
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Router Paths and Packet Switching
MAC Layer Frame Format
MAC Frames are also divided into fields - they include:
Trang 29Router Paths and Packet Switching
A Metric is a numerical value used by routing protocols help determine the best path to a destination
– The smaller the metric value the better the path
2 types of metrics used by routing protocols are:
– Hop count - this is the number of routers a packet must travel
through to get to its destination
– Bandwidth - this is the “speed” of a link also known as the data capacity of a link
Trang 3030
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Router Paths and Packet Switching
multiple paths to the same destination that all have the
same metric
To solve this dilemma , a router will use Equal Cost
Load Balancing - this means the router sends packets
over the multiple exit interfaces listed in the routing
table
Trang 31Router Paths and Packet Switching
pick the best path to a destination
One of 3 path determinations results from searching for the best path
– Directly connected network
– Remote network
– No route determined
Trang 3232
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Router Paths and Packet Switching
router to switch a packet from an incoming interface to
an outgoing interface on the same router
• 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
Trang 33Router Paths and Packet Switching
As a packet travels from one networking device to another
packet is forwarded from one router to the next
which point router discards packet (prevents packets from
endlessly traversing the network)
Trang 3434
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Router Paths and Packet Switching
Path determination and switching function details PC1 wants to send something to PC 2
– Step 1 - PC1 encapsulates packet into a frame - frame
contains R1’s destination MAC address
Trang 35Router Paths and Packet Switching
next hop IP address
Trang 3636
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Router Paths and Packet Switching
Trang 37Router Paths and Packet Switching
next hop IP address
Trang 3838
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Router Paths and Packet Switching
Step 4 - Packet arrives at R3
connected to destination via its fast Ethernet interface
Step 5 - IP packet arrives at PC2 - frame is decapsulated and
processed by upper layer protocols
Trang 39Summary
Trang 40so that router can examine the destination IP address
route then Router determines next hop IP address Router will re-encapsulate packet with appropriate layer 2 frame and send
it out to next destination
destination IP addresses do not change
Trang 42© 2007 Cisco Systems, Inc All rights reserved Cisco Public 1
Version 4.0
Static Routing
Routing Protocols and
Concepts – Chapter 2
Trang 43Objectives
Define the general role a router plays in networks
Describe the directly connected networks, different
router interfaces
Examine directly connected networks in the routing
table and use the CDP protocol
Describe static routes with exit interfaces
Describe summary and default route
Examine how packets get forwarded when using
static routes
Identify how to manage and troubleshoot static
Trang 443
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
General Role of the Router
Functions of a Router
– Forwarding packets to destination
Introducing the Topology
– 3 1800 series routers connected via WAN links
– Each router connected to a LAN represented by a switch and a PC
Trang 45General Role of the Router
Connections of a Router for WAN
standards
Connections of a Router for Ethernet
Cross-over
Hub-to-PC, Hub-to-Server
Hub-to-Hub, Router-to-Router
Trang 465
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Interfaces
– Show IP router command – used to view routing table
– Show Interfaces command – used to show status of an
interface
– Show IP Interface brief command – used to show a portion of
the interface information
– Show running-config command – used to show configuration
file in RAM
Trang 47Interfaces
– By default all serial and Ethernet interfaces are down
Trang 487
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Interfaces
– Show interfaces for fastEthernet 0/0 – command used to show status of fast Ethernet port
– Show ip interface brief
– Show running-config
Ethernet interfaces participate in ARP
Trang 49Interfaces
Trang 509
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Interfaces
service provider CSU/DSU is a DCE device
the DTE device
Trang 51Interfaces
Trang 5211
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Routing Table and CDP Protocol
adding or removing routes
Trang 53Routing Table and CDP Protocol
Trang 5413
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Routing Table and CDP Protocol
When a router only has its interfaces configured & no
other routing protocols are configured then:
– The routing table contains only the directly connected networks
Trang 55Routing Table and CDP Protocol
Trang 5615
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Routing Table and CDP Protocol
Trang 57Routing Table and CDP Protocol
• Layer 3 neighbors
• Layer 2 neighbors
Trang 5817
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Routing Table and CDP Protocol
– Show cdp neighbors command
– Show cdp neighbors detail command
Trang 59Routing Table and CDP Protocol
Trang 6019
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Static Routes with Exit Interfaces
to a stub network
Trang 61Static Routes with Exit Interfaces
Trang 6221
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Static Routes with Exit Interfaces
the "next-hop" to this network
Trang 63Static Routes with Exit Interfaces
Trang 6423
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Static Routes with Exit Interfaces
Zinin’s 3 routing principles
– Principle 1: “Every router makes its decision alone, based on
the information it has in its own routing table.”
– Principle 2: “The fact that one router has certain information in its routing table does not mean that other routers have the
same information.”
– Principle 3: “Routing information about a path from one
network to another does not provide routing information about
the reverse, or return path.”
Trang 65Static Routes with Exit Interfaces
Using Zinin’s 3 routing principles, how would you
answer the following?
– Would packets from PC1 reach their destination?
192.168.1.0/24 networks would reach their destination
– Does this mean that any packets from these networks destined for 172.16.3.0/24 network will reach their destination?
172.16.3.0/24 network
Trang 6625
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Static Routes with Exit Interfaces
– Recursive route lookup - Occurs when the router has to perform multiple lookups in the routing table before forwarding a packet
A static route that forwards all packets to the next-hop IP address goes through the following process (reclusive route lookup)
address with the Next hop address
Trang 67Static Routes with Exit Interfaces
Configuring a Static route with an Exit Interface
– Static routes configured with an exit interface are more efficient
because the routing
search instead of 2 searches
exit interface
Trang 6827
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Static Routes with Exit Interfaces
– Existing static routes cannot be modified The old static route
• no ip route 192.168.2.0 255.255.255.0 172.16.2.2
Trang 69Static Routes with Exit Interfaces
destination and that Return path is working
Trang 7029
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Static Routes with Exit Interfaces
– If a static route is configured on an Ethernet link and packet is sent to the next-hop router then…
• The destination MAC address will be the address of the
next hop’s Ethernet interface
Trang 71Summary and Default Route
table
number of static routes into a single static route.
Trang 7231
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Summary and Default Route
Trang 73Summary and Default Route
– This is a route that will match all packets Stub routers that
have a number of static routes all exiting the same interface
are good candidates for a default route
the routing table
address and subnet mask are all zeros
ip-address ]
Trang 7433
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Summary and Default Route
match when comparing destination IP address and subnet
mask
all packets will match
Trang 75Static Routes and Packet Forwarding
Packet forwarding with static routes (recall Zinin’s 3
routing principles)
Router 1
192.168.2.0/24
Trang 7635
© 2007 Cisco Systems, Inc All rights reserved Cisco Public
Static Routes and Packet Forwarding
Packet forwarding with static routes (recall Zinin’s 3
routing principles)
Router 2