0% found this document useful (0 votes)
32 views12 pages

Framing, Flow Control and Congestion Control

Flow of aspects and the framing

Uploaded by

Avan Cruzz
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)
32 views12 pages

Framing, Flow Control and Congestion Control

Flow of aspects and the framing

Uploaded by

Avan Cruzz
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/ 12

Functions of the data link layer

Framing: Data are sent form the sending station to the receiving stations in blocks called frames.
The beginning and end of each frame must be recognizable by the receiver.
Flow control: The sending station must not overwhelm the receiving station.
Error control: Bit errors introduced in the transmission system must be detected and corrected.

Framing.
Framing makes it possible for the sender to send a set of bits that are meaningful to the
receiver. The data link layer to create and recognizes frame boundaries.
The four framing methods that are widely used are;
 Character count
 Byte oriented framing
 Bit oriented Framing
 Clock based Framing
Character Count
In this method the number of characters in the frame is specified as a field in the frame header.
The data link layer at the destination reads the character count and knows where the end of the
frame is.
The disadvantage of this method is if there is an error in the character, the receiver will lose
synchronization.

Byte Oriented framing


This method uses special characters (sentinel characters) to indicate where frames start (STX -
start of text) and end (ETX-end of text).
The problem with this method is that one of the special characters might appear in the data
portion of the frame. This is overcome preceding these characters with a DLE (data-link-escape)
character whenever they are found inside the frame.
If the DLE character is also in the frame body it is preceded by another DLE .
The adding of special characters for this purpose is called character stuffing.
BISYNC protocol is an example of a byte oriented protocol
BISYNC Frame

Bit oriented framing


In this method data frames can contain an arbitrary number of bits. At the start and end of each
frame is a flag byte consisting of the special bit pattern 01111110.
If this bit pattern occurs in the data it must be ensured that the receiver does not erroneously
interpret it as a frame delimiter. This is done by bit stuffing, which is inserting a zero whenever 5
ones are encountered in the data
Whenever the receiver finds five consecutive 1s in the incoming data stream, followed by a zero
bit, it automatically destuffs the 0 bit.
The boundary between two frames can be determined by locating the flag pattern which is
consecutive 6 1s
Synchronous Data Link Control (SDLC) and the High-Level Data Link Control (HDLC) and
Ethernet are examples of bit oriented protocols.

HDLC Frame

Clock-based Framing
In a clock-based framing system, a series of repetitive pulses are used to maintain a constant bit
rate. SONET (Synchronous Optical Network) is an example that uses clock based framing. .

Flow Control and ARQ


Flow Control
The purpose of flow control is to ensure that the sending entity does not overwhelm receiving
entity.
The receiving entity allocates a data buffer for a transfer to hold data as it is being processed.
When data are received, the receiver must do a certain amount of processing before passing the
data to the higher-level software. In the absence of flow control, the receiver's buffer may fill up
and overflow while it is processing old data.
Without flow control, the receiver's buffer may overflow while it is processing old data.
.

Stop-and-wait flow control


Stop and wait which is the simplest form of flow control works as follows;
o source transmits frame
o destination receives frame and replies with acknowledgement (ACK) when its ready to
receive more frames.
o source waits for ACK before sending next frame
o destination can stop flow by not sending ACK
o if received frame is damaged, discard it.
o transmitter has timeout such that if no ACK within timeout, the frame is retransmitted
o if ACK is damaged, transmitter will not recognize it and after timeout the transmitter will
retransmit.
o The receiver will get two copies of the same frame.
o To prevent this alternate numbering of frames and ACKs is used. F0/F1 and ACK0 /
ACK1
o The ACKs may be piggybacked on data frames in duplex communication.
The main advantage of stop and wait is its simplicity. The Stop and wait flow control works for
large frames but is not suitable if data is split into small frames.
For high data rates and long distances between sender and receiver, stop-and-wait flow control
give poor line utilization. .

Fig: Stop and wait flow control

Sliding Window flow control


In Sliding Window flow control the source can send a number of packets without waiting for
acknowledgments up to a certain number. The maximum number of unacknowledged frames that
is allowed is the “window size”. The sender does not wait for ACK after every frame.
Sliding Window flow control allows multiple numbered frames to be in transit in the channel
(pipe lining). ACKs are cumulative. That is the received ACK acknowledges the current frame
and all previous ones
Both the transmitter and the receiver have buffers W frames long.
Transmitter can send up to W frames without ACK from the receiver. The ACK includes number
of next frame expected by the receiver.
The receiver may send ‘receive not ready’ to acknowledge frames without permitting further
transmission.
Sliding-window flow control is much more efficient than stop-and-wait flow control.

