教育部顧問室通訊科技教育改進計畫專案獎助
第四章
有線網路路由
周立德
陳彥文
許獻聰
劉惠英
賴源正
陳仁暉
國立中央大學資訊工程學系
國立中央大學通訊工程研究所
淡江大學電機工程學系
輔仁大學電子工程學系
國立台灣科技大學資訊管理學系
長庚大學資訊工程學系
http://networklab.csie.ncu.edu.tw/CommEduProj
 2003-2004 All rights reserved. No part of this publication and file may be reproduced, stored in a
retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying,
recording or otherwise, without prior written permission.
1
Wired Routing
 Distance-Vector/Link-State Routing
 Exterior/Interior Routing
 Protocol names
2
Introduction to Graph
 A Graph G is defined as (N, A), where N is a
set of nodes, and a collection A of pairs of
distinct nodes from N
 Undirected v.s. directed
 Walk, path, loop
3
Introduction to Tree
 A graph G = (N , A), if G is a acyclic
connection graph, then G called a tree.
 Spanning tree
 Minimal spanning tree
1
2
3
4
5
Graph G1
A spanning tree of G1
4
Minimal spanning tree
 Assume G = (N,A) is a graph. Associated
with each edge e in G is a positive real
number wt(e), the weight of e. the weight of
an edge indicates cost for constructing the
edge. T is one spanning tree of G , where
the sum of the weights of the edges in T is
minimal. Such as T is called minimal
spanning tree.
5
How to find minimal spanning
tree
 Kruskal’s algorithm
 Prim’s Algorithm
22 13
42
15
39
62
72
10
18
6
Importance of the Spanning
tree
 A spanning tree is a subset of a network
graph that includes all nodes.
 There is only one path existed from the root
node to each leaf node.
 Broadcasting (flooding)
 Reverse path forwarding
 Minimum Spanning tree
7
What is routing
Which path ??
source
destination
8
Routing
 Control – centralized v.s. distributed
 Route change – static routing v.s. adaptive
routing
 Static routing: the path used by the sessions of
each origination-destination pair is fixed
regardless of traffic condition.
 Adaptive routing: Paths change occasionally in
response to congestion.
9
Convergence and converged
 When topology of network changes or failure, the
network knowledge base must also change. The
knowledge needs to reflect an accurate, consistent
view of the new topology. This view is called
convergence.
 When all routers in an inter-network are operating
with the same knowledge, the inter-network is said
to have converged. Fast convergence is a desirable
network feature.
10
Routing
 Flooding and broadcasting
 不將收到之packet回送給來源端
 不重覆送出相同之packet
 An important metric for the routing algorithms
comparison  the shortest delay
 Shortest path routing
 Each communication link is assigned a positive number
(called length), the length may be any measurement
criteria
 Shortest path  Min-hop (if the length of each link=1)
11
Flooding and broadcasting
destination
source
12
Flooding
 每一送出之Flooding packet均加上source
ID並給予編號,每一node對一source相同
編號的packet做傳送
 Source對其所傳送出去packet以遞增方式
編號,而每一node對同一source只需記錄
其所收到最大編號的packet即可
13
Routing
 Optimal routing
 Traffic may be splitted at some strategic points
to “smooth” delay and to increase network
throughput
 Hot potato (deflection) routing
 To minimize buffer overflow and to reduce the
packet loss
14
Inter-Network Routing
 Several LANs may be interconnected into a
large network (may be through WAN).
 Each LAN (subnet) may be regarded as a
“node” of the interconnected (WAN)
network!
 Hierarchical v.s. Nonhierarchical routing
15
Basic of Network Routing
 The length (weight) of each link (arc) may be
measured by delay, cost, performance, … etc.
 Each node collects the network status (path
information) to calculate the shortest path to
destinations
 Each node shall broadcast its link information 
Flooding is necessary
 Each node decides the shortest path from its view
point  short path algorithms
16
Evaluation of Shortest Path
Routing
 Oscillation  packets delivered in different
path and results in much processing time
required for packet sequencing.
 Stability in data gram networks
 Stability in virtual circuit networks
17
Stability Issues in Routing
Link 1
r
destination
origin
Link 2
•If routing update is
performed every T interval
-Datagram
-Virtual circuit
18
For datagram - adaptive
Link 1
T
2T
3T
4T
T
2T
3T
4T
Link 2
19
For virtual circuit -static
T
2T
3T
4T
20
Routing Selection
 Distance vector
 Routing Information Protocol (RIP)
 IGRP
 Link State
 Intermediate System – Intermediate System (IS – IS)
 Open Shortest Path First (OSPF)
 hybrid routing protocol
 EIGRP
21
Routing Selection
 對於小型網路,採用distance vector base
