0% found this document useful (0 votes)
59 views180 pages

CN Unit 4

Uploaded by

C14Pranav Dhumal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views180 pages

CN Unit 4

Uploaded by

C14Pranav Dhumal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 180

SY B. Tech.

(Information Technology)
2018 Pattern
ITUA22183-Computer Networks

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 1
▪ Prerequisites :

▪ Digital Electronics, Fundamentals of Data Communication

▪ Course Objectives :
▪ To study the fundamentals of networking
▪ To understand functionalities of Physical and Data link layer
▪ To understand the functionalities of Network Layer
▪ To study various protocols at Transport and Application Layer
▪ To learn different techniques for routing and routing configuration.
▪ To learn and demonstrate VLAN, ACL and NAT in networking
▪ Course Outcomes :
▪ After completion of the course, student will be able to
▪ 1. Explore network design issues
▪ 2. Understand the functions of OSI layers & TCP/IP protocol stack
▪ 3. Understand the functionality of network layer
▪ 4. Understand the functionality of Transport and Application Layer
▪ 5. Analyze the routing requirements for a given network/LAN and decide the most
▪ appropriate routing strategy.
▪ 6. Design Switched networks and demonstrate the concepts of VLAN and ACL for
▪ switched networks. © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 2
UNIT 4- Routing Essentials
▪ Introduction to Routing,

▪ Router Functions and Configuration,

▪ Routing Decisions and Operations,

▪ Routing Table,

▪ Static Routing and Default Routing,

▪ Dynamic Routing and Protocols,

▪ Static vs. Dynamic Routing.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 3
1: Routing Concepts

CCNA Routing and Switching

Routing and Switching Essentials v6.0


1.1 Router Initial Configuration

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 5
Router Functions
Characteristics of a Network
▪ Networks are relied on for web applications,
IP telephony, video conferencing, interactive
gaming, e-commerce, and much more.

▪ Characteristics referred to when discussing


networks:
• Topology
• Physical topology – arrangement of the cables,
network devices, and end systems; it describes
how the network devices are actually
interconnected with wires and cables
• Logical topology – describes the path over which
the data is transferred in a network and how the
network devices appear connected to network
users
• Speed – measure of the data rate in bits per
second (b/s) of a given link in the network
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 6
Router Functions
Characteristics of a Network (Cont.)
• Cost – general expense for purchasing of
network components as well as installation and
maintenance of the network
• Security – indicates how protected the network
is, including the information that is transmitted
over the network
• Availability – refers to the likelihood that the
network is available for use when it is required
• Scalability – indicates how easily the network
can accommodate more users and data
transmission requirements as they increase
• Reliability – indicates the dependability of the
components that make up the network
including the routers, switches, PCs, and
servers; often measured as MTBF (mean time
between failures)
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 7
Router Functions
Why Routing?
▪ Router:
• Connects one network to another
network
• Determines the best route to the
destination before forwarding traffic to
the next router along the path
• Responsible for routing traffic
between network
• Routing table used to determine the
most efficient path to reach the
destination

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 8
Router Functions
Routers Are Computers ▪ A router is a specialized computer and
requires the same components to operate as
computers including:
• Central Processing Unit (CPU)
• Operating System (OS)
• A desktop computer might use the Windows
Operating System, but a Cisco Router uses the
Cisco Internetwork Operating System (IOS).
• Memory and storage (RAM, ROM, NVRAM,
Flash, hard drive)
• Non-volatile vs. volatile memory
• Which one requires constant power to retain
content?

▪ Routers have specialized ports and network


interface cards to interconnect devices to other
networks
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 9
Router Functions
Routers Are Computers (Cont.)

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 10
Router Functions
Routers Interconnect Networks
▪ Router is responsible for forwarding
packets from network to network, from the
source to the destination

▪ Multiple networks on a router require


multiple interfaces that each belong to a
different IP network
• These interfaces are used to connect:
• LANs – Ethernet networks that contain PCs,
printers, and servers
• WANs – used to connect networks over large
geographical areas such as to an ISP

▪ When a packet arrives on a router’s


interface, the router might be the final
destination, or it may have to send it to
another router to reach its final
destination.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 11
Router Functions
▪ The primary functions of a router are to:
Routers Choose Best Paths • Determine the best path to send packets
• Forward packets toward their destination

▪ When a router receives a packet, it examines


the destination address of the packet and uses
the routing table to look for the best path to that
network.
• When a match is found, the router encapsulates the
packet into the data link frame of the outgoing exit
interface and then forwards the packet out that
interface to its destination.

▪ A router can handle different data link layer


frame encapsulations.
• The router might receive a frame from its Ethernet
interface. It will have to de-encapsulate the packet to
search the routing table for a matching network.
▪ Routers use the routing table like a map to discover
Once it finds a match, it will encapsulate it inside of
the best path to a given network.
the corresponding frame required for the outgoing
interface, such as a PPP frame.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 12
Router Functions
Packet Forwarding Mechanisms
▪ Routers support three packet-forwarding mechanisms:

• Process switching –
• Slower and older packet forwarding mechanism
• Packet arrives on an interface, it is forwarded to the
control plane where the CPU matches the destination
address with an entry in its routing table in order to
determine the exit interface
• Slow because it does this for every packet in a stream
• Fast Switching –
• Common packet forwarding mechanism which uses a
fast-switching cache to store the next-hop information
• Packet arrives on an interface, it is forwarded to the
control plane where the CPU searches for a match in
the fast-switching cache
• If no match, it is process-switched and forwarded to
the exit interface
• Packet flow information stored
© 2016 Cisco and/or its affiliates. in the
All rights fast-switching
reserved. Cisco Confidential 13

cache for quick lookup


Router Functions
Packet Forwarding Mechanisms (Cont.)
• Cisco Express Forwarding – CEF
• Fastest, most recent, and preferred packet-
forwarding mechanism
• CEF builds a Forwarding Information Base
(FIB) and an adjacency table
• Table entries are not packet-triggered like
fast switching, but change-triggered when
something changes in the network topology
• When a network has converged, the FIB
and adjacency tables contain all the
information a router would have to consider
when forwarding a packet
• FIB contains pre-computed reverse
lookups, next hop information for routes
including the interface and Layer 2
information
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 14
Router Functions
Packet Tracer – Using Traceroute to Discover the Network

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 15
Router Functions
Lab – Mapping the Internet

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 16
Connect Devices
Connect to a Network
▪ Home Office devices might connect as
follows:
• Laptops and tablets connect wirelessly
to a home router.
• A network printer connects using an
Ethernet cable to the switch port on the
home router
• The home router connects to the
Internet service provider cable modem
using an Ethernet cable.
• The cable modem connects to the ISP
network.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 17
Connect Devices
Connect to a Network (Cont.)
▪ Branch site devices might connect as
follows:
• Desktop PCs, VoIP phones, and corporate
resources such as file servers and printers
connect to Layer 2 switches using
Ethernet cables.
• Laptops and smartphones connect
wirelessly to wireless access points
(WAPs).
• The WAPs connect to switches using
Ethernet cables.
• Layer 2 switches connect to an Ethernet
interface on the edge router using
Ethernet cables.
• The edge router connects to a WAN
service provider.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 18
Connect Devices
Connect to a Network (Cont.)
▪ Central site devices might connect as
follows:
• Desktop PCs and VoIP phones connect to
Layer 2 switches using Ethernet cables.
• Layer 2 switches connect redundantly to
multilayer Layer 3 switches using Ethernet
fiber-optic cables.
• Layer 3 multilayer switches connect to an
Ethernet interface on the edge router
using Ethernet cables.
• The corporate website server connects to
the edge router interface.
• The edge router connects to a WAN SP
and also to an ISP for backup purposes.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 19
Connect Devices
Default Gateways ▪ Devices need the following information
for network access: IP address, subnet
mask, and default gateway.

▪ When a host sends a packet to a device


that is on the same IP network, the
packet is forwarded out the host interface
to the destination device. The router does
not need to get involved.

▪ When a host sends a packet to a device


on a different IP network, the packet is
forwarded to the default gateway
because the host device cannot
communicate with devices outside of the
local network.

▪ The default gateway is the device that


▪ Routers are also usually configured with their own default gateway. routes traffic from the local network to
devices on remote networks, such as
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 20
devices on the Internet.
Connect Devices
Document Network Addressing ▪ When designing a new network or
mapping an existing one, the
documentation should identify:
• Device names
• Interfaces used in the design
• IP addresses and subnet masks
• Default gateway addresses
▪ The figure in the left shows two useful
documents:
• Topology diagram – provides a visual
reference that indicates the physical
and logical Layer 3 addressing.
• An addressing table – captures device
names, interfaces, IPv4 addresses,
subnet masks, and default gateway
addresses.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 21
Connect Devices
Enable IP on a Host ▪ A host can be assigned IP address
information either:
• Statically –
• Manually configure the IP address,
subnet mask, default gateway and
probably the DNS server IP address.
• Servers and printers commonly use
static address assignment.
• Dynamically –
• IP address information is obtained
from a Dynamic Host Configuration
Protocol (DHCP) server.
• DHCP server provides an IP address,
subnet mask, default gateway and
probably the DNS server information.
• Most host devices uses DHCP.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 22
Connect Devices
▪ Host computers connect to a wired network
Device LEDs using a RJ-45 Ethernet cable.

▪ Most network interface cards have one or


two LED indicators next to the interface.
• Green LED indicates a good connection.
• A blinking green indicates network activity.
• No light indicates a problem with either the
network cable or the network itself.
▪ Network infrastructure devices also use
LEDs to provide a quick status view. For
example, a Cisco Catalyst 2960 switch:
• Green LEDs indicate a switch is functioning
normally.
• Amber LEDs indicate a malfunction.
▪ Cisco routers also use various LED
indicators to provide status information.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 23
Connect Devices
Console Access ▪ Devices including routers and switches are
commonly accessed using Secure Shell (SSH)
or HyperText Transfer Protocol Secure (HTTPS).
▪ Console access is usually only required when
initially configuring a device, or if remote access
fails.

▪ Console access requires:


• Console cable – RJ-45 to DB-9 serial cable or a
USB serial cable.
• Terminal emulation software – Tera Term, PuTTY,
or HyperTerminal
▪ Cable is connected between the serial port of the
host and the console port on the device.
• If a host does not have a serial port, use the USB
port and a USB-to-RS-232 adapter.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 24
Connect Devices
Enable IP on a Switch
▪ Network devices require IP
addresses in order for the network
administrator to connect to the
devices using Telnet, SSH, HTTP,
or HTTPS.

▪ A switch requires an IP address to


be configured on a virtual
interface, called the switched
virtual interface (SVI).

▪ Commands in the figure to the left


should be used to configure the IP
address on vlan 1 and also the
default-gateway information.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 25
Connect Devices
Packet Tracer – Documenting the Network

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 26
Router Basic Settings
Configure Basic Router Settings ▪ Cisco routers and switches have
similar initial configuration steps:
• Name the device in order to
distinguish it from other devices in
the network using the hostname
command in global config mode.
• Secure management access as
shown in the figure to the left in
order to secure privileged EXEC,
user EXEC, and remote access.
• Configure a banner to provide legal
notification of unauthorized access
in global config mode: banner motd
** Authorized Access Only! **
▪ Always save your configuration
changes and verify your settings:
R1# copy running-config startup-
config
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 27
Router Basic Settings
▪ Layer 2 switches support LANs and
Configure an IPv4 Router Interface have multiple FastEthernet or
Gigabit Ethernet ports.

▪ Routers support LANs and WANs


and have many types of interfaces
including Gigabit Ethernet and High-
Speed WAN Interface Card (HWIC)
slots to support WAN connections.

▪ As shown in the figure to the left, an


interface must be configured with an
IP address, subnet mask, and
activated with the no shutdown
command.
Note: In a lab environment, the serial
interface with the cable end labeled DCE
needs to be configured with a clock rate
command.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 28
Router Basic Settings
▪ To configure host PC1, statically
Configure an IPv6 Router Interface assign an IPv6 address to the host
under Internet Control Protocol
Version 6 (TCP/IPv6) Properties.

▪ Configuring an IPv6 interface is very


similar to configuring an IPv4
interface, use the ipv6 address
command.

▪ As shown in the figure, configure the


interface with an IPv6 address and
subnet mask prefix.

▪ Activate the interface with the no


shutdown command.

▪ The clock rate 128000 command was used since this is being ▪ An interface can generate its own
configured in a lab environment. IPv6 link-local address without having
a global unicast address by using the
ipv6 enable interface config
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 29
command.
Router Basic Settings
Configure an IPv6 Router Interface (Cont.)
▪ Unlike IPv4, IPv6 interfaces will typically
have more than one IPv6 address.

▪ An IPv6 device must have an IPv6 link-


local address but will most likely also
have an IPv6 global unicast address.

▪ An interface can also have multiple IPv6


global unicast addresses from the same
subnet.

▪ These commands can be used to create a


global unicast or link-local IPv6 address:
• ipv6 address ipv6-address/prefix-length
• ipv6 address ipv6-address/prefix-length
eui-64
• ipv6 address ipv6-address/prefix-length
link-local
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 30
Router Basic Settings
▪ An IPv4 loopback interface is
Configure an IPv4 Loopback Interface typically configured on a router for
testing and management purposes.
▪ A loopback interface is a logical
interface internal to the router.
• It is not assigned to a physical port
and can not be connected to any
other device.
• It is a software interface that is
automatically placed in an “up” state
as long as the router is functioning.
▪ Some routing protocols such as
OSPF require an address for
identification, the loopback address
can be used rather than an interface
address which might go down on
occasion, disrupting OSPF routing.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 31
Router Basic Settings
Packet Tracer – Configuring IPv4 and IPv6 Interfaces

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 32
Verify Connectivity of Directly Connected Networks
Verify Interface Settings ▪ The following commands are used to verify
the operation and configuration of an
interface:
• show ip interface brief – Displays a summary
for all interfaces including the IPv4 address of
the interface as well as the current operational
status.
• show ip route – Displays the contents of the
IPv4 routing table.
• show running-config interface interface-id –
Displays the commands configured on the
specified interface.

▪ The following commands can be used to


gather more detailed interface information:
• show interfaces – Displays interface
information and packet flow counts.
• show ip interface – Displays the IPv4 related
information for all interfaces on a router.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 33
Verify Connectivity of Directly Connected Networks
▪ IPv6 commands used for interface
Verify IPv6 Interface Settings configuration verification are similar to IPv4.
• show ipv6 interface brief – If the output
shows up/up, this shows that Layers 1 and 2
are operational
• show ipv6 interface interface-id – Shows
the interface status and all of the IPv6
addresses that belong to the interface.
• show ipv6 route – Verifies that IPv6
networks and specific IPv6 interface
addresses have been installed in the IPv6
routing table.
▪ As shown in the figure to the left, a ‘C’ next
to a route indicates that this is a directly
connected network.
• When the router interface is configured with a
global unicast address and is in the “up/up”
state, the IPv6 prefix length is added to the
IPv6 routing table
© 2016 Cisco and/or its as a Allconnected
affiliates. route.
rights reserved. Cisco Confidential 34
Verify Connectivity of Directly Connected Networks
Filter Show Command Output ▪ Commands that generate multiple screens of
output are, by default, paused after 24 lines.
• The spacebar allows you to see the next set of
lines, while the ENTER key will display the next
line.
• Use the terminal length command to change the
number of lines to be displayed.
▪ Another useful feature that makes it easier to
view show output is by filtering the output. To
enable the filtering command, use the pipe
character, “|”. For example:
• show running-config | section line con – shows the
section that starts with “line con”
• show ip interface brief | include down – includes all
output that matches “down”
• show ip interface brief | exclude up – “excludes all
output that matches up”
• show running-config | begin line – shows all the
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 35
remaining output starting with “line”
Verify Connectivity of Directly Connected Networks
Command History Feature ▪ The command history feature shows
previously executed commands when
recalled.
▪ Press Ctrl+P or the Up Arrow key to recall
commands in the history buffer.
• The most recent commands are displayed first
• Keep pressing Up Arrow to recall the
commands in the history buffer.
▪ By default, command history is enabled and
the last 10 commands are stored in the
history buffer.
▪ Use the terminal history size user EXEC
command to change this number.

▪ Use the show history privileged EXEC


command to display the contents of the
buffer.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 36
Verify Connectivity of Directly Connected Networks
Packet Tracer – Configuring and Verifying a Small Network

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 37
Verify Connectivity of Directly Connected Networks
Lab – Configuring Basic Router Settings with IOS CLI

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 38
1.2 Routing Decisions

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 39
Switching Packets Between Networks
Router Switching Function
▪ The primary function of a router
is to forward packets toward
their destination.
• Uses a switching function which
is a process that accepts a
packet on one interface and
forwards it out of another
interface. This is not to be
confused with the function of a
Layer 2 switch.
• The switching function also
encapsulates the packets in the
appropriate data link frame type
for the outgoing interface.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 40
Switching Packets Between Networks
▪ When a router receives a packet from one
Router Switching Function (Cont.) network that is destined for another network,
the router performs the following three
steps:
• Step 1. De-encapsulates the Layer 2 frame
header and trailer to expose the Layer 3
packet.
• Step 2. Examines the destination IP address
of the IP packet to find the best path in the
routing table.
• Step 3. If the router finds a path to the
destination, it encapsulates the Layer 3
packet into a new Layer 2 frame and
forwards the frame out the exit interface.
▪ As a packet travels from the source device
to the destination device, the Layer 3 IP
addresses do not change. However, the
Layer 2 data link addresses change at every
hop as it is de-encapsulated and re-
encapsulated.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 41
Switching Packets Between Networks
Send a Packet ▪ For PC1 to send a packet to PC2,
the following occurs:
• PC1 must determine if the
destination IPv4 address is on the
same network. If it is on the same
network, PC1 will obtain the
destination MAC address from its
ARP cache or use an ARP request.
• Because the destination network is
on a different network, PC1 forwards
the packet to its default gateway.
• To determine the MAC address of
the default gateway, PC1 checks its
ARP table for the IPv4 address of the
default gateway and its
corresponding MAC address. An
ARP request is sent if it is not found.
• When PC1 has the MAC address of
Router R1,its affiliates.
© 2016 Cisco and/or it can forward
All rights the
reserved. Cisco packet.
Confidential 42
Switching Packets Between Networks
▪ When R1 receives the Ethernet frame
Forward to the Next Hop from PC1, the following occurs:
• R1 examines the destination MAC
address which matches the MAC
address of the receiving interface and
copies the frame into its buffer.
• R1 identifies the Ethernet Type field as
0x800 which indicates that the Ethernet
frame contains an IPv4 packet in the
data portion of the frame.
• R1 de-encapsulates the Ethernet frame.
• Because the destination IPv4 address
of the packet, 192.168.4.10, does not
match any of the directly connected
networks on R1, R1 searches the
routing table for a corresponding route.
• R1’s Routing Table has a route for the
192.168.4.0/24 network.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 43
Switching Packets Between Networks ▪ When R1 receives the Ethernet frame
Forward to the Next Hop (Cont.) from PC1, the following occurs:
• The route that R1 finds to the
192.168.4.0/24 network has a next-hop
address of 192.168.2.2 and an exit
interface of FastEthernet 0/1.
• This will require that the IPv4 packet be
encapsulated in a new Ethernet frame
with the destination MAC address of the
IPv4 address of the next-hop router,
192.168.2.2
• Because the exit interface is on an
Ethernet network, R1 must resolve the
next-hop IPv4 address with a
destination MAC address using ARP,
assuming it is not in its ARP cache.
• When R1 has the MAC address for the
next-hop, the Ethernet frame is
forwarded out of the FastEthernet 0/1
interface of R1.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 44
Switching Packets Between Networks
Packet Routing
▪ R2 examines the destination MAC
address. Because it matches the
MAC address of its receiving
interface, R2 copies the frame into
its buffer.

▪ R2 determines that that frame


contains an IPv4 packet in the data
portion of the frame.

▪ R2 de-encapsulates the Ethernet


frame.
▪ The process outlined to the right describes what
▪ Because the destination IP address
happens when router R2 receives a frame on its
is on a different network, the routing
FA0/0 interface that needs to be forwarded to router
table is searched to find a
R3.
corresponding route for the
destination IPv4 address.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 45
Switching Packets Between Networks
▪ The routing table of R2 has a route
Packet Routing (Cont.) to the 192.168.4.0/24 network with
a next-hop IPv4 address of
192.168.3.2 and an exit interface of
Serial 0/0/0.

▪ Because the exit interface is not


Ethernet, R2 does not have to
resolve the next-hop IP-v4 address
with a destination MAC address.

▪ The IPv4 packet is encapsulated


into a new data link frame used by
the exit interface and sent out the
Serial 0/0/0 exit interface.

▪ Because there are no MAC


addresses on serial interfaces, R2
sets the data link destination
address to an equivalent of a
broadcast.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 46
Switching Packets Between Networks
Reach the Destination
▪ R3 copies the data link PPP
frame into its buffer.
▪ R3 de-encapsulates the data link PPP
frame.

▪ R3 searches the routing table for the


destination IPv4 address of the packet.

▪ Because the destination network is on


R3’s directly connected network, the
packet can be sent directly and does
not need to be sent to another router.
▪ The process outlined on the right describes what takes ▪ Because the exit interface is a directly
place when R3 receives a frame on its serial interface. connected Ethernet network, R3 must
resolve the destination IPv4 address of
the packet with a destination MAC
address by either finding it in its ARP
cache or send out an ARP request.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 47
Path Determination
▪ The primary function of a router is to
Routing Decisions determine the best path to send packets.

▪ A routing table search results in one of


three path determinations:
• Directly connected network – If the
destination IP address belongs to a
network that is directly connected to the
router, the packet is forwarded out of that
interface.
• Remote network – If the destination IP
address of the packet belongs to a remote
network, the packet is forwarded to another
router.
• No route determined – If the destination IP
address does not belong to a connected
network or is in the routing table, the
packet is sent to Gateway of Last Resort.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 48
Path Determination ▪ Determining the best path to a destination network
Best Path involves the evaluation of multiple paths and
selecting the optimum or shortest path to reach that
network.

▪ The best path is selected based on the metric or


value that is used by the routing protocol.

▪ The best path to a network is the path with the


lowest metric. A metric is a value that is used to
measure the distance to a given network.

▪ Each dynamic routing protocols has their own rules


and metrics to build and update routing tables. For
example:
• Routing Information Protocol (RIP) – Hop count
• Open Shortest Path First (OSPF) – Cisco’s cost
based cumulative bandwidth from source to
destination
• Enhanced Interior Gateway Routing Protocol
(EIGRP) – Bandwidth, delay, load, reliability
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 49
Path Determination
Load Balancing
▪ If a router has two or more paths with identical
metrics to the same destination network, the
router will forward the packets using both paths
equally.

▪ The routing table contains a single destination


network, but has multiple exit interfaces – one
for each equal cost path. This is referred to as
equal cost load balancing.

▪ If configured correctly, load balancing can


increase the effectiveness and performance of
the network.

▪ Equal cost load balancing can be configured to


use both dynamic routing protocols and static
routes.

▪ EIGRP supports unequal cost load balancing.


© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 50
Path Determination
Administrative Distance ▪ If a router has multiple routing
protocols configured and static routes,
it is possible that the routing table
might have more than one route
source for the same destination
network.

▪ Each routing protocol might prefer a


different path to reach the same
destination. How does the router
know which path to choose?

▪ The Cisco IOS uses what is known as


the administrative distance (AD) to
determine which route to install in the
routing table.
▪ Which route source is more trustworthy, Internal
▪ The AD represents the
EIGRP or OSPF?
“trustworthiness” of the route. The
lower the AD, the more trustworthy.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 51
1.3 Router Operation

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 52
Analyze the Routing Table
▪ The routing table of a router stores
The Routing Table information about:
• Directly connected routes – Obtained
from the active router interfaces.
• Remote routes – These are remote
networks connected to other routers
that are learned from dynamic routing
protocols or are statically configured.
▪ A routing table is a data file in RAM
that is used to store information about
directly connected and remote
networks.

▪ The routing table contains next hop


associations for remote networks.
The association tells the router what
the next hop is for a destination
network.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 53
Analyze the Routing Table
▪ On a Cisco router, the show ip route
Routing Table Sources command can be used to display the IPv4
routing table.

▪ Additional route information is provided in


the routing table including: how the route
was learned, how long the route has been in
the table, and which interface to send out of
to reach a destination.

▪ Sources of the routing table entries are


identified by a code:
• L - Local Route interfaces
• C - Directly connected interfaces
• S - Static routes
• D – Learned dynamically from another router
using the EIGRP routing protocol.
• O – Learned dynamically from another router
using the OSPF routing protocol.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 54
Analyze the Routing Table
Remote Network Routing Entries ▪ You must know how to interpret the
content of IPv4 and IPv6 routing
tables. The figure to the left highlights
the details for the route to the remote
network 10.1.1.0:
• Route source – how the route was learned
• Destination network – address of the
remote network
• Administrative distance – trustworthiness
of the route
• Metric – value assigned to reach the
remote network; lower the better
• Next-hop – the IPv4 address of the next
router to forward the packet to
• Route timestamp – how much time has
passed since the route was learned
• Outgoing interface – exit interface to
forward packet out of
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 55
Directly Connected Routes
Directly Connected Interfaces
▪ A new router without any configured
interfaces will have an empty routing
table – as shown in the figure.
▪ Before the interface state is
considered up/up and added to the
IPv4 routing table, the interface must:
• Be assigned a valid IPv4 or IPv6 address
• Be activated with the no shutdown
command
• Receive a carrier signal from another
device such as a router, switch, or host.

▪ When the interface is up, the network


of that interface is added to the routing
table as a directly connected route.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 56
Directly Connected Routes
Directly Connected Routing Table Entries

▪ With IOS version 15 and later, an


active directly connected interface
creates two routing table entries as
shown in the figure:
• The route source “C” identifies the
route as a directly connected network.
• The route source “L” identifies the
IPv4 address assigned to the router’s
interface.
▪ The routing table entry shows the
destination network as well as the
outgoing interface to use when
forwarding packets to the destination
network.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 57
Directly Connected Routes
Directly Connected Examples
▪ When the interfaces are configured
with an appropriate IP address,
subnetmask, and activated with the
no shutdown command, they will
be automatically added to the
routing table as shown in the figure
to the left.

▪ As each interface is added, the


routing table automatically adds
the connected (‘C’) and local (‘L’)
entries.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 58
Directly Connected Routes
Directly Connected IPv6 Example ▪ The figure to the left shows the
configuration steps for the directly
connected interfaces of R1 with the
indicated IPv6 addresses.

▪ The show ipv6 route command is


used to verify that the IPv6 networks
and specific IPv6 interface addresses
have been installed in the IPv6 routing
table.
• A ‘C’ indicates that it is a directly
connected route.
• An ‘L’ indicates it is a local route, but
with IPv6, it has a /128 prefix.
▪ The ping command can be used to
verify connectivity. For example:
• ping 2001:db8:acad:3::2
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 59
Directly Connected Routes
Packet Tracer – Investigating Directly Connected Routes

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 60
Statically Learned Routes
Static Routes
▪ After directly connected interfaces are
configured and added to the routing
table, then static or dynamic routing can
be configured.

▪ Static routes are manually configured


and define an explicit path between two
networking devices.
▪ If the network topology changes, static
routes must manually be reconfigured.

▪ Benefits of static routes include:


• Improved security
• Resource efficiency – less bandwidth
usage and no CPU cycles are used to
calculate and communicate route

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 61
Statically Learned Routes
Static Routes (Cont.) ▪ There are two main types of static routes in the
routing table:
• Static route to a specific network
• Default static route
▪ IPv4 static routes are configured using the
following command:
• ip route network mask { next-hop-ip | exit-intf }
▪ A static route appears in the routing table with
the code ‘S’.

▪ A default static route is similar to a default


gateway on a PC or host. The default static
route specifies the exit point to use when the
routing table does not have a path for the
destination network. Use the command:
• ip route 0.0.0.0 0.0.0.0 { exit-intf | next-hop-ip }
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 62
Statically Learned Routes
▪ The figure to the left shows the
Static Route Examples configuration of an IPv4 default static
route on R1 to the Serial 0/0/0 interface.
• The ‘S’ indicates that it is a static route
• The asterisk (*) identifies this as a
possible candidate to be the default route.
• Notice that this route was chosen to be
the Gateway of last resort (default route).
▪ Here are two static route configurations
from R2 to reach the two LANs on R1:
• ip route 192.168.10.0 255.255.255.0 s0/0/0
• ip route 192.168.11.0 255.255.255.0
209.165.200.225

▪ Which route was configured to use the


exit interface?

▪ Will they send packets for these


networks to the same router?
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 63
Statically Learned Routes
Static IPv6 Route Examples ▪ To configure a default IPv6 static
route, use the ipv6 route ::/0 [ipv6-
address | interface-type interface-
number} global configuration
command:
• ipv6 route ::/0 s0/0/0
• Unlike the IPv4 static route, there is
no asterisk (*) or Gateway of Last
Resort explicitly identified in the
routing table.
▪ Like IPv4, static routes are explicitly configured to reach a ▪ Use the show ipv6 route
specific remote network. For example: command to verify the static routes
• ipv6 route 2001:0DB8:ACAD:1::/64 2001:0Db8:ACAD:3::1 were installed.
• ipv6 route 2001:0DB8:ACAD:2::/64 s0/0/0
▪ Use ping to verify remote network
▪ Notice that one of these routes uses an exit interface while the connectivity from R1:
other uses a next hop address.
• ping 2001:0DB8:ACAD:4::1
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 64
Dynamic Routing Protocols ▪ Dynamic routing protocols are used by
Dynamic Routing routers to share information about the
reachability and status of remote
networks.

▪ Rather than manually configuring static


routes, dynamic routing protocols use
network discovery to share information
about the networks that it knows about
with other routers that are using the same
routing protocol.
• Routers automatically learn about remote
networks from other routers
• These networks and the best path to each
are added to the routing table of the router.
▪ Routers have converged after they have
finished exchanging and updating their
routing tables. Routers then maintain the
networks in their routing tables.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 65
Dynamic Routing Protocols
IPv4 Routing Protocols ▪ One of the major advantages of dynamic
routing protocols over static routes -
determine a new best path if the initial
path becomes unusable.

▪ Dynamic routing protocols can adjust to


topology changes without involving the
network administrator.

▪ Cisco routers support a variety of IPv4


routing protocols including:
• EIGRP
• OSPF
• IS-IS
• RIP
• Use router ? in global config mode to see
the complete list.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 66
1.4 Summary

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 67
2.1 Implement Static Routes

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 68
Static Routing
Reach Remote Networks
▪ A router learns about remote networks in two ways:
• Manually entered into the route table using static routes
• Static routes are not automatically updated and must be reconfigured when topology changes
• Dynamically (Automatically) learned using a routing protocol

Static and Dynamic


Default Routing
Routes

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 69
Static Routing
Why Use Static Routing?

Dynamic versus Static Routing

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 70
Static Routing
When to Use Static Routes
Three uses for static routes:
Stub Networks and
▪ Smaller networks that are not expected Stub Routers
to grow

▪ Routing to and from stub networks


• Stub network accessed by a single route
and has one neighbor
• 172.16.3.0 is a stub network
▪ A single default route to represent a path
to any network not found in the routing
table
• Use default route on R1 to point to R2 for
all other networks

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 71
Types of Static Routes
Static Route Applications

Use Static Routes To:


▪ Connect to a specific network

▪ Connect a stub router

▪ Summarize routing table entries which reduces size of routing advertisements

▪ Create a backup route in case a primary route link fails

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 72
Types of Static Routes
Standard Static Route

▪ R2 configured with a static route to reach the stub network 172.16.3.0/24

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 73
Types of Static Routes
Default Static Route
▪ Default route matches all packets and is used
when a packet does not match a specific route
in the routing table

▪ Can be dynamically learned or statically


configured

▪ Default Static route uses 0.0.0.0/0 as the


destination IPv4 address

▪ Creates a Gateway of Last Resort

▪ Common use is when connecting a


company’s edge router to the ISP network

▪ Router has only one router to which it is


connected

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 74
Types of Static Routes
Summary Static Route
▪ Multiple static routes can be summarized into a single network address
• Destination networks must be contiguous
• Multiple static routes must use the same exit interface or next hop
• In figure, four networks is summarized into one summary static route

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 75
Types of Static Routes
Floating Static Route
▪ Static routes that are used to provide
a backup path Floating
▪ Used when primary route is not
Static Route
available

▪ Configured with a higher


administrative distance
(trustworthiness) than the primary
route
▪ Example: EIGRP administrative
distance equals 90. A floating static
route with an AD of 91 or higher
would serve as backup route and will
be used if EIGRP route goes down.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 76
2.2 Configure Static and Default
Routes

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 77
Configure IPv4 Static Routes
ip route Command

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 78
Configure IPv4 Static Routes
Next-Hop Options

▪ In this example, each router only has entries for directly connected network

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 79
Configure IPv4 Static Routes
Next-Hop Options (Cont.)

▪ R1 does not have an entry in its routing table for the


R3 LAN network
▪ In a static route next-hop can be identified by
• Next-hop IP address
• Router exit interface
• Next-hop IP address and exit interface

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 80
Configure IPv4 Static Routes
Configure a Next-Hop Static Route
▪ In this example, only the next-hop IP
address is specified

▪ Before packet is forwarded the router


must determine the exit interface to use
(route resolvability)

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 81
Configure IPv4 Static Routes
Configure a Next-Hop Static Route (Cont.)
▪ In example, when a packet is destined
for 192.168.2.0/24 network, R1:
• Looks for match (#1) and needs to
forward packets to 172.16.2.2
• R1 must determine how to reach
172.16.2.2 first
• Searches a second time for
172.16.2.0/24 (#2) and matches to exit
interface s0/0/0
• Takes two routing table lookups,
process referred to as recursive lookup
• If the exit interface is “down” or
“administratively down” then the static
route configured with next-hop will not
be installed in routing table
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 82
Configure IPv4 Static Routes
Configure a Directly Connected Static Route
▪ Use the exit interface to specify next-hop so
no other lookups are required
▪ Administrative distance of static route is 1

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 83
Configure IPv4 Static Routes
Configure a Directly Connected Static Route (Cont.)
▪ Cisco Express Forwarding (CEF)
• default behavior on IOS 12.0 or later
• provides optimized lookup
• uses a Forwarding Information Base (FIB) which is a copy of the routing table and an adjacency table
that includes Layer 2 addresses
• no recursive lookup needed for next-hop IP address lookups

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 84
Configure IPv4 Static Routes
Configure a Fully Specified Static Route
▪ Both the exit interface and the next-hop IP address
are specified

▪ When exit interface is an Ethernet network, fully


specified static route is used

▪ Note: With CEF, a next-hop address could be used


instead

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 85
Configure IPv4 Static Routes
Verify a Static Route

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 86
Configure IPv4 Default Routes
Default Static Route
▪ Default static routes are commonly used when connecting:
• An edge router to a service provider network
• A stub router (a router with only one upstream neighbor router)

▪ Default route is used when no other routes in the routing table match the destination IP

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 87
Configure IPv4 Default Routes
Configure a Default Static Route
Any packets
not matching
route entries
are forwarded
to 172.16.2.2

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 88
Configure IPv4 Default Routes
Verify a Default Static Route
▪ show ip route static displays
just the static routes
• S indicates static route
• candidate default route indicated
by *
• /0 mask in route entry indicates
none of the bits are required to
match

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 89
Configure IPv4 Default Routes
Packet Tracer – Configuring IPv4 Static and Default Routes

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 90
Configure IPv4 Default Routes
Lab – Configuring IPv4 Static and Default Routes

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 91
Configure IPv6 Static Routes
The ipv6 route Command

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 92
Configure IPv6 Static Routes
The ipv6 route Command (Cont.)

▪ ipv6 unicast-routing
enables the router to
forward IPv6 packets

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 93
Configure IPv6 Static Routes
Next-Hop Options
▪ Each router only knows about directly connected networks
• R1 can ping R2 (ipv6 2001:DB8:ACAD:4::2) but cannot ping R3 (ipv6 2001:DB8:ACAD:3::2)

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 94
Configure IPv6 Static Routes
Next-Hop Options (Cont.)
▪ Next hop can be identified by an IPv6 address, exit interface, or both.

▪ Destination is specified by one of three route types:


• Next-hop static IPv6 route - Only the next-hop IPv6 address is specified
• Directly connected static IPv6 route - Only the router exit interface is specified
• Fully specified static IPv6 route - The next-hop IPv6 address and exit interface are specified

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 95
Configure IPv6 Static Routes
Configure a Next Hop Static IPv6 Route
As with IPv4, must resolve the route to determine
the exit interface to use to forward the packet
Three next-
hop static
routes are
configured
on R1

The IPv6 address matches the route for the


directly connected network 2001:DB8:ACAD:4::/64
with the exit interface Serial 0/0/0.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 96
Configure IPv6 Static Routes
Configure a Directly Connected Static IPv6 Route
▪ Alternative to next hop is to specify the exit interface

▪ Packet destined for 2001:DB8:ACAD:3::/64 network, forwarded out Serial 0/0/0 – no other lookups
needed

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 97
Configure IPv6 Static Routes
Configure a Fully Specified Static IPv6 Route
▪ Fully specified static route must be used if IPv6 link-local address is used as next-hop

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 98
Configure IPv6 Static Routes
Verify IPv6 Static Routes

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 99
Configure IPv6 Default Routes
Default Static IPv6 Route
▪ Default static route matches all packets not specified in routing table

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 100
Configure IPv6 Default Routes
Configure a Default Static IPv6 Route

▪ R1 is a stub router
because it is only
connected to R2

▪ More efficient to
configure a default
static IPv6 route in
this topology

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 101
Configure IPv6 Default Routes
Verify a Default Static Route
▪ ::/0 mask indicates that none of the bits are required to match

▪ If a more specific match does not exist, the default static IPv6 route matches all packets.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 102
Configure IPv6 Default Routes
Packet Tracer – Configuring IPv6 Static and Default Routes

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 103
Configure IPv6 Default Routes
Lab – Configuring IPv6 Static and Default Routes

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 104
Configure Floating Static Routes
Floating Static Routes
Floating static routes have an administrative distance
greater than the dynamic routing protocol or other
static route
▪ Used as backup routes

▪ Administrative distance of common routing protocols


• EIGRP = 90
• IGRP = 100
• OSPF = 110
• IS-IS = 115
• RIP = 120
▪ By default, AD of static route = 1

▪ Static route AD can be increased to make route


less desirable until preferred route is lost
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 105
Configure Floating Static Routes
Configure a Floating Static Route

Preferred router from


R1 is to R2 (AD = 1)

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 106
Configure Floating Static Routes
Test the IPv4 Floating Static Route

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 107
Configure Floating Static Routes
Test the IPv4 Floating Static Route (Cont.)

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 108
Configure Floating Static Routes
Configure an IPv6 Floating Static Route
▪ Similar to IPv4 floating static routes

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 109
Configure Floating Static Routes
Packet Tracer - Configuring Floating Static Routes

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 110
Configure Static Host Routes
Automatically Installed Host Routes
Host route is an IPv4 address with a 32-bit mask or IPv6 address with a 128-bit mask.
▪ Automatically installed when IP address is configured

▪ Configured as a static host route

▪ Allows more efficiency for packets directed to the router

▪ Local route marked with “L” (introduced in IOS 15)

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 111
Configure Static Host Routes
Configure IPv4 and IPv6 Static Host Routes

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 112
2.3 Troubleshoot Static and
Default Routes

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 113
Packet Processing with Static Routes
Static Routes and Packet Forwarding
PC1 sending R1 has no
packet to PC3 - specific route
Packet arrives to 192.168.2.0
on G0/0 so uses
default route

R1 Frame
encapsulates forwarded
packet in new out S0/0/0
frame

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 114
Packet Processing with Static Routes
Static Routes and Packet Forwarding (Cont.)

R2 de-
Packet encapsulates
arrives on the frame and
S0/0/0 looks for a
interface R2 has a R2
route to the static route to encapsulates
on R2 destination 192.168.2.0/24 the packet in
out the Serial a new frame
0/0/1 interface and forwards
out S0/0/1

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 115
Packet Processing with Static Routes
Static Routes and Packet Forwarding (Cont.)

• R3 encapsulates the
R3 de- R3 looks up the
packet in a new
encapsulates the ARP table entry for
frame with the MAC
frame and sees a 192.168.2.10 to find
address of the G0/0
connected route the Layer 2 MAC
interface as the
to 192.168.2.0/24 address for PC3
source Layer 2
out G0/0 (ARP used if
address and the
needed for PC3
MAC address of PC3
MAC)
as the destination
MAC address
• Frame is forwarded
out of G0/0 interface
and packet arrives
on the NIC interface
of PC3

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 116
Troubleshoot IPv4 Static and Default Route Configuration
Troubleshoot a Missing Route
▪ Common IOS troubleshooting commands
include:
• ping
• traceroute
• show ip route
• show ip interface brief
• show cdp neighbors detail

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 117
Troubleshoot IPv4 Static and Default Route Configuration
Troubleshoot a Missing Route (Cont.)

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 118
Troubleshoot IPv4 Static and Default Route Configuration
Solve a Connectivity Problem

A traceroute reveals that R2


forwards the traceroute back
to R1. R1 returns it to R2

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 119
Troubleshoot IPv4 Static and Default Route Configuration
Solve a Connectivity Problem (Cont.)

Static route to 192.168.2.0/24 has been


configured using the next-hop address
172.16.2.1.

Incorrect route is removed and the


correct route is then entered

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 120
Troubleshoot IPv4 Static and Default Route Configuration
Packet Tracer – Troubleshooting Static Routes

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 121
Troubleshoot IPv4 Static and Default Route Configuration
Lab – Troubleshooting Static Routes

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 122
2.4 Summary

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 123
3: Dynamic Routing

CCNA Routing and Switching

Routing and Switching Essentials v6.0


3.1 Dynamic Routing
Protocols

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 125
Dynamic Routing Protocol Overview
Dynamic Routing Protocol Overview

▪ RIP protocol was updated to RIPv2 to accommodate growth in the network environment
• RIPv2 does not scale to current larger network implementations
▪ Routing Protocols developed to meet the need of larger networks include:
• Open Shortest Path First (OSPF)
• Intermediate System-to-Intermediate System (IS-IS).
• Enhanced IGRP (EIGRP)
▪ Border Gateway Protocol (BGP) is used between Internet service providers (ISPs)
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 126
Dynamic Routing Protocol Overview
Dynamic Routing Protocol Components
▪ Purpose of dynamic routing protocols includes:
• Discovery of remote networks
• Maintaining up-to-date routing information
• Choosing the best path to destination networks
• Ability to find a new best path if the current path is no
longer available
▪ The main components of dynamic routing
protocols include:
• Data structures - tables or databases kept in RAM.
• Routing protocol messages - to discover neighboring
routers, exchange routing information, and maintain
accurate information about the network.
• Algorithms – to facilitate learning routing information
and for best path determination.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 127
Dynamic versus Static Routing
Static Routing Uses
▪ Networks often use both static
and dynamic routing.
▪ Static Routing is used as
follows:
• For easy routing table
maintenance in small networks.
• Routing to and from a stub
network.
• Accessing a single default route.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 128
Dynamic versus Static Routing
Static Routing Advantages and Disadvantages

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 129
Dynamic versus Static Routing
Dynamic Routing Protocols Uses
▪ Dynamic routing is the best
choice for large networks
▪ Dynamic routing protocols help
the network administrator
manage the network:
• Providing redundant paths
• Automatically implementing the
alternate path when a link goes
down.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 130
Dynamic versus Static Routing
Dynamic Routing Advantages and Disadvantages

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 131
Dynamic routing
▪ Routing Algorithm (Dijkstra / Bellman-Ford) – idealization
• All routers are identical
• Network is flat.
• Not true in Practice

▪ Hierarchical routing
• Internet = network of networks
• Each network admin may want to control routing in its own routing network.
• Hierarchical routing solves
• Scale problems.
• Administrative autonomy.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 132
Routing Protocols RIP, OSPF, BGP

▪ Dynamic protocols
• Sharing neighborhood information

▪ Use different metrics.

▪ RIP (one hop count, how many networks a packet crosses), Networks areits affiliates.
© 2016 Cisco and/or treated All rightsequally
reserved. Cisco Confidential 133
Routing Information Protocol RFC 1058
• Receive a RIP message (a response)
• Add one hop for each advertised dest
• Repeat
• If (dest not in routing table)
• Add the advertised info to the
table
• Else
• If (next-hop is the same)
• Replace with the
advertised one
• Else
▪ http://www.faqs.org/rfcs/rfc1058.html • If (advertised hop count
< one in the table)
▪ Distance vector algorithm (Bellman-Ford) • Replace entry in the
• Sharing knowledge about the entire AS routing table
• Return
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 134

• Shares only with neighbors


Initializing and Updating Routing Table

▪ Destination Metric Gateway

▪ Dest D G

▪ Rule to implement RIP based in DVA

▪ If Information is not from G


• Update to reflect minimum cost

▪ If Information is from G
• Always update

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 135
RIP message format
• RIP messages uses UDP
datagrams on port 520
• Implemented in Unix systems by
the ‘routed’ daemon.

• Size of datagram limited to 512


bytes (allow advertisement of 25
routes.

• Command: 8 bits
• Request (1), reply (2)

• Version: 1 or 2

• Family: of protocol used for


TCP/IP it is 2
• Network address : 32 bytes
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 136

• Distance: hop count from the


RIP message example

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 137
RIP timers

• Periodic timer: control advertising of regular update messages (25-35


sec)
• Expiration timer: governs the validity of a route (180 sec)
• Every time an update (on a 30 sec average) is received the timer is reset
• If no update received within this timer the metric is set to 16
• Garbage timer: 120 sec
• A route can be advertised with a 16 metric for 120 sec before it get purged
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 138
Slow Convergence Problem

Solved by limiting number of hops to 15, 16 means


That the destination is unreachable

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 139
RIP Instability

Triggered Updates

Split Horizons

Poison reverse

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 140
Border Gateway Protocol (RFC 1771)
▪ Based on the path vector routing.
▪ Distance-vector protocol not preferred for inter-AS routing (exterior
routing protocol)
• Assumes all routers have a common distance metrics to judge route
preferences.
• If routers have different meanings of a metric, it may not be possible to create stable, loop
free routes.
• A given AS may have different priorities from another AS.
• Gives no information about the ASs that will be visited.
▪ Link-state routing protocol
• Different metrics.
• Flooding is not realistic.
▪ Path vector routing
• No metrics, © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 141
BGP (continued)

▪ Messages are sent over TCP connections on port 179.

▪ Functional procedures
• Neighbor acquisition (open message, acceptance through Keepalive message)
• Neighbor reachability (periodic Keepalive messages)
• Network reachability (broadcast an update message)
• Each routers maintains a database of networks that can be reached
• + preferred route to this network.

▪ RFC does not address © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 142
BGP (cont.)

Example of Network Reachability Example of Message adverstisements

Network Next router Path


N1 R1 AS14,AS23,AS67
N2 R5 AS22,AS67,AS5,AS89
N3 R6 AS67,AS89,AS9,AS34
N4 R12 AS62,AS2,AS9

▪ Loop Prevention in BGP:


• Checks the Path before updating its
database. (If its AS is in the path
ignore the message)
▪ Policy Routing:
• If a path consist of an AS against
the policy of the current AS,
message discarded.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 143
BGP message format (Open, Keepalive,
Update, Notification

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 144
Open Shortest Path First (RFC 1247)

▪ Uses IP, has a value in the IP Header (8 bit protocol field)

▪ Interior routing protocol, its domain is also an autonomous system

▪ Special routers (autonomous system boundary routers) or backbone


routers responsible to dissipate information about other AS into the
current system.
▪ Divides an AS into areas

▪ Metric based on type of service


• Minimum delay (rtt), maximum throughput, reliability, etc..

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 145
OSPF (type of links)

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 146
OSPF (link state advertisement)

Network Link
Router Link
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 147
OSPF (LSA cont.)

Summary link to Network

Summary link to AS boundary router

External Link

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 148
Shortest Path Calculation

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 149
Types of OSPF packets and header
format

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 150
Link State Update Packet
A router link example
LSA header not covered
Refer to RFC 1247

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 151
A Network Link Example

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 152
Summary Links state Advertisements

Summary link to network

Summary link to AS boundary

External Link
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 153
3.2 RIPv2

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 154
Dynamic versus Static Routing
Router RIP Configuration Mode

▪ Use the router rip command to enable RIP v1

▪ Use the no router rip command to disable RIP

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 155
Configuring the RIP Protocol
Advertise Networks
▪ The network network-address
router configuration mode
command:
• Enables RIP on all interfaces that
belong to a specific network
• Advertises the network in RIP routing
updates sent to other routers every 30
seconds.

Note: RIPv1 is a classful routing protocol


for IPv4.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 156
Configuring the RIP Protocol
Verify RIP Routing

show ip route – displays RIP routes


installed in the routing table.
show ip protocols – displays IPv4 routing
protocols configured on the router.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 157
Configuring the RIP Protocol
Enable and Verify RIPv2
▪ Use the version 2 router
configuration mode command to
enable RIPv2
▪ Use the show ip protocols
command to verify that RIPv2 is
configured.
▪ Use the show ip route
command to verify the RIPv2
routes in the routing table.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 158
Configuring the RIP Protocol
Disable Auto Summarization
▪ RIPv2 automatically
summarizes networks at major
network boundaries.
▪ Use the no auto-summary
router configuration mode
command to disable auto
summarization.
▪ Use the show ip protocols
command to verify that auto
summarization is off.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 159
Configuring the RIP Protocol
Configure Passive Interfaces
▪ RIP updates:
• Are forwarded out all RIP-enabled interfaces
by default.
• Only need to be sent out interfaces that are
connected to other RIP-enabled routers.
▪ Sending RIP updates to LANs wastes
bandwidth, wastes resources, and is a
security risk.

▪ Use the passive-interface router


configuration command to stop routing
updates out the interface. Still allows
that network to be advertised to other
routers.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 160
Configuring the RIP Protocol
Propagate a Default Route
▪ In the diagram a default static
route to the Internet is configured
on R1.
▪ The default-information
originate router configuration
command instructs R1 to send the
default static route information in
the RIP updates.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 161
Configuring the RIP Protocol
Packet Tracer - Configuring RIPv2

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 162
Configuring the RIP Protocol
Lab - Configuring Basic RIPv2

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 163
3.3 The Routing Table

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 164
Parts of an IPv4 Route Entry
Routing Table Entries

Routing Table for R1

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 165
Parts of an IPv4 Route Entry
Directly Connected Entries ▪ Directly Connected Networks (C) are
automatically added to the routing table
when the interface is configured and
activated.
▪ Entries contain the following information:
• Route source - how the route was learned.
• Destination network – remote network.
• Outgoing Interface – exit interface used to
forward packets to destination.
▪ Other route source entries include:
• S –Static Route
• D – EIGRP routing protocol
• O – OSPF routing protocol
• R - RIP routing protocol

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 166
Parts of an IPv4 Route Entry
Remote Network Entries
▪ Routes to remote networks contain the
following information:
• Route source – how route was learned
• Destination network
• Administrative distance (AD) -
trustworthiness of the route.
• Metric – value assigned to reach the remote
network. Lower is better.
• Next hop – IPv4 address of the next router
that the packet should be forwarded to.
• Route timestamp – time since the route was
updated.
• Outgoing interface - the exit interface to use
to forward the packet

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 167
Dynamically Learned IPv4 Routes
Routing Table Terms
▪ The routing table is a hierarchical
structure that is used to speed up the
lookup process when locating routes
and forwarding packets.
▪ The hierarchy includes:
• Ultimate Routes
• Level 1 routes
• Level 1 parent routes
• Level 2 child routes

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 168
Dynamically Learned IPv4 Routes
Ultimate Route
▪ An ultimate route is a routing table
entry that contains either a next-hop
IPv4 address or an exit interface.
▪ Directly connected, dynamically
learned, and local routes are
ultimate routes.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 169
Dynamically Learned IPv4 Routes
Level 1 Route
▪ A level 1 route can be a:
• Network route - a network route that
has a subnet mask equal to that of the
classful mask.
• Supernet route - a network address
with a mask less than the classful
mask, for example, a summary
address.
• Default route - a static route with the
address 0.0.0.0/0

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 170
Dynamically Learned IPv4 Routes
Level 1 Parent Route
▪ A parent route is a level 1 network
route that is subnetted.
▪ In the routing table, it basically
provides a heading for the specific
subnets it contains.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 171
Dynamically Learned IPv4 Routes
Level 2 Child Route
▪ A level 2 child route is a route that
is a subnet of a classful network
address.
▪ Level 1 parent routes contain level
2 child routes.
▪ Level 2 child routes are also
ultimate routes.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 172
The IPv4 Route Lookup Process
Route Lookup Process ▪ Router lookup process:
• If the best match is a level 1 ultimate
route, then this route is used to forward
the packet.
• If the best match is a level 1 parent
route, the router then examines child
routes (the subnet routes).
• If there is a match with a level 2 child
route, that is used to forward the packet.
• If there is no match with level 2 child
routes, the router searches level 1
supernet or default routes. If there is a
match, that route is used.
• If there is no match found in the routing
table the packet is dropped.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 173
The IPv4 Route Lookup Process
Best Route = Longest Match
▪ The best match is the route in the
routing table that has the most
number of far left matching bits with
the destination IPv4 address of the
packet.
▪ The route with the greatest number of
equivalent far left bits, or the longest
match, is always the preferred route.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 174
Analyze an IPv6 Routing Table
IPv6 Routing Table Entries

▪ An IPv6 routing table includes directly


connected, static and dynamically
learned routes.
▪ All IPv6 routes are level 1 ultimate
routes.

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 175
Analyze an IPv6 Routing Table
Directly Connected Entries
▪ Use the show ipv6 route command to
display the IPv6 routing table.
▪ The directly connected route entries
include the following:
• Route source – How the route was learned.
Directly connected indicated with a C and L
for local route.
• Directly connected network address.
• Administrative distance – Trustworthiness of
the route (lower more trustworthy).
• Metric – Value assigned to reach the network
(lower is preferred route).
• Outgoing interface – Exit interface used to
forward packet.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 176
Analyze an IPv6 Routing Table
Remote IPv6 Network Entries
▪ The remote IPv6 route entries also
include the following:
• Route source – How the route was
learned. Common codes include O
(OSPF), D (EIGRP), R (RIP), and S
(Static route).
• Next hop - Identifies the IPv6 address
of the next router to forward the packet
to.
▪ The IPv6 router lookup process:
• Examines level 1 network routes for the
best match.
• Longest match is the best match.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 177
3.4 Summary

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 178
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 179

You might also like