You are on page 1of 4

CPS 422 Network Layer - Classes of Service

Computer Networks ‰Network Layer provides two classes of services


o Connection oriented
o Connection-less
‰A connection is usually called a virtual circuit (VC)
‰The independent packets of a connectionless
NETWORK LAYER service are called datagrams
‰In a VC all packets follow the same route from
source to destination
‰In a connectionless service all packets (datagrams)
are routed independent of each other

Faisal Amjad CPS 422 Faisal Amjad CPS 422

Comparison of VC and datagram subnets Routing and Classes of service


Issue Datagram Subnet VC Subnet ‰ The main function of the network layer is routing packets
from source to destination machine
Circuit setup Not needed Required
‰ In most of the cases, packets will require multiple hops to
Addressing Each packet contains source Each packet contains make this journey
destination address a short VC number
‰ Hence, Routing algorithm is that part of network layer
State information Subnet does not hold Each VC requires a
table space
software, responsible for deciding which output line an
incoming packet should be transmitted on
Routing Each packet routed Route chosen at
independently circuit setup, all ‰ For subnets using datagrams (e.g. IP) this decision is made
packets follow it
anew for every arriving data packets since the best route
Effect of router None, except for packets lost
during the crash
All VCs at point of
failure are
may have changed since the last time
failure terminated ‰ For subnets employing VCs (e.g. ATM based networks), the
Congestion control Difficult Easy because buffers routing decision is made at circuit setup time
are allocated in
advance for each VC ‰ Data packets in this case follow the previously established
route ( also called session routing )
Faisal Amjad CPS 422 Faisal Amjad CPS 422

Routing Algorithm and its Properties Routing Algorithm and its Properties (Contd)

‰ Properties required from a Routing protocol are ‰Stability is an important goal, an algorithm must
o Correctness
come to conclusion quickly, so that routing
o Simplicity
o Robustness decisions are not held up for long
o Stability ‰Fairness means all hosts’ traffic is treated equally
o Fairness
o Optimality ‰Optimality means that the network resources are
‰ Without correctness a routing protocol is useless utilized to their maximum efficiency
‰ A simple protocol is an efficient one, that requires less ‰Fairness and optimality are often contradicting
processing at the router
goals
‰ Robustness: Once a network comes up, it may undergo
changes, failures etc. many times. The routing protocol
must be able to handle all sorts of changes, without
requiring all jobs to be aborted and system rebooting

Faisal Amjad CPS 422 Faisal Amjad CPS 422

1
Routing Algorithm and its Properties (Contd)
Conflict between fairness and optimality
‰What do we need to optimize???
A B ‰One metric could be mean packet delay
‰Another one could be network throughput
‰But both of them are again conflicting goals
C C1 ‰Increasing network throughput would mean having
more and more packets in the buffers of the
routers so that they do not sit idle
A1 B1 ‰However this would increase mean packet delay
‰To reduce mean packet delay we should have a
smaller queue at the routers
‰Hence these two goals prove to be in contradiction
Faisal Amjad CPS 422 Faisal Amjad CPS 422

Routing Algorithms and their Classes Shortest Path Routing


‰ Two classes of routing algorithms
‰A widely used, static routing algorithm
o Non adaptive algorithms and
o Adaptive algorithms ‰The idea is to build a graph of the subnet, with
‰ Non-adaptive algorithms do not base their routing each node of the graph representing a router and
decisions on estimates of current traffic or topology. each arc representing a communication link.
‰ The choice of routes is computed in advance, off-line and
downloaded to the routers when the network is booted. ‰To choose a route between given routers, the
This is also called static routing algorithm finds the shortest path
‰ Adaptive routing algorithms change their routing decisions ‰The “shortest path” may be computed on the basis
to reflect changes in topology and traffic conditions
of number of hops, the distance, bandwidth
‰ Adaptive algorithms differ in
o From where they get routing information available, queue lengths etc.
o When do they change routes ‰Any number of metrics can be used for shortest
o What metric is used for optimization
path calculation
Faisal Amjad CPS 422 Faisal Amjad CPS 422

Dijkstra’s Algorithm - Shortest Path Routing


B C
‰Each node is labeled (in parenthesis) with its 2
7
3
distance from the source node along the best A
2 E 2
F
3
D
known path 6 1 2
2

‰Initially no paths are known so the nodes are G 4


H

labeled with infinity


‰As the algorithm proceeds, paths are found and ‰ We want to find the shortest route from A to D
labels changed, reflecting better paths. ‰ A is the starting node, made permanent by a filled circle
‰ All links are labeled with the distance from adjacent nodes
‰A label may be tentative or permanent.
‰ All nodes adjacent to A will be considered in this run, in
‰Initially all labels are tentative, but made this case B and G
permanent when they are established as shortest
paths.
Faisal Amjad CPS 422 Faisal Amjad CPS 422

2
B (2,A) C ( ∞,-) B (2,A) C ( ∞,-)
7 7
2 3 2 3
2 E( ∞,-) 2 3 2 E( ∞,-) 2 3
A F( ∞,-) D ( ∞,-) A F( ∞,-) D ( ∞,-)
6 1 2 6 1 2
2 2
G (6,A) 4 G (6,A) 4
H ( ∞,-) H ( ∞,-)

‰ We have labeled all the nodes of the graph ‰ Node with a Label having the shortest path will be made
‰ Nodes adjacent to A are labeled with their distance from permanent, in this case B (indicated by a filled circle)
A, alongwith the node identity from which this probe was ‰ This node (B) now becomes the working node and
made subsequent probe will be made from it
‰ Nodes not adjacent to A are labeled with infinity

Faisal Amjad CPS 422 Faisal Amjad CPS 422

B (2,A) C ( 9,B) B (2,A) C ( 9,B)


7 7
2 3 2 3
2 E( 4,B) 2 3 2 E( 4,B) 2 3
A F( ∞,-) D ( ∞,-) A F( 6,E) D ( ∞,-)
6 1 2 6 1 2
2 2
G (6,A) 4 G (6,A) 4
H ( ∞,-) H ( ∞,-)
G (5,E)

‰ All nodes adjacent to B are probed and labels now changed ‰ All nodes adjacent to E are probed and labels now changed
according to their distances according to their distances
‰ Node with the label having shortest distance will be made ‰ Note that the label of G has to change since its distance is
permanent next lesser from E (5) rather than directly from A (6)
‰ Which node (with a tentative label) has the shortest
distance label ??

Faisal Amjad CPS 422 Faisal Amjad CPS 422

B (2,A) C ( 9,B) B (2,A) C ( 9,B)


7 7
2 3 2 3
2 E( 4,B) 2 3 2 E( 4,B) 2 3
A F( 6,E) D ( ∞,-) A F( 6,E) D ( ∞,-)
6 1 2 6 1 2
2 2
G (5,E) 4 G (5,E) 4
H ( ∞,-) H ( 9,G)

‰ Now all tentative nodes are scanned and the one with ‰ Now all neighbors of G are probed and labeled, in this case
shortest distance will be made permanent, and made the H
working node

Faisal Amjad CPS 422 Faisal Amjad CPS 422

3
B (2,A) C ( 9,B) B (2,A) C ( 9,B)
7 7
2 3 2 3
2 E( 4,B) 2 3 2 E( 4,B) 2 3
A F( 6,-E D ( ∞,-) A F( 6,E) D ( ∞,-)
6 1 2 6 1 2
2 2
G (5,E) 4 G (5,E) 4
H ( 9,G) H ( 8,F)

‰ Since F has smallest distance, it is made permanent ‰ Since H has smallest distance, it is made permanent

Faisal Amjad CPS 422 Faisal Amjad CPS 422

B (2,A) C ( 9,B)
7
2 3
2 E( 4,B) 2 3
A F( 6,E) D ( 10,H)
6 1 2
2
G (5,E) 4
H ( 8,F)

‰ Since H has smallest distance, it is made permanent


‰ In the next run D will have the shortest path from H (10)
‰ At the end the shortest path will be constructed from the
labels already made permanent
‰ DHFEBA will at the end be reversed to get the (forward)
shortest path

Faisal Amjad CPS 422

You might also like