0% found this document useful (0 votes)
277 views28 pages

Unit-Iii: (Q) Explain Network Layer Design Issues? (2M/5M)

The document discusses several key topics regarding network layer design issues: 1. It describes store-and-forward packet switching, where packets are routed through intermediate nodes until reaching the destination. 2. It explains the services provided by the network layer to the transport layer, including uniform numbering and shielding the transport layer from network changes. 3. It discusses the implementation of connectionless and connection-oriented services, including how datagrams are routed independently in connectionless networks and how virtual circuits are established in connection-oriented networks.

Uploaded by

karthik vaddi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
277 views28 pages

Unit-Iii: (Q) Explain Network Layer Design Issues? (2M/5M)

The document discusses several key topics regarding network layer design issues: 1. It describes store-and-forward packet switching, where packets are routed through intermediate nodes until reaching the destination. 2. It explains the services provided by the network layer to the transport layer, including uniform numbering and shielding the transport layer from network changes. 3. It discusses the implementation of connectionless and connection-oriented services, including how datagrams are routed independently in connectionless networks and how virtual circuits are established in connection-oriented networks.

Uploaded by

karthik vaddi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

UNIT-III

(Q)Explain Network Layer Design Issues? (2M/5M)

Network Layer Design Issues


1. Store-and-forward packet switching
2. Services provided to transport layer
3. Implementation of connectionless service
4. Implementation of connection-oriented service
5. Comparison of virtual-circuit and datagram networks

1 Store-and-forward packet switching

A host with a packet to send transmits it to the nearest router, either on its own LAN or over a
point-to-point link to the ISP. The packet is stored there until it has fully arrived and the link has
finished its processing by verifying the checksum. Then it is forwarded to the next router along
the path until it reaches the destination host, where it is delivered. This mechanism is store-and-
forward packet switching.

2 Services provided to transport layer


The network layer provides services to the transport layer at the network layer/transport layer
interface. The services need to be carefully designed with the following goals in mind:
1. Services independent of router technology.
2. Transport layer shielded from number, type, topology of routers.
3. Network addresses available to transport layer use uniform numbering plan
– even across LANs and WANs
3 Implementation of connectionless service

If connectionless service is offered, packets are injected into the network individually and
routed independently of each other. No advance setup is needed. In this context, the packets
are frequently called datagrams (in analogy with telegrams) and the network is called a
datagram network.

A’s table (initially) A’s table (later) C’s Table E’s Table

Let us assume for this example that the message is four times longer than the maximum packet
size, so the network layer has to break it into four packets, 1, 2, 3, and 4, and send each of them
in turn to router A.
Every router has an internal table telling it where to send packets for each of the possible
destinations. Each table entry is a pair(destination and the outgoing line). Only directly
connected lines can be used.
A’s initial routing table is shown in the figure under the label ‘‘initially.’’
At A, packets 1, 2, and 3 are stored briefly, having arrived on the incoming link. Then each packet
is forwarded according to A’s table, onto the outgoing link to C within a new frame. Packet 1 is
then forwarded to E and then to F.
However, something different happens to packet 4. When it gets to A it is sent to router B, even
though it is also destined for F. For some reason (traffic jam along ACE path), A decided to send
packet 4 via a different route than that of the first three packets. Router A updated its routing
table, as shown under the label ‘‘later.’’
The algorithm that manages the tables and makes the routing decisions is called the routing
algorithm.
4 Implementation of connection-oriented service

A’s table C’s Table E’s Table

If connection-oriented service is used, a path from the source router all the way to the
destination router must be established before any data packets can be sent. This connection is
called a VC (virtual circuit), and the network is called a virtual-circuit network

When a connection is established, a route from the source machine to the destination machine
is chosen as part of the connection setup and stored in tables inside the routers. That route is
used for all traffic flowing over the connection, exactly the same way that the telephone system
works. When the connection is released, the virtual circuit is also terminated. With connection-
oriented service, each packet carries an identifier telling which virtual circuit it belongs to.

