You are on page 1of 40

Chapter 6

 Routing

[Chapter 6: Routing]
Version 1.0
Chapter 6
 Routing

Overview and Objectives


 By the end of this chapter, you will have learned about:
• Basic concepts of routing
• Static route
• Routing Information Protocol (RIP)
 This new knowledge will be consolidated by a hands-on exercise.

2
Chapter 6
 Routing

Routing: Basic Concepts


 Routing is usually defined as using a Layer 3 device to forward data
packets between networks.
 The routing process uses routing tables, network protocols, and
routing algorithms to select the most efficient path for forwarding
the IP packet.
 The router must keep the routing table updated and exchange it
with neighboring routers in either a static or dynamic way.

3
Chapter 6
 Routing

Routing: Basic Concepts (cont’d)


 There are four main types of entries in the routing table:
• Static Route
• Dynamic Route
• Default Route
• Local Route

4
Chapter 6
 Routing

The Routing Table


 The routing table holds only one entry per network.
 If there is more than one path to the same destination, the routing
process needs to be able to select which source of information
should be used in the routing table.
 The entries in the routing table are learned either statically or
dynamically.

5
Chapter 6
 Routing

Routing Metrics

6
Chapter 6
 Routing

Routing Methods
 There are two main routing methods used widely:
• Distance vector routing, where the router needs to know the direction
(vector) in which to send the packets.
• Link state routing, where the router needs to have its own map of the
network’s topology.

7
Chapter 6
 Routing

Routing Preference

Protocol Preference
Local 0
Default 1
Static 60
RIP 100
OSPF Intra 80
OSPF Inter 90
OSPF ExtT1 110
OSPF ExtT2 115
EBGP 70
IBGP 130

8
Chapter 6
 Routing

Classful and Classless Routing


 Classful routing protocols do not include the subnet mask with
the route advertisement. Example: RIPv1.
 Classless routing protocols include the subnet mask with the
route advertisement. Examples: RIPv2, OSPF.

9
Chapter 6
 Routing

Distance Vector Routing Protocol (DVRP)


 Distance vector is an approach to finding routes between
networks. A router using a Distance Vector Routing Protocol (DVRP)
exchanges information with its neighbors and determines the route
based on the factors of distance and vector:
• “Distance” uses metrics, i.e. number of hops to the destination.
• “Vector” refers to the direction leading to the destination.
 Examples of DVRPs:
• Routing Information Protocol (RIP) for IP
• Cisco System Interior Gateway Routing Protocol (IGRP)
• Xerox Networking System (XNS) RIP
• Novell IPX RIP
• AppleTalk Routing Table Maintenance Protocol (RTMP)

10
Chapter 6
 Routing

How the DVRP algorithm works?


10.0.1.0 10.0.2.0 10.0.3.0 10.0.4.0 10.0.5.0
.1 .1 .2 .1 .2 .1 .2 .1
Router A Router B Router C Router D

t0 NET VIA HOP NET VIA HOP NET VIA HOP NET VIA HOP

10.0.1.0 -- 0 10.0.2.0 -- 0 10.0.3.0 -- 0 10.0.4.0 -- 0


10.0.2.0 -- 0 10.0.3.0 -- 0 10.0.4.0 -- 0 10.0.5.0 -- 0

t1
NET VIA HOP NET VIA HOP NET VIA HOP NET VIA HOP

10.0.1.0 -- 0 10.0.2.0 -- 0 10.0.3.0 -- 0 10.0.4.0 -- 0


10.0.2.0 -- 0 10.0.3.0 -- 0 10.0.4.0 -- 0 10.0.5.0 -- 0
10.0.3.0 10.0.2.2 1 10.0.1.0 10.0.2.1 1 10.0.2.0 10.0.3.1 1 10.0.3.0 10.0.4.1 1
10.0.4.0 10.0.3.2 1 10.0.5.0 10.0.4.2 1

t2
NET VIA HOP NET VIA HOP NET VIA HOP NET VIA HOP

10.0.1.0 -- 0 10.0.2.0 -- 0 10.0.3.0 -- 0 10.0.4.0 -- 0


10.0.2.0 -- 0 10.0.3.0 -- 0 10.0.4.0 -- 0 10.0.5.0 -- 0
10.0.3.0 10.0.2.2 1 10.0.1.0 10.0.2.1 1 10.0.2.0 10.0.3.1 1 10.0.3.0 10.0.4.1 1
10.0.4.0 10.0.2.2 2 10.0.4.0 10.0.3.2 1 10.0.5.0 10.0.4.2 1 10.0.2.0 10.0.4.1 2
10.0.5.0 10.0.3.2 2 10.0.1.0 10.0.3.1 2

