Unit Iv: Flow Control, Error Detection & Correction, Csma, Csma/Cd, HDLC and PPP
Unit Iv: Flow Control, Error Detection & Correction, Csma, Csma/Cd, HDLC and PPP
❖ Enquiry/Acknowledgment (ENQ/ACK)
❖ Poll/Select
Flow Control
Second aspect of Data link control- Flow Control
Set of procedures that tells the sender as how much data it can
transmit before waiting for an acknowledgment from the receiver.
Receiver got set of memory blocks called the BUFFER that store
the incoming data before they are processed.
If buffer begins to fill up, receiver must be able to tell the sender to
send fewer data frames or halt the transmission until the buffer is
free to accept the data frame again.
Under this we got two techniques:
Frames can be sent one after another i.e. link can carry
several frames at once and its capacity can be used
efficiently
At receiver we got not n-1 data frames but n-1 spaces for frames
As new frames come in the size of the receiver window shrinks
Receiver window does not represent number of frames received but
number of frames that may still be received before an ACK can be
sent.
If a receiver got a window size of w, if three frames are received
without being acknowledged , number of spaces in window is w-3.
As soon as ACK is received , the window expands to include more
spaces for number of frames equal to number of frames
acknowledged
Let us take the receiving window of size 7 i.e 0 through 6
With the arrival of data frame 0, receiving window shrinks moving
from 0 to 1 and receiver window has now shrunk to six frames before
sending an ACK
Once say frames 0 through 3 are received without sending an ACK,
receiving window now shrinks to 3 frame spaces.
Sliding Window
Automatic Repeat Request (ARQ)
36
Error Detection & Correction
❖ Single bit error: Error where only one bit of given data
unit such as byte, character or packet is changed from 0
to 1.
❖ Burst Error : Error where two or more bits in a given data
unit have changed from 1 to 0 or 0 to 1.
37
Single Bit Error
38
Burst Error
39
Error Detection Techniques
40
Redundancy
41
42
Four types of redundancy checks are used
in data communications
Vertical Redundancy Check - VRC
Performance
▪ If two bits in one data units are damaged and two bits in
exactly the same positions in another data unit are also
damaged, the LRC checker will not detect an error.
VRC and LRC
Cyclic Redundancy Check (CRC)
61
Checksum
62
At the sender
1=1, 2=2, 3= 1+2, 4=4, 5= 1+4, 6= 2+4, 7= 1+2+4, 8=8, 9= 1+8, 10=
2+8, 11= 1+2+8
so now r1= 1,3, 5, 7, 9, 11; r2= 2,3,6,7,10,11; r4= 4,5, 6,7; r8= 8,9,10,11
•
Example
Hamming Code
• Now we write the parity bit for each of the r value . For
example parity bit of r1 is calculated to provide even
parity of combination 3,5,7,9,11 which sees odd number
of 1’s and we add 1 to r1. Similarly we perform for r2, r4
and r8 ending in the final code as 10011100101
• Now the code is sent to the receiver say 10010100101and
receiver calculates the four new VRC’s using the same set
of bits used by sender plus relevant parity bits (r1,r2,r4,
r8) for each set
• Then receiver reassembles new parity values into a binary
number in order of r position (r8, r4, r2, r1) which results
in 0111.
• That is bit 7 is the error and is corrected to give
10010100101
Single-bit error
Error
Detection
Medium Access control
Methods –CSMA, CSMA/CA &
/CD
MULTIPLE ACCESS PROTOCOLS
Each station has the right to the medium without being controlled
by another station
If more than one station tries to send, there is an access conflict-
collision and frames will be either destroyed or modified
To avoid access conflict or to resolve it when it happens, each
station follows a procedure which answers the following queries:
▪ When can station access the medium
▪ What can station do if medium is busy
▪ How can the station determine the success or failure of the
transmission
▪ What can station do if there is an access conflict
Random access methods we would be studying have evolved
from a very interesting protocol known as ALOHA which uses a
very simple procedure called Multiple Access (MA)
84
CSMA protocol
■ CSMA requires that each station first listen to the medium before sending
■ CSMA can reduce the possibility of collision but cannot eliminate it.
■ When a station sends a frame and any other station sends a frame
during this time, a collision will result.
■ But if the first bit of frame reaches the end of medium, every
station will have heard the bit and will refrain from sending.
■ Figure in next slide shows the worst case where a frame sent by
station A at time t1 reaches the rightmost station D at time t1+ Tp
Vulnerable Time in CSMA
Behavior of three persistence methods
1-Persistent CSMA protocol
If the medium is busy it waits until it becomes idle and sends its
frame with a probability of 1.
Before sending the last bit of frame, sending station must detect
collision , if any must abort the transmission
Reason for this is a station once sent the entire frame does not
monitor the line for collision detection
Solution
The frame transmission time is Tfr = 2 × Tp = 51.2 μs. This means, in the worst
case, a station needs to transmit for a period of 51.2 μs to detect the collision. The
minimum size of the frame is 10 Mbps × 51.2 μs = 512 bits or 64 bytes. This is
actually the minimum size of the frame for Standard Ethernet.
HDLC and PPP
The Data Link Layer in the Internet
A home personal computer acting as an internet host.
102
PPP Design Requirements [RFC 1557]
103
PPP Design Requirements (cont.)
104
PPP non-requirements
• No error correction/recovery
(modems do one layer FEC, one layer packetization +
retransmission “under the covers” anyway; other
technologies are pretty reliable)
• No flow control
• Out of order delivery OK
105
PPP Data Frame
106
PPP Data Frame
107
Byte Stuffing
flag byte
pattern
in data
to send
109
Where does PPP get used?
110
High-Level Data Link Control (HDLC)
Unbalanced Mode
Commands
Primary
Responses
Secondary Secondary
Balanced
mode
Combined Combined
commands/Responses
HDLC
Both the above modes mean that the secondary node is logically
disconnected from the primary node
• Initialization Mode
• A node negotiates transmission parameters with the other node E.g., flow
control information
• Parameters negotiated in this mode are used during any of the data
transfer modes
Data Link Control HDLC frame structure
(a) Frame
Format
(b) Control
field
format
Data Link Control
HDLC frame structure
• Flag: 01111110- start and ending delimiter. Bits are stuffed for flags in data frames
• FCS: 16-bit CRC using generating polynomial
G(x) = x16 + x12 + x5 + 1
• Address field:
• mainly used in multidrop link configuration, and not used in point-to-point
• In unbalanced configuration, every secondary is assigned a unique address. Contains
address of secondary station in both command and response frames
• In balanced mode, command frame has destination address and response frame has sending
node’s address
• Group addresses are also possible. E.g., One command sent to all the secondaries
• In I-frames, N(s) is the sequence number of the frame being sent, and R(s) is the
sequence number of the frame being expected.
• The P/F bit, known as the poll/final bit, is used with different meaning in different
contexts.
• It is used to indicate polling, to indicate the final I-frame, etc
HDLC
• Services
• Framing
• Error control
• Reliability
• Connection management
• Medium access control
• Switching
• Protocols, Standards
• Ethernet
• Token Ring
• FDDI
• Wireless
• PPP
• HDLC