As an example, consider the situation shown in Figure. Here, host H1 has established connection
1 with host H2. This connection is remembered as the first entry in each of the routing tables.
The first line of A’s table says that if a packet bearing connection identifier 1 comes in from H1,
it is to be sent to router C and given connection identifier 1. Similarly, the first entry at C routes
the packet to E, also with connection identifier 1.
Now let us consider what happens if H3 also wants to establish a connection to H2. It chooses
connection identifier 1 (because it is initiating the connection and this is its only connection) and
tells the network to establish the virtual circuit.
This leads to the second row in the tables. Note that we have a conflict here because although
A can easily distinguish connection 1 packets from H1 from connection 1 packets from H3, C
cannot do this. For this reason, A assigns a different connection identifier to the outgoing traffic
for the second connection. Avoiding conflicts of this kind is why routers need the ability to
replace connection identifiers in outgoing packets.
In some contexts, this process is called label switching. An example of a connection-oriented
network service is MPLS (Multi Protocol Label Switching).

5 Comparison of virtual-circuit and datagram networks

(Q) What are the advantages of adaptive routing approach over non adaptive routing?

Routing Algorithms
The main function of NL (Network Layer) is routing packets from the source machine to the
destination machine.
There are two processes inside router:
a) One of them handles each packet as it arrives, looking up the outgoing line to use for it in
the routing table. This process is forwarding.
b) The other process is responsible for filling in and updating the routing tables. That is where
the routing algorithm comes into play. This process is routing.

Regardless of whether routes are chosen independently for each packet or only when new
connections are established, certain properties are desirable in a routing algorithm correctness,
simplicity, robustness, stability, fairness, optimality
Routing algorithms can be grouped into two major classes:
1) nonadaptive (Static Routing)
2) adaptive. (Dynamic Routing)

Nonadaptive algorithm do not base their routing decisions on measurements or estimates of


the current traffic and topology. Instead, the choice of the route to use to get from I to J is
computed in advance, off line, and downloaded to the routers when the network is booted. This
procedure is sometimes called static routing.

Adaptive algorithm, in contrast, change their routing decisions to reflect changes in the
topology, and usually the traffic as well.
Adaptive algorithms differ in
1) Where they get their information (e.g., locally, from adjacent routers, or from all routers),
2) When they change the routes (e.g., every ∆T sec, when the load changes or when the
topology changes), and
3) What metric is used for optimization (e.g., distance, number of hops, or estimated transit
time).
This procedure is called dynamic routing

Different Routing Algorithms


• Optimality principle
• Shortest path algorithm
• Flooding
• Distance vector routing
• Link state routing
• Hierarchical Routing

(Q) Explain the Optimality Principle with a suitable example.

The Optimality Principle


One can make a general statement about optimal routes without regard to network topology
or traffic. This statement is known as the optimality principle.
It states that if router J is on the optimal path from router I to router K, then the optimal path
from J to K also falls along the same
As a direct consequence of the optimality principle, we can see that the set of optimal routes
from all sources to a given destination form a tree rooted at the destination. Such a tree is called
a sink tree. The goal of all routing algorithms is to discover and use the sink trees for all routers
(a) A network. (b) A sink tree for router B.

Q) Describe Dijkstra shortest path algorithm. Also show working of Dijkstra


algorithm with the help of an example.
(or)
With an example, explain shortest path routing.
(or)
What happens when large packet wants to travel through network with smaller maximum
packet size? Explain.

Shortest Path Routing (Dijkstra’s)


The idea is to build a graph of the subnet, with each node of the graph representing a router
and each arc of the graph representing a communication line or link.
To choose a route between a given pair of routers, the algorithm just finds the shortest path
between them on the graph
1. Start with the local node (router) as the root of the tree. Assign a cost of 0 to this node and
make it the first permanent node.
2. Examine each neighbor of the node that was the last permanent node.
3. Assign a cumulative cost to each node and make it tentative
4. Among the list of tentative nodes
a. Find the node with the smallest cost and make it Permanent
b. If a node can be reached from more than one route then select the route with the
shortest cumulative cost.
5. Repeat steps 2 to 4 until every node becomes permanent
Q) The major problem with distance vector algorithm is ‘count to infinity’. How
exchange of complete path from router to destination instead of delay, helps in
solving count to infinity problem.
(or)

