You are on page 1of 41

Revision Record Dont Print This

Page
Course Code Product Product Version Course Version ISSUE

ODN101203 MBB V6R2 1.00

Developer/Modifier Time Approver New/Update

Liu Feng 2012.07 Gaojianqin Update

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page0
IP Routing Basis

www.huawei.com

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved.


Foreword
 The IP backhaul solution is an mobile backhaul solution
that uses multiple types of routers to bear services. How
do routers bear services?

 This document mainly introduces the basic IP route


information:
 Concepts of routes, routers, and routing tables

 The IP routing process

 Routing protocols

 Working principles of routers

 This document aims to help you understand the basic


concepts of IP routing.
Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page2
Objectives
 After completing this course, you will be able to:

 Describe the definitions of routes, routers, and routing


tables

 Understand the content of routing tables

 Describe the IP routing process

 Describe how IP routes are obtained

 Describe the categories of dynamic routing protocols and


the preferences of the protocols

 Describe the principles for route selection

Copyright
 Describe the implementation of load-balancing and route
2011 Huawei Technologies Co., Ltd. All rights reserved.
Page3
Contents
1. Basic concepts about routes

2. Overview of routing protocols

3. Working principles of routers

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page4
Contents
1. Basic concepts about routes

2. Overview of routing protocols

3. Working principles of routers

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page5
What is Route?

A R1 Network N

 As shown in the preceding figure, router R1 receives a packet


whose destination address is Network N. R1 can transmit the
packet through different routes. Which route will R1 choose? It
depends on the routing information that is stored on each router.
Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page6
Router

Host A

Host C

Host B

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page7
Routing Table
1. display ip routing-table
2. Routing Tables:
3. Destination/Mask proto pref Cost Nexthop Interface
4. 0.0.0.0/0 STATIC 60 0 10.0.1.1 Ethernet1/0
5. 1.0.0.0/8 RIP 100 1 10.0.1.1 Ethernet1/0
6. 1.1.1.0/24 STATIC 60 0 10.0.1.1 Ethernet1/0
7. 1.1.1.1/32 OSPF 10 2 10.0.1.1 Ethernet1/0
8. 2.2.2.2/32 DIRECT 0 0 127.0.0.1 InLoopBack0
9. 10.0.1.0/30 DIRECT 0 0 10.0.1.2 Ethernet1/0
10. 10.0.1.2/32 DIRECT 0 0 127.0.0.1 InLoopBack0
11. 127.0.0.0/8 DIRECT 0 0 127.0.0.1 InLoopBack0
12. 127.0.0.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page8
IP Routing Process

E1 E0 E0 E1 E0 E1
10.3.1.0 10.1.2.0/24 10.2.1.0/2 10.4.1.0
.1 .2 .1 4 .2
RTA RTB RTC

Destinatio Next Out Destinatio Out Destinatio Out


Next Hop Next Hop
n Network Hop Port n Network Port n Network Port

10.1.2.0 10.1.2.1 E0 10.1.2.0 10.1.2.2 E0 10.1.2.0 10.2.2.2 E0

10.2.1.0 10.1.2.2 E0 10.2.1.0 10.1.2.1 E0 10.2.1.1 10.2.1.2 E0

10.3.1.0 10.3.1.1 E1 10.3.1.0 10.1.2.1 E0 10.3.1.0 10.2.1.1 E0

10.4.1.0 10.1.2.2 E0 10.4.1.0 10.2.1.2 E1 10.4.1.0 10.4.1.1 E1

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page9
Self-Test Questions
1. Which of the following items are contained in a routing table? ( )

A. Destination/Mask

B. Protocol

C. Preference

D. Cost

E. NextHop

F. Interface

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page10
Contents
1. Basic concepts about routes

2. Overview of routing protocols

3. Working principles of routers

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page11
Contents
2. Overview of Routing Protocols
2.1 Types of Routes

2.2 Obtaining of Routes

2.3 Getting to Know Dynamic Routing Protocols

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page12
Types of Routes
 A router forwards packets based on its routing table and selects a
port for transmitting a packet based on the mapping between its
ports and the packet's destination address.
 Routes are classified into two types based on the connection between
the router and the destination address:
 Direct route: When the destination address is directly connected to the
router, the router forwards the data packet through the port connected to
the destination address. The route between the router and the destination
address is a direct route.
 Indirect route: When the destination address is not directly connected to
the router, the router obtains routes to the destination address using
certain routing protocols and selects the optimal route.

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page13
Example
R2 R3
10.1.1.0/24

R1
E0/0 192.168.2.0/24
E1/0

R4 R5

Router Source Target Network Outbound Interface


DIRECT 10.1.1.0 E0/0
OSPF 192.168.2.0 E1/0

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page14
Contents
2. Overview of Routing Protocols
2.1 Types of Routes