protocols易於配置和管理,且應用較為廣
泛,但在面對大型網路時,不但其固有
的環路問題變得更難解決,所佔用的帶
寬也迅速增長因此對於大型網路,採用
link state protocols較為恰當。
22
Distance Vector Routing
 Distance vector protocols are often referred
to as “Bellman-Ford” protocols.
 每個router必須維護一個表格,紀錄本身與
每個目的地的最佳距離,並定期與他的鄰近
router交換資訊。
 Count to infinity , Split horizon
23
Distance Vector Routing
A
B
C
D
E
∞
∞
∞
∞
初始化 A failure
1
∞
∞
∞
第一次交換
1
2
∞
∞
第二次交換
1
3
3
∞
第三次交換
1
3
3
4
第四次交換
Stable
24
Count to infinity
A
B
C
D
E
初始化
1
2
3
4
A failure, B can not get message from A, and C
tell B that it has a path to A
第一次交換
3
2
3
4
第二次交換
3
4
3
4
..
..
..
..
..
∞
∞
∞
∞
..
25
Split horizon
Network 1
Router1
Router2
Router2不能告訴Router1有關Network 1的資訊,
因為那是Router 1告訴Router 2的。
26
Triggered update
27
Link state Routing
 All node have a copy of the network map.
 Link state sometimes is called “shortest path first”
(SPF).
 Concept of link state
 Discover its neighbor and Measure each delay of its
neighbor
 Send packet which contain its knowledge to all
of its neighbor
 Compute the shortest path to every other router
28
Why is the link state better ?
 Fast, loopless convergency
 Support of precise/multiple metrics
 The largest throughput; the lowest delay; the lowest
cost; the best reliability; …
 Metric per system v.s. metric per packet (OSPFv2)
 Support multiple paths to a destination
 Traffic splitting
 Separate representation of external routes
29
Exterior Routing Protocols
 The basic routable element is the
Autonomous System.
 Exterior routing is to exchange routing
information among ASs.
30
Exterior Routing Protocols
 Concept of AS
 The minimum AS is composed of exactly one
router directly connecting one LAN to Internet .
IANA 會給每一AS唯一的 16 位元碼,稱為
ASN (Autonomous System Number)。
 An As can “self-routing” within its local
network.
 AS is also referred as to a routing domain.
31
Exterior Routing的功能
 與Interior Routing比較
 Exterior Routing較著重路由連線之策略,而
非最短路徑
32
EGP Protocol
Gateway
IGP
Gateway
EGP
AS 2
AS 1
Gateway
Gateway
33
IP Networks and Routing
 Interior Routing Protocols




RIP (Routing Information Protocol)
OSPF (Open Shortest Path First)
IGRP/EIGRP
IS-IS
 Exterior Routing Protocols
 EGP (Exterior Gateway Protocol)
 BGP (Border Gateway Protocol) v.s. CIDR (Classless
Inter Domain Routing)
 Policy Routing
34
Routing Information Protocol
( RIP )
 RIP is a distance vector interior routing
protocol.
 RIP update broadcast every 30 seconds.
 RIP only uses one metric (hop count).
 The max of hop count is 15.
35
Open Shortest Path First
(OSPF)
 OSPF is a link state interior routing protocol.
 All nodes have a copy of the network
topology. 一旦每個router有完整的network
topology ,就可以自己為根,建構最短路
徑樹。
 Support CIDR. (Classless Inter-Domain
Routing)
36
IGRP
 IGRP is a Cisco proprietary protocol and was
developed to supersede RIP.
 IGRP is a distance vector interior routing protocol.
IGRP update broadcast every 90 seconds.
 IGRP uses a combination of metrics. delay,
bandwidth, reliability, and load are all factored
into the routing decision. In contrast, RIP only
uses one metric (hop count).
37
IS-IS
 IS-IS is a link state routing protocol.
 IS-IS, as defined by ISO, support only the
Connectionless Network protocol ( CLNP )
38
Exterior Gateway Protocol
( EGP )
 要求每個router每30秒傳送訊息給相鄰的
router。
 只能得到可選擇的多重路徑,而無法判
斷哪一條路徑較短。
 EGP記錄一份完整的routing資料及更新。
39
Border Gateway Protocol
( BGP )
 BGP is the current popular exterior routing
protocol.
 Running over TCP, on port 179
 只在初始時router需和相鄰router交換整個
routing table,此後只有當自身發生改變時,
BGP才會產生更新訊息發送給其它router,且該
訊息中僅包含那些發生改變的路由,這樣不但
減少了router計算量,而且節省了BGP所占頻寬。
40
Classless Inter Domain Routing
(CIDR)
 new addressing scheme for the Internet which
allows for more efficient allocation of IP addresses
than the old Class A, B, and C address scheme.
 Three bears problem.
 Why CIDR?
 Running out of IP addresses.
 Running out of capacity in the global routing tables
41