a)Elucidate Distance Vector Routing Algorithm with example.


b) Describe the problem and solutions associated with distance vector routing
(or)
What is count-to-infinity problem? Explain.
(or)
Explain distance vector routing algorithm.

Distance Vector Routing

In distance vector routing, the least-cost route between any two nodes is the route with
minimum distance. In this protocol, as the name implies, each node maintains a vector (table)
of minimum distances to every node.

Mainly 3 things in this

Initialization
Sharing
Updating

Initialization
Each node can know only the distance between itself and its immediate neighbors, those directly
connected to it. So for the moment, we assume that each node can send a message to the
immediate neighbors and find the distance between itself and these neighbors. Below fig shows
the initial tables for each node. The distance for any entry that is not a neighbor is marked as
infinite (unreachable).
Initialization of tables in distance vector routing

Sharing
The whole idea of distance vector routing is the sharing of information between neighbors.
Although node A does not know about node E, node C does. So if node C shares its routing table
with A, node A can also know how to reach node E. On the other hand, node C does not know
how to reach node D, but node A does. If node A shares its routing table with node C, node C
also knows how to reach node D. In other words, nodes A and C, as immediate neighbors, can
improve their routing tables if they help each other.
NOTE: In distance vector routing, each node shares its routing table with its immediate
neighbors periodically and when there is a change

Updating
When a node receives a two-column table from a neighbor, it needs to update its routing
table. Updating takes three steps:
1. The receiving node needs to add the cost between itself and the sending node to each value
in the second column. (x+y)
2. If the receiving node uses information from any row. The sending node is the next node in
the route.
3. The receiving node needs to compare each row of its old table with the corresponding row
of the modified version of the received table.
a. If the next-node entry is different, the receiving node chooses the row with the
smaller cost. If there is a tie, the old one is kept.
b. If the next-node entry is the same, the receiving node chooses the new row.
For example, suppose node C has previously advertised a route to node X with distance 3.
Suppose that now there is no path between C and X; node C now advertises this route with a
distance of infinity. Node A must not ignore this value even though its old entry is smaller. The
old route does not exist anymore. The new route has a distance of infinity.

Updating in distance vector routing

Final Diagram
When to Share
The question now is, When does a node send its partial routing table (only two columns) to all
its immediate neighbors? The table is sent both periodically and when there is a change in the
table.
Periodic Update A node sends its routing table, normally every 30 s, in a periodic update. The
period depends on the protocol that is using distance vector routing.
Triggered Update A node sends its two-column routing table to its neighbors anytime there is
a change in its routing table. This is called a triggered update. The change can result from the
following.
1. A node receives a table from a neighbor, resulting in changes in its own table after updating.
2. A node detects some failure in the neighboring links which results in a distance change to
infinity.

Two-node instability

Three-node instability

SOLUTIONS FOR INSTABILITY


1. Defining Infinity: redefine infinity to a smaller number, such as 100. For our previous
scenario, the system will be stable in less than 20 updates. As a matter of fact, most
implementations of the distance vector protocol define the distance between each node to
be 1 and define 16 as infinity. However, this means that the distance vector routing cannot
be used in large systems. The size of the network, in each direction, cannot exceed 15 hops.

2. Split Horizon: In this strategy, instead of flooding the table through each interface, each node
sends only part of its table through each interface. If, according to its table, node B thinks
that the optimum route to reach X is via A, it does not need to advertise this piece of
information to A; the information has come from A (A already knows). Taking information
from node A, modifying it, and sending it back to node A creates the confusion. In our
scenario, node B eliminates the last line of its routing table before it sends it to A. In this case,
node A keeps the value of infinity as the distance to X. Later when node A sends its routing
table to B, node B also corrects its routing table. The system becomes stable after the first
update: both node A and B know that X is not reachable.

3. Split Horizon and Poison Reverse Using the split horizon strategy has one drawback.
Normally, the distance vector protocol uses a timer, and if there is no news about a route,
the node deletes the route from its table. When node B in the previous scenario eliminates
the route to X from its advertisement to A, node A cannot guess that this is due to the split
horizon strategy (the source of information was A) or because B has not received any news
about X recently. The split horizon strategy can be combined with the poison reverse
strategy. Node B can still advertise the value for X, but if the source of information is A, it can
replace the distance with infinity as a warning: "Do not use this value; what I know about this
route comes from you."