3 2 1 0 3 2 1 0 3 2 1 0

Fig: Sliding window protocol

The figure above depicts the sliding-window process. Frames are numbered sequentially from 0
to 3, and then the same numbers are reused for subsequent frames. The shaded rectangle
indicates the maximum number of frames that may be sent. Each time a frame is sent, the shaded
window shrinks; each time an acknowledgment is received, the shaded window grows.
Let’s say the sender transmits three frames, beginning with frame 0. The shaded window will
shrinks by 3. If an acknowledgment is received for two frames, the shaded window grows by 2.
The sender must buffer the unacknowledged frames in case they need to be retransmitted.

Automatic Repeat Request (ARQ)


The purpose of ARQ is to make a data channel reliable. There are three versions of ARQ:

— Stop-and-wait
— Go-back-N
— Selective-reject (Selective repeat)

Stop-and-wait ARQ.

This is based on stop and wait flow control. See description of Stop and wait flow control

Go back N ARQ
This is a form of error control based on sliding-window flow control . See description of sliding
window flow control

o If there is no error, ACK sent to transmitter.


o uses window to control number of outstanding frames
o if error, reply with rejection
o discard that frame and all future frames until error frame received correctly
o transmitter must go back ‘N’ and retransmit that frame and all subsequent frames
Fig: Go Back N ARQ

Selective Reject
With selective-reject ARQ, the only frames retransmitted are those that receive a negative
acknowledgment or those that time out. Subsequent frames are accepted by the receiver and
buffered.
Selective reject is more efficient than go-back-N, because it minimizes the amount of
retransmission
In this case the receiver must maintain large enough buffer and requires more complex logic in
the transmitter. Selective reject is used for a satellite link because of the long propagation delay. .
Congestion control
Congestion occurs when the number of packets being transmitted through a network
approaches the capacity of the network (80% utilization considered critical). As the number
of packets in a network increases it reaches a level where the performance drops dramatically.
Congestion control aims to keep no of packets below that level.

Congestion occurs due to the following reasons;


– packet arrival rate exceeds the outgoing link capacity.
– insufficient buffer capacity to store incoming packets
– Processing at a slower rate compared to the incoming traffic.
– Bursty traffic

The main difference between flow control and congestion control is that Congestion control is
a global issue in a network, that is, it involves every router, switch and host within the
network while flow control is point-to-point; it just involves the sender and receiver

Congestion control techniques.


Congestion Control Techniques include:
i. Discard strategy or Load shedding
ii. Backpressure
iii. Choke packets
iv. Implicit Congestion Signaling
v. Explicit Congestion Signaling
vi. Traffic shaping

Discard strategy.

This is a simple strategy in which routers or switches simply discard packets when buffers
become full. Load shedding strategies include

– Discard new packets ( wine strategy)


– Discard old data and keep new packets(milk strategy)

Backpressure

Backpressure is a node-to-node congestion control


When node becomes congested it slows down or halt flow of packets from other nodes.
The flow restrictions propagate backwards to the source nodes.
This is used in connection oriented networks that allow hop by hop congestion control (eg.
X.25)
It is not used in ATM or frame relay

Choke packets

A choke packet is a control packet generated at a congested node and transmitted back to a
source node to restrict traffic flow.
In this method, the congested node sends a warning directly to the source node.
The source must reduce its transmission rate by a certain percentage on receiving the choke
packet

