0% found this document useful (0 votes)
3 views52 pages

IP Routing Basics and Techniques

The document provides an overview of IP routing, emphasizing the importance of routers in facilitating communication between different IP subnets. It covers key concepts such as routing entries, optimal route selection, and the structure of IP routing tables. Additionally, it distinguishes between direct, static, and dynamic routes, explaining how routers manage and forward packets based on this routing information.

Uploaded by

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

IP Routing Basics and Techniques

The document provides an overview of IP routing, emphasizing the importance of routers in facilitating communication between different IP subnets. It covers key concepts such as routing entries, optimal route selection, and the structure of IP routing tables. Additionally, it distinguishes between direct, static, and dynamic routes, explaining how routers manage and forward packets based on this routing information.

Uploaded by

nasrabdulmunem
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

IP Routing Basics

Page 0 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Foreword
⚫ There are typically multiple IP subnets on a typical data communication network.
Layer 3 devices are required to exchange data between these IP subnets. These
devices have the routing capability and can forward data across subnets.
⚫ Routing is the basic element of data communication networks. It is the process of
selecting paths on a network along which packets are sent from a source to a
destination.
⚫ This course introduces the basic concepts of routing.

Page 1 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Objectives
⚫ On completion of this course, you will be able to:
 Understand the basic principles of routers.
 Know how routers select optimal routes.
 Understand the contents of routing tables.
 Master advanced routing features.

Page 2 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Contents
1. Overview of IP Routing
▪ Basic Concepts of Routing

▫ Generation of Routing Entries

▫ Optimal Route Selection

▫ Route-based Forwarding

2. Static Routing

3. Dynamic Routing

4. Advanced Routing Features

Page 3 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Background: Inter-Subnet Communication

M
• An IP address uniquely identifies a node on a
network. Each IP address belongs to a unique
subnet, and each subnet may belong to a
different area of the network.
N
• To implement IP addressing, subnets in
different areas need to communicate with

How to communicate
each other.
with the network M?

Page 4 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.

• A unique network node can be found based on a specific IP address. Each IP address
belongs to a unique subnet. These subnets may be distributed around the world and
constitute a global network.

• To implement communication between different subnets, network devices need to


forward IP packets from different subnets to their destination IP subnets.
Routes
⚫ Routes are the path information used to guide packet forwarding.
⚫ A routing device is a network device that forwards packets to a destination subnet based on routes. The most
common routing device is a router.
⚫ A routing device maintains an IP routing table that stores routing information.
Route-based Packet Forwarding

Router R4

Data R1 R2 R3

N M

Gateway Gateway

Destination-based forwarding

Page 5 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.

• A gateway and an intermediate node (a router) select a proper path according to the
destination address of a received IP packet, and forward the packet to the next router.
The last-hop router on the path performs Layer 2 addressing and forwards the packet
to the destination host. This process is called route-based forwarding.

• The intermediate node selects the best path from its IP routing table to forward
packets.

• A routing entry contains a specific outbound interface and next hop, which are used to
forward IP packets to the corresponding next-hop device.
Routing Information

⚫ A route contains the following information:


 Destination: identifies a destination subnet.
[Link]
[Link]/24
 Mask: identifies a subnet together with a destination
IP address.
GE0/0/0
[Link]  Outbound interface: indicates the interface through
which a data packet is sent out of the local router.
 Next hop: indicates the next-hop address used by the
IP routing table router to forward the data packet to the destination
Outbound subnet.
Destination/Mask Next Hop
Interface
[Link]/24 GE0/0/0 [Link]
⚫ The information identifies the destination subnet
and specifies the path for forwarding data packets.

Page 6 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.

• Based on the information contained in a route, a router can forward IP packets to the
destination along the required path.

• The destination address and mask identify the destination address of an IP packet.
After an IP packet matches a specific route, the router determines the forwarding path
according to the outbound interface and next hop of the route.

• The next-hop device for forwarding the IP packet cannot be determined based only on
the outbound interface. Therefore, the next-hop device address must be specified.
IP Routing Table

[Link]/8 Outbound
Destination/Mask Next Hop
Interface
R4
• Routers discover routes using multiple
[Link]/8 [Link] GE0/0
[Link]/30 methods.
[Link]/8 [Link] GE0/1
[Link]/8 [Link] GE0/2 • A router selects the optimal route and