The Count-to-Infinity Problem


Q) Write in detail about Link-state routing algorithm and mention its advantages and
disadvantages.
Link State Routing
Link state routing is based on the assumption that, although the global knowledge about the
topology is not clear, each node has partial knowledge: it knows the state (type, condition, and
cost) of its links. In other words, the whole topology can be compiled from the partial knowledge
of each node

Building Routing Tables


1. Creation of the states of the links by each node, called the link state packet (LSP).
2. Dissemination of LSPs to every other router, called flooding, in an efficient and reliable way.
3. Formation of a shortest path tree for each node.
4. Calculation of a routing table based on the shortest path tree

I. Creation of Link State Packet (LSP) A link state packet can carry a large amount of
information. For the moment, we assume that it carries a minimum amount of data: the
node identity, the list of links, a sequence number, and age. The first two, node identity and
the list of links, are needed to make the topology. The third, sequence number, facilitates
flooding and distinguishes new LSPs from old ones. The fourth, age, prevents old LSPs from
remaining in the domain for a long time.
LSPs are generated on two occasions:
1. When there is a change in the topology of the domain
2. on a periodic basis: The period in this case is much longer compared to distance vector.
The timer set for periodic dissemination is normally in the range of 60 min or 2 h based on
the implementation. A longer period ensures that flooding does not create too much traffic
on the network.
II. Flooding of LSPs: After a node has prepared an LSP, it must be disseminated to all other
nodes, not only to its neighbors. The process is called flooding and based on the following
1. The creating node sends a copy of the LSP out of each interface
2. A node that receives an LSP compares it with the copy it may already have. If the newly
arrived LSP is older than the one it has (found by checking the sequence number), it
discards the LSP. If it is newer, the node does the following:
a. It discards the old LSP and keeps the new one.
b. It sends a copy of it out of each interface except the one from which the packet arrived.
This guarantees that flooding stops somewhere in the domain (where a node has only
one interface).
III. Formation of Shortest Path Tree: Dijkstra Algorithm
A shortest path tree is a tree in which the path between the root and every other node is the
shortest.
The Dijkstra algorithm creates a shortest path tree from a graph. The algorithm divides the
nodes into two sets: tentative and permanent. It finds the neighbors of a current node, makes
them tentative, examines them, and if they pass the criteria, makes them permanent.
IV. Calculation of a routing table
routing table for node A

Q) Explain Path Vector Routing

Path Vector Routing


Distance vector and link state routing are both intra domain routing protocols. They can be used
inside an autonomous system, but not between autonomous systems. These two protocols are
not suitable for inter domain routing mostly because of scalability. Both of these routing
protocols become intractable when the domain of operation becomes large. Distance vector
routing is subject to instability in the domain of operation. Link state routing needs a
huge amount of resources to calculate routing tables. It also creates heavy traffic because of
flooding. There is a need for a third routing protocol which we call path vector routing.

Path vector routing proved to be useful for inter domain routing. The principle of path vector
routing is similar to that of distance vector routing. In path vector routing, we assume that
there is one node (there can be more, but one is enough for our conceptual discussion) in each
AS that acts on behalf of the entire AS. Let us call it the speaker node. The speaker node in an
AS creates a routing table and advertises it to speaker nodes in the neighboring ASs. The idea is
the same as for distance vector routing except that only speaker nodes in each AS can
communicate with each other. However, what is advertised is different. A speaker node
advertises the path, not the metric of the nodes, in its autonomous system or other autonomous
systems

Initialization
Initial routing tables in path vector routing

Sharing
Just as in distance vector routing, in path vector routing, a speaker in an autonomous system
shares its table with immediate neighbors. In Figure, node A1 shares its table with nodes B1
and C1. Node C1 shares its table with nodes D1, B1, and A1. Node B1 shares its table with C1
and A1. Node D1 shares its table with C1.

