Lecture 4 - Static+Dynamic Routing
Lecture 4 - Static+Dynamic Routing
Cisco Public 1
Objectives
Define the general role a router plays in networks.
Describe static routes with exit interfaces
Describe summary and default route
Examine how packets get forwarded when using
static routes
Describe the role of dynamic routing protocols
Describe how metrics are used by routing protocols
Determine the administrative distance of a route and
describe its importance in the routing process.
Identify the different elements of the routing table.
Cisco Public 2
General Role of the Router
Functions of a Router
Best Path Selections
Forwarding packets to destination
Cisco Public 3
General Role of the Router
Connections of a Router for WAN
-A router has a DB-60 port that can support 5
different cabling standards
–Newer routers support the smart serial
interface that allows for more data to be
forwarded across fewer cable pins.
Connections of a Router for Ethernet
-2 types of connectors can be used: Straight
through and Cross-over
Straight through used to connect:
-Switch-to-Router, Switch-to-PC, Hub-to-
PC, Hub-to-Server
Cross-over used to connect (pin 1 connected
to pin 3, and pin 2 connected to pin 6):
-Switch-to-Switch, PC-to-PC, Switch-to-
Hub, Hub-to-Hub, Router-to-Router, PC-
Router
Cisco Public 4
General Role of the Router in COD
Smart Serial cables: DCE and DTE
-Use straight cable to connect between
the DTE and DCE..
Ethernet cables:
Cross-over cable: RED cable
Roll-over cable: flat cables
Straight cable: all other cables
http://www.csdata.com/csdonline/customer/home.php
Cisco Public 5
Serial Connectors
DTE
DCE
DCE
DTE DCE DTE
Cisco Public 7
Interfaces
Configuring an Ethernet interface
-By default all serial and Ethernet interfaces are down
-To enable an interface use the No Shutdown command
Cisco Public 8
Examining Router Interfaces
-Physically connecting a WAN Interface.
-A WAN Physical Layer connection has sides:
Data Circuit-terminating Equipment (DCE) – This is the service
provider. CSU/DSU is a DCE device.
The CSU/DSU (DCE device) is used to convert the data from the router (DTE
device) into a form acceptable to the WAN service provider.
a DCE device such as a CSU/DSU will provide the clock.
Data Terminal Equipment (DTE) – Typically the router is the DTE
device.
Cisco Public 9
Static Routes
A router can learn about remote networks in one of two ways:
–Manually, from configured static routes
–Automatically, from a dynamic routing protocol
•Dynamic routing protocols are introduced in the next chapter.
Cisco Public 10
Static Routes
IP route command
To configure a static route use the following command: ip route
Example:
-Router(config)# ip route network-address subnet-mask {ip-
address | exit-interface }
Cisco Public 11
Static Routes
Remember R1 knows about its directly
connected networks.
–These are the routes currently in its
routing table.
The remote networks that R1 does not
know about are:
–172.16.1.0/124 - The LAN on R2
–192.168.1.0/24 - The serial network
between R2 and R3
–192.168.2.0/24 - The LAN on R3
Cisco Public 12
Static Routes
R1(config)#ip route 172.16.1.0 255.255.255.0 172.16.2.2
Dissecting static route syntax
ip route - Static route command
172.16.1.0 – Destination network address
255.255.255.0 - Subnet mask of destination
network
172.16.2.2 - Serial 0/0/0 interface IP address
on R2, which is the "next-hop" to this network
show ip route output
–S - Routing table code for static route
–172.16.1.0 - Network address for the route
–/24 - Subnet mask for this route; this is
displayed in the line above, known as the parent
route, and discussed in Chapter 8
–[1/0] - Administrative distance and metric for
the static route (explained in a later chapter)
–via 172.16.2.2 - IP address of the next-hop
router, the IP address of R2's Serial 0/0/0
interface
Cisco Public 13
Static Routes
Configuring routes to 2 or more remote networks
Use the following commands for R1
-R1(config)#ip route 192.168.1.0 255.255.255.0 172.16.2.2
-R1(config)#ip route 192.168.2.0 255.255.255.0 172.16.2.2
Cisco Public 14
Static Routes
Zinin’s 3 routing principles
Principle 1: "Every router makes its decision alone, based on the information it has
in its own routing table.“
R1 has three static routes in its routing table and makes forwarding decisions
based solely upon the information in the routing table.
R1 does not consult the routing tables in any other routers.
Making each router aware of remote networks is the responsibility of the
network administrator.
Principle 2: "The fact that one router has certain information in its routing table does
not mean that other routers have the same information.“
The network administrator would be responsible for ensuring that the next-hop
router also has a route to this network
Using Principle 2, we still need to configure the proper routing on the other
routers (R2 and R3) to make sure that they have routes to these three networks.
Principle 3: "Routing information about a path from one network to another does not
provide routing information about the reverse, or return path.“
Most of the communication over networks is bidirectional. This means that
packets must travel in both directions between the end devices involved.
Using Principle 3 as guidance, we will configure proper static routes on the other
routers to make sure they have routes back to the 172.16.3.0/24 network.
Cisco Public 15
Static Routes with next-hop IP address
Resolving to an Exit Interface
-Recursive route lookup - Occurs when the router has to perform multiple
lookups in the routing table before forwarding a packet. A static route that
forwards all packets to the next-hop IP address goes through the following
process (reclusive route lookup)
(Step 1) The router first must match static route’s destination IP
address with the Next hop address
The packet's destination IP address is matched to the static route
192.168.2.0/24 with the next-hop IP address 172.16.2.2.
(Step 2) The next hop address is then matched to an exit interface
The next-hop IP address of the static route, 172.16.2.2, is matched to the
directly connected network 172.16.2.0/24 with the exit interface of Serial 0/0/0.
Cisco Public 16
Static Routes with Exit Interfaces
Configuring a Static route with an Exit
Interface
-Static routes configured with an exit interface
are more efficient
–The routing table can resolve the exit interface
in a single search instead of 2 searches
If the static route cannot be resolved to an
exit interface, the static route is removed from
the routing table
–Notice from the debug output that all three
static routes were deleted when the Serial 0/0/0
interface was shut down.
–They were deleted because all three static
routes were resolved to Serial 0/0/0.
–However, the static routes are still in the R1's
running configuration. If the interface comes
back up (is enabled again with no shutdown),
the IOS routing table process will reinstall these
static routes back into the routing table.
Cisco Public 17
Static Routes with Exit Interfaces
Modifying Static routes
Existing static routes cannot be modified. The old static route
must be deleted by placing no in front of the ip route
Example:
-no ip route 192.168.2.0 255.255.255.0 172.16.2.2
A new static route must be rewritten in the configuration
R1(config)# no ip route 192.168.2.0 255.255.255.0 172.16.2.2
R1(config)#ip route 192.168.2.0 255.255.255.0 serial 0/0/0
Cisco Public 18
Static Routes with Exit Interfaces
Verifying the Static Route Configuration
-Use the following commands
Step 1 show running-config
Step 2 verify static route has been entered correctly
Step 3 show ip route
Step 4 verify route was configured in routing table
Step 5 issue ping command to verify packets can
reach destination and that Return path is working
Cisco Public 19
Summary and Default Route
Summarizing routes reduces the size of the routing
table.
Route summarization is the process of combining a
number of static routes into a single static route.
–For example, the networks 10.0.0.0/16, 10.1.0.0/16,
10.2.0.0/16, 10.3.0.0/16, 10.4.0.0/16, 10.5.0.0/16, all the way
through 10.255.0.0/16 can be represented by a single network
address: 10.0.0.0/8.
Multiple static routes can be summarized into a single
static route if:
–The destination networks can be summarized into a single
network address, and
–The multiple static routes all use the same exit-interface or
next-hop IP address
Cisco Public 20
Calculating a summary route
Here's the process of creating the summary route
172.16.1.0/22, as shown in the figure:
1. Write out the networks that you want to summarize in
binary.
2. To find the subnet mask for summarization, start with
the left-most bit.
3. Work your way to the right, finding all the bits that
match consecutively.
4. When you find a column of bits that do not match,
stop. You are at the summary boundary.
5. Now, count the number of left-most matching bits,
which in our example is 22. This number becomes
your subnet mask for the summarized route, /22 or
255.255.252.0
6. To find the network address for summarization, copy
the matching 22 bits and add all 0 bits to the end to
make 32 bits.
By following these steps, we can discover that the 3
static routes on R3 can be summarized into a single
static route, using the summary network address of
172.16.0.0 255.255.252.0:
ip route 172.16.0.0 255.255.252.0 Serial0/0/1
Cisco Public 21
Example: Calculating a summary route
Which address can be used to
summarize networks 172.168.0.0 /24
through 172.168.7.0 /24?
10101100 10101000 00000000 00000000
10101100 10101000 00000001 00000000
10101100 10101000 00000010 00000000
10101100 10101000 00000011 00000000
10101100 10101000 00000100 00000000
10101100 10101000 00000101 00000000
10101100 10101000 00000110 00000000
10101100 10101000 00000111 00000000
Answer:
Cisco Public 22
Example: Calculating a summary route
Which address can be
used to summarize
networks 11000000 00000001 00000001 00000000
• 192.1.1.0/27 11000000 00000001 00000001 00100000
• 192.1.1.32/27 11000000 00000001 00000001 01000000
• 192.1.1.64/28 11000000 00000001 00000001 01010000
• 192.1.1.80/28 11000000 00000001 00000001 01100000
• 192.1.1.96/29 11000000 00000001 00000001 01101000
• 192.1.1.104/29 11000000 00000001 00000001 01110000
• 192.1.1.112/29 11000000 00000001 00000001 01111000
• 192.1.1.120/29
Answer:
Cisco Public 23
Summary Route
Static routes and subnet masks
–The routing table lookup process will use the most specific match
when comparing destination IP address and subnet mask
–For example, what if we had the following two static routes in the
routing table
•172.16.0.0/24 is subnetted, 3 subnets
•S 172.16.1.0 is directly connected, Serial0/0/0 and
•S 172.16.0.0/16 is directly connected, Serial0/0/1
–Consider a packet with the destination IP address 172.16.1.10. This
IP address matches both routes.
•The routing table lookup process will use the most-specific match.
•Because 24 bits match the 172.16.1.0/24 route, and only 16 bits of
the 172.16.0.0/16 route match, the static route with the 24 bit match
will be used.
•This is the longest match.
Cisco Public 24
Default Route
Default Static Route
This is a route that will match all packets.
Like route summarization this will help reduce
the size of the routing table
Default static routes are used:
–When no other routes in the routing table match the
packet's destination IP address. A common use is
when connecting a company's edge router to the ISP
network.
–When a router has only one other router to which it
is connected. This condition is known as a stub
router.
Configuring a default static route
Similar to configuring a static route. Except
that destination IP address and subnet mask
are all zeros
Example:
-Router(config)#ip route 0.0.0.0 0.0.0.0
[exit-interface | ip-address ]
Cisco Public 25
Summary and Default Route
R1 is a stub router.
–It is only connected to R2.
–Currently R1 has three static routes,
which are used to reach all of the remote
networks in our topology.
–All three static routes have the exit
interface Serial 0/0/0, forwarding packets
to the next-hop router R2.
R1 is an ideal candidate to have all
of its static routes replaced by a
single default route.
–First, delete the three static routes
–Next, configure the single default static
route using the same Serial 0/0/0 exit
interface
R1(config)#ip route 0.0.0.0 0.0.0.0 serial 0/0/0
Cisco Public 26
Static Routes and Packet Forwarding
Verify the change to the routing table
with the show ip route command
S* 0.0.0.0/0 is directly connected, Serial0/0/0
–Note the * or asterisk next to the S.
•As you can see from the Codes table in
the figure, the asterisk indicates that this
static route is a candidate default route.
–The key to this configuration is the /0
mask.
•We previously said that it is the subnet
mask in the routing table that determines
how many bits must match between the
destination IP address of the packet and
the route in the routing table.
•A /0 mask indicates that zero or no bits
are needed to match.
Cisco Public 27
Dynamic Routing Protocols
Dynamic routing protocols are usually
used in larger networks to ease the
administrative and operational overhead
of using only static routes.
Typically, a network uses a combination
of both a dynamic routing protocol and
static routes.
Cisco Public 28
The Evolution of Dynamic Routing Protocols
One of the earliest routing protocols was Routing Information Protocol (RIP).
–RIP has evolved into a newer version RIPv2. However,
–The newer version of RIP still does not scale to larger network implementations.
To address the needs of larger networks, two advanced routing protocols were
developed: Open Shortest Path First (OSPF) and Intermediate System-to-
Intermediate System (IS-IS).
Cisco developed Interior Gateway Routing Protocol (IGRP) and Enhanced IGRP
(EIGRP), which also scales well in larger network implementations.
Additionally, there was the need to interconnect different internetworks and provide
routing among them. Border Gateway Routing (BGP) protocol is now used between
ISPs as well as between ISPs and their larger private clients to exchange routing
information.
With the advent of numerous consumer devices using IP, the IPv4 addressing space
is nearly exhausted. Thus IPv6 has emerged. To support the communication based
on IPv6, newer versions of the IP routing protocols have been developed (see the
IPv6 row in the table).
Cisco Public 29
Dynamic Routing Protocols
Function(s) of Dynamic Routing Protocols:
–-Dynamically share information between routers.
–-Automatically update routing table when topology changes.
–-Determine best path to a destination.
–Compared to static routing, dynamic routing protocols require less administrative
overhead.
•However, the expense of using dynamic routing protocols is dedicating part of a router's
resources for protocol operation including CPU time and network link bandwidth.
– One of the primary benefits to using a dynamic routing protocol is that routers
exchange routing information whenever there is a topology change. This exchange
allows routers to automatically learn about new networks and also to find alternate
paths when there is a link failure to a current network.
Cisco Public 30
Dynamic Routing Protocols
A routing protocol
–is a set of processes, algorithms, and messages that are used to
exchange routing information and populate the routing table with the
routing protocol's choice of best paths
The purpose of a dynamic routing protocol is to:
–-Discover remote networks
–-Maintaining up-to-date routing information
–-Choosing the best path to destination networks
–-Ability to find a new best path if the current path is no longer
available
Cisco Public 31
Dynamic Routing Protocols
Components of a routing protocol
–Data structures
•Some routing protocols use tables and/or databases for its operations.
This information is kept in RAM
–Algorithm
•Algorithm is a finite list of steps used in accomplishing a task
•Algorithms are used for facilitating routing information and best path
determination
–Routing protocol messages
•These are messages for discovering neighbors and exchange of
routing information , and other tasks to learn and maintain accurate
information about the network.
Cisco Public 32
Dynamic Routing Protocols
Advantages of static routing Advantages of dynamic routing
–-It can backup multiple -Administrator has less work
interfaces/networks on a router maintaining the configuration when
–-Minimal CPU processing adding or deleting networks.
–-Easier for administrator to -Protocols automatically react to the
understand
topology changes.
–-Easy to configure
–-No extra resources are needed -Configuration is less error-prone.
–-More secure -More scalable, growing the network
usually does not present a problem
Disadvantages of static routing
–-Network changes require manual Disadvantages of dynamic routing
reconfiguration -Router resources are used (CPU
–-Configuration and maintenance is cycles, memory and link bandwidth).
time-consuming
-More administrator knowledge is
–-Does not scale well in large
topologies required for configuration,
–-Configuration is error-prone, verification, and troubleshooting.
especially in large networks
Cisco Public 33
Classifying Routing Protocols
Dynamic routing protocols:
–RIP
•A distance vector interior routing protocol
–IGRP
•The distance vector interior routing
developed by Cisco (deprecated from 12.2
IOS and later)
–EIGRP
•The advanced distance vector interior
routing protocol developed by Cisco
–OSPF
•A link-state interior routing protocol
–IS-IS
•A link-state interior routing protocol
–BGP
•A path vector exterior routing protocol
Cisco Public 34
Classifying Routing Protocols
An autonomous system (AS) - otherwise known as a
routing domain - is a collection of routers under a
common administration.
Because the Internet is based on the ASs concept, two
types of routing protocols are required: interior and
exterior routing protocols.
–-Interior Gateway Protocols (IGP)
•are used for intra-autonomous system routing - routing
inside an autonomous system
•IGPs are used for routing within a routing domain, those
networks within the control of a single organization.
–An autonomous system is commonly comprised of many
individual networks belonging to companies, schools, and
other institutions.
• IGPs for IP include RIP, IGRP, EIGRP, OSPF, and IS-IS
–-Exterior Gateway Protocols (EGP)
•are used for inter-autonomous system routing - routing
between autonomous systems that are under the control
of different administrations
•At the ISP level, there are often more important issues
than just choosing the fastest path.
•BGP is typically used between ISPs and sometimes
between a company and an ISP
–
Cisco Public 35
Classifying Routing Protocols
IGP: Comparison of Distance Vector & Link
State Routing Protocols
–Distance vector
– routes are advertised as vectors of distance &
direction.
•Distance is defined in terms of a metric such as hop
count (RIP)
•Direction is simply the next-hop router or exit
interface
•Distance vector protocols typically use the Bellman-
Ford algorithm for the best path route determination
– incomplete view of network topology.
•Distance vector protocols use routers as sign posts
along the path to the final destination.
•Distance vector routing protocols do not have an
actual map of the network topology
– Generally, periodic updates.
•Some distance vector protocols periodically send
complete routing tables to all connected neighbors.
Cisco Public 36
Classifying Routing Protocols
IGP: Comparison of Distance Vector &
Link State Routing Protocols
–Link state
– complete view of network topology is created.
•The sign posts along the way from source to
destination are not necessary, because all link-
state routers are using an identical "map" of the
network.
– updates are not periodic.
•After the network has converged, a link-state
update only sent when there is a change in the
topology.
–
Cisco Public 37
Classifying Routing Protocols
Comparison of Distance Vector & Link State Routing Protocols
Cisco Public 38
Classifying Routing Protocols
Classful routing protocols
–Do NOT send subnet mask in routing updates,
–Do NOT support VLSM,
–Classful routing protocols cannot be used when
a network is subnetted using more than one
subnet mask,
•This does not mean you can not subnet the
clasasfull network. You can still subnet it,
but can only do it once and all network needs
to have the identical mask.
– Routing protocols such as RIPv1 and IGRP.
Cisco Public 40
Routing Protocols Metrics
To select the best path, the routing
protocol must be able to evaluate and
differentiate between the available paths.
For this purpose a metric is used.
Metric
–A value used by a routing protocol to
determine which routes are better than others.
Each routing protocol uses its own metric.
–RIP uses hop count,
•The hop count refers to the number of routers
a packet must cross to reach the destination
network.
•For R3 in the figure, network 172.16.3.0 is two
hops, or two routers away.
–EIGRP uses a combination of bandwidth and
delay,
–OSPF uses bandwidth (cost).
Cisco Public 41
Routing Protocols Metrics
Metrics used in IP routing protocols
–Bandwidth
•Influences path selection by preferring the path
with the highest bandwidth
–Cost
•A value determined either by the IOS or by the
network administrator to indicate preference for a OSPF
route. Cost can represent a metric, a combination
of metrics or a policy.
–Delay RIP
•Considers the time a packet takes to traverse a
path
–Hop count
•A simple metric that counts the number of routers
a packet must traverse
–Load
•Considers the traffic utilization of a certain link
–Reliability
•Assesses the probability of a link failure,
calculated from the interface error count or
previous link failures
Cisco Public 42
Routing Protocols Metrics
The Metric Field in the Routing Table
Metric used for each routing protocol
–-RIP - hop count
–-IGRP & EIGRP - Bandwidth (used by
default), Delay (used by default), Load,
Reliability
–-IS-IS & OSPF – Cost, Bandwidth
(Cisco’s implementation)
Refer to the example in the figure The
routers are using the RIP routing
protocol.
–The metric associated with a certain
route can be best viewed using the
show ip route command.
–The metric value is the second value in
the brackets for a routing table entry.
–In the figure, R2 has a route to the
192.168.8.0/24 network that is 2 hops
away.
•R 192.168.8.0/24 [120/2] via
192.168.4.1, 00:00:26, Serial0/0/1
Cisco Public 43
Routing Protocols Metrics
Load balancing
–when two or more routes to the same
destination have identical metric values
–This is the ability of a router to
distribute packets among multiple same
cost paths
R2 load balances
traffic to PC5 over two
equal cost paths.
Cisco Public 44
Unequal Cost Load Balancing with EIGRP
Cisco Public 46
Administrative Distance of a Route
Administrative distance is an integer value from 0 to 255.
The lower the value the more preferred the route source.
–An administrative distance of 0 is the most preferred.
–Only a directly connected network has an administrative distance
of 0, which cannot be changed
–An administrative distance of 255 means the router will not believe
the source of that route and it will not be installed in the routing
table.
Cisco Public 47
Administrative Distance of a Route
Identifying the Administrative Distance (AD) in a routing
table
–It is the first number in the brackets in the routing table
Cisco Public 49
Administrative Distance of a Route
Directly connected routes
–-Immediately appear in the routing table as soon as the
interface is configured
Cisco Public 50
Administrative Distance of a Route
Directly connected routes
–Have a default AD of 0
Static Routes
–Administrative distance of a static route has a default value of 1
A static route using either a next-hop IP address or an exit
interface has a default AD value of 1.
–However, the AD value is not listed in show ip route when you
configure a static route with the exit interface specified. When a static
route is configured with an exit interface, the output shows the network
as directly connected via that interface.
Cisco Public 51