Data Link Layer :- Design Issues, : Framing, Error Control, Flow Control, Elementary Data Link Protocols, Sliding window protocol, Example Data link protocols :HDLC, SLIP and PPP.
2. Agenda :Unit 2
Data Link Layer :- Design Issues : Framing, Error
Control, Flow Control, Elementary Data Link
Protocols, Sliding window protocol, Example
Data link protocols :HDLC, SLIP and PPP.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 2
3. The Main Design Issues
Reliability Resource Allocation
Scalability Routing
Addressing Error Control
Flow Control Statistical Multiplexing
Security
The most possible issues with the Data Link can be :
– Induced traffic:
– Power and bandwidth constraints
– Interpretation unfairness
– Interpretation of congestion
– Dynamic topology
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 3
4. Data Link Layer
The data link layer is the protocol layer in a program that
handles the moving of data into and out of a physical link in a
network. The data link layer is Layer 2 in the Open Systems
Interconnection (OSI) architecture model for a set of
telecommunication protocols.
The main service provided is to transfer data packets from
the network layer on the sending machine to the network
layer on the receiving machine. In actual communication,
the data link layer transmits bits via the physical layers and
physical medium.
The main design issues are related to services provided to the
Network Layer, Framing, Error Control and Flow Control.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 4
8. Unacknowledged connectionless service
Here, the data link layer of the sending machine
sends independent frames to the data link layer
of the receiving machine. The receiving machine
does not acknowledge receiving the frame. No
logical connection is set up between the host
machines. Error and data loss is not handled in
this service. This is applicable in Ethernet
services and voice communications.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 8
9. Acknowledged connectionless service
Here, no logical connection is set up between
the host machines, but each frame sent by the
source machine is acknowledged by the
destination machine on receiving. If the source
does not receive the acknowledgment within a
stipulated time, then it resends the frame. This
is used in Wifi (IEEE 802.11) services.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 9
10. Acknowledged connection-oriented service
This is the best service that the data link layer can offer to the
network layer. A logical connection is set up between the two
machines and the data is transmitted along this logical path.
The frames are numbered, that keeps track of loss of frames
and also ensures that frames are received in correct order.
The service has three distinct phases −
• Set up of connection – A logical path is set up between the source
and the destination machines. Buffers and counters are initialized to
keep track of frames.
• Sendingframes – The frames are transmitted.
• Release connection – The connection is released, buffers and other
resources arereleased.
• It is appropriate for satellite communications and long-distance
telephone circuits.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 10
11. Parts of a Frame
A frame has the following parts −
• Frame Header − It contains the source and the
destination addresses of the frame.
• Payload field − It contains the message to be delivered.
• Trailer − It contains the error detection and error
correction bits.
• Flag − It marks the beginning and end of the frame.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 11
13. Framing
• Advantage: Data is broken up into recoverablechunks thatcan
easily be checked for corruption.
• Problemsin Framing–
• Detecting start of the frame: When a frame is transmitted, every
station must be able to detect it. Station detect frames by looking
out for special sequence of bits that marks the beginning of the
frame i.e. SFD (Starting Frame Delimeter).
• How do station detect a frame: Every station listen to link for SFD
pattern through a sequential circuit. If SFD is detected, sequential
circuit alerts station. Station checks destination address to accept or
rejectframe.
• Detectingendof frame: When to stop readingthe frame.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 13
14. Methods of Framing
There are basically four methods of framing as
given below –
1. Character Count
2. Flag Byte with Character Stuffing
3. Starting and Ending Flags, with Bit Stuffing
4. Encoding Violations
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 14
16. Framing Types
1. Fixed size – The frame is of fixed size and there is no need to
provide boundaries to the frame, length of the frame itself acts as
delimiter.
Drawback: It suffers from internal fragmentation if data size is less
than frame size
Solution: Padding
2. Variable size – In this there is need to define end of frame as well as
beginningof next frame to distinguish.Thiscan be donein two ways:
Length field – We can introduce a length field in the frame to indicate
the length of the frame. Used in Ethernet(802.3). The problem with
this is that sometimes the length field might get corrupted.
End Delimeter (ED) – We can introduce an ED(pattern) to indicate the
end of the frame. Used in Token Ring.
The problem with this is that ED can occur in the data.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 16
17. Solutions to End Delimeter (ED) occurrence in
data
1. Character/ByteStuffing: Used when frames
consistof character. If data containsED then,
byte is stuffedinto data to differentiateit from
ED. Let ED = “$” –> if data contains ‘$’
anywhere, it can be escaped using ‘O’
character.
–> if data contains‘O$’ then, use ‘OOO$'($ is
escaped using O and O is escaped using O).
2. Disadvantage – It is very costly and obsolete
method.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 17
20. Contd..
3. Bit Stuffing:
• Let ED = 01111 and if data = 01111
• –> Sender stuffs a bit to break the pattern i.e. here appends
a 0 in data = 011101.
• –> Receiver receives the frame.
• –> If data contains 011101, receiver removes the 0 and
reads the data.
E.g.–
• If Data –> 011100011110and ED –> 0111 then, find data
after bit stuffing ?–> 01110000111010
• If Data –> 110001001 and ED –> 1000 then, find data after
bit stuffing ?–> 11001010011
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 20
22. Physical Layer Coding Violations
Encoding violation is method that is used only
for network in which encoding on physical
medium includes some sort of redundancy i.e.,
use of more than one graphical or visual
structure to simply encode or represent one
variable of data.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 22
23. Noiseless channel means that there will not be any kind of interference or
disturbancein the path of communicationor transmission.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 23
24. Simplex Protocol
Simplex Protocol is one that has no flow or error control
and it is a unidirectional protocol in which data frames are
traveling in only one direction-from the sender to receiver.
We assume that the receiver can immediately handle any
frame it receives with a processing time that is small
enough to be negligible. The data link layer of the receiver
immediately removes the header from the frame and hands
the data packet to its network layer, which can also accept
the packet immediately.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 24
25. Stop and Wait Protocol
Stop and Wait means, whatever the data that sender wants to
send, he sends the data to the receiver. After sending the
data, he stops and waits until he receives the
acknowledgment from the receiver. The stop and wait
protocol is a flow control protocol where flow control is one of
the services of the data link layer.
It is a data-link layer protocol which is used for transmitting
the data over the noiseless channels. It provides
unidirectional data transmission which means that either
sending or receiving of data will take place at a time. It
provides flow-control mechanism but does not provide any
error control mechanism.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 25
26. Error control in Data Link Layer
Error control in data link layer is the process of
detecting and correcting data frames that have been
corrupted or lost during transmission.
In case of lost or corrupted frames, the receiver does
not receive the correct data-frame and sender is
ignorant about the loss. Data link layer follows a
technique to detect transit errors and take necessary
actions, which is retransmission of frames whenever
error is detected or frame is lost. The process is called
Automatic Repeat Request (ARQ).
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 26
27. Phases in Error Control
Detection of Error − Transmission error, if any, is detected by
either the sender or the receiver.
Acknowledgment − acknowledgment may be positive or negative.
– Positive ACK − On receiving a correct frame, the receiver
sends a positive acknowledge.
– Negative ACK − On receiving a damaged frame or a
duplicate frame, the receiver sends a negative
acknowledgment back to the sender.
Retransmission − The sender maintains a clock and sets a timeout
period. If an acknowledgment of a data-frame previously
transmitted does not arrive before the timeout, or a negative
acknowledgment is received, the sender retransmits the frame.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 27
28. Error and Flow Control
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 28
29. Stop and Wait –
The sender sends the packet and waits for the ACK
(acknowledgement) of the packet. Once the ACK reaches the
sender, it transmits the next packet in row. If the ACK is not
received, it re-transmits the previous packet again.
Go Back N –
The sender sends N packets which is equal to the window size. Once
the entire window is sent, the sender then waits for a cumulative
ACK to send more packets. On the receiver end, it receives only in-
order packets and discards out-of-order packets. As in case of
packet loss, the entire window would be re-transmitted.
Selective Repeat –
The sender sends packet of window size N and the receiver
acknowledges all packet whether they were received in order or
not. In this case, the receiver maintains a buffer to contain out-of-
order packets and sorts them. The sender selectively re-transmits
the lost packet and moves the window forward.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 29
31. ARQ
For the same function of ARQ, there are various
applications:
• TransmissionControl Protocol (TCP)
• Specific Service OrientationProtocol: Error-
correction of message signals in ATM networks.
• High-LevelData Link protocol.
• IBM Binary synchronous Communications
Protocol.
• Xmodem : modem file transfer protocol.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 31
32. Stop and Wait ARQ
• Used in Connection-orientedcommunication.
• It offerserrorand flow control
• It is used in Data Link and TransportLayers
• Stop and Wait ARQ mainly implements Sliding WindowProtocol
conceptwith WindowSize 1
Sender:
Send one data packet at a time.
Send next packetonly after receivingacknowledgementfor previous.
Receiver:
Acknowledgementafter receivingand consumingof data packet.
After consumingpacketacknowledgementneed to be sent (Flow
Control)
Problems: Lost Data, Lost Acknowledgement,Delayed
Acknowledgement/Data
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 32
33. Solution: Stop and Wait ARQ
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 33
35. Stop and Wait ARQ
• Propagation Delay: Amount of time taken by a packet
to make a physical journey from one router to
another router.
• Propagation Delay = (Distance between routers) /
(Velocity of propagation)
• RoundTripTime (RTT) = 2* Propagation Delay
• TimeOut (TO) = 2* RTT
• Time To Live (TTL) = 2* TimeOut. (Maximum TTL is
180 seconds)
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 35
36. Features: Stop and Wait ARQ
• It uses link between sender and receiver ashalf duplexlink
• Throughput= 1 Data packet/frame per RTT
• If Bandwidth*Delay product is very high, then stop and wait
protocol is not so useful. The sender has to keep waiting for
acknowledgements before sendingthe processed nextpacket.
• It is an example for “Closed Loop OR connection oriented “
protocols
• It is an special category of SWP whereits window size is 1
• Irrespective of number of packets sender is having stop and wait
protocol requires only 2 sequence numbers0 and 1
Stop and Wait ARQ may work fine where propagation delay is very less
for example LAN connections, but performs badly for distant
connections like satellite connection.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 36
37. Go Back-N ARQ
• Go Back-N ARQ uses the concept of protocol pipelining i.e.
the sender can send multiple frames before receiving the
acknowledgement for the first frame.
• N is the sender’s window size.
• There are finite numbers of frames numbered in sequential
order. e.g. if the sending window size is 4(or 22), then the
sequence no. will be 0,1,2,3, 0,1,2,3,0,1….
• The no. of frames that can be sent depends on the window
size of the sender.
• If the acknowledgement of the frame is not received within
time then all frames in the current window are re-
transmitted.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 37
39. Selective Repeat ARQ
• In Selective Repeat ARQ, only the erroneous
or lost frames are retransmitted, while correct
frames are received and buffered.
• The receiver keeps track of sequence number;
it buffers the frames in memory and sends the
negative acknowledgment for missing or
defected frames,
• The sender then re-sends only for the negative
acknowledgment received.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 39
41. Question
1. Station A needs to send a message consisting
of 9 packets to station B using a sliding window
(size 3) and go-back-n error control strategy. All
packets are ready and immediately available for
transmission. If every 5th packet that A transmits
gets lost (not acknowledgment), then find the
number of packets transmitted by A to B.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 41
42. Question
2. Host A wants to send 10 frames to Host B. The
hosts agreed to go with selective repeat ARQ.
How many numbers of frames are transmitted
by Host A if every 6th frame that is transmitted
by host A is either destroyed or lost? Also find
the number of frames sent if he could have used
Go-Back-4 ARQ.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 42
43. PROPERTIES
STOP AND
WAIT GO BACK N SELECTIVE REPEAT
Sender window size 1 N N
Receiver Window size 1 1 N
Minimum Sequence number 2 N+1 2N
Efficiency 1/(1+2*a) N/(1+2*a) N/(1+2*a)
Type of Acknowledgement Individual Cumulative Individual
Supported order at Receiving
end –
In-order
delivery only
Out-of-order
delivery as well
Number of retransmissions in
case of packet drop 1 N 1
a = Ratio of Propagation delayand Transmissiondelay
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 43
44. Error Detection & Correction
Data-link layer uses some error control
mechanism to ensure that frames (data bit
streams) are transmitted with certain level of
accuracy. But to understand how errors is
controlled, it is essential to know what types of
errors may occur.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 44
45. Types of Errors
• Single bit error
• Burst error (More than 1, continuous or non-
continuous bit)
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 45
46. Error Detecting Techniques:
Basic approach used for error detection is the
use of redundancy bits, where additional bits
are added to facilitate detection of errors.
• Single parity check/Vertical redundancy check
(VRC)
• Two-dimensional parity check/Longitudinal
(LRC)
• Checksum
• Cyclic redundancy check
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 46
47. Simple Parity check
Blocks of data from the source are subjected to
a check bit or parity bit generator form, where a
parity of :
• 1 is added to the block if it contains odd
number of 1’s, and
• 0 is added if it contains even number of 1’s
• This scheme makes the total number of 1’s
even, that is why it is called even parity
checking.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 47
49. Limitation of VRC
• Single bit error
• Burst error is checked if number of error is
odd.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 49
50. Two-dimensional Parity check
Parity check bits are calculated for each row,
which is equivalent to a simple parity check bit.
Parity check bits are also calculated for all
columns, then both are sent along with the
data. At the receiving end these are compared
with the parity bits calculated on the received
data.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 50
54. Checksum
• In checksum error detection scheme, the data is divided into k
segments each of m bits.
• In the sender’s end the segments are added using 1’s
complement arithmetic to get the sum. The sum is
complemented to get the checksum.
• The checksum segment is sent along with the data segments.
• At the receiver’s end, all received segments are added using
1’s complement arithmetic to get the sum. The sum is
complemented.
• If the result is zero, the received data is accepted; otherwise
discarded.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 54
61. Cyclic redundancy check (CRC)
• Unlike checksum scheme, which is based on addition, CRC
is based on binary division.
• In CRC, a sequence of redundant bits, called cyclic
redundancy check bits, are appended to the end of data
unit so that the resulting data unit becomes exactly
divisible by a second, predetermined binary number.
• At the destination, the incoming data unit is divided by the
same number. If at this step there is no remainder, the data
unit is assumed to be correct and is therefore accepted.
• A remainder indicates that the data unit has been damaged
in transit and therefore must be rejected.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 61
68. Error-correcting codes
Error-correcting codes (ECC) are a sequence of numbers
generated by specific algorithms for detecting and removing
errors in data that has been transmitted over noisy channels.
Error correcting codes ascertain the exact number of bits that
has been corrupted and the location of the corrupted bits, within
the limitations in algorithm.
ECCs can be broadly categorized into two types −
Block codes − The message is divided into fixed-sized blocks of
bits, to which redundant bits are added for error detection or
correction.
Convolutional codes − The message comprises of data streams
of arbitrary length and parity symbols are generated by the
sliding application of a Boolean function to the data stream.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 68
69. Error Correction Techniques
Error correction techniquesfind out the exact number of bits
that have been corrupted and as well as their locations.
• Backward Error Correction (Retransmission)
• Forward Error Correction
Codes used:
– Hamming Codes
– Binary ConvolutionCode
– Reed – Solomon Code
– Low-Density Parity-Check Code
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 69
70. Backward Error Correction
Technique of error correction that occurs in a channel
through the detection of errors by the receiver: the receiver
responds to any errors in a block by requesting the
transmitter to retransmit the affected block. Backward
correction requires a return channel, by contrast with
forward error correction. BEC (also known as Automatic
Repeat reQuest, ARQ) uses feedback from the receiver to
the transmitter: the receiver signals to the transmitter
whether a block of data was received correctly or not. If the
reception is erroneous, then the transmissionis repeated.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 70
71. Forward error correction (FEC)
Forward error correction (FEC) is a method of obtaining
error control in data transmission in which the source
(transmitter) sends redundant data and the destination
(receiver) recognizes only the portion of the data that
contains no apparent errors.
FEC works by adding redundant bits to a bitstream to
help the decoder detect and correct some
transmission errors without the need for retransmission.
The name forward stems from the fact that the flow of
data is always in the forward direction (i.e., from encoder
to decoder).
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 71
72. Hamming code
Hamming code is a set of error-correction codes that can be
used to detect and correct the errors that can occur when the
data is moved or stored from the sender to the receiver.
The number of redundant bits(parity) can be calculated using
the following formula:
Redundant bits –
Redundant bits are extra binary bits that are generated and
added to the information-carrying bits of data transfer to
ensure that no bits were lost during the data transfer.
The number of redundant bits can be calculated using the
following formula:
2^r ≥ m + r + 1 where, r = redundant bit, m = data bit
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 72
73. Encoding a message by Hamming Code
The procedure used by the sender to encode the
message encompasses the following steps:
• Step 1 − Calculation of the number of redundant bits.
• Step 2 − Positioning the redundant bits.
• Step 3 − Calculating the values of each redundant bit.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 73
74. Step 1 − Calculation of the number of
redundant bits
If the message contains m𝑚number of data bits, r𝑟number of
redundant bits are added to it so that m𝑟 is able to indicate at
least (m + r+ 1) different states. Here, (m + r) indicates location of
an error in each of (𝑚 + 𝑟) bit positions and one additional state
indicates no error. Since, r𝑟 bits can indicate 2r 𝑟 states, 2r 𝑟 must
be at least equal to (m + r + 1). Thus the following equation
should hold 2r ≥ m+r+1
e.g.
Suppose the number of data bits is 7, then the number of
redundant bits can be calculated using:
= 2^4 ≥ 7 + 4 + 1 [check putting values r = 1,2,3,4]
Thus, the number of redundant bits= 4 as it satisfies the
condition.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 74
75. Positioning the redundant bits
The r redundant bits placed at bit positions of powers of 2, i.e. 1,
2, 4, 8, 16 etc. They are referred in the rest of this text as r1 (at
position 1), r2 (at position 2), r3 (at position 4), r4 (at position 8)
and so on.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 75
76. Calculating the values of each redundant bit
The redundant bits are parity bits. A parity bit is an extra bit that makes the
number of 1s either even or odd. The two types of parity are −
• Even Parity − Here the total number of bits in the message is made even.
• Odd Parity − Here the total number of bits in the message is made odd.
• Each redundant bit, ri, is calculated as the parity, generally even parity,
based upon its bit position. It covers all bit positions whose binary
representation includes a 1 in the ith position except the position of ri.
Thus −
• r1 is the parity bit for all data bits in positions whose binary representation
includes a 1 in the least significant position excluding 1 (3, 5, 7, 9, 11 and
so on)
• r2 is the parity bit for all data bits in positions whose binary representation
includes a 1 in the position 2 from right except 2 (3, 6, 7, 10, 11 and so on)
• r3 is the parity bit for all data bits in positions whose binary representation
includes a 1 in the position 3 from right except 4 (5-7, 12-15, 20-23 and so
on)
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 76
78. Decoding a message in Hamming Code
Once the receiver gets an incoming message, it
performs recalculations to detect errors and correct
them. The steps for recalculation are −
• Step 1 − Calculation of the number of redundant bits.
• Step 2 − Positioning the redundant bits.
• Step 3 − Parity checking.
• Step 4 − Error detection and correction
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 78
79. Decoding a message in Hamming Code
Step 1 − Calculation of the number of redundant bits
• Using the same formula as in encoding, the number of redundant bits are
ascertained.
• 2r ≥ m + r + 1 where m is the number of data bits and r is the number of
redundant bits.
Step 2 − Positioning the redundant bits
• The r redundant bits placed at bit positions of powers of 2, i.e. 1, 2, 4, 8,
16 etc.
Step 3 − Parity checking
• Parity bits are calculated based upon the data bits and the redundant bits
using the same rule as during generation of c1,c2 ,c3 ,c4 etc. Thus
• c1 = parity(1, 3, 5, 7, 9, 11 and so on)
• c2 = parity(2, 3, 6, 7, 10, 11 and so on)
• c3 = parity(4-7, 12-15,20-23 and so on)
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 79
80. Error Correction part
Step 4 − Error detection and correction
The decimal equivalent of the parity bits binary
values is calculated. If it is 0, there is no error.
Otherwise, the decimal value gives the bit
position which has error.
Note:Read the detail in solved examplewith diagramsin the class notessent in PDF.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 80
81. Questions
• The 7-bit hamming code word received by a
receiver is 1011011. For the even parity, state
whether the received code word is correct or
wrong. If wrong locate the bit having error.
• A(7,4) hamming code is received as 1010111.
Determine the correct code when there is
even parity.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 81
84. Block Codes as Correcting Codes
Block Codes (No memory is required) : (n,k) block code is
generate when the channel encoder accepts information in
successive k bit blocks. At the end of each such block, (n-k)
parity bit is added, which contains no information and termed
as redundant bits.
In block coding, we divide our message into blocks, each of k bits,
called data-words. We add r redundant bits to each block to make the
length n = k + r. The resulting n-bit blocks are called code-words. For
the moment, it is important to know that we have a set of data-words,
each of size k, and a set of code-words, each of size of n. With k bits,
we can create a combination of 2 𝑘data-words; with n bits, we can
create a combination of 2 𝑛 code-words. The block coding process is
one-to-one; the same data-word is always encoded as the same code-
word.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 84
86. Convolutional Codes
Convolutional Codes (Memory is required):
Here the code words are generated by discrete–
time convolution of the input sequence with
impulse response of the encoder. Unlike block
codes, channel encoder accepts messages as a
continuous sequence and generates a
continuous sequence of encoded bits at the
output.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 86
88. Convolutional codes rate (r) : r= k/n , here k is number of message bits and ‘n’ is number of
encoded output bits for one message bit.
ConstraintLength(k) It is the number of shifts over which a single message bit can
influence the encoder output.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 88
89. m1 m2 state
0 0 a
0 1 b
1 0 c
1 1 d
I/P PS
(m1,m2)
NS
0 00 00
1 00 10
0 10 01
1 10 11
0 01 00
1 01 10
0 11 01
1 11 11
m m1 m2 X1 X2 PS NS
0 0 a
0 0 a
0 1 b
0 1 b
1 0 c
1 0 c
1 1 d
1 1 d
m m1 m2 X1 X2 PS NS
0 0 0 a
1 0 0 a
0 0 1 b
1 0 1 b
0 1 0 c
1 1 0 c
0 1 1 d
1 1 1 d
Assignment
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 89
92. High-level data link control (HDLC)
It was actually called SDLC(Synchronous data link
control), developed by IBM and is a bit oriented
protocol.
High-level data link control (HDLC), documented in
ISO 3309, specifies a packet forming standard for
serial links. HDLC supports several modes of
operation, including a simple sliding window mode
for reliable delivery. Since Internet provide
retransmission at higher levels (i.e. TCP), most
Internet applications use HDLC's unreliable delivery
mode, Unnumbered Information.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 92
94. HDLC history
• It was developed for Terminal Networks
• Extended for WAN to WAN PTP serial links
• Extended for WAN to LAN PTP Serial Links
• Extended for PTMP for LAN Multi drop links
• Support Half-duplex and full-duplex modes
• Support PTP and PTMP networks
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 94
97. FIELD NAME SIZE (BITS)
Flag Field 8 bits
Address Field 8 bits
Control Field 8 or 16 bits
Information Field
Variable (not used in some
type of HDLC frames)
FCS (Frame Check Sequence)
Field
16 or 32 bits
Closing Flag Field 8 bits
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 97
100. 1. I-frame
I-frame stands for Information frames. This frame is
generally used for transporting user data from network
layer. These frames actually carry actual data or
information of upper layer and some control information.
This frame carries data along with both send sequence
number and an acknowledgment number. It can also be
used to piggyback acknowledgment information in case
of ABM (Asynchronous Balanced Mode). The first bit of
this frame of control filed is 0.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 100
101. 2. S-frame
S-frame stands for Supervisory frames. These frames are
basically required and essential for error control and flow
control. They also provide control information. It contains
or includes only an Acknowledgment number.
First two bit of this frame of control filed is 10. S-frame
does not have any information fields. This frame contains
send and receive sequence numbers. E.g.
• Receive Ready (RR)
• Receive Not Ready (RNR)
• Reject on frame N(R) (REJ)
• Selective reject on N(R) (SREJ), etc.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 101
102. 3. U-frame
U-frame stands for Unnumbered frames. These frames are also required in
various functions like link setup and disconnections. These frames basically
support control purposes and are not sequenced. First two bit of this frame of
control filed is 11. Some of U-frame contain an information field depending
upon type.
These frames are also used for different miscellaneous purposes along with
link management. U-frame is required for managing link itself. This frame
does not include any type of acknowledgment information i.e. in turn it
includes or contained in sequence number. These frames are generally
reserved for system management. E.g.
• Set Normal Response Mode (SNRM)
• Set Asynchronous Response Mode (SARM)
• Set Asynchronous Balanced Mode (SABM)
• Unnumbered Polling (UP)
• Unnumbered Acknowledge (UA), etc.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 102
109. Point-to-Point Protocol (PPP)
In computer networking, Point-to-Point Protocol (PPP) is a Data
link layer (layer 2) communications protocol between
two routers directly without any host or any other networking in
between. It can provide connection authentication, transmission
encryption, and compression, load balancing and error detection
and link quality monitoring. Originally, PPP was often used for
dial-up connections. Nowadays it's still used for DSL with PPPoE
(PPP over Ethernet) and PPPoA (PPP over ATM). One of the
advantages of still using PPP is that it allows authentication
through PAP and CHAP.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 109
110. Contd..
Its main component are Encapsulation, Authentication
protocols, Link Control Protocol(LCP) and Network control
protocol(LCP).
It is Character oriented, WAN protocol, commonly run over
internet links. It is mainly used in broadband communications
having heavy loads and high speeds. It is used to transmit
multiprotocol data between two directly connected point to
point computers.
It does not provide services of flow control, multipoint, error
correction and retransmission, or delivery in order.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 110
111. Functions of PPP protocol
• To define the following:
• The frame format
• Link establishment
• Data exchange process
• Method of encapsulation of network layer
data in the data link frame
• And the authentication process between two
devices.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 111
113. Difference between HDLC and PPP
The main difference between High-level Data Link Control
(HDLC) and Point-to-Point Protocol (PPP) is that High-level
Data Link Control is the bit-oriented protocol, on the other
hand, Point-to-Point Protocol is the byte-oriented protocol.
Another difference between HDLC and PPP is that HDLC is
implemented by Point-to-point configuration and also multi-
point configurations on the other hand while PPP is
implemented by Point-to-Point configuration only.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 113
114. The Serial Line Internet Protocol (SLIP)
The Serial Line Internet Protocol (SLIP) is an encapsulation of the
Internet Protocol designed to work over serial ports and modem
connections. SLIP was developed by Rick Adams in 1984. It is
documented in RFC 1055. SLIP has been largely replaced by the
Point-to-Point Protocol (PPP), which has more features
and does not require a predefined IP address configuration. As
SLIP does not provide error detection, it is not recommended for
error-prone dial-up connections.
However, embedded applications running on microcontrollers
are still using SLIP for encapsulating IP packets due to its
very small overhead.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 114
116. SLIP Frame
SLIP frame has a very simple format, comprising of payload and a
flag that acts as an end delimiter. The flag is generally a special
character equivalent to decimal 192. If this flag is present in the
data, then an escape sequence precedes it, so that the receiver
does not consider it as the end of the frame.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 116
117. Advantages of SLIP
• It has a very small overhead. So, it is suitable
for usage in microcontrollers.
• It reuses the existing dial-up connections and
telephone lines.
• It supports the most widely used protocol,
Internet Protocol (IP). So, there is ease of
deployment.
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 117
118. SLIP limitations
It cannot support or provide services for :
• multiple physical connections within a link (multilink)
• CHAP or PAP authentication
• packet filtering
• error detection
• negotiation of IP addresses
• Bring up on demand of links
• automatic reacquisition of links
• timing out of inactive links
• extensibility to network protocols other than IP
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 118
119. Point-to-Point Protocol
Serial Line Internet
Protocol
High-level Data Link
Control
Currently used protocol Older protocol Older protocol
Used in establishing a direct
connection
Used to handle TCP/IP
traffic
Used for point to multipoint
connections
Data link layer Physical layer protocol Data link layer protocol
Provide error checking
Doesn’t
provide error checking
Provide error correction
Comprehensive
framing mechanism
Single ended character is
there
Frames can be transmitted
over synchronous or
asynchronous links
Flag to indicate the start and
end of a frame
Used escaped character
that is 0Xco to start and end
of the frame
Beginning and end of each
frame has to be identified
More robust Less robust Less robust
Identifies the protocol in the
data field of the frame
It has no type field
Provide reliable
data transfer field
IIPS DAVV,MCA VIIB ClassNotes: Dr. V Dutta 119