Updating When a speaker node receives a two-column table from a neighbor, it updates its own
table by adding the nodes that are not in its routing table and adding its own autonomous
system and the autonomous system that sent the table. After a while each speaker has a table
and knows how to reach each node in other Ass
a) Loop prevention. The instability of distance vector routing and the creation of loops can be
avoided in path vector routing. When a router receives a message, it checks to see if its AS is
in the path list to the destination. If it is, looping is involved and the message is ignored.
b) Policy routing. Policy routing can be easily implemented through path vector routing. When
a router receives a message, it can check the path. If one of the AS listed in the path is against
its policy, it can ignore that path and that destination. It does not update its routing table
with this path, and it does not send this message to its neighbors.
c) Optimum path. What is the optimum path in path vector routing? We are looking for a path
to a destination that is the best for the organization that runs the AS. One system may use
RIP, which defines hop count as the metric; another may use OSPF with minimum delay
defined as the metric. In our previous figure, each AS may have more than one path to a
destination. For example, a path from AS4 to ASI can be AS4-AS3-AS2-AS1, or it can be AS4-
AS3-ASI. For the tables, we chose the one that had the smaller number of ASs, but this is
not always the case. Other criteria, such as security, safety, and reliability, can also be applied
(Q) Explain Hierarchical Routing

As networks grow in size, the router routing tables grow proportionally. Not only is router
memory consumed by ever-increasing tables, but more CPU time is needed to scan them and
more bandwidth is needed to send status reports about them.
At a certain point, the network may grow to the point where it is no longer feasible for every
router to have an entry for every other router, so the routing will have to be done hierarchically,
as it is in the telephone network.
When hierarchical routing is used, the routers are divided into what we will call regions. Each
router knows all the details about how to route packets to destinations within its own region
but knows nothing about the internal structure of other regions.
For huge networks, a two-level hierarchy may be insufficient; it may be necessary to group the
regions into clusters, the clusters into zones, the zones into groups, and so on, until we run out
of names for aggregations

When a single network becomes very large, an interesting question is ‘‘how many levels
should the hierarchy have?’’
For example, consider a network with 720 routers. If there is no hierarchy, each router needs
720 routing table entries.
If the network is partitioned into 24 regions of 30 routers each, each router needs 30 local
entries plus 23 remote entries for a total of 53 entries.
If a three-level hierarchy is chosen, with 8 clusters each containing 9 regions
of 10 routers, each router needs 10 entries for local routers, 8 entries for
routing to other regions within its own cluster, and 7 entries for distant
clusters, for a total of 25 entries
Kamoun and Kleinrock (1979) discovered that the optimal number of levels
for an N router network is ln N, requiring a total of e ln N entries per router

Q) Explain the general principles of congestion control.


(or)
b) Explain the congestion prevention policies
CONGESTION CONTROL
Congestion control refers to techniques and mechanisms that can either prevent congestion
before it happens or remove congestion after it has happened.
Congestion control mechanisms can be divided into two categories:
1. Open-loop congestion control (prevention)
2. Closed-loop congestion control (removal)

Open-Loop Congestion Control

In open-loop congestion control, policies are applied to prevent congestion before it happens.
Here congestion control is handled by either the source or the destination.

Retransmission Policy

The packet needs to be retransmitted by sender, when a packet is lost or corrupted.


Retransmission is sometimes unavoidable. It may increase congestion in the network.
The retransmission policy and the retransmission timers must be designed to optimize
efficiency and at the same time prevent congestion.
Example: Retransmission policy used by TCP is designed to prevent or alleviate congestion.

Window Policy

The Selective Repeat window is better than the Go-Back-N window for congestion control.
In the Go-Back-N window, when the timer for a packet is expired several packets will be
resent, although some may have arrived safe and sound at the receiver. This duplication
may make the congestion worse.
The Selective Repeat window tries to send the specific packets that have been lost or
corrupted.

Acknowledgment Policy

The acknowledgments are also part of the load in a network. Sending fewer
acknowledgments means imposing less load on the network.
If the receiver does not acknowledge every packet it receives, it may slow down the
sender and help prevent congestion.
A receiver may send an acknowledgment only if it has a packet to be sent or a special
timer expires.