GE0/2
[Link]/30 [Link] GE0/2
installs it in its IP routing table.
[Link]/30
[Link]/32 [Link] GE0/2 • The router forwards IP packets based on
GE0/0 GE0/1
[Link]/30
routes in the IP routing table.
[Link]/30 R2
• Routers manage path information by

[Link]/30 managing their IP routing tables.


[Link]/30

R1 R3

[Link]/8 [Link]/8

Page 7 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.

• A router forwards packets based on its IP routing table.

• An IP routing table contains many routing entries.

• An IP routing table contains only optimal routes but not all routes.

• A router manages routing information by managing the routing entries in its IP routing
table.
Contents
1. Overview of IP Routing
▫ Basic Concepts of Routing

▪ Generation of Routing Entries

▫ Optimal Route Selection

▫ Route-based Forwarding

2. Static Routing

3. Dynamic Routing

4. Advanced Routing Features

Page 8 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
How to Obtain Routing Information
• A router forwards packets based on its IP routing table. To implement route-based packet forwarding, the router
needs to obtain routes. The following describes the common methods of obtaining routes.

Direct Routes Static Routes Dynamic Routes


• Direct routes are automatically generated • Static routes are manually configured by • Dynamic routes are learned by dynamic
by devices and point to local directly network administrators. routing protocols running on routers.
connected networks. [Link]/24

GE0/0/0
[Link]/24 [Link]/24
GE0/0/1
[Link]/24

GE0/0/1
Dynamic routing
protocol
GE0/0/2 OSPF

Outbound
Protocol Destination/Mask
Interface Outbound Outbound
Protocol Destination/Mask Protocol Destination/Mask
Direct [Link]/24 GE0/0/0 Interface Interface
Direct [Link]/24 GE0/0/1 Static [Link]/24 GE0/0/1 OSPF [Link]/24 GE0/0/2

Page 9 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.

• Direct routes are the routes destined for the subnets to which directly connected
interfaces belong. They are automatically generated by devices.

• Static routes are manually configured by network administrators.

• Dynamic routes are learned by dynamic routing protocols, such as OSPF, IS-IS, and
BGP.
Direct Routes (1)
Direct Routes
• A direct route is automatically generated by a
device and points to a local directly-connected
GE0/0/0 network.
[Link]/24
[Link]/24
GE0/0/1
[Link]/24 • When a router is the last hop router, IP packets
RTB [Link]/24 to be forwarded will match a direct route and the
router will directly forward the IP packet to the
destination host.
Direct routes in the IP routing table of RTB • When a direct route is used for packet
Destination/ Outbound forwarding, the destination IP address of a
Protocol Next Hop
Mask Interface
packet to be forwarded and the IP address of the
[Link]/24 Direct [Link] GE0/0/0
router‘s outbound interface are in the same
[Link]/24 Direct [Link] GE0/0/1
subnet.

Page 10 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.

• When a packet matches a direct route, a router checks its ARP entries and forwards
the packet to the destination address based on the ARP entry for this destination
address. In this case, the router is the last hop router.

• The next-hop address of a direct route is not an interface address of another device.
The destination subnet of the direct route is the subnet to which the local outbound
interface belongs. The local outbound interface is the last hop interface and does not
need to forward the packet to any other next hop. Therefore, the next-hop address of
a direct route in the IP routing table is the address of the local outbound interface.

• When a router forwards packets using a direct route, it does not deliver packets to the
next hop. Instead, the router checks its ARP entries and forwards packets to the
destination IP address based on the required ARP entry.
Direct Routes (2)
Direct routes

GE0/0/0 GE0/0/1
[Link]/24 [Link]/24
• Not all the direct routes generated for interfaces
GE0/0/0 GE0/0/1
RTA [Link]/24 RTB [Link]/24 RTC are installed in the IP routing table. Only the
direct routes of which the physical status and
protocol status of interfaces are up are installed
in the IP routing table.
Direct routes in the IP routing table of RTB
Outbound
Destination/Mask Protocol Next Hop
Interface
[Link]/24 Direct [Link] G0/0/1

• When GE0/0/0 goes down, the direct route for this interface is
not installed in the IP routing table.

Page 11 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Contents
1. Overview of IP Routing
▫ Basic Concepts of Routing

▫ Generation of Routing Entries

▪ Optimal Route Selection

▫ Route-based Forwarding

2. Static Routing

3. Dynamic Routing

4. Advanced Routing Features

Page 12 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Examining the IP Routing Table
<Huawei> display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 6 Routes : 6

Destination/Mask Proto Pre Cost Flags NextHop Interface

[Link]/32 Static 60 0 D [Link] NULL0


[Link]/32 Static 60 0 D [Link] Vlanif100
[Link]/24 Direct 0 0 D [Link] Vlanif100
[Link]/32 Direct 0 0 D [Link] Vlanif100
[Link]/8 Direct 0 0 D [Link] InLoopBack0
[Link]/32 Direct 0 0 D [Link] InLoopBack0

Destination/Mask Protocol Flag Next-hop Outbound


address interface
Route Cost
preference (Metric)

Page 13 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Fields in the IP Routing Table
⚫ Destination/Mask: indicates the destination network address and mask of a specific route. The subnet address of a
destination host or router is obtained through the AND operation on the destination address and mask. For
example, if the destination address is [Link] and the mask is [Link], the IP address of the subnet to which
the host or router belongs is [Link].
⚫ Proto (Protocol): indicates the protocol type of the route, that is, the protocol through which a router learns the
route.
⚫ Pre (Preference): indicates the routing protocol preference of the route. There may be multiple routes to the same
destination, which have different next hops and outbound interfaces. These routes may be discovered by different
routing protocols or be manually configured. A router selects the route with the highest preference (with the lowest
preference value) as the optimal route.
⚫ Cost: indicates the cost of the route. When multiple routes to the same destination have the same preference, the
route with the lowest cost is selected as the optimal route.
⚫ NextHop: indicates the local router’s next-hop address of the route to the destination network. This field specifies
the next-hop device to which packets are forwarded.
⚫ Interface: indicates the outbound interface of the route. This field specifies the local interface through which the
local router forwards packets.

Page 14 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.

• The Preference field is used to compare routes from different routing protocols, while
the Cost field is used to compare routes from the same routing protocol. In the
industry, the cost is also known as the metric.
Route Preference - Basic Concepts
Comparing Route Preferences • When a router obtains routes to the same
destination subnet from different routing protocols
Routes (these routes have the same destination network
address and mask), the router compares the

Different
preferences of these routes and prefers the route
Destination Installed in the IP
subnet/mask routing table with the lowest preference value.
Same • A lower preference value indicates a higher
Higher Preference preference.
Preference
• The route with the highest preference is installed in
the IP routing table.

Page 15 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Route Preference - Comparison Process
Comparing Route Preferences

Dynamic routing
protocol [Link]/30 • RTA discovers two routes to [Link]/30, one is
OSPF
[Link]/30
[Link]/30
an OSPF route and the other a static route. In
this case, RTA compares the preferences of the
RTA
[Link]/30 [Link]/30 two routes and selects the route with the lowest
preference value.
• Each routing protocol has a unique preference.
Route entries of RTA
• OSPF has a higher preference. Therefore, the
Destination/Mask Protocol Preference Next Hop

[Link]/30 Static 60 [Link] Installed OSPF route is installed in the IP routing table.
in the IP
[Link]/30 OSPF 10 [Link] routing
table

Page 16 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.

• RTA learns two routes to the same destination, one is a static route and the other an
OSPF route. It then compares the preferences of the two routes, and prefers the OSPF
route because this route has a higher preference. RTA installs the OSPF route in the IP
routing table.
Metric - Comparison Process
Metric comparison

Dynamic routing • RTA learns two routes with the same


protocol [Link]/30
OSPF destination address ([Link]/30) and
Cost=10 Cost=10 [Link]/30
[Link]/30 preference through OSPF. In this case, RTA
Cost=10
RTA needs to compare the metrics of the two
[Link]/30 [Link]/30
routes.
• The two routes have different metrics. The
OSPF route with the next hop being [Link]
Route entries of RTA
has a lower metric (with the cost 10), so it is
Destination/Mask Protocol Cost Next Hop
[Link]/30 OSPF 20 [Link] Installed installed in the IP routing table.
in the IP
[Link]/30 OSPF 10 [Link] routing
table

Page 17 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Route Preference - Common Default Values
⚫ The following table lists the default preference values of common route types:

Protocol Route Type Default Preference

Direct Direct route 0

Static Static route 60

OSPF internal route 10


Dynamic routing protocol
OSPF external route 150

Page 18 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.

• The table lists the preferences of some common routing protocols. Actually, there are
multiple types of dynamic routes. We will learn these routes in subsequent courses.
Metric - Basic Concepts
Comparing Metrics • When a router discovers multiple routes to the

Routes
same destination network through the same
routing protocol, the router selects the optimal
route based on the metrics of these routes if
Different
Installed in the
Destination/mask IP routing table these routes have the same preference.

Same • The metric of a route indicates the cost of


reaching the destination address of the route.
Higher preference
Preference • Common metrics include the hop count,
bandwidth, delay, cost, load, and reliability.
Same
preference • The route with the lowest metric is installed in
Lower metric
the IP routing table.
Metric

• The metric is also known as the cost.

Page 19 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Contents
1. Overview of IP Routing
▫ Basic Concepts of Routing

▫ Generation of Routing Entries

▫ Optimal Route Selection

▪ Route-based Forwarding

2. Static Routing

3. Dynamic Routing

4. Advanced Routing Features

Page 20 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Longest Matching
⚫ When a router receives an IP packet, it compares the destination IP address of the packet with all
routing entries in the local routing table bit by bit until the longest matching entry is found. This is the
longest matching mechanism.

Bit-by-bit matching
Destination IP
[Link]
address 172. 16. 00000010 00000001

[Link] 172. 16. 00000001 xxxxxxxx


Routing entry 1
[Link]

[Link] 172. 16. 00000010 xxxxxxxx


Routing entry 2
[Link]

[Link] 172. 16. xxxxxxxx xxxxxxxx


Routing entry 3
[Link]

Page 21 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Example of Longest Matching (1)
Example of Longest Matching

Destination IP [Link]/30
address:
• There are two routes to [Link] in the IP
[Link]
RTA
routing table of RTA, one has the 16-bit mask
[Link]/30 and the other has the 24-bit mask. According to
DATA the longest matching rule, the route with the 24-
bit mask is preferred to guide the forwarding of
[Link]/30
packets destined for [Link].
IP routing table of RTA
Destination/Mask Next Hop
[Link]/16 [Link]
[Link]/24 [Link] Match
[Link]/24 [Link]

Page 22 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Example of Longest Matching (2)
Example of Longest Matching

Destination IP [Link]/30
address:
• There are two routes to [Link] in the IP
[Link]
RTA
routing table of RTA, one has the 16-bit mask
[Link]/30 and the other has the 24-bit mask. According to
Data the longest matching rule, the route with the 24-
bit mask is preferred to guide the forwarding of
[Link]/30
packets destined for [Link].
IP routing table of RTA
Destination/Mask Next Hop
[Link]/16 [Link]
[Link]/24 [Link]
[Link]/24 [Link] Match

Page 23 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Route-based Forwarding Process
Outbound
Destination/Mask Next Hop
Interface
Destination [Link]/24 [Link] GE0/0
IP address:
[Link]/24 [Link] GE0/1
[Link]
[Link]/24 [Link] GE0/0
[Link]/24 [Link] GE0/1
IP routing table of R2
Data
Gateway Gateway
GE0/1 GE0/0 GE0/0 GE0/1 GE0/0 GE0/1
[Link]/24 [Link]/24 [Link]/24 [Link]/24
[Link] [Link] [Link] [Link] [Link] [Link]
R1 R2 R3

IP routing table of R1 IP routing table of R3


Outbound Outbound
Destination/Mask Next Hop Destination/Mask Next Hop
Interface Interface
[Link]/24 [Link] GE0/1 [Link]/24 [Link] GE0/1
[Link]/24 [Link] GE0/0 [Link]/24 [Link] GE0/0
[Link]/24 [Link] GE0/0 [Link]/24 [Link] GE0/0
[Link]/24 [Link] GE0/0 [Link]/24 [Link] GE0/0

Page 24 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.

• The IP packets from [Link]/24 need to reach [Link]/24. After receiving these
packets, the gateway R1 searches its IP routing table for the next hop and outbound
interface and forwards the packets to R2. After the packets reach R2, R2 forwards the
packets to R3 by searching its IP routing table. Upon receipt of the packets, R3
searches its IP routing table, finding that the destination IP address of the packets
belongs to the subnet where a local interface resides. Therefore, R3 directly forwards
the packets to the destination subnet [Link]/24.
Summary of the IP Routing Table
• When a router obtains routes to the same destination subnet with the same mask from different
routing protocols, the router prefers the route with the lowest preference value of these routing
protocols. If these routes are learned from the same routing protocol, the router prefers the route with
the lowest cost. In summary, only the optimal route is installed in the IP routing table.