2.2 Obtaining of Routes

2.3 Getting to Know Dynamic Routing Protocols

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page15
Direct Route
1.
display ip routing-table
2.
Routing Tables:
3.
Destination/Mask proto pref Cost Nexthop Interface
4.
0.0.0.0/0 STATIC 60 0 10.0.1.1 Ethernet1/0
5.
1.0.0.0/8 RIP 100 1 10.0.1.1 Ethernet1/0
6.
1.1.1.0/24 STATIC 60 0 10.0.1.1 Ethernet1/0
7.
1.1.1.1/32 OSPF 10 2 10.0.1.1 Ethernet1/0
8.
2.2.2.2/32 DIRECT 0 0 127.0.0.1 InLoopBack0
9.
10.0.1.0/30 DIRECT 0 0 10.0.1.2 Ethernet1/0
10.
10.0.1.2/32 DIRECT 0 0 127.0.0.1 InLoopBack0
11.
127.0.0.0/8 DIRECT 0 0 127.0.0.1 InLoopBack0
12.
127.0.0.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page16
Static Route
1.
display ip routing-table
2.
Routing Tables:
3.
Destination/Mask proto pref Cost Nexthop Interface
4.
0.0.0.0/0 STATIC 60 0 10.0.1.1 Ethernet1/0
5.
1.0.0.0/8 RIP 100 1 10.0.1.1 Ethernet1/0
6.
1.1.1.0/24 STATIC 60 0 10.0.1.1 Ethernet1/0
7.
1.1.1.1/32 OSPF 10 2 10.0.1.1 Ethernet1/0
8.
2.2.2.2/32 DIRECT 0 0 127.0.0.1 InLoopBack0
9.
10.0.1.0/30 DIRECT 0 0 10.0.1.2 Ethernet1/0
10.
10.0.1.2/32 DIRECT 0 0 127.0.0.1 InLoopBack0
11.
127.0.0.0/8 DIRECT 0 0 127.0.0.1 InLoopBack0
12.
127.0.0.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page17
Default Route
1.
display ip routing-table
2.
Routing Tables:
3.
Destination/Mask proto pref Cost Nexthop Interface
4.
0.0.0.0/0 STATIC 60 0 10.0.1.1 Ethernet1/0
5.
1.0.0.0/8 RIP 100 1 10.0.1.1 Ethernet1/0
6.
1.1.1.0/24 STATIC 60 0 10.0.1.1 Ethernet1/0
7.
1.1.1.1/32 OSPF 10 2 10.0.1.1 Ethernet1/0
8.
2.2.2.2/32 DIRECT 0 0 127.0.0.1 InLoopBack0
9.
10.0.1.0/30 DIRECT 0 0 10.0.1.2 Ethernet1/0
10.
10.0.1.2/32 DIRECT 0 0 127.0.0.1 InLoopBack0
11.
127.0.0.0/8 DIRECT 0 0 127.0.0.1 InLoopBack0
12.
127.0.0.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page18
Dynamic Route
1.
display ip routing-table
2.
Routing Tables:
3.
Destination/Mask proto pref Cost Nexthop Interface
4.
0.0.0.0/0 STATIC 60 0 10.0.1.1 Ethernet1/0
5.
1.0.0.0/8 RIP 100 1 10.0.1.1 Ethernet1/0
6.
1.1.1.0/24 STATIC 60 0 10.0.1.1 Ethernet1/0
7.
1.1.1.1/32 OSPF 10 2 10.0.1.1 Ethernet1/0
8.
2.2.2.2/32 DIRECT 0 0 127.0.0.1 InLoopBack0
9.
10.0.1.0/30 DIRECT 0 0 10.0.1.2 Ethernet1/0
10.
10.0.1.2/32 DIRECT 0 0 127.0.0.1 InLoopBack0
11.
127.0.0.0/8 DIRECT 0 0 127.0.0.1 InLoopBack0
12.
127.0.0.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page19
Contents
2. Overview of Routing Protocols
2.1 Types of Routes

2.2 Obtaining of Routes

2.3 Getting to Know Dynamic Routing Protocols

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page20
Classified by Application Range

 IGP (Interior gateway protocol )


 RIP

 OSPF

 IS-IS

 EGP (Exterior gateway protocol )


 BGP

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page21
Classified by Protocol Algorithm

 Routing protocols using the distance vector algorithm


 RIP

 BGP

 Routing protocols using the link state algorithm


 OSPF

 IS-IS

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page22
Autonomous System
AS65000
AS65001
RIPv1/v2

BGP
OSPF

ISIS

 An AS is a collection of routers that are managed in a


centralized manner and adopt the same route selection policy.

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page23
Distance-Vector Algorithm
Routing Table

A
Routing Table Routing Table
B D
C

Routing Table

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page24
Link-State Algorithm
LSDB

LSP generated by RTA