Discarding Policy

A good discarding policy by routers may prevent congestion.


Example: In audio transmission if the policy is to discard less sensitive packets when
congestion happens, the quality of sound is still preserved and congestion is prevented.

Admission Policy

An admission policy can prevent congestion in virtual-circuit networks.


Switches first check the resource requirement of a data flow before admitting it to the
network.
A router can deny establishing a virtual-circuit connection if there is congestion in the
network or if there is a possibility of future congestion.

Closed-Loop Congestion Control

Closed-loop congestion control mechanisms try to alleviate congestion after it happens.


Several mechanisms have been used by different protocols are: Back pressure, Choke packet,
Implicit signaling, Explicit signaling.

Backpressure

In Backpressure mechanism, a congested node stops receiving data from the immediate
upstream node.
This may cause the upstream nodes to become congested and they reject data from their
upstream nodes.
Backpressure is a node-to-node congestion control that starts with a node and propagates
in the opposite direction of data flow to the source.
The backpressure technique can be applied only to virtual circuit networks, in which
each node knows the upstream node from which a data flow is coming.

Choke Packet

A choke packet is a packet sent by a node to the source to inform that congestion has
occurred.
In the choke packet method, the warning is sent from the router, which has encountered
congestion to the source station directly. The intermediate nodes through which the packet
has traveled are not warned.

Implicit Signaling

In implicit signaling, there is no communication between the congested nodes and the
source.
Source guesses that there is congestion somewhere in the network from other symptoms.
Example: when a source sends several packets and there is no acknowledgment for a while,
one assumption is that the network is congested. The delay in receiving an acknowledgment
is interpreted as congestion in the network and the source should slow down sending speed.

Explicit Signaling

The node that experiences congestion can explicitly send a signal to the source or
destination.
In explicit signaling method, the signal is included in the packets that carry data.
Explicit signaling can occur in either the forward or the backward direction.

(Q) Explain Congestion Detection and Avoidance

CONGESTION CONTROL in TCP


TCP uses congestion control to avoid congestion or alleviate congestion in the network.
Congestion Window

In TCP the sender window size is determined by the available buffer space in the receiver
(rwnd). That means receiver dictates the sender about the size of the sender's window.
If the network cannot deliver the data as fast as they are created by the sender then the
network must tell the sender to slow down. So the network can also determine the size of
the sender's window.
Hence the Sender window size is determined by the receiver and by congestion in the
network.
The actual size of the window is the minimum of (receiver window, congestion window).

Actual Window Size = minimum ( rwnd,cwnd)

Congestion Policy
There are three phases in TCP's Congestion policy: Slow start, Congestion Avoidance and
Congestion Detection.

Slow Start: Exponential Increase

In this algorithm is based on the size of the congestion window (cwnd) starts with
one maximum segment size (i.e. cwnd=1 MSS).
The MSS is determined during connection establishment by using an option of the
same name.
The size of the window increases one MSS each time an acknowledgment is received.
As the name implies, the window starts slowly but grows exponentially.
Example: Consider the below figure that shows the communication between client and server
by using Slow start mechanism.
If Receiver window (rwnd) is much higher than Congestion window (cwnd) then the
sender window size always equals Congestion window size (cwnd). Each segment is
acknowledged individually.
The sender starts with cwnd=1MSS (i.e.) the sender can send only one segment.
After receipt of the acknowledgment for segment 1, the size of the congestion window is
increased by 1 (i.e.) cwnd = 2.
Now two more segments can be sent. When each acknowledgment is received, the size
of the window is increased by 1 MSS.
When all seven segments are acknowledged cwnd = 8.
Start cwnd=1
After round 1 cwnd=21=2
After round 2 cwnd=22=4
After round 3 cwnd=23=8
If there is delayed ACKs, the increase in the size of the window is less than power of 2.
Slow start cannot continue indefinitely. There must be a threshold to stop this phase.
The sender keeps track of a variable called ssthresh (slow-start threshold). In general the
value of ssthresh is 65,535 bytes.
When the size of window in bytes reaches threshold value then the slow start stops and
the next phase starts.

Congestion Avoidance: Additive Increase