• When a router receives a packet, it searches its IP routing table for the outbound interface and next
hop based on the destination IP address of the packet. If it finds a matching routing entry, it forwards
the packet according to the outbound interface and next hop specified by this entry. Otherwise, it
discards the packet.

• Packets are forwarded hop by hop. Therefore, all the routers along the path from the source to the
destination must have routes destined for the destination. Otherwise, packet loss occurs.

• Data communication is bidirectional. Therefore, both forward and backward routes must be available.

Page 25 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Contents
1. Overview of IP Routing

2. Static Routing

3. Dynamic Routing

4. Advanced Routing Features

Page 26 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Application Scenarios of Static Routes
Static Routes • Static routes are manually configured by network
administrators, have low system requirements, and
apply to simple, stable, and small networks.
Destined for
[Link]/24 GE0/0/0 GE0/0/1 • The disadvantage of static routes is that they
[Link]/24 [Link]/24
cannot automatically adapt to network topology
GE0/0/0 GE0/0/1
RTA [Link]/24 RTB [Link]/24 RTC changes and so require manual intervention.

• RTA needs to forward the packets with the


destination address [Link]/24. However, the IP
Destination Protocol Next Hop
[Link] Static [Link] routing table of RTA has only one direct route,
[Link] Direct [Link] which does not match [Link]/24. In this case, a
static route needs to be manually configured so
that the packets sent from RTA to [Link]/24 can
be forwarded to the next hop [Link].
Page 27 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Static Route Configuration
⚫ Specify a next-hop IP address for a static route.
[Huawei] ip route-static ip-address { mask | mask-length } nexthop-address

⚫ Specify an outbound interface for a static route.


[Huawei] ip route-static ip-address { mask | mask-length } interface-type interface-number

⚫ Specify both the outbound interface and next hop for a static route.
[Huawei] ip route-static ip-address { mask | mask-length } interface-type interface-number [ nexthop-address ]

When creating a static route, you can specify both the outbound interface and next hop. Alternatively, you can
specify either the outbound interface or next hop, depending on the interface type:
For a point-to-point interface (such as a serial interface), you must specify the outbound interface.
For a broadcast interface (for example, an Ethernet interface) or a virtual template (VT) interface, you must
specify the next hop.

Page 28 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Configuration Example
GE0/0/0 S1/0/0
[Link]/24 [Link]/24
GE0/0/0 S1/0/0 Configure RTA.
RTA [Link]/24 RTB [Link]/24 RTC
[RTA] ip route-static [Link] [Link] [Link]

Destined for Destined for


[Link]/24 [Link]/24
Configure RTC.
• Configure static routes on RTA and RTC for communication [RTC] ip route-static [Link] [Link] S1/0/0
between [Link]/24 and [Link]/24.
• Packets are forwarded hop by hop. Therefore, all the routers
along the path from the source to the destination must have
routes destined for the destination.

• Data communication is bidirectional. Therefore, both forward


and backward routes must be available.

Page 29 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Default Routes
• Default routes are used only when packets to be forwarded do not match any routing entry in an IP
routing table.

• In an IP routing table, a default route is the route to network [Link] (with the mask [Link]), namely,
[Link]/0. RTA needs to forward
packets to a subnet that is
not directly connected to it
and forwards the packets to
[Link].

[Link]/24
RTA RTB [Link]/24
GE0/0/0 GE0/0/0
[Link]/24 [Link]/24
[Link] .
[Link] .
[Link]/24

[RTA] ip route-static [Link] 0 [Link]

Page 30 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Application Scenarios of Default Routes
⚫ Default routes are typically used at the egress of an enterprise network. For example, you can configure
a default route on an egress device to enable the device to forward IP packets destined for any address
on the Internet.

Enterprise
network RTA
[Link]/24 Internet
GE0/0/1 GE0/0/0 [Link]
PC [Link] [Link]
[Link]
Gateway: [Link]

[RTA] ip route-static [Link] 0 [Link]

Page 31 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Contents
1. Overview of IP Routing

2. Static Routing

3. Dynamic Routing

4. Advanced Routing Features

Page 32 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Overview of Dynamic Routing
Static Routing Dynamic Routing
• To use static routes on • Dynamic routes can be
Static routing any device, you must Dynamic routing automatically
manually configure OSPF discovered and learned.
them. • Dynamic routes can
• Static routes cannot adapt to topology
adapt to link changes. changes.

