1 chapter 4: internetworking (ip routing) dr. rocky k. c. chang 16 march 2004
DESCRIPTION
3 Internet topology See for more Internet topologies. Backbone service provider Peering point Peering point Large corporation Small corporation “ Consumer ” ISP “Consumer” ISP “ Consumer” ISPTRANSCRIPT
1
Chapter 4: Internetworking(IP Routing)
Dr. Rocky K. C. Chang16 March 2004
2
The routing problem• Problem: How does a router construct its
routing table for IP forwarding?• Forwarding vs routing
– Routing is the process by which forwarding tables are built.
• Forwarding table vs routing table– A routing table is built by routing protocols as a
precursor to building the forwarding table.– A forwarding table consists of detail enough
information to speed up datagram forwarding.
3
Internet topology• See http://www.cybergeography.org/atlas/topology.html for
more Internet topologies.
Backbone service provider
Peeringpoint
Peeringpoint
Large corporation
Large corporation
Smallcorporation
“Consumer ” ISP
“Consumer” ISP
“ Consumer” ISP
4
Internet topology• Major components in the Internet topology:
– Autonomous system (AS), e.g., polyu.edu.hk, ibm.com, etc.
– Internet service providers (ISPs): Local ISPs, regional ISPs, National ISPs, Backbone ISPs.
– Exchange networks: For local traffic interchange, e.g., HKIX.
– Some special networks, like Harnet in Hong Kong.– Routers (plus other networks) are usually used to
connect these components together.
5
An example• u5x-174.comp.polyu.edu.hkwww.stanford.edu
– polyu.edu.hk (158.132.0.0) Harnet (192.245.196.0)– Harnet Scramento.cw.net (166.49.0.0)– Scramento.cw.net SanFrancisco.cw.net
(204.70.0.0)– SanFrancisco.cw.net bbnplanet.net– bbn.planet.net stanford.edu (171.64.0.0)
6
Not all routers are equal • Interior routers: Only know how to route
datagrams to destinations within the same AS.• Border routers: Interface between its AS and
other AS:– A nonbackbone router usually has a “default route”
to another “more knowledgeable” router for “unknown destinations.”
– A backbone router is supposed to know every IP network in the Internet.
• Intradomain routing vs Interdomain routing
7
Intradomain routing• Two main approaches: Distance vector and link
state.– Both are implemented as distributed protocols
(centralization is the enemy of scalability).– In the distance vector approach, each router talks
only to its directly connected neighbors, but it tells them everything it has learned.
– In the link state approach, each router talks to all other routers in the network, but it tells them only what it knows for sure (only the states of its directly connected links).
8
Distance vector routing protocols• Each node does two things:
– It constructs a one-dimensional array (a vector) containing the “distances” (costs) to all other nodes.
– It distributes the vector to its immediate neighbors.• Each node’s vector initially consists of
– a distance of 0 for reaching itself, and– a distance of infinity for reaching other nodes.
• When the algorithm converges, each node knows for each destination node – (1) the next node closer to the destination, and– (2) the associated cost for this path.
9
An example
D
G
A
F
E
B
C
10
An example• Node A’s routing table (using hop count as the
cost)
1. Initially 3. After convergence
Destination Cost Next hop Destination Cost Next hopA 0 A A 0 A
B 1 B2. After talking with its neighbors C 1 C
D 2 CDestination Cost Next hop E 1 E
A 0 A F 1 FB 1 B G 2 FC 1 CE 1 EF 1 F
11
Dynamic routing• Each node periodically sends its distance vector
to its neighbor (periodic updates).• If link A-C fails,
– The cost in A’s entry to C becomes infinity.– B will advertise to A a path to C with cost 1.– F will advertise to A a path to C with cost 2.– Therefore, A’ entry to C is updated to: Next hop =
B and cost = 2.
12
Dynamic routing• Each node may send an updated distance vector
to its neighbor, triggered by external events (triggered updates).
• If link A-C fails,– The cost in A’s entry to C becomes infinity.– A will immediately send its updated vector to B, E, F.– This update does not affect B’s routing table. – However, E will update its entry to C from 2 to
infinity, and then from infinity to 3; and similarly for F.
13
Routing loops• If the link A-E fails,
– The corresponding entry in A is updated.– A triggered update from A, and periodic updates
from B, C, and F.– Possible timing (>: earlier than):
• Case 1: A > B and A > C and A > F• Case 2: A > B and A > C but A < F• Case 3: A > B and A > F, but A < C
– In case 1, all nodes will eventually conclude that E is unreachable.
– In case 2, a routing loop between A and F forms.
14
Routing loops– In case 3, a routing loop between A and C forms.
• In both cases 2 and 3, the cost to E keeps on increasing.– One solution to this problem is to declare the link
unusable when the cost reaches, say, 16 (count to infinity).
• Split horizon is another solution to solving 2-node routing loop.– A node will not advertise a route back to another node
that serves as the next hop for that route.– For example, B, C, F will not advertise their routes to
E back to A.
15
Routing information protocol (RIP)• RIP implements the distance vector approach.• A hop count of 16 is interpreted as infinity.• Each RIP router broadcasts its distance vectors
to its neighbors every 30 seconds.• RIP is implemented at the application level.
– Common daemons used on the Unix systems are the programs routed and gated.
– RIP packets are carried over UDP and IP.
16
Link state routing protocols• In this approach, every nodes maintains the
network topology information in a link state database.
• Thus, this approach relies on two mechanisms:– A reliable flooding for dissemination of link-state
information, and– a shortest-path algorithm for computing routes.
17
An example
D
G
A
F
E
B
C
18
An example• Link state database:
From To Metric Seq. NumberA B 1 1A C 1 1A D 1 1A E 1 1A F 1 1A G 1 1B A 1 1B C 1 1B D 1 1B E 1 1B F 1 1B G 1 1: : : :: : : :
19
Link state updates• The link state can be based on any metric,
including hop count, latency, throughput, monetary cost, etc.
• When a link state is changed, say from 1 to 2 for AE, A will send this update to all other nodes through a reliable flooding scheme.– A sends the update to B, C, F.– A ensures the reliable transmission of the update
through positive acknowledgment and retransmission.
20
Link state updates– B, C, F, upon receiving the update, compare the
sequence number of the update and that in their databases.
• If the sequence number in the update is higher, update the link state in the database, and forward it to other interfaces other than the one where the update is received.
• Otherwise, drop the update and no change in the database.– Although C receives two copies of the update, it
forwards only one copy to D and the other is discarded.
– The new link state database becomes
21
Link state updatesFrom To Metric Seq. NumberA B 1 1A C 1 1A D 1 1A E 2 2A F 1 1A G 1 1B A 1 1B C 1 1B D 1 1B E 1 1B F 1 1B G 1 1: : : :: : : :
22
Computing optimal paths• Given a link state database for the network
topology, each node can apply any shortest-path algorithms to find optimal paths from itself to other nodes in the network.
• For example, using the hop count as the metric, we have for node A:
23
Computing optimal paths
A
B
E
F G
C
D
24
Open shortest path first (OSPF) protocol• OSPF implements a link state approach.• OSPF supports different type-of-service routing
by having different sets of metric for route computation.
• OSPF supports equal-cost routes to a destination.
• OSPF reduces the amount of routing update messages as compared with RIP.
• OSPF provides fast and loopless convergence.
25
Interdomain routing• Interdomain routing is especially important for
backbone routers.• While intradomain routing is based on a
measurable quantity, interdomain routing is based on trust and policy.– The metric used in one domain may not be meaningful
in another domain.• Therefore, the objective of interdomain routing is
reachability, not optimality.– An interdomain routing protocol must be able to find a
loopless path to reach another AS.
26
Border gateway protocol (BGP)• The primary goal of BGP is to provide efficient
and robust interdomain routing with rapid convergence and loop detection.– This goal is accomplished by the concept of path
vector.• Two BGP speakers establish a BGP connection
by exchanging “open” messages.– The connection is maintained by periodic exchanges
of “keepalive” messages.– Routing information updates are sent in “update”
messages.
27
An example
Backbone network(AS 1)
Regional provider A(AS 2)
Regional provider B(AS 3)
Customer P(AS 4)
Customer Q(AS 5)
Customer R(AS 6)
Customer S(AS 7)
128.96.0.0192.4.153.0
192.4.32.0192.4.3.0
192.12.69.0
192.4.54.0192.4.23.0
28
An example• The BGP speakers of AS4-7 advertise
reachability information to their regional providers.
• AS2’s BGP speaker advertises reachability of 128.96.0.0, 192.4.153.0 with (AS2, AS4), and 192.4.32.0, and 192.4.3.0 with (AS2, AS5) to AS1.
• AS1 will in turn advertise this reachability information to AS3 with (AS1, AS2, AS4) and (AS1, AS2, AS5), respectively.
29
Another example
Backbone network(AS 1)
Regional provider A(AS 2)
Regional provider B(AS 3)
Customer P(AS 4)
Customer Q(AS 5)
Customer R(AS 6)
Customer S(AS 7)
128.96.0.0192.4.153.0
192.4.32.0192.4.3.0
192.12.69.0
192.4.54.0192.4.23.0
30
Another example• AS3 now receives two sets of reachability
information for 128.96.0.0, 192.4.153.0:– One from AS1 with (AS1, AS2, AS4), and– another from AS2 with (AS2, AS4).– Now, AS3 could decide based on the minimal
number of AS traversal.• The route (AS3, AS2, AS4) may return back to
AS2 via AS1.– AS2 will refuse to use this route when it finds its
AS number in the advertisement.