t3
NET VIA HOP NET VIA HOP NET VIA HOP NET VIA HOP

10.0.1.0 -- 0 10.0.2.0 -- 0 10.0.3.0 -- 0 10.0.4.0 -- 0


10.0.2.0 -- 0 10.0.3.0 -- 0 10.0.4.0 -- 0 10.0.5.0 -- 0
10.0.3.0 10.0.2.2 1 10.0.1.0 10.0.2.1 1 10.0.2.0 10.0.3.1 1 10.0.3.0 10.0.4.1 1
10.0.4.0 10.0.2.2 2 10.0.4.0 10.0.3.2 1 10.0.5.0 10.0.4.2 1 10.0.2.0 10.0.4.1 2
10.0.5.0 10.0.2.2 3 10.0.5.0 10.0.3.2 2 10.0.1.0 10.0.3.1 2 10.0.1.0 10.0.4.1 3 11
Chapter 6
 Routing

Illustration of an invalid timer


10.0.1.0 10.0.2.0 10.0.3.0 10.0.4.0 10.0.5.0

.1 .1 .2 .1 .2 .1 .2 .1
Router A Router B Router C Router D

NET VIA HOP NET VIA HOP NET VIA HOP NET VIA HOP

10.0.1.0 -- 0 10.0.2.0 -- 0 10.0.3.0 -- 0 10.0.4.0 -- 0


10.0.2.0 -- 0 10.0.3.0 -- 0 10.0.4.0 -- 0 10.0.5.0 -- 0
10.0.3.0 10.0.2.2 1 10.0.1.0 10.0.2.1 1 10.0.2.0 10.0.3.1 1 10.0.3.0 10.0.4.1 1
10.0.4.0 10.0.2.2 2 10.0.4.0 10.0.3.2 1 10.0.5.0 10.0.4.2 1 10.0.2.0 10.0.4.1 2
10.0.5.0 10.0.2.2 3 10.0.5.0 10.0.3.2 2 10.0.1.0 10.0.3.1 2 10.0.1.0 10.0.4.1 3

12
Chapter 6
 Routing

Split Horizon
10.0.1.0 10.0.2.0 10.0.3.0 10.0.4.0 10.0.5.0
.1 .1 .2 .1 .2 .1 .2 .1
Router A Router B Router C Router D

Routing Update Routing Update

NET VIA HOP NET VIA HOP


10.0.4.0 -- 0 10.0.3.0 -- 0
10.0.5.0 10.0.4.2 1 10.0.2.0 10.0.3.1 1
10.0.1.0 10.0.3.1 2

13
Chapter 6
 Routing

Counting to Infinity

10.0.4.0 10.0.5.0
A B
Link Failure
10.0.1.0 10.0.3.0
10.0.2.0

C D

10.0.1.0 10.0.2.0 10.0.3.0 10.0.4.0 10.0.5.0


A B C D
.1 .1 .2 .1 .2 .1 .2 .1 Link Failure

Routing update Routing update Routing Routing update


10.0.5.0 is 10.0.5.0 is update 10.0.5.0 is
unreachable unreachable 10.0.5.0 is unreachable
unreachable

14
Chapter 6
 Routing

Holddown Timer
 Holddown timer is a mechanism to prevent a router from accepting
any changes to a route for a period of time so that some problems,
like interface flapping, do not impact the network.

10.0.1.0 10.0.2.0 10.0.3.0 10.0.4.0


A B C
.1 .1 .2 .1 .2 .1 Link Failure

Bad Routing Bad Routing Bad Routing Bad Routing


Update Update Update Update
Holddown Timer Holddown Timer Holddown Timer Holddown Timer

15
Chapter 6
 Routing

Holddown Timer (cont’d)

Interface of a Router Down/Up Process

Holddown Timer Holddown Timer

Poison Reverse Poison Reverse


10.0.1.0 10.0.2.0 10.0.3.0 10.0.4.0
A B C
.1 .1 .2 .1 .2 .1 Link Failure

10.0.4.0 is 10.0.4.0 is
unreachable!
reachable! unreachable!
reachable!

Page is animated 16
Chapter 6
 Routing

Routing Information Protocol Version 1 (RIPv1)


 RIPv1 is defined in RFC 1058.
 All RIP messages are encapsulated in a User Datagram Protocol
(UDP).
 RIPv1 defines two types of messages:
• Request message
• Response message
 It uses classful routing. The routing updates do not carry subnet
information and lack support for Variable Length Subnet Masks
(VLSM).
 There is no router authentication mechanism.
 Routes update via broadcast.
 RIP permits a hop count of up to 15.

17
Chapter 6
 Routing

RIPv1 Packet Format


0 31

Command Version Must be zero


Address Family
Must be zero
Route Entry 1

Identifier
IP Address
Must be zero
Must be zero
Metric
…………
Address Family
Must be zero
Route Entry 2

Identifier
IPv4 Address
Must be zero
Must be zero
Metric

Note: 1 RIP packet can contain a


maximum of 25 route entries.

18
Chapter 6
 Routing

RIPv1 Request Message Type and Process

Router A Router B
100.100.100.100 10.1.1.1 10.1.1.2 200.200.200.200

Initially, both Routers A and B send To: 255.255.255.255


1 the request to each other with
broadcast. To: 255.255.255.255

To: 10.1.1.2
Routers A and B reply to each other
2
with the full routing table. To: 10.1.1.1

To: 255.255.255.255
A periodic update will be
3
forwarded with a broadcast packet. To: 255.255.255.255

Page is animated 19
Chapter 6
 Routing

RIPv1 Request/Response Packets


 Request Packet

 Response Packet

20
Chapter 6
 Routing

Classful Routing
Address Class Most Significant Bit Value Ranges
Class A 0000 0.0.0.0 to 126.255.255.255
Class B 1000 128.0.0.0 to 191.255.255.255
Class C 1100 192.0.0.0 to 223.255.255.255
Class D 1110 224.0.0.0 to 239.255.255.255
Class E 1111 240.0.0.0 to 255.255.255.255

10.10.20.64
10.10.20.192
10.15.75.64
192.168.1.0 10.93.1.1
10.100.3.5

192.168.1.32
192.168.1.64
192.168.1.96 10.0.0.0
192.168.1.128

Network boundary

Route summarization at boundary routers


21
Chapter 6
 Routing

Routing Information Protocol Version 2 (RIPv2)


 The RIPv2 specification (RFC 2453) allows more information to be
included within RIP packets.
 It provides a simple authentication mechanism that was not
supported in RIPv1.
 RIPv2 is a classless routing protocol. Compared with RIPv1, RIPv2
has the following advantageous features:
• Mask information carried for each route entry
• Designated next hop to select the best next hop on broadcast networks
• Multicast routing update to reduce resource consumption
• Plain text authentication and MD5 authentication to enhance security

22
Chapter 6
 Routing

RIPv2 Packet Format


0 31
Command Version Must be zero
Address Family
Route Tag
Route Entry 1

Identifier
IPv4 Address
Subnet Mask
Next Hop
Metric
…………
Address Family
Route Tag
Route Entry 2

Identifier
IP Address
Subnet Mask
Next Hop
Metric

23
Chapter 6
 Routing

RIPv2 Request Message Type and Process

Router A Router B
100.1.1.0 10.1.1.1 10.1.1.2 200.1.1.0

Initially, both Routers A and B send To: 224.0.0.9


1 the request to each other with
multicast. To: 224.0.0.9

To: 10.1.1.2
Routers A and B reply to each
2
other with the full routing table. To: 10.1.1.1

To: 224.0.0.9
A periodic update will be
3
forwarded with a multicast packet. To: 224.0.0.9

Page is animated 24
Chapter 6
 Routing

RIPv2 Process: Initial Negotiation

25
Chapter 6
 Routing

RIPv2 Process: Periodic Update

26
Chapter 6
 Routing

Example: RIPv1
DGS-3627-1 DGS-3627-2
100.1.1.1 10.1.1.1 10.1.1.2 200.1.1.1

 Enable RIPv1 for both switches


enable rip
config rip all tx_mode v1_only rx_mode v1_only state enable

DGS-3627-1:admin#sh iproute  Check interface status


Command: show iproute

Routing Table
IP Address/Netmask Gateway Interface Cost Protocol
------------------ --------- --------- ------ --------
10.1.1.0/24 0.0.0.0 System 1 Local
100.1.1.0/24 0.0.0.0 int1 1 Local
200.1.1.0/24 10.1.1.2 System 2 RIP

DGS-3627-1:admin#sh rip  Check RIP version and status


Command: sh rip

RIP Global State : Enabled

RIP Interface Settings


