Network Layer

Network Layer – Routing 1
Dr. Sanjay P. Ahuja, Ph.D.
Fidelity National Financial Distinguished Professor of CIS
School of Computing, UNF
Introduction




Network Layer is responsible for delivering packets from source to
destination over multiple links (routing).
Network layer provides a service to the Transport Layer.
Application
The Transport Layer is shielded from number, type,
Transport
and topology of the subnets present.
Two types of network layer services considered:
Network
connectionless (using datagrams) and
Link
connection-oriented (using Virtual Circuits).
Physical
Routing

Routing is one of the most complex and crucial aspects of
a packet switched network.

Desirable attributes of routing include:




Correctness
Simplicity
Robustness
Stability
Elements of Routing Techniques

Performance Criteria:


Least number of hops
Least cost based on:



Decision Time



Delay
Throughput
Datagram
Virtual Circuit
Decision Place



Each node (distributed)
Central node (centralized)
Originating node
Least-Cost Algorithms

Virtually all packet switched networks base their routing decision on some
form of least-cost routing.



E.g. least cost α current load on link (delay)
E.g. least cost 1/α link capacity (or bandwidth)
The least-cost routing algorithm states that: “Given a network of nodes
connected by bidirectional links, where each link has a cost associated with it
in each direction, define the cost of a path between nodes as the sum of the
costs of the links traversed. For each pair of nodes find the path with the least
cost.”
Dijkstra’s Algorithm

This finds the shortest paths from a given source node to all other
nodes by developing the paths in order of increasing path length.

Definitions:





N = set of nodes in the network
s = source node
M = set of nodes so far incorporated by the algorithm
dij = link cost from node i to node j; dii = 0; dij = ∞ if the two nodes are not directly
connected; dij >= 0 if the two nodes are directly connected.
Dn = cost of least-cost path from node s to node n that is currently known to the
algorithm.
Dijkstra’s Algorithm

The algorithm has 3 steps; step 2 and 3 are repeated until M = N.
1. Initialize:
M = {s}
Dn = dsn for n ≠ s
i.e. set of nodes incorporated is only the source node
i.e. initial path costs to neighboring nodes are simply
the link costs
2. Find the neighboring node not in M that has the least-cost path from node s
and incorporate that node in M:
Find w ε M such that Dw = min Dj
jεM
Add w to M.
3. Update least-cost paths:
Dn = min [Dn, Dw + dwn] for all n ε M.
If the latter term is the minimum, the path from s to n is now the path from s
to w concatenated with the link from w to n.
Dijkstra’s Algorithm - Example
Dijkstra’s Algorithm - Example

Source node = 1
Iteration
M
D2
Path
D3
Path
D4
1
{1}
2
1-2
5
1-3
1
2
{1,4}
2
1-2
4
1-4-3
3
{1, 2, 4}
2
1-2
4
4
{1, 2, 4, 5}
2
1-2
5
{1,2,3,4,5}
2
6
{1,2,3,4,5,6}
2
Path
D5
Path
D6
Path
1-4
∞
---
∞
---
1
1-4
2
1-4-5
∞
---
1-4-3
1
1-4
2
1-4-5
∞
---
3
1-4-5-3
1
1-4
2
1-4-5
4
1-4-5-6
1-2
3
1-4-5-3
1
1-4
2
1-4-5
4
1-4-5-6
1-2
3
1-4-5-3
1
1-4
2
1-4-5
4
1-4-5-6
Routing Strategies – Static or Fixed Routing

Static or Fixed Routing
Route selected for each s-d pair using Dijkstra’s algorithm.
Routes are fixed and can only change if there is change in topology.
Costs based on link capacity and not traffic conditions.
Advantage: Simplicity; works well in a network with steady load.
Disadvantage: Does not react to congestion or failures.
Routing Strategies – Flooding

Requires no network information at all.

A packet is sent by source node to all its neighbors. At each node, incoming
packet is retransmitted on all outgoing links except for the link that it arrived
from.

To prevent incessant retransmissions, a hop count field is included with each
packet. The count is sent to some maximum value.

Advantage: All possible routes between s and d tried. So a packet always gets
through as long as at least one path exists between s and d.

Disadvantage: Traffic load generated increases with network connectivity;
could cause traffic delays.