Académique Documents
Professionnel Documents
Culture Documents
Page
Course Code Product Product Version Course Version ISSUE
Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page0
IP Routing Basis
www.huawei.com
Routing protocols
Copyright
Describe the implementation of load-balancing and route
2011 Huawei Technologies Co., Ltd. All rights reserved.
Page3
Contents
1. Basic concepts about routes
Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page4
Contents
1. Basic concepts about routes
Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page5
What is Route?
A R1 Network N
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
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
Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page11
Contents
2. Overview of Routing Protocols
2.1 Types of Routes
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
Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page14
Contents
2. Overview of Routing Protocols
2.1 Types of Routes
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
Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page20
Classified by Application Range
OSPF
IS-IS
Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page21
Classified by Protocol Algorithm
BGP
IS-IS
Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page22
Autonomous System
AS65000
AS65001
RIPv1/v2
BGP
OSPF
ISIS
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
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
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
Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page27
Contents
3. Working principles of routers
3.1 Selection of routes
Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page28
Longest Matching Prefix
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
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
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
Copyright 2011 Huawei Technologies Co., Ltd. All rights reserved. Page39
Thank you
www.huawei.com