• When the network scale expands, it becomes increasingly • Dynamic routing protocols automatically discover and
complex to manually configure static routes. In addition, generate routes, and update routes when the topology
when the network topology changes, static routes cannot changes. These protocols effectively reduce the workload
adapt to these changes in a timely and flexible manner. of network administrators and are widely used on large
networks.

Page 33 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.

• The disadvantage of static routes is that they cannot automatically adapt to network
topology changes and so require manual intervention.

• Dynamic routing protocols provide different routing algorithms to adapt to network


topology changes. Therefore, they are applicable to networks on which many Layer 3
devices are deployed.
Classification of Dynamic Routing Protocols
Classification by the application scope

Interior Gateway Protocol (IGP) Exterior Gateway Protocol (EGP)

RIP OSPF IS-IS BGP

Classification by working mechanism and routing algorithm

Distance-vector routing protocol Link-state routing protocol

RIP OSPF IS-IS

Page 34 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.

• Dynamic routing protocols are classified into two types based on the routing
algorithm:

▫ Distance-vector routing protocol

▪ RIP

▫ Link-state routing protocol

▪ OSPF

▪ IS-IS

▫ BGP uses a path vector algorithm, which is modified based on the distance-
vector algorithm. Therefore, BGP is also called a path-vector routing protocol in
some scenarios.

• Dynamic routing protocols are classified into the following types by their application
scope:

▫ IGPs run within an autonomous system (AS), including RIP, OSPF, and IS-IS.

▫ EGP runs between different ASs, among which BGP is the most frequently used.
Contents
1. Overview of IP Routing

2. Static Routing

3. Dynamic Routing

4. Advanced Routing Features

Page 35 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Equal-Cost Route
Route Recursion Floating Route
Route Summarization

Route Recursion (1)


⚫ Route recursion is a recursive search process of the IP routing table where the next-hop IP
address is wanted to route packets towards its destination but when found it is not part of
any directly connected network.
GE0/0/0 GE0/0/1
[Link]/24 [Link]/24
[Link]/24
GE0/0/0 GE0/0/1
RTA [Link]/24 RTB [Link]/24 RTC

[RTA] ip route-static [Link] 24 [Link]

The next hop of the route to [Link]/24 is [Link],


which is not on a directly connected network of
RTA. If the IP routing table does not have a route
to [Link], this static route does not take effect
and cannot be installed in the IP routing table.

Page 36 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Equal-Cost Route
Route Recursion Floating Route
Route Summarization

Route Recursion (2)

GE0/0/0 GE0/0/1
[Link]/24 [Link]/24
[Link]/24
GE0/0/0 GE0/0/1
RTA [Link]/24 RTB [Link]/24 RTC

Destination/ Outbound
Next Hop
Mask Interface
[RTA] ip route-static [Link] 24 [Link]
Recursion
[Link]/24 [Link] GE0/0/0
[Link]/24 [Link] GE0/0/0
[RTA] ip route-static [Link] 24 [Link]

Configure a route to [Link], with the next hop pointing to [Link] on the directly connected network.
In this way, RTA can recurse the route with the destination [Link]/24 to the route with the destination
[Link].

Page 37 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Equal-Cost Route
Route Recursion Floating Route
Route Summarization

Equal-Cost Route
⚫ When there are equal-cost routes in the IP routing table, a router forwards IP packets to be sent to the
destination subnet through all valid outbound interfaces and next hops in the equal-cost routes,
achieving load balancing.

RTA GE0/0/0 GE0/0/0 RTB


[Link]/30 Cost=10 [Link]/30
[Link]/30
GE0/0/1 Cost=10 GE0/0/1
[Link]/30 [Link]/30

If there are multiple routes to the same


RTA's IP routing table destination from the same source, with the
same cost, but pointing to different next
Destination/Mask Next Hop hops, the routes are installed in the IP
[Link] routing table as equal-cost routes. Traffic to
[Link]/30 be sent to the destination will be distributed
[Link]
to these equal-cost routes.

Page 38 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Equal-Cost Route
Route Recursion Floating Route
Route Summarization

Floating Route - Basic Concepts


Floating Route
• Different preferences can be manually

RTB
configured for static routes. Therefore, you can
configure two static routes with the same
destination address/mask but different
[Link]/30
[Link]/30 preferences and next hops to implement backup
[Link]/30 of forwarding paths.

[Link]/30 [Link]/30 • A backup route is known as a floating route,