Interface IP Address TX Mode RX Mode Authentication State
--------- ------------ ------- ------- -------------- -------
System 10.1.1.1/24 V1 Only V1 Only Disabled Enabled
Int1 100.1.1.1/24 V1 Only V1 Only Disabled Enabled

Total Entries : 2

27
Chapter 6
 Routing

Example: RIPv2
DGS-3627-1 DGS-3627-2
100.1.1.1 10.1.1.1 10.1.1.2 200.1.1.1

 Enable RIPv2 for both switches


enable rip
config rip all tx_mode v2_only rx_mode v2_only state enable

DGS-3627-1:admin#sh iproute  Check interface status


Command: show iproute

Routing Table
IP Address/Netmask Gateway Interface Cost Protocol
------------------ --------- --------- ------ --------
10.1.1.0/24 0.0.0.0 System 1 Local
100.1.1.0/24 0.0.0.0 int1 1 Local
200.1.1.0/24 10.1.1.2 System 2 RIP

DGS-3627-1:admin#sh rip  Check RIP version and status


Command: sh rip

RIP Global State : Enabled

RIP Interface Settings


Interface IP Address TX Mode RX Mode Authentication State
--------- ------------ ------- ------- -------------- -------
System 10.1.1.1/24 V2 Only V2 Only Disabled Enabled
Int1 100.1.1.1/24 V2 Only V2 Only Disabled Enabled

Total Entries : 2

28
Chapter 6
 Routing

Example: RIP Authentication


DGS-3627-1:admin#config rip all DGS-3627-1:admin#sh rip
authentication enable key Command: show rip
Command: config rip all authentication RIP Global State : Enabled
enable key
RIP Interface Settings
Success. Interface IP Address TX Mode RX Mode Authen- State
tication
--------- ------------ ------- ------- -------- -------
System 10.1.1.1/24 V2 Only V2 Only Enabled Enabled
Int1 100.1.1.1/24 V2 Only V2 Only Enabled Enabled

Total Entries : 2

DGS-3627-1 DGS-3627-2
100.1.1.1 10.1.1.1 10.1.1.2 200.1.1.1

29
Chapter 6
 Routing

Configuring Static Route


and RIP

30
Chapter 6
 Routing

Create iproute command


 This command is used to create an IP route entry to the switch’s IP
routing table.
DGS-3627:admin#
create iproute [default | <network_address>] [null0 |
<ipaddr> {<metric 1-65535>} {[primary | backup |
weight <value 1-4>]}]

31
Chapter 6
 Routing

Delete iproute command


 This command is used to delete an IP route entry from the switch’s
IP routing table.
DGS-3627:admin#
delete iproute [default | <network_address>] [null0 |
<ipaddr>]

32
Chapter 6
 Routing

Show iproute command


 This command is used to display the switch’s current IP routing
table.
DGS-3627:admin#
show iproute {[<network_address> | <ipaddr>]}
{[static | rip | ospf | bgp | hardware]}

33
Chapter 6
 Routing

Enable rip command


 This command is used to enable the RIP routing protocol.

DGS-3627:admin#
enable rip

34
Chapter 6
 Routing

Config rip command


 This command is used to configure RIP on the switch.
DGS-3627:admin#
config rip [ipif <ipif_name 12>|all] {authentication
[ enable <password 16> | disable ] | tx_mode [disable
| v1_only | v1_compatible | v2_only] | rx_mode
[v1_only | v2_only | v1_or_v2 | disable] | state
[enable | disable]}

35
Chapter 6
 Routing

Show rip command


 This command is used to display the RIP configuration and statistics
for the switch.
DGS-3627:admin#
show rip {ipif <ipif_name 12>}

36
Chapter 6
 Routing

Config route preference command


 This command is used to configure route type preference.

DGS-3627:admin#
config route preference [static | default | rip |
ospfIntra | ospfInter | ospfExt1 | ospfExt2 | ebgp |
ibgp] <value 1-999>

37
Chapter 6
 Routing

Show route preference command


 This command is used to display the route preference of each route
type.
DGS-3627:admin#
show route preference {[ local | static | default |
rip | ospf | ospfIntra | ospfInter | ospfExt1 |
ospfExt2 | ebgp | ibgp]

38
Chapter 6
 Routing

Summary
 This chapter introduces routing, including the static route and the
dynamic route.
 A static route is configured by the administrator manually. For a
dynamic route, a routing protocol is configured and  routing updates
are received automatically.
 RIP is an example of a routing protocol. It has two versions: RIPv1,
a classful routing protocol, and RIPv2, a classless routing protocol. 

39
Chapter 6
 Routing

Lab Topology

40

You might also like