You are on page 1of 21

Static and Dynamic Routing

Basic Routing Concepts


• What is a Router?
A router is a specialized computer which can
connect multiple networks to allow exchange
of packets between them.
Basic Routing Concepts
• Router Functions
 Learn which networks/subnets are available
 In case there are multiple paths, choose the best
one
 Keep (routing table) up-to-date
 Translate layer 2 headers (disparate network
connections)
 Keep loop-free paths
 Make forwarding decisions based on layer 3
headers
Basic Router Configuration
(Review)
 The Show Command
 Hostname
 Console Password
 Telnet Password
 Enable Password
 Logon Banner
 IP Address
 Shutdown
 Saving Configurations
Static Routing
Static Routing
• Routers only know DIRECTLY connected networks.
• You have to “ teach” the router what is beyond what is
connected to it.

Router(config)# ip route network-address subnet-mask { ip-


address | exit-intf [ip-address]} [distance]

Note: Either the ip-address, exit-intf, or the ip-address and exit-intf parameters must be
configured.
Static Routing

R1(config)# ip route 172.16.2.0 255.255.255.0 172.16.4.2

Or

R1(config)# ip route 172.16.2.0 255.255.255.0 S0/0/0

Remember: Routing is 2 way!


Default Static Route

• A default route is a static route that


matches all packets. A single default
route represents any network that is not
in the routing table.
• Routers commonly use default routes
that are either configured locally or
learned from another router. The default
route is used as the Gateway of Last
Resort.
• Default static routes are commonly used
when connecting an edge router to a
service provider network, or a stub
router (a router with only one upstream
neighbor router).
• The figure shows a typical default static
route scenario.
Default Static Route (Cont.)

IPv4 Default Static Route: The command syntax for an IPv4 default static route is similar to
any other IPv4 static route, except that the network address is 0.0.0.0 and the subnet mask
is 0.0.0.0. The 0.0.0.0 0.0.0.0 in the route will match any network address.

Note: An IPv4 default static route is commonly referred to as a quad-zero route.

The basic command syntax for an IPv4 default static route is as follows:
Router(config)# ip route 0.0.0.0 0.0.0.0 {ip-address | exit-
intf}

IPv6 Default Static Route: The command syntax for an IPv6 default static route is similar to
any other IPv6 static route, except that the ipv6-prefix/prefix-length is ::/0, which matches all
routes.

The basic command syntax for an IPv6 default static route is as follows:
Router(config)# ipv6 route ::/0 {ipv6-address | exit-intf}
Configure a Default Static Route

The example shows an IPv4 default static route configured on R1. With the
configuration shown in the example, any packets not matching more specific route
entries are forwarded to R2 at 172.16.2.2.

R1(config)# ip route 0.0.0.0 0.0.0.0 172.16.2.2

An IPv6 default static route is configured in similar fashion. With this configuration
any packets not matching more specific IPv6 route entries are forwarded to R2 at
2001:db8:acad:2::2

R1(config)# ipv6 route ::/0 2001:db8:acad:2::2


Verify a Default Static Route
The show ip route static command output from R1 displays the contents of the static routes in the routing
table. Note the asterisk (*) next to the route with code ‘S’. The asterisk indicates that this static route is a
candidate default route, which is why it is selected as the Gateway of Last Resort.

Notice that the static default route configuration uses the /0 mask for IPv4 default routes. Remember that
the IPv4 subnet mask in a routing table 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 none of the bits are
required to match. As long as a more specific match does not exist, the default static route matches all
packets.
Verify a Default Static Route
(Cont.)
This example shows the show ipv6 route static command output to display the contents
of the routing table.

Notice that the static default route configuration uses the ::/0 prefix for IPv6 default
routes. Remember that the IPv6 prefix-length in a routing table determines how many
bits must match between the destination IP address of the packet and the route in the
routing table. A ::/0 prefix indicates that none of the bits are required to match. As long
as a more specific match does not exist, the default static route matches all packets.
Routing Protocols
Concepts
• Routing protocols types :
- Static.
- Dynamic.

• Dynamic routing protocols types:


- Distance vector routing protocols.
- Link state routing protocols.
Dynamic Routing
Protocols
• 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
• 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
Distance Vector Routing
Protocols
– Distance Vector Technology - the Meaning of
Distance Vector
– A router using distance vector routing protocols knows 2 things:
• Distance to final destination
• Vector, or direction, traffic should be directed
– Characteristics of Distance Vector routing protocols:
– Periodic updates
– Neighbors
– Broadcast updates
– Entire routing table is included with routing update
Link State Routing
Protocols
• Link state routing protocols
-Also known as shortest path first algorithms
-These protocols built around Dijkstra’s SPF
• Dikjstra’s algorithm also known as
the shortest path first (SPF)
algorithm
–This algorithm accumulates costs
along each path, from source to
destination.
Link-State Routing
Process
• How routers using Link State Routing Protocols reach convergence
1. Each routers learns about its own directly connected networks
– interface is in the up state
2. Each router is responsible for meeting its neighbors on directly connected
networks
– exchange hello packet to other directly connected link state routers.
3. Each router builds a Link-State Packet (LSP) containing the state of each
directly connected link
– recording all the pertinent information about each neighbor, including
neighbor ID, link type, and bandwidth.
4. Each router floods the LSP to all neighbors, who then store all LSPs
received in a database.
– Each router stores a copy of each LSP received from its neighbors in a
local database.
5. Each router uses the database to construct a complete map of the
topology and computes the best path to each destination network.
– The SPF algorithm is used to construct the map of the topology and to
determine the best path to each network.
Advantages of a Link-State
Routing Protocol

Routing Builds Router can Event driven Use


protocol Topological independentl Convergence routing of
map y determine updates LSP
the shortest
path to every
network.

Distance No No Slow Generally No No


vector

Link State Yes Yes Fast Generally Yes


Yes
Questions ?

You might also like