RTA RTC
which is used only when the primary route is
unavailable. That is, a floating route is installed
Configure a floating route on RTA.
in the IP routing table only when the next hop of
[RTA] ip route-static [Link] 30 [Link]
[RTA] ip route-static [Link] 30 [Link] preference 70 the primary route is unreachable.

Page 39 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Equal-Cost Route
Route Recursion Floating Route
Route Summarization

Floating Route - Example


Floating Route Switching

RTB RTB

[Link]/30 [Link]/30
[Link]/30 [Link]/30

[Link]/30 [Link]/30

[Link]/30 [Link]/30 [Link]/30 [Link]/30


RTA RTC RTA RTC
Destined for [Link]

RTA's IP routing table when the primary link is available RTA's IP routing table when the primary link fails
Destination Next Hop Preference Destination Next Hop Preference
[Link] [Link] 60 [Link] [Link] 70

Page 40 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.

• When the link between RTA and RTB is normal, the two routes to [Link]/30 are both
valid. In this case, RTA compares the preferences of the two routes, which are 60 and
70 respectively. Therefore, the route with the preference value 60 is installed in the IP
routing table, and RTA forwards traffic to the next hop [Link].

• If the link between RTA and RTB is faulty, the next hop [Link] is unreachable, which
causes the corresponding route invalid. In this case, the backup route to [Link]/30 is
installed in the IP routing table. RTA forwards traffic destined for [Link] to the next
hop [Link].
Equal-Cost Route
Route Recursion Floating Route
Route Summarization

CIDR
• Classless Inter-Domain Routing (CIDR) uses IP addresses and masks to identify networks and subnets. CIDR replaces
the previous addressing architecture of classful network design (such as classes A, B, and C addresses).

• CIDR is based on variable length subnet mask (VLSM). CIDR uses prefixes of any lengths to divide the address space
with continuous IP addresses. Multiple address segments with continuous prefixes can be summarized into a
network, effectively reducing the number of routing entries.

192. 168. 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 [Link]/22

192. 168. 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 [Link]/23


[Link]/21
192. 168. 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 [Link]/21

192. 168. 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 [Link]/23

Page 41 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Equal-Cost Route
Route Recursion Floating Route
Route Summarization

Background of Route Summarization


• Subnet division and VLSM resolve the problem of address space waste, but also bring a new challenge:
increasing routing entries in the IP routing table.

• Route summarization can minimize routing entries.

[Link]/24 [Link]/24 [Link]/24 [Link]/24

[Link]/24

RTB's IP routing table


RTA
To route traffic to the directly connected network
[Link]/24 segments of RTA, RTB must have routes to these
[Link]/24
[Link]/24 network segments. If a static route is manually
[Link]/24 configured for each network segment, the
[Link]/24 configuration workload will be heavy and RTB's IP
RTB routing table will have a large number of routing
[Link]/24
[Link]/24 entries.

Page 42 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.

• On a large-scale network, routers or other routing-capable devices need to maintain a


large number of routing entries, which will consume a large amount of device
resources. In addition, the IP routing table size is increasing, resulting in a low
efficiency of routing entry lookup. Therefore, we need to minimize the size of IP
routing tables on routers while ensuring IP reachability between the routers and
different network segments. If a network has scientific IP addressing and proper
planning, we can achieve this goal by using different methods. A common and
effective method is route summarization, which is also known as route aggregation.
Equal-Cost Route
Route Recursion Floating Route
Route Summarization

Overview of Route Summarization

[Link]/24
[Link]/24
RTA RTB
... • Route summarization is an approach of summarizing
[Link] ...
[Link] ... routes with the same prefix into one summary route to
[Link]/24
minimize the IP routing table size and improve device
resource usage.

• Route summarization uses CIDR to summarize network


[RTA] ip route-static [Link] 16 [Link]
segments with the same prefix into a single one.

• The routes before being summarized are known as


On RTA, configure static routes to the directly specific routes, and the routes created after
connected network segments [Link]/24,
[Link]/24, ..., and [Link]/24 of RTB, with the summarization are known as summarized routes or
same next hop. Therefore, these routes can be
summary routes.
summarized into one route.

Page 43 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.

• To enable RTA to reach remote network segments, we need to configure a specific


route to each network segment. In this example, the routes to [Link]/24, [Link]/24,
and [Link]/24 have the same next hop, that is, [Link]. Therefore, we can summarize
these routes into a single one.

• This effectively reduces the size of RTA's IP routing table.


Equal-Cost Route
Route Recursion Floating Route
Route Summarization