When the size of the congestion window reaches the slow-start threshold, the slow-start
phase stops and the additive phase begins.
In this algorithm, each time the whole window of segments is acknowledged (one
round), the size of the congestion window is increased by 1.
Consider the below figure that implements Additive Increase algorithm:
In this case, after the sender has received acknowledgments for a complete window size of
segments, the size of the window is increased by one segment.
Start cwnd= l
After round 1 cwnd= 1+ 1 =2
After round 2 cwnd= 2+ 1 =3
After round 3 cwnd= 3+ 1 =4

Congestion Detection: Multiplicative Decrease

If congestion occurs, the congestion window size must be decreased.


When there is a need to retransmit segment, then the sender guess that at some place the
congestion has occurred.
Retransmission can occur in one of two cases: when a timer times out or when three
ACKs are received.
In both cases, the size of the threshold is dropped to one-half (i.e.) a multiplicative
decrease.
TCP implementations have two reactions:
1. If a time-out occurs, there is a stronger possibility of congestion. A segment has probably
been dropped in the network and there is no news about the sent segments.
In this case TCP reacts strongly:
a. It sets the value of the threshold to one-half of the current window size.
b. It sets cwnd to the size of one segment (i.e.) cwnd=1.
c. It starts the slow-start phase again.
2. If three ACKs are received, there is a weaker possibility of congestion. A segment may
have been dropped but some segments after that may have arrived safely since three ACKs
are received. This is called fast transmission and fast recovery.
In this case, TCP has a weaker reaction:
a. It sets the value of the threshold to one-half of the current window size.
b. It sets cwnd to the value of the threshold (i.e.) cwnd= ssthresh.
c. It starts the congestion avoidance phase.
Backward Signaling A bit can be set in a packet moving in the direction opposite to the congestion. This bit
can warn the source that there is congestion and that it needs to slow down to avoid the discarding of packets.
Forward Signaling A bit can be set in a packet moving in the direction of the congestion. This bit can warn the
destination that there is congestion. The receiver in this case can use policies, such as slowing down the acknowledgments
to get rid of the congestion.

Q) Explain QOS in Network layer?


(or)
Explain techniques to improve QOS?
(or)
Explain Leaky Bucket nd Token Bucket Algorithm?

QUALITY OF SERVICE (QoS)


It is an internetworking issue. There are four Flow characteristics are related to Qos. They are:
Reliability, Delay, Jitter and Bandwidth.
Reliability: Lack of reliability means that losing a packet or acknowledgment, which entails retransmission.
Electronic mail, file transfer, and Internet access have reliable transmissions. Delay: Applications can tolerate
delay in different degrees. Telephony, audio conferencing, video conferencing, and remote log-in need minimum
delay.
Jitter: It is the variation in delay for packets belonging to the same flow. If four packets depart at times 0, 1, 2,3 and
arrive at 20, 21, 22, 23 all have the same delay = 20 units of time. Audio and video applications accept the delay of
packets as long as if the delay is same for all the packets.
Bandwidth: Different applications need different bandwidths. In video conferencing, it needs to send millions of
bits per second to refresh a color screen while the total number of bits in an e-mail may not reach even a million.
TECHNIQUES TO IMPROVE QoS
There are four techniques that will improve the QoS:
1. Scheduling
2. Traffic shaping
3. Admission control
4. Resource reservation

Scheduling

Packets from different flows arrive at a switch or router for processing.


Several scheduling techniques are designed to improve the quality of service such as: FIFO Queuing, Priority
Queuing and Weighted fair queuing.

First-In-First-Out Queuing (FIFO)

In FIFO queuing, the packets wait in a buffer (queue) until the node (router or switch) is ready to process them.
If the average arrival rate is higher than the average processing rate then the queue will fill up and new packets
will be discarded.
That means the speed of receiving the packets in to buffer is more than the speed of processing the packets by
processor then the buffer will be filled completely and then there is no place for newly arrived packets hence
these packets will be discarded.

Priority Queuing

