Professional Documents
Culture Documents
1
Network Layer
2
3
Two key network-layer functions
4
Interplay between routing and forwarding
6
Services Provided by The Network Layer
7
Virtual Circuit and Datagram Networks
8
Implementation of Network Layer Services
IP (Internet Protocol),
which is the basis for
the entire Internet, is
the dominant example
of a connectionless
network service. 10
Virtual Circuit Networks
• That route is used for all traffic flowing over the connection,
exactly the same way that the telephone system works.
Connection
identifier
12
Comparison of Virtual-Circuit and Datagram
Networks
Static
Dynamic
13
Routing Algorithms
• Routing Algorithm decides which line the packet will take
• We refer to the default router of the source host as the source router
and the default router of the destination host as the destination
router. 14
Routing Algorithms
• Hierarchical Routing
• Broadcast Routing
• Multicast Routing
• Anycast Routing
15
Routing Algorithm and Graph abstraction
v 3 w
2 5
u 2 1 z
3
1 2
x y
1
graph: G = (N,E)
N = set of routers = { u, v, w, x, y, z }
E = set of links ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) }
16
Graph abstraction: Costs
• For any edge (x,y) in E, we denote c(x,y) as the cost of the edge
between nodes x and y.
• least-cost path: Find a path between the source and destination that
has least cost.
• Note that if all edges in the graph have the same cost, the least-cost
path is also the shortest path (that is, the path with the smallest
number of links between the source and the destination). 18
The Link-State (LS) Routing Algorithm
19
Dijkstra’s Algorithm
1 Initialization:
2 N' = {u}
3 for all nodes v
4 if v adjacent to u
5 then D(v) = c(u,v)
6 else D(v) = ∞
7
8 Loop
9 find w not in N' such that D(w) is a minimum
10 add w to N'
11 update D(v) for all v adjacent to w and not in N' :
12 D(v) = min( D(v), D(w) + c(w,v) )
13 /* new cost to v is either old cost to v or known
14 shortest path cost to w plus cost from w to v */
15 until all nodes in N'
20
Dijkstra’s Algorithm
x
9
21
Least cost path and forwarding table
22
Distance Vector Algorithm
• key idea:
• from time-to-time, each node sends its own distance vector estimate
to neighbors
• when x receives new DV estimate from neighbor, it updates its own
DV using B-F equation:
Dx(y) ← minv{c(x,v) + Dv(y)} for each node y ∊ N
each node:
wait for (change in local link cost
or msg from neighbor)
recompute estimates
23
Step-by-Step
Figure 4.30 25
DV Algorithm Initial Operation
26
Sending DV between neighbor hosts
• After initialization, each node sends its distance vector to each of its
two neighbors.
• This is illustrated in Figure 4.30 by the arrows from the first column
of tables to the second column of tables.
• For example, node x sends its distance vector Dx = [0, 2, 7] to both
nodes y and z. After receiving the updates, each node re-computes
its own distance vector. For example, node x computes
• The second column, in Figure 4.30, displays, for each node, the
node’s new distance vector along with distance vectors just received
from its neighbors.
27
Distance-vector (DV) Algorithm Operation
• Note that only nodes x and z send updates: node y’s distance
vector didn’t change so node y doesn’t send an update.
29
Changes in Link Cost