Summarization and Calculation


192 168 X 0

[Link]/24 1 1 0 000 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 000

[Link]/24 1 1 0 000 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0

[Link]/24 1 1 0 000 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 000


Network address Host address

[Link]/22 1 1 0 000 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

• To summarize routes to multiple continuous network segments into one summary route that just includes these
network segments, ensure that the mask length of the summary route is as long as possible.

• The key to achieve this is to convert the destination addresses of specific routes into binary numbers and then
find out the identical bits in these binary numbers.

Page 44 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Equal-Cost Route
Route Recursion Floating Route
Route Summarization

Problems Caused by Route Summarization (1)


Routing Loop

[RTB] ip route-static [Link] 0 [Link] [RTA] ip route-static [Link] 16 [Link]

[Link]/24
[Link]/24 RTB RTA
... [Link] Internet
... [Link]
...
1 2
[Link]/24

RTB receives traffic destined Routes are summarized on RTA.


for [Link]/24 and forwards Therefore, RTA forwards the traffic
the traffic to RTA according back to RTB according to the
to the default route. Loop summary route to [Link]/16.

Page 45 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Equal-Cost Route
Route Recursion Floating Route
Route Summarization

Problems Caused by Route Summarization (2)


Solution for Preventing Routing Loops

[RTB] ip route-static [Link] 0 [Link] [RTA] ip route-static [Link] 16 [Link]

[Link]/24
[Link]/24 RTB RTA
... [Link] Internet
...
... [Link]
[Link]/24

[RTB] ip route-static [Link] 16 0 NULL0

• Configure a route pointing to Null0 on RTB to


prevent routing loops when summarizing routes.

Page 46 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.

• In most cases, both static and dynamic routes need to be associated with an outbound
interface. This interface is the egress through which the device is connected to a
destination network. The outbound interface in a route can be a physical interface such
as a 100M or GE interface, or a logical interface such as a VLANIF or tunnel interface.
There is a special interface, that is, Null interface. It has only one interface number,
that is, 0. Null0 is a logical interface and is always up. When Null0 is used as the
outbound interface in a route, data packets matching this route are discarded, like
being dumped into a black-hole. Therefore, such a route is called a black-hole route.
Equal-Cost Route
Route Recursion Floating Route
Route Summarization

Accurate Route Summarization (1)


RTB [Link]/24
[Link] [Link]/24
...
RTA [Link]/24

[Link]
RTC
[Link]/24
[Link]/24
...
[Link]/24

[RTA] ip route-static [Link] 16 [Link]

• To simplify the configuration, an administrator may configure a static summary route on RTA to allow RTA to reach network
segments [Link]/24 to [Link]/24 of RTB. However, this summary route also includes the network segments of RTC.
As a result, RTA forwards the traffic destined for network segments of RTC to RTB, causing data packet loss. This problem is
caused by inaccurate route summarization. To resolve this problem, the summary route must be as accurate as possible; that
is, it just covers all specific routes that are to be summarized, with no extra route included.

Page 47 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Equal-Cost Route
Route Recursion Floating Route
Route Summarization

Accurate Route Summarization (2)


172 16 0 0

[Link]/24 1 0 1 011 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0

[Link]/24 1 0 1 011 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0

[Link]/24 1 0 1 0110 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0

/22
ip route-static [Link] 24 [Link]
ip route-static [Link] 24 [Link] ip route-static [Link] 22 [Link]
ip route-static [Link] 24 [Link]

Accurately calculate the summarized


network address and mask to ensure
accurate route summarization.

Page 48 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Quiz
1. How does a router select the optimal route?

2. How do I configure a floating route?

3. What is the summary route for routes to [Link]/24, [Link]/24, and [Link]/24?

Page 49 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.

1. The router first compares preferences of routes. The route with the lowest preference
value is selected as the optimal route. If the routes have the same preferences, the
router compares their metrics. If the routes have the same metric, they are installed in
the IP routing table as equal-cost routes.

2. To configure a floating route, configure a static route with the same destination
network segment and mask as the primary route but a different next hop and a larger
preference value.

3. The summary route is [Link]/20.


Summary
⚫ This section presents the basic concepts of routes, how routes instruct routers to
forward IP packets, common route attributes, and default routes (special static
routes).

⚫ In addition, this section describes advanced routing features including route


recursion, floating routes, and equal-cost routes, which are widely used on live
networks.

Page 50 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Thank You
[Link]

Page 51 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.

You might also like