In priority queuing, packets are first assigned to a priority class. Each priority class has its own queue.
The packets in the highest-priority queue are processed first. Packets in the lowest- priority queue are
processed last.
The system does not stop serving a queue until it is empty.
There is drawback with priority queues called Starvation (i.e.) if there is a continuous data flow in a high-
priority queue, the packets in the low-priority queues will never have a chance to be processed.

Weighted Fair Queuing

In this technique, the packets are still assigned to different classes and admitted to different queues.
The queues are weighted based on the priority of the queues; higher priority means a higher weight.
The system processes packets in each queue in a Round-Robin fashion with the number of packets selected
from each queue based on the corresponding weight.
Example: If the weights are 3, 2, and 1, three packets are processed from the first queue, two from the second queue,
and one from the third queue. If the system does not impose priority on the classes, all weights can be equal. In this
way, we will achieve fair queuing with priority.

Traffic Shaping

Traffic shaping is a mechanism to control the amount of traffic and the rate of the traffic sent to the network. Two
techniques can shape traffic: Leaky bucket and Token bucket.

Leaky Bucket

If a bucket has a small hole at the bottom, the water leaks from the bucket at a constant rate as long as there is
water in the bucket. The rate at which the water leaks does not depend on the rate at which the water is input to
the bucket unless the bucket is empty. The input rate can vary, but the output rate remains constant.
In networking, a technique called leaky bucket can smooth out Bursty traffic. Bursty chunks are stored in the
bucket and sent out at an average rate.

In the above figure, the network has committed a bandwidth of 3 Mbps for a host. The use of the leaky bucket
shapes the input traffic to make it conform to this commitment.
The host sends a burst of data at a rate of 12 Mbps for 2 sec, for a total of 24 Mbits of data.
The host is silent for 5 sec and then sends data at a rate of 2 Mbps for 3 sec, for a total of 6 Mbits of data.
In total the host has sent 30 Mbits of data in l0s.
The leaky bucket smoothen the traffic by sending out data at a rate of 3 Mbps during the same 10 sec.
Without the leaky bucket, the beginning burst may have hurt the network by consuming more bandwidth than
is set aside for this host.
This way the leaky bucket may prevent congestion.
Consider the below figure that shows implementation of Leaky Bucket:

A FIFO queue holds the packets. If the traffic consists of fixed-size packets the process removes a fixed
number of packets from the queue at each tick of the clock.
If the traffic consists of variable-length packets, the fixed output rate must be based on the number of bytes or
bits.
The following is an algorithm for variable-length packets:
1. Initialize a counter to n at the tick of the clock
2. If n is greater than the size of the packet, send the packet and decrement the counter by the packet size. Repeat
this step until n is smaller than the packet size.
3. Reset the counter and go to step 1.
Problems with Leaky Bucket

1. The leaky bucket is very restrictive. If a host is not sending for a while, its bucket becomes empty.
2. After some time if the host has bursty data, the leaky bucket allows only an average rate. The time when the
host was idle is not taken into account.
These problems can be overcome by Token bucket algorithm.

Token Bucket

The token bucket algorithm allows idle hosts to accumulate credit for the future in the form of tokens.
For each tick of the clock, the system sends n tokens to the bucket.
The system removes one token for every cell (or byte) of data sent.
Example: If n is 100 and the host is idle for 100 ticks, the bucket collects 10,000 tokens.
Now the host can consume all these tokens in one tick with 10,000 cells, or the host takes 1000 ticks with 10
cells per tick.
The host can send bursty data as long as the bucket is not empty.

The token bucket can easily be implemented with a counter.


The token is initialized to zero.
Each time a token is added, the counter is incremented by 1.
Each time a unit of data is sent, the counter is decremented by 1.
When the counter is zero, the host cannot send data.

Resource Reservation

A flow of data needs resources such as a buffer, bandwidth, CPU time, and so on.
The quality of service is improved if these resources are reserved before data transfer.

Admission Control

Admission control refers to the mechanism used by a router or a switch to accept or reject a flow based on
predefined parameters called flow specifications.
Before a router accepts a flow for processing, it checks the flow specifications to see if its capacity and its
previous commitments to other flows can handle the new flow.
Note: Capacity is in terms of bandwidth, buffer size, CPU speed, etc.

You might also like