A hop by hop choke packet as opposed to destination node to source node choke packet is a
more efficient.
`An example of a choke packet is the Internet Control Message Protocol ( ICMP) Source
Quench Packet.

Implicit Congestion Signaling


When network congestion occurs transmission delay for an individual packet from source to
destination increases and packets are discarded. Implicit congestion control is congestion
control achieved when the sources detect congestion through increased transmission delay and
packet loss and in response reduces flow.
Congestion control on the basis of implicit signaling is the responsibility of end systems and
does not require action on the part of network nodes.
Implicit signaling is used in connectionless networks where there are no logical connections
on which flow can be regulated.
TCP has mechanisms for acknowledging receipt of TCP segments and for regulating the flow
of data between source and destination.
Implicit signaling can also be used in connection-oriented networks. .

Explicit Congestion Signaling

In explicit congestion control techniques the network alerts end systems of growing congestion
within the network and the end systems reduce the load offered to the network.

Explicit congestion control techniques typically operate over connection-oriented networks.

Unlike in the choke packet method, where a separate packet is used, the signal is included in
the packets that carry data.

Explicit congestion signaling approaches work in one of two directions:

Backward: the network notifies the source that indicates that the packets that the user
transmits on this logical connection may encounter congested resources and congestion
avoidance procedures should be initiated for traffic in the opposite direction to the received
notification.

This backward information is transmitted either in the headers of a data packets to the source or
by transmitting separate control packets to the source.

Forward: the network notifies the user that this packet, on this logical connection, has
encountered congested resources and congestion avoidance procedures should be initiated for
traffic in the same direction as the received notification.

As in the backward case this information is transmitted either in the headers of a data packets to
the source or by transmitting separate control packets to the source.
Traffic shaping

Traffic shaping controls the rate at which packets are sent to the network based on previous-hop
or next-hop information. Traffic shaping is used in ATM networks

There are two common traffic shaping algorithms. These are:

– Leaky Bucket
– Token Bucket
Leaky Bucket
The Leaky Bucket Algorithm(LBA) is a traffic shaping mechanism that controls the amount
and the rate of the traffic sent to the network.
LBA shapes bursty traffic into fixed rate traffic by averaging the data rate.
Basically it is implemented as a single-server queue with constant service time. The leaky
bucket enforces a constant output rate
If the buffer overflows then packets are discarded.

Token Bucket Algorithm


A token bucket algorithm is a modification of leaky bucket in which leaky bucket contains
tokens as opposed to packets in the LBA method. Token Bucket Algorithm allows the output
rate to vary depending on the size of the burst. To transmit packets, the host must use tokens
which are generated by a clock at a constant rate.
A token bucket algorithm allows idle hosts to accumulate tokens up to the maximum size of
the bucket for later use with bursty traffic
In the token bucket algorithm, a packet is transmitted if there are enough tokens to its length.

The differences between these algorithms are ;

– Unlike Leaky bucket which discards packets token bucket discards tokens
– Leaky Bucket sends packets at an average rate while Token Bucket allows for bursts
– Token Bucket allows saving of tokens for later use to send large bursts while Leaky
Bucket does not allow saving.

Further reading :
Framing- Chapter 11 of Data Communication and Networking(Fourth Edition) by
Behrouz Forouzan
Flow control and ARQ--Chapter 7 of Data and Computer Communications 8th edition
by William Stalling
Congestion Control--- Chapter 13 of Data and Computer communication 8th edition
. by William Stalling

Appendix
ASCII control characters (character code 0-31)
The first 32 characters in the ASCII-table are unprintable control codes and are used to control
peripherals such as printers.

DEC OCT HEX BIN Symbol Description


0 000 00 00000000 NUL Null character
1 001 01 00000001 SOH Start of Heading
2 002 02 00000010 STX Start of Text
3 003 03 00000011 ETX End of Text
4 004 04 00000100 EOT End of Transmission
5 005 05 00000101 ENQ Enquiry
6 006 06 00000110 ACK Acknowledge
7 007 07 00000111 BEL Bell, Alert
8 010 08 00001000 BS Backspace
9 011 09 00001001 HT Horizontal Tab
10 012 0A 00001010 LF Line Feed
11 013 0B 00001011 VT Vertical Tabulation
12 014 0C 00001100 FF Form Feed
13 015 0D 00001101 CR Carriage Return
14 016 0E 00001110 SO Shift Out
DEC OCT HEX BIN Symbol Description
15 017 0F 00001111 SI Shift In
16 020 10 00010000 DLE Data Link Escape
17 021 11 00010001 DC1 Device Control One (XON)
18 022 12 00010010 DC2 Device Control Two
19 023 13 00010011 DC3 Device Control Three (XOFF)
20 024 14 00010100 DC4 Device Control Four
21 025 15 00010101 NAK Negative Acknowledge
22 026 16 00010110 SYN Synchronous Idle
23 027 17 00010111 ETB End of Transmission Block
24 030 18 00011000 CAN Cancel
25 031 19 00011001 EM End of medium
26 032 1A 00011010 SUB Substitute
27 033 1B 00011011 ESC Escape
28 034 1C 00011100 FS File Separator
29 035 1D 00011101 GS Group Separator
30 036 1E 00011110 RS Record Separator
31 037 1F 00011111 US Unit Separator

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy