One of the most basic networking courses is provided by Cisco Systems via the Cisco Networking Academy.
The academy provides a comprehensive program allowing students to get started in information technology and have multiple certifications.
Cisco created academies in 9,000 learning institutions spread across more than 170 countries that offer the Cisco Networking Academy curriculum.
The Associate level of Cisco Certifications can begin directly with CCNA for network installation, operations and troubleshooting or CCDA for network design. Think of the Associate Level as the foundation level of networking certification.
Find me on:
AFCIT
http://www.afcit.xyz
YouTube
https://www.youtube.com/channel/UCuewOYbBXH5gwhfOrQOZOdw
Google Plus
https://plus.google.com/u/0/+AhmedGadIT
SlideShare
https://www.slideshare.net/AhmedGadFCIT
LinkedIn
https://www.linkedin.com/in/ahmedfgad/
ResearchGate
https://www.researchgate.net/profile/Ahmed_Gad13
Academia
https://www.academia.edu/
Google Scholar
https://scholar.google.com.eg/citations?user=r07tjocAAAAJ&hl=en
Mendelay
https://www.mendeley.com/profiles/ahmed-gad12/
ORCID
https://orcid.org/0000-0003-1978-8574
StackOverFlow
http://stackoverflow.com/users/5426539/ahmed-gad
Twitter
https://twitter.com/ahmedfgad
Facebook
https://www.facebook.com/ahmed.f.gadd
Pinterest
https://www.pinterest.com/ahmedfgad/
1. CCNA – Routing & Switching – Semester 2 Notes
By
Ahmed Fawzy Gad
Faculty of Computers and Information (FCI)
Menoufia University
Egypt
ahmed.fawzy@ci.menofia.edu.eg
MENOUFIA UNIVERSITY
FACULTY OF COMPUTERS
AND INFORMATION
ALL DEPARTMENTS
COMPUTER NETWORKS
المنوفية جامعة
والمعلومات الحاسبات كلية
األقسام جميع
الحاسب شبكاتالمنوفية جامعة
2. Networks Materials
Course overview:
Basics about router and its internal components (hardware and software).
Basics about routing.
A look at routing table.
Routing techniques: static and dynamic routing.
Static routing overview.
Dynamic routing overview and dynamic routing protocols (RIPv1, RIPv2, EIGRP, OSPF).
3. Router Overview
Draw a diagram of two networks connected via a router.
To connect two different LANs, router is used that is responsible for the delivery of packets
across networks.
Basic functionality of a router is packet forwarding from source to destination.
Router has all of its interfaces in different networks. A single interface can connect multiple
networks but it is advanced topic.
Router basic function is routing using its routing table. Routing is mapping between input port
and output port. That is for incoming packet in one port, what is the output port to forward
packet? To find the output port, router routing table is used.
Router>>Routing>>Routing Table>>Routes>>Input-Output Interfaces
Router Components:
Router can be regarded a computer as it has the main components of any computer.
Computer has two main parts: software and hardware. Router has these components too.
For hardware, it has CPU and different types of memories including RAM, ROM, Flash and
NVRAM.
For software, router has operating system and configuration files.
CPU
CPU executes instructions in RAM. So whatever the router do must be found in RAM.
What router requires to process? Operating system, running configuration file, IP routing table,
ARP cache, packet buffering. Thus these must be first fetched into RAM before processing by
CPU.
But RAM is volatile and router requires some means of non-volatile memories.
Non-volatile memories in Cisco router are ROM, Flash and NVRAM.
Flash Memory
Used to store the complete IOS permanently.
ROM is used to store:
1. Bootstrap program
This program is used to locate full IOS and load it into RAM.
2. Scaled-down version of IOS
In case of failure to find the IOS, this version of IOS stored in ROM is used to
make the router running to be able to install a full IOS image. Example: DHCP
can be regarded an advanced feature in IOS and may not be provided by the
scaled-down IOS version.
3. Diagnostic software
During the POST process, the diagnostic software in ROM is used to check
hardware components including CPU, RAM, NVRAM, etc.
4. NVRAM
Used to permanently store the startup configuration file and can be reprogrammed easily.
Note that whatever the CPU executes must first be moved to RAM. So diagnostic software must
be moved into RAM for processing and similarly other software such as bootstrap, IOS, startup-
config, etc.
Router Bootup Process:
POST (Power-On Self-Test):
o Check router hardware components. Router loads the diagnostic software from
ROM into RAM and executes the instructions to check hardware components
including CPU and memories.
Load the Bootstrap Program
o Loaded using diagnostic software.
Locating the Cisco IOS image
o Regularly IOS is found in flash memory. But it can be found in a TFTP server. If
IOS not found, the scaled-down version in ROM is used.
Loading Cisco IOS into RAM
o Loaded using bootstrap program.
Locating the Configuration File
o The startup-config file is located using the bootstrap program in either NVRAM
or a TFTP server preconfigured on the router. If the startup-config is in located
successfully, it will copied into RAM and used as the running-config file. If not
found, the user is asked to enter setup mode which is a series of questions to
create a basic configuration. If not entered setup mode, the router creates a
default running-config file.
Loading the Configuration File
o After locating the startup configuration file, the IOS loads it into RAM and
becomes the running configuration file. If the startup configuration file can`t be
found, the router asks the user to enter setup mode.
o Setup mode is a series of questions allowing basic router configuration such as
hostname, router password, secret, virtual terminals password, etc. When no
startup configuration file is located in NVRAM/TFTP server and user not entered
setup mode, the IOS will create a default running configuration file that contains
the basic router configuration such as a default hostname Router, no
passwords, etc.
o After successfully checking both hardware and software components in the
router, the router is ready for configuration. The router will enter the user EXEC
5. mode with the command prompt Router> as the entry point to the router
configurations.
To check the hardware and software components of a Cisco router, use the show version in
user/privileged EXEC mode.
Router configuration
Device mode of operations:
Setup Mode
User Executive Mode
6. Privileged User Executive Mode
Global Configuration Mode
Interface Configuration Mode
Sub-interface Configuration Mode
Line Configuration Mode
Router Configuration Mode
ROM Monitor Mode
For each mode, there is some information to know:
What is this mode used for
How to enter this mode
Mode command prompt
Mode commands
How to go to higher and lower modes from this mode?
Cisco IOS is a modal OS and has a hierarchical structure. That is it has different modes of
operation.
Each mode has its domain/scope of operation and set of commands to specify how to configure
its scope of operation. Each mode has its distinctive command prompt. It is called command
prompt because the IOS is prompting you to make an entry.
Every prompt begins with the device name and remainder of the prompt describes the mode.
The prompt changes to reflect the current mode of operation.
Some commands are available to all modes and some commands can be applied only after
entering the corresponding mode.
Some modes may require authentication but the user executive mode does not require.
Top to bottom, the IOS primary modes are:
User executive (EXEC) mode: Router>
Top at the modal hierarchical structure and the entrance to the IOS configurations. It
provides very limited monitoring commands so it can be called view-only mode.
It does not have commands that change configuration but just view the configuration so it is
harmless mode.
No authentication is required to access the user EXEC mode.
Its command prompt is identified by the > symbol. Examples: Router> or Switch>.
Examples of operations available in this mode:
Show commands but they are limited. It can`t show the running or startup configuration
files.
Ping
Traceroute
7. For security, Cisco IOS separates user access in two levels. As no users accessing the router can
manage and configure the router. Some users are required only to view some configurations in
the router.
Privileged executive (EXEC) mode A.K.A. Enable mode: Router#
Entered using enable command at user EXEC mode.
This mode provides access to view all router configurations in addition to some commands that
change some router configurations.
Some commands work on both user and privileged EXEC modes but privileged mode has higher
privileges than user mode. It is similar to administrator in Windows.
Can be viewed as the root of the IOS. Users logged on in the privileged executive mode can
access the entire IOS command structure.
It can be configured for authentication.
It is the entry point to other modes.
Its command prompt is identified by the # symbol. Examples: Router# or Switch#.
Privileged EXEC mode contains all user EXEC mode commands and more.
Examples of operations available in this mode and not in user executive mode:
All show commands are available
Copy the running configuration file to the NVRAM copy running-config startup-config
Erasing the startup configuration file erase startup-config
Debugging for errors
Deleting files
Reloading router
Global configuration mode: Router (config)#
Entered using configure terminal privileged EXEC mode command.
Commands applied in the global configuration mode apply to the entire router neither to a
specific routing protocol nor a specific interface but to all routing protocols and interfaces.
Its command prompt is identified by the (config)# symbol.
Examples: Router (config)# or Switch (config)#.
Examples of operations performed in this mode
Router hostname
Router password
Router secret
Global configuration mode is the entry point to other specific configuration modes.
Other specific configuration modes: Router (config-mode)#
Interface Configuration Mode: Router(config-if)#
Entered using interface type number command at global configuration mode.
Router Configuration Mode: Router(config-router)#
Entered using router routing-protocol command at global configuration mode.
8. Line Configuration Mode: Router(config-line)#
Configure lines (physical or virtual) such as Console, AUX, VTY, etc.
The user EXEC mode can be accessed on the router via:
1. Console Port
2. AUX Port
3. Telent (VTY) (Remote access)
As a way of security to prevent all configuration vulnerabilities, it is recommended to configure
authentication to access these router access ways.
The EXEC mode for security is divided into two modes (User EXEC and Privileged EXEC modes).
The user EXEC mode is for normal user and privileged EXEC mode is for admin users that are
authorized to access the system.
The user EXEC mode is just a view-only mode that contains a set of show, ping, traceroute
commands and other viewing commands but privileged EXEC mode provides facilities to change
configurations and has more show commands. It is the key to access the other configuration
modes.
Both have many similar commands such as show commands. Example: show ip route
To toggle between the user and privileged EXEC modes, use enable and disable.
Note that commands entered in the global configuration mode update the running
configuration file as soon as they are entered. But these changes are not saved into the startup
configuration file until copying the running configuration file into startup configuration file using
the privileged EXEC mode command copy running-config startup-config.
Rom Monitor Mode: rommon ‘num’ >
This mode is entered using the Break key.
The command prompt has a number that indicates the number of commands entered. It
defaults to 1.
The ROM monitor is the bootstrap program used to initialize the hardware and loads the Cisco
IOS when the router is powered on or reloaded.
The ROM Monitor mode is used to:
Manually loading a system image for testing, upgrading, etc.
Moving around configuration modes
logout: Log off the router and exits user EXEC mode.
enable : user EXEC to privileged EXEC
disable: privileged EXEC to user EXEC
exit: enters previous mode.
9. end: returns to privileged EXEC mode
CTRL-C: interrupts any command entry and returns to privileged EXEC mode.
CTRL-Z: return to privileged EXEC mode but can`t interrupts current operations. Equivalent to
end command.
CTRL-Shift-6: interrupts CLI when it is unresponsive such as ping, traceroute, DNS lookups, etc.
To disable DNS lookup Router(config)#no ip domain-lookup
CTRL-R: redisplay the line after IOS outputs a message that interrupts it. To disable logging from
affecting outputs:
configure terminal
line console 0
logging synchronous
reload: restart IOS and restore previous startup-config.
erase startup-config: deletes startup-config file from NVRAM and decompress the stored
startup-config file from IOS.
copy startup-config running-config
copy running-config startup-config
Notes:
After entering the global configuration mode, any further specific mode will have its
command prompt as follows hostName(config-modeName)# such as interface
configuration mode Router(config-if)#
To get help and view all commands in a mode, press ?. It can show what is the valid
completions for the written characters such as sh?.
To allow the router to autocomplete a command, type a distinctive part of the
command then press Tab that will complete a partial command.
CTRL+C interrupts current operations but CTRL+Z not. When the router asks a question
such as copy running-config startup-config, CTRL+C can interrupt this operation but
CTRL+Z not.
Cursor movement flexibility
o CTRL+A: Moves the curser to the beginning of the line.
o CTRL+E: Moves the curser to the end of the line.
o Up and Bottom arrows: Moves forward and backward in the command stack.
o CTRL+U, CTRL+X: erase all characters from the curser to the beginning of the
line.
o CTRL+W: Erases the word to the left of the curser.
CTRL+R/I/L: Redisplays the line after a console message.
Break Keys: CTRL+C, CTRL+Z, CTRL+Shift+6
10. Basic Configurations
Naming device
o Device name is important because it can be used to access the device remotely
using Telnet or SSH.
o To reset hostname, use no hostname
Banner message
o Used to show that only authorized users can access the device not welcoming
an unauthorized user that can damage the device.
o There are different types of banner messages but the most common is message
of the day (MOTD) banner. It uses delimiters for the start and end of the
message. First occurrence indicates start and second occurrence indicates end.
The delimiters should not be used within the message body.
o Text has a maximum length of 80 characters and maximum of 40 lines.
o There is also exec and login banners.
Banner motd **
Unauthorized access not allowed
**
Limit device access
o Device should be configured with passwords to limit access and close any
vulnerabilities.
o First check for the number of console and VTY ports in the router in the
configuration file.
o Console Password
The console port can be used to plug in a cable to the router to gain
access. It should be secured by a strong password.
The login command enables password check on the line. If not used,
there will be no password check.
It can be secured in the line configuration mode as follows:
Router(config)# line console 0
Router (config-line)# password password
Router (config-line)# login
o Virtual Terminals - Virtual TeleType (VTY)
The number of VTY terminals depends on the IOS version.
Router(config)# line vty 0 4
Router(config-line)# password password
Router(config-line)# login
11. o Securing access to privileged EXEC mode
Router(config)#enable password password
Router(config)#enable secret password
If both are enabled, the secret is used.
Encrypting Password Display
o To encrypt the passwords from being displayed in the running configuration file,
use the global configuration mode command service password-encryption
o The no version of this command doesn`t decrypt the passwords.
o The passwords are only encrypted when being viewed in running configuration
file but not when sent over the media.
DNS lookup problem
o IP domain name lookups or IP DNS resolution is enabled by default.
o To Telnet a router from another, just write its IP address or its name. A packet
will be sent to the DNS to resolve the name to an IP address.
o But what if no DNS was installed in the network? The DNS request made by the
router to connect the remote router will have no recipient. This will take time
while the router trying to translate the name to IP address before the request
times out and return back to the command prompt. So when no DNS is installed
in the network, it is preferred to disable IOS DNS lookups. Note that disabling
DNS lookups using the no ip domain-lookup global configuration mode
command just disables DNS packets generated by Cisco IOS software. DNS
packets (requests/responses) for end users will not be affected and will be
routed correctly.
These configurations are general router configurations. For the router to start forwarding
packets, it must know its directly connected networks by configuring its interfaces.
Router ports and interfaces
There is a brief difference between ports and interfaces that is router port is used for
management and administrative access but router interface is used for sending and receiving
user traffic but they can be used interchangeably.
12. Management Ports:
Used to manage the router but not to packet forwarding. The most common used management
port is the console port that is used to attach a PC for configuration.
Interfaces:
Interfaces are used to send and receive user traffic. As router is used to connect different
networks, there are different interfaces to connect these networks.
Two major interface types are:
Start by saying that LAN uses Ethernet (10 Mbps), Fast Ethernet (100 Mbps), and Giga Ethernet
(1000 Mbps) LAN interfaces but WAN uses serial interfaces.
But why using different technologies for LAN and WAN? Is it possible to use LAN technology in
WAN interfaces?
Ethernet interfaces provide high bandwidth compared to serial interfaces but it can`t cover
distances longer than just one kilometer.
LAN interfaces have MAC address and participate in ARP process.
There are different WAN serial connection types (leased lines, circuit/packet switching).
For leased lines, it is a dedicated link between customer and service provider. It does not require
MAC address and not participates in ARP process.
Signals passed from one point to another are encoded into signals for transmission over the
leased line (telephone line).
There are different encapsulations to use in leased lines (PPP, HDLC).
Give brief information about the term encapsulation and how it is relevant in packet forwarding
process.
HDLC is Cisco default encapsulation protocol applied for WAN serial interfaces. It is with Cisco
devices only but PPP can connect different devices from different vendors.
As a summary, both LAN and WAN interfaces have IP address and subnet mask. LAN interfaces
only have MAC address but WAN interfaces not require MAC address and use broadcast MAC
address as destination MAC address.
Q. Why LAN interfaces use MAC address and WAN serial interfaces not use MAC address?
For leased lines serial interfaces, there are two devices used:
Data Terminal Equipment (DTE)
Data Communications Equipment (DCE)
Tip: Use a graph showing that the two devices use different data rates while transmitting data
using a sine wave signal.
13. The two routers will transmit signals to each other at different rates. One of them must be the
master that determines the appropriate data rate of transmission and other is slave that
transmits data over that rate.
LAN interfaces:
LAN interfaces such as Ethernet, fast Ethernet, and Giga Ethernet are used to connect
the router LAN similar to what PC NIC do. Each LAN interfaces will have a MAC address ad
participates in the ARP process.
WAN interfaces:
WAN interfaces are used to connect router to external networks. WAN uses serial
interfaces. Usually WAN interfaces are used to connect the router to ISP.
There are different WAN serial connection types:
Leased lines (PPP, HDLC High-level Data Link Control)
Circuit Switching (ISDN Integrated Services Digital Network)
Packet Switching (Frame Relay)
Most WAN links are PPP as only two devices are connected. For this reason, WAN interfaces do
not use the layer 2 address as LAN interfaces and the layer 2 address field is not used and the
WAN interface doesn`t participate in ARP process.
WAN point-to-point serial interfaces use layer encapsulation based on the interface type and
the medium technology used such as PPP, HDLC, etc.
The most common WAN is the one used to connect ISP.
Thus both LAN and WAN interfaces has IP address and subnet mask but LAN interfaces also has
MAC address and WAN interfaces use a broadcast MAC address when creating a packet.
Cisco uses WAN Interface Card (WIC) that allows devices like a router to transmit data over a
WAN. There is a more enhanced version of WIC called High-speed WAN Interface Card (HWIC).
Ethernet interfaces are used to connect to LANs.
Serial interfaces are used to connect to WANs.
Regular Ethernet cables use copper and cover a distance of a maximum of 1 kilometer. Because
it cover short distance, it is not suitable for WAN connections and only used for LAN
connections. Serial cables are used for WAN connections for that reason as it covers longer
distances.
Another reason using serial links is simplicity as it provides point-to-point communication and
not requires layer 2 addressing.
Serial ports are used in WANs because they are programmable. Distance and availability are
other factors.
14. Serial ports provides data rate of 2Mbps but Ethernet provides higher data rates.
Ethernet can cover short distances and go up to 100 meters because Ethernet links are
expensive than serial.
Serial can go to longer distance because it transmits 1 bit at a time.
When starting in networking, it is more convenient to just know that each router interface
belongs to a different network IP address with different subnet mask.
Interface numbers
How to know the numbering used in the interfaces such as 0/0 or 0/0/0? Check for that in the
running configuration file.
How this numbering works is advanced and can be given if there is time.
Advanced Topic
How interfaces are numbered?
For a modular router, it has modules and each module has a number of slots in addition to
some native interfaces.
The native interfaces are Ethernet, Fast Ethernet, or Giga Ethernet.
Slots are used to add WIC to the router. Each WIC holds a number of WAN interfaces. To refer to
a specific interface inside a WIC inside a module, first specify its WIC number then its number
inside the WIC.
Modular router has this numbering for its interfaces: type slot/number where slot refers to the
module number such as fastethernet 0/0.
So for a modular router, it has a number of slots and each slot has a number of interfaces.
For a large modular router, there are a number of slots, each slot has a number of subslots and
each subslot has a number of interfaces. This allows for greater expansion.
Interface numbering for such a router will include a number for the lot, a number for a subslot
inside the slot and a number for the interface inside the subslot such as serial 0/0/0.
Slot and interface numbering starts and increases from right to left, bottom to top:
If 5 If 4 If 3 If 2 If 1 If 0
Slot 5 5,5 5,4 5,3 5,2 5,1 5,0
Slot 4 4,5 4,4 4,3 4,2 4,1 4,0
15. Slot 3 3,5 3,4 3,3 3,2 3,1 3,0
Slot 2 2,5 2,4 2,3 2,2 2,1 2,0
Slot 1 1,5 1,4 1,3 1,2 1,1 1,0
Slot 0 0,5 0,4 0,3 0,2 0,1 0,0
Interfaces are numbered based on the router physical configuration. Note that a router can
have modules and these modules contain interfaces.
For a fixed configuration, the router is not modular and has fixed physical layout. So each
interface has its module and can`t be changed. So it has interface numbering follows type
number naming convention such as Ethernet 0.
Router 2620 uses two numbers serial interface numbering.
Router Interface Configurations
Previous configurations are general.
To make the router prepared for routing packets among different networks, it must at first know
its directly connected networks.
So all router interfaces must be correctly configured by IP addresses and subnet masks.
16. Router interfaces (directly connected networks) are the way to access other remote networks. If
the directly connected networks are not appropriately configured, then the router will not be
able to find remote networks as it depends on them.
So routing configurations will have two basic steps:
1. Directly connected networks configurations
2. Remote networks configurations
For the data to be transmitted over the leased lines it needs to be converted to the appropriate
signal for transmission over the leased line.
DTE is the device like a computer that receives data from end user and converts it to signal for
transmission over the leased line.
After the signals get received at the DCE which is the service provider, it will be decoded. DCE is
like a modem.
Data is transferred between two routers at a specific frequency. The two devices must agree on
that frequency. If they used two different data rate the transmission won`t work.
One device will take control over the link to specify the data rate which is the clock. That is the
DCE.
Configuring directly connected networks
Tip: Draw a router with two Ethernet interfaces connecting different networks.
By default, interfaces have a status that is administratively down and line protocol that is down.
Status reflects if the interface is in shutdown or no shutdown mode.
Line protocol reflects the connection status.
17. When the interface is connected to another interface that is in no shutdown mode, the line
protocol is up because the two devices keep sending keep-alive messages to reflect that they
exist and operations. When the interface is not connected to another interface, the keep-alive
messages are not exchanged between the devices and thus the line protocol is down.
Ethernet and serial interfaces status is up if they are in no shutdown mode.
Ethernet interfaces have line protocol up if:
1. Interface is connected to another operational device.
Serial interfaces are up if:
1. Interface is connected to another serial interface
2. Clock rate is set in the DCE
Note that you need to know interface numbers and types in the router. This information is
found in the running configuration file.
When connecting two interfaces, there are two ways to choose the connection type:
Automatic
Manual
For automatic way, the type of cable is determined automatically based on the device and
interface types. In this way, the specific interface number used in the connection is unknown.
Also when connecting two serial interfaces automatically, no information can provide which one
is DTE and which is DCE besides not knowing the interface numbers used.
To know it, just allow the port numbers to appear from the Options>Preferences> Always Show
Port Labels. The DCE will have a clock appearing with interface type and number used.
In the manual way, NA must select the right LAN cable type based on the device and interface
types among these types:
LAN: Straight through: Order of colored pins is identical in each cable end.
LAN: Cross over: Pin 1 connected to pin 3 and pin 2 connected to pin 6.
WAN: Serial DCE: The first connection end is DCE and the other is DTE.
WAN: Serial DTE: The first connection end is DTE and the other is DCE.
In this way, the NA knows the interface numbers used and which one is DCE and DTE in case of
serial.
Q. How to say that the LAN connection is straight through or cross over?
The normal LAN has the following topology:
PC/Server/Printer – Switch/Hub — Router – Access Point
All of these connections are straight through.
Anything else is cross over: PC/Server—Router, Switch—Switch, PC – AP, etc.
18. Another way to know connection type:
Hub & switch are category one devices. Router, printer, access point, server are category two.
(Category one – category one, category two – category two) -> Cross over cable.
(Category one – category two) -> Straight through cable.
Also which interface in the PPP serial link is DTE and which is DCE is known using the show
controllers serial number.
For each interface, a number of configurations are required to be used:
IP address
Subnet Mask
Enter the no shutdown mode for the interface
If there is a point-to-point serial connection, the DCE must be configured by the clock rate. The
clock rate must be one of the already existing clock rates.
To change the interface configuration such as changing IP address and subnet mask, two
independent unordered operations must be configured: shutdown and remove IP and subnet
mask then make the new configurations then no shutdown the interface.
1. shutdown
2. no ip address
3. ip address address subnet-mask
4. no shutdown
Note that each interface must be configured in a different network. IOS allows configuring two
different interfaces in the same network; the new interface will not be active.
The logging messages after interface status get changes can affect command entry. To get rid of
such effects:
Logging synchronous
CTRL+R/I/L: Redisplays the line after a console message
To view interface status:
show interfaces
show interfaces type number
show ip interface brief
The most important step in routing is to correctly recognize direct networks and making sure it
works. One way to make sure that this works is using ping. Devices in the same LAN can ping
themselves.
19. After successfully configuring directly connected networks, there is a route in the routing table
that make router able to access them. Use show ip route to know networks that can be
accessed by the router.
What if a device in one LAN needs to access a device in a different LAN? The router checks its
routing table for route to access the destination LAN.
If router try to ping to a network not listed in the routing table, ping fails. Use CTRL+Shift+6 to
stop ping.
Routing is the process of creating these routes.
Configuring access to remote networks
There are two ways to configure router how to access remote networks:
1. Static
2. Dynamic
Static Routing
Router(config)#ip route network-address subnet-mask {ip-address | exit-interface}
Static route can be configured using exit interface or IP address of next hop.
Using next hop IP address
Next hop is a routing term refers to the next closest router to use to forward a packet to its
destination.
Create an example that shows how to make a static route using exit interface and next hop IP
address and show differences.
Static route using exit interface makes the destination network in the route appears as if it was
directly connected.
Using next hop IP address adds another step that resolves the IP address to exit interface:
1. Router makes a routing table lookup to find the route mapping the destination IP
address to exit interface.
2. After finding the exit interface, packet will be sent via that interface.
If using the exit interface, just data will be sent over the exit interface.
Example:
S 10.0.0.0/24 [1/0] via 20.0.0.2
So to reach a destination network, the network IP address must be resolved into an exit
interface. This is known as route resolvability.
When the router makes two routing table lookups before forwarding a packet, this is called
recursive route lookup.
What happens if an interface is went down?
The directly connected network via that interface will be removed from the routing table.
20. Also the remote networks that are reachable via that interface will be removed from the
routing table.
But this information is still in running configuration file. When the interface is up again, all of
these routes (directly connected & remote) will be installed again in the routing table.
Static route must be configured in both ways. For example, from R1 to R2 and from R2 to R1.
Modify a route
To modify a static route, remove it completely then create a new one using the no ip route
network-address {exit-interface next-hop-ip} global configuration command.
Note the difference between modifying the interface IP address and modifying a static route.
To modify an interface, it is not required to specify the IP address and subnet mask specifically
and just use no ip address command. This is because there is only one IP address and using the
no ip address command implicitly asks to remove the IP address of that interface.
But to modify a route, it is required to specifically type the route information such as network
address. This is because there are may be more than one route established and it is required to
know which route is required to be modified.
Verify static routes
show running-config
show ip route
show ip route static
ping
traceroute
debug ip routing
Debugging
When a new route is added or deleted, the IOS shows a message about that route. The debug ip
routing activates routing debugging over the router.
To disable debugging of routing processes, use no debug ip routing or no debug but this
disables all debugging processes not only for routing.
Route Summarization
Create a topology similar to the one in the image below.
Normally there is a route for each destination network in the routing table. Suppose that there
is a large number of networks such as 1000 network that are required to be accessed, it is
tiresome to create a route for each network separately.
21. A better solution is to create a single route that works for different networks. This route is called
a summary route.
But there are some criteria to create a summary route:
1. The networks can be summarized into a single network address
2. All routes required to be summarized must use the same exit interface or next hop IP
address
Make an example when a summary route is valid.
Make two examples when a summary route can`t be created due to:
1. Accessing destination networks will use different exit interfaces or next hop IP
addresses.
2. Networks can`t be combined into a single network address.
How to create a summary route?
How to replace different addresses by a single address?
Find the byte at which the addresses change. Write this byte in bit representation then find the
first bit at which change appears. All bits before that bit will be assigned to network address.
For example:
10.10.1.0/24, 10.10.2.0/24, 10.10.3.0/24 all of these addresses match in the first three bytes
and change beginning from the third byte. Then write the third byte as bits as follows:
00000001
00000010
00000011
This byte matches in the first 6 bits and change from the 7th
bit. Thus the new network address
will have 3 bytes + 6 bits and subnet mask will have the prefix 22.
New network address is 10.10.0.0/22. That is has subnet mask of 255.255.252.0.
Notice that all the three addresses are also part of that new summarized address.
Configuring a summary address
After calculating the summary address, add the summary route without removing the previous
individual routes.
Q. Which route will be matched: summary or the individual?
Ans. The most specific route in the routing table will be used. To make sure that this works,
make the summary route forwards its packet to null0 interface. Try to ping one of the networks
accessed via individual in addition to summary route, the packet will be received successfully.
This means that the summary route is not matched.
Thus the most specific route is used.
22. Remove the previous routes then create this route using the same exit interface or next hop IP
address used by these three addresses previously.
Advantage of summary route is to make the routing table simpler and have less number of
routes.
Note:
Null0 interface is a logical interface that is always up/up state. It can be used to drop packets if
there is no matching route in the routing table.
Default static route
When there is no specific route matched, the default route is used.
It is a route with all zeros in network address and subnet mask.
ip route 0.0.0.0 0.0.0.0 {exit-interface|next-hop-ip}
It is called quad-zero route.
Marked as S* in the routing table.
Try to apply the default route on one router.
How router matches between destination IP address and its routes in
routing table?
1. Source sends a packet to destination via router (interface configured as default
gateway).
2. Router forwards packet using network address only. Find network address of the
destination using its IP address and subnet mask.
3. Convert network address to binary.
4. Match this binary address with the network address in each route sequentially until
finding a match. Use the first match and stop after it.
Example:
24. There are two ways to configure router how to access remote networks:
1. Static
2. Dynamic
Dynamic and static routing comparison
Understanding static routing will require answering these questions:
What are the limitations of static routing?
What are the benefits of static routing?
How can the benefits be used to create useful applications?
Using static routing, to add any network to the routing table the NA must manually create a
route for that network.
Static routing has a number of disadvantages:
Suitable only for small networks – partially solved using summarization
o Requires complete knowledge of the entire network but it is very difficult to
know the network address of a large number of networks
o Time used to add route for different networks
Maintenance adds heavy burden on NA to fix. For example, changing the addressing of a
given network will require that NA will change the route to that network in all other
routers.
Lakes flexibility to network changes
o If there is a failure in the network, it doesn`t act to the change until NA
intervention
o Single error in a route can affect the whole process. There are a large number of
IP addresses and subnet masks to add for different networks. A single failure
can make the whole process erroneous
o If a high speed link added between two devices, static routing can`t use it until
NA intervention
Static routing has a number of advantages:
Minimal resources usages
o Dynamic routing protocols consumes router CPU processing time and memory
to know remote networks and send routing updates
Easier for NA to remember and understand
Easy to configure for a small network
More secure
o Doesn`t send routing information over the network
Static routing usages:
Small network that doesn`t grow
Stub networks
25. Default route
Dynamic routing protocols classification:
IGP or EGP
Distance vector and link-state
Classful or classless:
o Classful is restricted to address classes and doesn`t differentiates between
subnets from the same class. Does not send subnet mask in its updates
o Classless can differentiates between subnets from the same class. Send subnet
mask in its routing updates
IP classes review:
A: 8 bits for network with subnet mask 255.0.0.0
o First bit is 0
o 1-127
B: 16 bits for network with subnet mask 255.255.0.0
o First two bits 10
o 128-191
C: 24 bits for network with subnet mask 255.255.255.0
o First three bits 110
o 192-223
Common routing protocols and their classification:
RIP: Routing Information Protocol Distance vector routing protocol
o RIP 1.0: Classful IPv4
o RIP 2.0: Classless IPv6
o RIPng: Classless
OSPF: Open Shortest Path First link-state classless routing protocol
o OSPFv2: IPv4
o OSPFv3: IPv6
IGRP: Interior Gateway Routing Protocol distance vector classless routing protocol
EIGRP: Enhanced Interior Gateway Routing Protocol advanced distance vector classless
routing protocol
IS-IS: Intermediate System to Intermediate System link-state routing protocol
BGP: Border gateway Protocol path vector exterior routing protocol
Component of any dynamic routing protocol:
1. Data structures: Routing information such as tables and databases stored in RAM
2. Routing protocol messages: Uses messages to exchange routing information
3. Algorithm: Routing protocols uses algorithm to process the routing information and
select best path to any destination
26. Explain it by connecting two routers with each router having the same routing protocol. The
router firstly knows only its directly connected networks that are stored in a data structure in
RAM. Next using messages, it exchanges routing information about remote networks and stored
in data structures in RAM. Finally algorithm is executed over the routing information collected
to find the best path to remote networks.
Routing protocol must provide the following:
Functionality for sending/receiving routing updates
Calculate the best path for each network and install routes into routing table
Detecting and reacting to network changes
Routing protocol characteristics:
Time of convergence: Time required for all routers in the network to have the stable
network information
Scalability: How large the network that the routing protocol can support.
Classless (use VLSM) or classful: Classless routing protocols include the routing protocol
in the routing updates
Resource usage: CPU, memory, link bandwidth usage.
Implementation and maintenance: The level of detail required for the NA to implement
and maintain the network topology.
Useful terms:
Convergence
Metrics
Administrative Distance (AD)
Convergence
A network state at which the routing tables in all routers are in a state of consistency.
When there is a change in a point in the network, all routers must exchange the new
information and update their routing tables.
The time of convergence depends on the speed of routing information propagation and
calculation of new best paths.
To explain convergence, draw a network with 4 routers and show operations required to make a
state of convergence. Then make a change to explain convergence.
Metrics
Metrics are used when:
27. Two routes to the same destination network are known using the same routing protocol
to determine which route to use.
To explain metrics, connect two routers with two routes with one and two hops. First case is
that the routes are known from different routing protocols. Second case is that the routes are
known from the same routing protocol.
There are different metrics to be used:
Hob count: Number of routers a packet traverse to reach the destination
Bandwidth: Highest bandwidth
Delay: Time taken to deliver a packet
Examples:
If routes learned using RIP with different metrics, the one with low metric is used and
the others are deleted.
If two routes learned using RIP with the same metric, both stay in routing table. In this
case load balancing take place. Show an example how this can take place using hob
count as a metric.
If routes learned using different routing protocols, the route of the routing protocol with
least AD is used and the others are deleted.
Administrative distance (AD)
What if there are two routes known using different routing protocol:
When two routes to the same destination network are known using different routing
protocols, which route to use is determined using the administrative distance (AD).
AD is a value from 0 to 255. The lower the value, the more preferred the route.
Default administrative distances:
Directly connected >> 0
Static >> 1
RIP >> 120
OSPF >> 110
EIGRP >> 90
AD of a directly connected network has the value of 0 and can`t be changed.
Static route always are the most preferred way that a NA want packets to be forwarded
through. Thus it has a small AD of 1.
It is possible to change AD for static and dynamic routes.
To view AD/metric, use the show ip route command. For example:
R 192.168.8.0/24 [120/2] via 192.168.4.1, 00:00:26, Serial0/0/1
AD is the first number in the square brackets and metric is the second one.
28. The AD/metric of a directly connected network and static routes configured using exit interface
are not shown by default in the show ip route command output.
To view the AD/metric of them, use the show ip route [route] command.
This is not supported by all router models such as 1841 and 1941 but supported by others such
as 2620.
Q. Why not using metrics rather than administrative distance to compare different routes
known from the same routing protocol?
Ans: Because different routing protocols use different metrics such as hob count by RIP and
bandwidth by OSPF. It is not possible to compare units that doesn`t match.
Distance vector routing protocols:
RIP
IGRP
EIGRP
Routing Information Protocol (RIP)
It is an application layer protocol that uses port number 520.
29. It is a distance vector routing protocol. It is called vector because the direction is required.
Direction is the exit interface or next hop IP address. It has the distance word as it uses the
distance as metric to find the best destination.
RIP has the following characteristics:
Application layer protocol with port number of 520
Use UDP as its transport layer protocol
Distance vector routing protocol
Its AD is 120
Use hop count as a metric
Can`t create a route to a network with metric greater than 15 hob counts thus it is not
scalable
Routing updates are sent every 30 seconds by default
Not aware of network topology. It doesn`t have knowledge about the entire network.
All it knows is the direction (exit interface or next hop IP) to forward packets to the
destination network and the distance to the destination network.
RIP is multi-vendor protocol
Slow convergence time
Low resource usage
Simple implementation and maintenance
RIP 1.0 is Classful and RIP 2.0 is classless
Problems in RIP:
Send periodic updates regularly every 30 seconds even if no changes made in the network.
If there is a change in the network, it may stay 30 seconds to know that change.
Configuring RIP 1.0
Before configuring a routing protocol in a router, it is required that the router knows its directly
connected networks.
To enable a routing protocol, it is required to enter the router configuration mode.
Router(config)#router rip
This command just enters the router configuration mode to configure RIP but not activates RIP
on the router.
To remove RIP from the router, use the no router rip command
Routing protocols are used to send routing information about their networks to remote
networks rather than manually creating them.
Thus it is required to make the router know which networks it advertises to other routers.
30. To give the router a network that it will send its information to other networks, use this
command:
Router(config-router)#network directly-connected-classful-network-address
This command performs the following:
1. Activates all interfaces configured in that network for RIP operation. These interfaces
will send and receive routing information.
2. Advertises that network in its routing updates every 30 second.
show ip protocols
View networks RIP advertises
View networks RIP learned
Interfaces used
Passive interfaces
Next hob IP address of routers that are sources of routing updates
Commands:
show ip protocols : To know all routing protocols running in the router
show ip route
show ip route rip
show ip rip database
Understanding how RIP works:
Draw a network of two routers connected serially. Each router has one LAN.
Write down the directly connected networks above each router.
Then the remote network in each router will be learned as follows:
Each router will send its routing information from all of its interfaces configured with the
network command.
Thus to make a remote network knows about router directly connected networks, that router
should allow routing information to be sent via the interface connected to that network. To
activate the interface the classful network address of that interface is used.
When a router receives routing information from an interface, it will know that to access that
network use that interface to send data. Thus it knows the direction. To know the distance, it
31. will use the hop count field in the packet. So it will add a route that maps the destination
network address with the exit interface.
Give another example with three routers connected in series.
RIP doesn`t send subnet masks in the routing updates. So how it knows the subnet mask of a
given network address?
It works as follows:
If the network address received by an interface belongs to the same classful subnet, the subnet
mask of that interface is used rather than the classful subnet mask.
If the network address belongs to another classful subnet than the interface, the classful subnet
mask is applied to that interface not the interface subnet mask.
Generally, if a destination network address is in different class than the interface, the classful
subnet mask is used.
Passive interfaces
Not all interfaces are connected to RIP routers but still send routing updates over these
interfaces.
To stop sending routing information over passive interfaces:
Wrong solution: Just use no network network-address because it will stop sending it to other
routers.
Right solution: Declare that interface as passive:
Router(config-router)# passive-interface interface-type interface-number
View passive interfaces: show ip protocols
Because RIP1 is classful, any subnet address will be converted to its classful address. So the
network 192.168.1.0/26 will be converted to 192.168.1.0/24
Thus all subnets configured in different interfaces will be converted to its classful address.
RIP automatic summarization
RIPv1 automatic summarization is enabled by default and can`t be disabled.
When routing information is sent over different classful subnet, RIPv1 summarizes all of these
networks to a single address with a classful subnet mask.
Q. What happens if routing updates are sent over different classful subnet?
1. The classful subnet mask is used
32. 2. All network addresses are summarized
Automatic summarization advantages:
Smaller routing updates
Fast routing table lookup process
RIP works well for contiguous networks.
Automatic summarization has disadvantages when used with discontiguous networks.
Discontiguous network is one network separated by at least one network in different classul
subnet.
For example: If two 172.16.0.0/24 networks are separated by another network of different class
such as 10.0.0.0/8, the 172.16.0.0/24 networks are called discontiguous networks.
If RIP is used with discontiguous networks, some problems may appear:
Routers may not be aware of remote networks
Load balancing can incorrectly occur
To fix these problems, a routing protocol that send the subnet mask in the routing updates must
be used.
First solution is RIPv2.
To enable RIPv2, just enter version 2 command in the RIP configuration mode.
But just transferring from RIPv1 to RIPv2 doesn`t solve the problem because summarization take
effect.
RIPv2 automatic summarization is enabled by default. To disable it, use the no auto-summary
routing protocol configuration mode.
It is noted that converting the RIP from version 1 to 2 doesn`t remove all routes in the routing
table.
This is because there are three timers used:
Redistributing routes from one routing source to another routing source:
To advertise routes learned by one source such as static in dynamic routing protocol updates,
use the redistribute command
Router(config-router)#redistribute [static, rip, eigrp, ospf]
Note that redistribution default routes doesn`t redistribute default static routes.
RIP default route redistribution:
After configuring a default static route, it may be required to advertise this route into the
routing updates.
Router(config)#ip route 0.0.0.0 0.0.0.0 null 0
33. Routing protocols provide a way to advertise configured static routes:
Router(config-router)#default-information originate
RIP additional topics:
How RIP stops routing loops using hop count and split horizon?
Link-State Routing Protocols
Distance vector routing protocols just give information about the distance and direction to reach
the destination network.
34. Link-state routing protocols are like a map that provide information about all routes to a
destination network so a router can select its preferred route.
Each router is the OSPF domain creates a map about the network topology containing all routes
available to reach a destination network.
Link-state routing protocols can be called shortest path first because they use the Dijkstra`s
shortest path first (SPF) algorithm. This is not an accurate name because each algorithm tries to
find the shortest path.
Remember that the shortest path is not required the one with the least number of hops.
Having a map about network topology has many advantages:
Determine the best path to reach the destination
If the path used failed, router can easily find an alternative route to the destination
network
Main difference between distance vector and link-state routing protocol:
Distance vector routing protocols advertises routes to destination networks in form of distance
to each destination network and direction to be used.
R1 sends its routing update to R2. R1 says to R2 to reach the network N use the information
found in its route which is to use the link L1. R2 can`t choose another route than the received
route from in the routing update.
Link-state routing protocols not advertises routes but advertises state of links from which the
name link-state came from and allows each router to calculate the route to each destination
network without forcing it to use a specific route. So R1 not forces R2 to reach the network N via
L1 but sends the state about its links which are L1 and L2 and R2 find the best path it can use to
reach the destination network N which can be via L1 or L2.
The link in OSPF refers to a router interface.
State of link holds the following information:
Directly connected network to that link – IP address and subnet mask
Type of these networks connected to that link
Bandwidth of the link
35. Link-state routing protocols operation can be simply described as follows:
1. Learning about its links (interfaces) that are the directly connected networks – each
link/interface must be in the up/up state and included in a network command.
2. OSPF neighbors discovery
3. Each router builds its link-state packet (LSP) containg information about its links.
4. Each router floods its LSP only in interfaces where there are neighbors where each
neighbor stores the received LSP in its local database. Neighbors also flood these LSPs to
their neighbors that make a copy of it in its local database and send it also to all of its
neighbors until the LSP from one router get received by all other routers.
5. Each router will have the routing information stored at all routers and can easily create
a topological map about the network.
6. Using the Dijkstra`s SPF algorithm, each router calculates the best path to each
destination network and add this best path in its routing table. Each router will have a
topological map but individually creating it.
Hello packets are required to be sent periodically between OSPF neighbors as keepalive.
But LSP are not required to be sent periodically. They are sent only:
During initial startup of the router or the routing protocol
When a change occur in the topology such as link up or down or neighbor adjacency
established or broken.
Compare OSPF and EIGRP
Unlike distance vector routing protocols that must first run the Bellman-Ford algorithm to
process routing updates before sending them to other routers, link-state routing protocols
calculate the SPF algorithm after the flooding is complete. As a result, link-state routing
protocols reach convergence much faster than distance vector routing protocols.
Open Shortest Path First (OSPF)
OSPF characteristics
36. Link-state routing protocol
OSPF not uses either TCP or UDP and implements its own transport layer protocol
Classless
AD is 110
Metric is cost that depends on bandwidth
Uses the Dijkstra algorithm to calculate cost
Event-driven routing updates: Routing updates are sent only if change occurs in the
network compared to sending it periodically each 30 seconds in RIP.
Hierarchical design: Divides the complete network into a number of areas
Builds a topological map
OSPF is multi-vendor protocol
Fast convergence time
Provides authentication
Provides summarization but it is not enabled by default.
Heavy resource usage – CPU and memory
Scalable and not limited
Complex implementation and maintenance
Give an example showing that people that choose the easy way will have many troubles and
may not be able to continue their life as it is. People that study a few days before the exam,
people who …. Don`t take the easy way but take the right way.
OSPF created as a replacement for RIP distance vector routing protocol. RIP chooses the easy
way to create its routing table but it faces many challenges that include routing loops,
scalability, summarization, discontiguous networks and so on.
Explain the difference between routing information (routing update) and data packets.
Any routing protocol has a set of messages to exchange the routing information between
routers.
RIP has two messages only:
1. Request message: When a RIP router starts up, it sends a broadcast request message
from all of its RIP enables interfaces.
2. Response message: When a RIP router receives the request message it replies by a
response message containing its routing table.
OSPF five different types of messages:
1. Hello:
This packet is used to create neighbor adjacency between OSPF routers.
Advertise parameters that are required to be matched between two OSPF
routers to create neighbor adjacency.
37. Works as keepalive to maintain neighbor adjacency.
2. Database description
3. Link state request
4. Link state update
5. Link state acknowledgment
Each message is encapsulated into OSPF packet. So it can be said that there are five OSPF
messages or five OSPF packets as each message will have different packet in a one-to-one
relationship.
Note
To create neighbor adjacency between two routers, there are a number of parameters that are
required to be matched between the two routers:
Subnet mask
OSPF hello interval and dead timers (Typical interval is 10 seconds and dead period is 4
times that interval)
OSPF network types: OSPF has three network types
o Point-to-point network (PPP)
o Broadcast Multi-access network (BMA)
o Non-broadcast Multi-access network (NBMA)
So the interfaces that connect OSPF neighbors have to have the same subnet mask, intervals,
and in the same network type.
To view all of these information to a given interface, use this command
Router#show ip ospf interface interface-type interface-number command
Try to change these parameters in the neighbor OSPF routers and see the effect.
To change the hello and dead intervals, use these interface configuration mode commands:
Router(config-if)#ip ospf hello-interval
Router(config-if)#ip ospf dead-interval
To change the network type of an interface use the following interface configuration command:
Router(config-if)#ip ospf interface [broadcast – point-to-point]
To view the network type of an interface, use the show ip ospf interface interface-type
interface-number command
To view the changes occurred after changing the interface network type, make the network type
of the interfaces connecting two OSPF neighbors differs and show ip ospf neighbor. The state of
the neighbor will get changed.
OSPF Transport Layer Protocol
38. In regular data messages, there is data portion encapsulated into transport layer protocol TCP
segment or UDP datagram then encapsulated into IP packet and finally encapsulated into a data
link frame.
For OSPF messages, there will be an OSPF data portion encapsulated into OSPF packet then
encapsulated into IP packet and finally into a data link frame.
It is clear that OSPF not uses one of the existing transport layer protocols and implements its
own transport layer protocol.
Q. Why OSPF not uses UDP or TCP and creates its own transport mechanism?
This is because it needs features not completely supported in TCP and UDP. It needs to perform
reliable multicasting. TCP is reliable but not supports multicasting and UDP supports
multicasting but not reliable. So it implements its own transport mechanism that supports
reliability in form of acknowledgments and retransmission in case of segment loss and
multicasting.
OSPF Message Encapsulation
All OSPF message will have similar encapsulation:
Regardless of the OSPF specific information in the message encapsulation, it is required to know
what type of information to be added in the regular headers (IP packet header and data link
frame header).
Basic OSPF Configurations
Data Link Frame Header IP Packet Header OSPF Packet Header OSPF Data
39. Commands used to configure OSPF are not different from commands used for RIP
configurations.
To enter the OSPF configuration mode:
Router(config)#router ospf process-id
To allow routers to know about each other, they must have parameters that group them
together. All routers that have the same information will exchange routing updates with each
other.
The information used to group routers together to exchange routing updates differs from one
routing protocol to another.
For example, EIGRP uses process ID, OSPF uses area ID.
OSPF needs the process ID also in its configurations but it is not required to be matched on
routers to exchange routing information between them.
To enable OSPF over router interfaces:
Router(config-router)#network network-address wildcard-mask area area-id
RIP was not sending the subnet mask of the network in the routing updates.
OSPF solves that problem by allowing the NA to determine the subnet mask of each entered
network.
But rather than using the subnet mask, it uses wildcard mask.
Wildcard mask calculations
Wildcard is used in some routing protocols rather than subnet mask.
Subnet mask says that bit of 1 is for network address but wildcard mask has bit of 0 for the
network address.
Wildcard mask is the inverse of the subnet mask. Subtract the network subnet mask from the
broadcast subnet mask.
Example: Find the wildcard mask to the networks 172.16.1.0/16 and 172.16.1.16/28.
255.255.255.255
-255.255.0.0
0.0.255.255
255.255.255.255
-255.255.255.240
0.0.0.15
40. OSPF area is a group of routers that shares the same routing information.
Last field in the OSPF network command is used to specify the router area.
OSPF can be configured in only one area and is called single-area OSPF.
OSPF can be enabled in multiple areas and is called multiple-area OSPF.
In single-area OSPF, all routers will exchange the complete link-state database with all other
routers. This makes heavy load on the network to exchange all updates with all routers specially
in large networks.
Advantage of multiple-area OSPF is to divide the major network into a number of small
networks so that are less updates to be exchanged.
For single-area OSPF configurations, all routers will be in the same area and thus have the same
area in the network command.
To find the range of the OSPF area ID, network ?.?.?.? ?.?.?.? area ? that will show the valid
range of the area ID.
Some important troubleshooting commands in OSPF:
show ip protocols
show ip ospf neighbor
show ip ospf database
show ip ospf interface interface-type interface-number
show ip ospf
The output of the show ip protocols command includes this information:
OSPF process ID
Router ID
Number of areas the router in
Networks it advertise in OSPF
Interface IP address of the OSPF neighbors
AD
The output of the show ip ospf neighbor command includes these fields:
1. Neighbor ID
2. Pri:
3. State: Full means that the two routers are fully adjacent and have identical OSPF link-
state databases.
4. Dead Time: The amount of time remaining that the router will wait to receive an OSPF
Hello packet from the neighbor before declaring the neighbor down. This value is reset
when the interface receives a Hello packet.
5. Address: The IP address of the neighbor interface
41. 6. Interface: The interface of the router that is connected to the neighbor
The output of the show ip ospf contains information about the SPF algorithm:
The router usually reruns the SPF algorithm over its link-state database if there is a link change
such as link addition/deletion/modification. SPF algorithm is intensive in its calculations and
take time specially when there are a large number of OSPF routers in the area.
There are some links that usually go up and down called flapping link. For each change, the SPF
algorithm will rerun to create the updated routing information. To minimize this effect, the
router will wait 5 seconds before rerunning the algorithm. This is known as the SPF schedule
delay.
To also prevent the router from constantly running the algorithm, there is an additional hold
time of 10 seconds.
In RIP, the network command is used to enable all interfaces in this network for sending and
receiving RIP routing updates.
For example, if a router is connected to two networks 172.16.1.0 and 172.16.2.0, rather than
entering a separate network command for each network, it is easier to enter one network
command with the 172.16.0.0 network and it makes RIP enabled in all interfaces configured for
that network.
OSPF Router ID
RIP doesn`t have to have entire network knowledge. So it doesn`t need to know routers in the
network, which router originally sent the routing information about a specific route, etc.
But OSPF needs entire network knowledge.
So to make OSPF knows each router in the network, it must discriminate among different
routers and know routes originated from each router.
Each router in the OSPF network must be identified by a unique identifier which is the router ID.
Thus each router can discriminate among different routers using the router ID. By knowing each
router in the OSPF network, it can be easy to find routes came from each router.
Router ID is a normal IP address of an interface configured in the router.
How to determine the router ID?
There are three options to determine the router ID of a router:
1. Use the router ID configured using the OSPF router-id command.
2. If the OSPF router-id is not configured, use the highest IP address of the loopback
interfaces.
3. If no OSPF router-id and no loopback interfaces configured, use the highest active IP
address of its physical interfaces. The physical interfaces used to determine the OSPF
42. router ID are not required to be enabled for OSPF but it must be active. Note the IP used
is a host IP address not a network IP address.
Difference between null and loopback interfaces:
Both are logical interfaces different from physical interfaces such as Ethernet and serial.
Null interface is always in up/up state and have no IP address and subnet mask but loopback
interface have.
Null interface is used to drop packets by making a route that forwards data to a null interface.
Usually there is a single null interface with number 0.
But there are many loopback interfaces that can be configured. It goes to the up/up state
directly after entering the interface configuration mode of the loopback interface.
Give an example showing how to calculate OSPF router ID when no router-id command or
loopback interfaces configured.
If a router has 4 interfaces configured with the following IP addresses 192.168.1.20, 172.16.3.7,
10.5.7.3, 192.168.5.5, the highest IP address is 192.168.5.5.
To show the router ID of the OSPF router, use the show ip protocols command. This command
can also provide information about how many areas found in the router.
Some Cisco IOS software not shows router ID in the show ip protocols output. Use show ip ospf
or show ip ospf interface commands instead.
Give an example showing how to calculate OSPF router ID when no router-id command but
loopback interfaces are. Configure a loopback interface on a router and make its IP address
higher than any preconfigured interface IP address.
Show how to configure loopback interfaces.
The advantage of using loopback interfaces than physical interfaces to configure the router ID
Is that loopback interfaces can`t fail like physical interfaces. This provides stability to the OSPF
process. Because if there is a change in the physical interface IP address used as the router ID
requires repeating router ID calculations and sending update to other routers about the new
router ID.
To view all interfaces in the router to provide flexibility in determining the highest router
interface IP address is by using the show ip interface brief command.
But why the loopback interface IP address not used as the router ID however it is the highest IP
address?
OSPF has some steps to perform from being activated using the router ospf command to
exchange the routing updates between its neighbors. These in between steps include neighbor
discovery, router ID calculations and so on.
After making a change in an interface IP this doesn`t make OSPF process get repeated.
To force repeating the OSPF process:
43. 1. Reload OSPF: clear ip ospf process
2. Reload the router: reload: But make sure that the configuration file is copied into the
flash memory as the startup configuration file
Give an example showing how to calculate OSPF router ID when router-id command is
configured.
To configure a router with a router ID manually: Router(config-router)#router-id
Also it is required to force OSPF process to get repeated.
Duplicate Router ID
All OSPF routers must be configured with unique OSPF router ID.
When two routers have the same router ID in an OSPF domain, routing might not function
properly.
Show an example in which two routers have identical router ID.
OSPF Metric
OSPF metric is called cost. The lower the cost the lower the link to be used.
OSPF cost is based on the bandwidth. Note that bandwidth is required to be high but the cost is
required to be low.
The cost of the router link/interface is calculated using the following formula:
Cisco IOS Cost for OSPF = 10^8 /bandwidth in bps
The value 10^8 is called the reference bandwidth.
Using the bandwidth of the interfaces, its cost can be calculated:
Fast Ethernet = 100 Mbps
Ethernet = 10 Mbps
For Ethernet, the cost is 10^8/10^7 = 10
For fast Ethernet = 1
To show the bandwidth of an interface
Router#show interfaces interface-type interface-number
The cost is equal to 1 for bandwidth of 100 Mbps or higher. So the router will not differentiate
between a link with bandwidth of 100 Mbps or higher.
To change the reference bandwidth:
Router(config-router)#auto-cost reference-bandwidth
To change the cost of the link/interface:
44. Change the cost directly: Router(config-if)#ip ospf cost cost
Change the bandwidth and the SPF algorithm will calculate the cost automatically:
Router(config-if)#bandwidth bandwidth-kbps
If both bandwidth and cost changed, the cost will be the one entered directly in the cost
command.
To reset these values, use the no version of the command.
To show interface bandwidth: show interfaces interface-type interface-number
To show interface cost: show ip ospf interface interface-type interface-number
Default route in OSPF
Redistribution default routes is OSPF: Router(config-router)#default-information originate
The route will appear in other routers as OSPF external type 2 (E2).
OSPF has two types of external routes:
Type 1: The cost of that route is calculated as the accumulative cost as normal routes.
Type 2: Has only the external cost. Because static routes has cost of 1
Example: If there is a router learning a route from RIP with cost of 5. This route can be
redistributed as type 1 that adds the external cost of 5 plus the cost of the OSPF.
Type 2 just uses the cost of 5 and not adds the cost of the OSPF.
Explain those:
1. OSPF route states >> FULL: 00:02:25: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.2.1 on
Serial0/1 from LOADING to FULL, Loading Done
2. OSPF packet encapsulation
3. OSPF message types
OSPF Multiaccess Network
There are different network types defined in OSPF:
1. Point to point: Two devices directly connected with a point to point link.
2. Broadcast multi-access: It is a network with a media accessed by multiple devices and
each device can send a broadcast message to all other devices.
45. 3. Nonbroadcast multi-access NBMA: Like BMA, network media is connected by multiple
devices but no broadcast messages exist. One device can send messages to only one
device.
4. Point to multipoint:
5. Virtual links:
There are different ways to create multi-access network that can be accessed via different
devices. Just connect all of these devices using a grouping device like a switch or hub.
The meaning of broadcast is that all the connected devices are in the same broadcast domain.
To make all the devices in the same broadcast domain it will require using a device that doesn`t
divide the broadcast like a switch. So switch is used because it connects multiple devices and
also not divides the broadcast. A device like a router not creates a broadcast multi-access
because router divides the broadcast into multiple broadcasts as each broadcast message on
one interface can`t get propagated to other interfaces.
Problems of OSPF multi-access network:
Multiple adjacencies: There are a number of OSPF routers. For each two pair of routers, it is
required to create adjacency between them. But this will lead to a larger number of adjacencies
n(n-1)/2. For a broadcast multi-access network with 5 routers connected using a switch, there
will be 10 adjacencies required to created and maintained every 10 seconds. The complexity of
operation increases as the number of routers increase. For 10 routers, there will be 45
adjacencies. For 50 routers, there will be 1225 adjacencies.
Tip: Show the adjacencies created on the diagram.
Flooding LSAs: After creating adjacencies between neighboring OSPF routers, each router
needs to send link-state packet to all neighboring routers. If there is 5 routers, each router send
a link-state packet containing information about its links to the other 4 routers. So each router
of the 5 routers sends 4 packets for a total of 20 packets to be sent in response to any change in
the network. If there are 10 routers in the network, there will be 9 packets sent from each
router to each other router for a total of 90 packets. In addition to sending the advertisements,
there is acknowledgment packet sent after receiving each packet. So there are also 90
acknowledgment packets sent in response to the 90 update packets. This adds heavy burden on
the network and consumes most of its bandwidth causing the actual user data traffic get
delayed.
Routing protocols tries to make it easy to get routes that send data, but using this approach will
add heavy burden over the network resources and only create routes and forget the main task
of sending user data.
Solution to OSPF problems
46. The solution to the problems of OSPF is to decrease number of adjacencies created and
decrease number of LSAs propagated.
The solution can be summarized in three terms:
1. Designated Router (DR)
2. Backup Designated Router (BDR)
3. DROthers
OSPF elects one router as DR. The DR is the router used to communicate with all other OSPF
routers. Rather than creating full adjacency with all OSPF routers in the OSPF area, only one full
adjacency is created with the DR from each router. Rather than sending the LSA from each
router to all other routers in the OSPF area, only the LSA is sent to the DR and the DR send this
LSA to all other routers. This decrease the number of LSAs propagated in the network.
So there are a DR and other routers. Other routers send and receive routing information to and
from the DR only. Show how this works on a topology of five routers where one is DR where one
router sends the LSA to only the DR and DR redistributes this LSA to other routers.
One advantage to make a single router responsible of LSAs is to decrease costs of the network.
In the normal case without DR, all OSPF routers exchange LSAs with all other OSPF routers. This
needs that all routers have a large amount of RAM and fast processing CPU to manage this
heavy number of LSAs in addition to using links with high bandwidth. But using DR only requires
one router to have fast processing to handle all of these LSAs and only the link connecting the
DR to other routers is required to have high bandwidth.
But there is a disadvantage to use a single router for managing LSAs. This makes the OSPF
network susceptible to single point of failure. Solution to this is to use BDR.
There is another router called Backup Designated Router (BDR). All LSAs in the DR are also
stored in BDR in case of DR failure. This makes OSPF reliable and resilient because its operation
not stops by a single point of failure. All other routers rather than DR and BDR are called
DROthers.
So each DROther router creates two full adjacencies: one with DR and another with BDR. Each
DROther router also sends the LSA to the two routers (DR and BDR). The BDR is not used until
DR fails. Show this in the topology of 5 routers where one is the DR and another is the BDR.
Multicast IP Addresses
DROthers sends their LSAs to both DR and BDR. The DR and BDR use a multicast IP address
224.0.0.6. When DR floods the received LSA to all other routers, it uses the multicast IP address
224.0.0.5.
47. Remember that in point-to-point network types there are no DR and BDR. Show the difference
between the point-to-point and multi-access network types by a diagram of three routers.
DR/BDR Election Process
How a router became a DR or a BDR in a multi-access network?
The DR is the router with the highest OSPF interface priority.
The BDR is the router with the second highest OSPF interface priority.
If OSPF interface priorities are equal, the highest router ID is used.
Note that priority of the interfaces activated on an OSPF multi-access network are used but the
OSPF router ID is determined from any interface that is not required to be activated in an OSPF
network command.
So to elect DR and BDR for a multi-access network, only the priority of interfaces in the network
are used but interfaces in other networks not used in the election of this network.
The priority of an OSPF interface ranges from 0 to 255. Value of 0 makes the router ineligible to
be a DR or BDR.
To check the OSPF interface priority, use the show ip ospf interface inf-type inf-num.
If the OSPF interface priority of a router is zero this means it won`t be DR or BDR and must be
changed to get participation in the election process. At least change it to 1.
Assuming that all routers have an equal priority of 1, then election will depend on the OSPF
router ID.
By default, serial interfaces have interface priority of 0 to avoid making them participate in the
election process. This is because serial interface are found in point-to-point networks and these
networks have no election.
But the default interface priority for Ethernet interface is 1 because Ethernet interfaces are
connected to multi-access networks to make them valid for participation in the election process.
Packet Tracer Network
Discuss the packet tracer network. Configure OSPF in the network starting by router 1, then
router 2 and finally router 3.
Discuss how the election took place in the previous PT example to elect the DR and BDR using
OSPF router ID when all router interfaces have equal priority. Show the steps from calculating
the OSPF router ID for each router to the end of the election process of DR and BDR. Router
with the highest router ID is elected as DR and the router with the second highest router ID is
elected as BDR.
How to know router state?
To know whether an OSPF router is DR/BDR/DROther in a given multi-access network, show ip
ospf interface command for the interface connecting that router to the multi-access network.
Another way is to use the show ip ospf neighbor command:
1. If the neighbors are DR and BDR, this means that current router is DROther
48. 2. If the neighbors are DR and DROther, this means that current router is BDR
3. If the neighbors are DROther and BDR, this means that current router is DR
Explain why the theoretical results about the expected DR, BDR and DROther to be found in the
network doesn`t match the expected results.
Timing of DR/BDR Election
The DR and BDR election process takes place as soon as on OSPF with one interface get enabled
on a multi-access network. This happens as soon as the router is powered on or when the OSPF
network command is entered to activate an interface in a multi-access network.
Thus the election may take place before all routers in the network get activated. This may
causes a router with a lower router ID be elected as DR and BDR.
So the router with the high interface speed, large amount of RAM, fast CPU, and high speed link
bandwidth may not be used and another router with poor resources can be used. This will
deeply affect the OSPF process and decreases its performance.
After the election take place, if other routers with higher priorities or OSPF router ID get
enabled will not be elected as DR or BDR.
One solution is shutdown and boot up OSPF routers itself:
1. Shutdown all OSPF routers
2. Boot up the router required to be DR, then boot up router required to be BDR, then
boot up all other routers
Another solution is to shutdown and no shutdown OSPF router interfaces:
1. Shutdown all OSPF interfaces in the multi-access network
2. No shutdown the OSPF interface on the router required to be DR, then no shutdown the
OSPF interface on the router required to be BDR ,then no shutdown on other routers
Using OSPF interface priority in the election
Rather than depending on the OSPF router ID in the election, interface priority can be used to
provide better control because they are specific to interfaces. Assume that it is required to make
a router DR in one multi-access network and BDR or DROther in another multi-access network.
This may be a challenging task if OSPF router ID is used. Using OSPF interface priorities simplifies
the task.
Again priority of 0 makes router invalid to be DR or BDR.
To show interface priority: show ip ospf interface
The reason OSPF interface priorities are not used is that all of them are equal. To change the
OSPF interface priority use the ip ospf priorty {0 - 255} interface configuration mode command.
To force repeating the election process, just shutdown and boot up routers themselves or
shutdown and no shutdown routers interfaces.
49. Remember that the Hello message was used to create neighbor adjacencies and as a keepalive
between neighbors. Hello message can also be used to elect BR and BDR routers.
Multiarea OSPF
Normally when creating single area OSPF network, the area takes number 0. Area 0 is called
backbone area in OSPF.
But single area OSPF has some disadvantages:
1. Large number of routers in the same area leads to large database in each router
because each router will hold the link-state database of all other routers in the same
area.
2. Large database leads to some consequences such as large amount of memory to hold
the database and heavy use of CPU to run the Dijkstra algorithm over that large
database to create the routing table.
3. Link bandwidth is consumed to exchange the periodic Hello packets and link-state
advertisements (LSAs).
One characteristic of OSPF is that it is hierarchical structure. That is it provides dividing the
network into a number of areas. Rather than grouping all OSPF routers in the same area it is
more practical to separate them in different areas. Show an example with a graph to illustrate
how different areas are found. Full adjacency will be created only among routers in the same
area thus only Hello packets will be exchanged between routers in the same area thus
decreasing number of Hello packets exchanged. Link-state databases will only get exchanged
among routers with full adjacency and thus making the LSDBs get exchanged among routers in
the same area thus deceasing LSDBs exchanged. Any change or failure will only get exchanged to
routers with full adjacency thus it will be bounded to a single area only so if a link became down
then updates will be exchanged in its local area only and just routers in the same area will rerun
the algorithm and routers in different areas will not have to make any more processing. All
these factors reduce link bandwidth consumed for exchanging OSPF routing information.
All of these areas must connect to the backbone area (area 0). In each area there will be a
router that connects it to the backbone area which is called area border router (ABR).
Inside one area routers will exchange detailed link-state information but only summary of the
LSDB will be exchanged among areas not the detailed topology. Show an example showing that
routers in the same area will have the complete topology and routers outside the area will have
only summary of the topology.
When an update gets received by a router it will rerun the SPF algorithm to create the new
updated routing table. This only occurs in the same area. When an update is sent from one area
to a router in another area the router in this area will not rerun the SPF algorithm again but will
50. enter the received information into the routing table directly without any calculations. This
saves the CPU time.
Useful terms in multiarea OSPF:
Two-layer area hierarchy:
1. Backbone (transit) area: Two primary usages of the backbone area are it must connect
all other areas and must provide fast forwarding of the packets from one area to
another. Usually this area has no end user devices. In multiarea OSPF there must be an
area with number 0 to be backbone area.
2. Nonbackbone area: The primary usage of this area is to connect to end-user devices.
Because all areas are connected to other areas via the backbone area, traffic from one
nonbackbone area to another nonbackbone area must pass through the backbone area.
Area Border Router (ABR)
A router that has its interfaces connected to at least two OSPF areas including the backbone
area. Because the ABR is found in different areas it will create full adjacency with routers in
these areas and will have the complete LSDB of these areas. But when advertising the routing
updates from one area to another it will just provide summary of the database.
Autonomous System Boundary Router (ASBR)
ASBR is a router that is connected to an external non-OSPF domain.
Internal router
A router with all of its interfaces in the same area
Backbone router
Router with at least one interface connected to the backbone area
EIGRP
Distance vector routing protocols brief summary:
RIP is the first distance vector routing protocol to be used. It has AD of 120 and maximum hop
count of 15 hops.
51. RIP is limited in its network size. IGRP was used to solve RIP limited scalability to an extended
number of 255 hops and uses AD of 100.
IGRP is classful routing protocol. EIGRP is used to provide classless distance-vector routing
protocol.
Enhanced version of Cisco IGRP and both are Cisco proprietary protocols: IGRP is used to solve
RIP limited scalability to a metric of 15 hops to an extended number of 255. But IGRP
Enhanced Interior Gateway Routing Protocol (EIGRP) characteristics:
Distance vector routing protocol
Enhanced version of Cisco IGRP and both are Cisco proprietary protocols: IGRP is used to
solve RIP limited scalability to a metric of 15 hops to an extended number of 255. But
IGRP
Classless
AD is 90
Event-driven updates: EIGRP is a distance-vector routing protocol with features from
link-state routing protocols. This feature is summarized in two words (partial—time,
amount). Routing updates are sent only if change occurs in the network compared to
sending it periodically each 30 seconds in RIP and 90 seconds in IGRP. In addition to not
periodically sending the updates, it will send only parts of the database with changes.
Fast convergence. Make an example when there are 10 routers connected in series
show that it takes much time to make update from R1 reach R20 as this update will pass
from R1 to each subsequent router in 30 seconds for RIP and 90 seconds for IGRP.
Establish adjacencies: Can detect passive interfaces automatically using Hello packets.
Another feature from link-state routing protocols.
Builds a topological map: Other distance vector routing protocols just know routers
directly connected to it. Another feature from link-state routing protocols.
EIGRP is a network layer-independent routing protocol. So it can be used with IP, IPX,
and AppleTalk. So EIGRP must not use any feature that is found in only one protocol
than the others. So EIGRP not uses either TCP or UDP and uses RTP transport layer
protocol because TCP and UDP are used for IP only.
Metric in IGRP and EIGRP is not hop count but a combination of bandwidth, delay,
reliability, and load. By default just bandwidth and delay are used.
EIGRP uses two paths to each destination network rather than best path only in RIP
and IGRP. From the updates received by EIGRP router from other routers, EIGRP runs its
DUAL algorithm to find the best path to each destination network which is the one with
the least metric is used. In case of failure of this best path, the DUAL algorithm is
required to run again over the database to find another path to the destination
network. Rerunning the algorithm is CPU intensive. EIGRP will run the algorithm once
and find two paths to the destination network, the best path and second best path. The
best path in used in the routing table and the second best path is saved in another
52. topology database. In case of best path failure, the path in the topology database is
used into the routing table without rerunning the DUAL algorithm. So in case of failure,
EIGRP can solve the problem in less time.
Provides summarization but it is enabled by default.
Heavy resource usage – CPU and memory.
Scalable and not limited.
Complex implementation and maintenance.
Support authentication.
EIGRP Packet Types
EIGRP has five packet types
1. Hello
2. Acknowledgment
3. Update
4. Query
5. Reply
Administrative distance in EIGRP
EIGRP uses different ADs for the different routes it knows.
EIGRP has an AD of 90 for internal routes. Internal routes are the routes learned from other
EIGRP routers.
EIGRP has AD of 170 for external routes that are learned from external sources such as default
routes learned from static routing.
EIGRP has AD of 5 for summary routes.
EIGRP Configuration
To enter EIGRP configuration mode: R1(config)#router eigrp process-id
Process ID is a 16-bit number.
All routers with the same process ID can establish adjacencies. For OSPF the process ID was
router specific and not required to be matched across different routers.
Usually it is possible to run multiple instances of the same routing protocol. In RIP there is no
process ID specified and thus RIP can only be a single instance. OSPF and EIGRP can run multiple
instances by specifying different process IDs.
To activate EIGRP for a network: R1(config-router)#network network-address wildcard-mask
passive-interface command
53. For RIP, this command was useful to indicate that updates should not be send across as
interface.
EIGRP makes it automatically.
If this command is used with an interface then it will stop sending EIGRP updates over that
interface. It prevents both Hello and Update packets to be sent. Thus incorrectly entering this
command can break the adjacency created between two routers which is undesired effect.
This is one of the errors to be added to troubleshooting topologies.
Troubleshooting Commands
show ip ospf neighbors
show ip protocols
show ip route
show ip route eigrp
show ip eigrp
Default route redistribution
EIGRP Automatic Summarization
EIGRP automatically summarizes networks to their classful networks and adds a route of this
summary route to forward packets to NULL0 logical interface.
This is just a loop prevention mechanism. For example, if there are three subnets
(172.16.0.0/24, 172.16.1.0/24, 172.16.2.0/24), these addresses will be summarized to the major
address to be 172.16.0.0/16 with a route that forwards the packets to NULL0. So if there is a
packet destined for a subnet that not exist in the routing table but actually exist under the major
network such as 172.16.3.1, it will be dropped to avoid looping.
EIGRP sends the summarized routes not the individual routes and this makes other routers not
know the remote networks addresses.
Be default EIGRP summarizes routes. To stop summarization: R1(config-router)#no auto-
summary
To create manual route summarization, use the interface configuration mode command:
R1(config-if)#ip summary-address eigrp as-num network-address subnet-mask
Note that the summary route at R1 will only have AD of 5 but this is local and not propagated to
other routers. Other routers receiving the summary route will have AD of 90 as regular because
the route was known by EIGRP.
Advanced configurations that can be applied are such as:
Change link bandwidth:
Router(config)#bandwidth
54. Changing EIGRP link bandwidth percentage used for its updates
Router(config-if)#ip bandwidth-percent eigrp as-number percent
Changing Hello/Dead times
Router(config-if)#ip hello-interval eigrp as-number seconds
Router(config-if)#ip hold-time eigrp as-number seconds
IPv6
IPv6 has the length of 128 bits represented as 8 parts separated by colons. Each part contains 4
hexadecimals. Each hexadecimal is represented by 4 bits.
There are different types of addresses in IPv6:
1. Unicast
2. Multicast
3. Anycast
55. To create a basic IPv6 network that enables routing between its nodes, unicast address is
required.
There are different types of unicast addresses:
Unique local unicast
Loopback unicast
Unspecified unicast
Link local unicast
Global unicast
Simple network that sends a packet from a host inside a subnet to another host in different
subnet will require these basic steps:
1. The packet must get out from its originating host to the default gateway in its
connecting router inside its subnet.
2. The router will forward the packet from one subnet to another subnet until reaching the
destination host.
Main addresses required to configure a network for IPv6 are:
1. Link local unicast address: Each device should have a link-local address to communicate
with devices in the same subnet. The first 4 hexadecimals in this address are in the
range from FE80 to FEBF. This is because the first 10 bits must be 1111 1110 10.
2. Global unicast address: Only packets with a global unicast address will be forwarded to
destinations outside the local subnet. Global unicast address is similar to public IPv4
address. Range of the first 4 hexadecimals in the global unicast address is from 2000 to
3FFF. This is because the global unicast address must start with the first 3 bits 001.
After enabling IPv6 on a router interface by entering the global unicast address, the link local
unicast address will be automatically configured on that interface. Using the show ip interface
brief we can get the assigned link local address.
But it is recommended to manually configure the link local address because it is required to
enter the router link local IPv6 address on the end user devices as a default gateway. Not
knowing the link local address will require entering the router configuration to get the assigned
link local address by the router.
Configuration
Start by using Cisco router model 1941 because it supports IPv6 interfaces.
0.Configure interfaces with IPv6 addresses:
1. R1(config-if)#ipv6 address address/prefix
2. R1(config-if)#no shutdown
56. Enter clock rate for DCEs.
By default routing for IPv6 is disabled. To enable it, use the global configuration mode command
R1(config)#ipv6 unicast-routing
Configuring the following:
1. Static for IPv6
2. RIP for IPv6 (RIPng)
3. EIGRP for IPv6
4. OSPF for IPv6 (OSPFv3)
IPv6 Static Routing
1.Enable IPv6 routing
R1(config)#ipv6 unicast-routing
2.Configure IPv6 static routes:
R1(config)#ipv6 route netwok/prefix [exit-interface/next-hob-ip-address]
Steps summary for routing protocols:
1. Enable IPv6 routing
2. Activate the routing protocol
3. Configure routing protocols parameters like router ID for EIGRP and OSPF
4. Enable interfaces for routing
RIPng
1.Enable IPv6 routing
R1(config)#ipv6 unicast-routing
2.Enable RIP for IPv6
R1(config)ipv6 router rip process-name
3.Enable interfaces for RIP routing
R1(config-if)#ipv6 rip process-name enable
IPv6 EIGRP
To configure IPv6 routing for EIGRP, it is required to give each router a router ID which has the
same style for OSPF router ID.
57. 1.Enable IPv6 routing over the router:
R1(config)#ipv6 unicast-routing
2.Enable EIGRP for IPV6:
Assign a router ID for each router.
EIGRP is in shutdown mode by default. It is required to no shutdown it to get enabled.
1. R1(config)#ipv6 router eigrp as-number
2. R1(confg-rtr)#eigrp router-id a.b.c.d
3. R1(config-rtr)#no shutdown
3.Enable interfaces to be enabled for EIGRP routing:
R1(config-if)#ipv6 eigrp as-number
In IPv4 the interfaces were enabled for routing implicitly using the network command. The
network was enabled for routing then any interface inside the network will get enabled for
routing.
In IPv6, interfaces are activated explicitly inside the interface configuration mode.
OSPFv3
1.Enable IPv6 routing
R1(config)#ipv6 unicast-routing
2.Enable OSPF for IPv6:
R1(config)#ipv6 router ospf process-id
3.Assign each router a router ID:
R1(config-rtr)#router-id a.b.c.d
4.Enable interfaces for IPv6 routing:
R1(config-if)#ipv6 ospf process-id area area-num
Router Packet Forwarding Process
The main function of router is packet forwarding. This is done by
1. Determine best path.
2. Forward packet to their destination.
The router routing table is used to find the best path to forward the packet.
58. Before packets get received by router, the source will check if the destination is in its same
network. If not, then it does not know how to reach this destination device. So the source will
send data to its default gateway in connected router to make the routing decision using its
routing table.
The process that is done when the router receives a data is:
1. The data is received from the physical layer as a stream of encoded bits. The router
decodes them to create a frame and then pass the frame to layer 2 to
2. The router decapsulates the frame to get its header and trailer to get layer 2 destination
address.
3. Router checks if the destination layer 2 address matches the layer 2 address of the
router interface frame received from.
4. If there is a match, the router then removes the frame headers and trailers to get the
data portion of the frame which is the IP packet and pass it to layer 3 (network layer).
5. The router decapsulates the packet to get packet header.
6. The packet header is processed to get destination IP address.
7. The IP destination address in the packet is used to find the best path to forward the
packet and make its forwarding decision.
8. After finding the path to send data, the packet is encapsulated by the appropriate data-
link (layer 2) header and trailer to create a frame then send it down to layer 2 (data-link
layer).
9. Data-link layer reencapsulates the packet by a frame header and trailer to match the
source and destination layer 2 addresses.
10. The frame is then sent to physical layer.
11. Physical layer converts the packet into a stream of bits then send it over the cable
medium to its destination.
You can take care of matching layer 2 addresses in case of router interfaces connecting LANs.
Usually the router will receive the packet encapsulated in one type of data-link frame such as
Ethernet and forward it in another type of data-link frame such as PPP. The data-link (layer 2)
encapsulation depends on interface type and medium type to which the interface connects.
Cisco uses command-line interfaces to access the router. It is called command-line because
router accepts a command in a single line.
There are a number of interfaces to access the command-line:
Console
Virtual Teletype (VTY)
AUX
To access the console port, use this global configuration mode command: line console 0