RTA RTB
LSP generated by RTB
RTC
LSP generated by RTC
Flooding LSP
LSP generated by RTD
RTD

Destinatio Next
RTD
Cost
n Network Hop
..... ..... ...
..... ..... ... SPF algorithm
..... ..... ...
..... ..... ... Calculating
..... ..... ... the Routes
The shortest
IP Routing Table path tree

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page25
Self-Test Questions
2. Which of the following protocols are link state protocols?

A. RIP

B. OSPF

C. IS-IS

D. BGP

3. When a router has learned destination addresses from the following


routing protocols, which address will the router choose by default?

A. RIP

B. OSPF

C. IS-IS

D. BGP
Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page26
Contents
1. Basic concepts about routes

2. Overview of routing protocols

3. Working principles of routers

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page27
Contents
3. Working principles of routers
3.1 Selection of routes

3.2 Equal-Cost Routes and Backup Routes

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page28
Longest Matching Prefix

Query the routing table.

Perform the AND operation between


the destination address and the mark.

Compare the destination address Match


with items in the routing table. Select the longest match.

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page29
Example

For example, after a router receives a packet whose
destination IP address is 9.1.2.1

display ip routing-table
Routing Tables:
Destination/Mask proto pref cost Nexthop Interface
0.0.0.0/0 Static 60 0 120.0.0.2 Serial0/0
8.0.0.0/8 RIP 100 3 120.0.0.2 Serial0/1
9.0.0.0/8 OSPF 10 50 20.0.0.2 Ethernet0/0
9.1.0.0/16 RIP 100 4 120.0.0.2 Serial0/0
11.0.0.0/8 Static 60 0 120.0.0.2 Serial0/1
20.0.0.0/8 Direct 0 0 20.0.0.1 Ethernet0/2
20.0.0.1/32 Direct 0 0 127.0.0.1 LoopBack0

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page30
Preference of Routing Protocols

display ip routing-table
Routing Tables:
Destination/Mask proto pref cost Nexthop Interface


The preference of a routing protocol corresponds to the "pref" field in
a routing table. For the same destination IP address and the same
routing entry, different routes are calculated based on different
routing protocols (including the static routing protocol). A router
needs to select the optimal route. At a certain moment, only one
routing protocol determines the preferred route to a certain
destination. How to select the optimal route?
Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page31
Routing Protocols Preferences
Routing Protocol Preference of the Corresponding Route

DIRECT 0

OSPF 10

IS-IS 15

STATIC 60

RIP 100

OSPF ASE 150

OSPF NSSA 150

IBGP 255

EBGP 255

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page32
Path Cost

display ip routing-table
Routing Tables:
Destination/Mask proto pref cost Nexthop Interface


Path cost corresponds to the "cost" field in a routing table. If one
routing protocol (including the static routing protocol) discovers the
routes to the same destination through different paths, how does the
router select the optimal route?

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page33
Example

Suppose that router A uses the OSPF protocol and learns the
routes to router D from router B and router E respectively

Path1 The cost of the route A->B->C->D is 9.

Path2 The cost of the route A->E->F->C->D is 7.

Obviously, the route router A learns from router E is better and
adds the route (it learns from router E) to router D into router A's
routing table. B C D
5 2
A 2
1

2
F
2
E
Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page34
Contents
3. Working principles of routers
3.1 Selection of routes

3.2 Equal-Cost Routes and Backup Routes

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page35
Equal-Cost Routes and Load-balancing

display ip routing-table
Routing Tables: Public
Destinations : 13 Routes : 15
Destination/Mask Proto Pref Cost NextHop Interface
3.3.3.0/24 Direct 0 0 3.3.3.2 Serial2
3.3.3.1/32 Direct 0 0 3.3.3.1 Serial2
3.3.3.2/32 Direct 0 0 127.0.0.1 InLoopBack0
10.1.1.1/32 Static 60 0 1.1.1.1 Serial0
Static 60 0 2.2.2.1 Serial1
Static 60 0 3.3.3.1 Serial2
20.1.1.1/32 Direct 0 0 127.0.0.1 InLoopBack0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoopBack0

Equivalent routes to
balance load

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page36
Backup Routes

Routers support route backup to improve the network
reliability. You can configure multiple routes to the same
destination as required. The route with the highest
preference functions as the primary route. The other routes
with lower preferences function as backup routes.
B

192.168.1.0/24 10.10.10.0/24
A C D

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page37
Self-Test Questions
4. When the router receives a packet whose destination address is
202.4.2.1, which route will be selected? ( )

A. 0.0.0.0/0

B. 202.0.0.0/8

C. 202.4.0.0/16

D. 202.3.0.0/16

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page38
Summary
1. Basic concepts about routes

2. Overview of routing protocols

3. Working principles of routers

Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page39
Thank you
www.huawei.com

You might also like