5 DLL-LLC- Book

Water Birds (Ali)
Water Birds (Ali)Education consultant
5 DLL-LLC- Book
Introduction
 To achieve unnecessary control over data communication link
 A logic is added above the physical interface which is referred
as Data Link Control/ Protocol
 To see the need of data link control, some of the requirements
and objectives for data communication are listed as follows
 Frame synchronization- start and end should be recognizable
 Flow control- the sender and receiver data rate
 Error control- check the error and correct it
 Addressing- identify the address
 Control and Data on same link- should have control information
 Link Management- the initiation, maintenance and termination
 We will study the three mechanisms that are a part of data link
control
 Flow control, error detection and error control
Flow Control
Flow control is used to make sure that the
transmitted data is not over whelming the receiver
The receiver allocates a data buffer for the
processing before passing it to higher level software
In the absence the system may bottle neck
Ideal Flow Control
In the absence of errors, the model in
figure depicts a vertical time
sequence
It has advantage of showing time
dependencies
Each arrow represents a single frame
(data + control info)
It was an errorless communication
However, transmitted frame suffers a
variable amount of delay
Stop and Wait Flow Control
Simplest form of flow control
Source transmit a frame, after reception the
destination indicates its willingness to accept more
data by sending back an acknowledgment of the
frame just received
The source waits for the acknowledgment
The destination can thus stop the data flow by with
holding acknowledgment
If a larger data is broken down into smaller blocks,
this is done for the following reasons
Stop and Wait Flow Control
 Limited buffer size
 Longer the transmission, more likely there will be an error
 Smaller frames, errors are detected sooner and
retransmitted faster
 On LANs not to permit a station to hold a medium for longer
time
With multiple frames of a message, stop and wait
may be inadequate
We know about transmission time and propagation
delay
Stop and Wait Flow Control
Stop and Wait Flow Control
As per previous figure transmission time is normalized to 1
and propagation is expressed as variable ‘a’
When a<1 the propagation time is less than transmission time
The frame is long and before it is transmitted it arrives destination
When a>1 the propagation time is greater than transmission
time
The sender completes transmission before the frame arrives at
receiver
Note that for a>1 line is always underutilized and for a<1 line is
inefficiently utilized
In essence for high data rates or for long distances stop and
flow control provides inefficient line utilization
Sliding Windows Flow Control
As per the previous flow control the efficiency can be improved
by allowing multiple frames to be in transit at same time
A and B are connected via full duplex link (A -> B)
B allocates a buffer for n frames to be received from A
To keep track of the frames, they are labeled
B ack a frame by sending ack that includes sequence number of
next expected
The scheme can be used to ack multiple frames
A and B both maintains a list; sent sequence numbers and
received sequence numbers
Each of these lists can be thought of as a window or frame
Additional comments need to be made
Sliding Windows Flow ControlTo represent a sequence number, it occupies a field
in a frame
For K-bit field, the range of sequence number is O
through 2k
-1
Sliding Windows Flow Control
Receiver can control the size of the sending window
By limiting the size of the sending window data flow from
sender to receiver can be limited
Let 3 bits sequence has max of 7 frames, A->B
After transmitting some frames without ack A shrunk its
window to 4 frames
B then transmits RR3 (receive ready) which is ack of receive
frames
With this ack A is back up to permission of transmitting 7
frames starting from 3 onwards
RNR (receive not ready) a station can cut off a flow of frames
if it exceeds its buffer size
Sliding Windows Flow Control
Sliding Window Transmission
If 2 stations exchange data, each has to maintain 2 windows
(two directional)
One for transmit and one for receive
And each one has to send data and ack to other
Piggybank- provides efficient support for above requirement
Each frame holds sequence number of frame + field that holds
sequence number for ack
Thus a station sends data and ack both in one frame, saving
communication capacity
If station has ack but no data, it sends a separate ack frame
Similarly no ack but data to send, it must repeat the last ack it
sent
 Because data frame includes a field for ack number and some
number has to be put in that field
 Duplications are simply ignored
 Pipe line concept
Error detecting
We talked about transmission impairments and the effect of
data rate and signal-to-noise ratio on bit error rate.
Regardless of the design of the transmission system, there will
be errors, resulting in the change of one or more bits in a
transmitted frame.
So, how can a receiver know if the data received is error free?
 There are several methods that can be implemented to
accomplish this.
Some of these methods are simple and somewhat effective –
others are complicated and very effective.
Error Detection
Data transmission can contain errors
Single-bit
Burst errors of length n
How to detect errors
If only data is transmitted, errors cannot be detected
 Send more information with data that satisfies a
special relationship
 Add redundancy
Error Detection Methods
Parity bit
The simplest error-detection scheme is to append a parity bit
to the end of a block of data. A typical example is ASCII
transmission, in which a parity bit is attached to each 7-bit
ASCII character.
The value of this bit is selected so that the character has an
even number of 1s (even parity) or an odd number of 1s (odd
parity).
If one bit (or any odd number of bits) is erroneously inverted
during transmission then the receiver will detect an error.
Note, however, that if two (or any even number) of bits are
inverted due to error, an undetected error occurs.
Typically,
Even parity is used for synchronous transmission and
Odd parity for asynchronous transmission
Error Detection Methods
Vertical Redundancy Check (VRC)
Append a single bit at the end of data block such that
the number of ones is even
 Even Parity (odd parity is similar)
0110011  01100110
0110001  01100011
VRC is also known as Parity Check
Performance:
 Detects all odd-number errors in a data block
Longitudinal Redundancy Check
(LRC)
Organize data into a table and create a parity for
each column
11100111 11011101 00111001 10101001
11100111
11011101
00111001
10101001
10101010
11100111 11011101 00111001 10101001 10101010
Original Data LRC
Checksum
A checksum error detection method give us more accuracy if
used with a parity bit method.
The checksum field can be one or more bytes
A checksum method will basically check the sum of all the '1's
in a message and check that value against the checksum
value added by the sender to the message.
A checksum method can provide more precision to your error
detection efforts, there are still limitations.
A simple checksum cannot detect an even number of errors
which sum to zero, an insertion of bytes which sum to zero (add
0), or even the re-ordering of bytes in the message.
While there are some more advanced implementations of the
checksum method, including Fletcher's checksum method
CRC (cyclic redundancy check)
A better method to detect errors in a large block of data
involves the use of CRC codes.
The hardware required to implement a CRC code is slightly
more complicated than other error detection codes but it has
an error detection effectiveness greater than 99.9%.
CRC, which can be described as follows.
Given a k-bit block of bits, or message, the transmitter generates
an n-bit sequence, known as a frame check sequence (FCS)
Making a resulting frame, consisting of k + n bits which is exactly
divisible by some predetermined number.
The receiver then divides the incoming frame by that number
and, if there is no remainder, assumes there was no error.
CRC Concept
Let M(x) be the message polynomial
Let P(x) be the generator polynomial
P(x) is fixed for a given CRC scheme
P(x) is known both by sender and receiver
Create a block polynomial F(x) based on M(x) and P(x) such
that F(x) is divisible by P(x)
)(
0
)(
)(
)(
xP
xQ
xP
xF
+=
Cyclic Redundancy Check
Sending
1.Multiply M(x) by xn
2.Divide xn
M(x) by P(x)
3.Ignore the quotient and keep the reminder C(x)
4.Form and send F(x) = xn
M(x)+C(x)
Receiving
1.Receive F’(x)
2.Divide F’(x) by P(x)
3.Accept if remainder is 0, reject otherwise
Generating Polynomial
One way of considering CRC systems is to treat
the stream of transmitted bits as a representation of a
polynomial with coefficients of 1:
Let us assume k message bits and
n bits of redundancy
Associate bits with coefficients of a polynomial
1 0 1 1 0 1 1
1x6
+0x5
+1x4
+1x3
+0x2
+1x1
+1x0
= x6
+x4
+x3
+x+1
Generating Polynomial
CRC-16: G(x) = x16
+ x15
+ x2
+ 1
detects single and double bit errors
All errors with an odd number of bits
Burst errors of length 16 or less
Most errors for longer bursts
CRC-32: G(x) = x32
+ x26
+ x23
+ x22
+ x16
+ x12
+ x11
+ x10
+
x8
+ x7
+ x5
+ x4
+ x2
+ x + 1
Used in ethernet
Also 32 bits of 1 added on front of the message
 Initialize the LFSR to all 1s
Modulo 2 Arithmetic
Modulo 2 arithmetic uses binary addition with no
carries, which is just the exclusive-OR
operation. For example:
Example
Send
 M(x) = 110011  x5
+x4
+x+1 (6
bits)
 P(x) = 11001  x4
+x3
+1 (5 bits, n
= 4)
 4 bits of redundancy
 Form xn
M(x)  110011 0000
 x9
+x8
+x5
+x4
 Divide xn
M(x) by P(x) to find C(x)
100001
1001
11001
10000
11001
110011000011001
= C(x)
Receive
Send the block 110011 1001
00000
11001
11001
11001
110011100111001
No remainder
 Accept
Designing of CRC polynomial
 The most commonly used
polynomial lengths are
 9 bits (CRC-8)
 17 bits (CRC-16)
 33 bits (CRC-32)
 65 bits (CRC-64)
 CRC-8:
x8+x2+x+1
 Used in: 802.16 (along with error
correction).
 CRC-CCITT:
x16+x12+x5+1
 Used in: HDLC, SDLC, PPP
default
 IBM-CRC-16 (ANSI):
x16+x15+x2+1
 802.3:
x32+x26+x23+x22
+x16+x12+x11+x10
+x8+x7+x5+x4+x2+x+1
 Append 32 bits to the message.
 Detects all bursts of length 32 or
less.
 Used in: Ethernet, PPP option
Hamming Distance Based Checks
If we want to detect d bit errors in an n bit word we can map
every n bit word into a bigger n+d+1 bit word so that the
minimum Hamming distance between each valid mapping is
d+1.
Meaning if error-correcting bits are included with a message,
and if those bits can be arranged such that different incorrect
bits produce different error results, then bad bits could be
identified.
In a 7-bit message, there are seven possible single bit errors,
so three error control bits could potentially specify not only that
an error occurred but also which bit caused the error.
Hamming studied the existing coding schemes.
To start with he developed a nomenclature to describe the
system, including the number of data bits and error-correction
bits in a block.
Calculating the Hamming Code
 The key to the Hamming Code is the use of extra parity bits to allow the
identification of a single error.
 Create the code word as follows:
 Mark all bit positions that are powers of two as parity bits.
(positions 1, 2, 4, 8, 16, 32, 64, etc.)
 All other bit positions are for the data to be encode
 Each parity bit calculates the parity for some of the bits in the code word.
 The position of the parity bit determines the sequence of bits.
 Position 1: check 1 bit, skip 1 bit, check 1 bit, skip 1 bit, etc.
(1,3,5,7,9,11,13,15,...)
 Position 2: check 2 bits, skip 2 bits, check 2 bits, skip 2 bits, etc.
(2,3,6,7,10,11,14,15,...)
 Position 4: check 4 bits, skip 4 bits, check 4 bits, skip 4 bits, etc.
(4,5,6,7,12,13,14,15,20,21,22,23,...)
 Position 8: check 8 bits, skip 8 bits, check 8 bits, skip 8 bits, etc.
(8-15,24-31,40-47,...)
 Position 16: check 16 bits, skip 16 bits, check 16 bits, skip 16 bits, etc.
(16-31,48-63,80-95,...)
 Position 32: check 32 bits, skip 32 bits, check 32 bits, skip 32 bits, etc.
(32-63,96-127,160-191,...)
 Set a parity bit to 1 if the total number of ones in the positions it checked is odd
and 0 if the total number of ones in the positions it checks is even.
Example
With Hamming, can find errors quickly by just looking at one pattern:
Let's say error in a data bit:
100 sent
111000
became: 111001
i.e. data 101, but check bits wrong
Check bit 1 - 1 - checks bits 3,5 - 1 0 - OK
Check bit 2 - 1 - checks bits 3,6 - 1 1 - WRONG
Check bit 4 - 0 - checks bits 5,6 - 0 1 - WRONG
The bad bit is bit 2 + 4 = bit 6. Data was corrupted. Data
should be 100.
Example
Let's say error in a check bit:
100 sent
111000
became: 011000
i.e. data 100, but check bits wrong
Check bit 1 - 0 - checks bits 3,5 - 1 0 - WRONG
Check bit 2 - 1 - checks bits 3,6 - 1 0 - OK
Check bit 4 - 0 - checks bits 5,6 - 0 0 - OK
The bad bit is bit 1. Check bit was corrupted. Data is
fine.
Finding and fixing a bad bit
Do a example and then add an error and check the result
For above example create a code word of 011100101010.
Insert and error suppose the word that was received was
011100101110 instead.
Then the receiver could calculate which bit was wrong and
correct it.
The method is to verify each check bit. Write down all the
incorrect parity bits.
Doing so, you will discover that parity bits 2 and 8 are
incorrect. It is not an accident that 2 + 8 = 10, and that bit
position 10 is the location of the bad bit.
In general, check each parity bit, and add the positions that
are wrong, this will give you the location of the bad bit.
Error Correction
There are various methods used to correct errors.
 An obvious and simple one is to just detect the error
and then do nothing, assuming that something else
will fix it.
This method is fine when something else is able to
fix the error, but is of no use if there is no something
else!
_____In computers radiation can cause the gates to
change state from time to time.
Modern computer memory corrects these errors it is
called FEC (Forward Error Control) to differentiate it
from ARQ systems.
Techniques For Error Control
The most common are based on some or all of the
following ingredients:
Error detection. Techniques and coding of data.
Positive acknowledgment.
Retransmission after timeout. The source
retransmits a frame that has not been acknowledged
after a predetermined amount of time.
Negative acknowledgment and retransmission.
The estimation returns a negative acknowledgment to
frames in which an error is detected. The source
retransmits such frames.
ARQ (Automatic Repeat reQuest)
In data communication protocols, it is common to just ignore
errors that are received, while acknowledging correct data.
If an error is received, the lack of an acknowledgement eventually
leads to a retransmission after some timeout period.
The effect of ARQ is to turn an unreliable data link into a reliable
one
This technique is called ARQ (for Automatic Repeat reQuest).
Three versions of ARQ have been standardized:
Stop-and-wait
Go-back-N
Selective-reject
Stop N Wait ARQ
Based on the stop-and-wait flow-control technique
The source station transmits a single frame and then must
await an acknowledgment (ACK).
No other data frames can be sent until the destination station's
reply arrives at the source station.
Error Control - Two sorts of errors could occur.
First, the frame that arrives at the destination could be
damaged; the receiver detects this by error detection
technique
referred to earlier and simply discards the frame.
To account for this possibility, the source station is equipped
with a timer.
After a frame is transmitted, the source station waits for an
acknowledgment. If no acknowledgment is received by the
time the timer expires, then the same frame is sent again,
keeping a copy at transmitter
Stop N wait
 Second, damaged acknowledgment.
 Station A sends to station B, which
responds with an acknowledgment (ACK).
 The ACK is damaged in transit and is not
recognized by A, which eventually ends
timer & generate frame
 This duplicate frame arrives and is
accepted by B, which has therefore
accepted two copies of the same frame as
if they were separate.
 To avoid this problem, frames are
alternately labeled with 0 or 1
 ACK are of the form ACKO and ACK1.
 In keeping with the sliding-window
convention, an ACKO acknowledges receipt
of a frame numbered 1 and indicates that
the receiver is ready for a frame numbered
0.
 The sliding-window flow control technique
can be adapted to provide more efficient
line use.
Go back N ARQ
The form of error control based on sliding-window flow control
In go-back-N ARQ, a station may send a series of frames
sequentially numbered
The number of unacknowledged frames outstanding is determined
by window size, using the sliding-window flow control technique.
While no errors occur, the destination will acknowledge (RR =
receive ready)
If the destination station detects an error in a frame, it sends a
negative acknowledgment (REJ = reject) for that frame.
The destination station will discard that frame and all future incoming
frames until the frame in error is correctly received.
Thus, at source station, when it receives an REJ, must retransmit the
frame in error plus all succeeding frames that were transmitted in the
interim.
GO Back N
 When A is sending to B the following errors could
occur which is called Damaged frame.
 There are three sub cases:
 A transmits frame i. B detects an error and has
previously successfully received frame (i - 1). B
sends REJ i, indicated that frame i is rejected.
 When A receives the REJ, it must retransmit frame
i and all subsequent frames, since the original
transmission of i.
 Frame i is lost in transit. A subsequently sends
frame (i + 1). B receives frame (i + 1) out of order
and sends an REJ i
 Frame i is lost in transit, and A does not soon send
additional frames.
 B receives nothing and returns neither an RR nor
an REJ.
 When A's timer expires, it transmits an RR frame
that includes a bit known as the P bit, set to =1
 B interprets the RR frame with a P bit of 1 as a
command that must be acknowledged by sending
an RR indicating the next frame that it expects.
 When A receives the RR, it retransmits frame i.
Go Back N
 Damaged RR. There are two sub cases:
 B receives frame i and sends RR (i + I), which is lost in transit.
 Because acknowledgments are cumulative (e.g., RR 6 means that all frames
 through 5 are acknowledged),
 A will receive a subsequent RR to a subsequent frame and that it will arrive
before the timer associated with frame i expires.
 If A's timer expires, it transmits an RR command as in case of pervious slide. It
sets another timer, called the P-bit timer.
 If B fails to respond to the RR command, or if its response is damaged, then A's
P-bit timer will expire. At this point
 A will try again by issuing a new RR command and restarting the P-bit timer.
 This procedure is tried for a number of iterations.
 If A fails to obtain an Ack after some maximum number of attempts, it initiates a
reset procedure.
 Damaged REJ. If an REJ is lost, this is equivalent to the case lost in transit
Selective-reject ARQ
With selective-reject ARQ, the only frames retransmitted are those
that receive a negative acknowledgment, in this case called SREJ,
or that time-out.
This would appear to be more efficient than go-back-N, because it
minimizes the amount of retransmission.
On the other hand, the receiver must maintain a buffer large enough
to save post-SREJ frames until the frame in error is retransmitted
and it must contain logic for reinserting that frame in the proper
sequence.
The transmitter, too, requires more complex logic to be able to send
a frame out of sequence.
Because of such complications, select-reject ARQ is much less used
than go-back- N ARQ.
The window-size limitation is more restrictive for selective-reject than
for go back- N. Consider the case of a 3-bit sequence-number size
for selective-reject.
Selective reject
 Allow a window size of seven, and consider the following scenario
1. Station A sends frames 0 through 6 to station B. Frame
(0,1,2,3,4,5,6,7,0,1,2,3,4,5)
2. Station B receives all seven frames and cumulatively Ack with RR 7.
3. Because of some noise burst, the RR 7 is lost/corrupted
4. A’s times out and retransmits frame 0 - 6.
5. B has already advanced its receive window to accept frames
7,0,1,2,3,4, and 5
6. Thus, B assumes that frame 7 has been lost and that this is a new
frame 0,which it accepts.
 The problem with this scenario is that there is an overlap between the
sending and receiving windows.
 To overcome the problem, the maximum window size should be no more
than half the range of sequence numbers.
 In this above scenario, if only four unacknowledged frames may be
outstanding, no confusion can result.
 In general, for a k-bit sequence number field, which provides a sequence
number range of 2k, the maximum window size is limited to 2k-1.
OTHER DATA LINK CONTROL
PROTOCOLS
In addition to HDLC, there are a number of other
important data link control protocols.
LAPB
LAPD
Logical Link Control (LLC)
Frame Relay
Asynchronous Transfer Mode (ATM)
Frame structure
LAPB
LAPB (Link Access Procedure, Balanced) was
issued by ITU-T as part of its X.25
packet-switching network-interface standard. It is a
subset of HDLC that provides
only the asynchronous balanced mode (ABM); it is
designed for the point-to-point
link between a user system and a packet-switching
network node. Its frame format
is the same as that of HDLC.
LAPD
LAPD (Link Access Procedure, D-Channel) was issued by ITU-T as
part of its set
of recommendations on ISDN (Integrated Services Digital Network).
LAPD provides data link control over the D channel, which is a
logical channel at the user-ISDN interface.
There are several key differences between LAPD and HDLC.
Like LAPB, LAPD is restricted to ABM. LAPD always uses 7-bit
sequence numbers; 3-bit sequence numbers are not allowed.
The FCS for LAPD is always the 16-bit CRC.
Finally, the address field for LAPD is a 16-bit field that actually
contains two sub-addresses:
 one is used to identify one of possibly multiple devices on the user side
of the interface, and
 The other is used to identify one of possibly multiple logical users of
LAPD on the user side of the interface.
LLC
LLC is part of the IEEE 802 family of standards for
controlling operation over alocal area network (LAN).
LLC is lacking some features found in HDLC and
also has some features not found in HDLC.
The most obvious difference between LLC and
HDLC is the difference in frame format.
Link control functions in the case of LLC are actually
divided between two layers:
A medium access control (MAC) layer, and
The LLC layer, which operates on top of the MAC
layer.
LLC
Above Figure shows the structure of the combined MAC/LLC
frame;
The shaded portion corresponds to the fields produced at the
LLC layer.
The unshaded portions are the header and trailer of the MAC
frame.
The MAC layer includes source and destination addresses for
devices attached to the LAN.
Two addresses are needed as there is no concept of primary
and secondary in the LAN environment; therefore, both the
sender and receiver must be identified.
Error detection is done at the MAC level, using a 32-bit CRC.
Finally, there are some control functions peculiar to medium-
access control that may be included in a MAC control field.
Frame Relay
Frame relay is a data link control facility designed to provide a
streamlined capability for use over high-speed packet-
switched networks.
It is used in place of X.25,which consists of both a data link
control protocol (LAPB) and a network-layerprotocol (called
X.25 packet layer).
The data link control protocol defined for frame relay is LAPF
(Link Access Procedure for Frame-Mode Bearer Services).
There are actually two protocols: a control protocol, which has
similar features to HDLC, and a core protocol, which is a
subset of the control protocol.
There are several key differences between the LAPF control
protocol and HDLC.
Asynchronous Transfer Mode
(ATM)
Like frame relay, ATM is designed to provide a
streamlined data-transfer capability across high-
speed networks.
Unlike frame relay, ATM is not based on HDLC.
Instead, ATM is based on a completely new frame
format, known as a cell, that provides minimum
processing overhead.
1 von 50

Recomendados

Chapter 11: Data Link Control von
Chapter 11: Data Link ControlChapter 11: Data Link Control
Chapter 11: Data Link ControlJeoffnaRuth
2.5K views101 Folien
3a data link layer von
3a data link layer 3a data link layer
3a data link layer kavish dani
1K views55 Folien
data-link layer protocols von
data-link layer protocols  data-link layer protocols
data-link layer protocols BE Smârt
13.3K views49 Folien
Mcseminar von
McseminarMcseminar
McseminarAnkit Anand
197 views33 Folien
Tcp Reliability Flow Control von
Tcp Reliability Flow ControlTcp Reliability Flow Control
Tcp Reliability Flow ControlRam Dutt Shukla
2.5K views25 Folien
Framming data link layer von
Framming data link layerFramming data link layer
Framming data link layerPREMAL GAJJAR
6.8K views88 Folien

Más contenido relacionado

Was ist angesagt?

Data link layer tutorial von
Data link layer tutorialData link layer tutorial
Data link layer tutorialSwapnadeep Reloaded
1.1K views8 Folien
Dcn ppt on data link layer von
Dcn ppt on data link layerDcn ppt on data link layer
Dcn ppt on data link layerroma bora
1.9K views25 Folien
Tcp Immediate Data Transfer von
Tcp Immediate Data TransferTcp Immediate Data Transfer
Tcp Immediate Data TransferRam Dutt Shukla
1.2K views4 Folien
Data link layer von
Data link layerData link layer
Data link layerI World Tech
5.5K views124 Folien
Flow control and error control techniques in the data link layer protocol von
Flow control and error control techniques in the data link layer protocolFlow control and error control techniques in the data link layer protocol
Flow control and error control techniques in the data link layer protocolmdmuaj
475 views14 Folien
Data link layer von
Data link layerData link layer
Data link layerst2112
2.7K views34 Folien

Was ist angesagt?(20)

Dcn ppt on data link layer von roma bora
Dcn ppt on data link layerDcn ppt on data link layer
Dcn ppt on data link layer
roma bora1.9K views
Flow control and error control techniques in the data link layer protocol von mdmuaj
Flow control and error control techniques in the data link layer protocolFlow control and error control techniques in the data link layer protocol
Flow control and error control techniques in the data link layer protocol
mdmuaj475 views
Data link layer von st2112
Data link layerData link layer
Data link layer
st21122.7K views
Sliding window protocol von Rishu Seth
Sliding window protocolSliding window protocol
Sliding window protocol
Rishu Seth24.9K views
Data Link Layer Numericals von Manisha Keim
Data Link Layer NumericalsData Link Layer Numericals
Data Link Layer Numericals
Manisha Keim4.9K views
Presentation of computer network on data link layer von sumit gyawali
Presentation of computer network on data link layerPresentation of computer network on data link layer
Presentation of computer network on data link layer
sumit gyawali1.4K views
Chapter 4 data link layer von Naiyan Noor
Chapter 4 data link layerChapter 4 data link layer
Chapter 4 data link layer
Naiyan Noor13K views
Data link layer von sbkbca
Data link layerData link layer
Data link layer
sbkbca446 views
Unit 2 data link control von Vishal kakade
Unit 2 data link controlUnit 2 data link control
Unit 2 data link control
Vishal kakade9.9K views
Jaimin chp-3 - data-link layer- 2011 batch von Jaimin Jani
Jaimin   chp-3 - data-link layer- 2011 batchJaimin   chp-3 - data-link layer- 2011 batch
Jaimin chp-3 - data-link layer- 2011 batch
Jaimin Jani3.6K views
Connection Establishment & Flow and Congestion Control von Adeel Rasheed
Connection Establishment & Flow and Congestion ControlConnection Establishment & Flow and Congestion Control
Connection Establishment & Flow and Congestion Control
Adeel Rasheed1.1K views
Data link control & protocol concepts von Raji Lakshmi
Data link control & protocol conceptsData link control & protocol concepts
Data link control & protocol concepts
Raji Lakshmi6.2K views
Introduction to data link layer von Shashank HP
Introduction to data link layerIntroduction to data link layer
Introduction to data link layer
Shashank HP96 views

Destacado

05 directnets errors von
05 directnets errors05 directnets errors
05 directnets errorsjyang1983
1.5K views22 Folien
Error control coding von
Error control codingError control coding
Error control codingMohammad Bappy
2.7K views18 Folien
Haystack + DASH7 Security von
Haystack + DASH7 SecurityHaystack + DASH7 Security
Haystack + DASH7 SecurityHaystack Technologies
7.2K views19 Folien
Introduction to TCP/IP von
Introduction to TCP/IPIntroduction to TCP/IP
Introduction to TCP/IPFrank Fang Kuo Yu
2.2K views31 Folien
Wireshark Basics von
Wireshark BasicsWireshark Basics
Wireshark BasicsYoram Orzach
26K views95 Folien
Data link layer von
Data link layer Data link layer
Data link layer Mukesh Chinta
62.1K views101 Folien

Similar a 5 DLL-LLC- Book

Unit 4 data link layer von
Unit 4 data link layerUnit 4 data link layer
Unit 4 data link layermekind
11.3K views37 Folien
09 Data Link LayerFlow Control.ppt von
09 Data Link LayerFlow Control.ppt09 Data Link LayerFlow Control.ppt
09 Data Link LayerFlow Control.pptShaliniKumariGupta1
8 views56 Folien
Transport_Layer_Protocols.pptx von
Transport_Layer_Protocols.pptxTransport_Layer_Protocols.pptx
Transport_Layer_Protocols.pptxAnkitKumar891632
3 views34 Folien
stop and wait von
stop and waitstop and wait
stop and waitswati463221
41 views24 Folien
III_UNIT_ErrorCorrecting.pptx von
III_UNIT_ErrorCorrecting.pptxIII_UNIT_ErrorCorrecting.pptx
III_UNIT_ErrorCorrecting.pptxShantanuDharekar
7 views47 Folien
Data link control von
Data link controlData link control
Data link controlС. Ариука
1.8K views23 Folien

Similar a 5 DLL-LLC- Book(20)

Unit 4 data link layer von mekind
Unit 4 data link layerUnit 4 data link layer
Unit 4 data link layer
mekind11.3K views
Transmission control protocol von Sundra Anand
Transmission control protocolTransmission control protocol
Transmission control protocol
Sundra Anand897 views
Chapter 7 - Data Link Control Protocols 9e von adpeer
Chapter 7 - Data Link Control Protocols 9eChapter 7 - Data Link Control Protocols 9e
Chapter 7 - Data Link Control Protocols 9e
adpeer4.2K views
datalinklayermukesh-150130061041-conversion-gate01.pptx von lathass5
datalinklayermukesh-150130061041-conversion-gate01.pptxdatalinklayermukesh-150130061041-conversion-gate01.pptx
datalinklayermukesh-150130061041-conversion-gate01.pptx
lathass58 views

Más de Water Birds (Ali)

Who invented? von
Who invented?Who invented?
Who invented?Water Birds (Ali)
625 views11 Folien
Creative Writing Course Worksheets von
Creative Writing Course WorksheetsCreative Writing Course Worksheets
Creative Writing Course WorksheetsWater Birds (Ali)
1.4K views13 Folien
Essay Writing von
Essay Writing   Essay Writing
Essay Writing Water Birds (Ali)
11.7K views34 Folien
PhDs Produced by Punjab University from Jan to Dec 2014 von
PhDs Produced by Punjab University from Jan to Dec 2014PhDs Produced by Punjab University from Jan to Dec 2014
PhDs Produced by Punjab University from Jan to Dec 2014Water Birds (Ali)
827 views1 Folie
Course Outline for MA Urdu Punjab University von
Course Outline for MA Urdu Punjab UniversityCourse Outline for MA Urdu Punjab University
Course Outline for MA Urdu Punjab UniversityWater Birds (Ali)
10.7K views26 Folien
Course Outline for MA Philosophy Punjab University von
Course Outline for MA Philosophy Punjab UniversityCourse Outline for MA Philosophy Punjab University
Course Outline for MA Philosophy Punjab UniversityWater Birds (Ali)
4.1K views17 Folien

Más de Water Birds (Ali)(20)

PhDs Produced by Punjab University from Jan to Dec 2014 von Water Birds (Ali)
PhDs Produced by Punjab University from Jan to Dec 2014PhDs Produced by Punjab University from Jan to Dec 2014
PhDs Produced by Punjab University from Jan to Dec 2014
Water Birds (Ali)827 views
Course Outline for MA Urdu Punjab University von Water Birds (Ali)
Course Outline for MA Urdu Punjab UniversityCourse Outline for MA Urdu Punjab University
Course Outline for MA Urdu Punjab University
Water Birds (Ali)10.7K views
Course Outline for MA Philosophy Punjab University von Water Birds (Ali)
Course Outline for MA Philosophy Punjab UniversityCourse Outline for MA Philosophy Punjab University
Course Outline for MA Philosophy Punjab University
Water Birds (Ali)4.1K views
Course Outline for MA French Punjab University von Water Birds (Ali)
Course Outline for MA French Punjab UniversityCourse Outline for MA French Punjab University
Course Outline for MA French Punjab University
Water Birds (Ali)783 views
Course Outline for MA English Punjab University von Water Birds (Ali)
Course Outline for MA English Punjab UniversityCourse Outline for MA English Punjab University
Course Outline for MA English Punjab University
Water Birds (Ali)14K views
MPhil English Interview Schedule for 27 July 2011 (Punjab University) von Water Birds (Ali)
MPhil English Interview Schedule for 27 July 2011 (Punjab University)MPhil English Interview Schedule for 27 July 2011 (Punjab University)
MPhil English Interview Schedule for 27 July 2011 (Punjab University)
Water Birds (Ali)2.2K views
PU's MPhil English Interview Result 2011 von Water Birds (Ali)
PU's MPhil English Interview Result 2011PU's MPhil English Interview Result 2011
PU's MPhil English Interview Result 2011
Water Birds (Ali)3.7K views
Chinua Achebe - Things Fall Apart [Edited Version] von Water Birds (Ali)
Chinua Achebe - Things Fall Apart [Edited Version]Chinua Achebe - Things Fall Apart [Edited Version]
Chinua Achebe - Things Fall Apart [Edited Version]
Water Birds (Ali)3.4K views
Mother Courage and Her Children by Bertolt Bretch von Water Birds (Ali)
Mother Courage and Her Children by Bertolt BretchMother Courage and Her Children by Bertolt Bretch
Mother Courage and Her Children by Bertolt Bretch
Water Birds (Ali)3.9K views
Chapter 3 History and Geography The Foundations of Culture von Water Birds (Ali)
Chapter 3   History and Geography The Foundations of Culture  Chapter 3   History and Geography The Foundations of Culture
Chapter 3 History and Geography The Foundations of Culture
Water Birds (Ali)14K views

Último

Scope of Biochemistry.pptx von
Scope of Biochemistry.pptxScope of Biochemistry.pptx
Scope of Biochemistry.pptxshoba shoba
124 views55 Folien
Gopal Chakraborty Memorial Quiz 2.0 Prelims.pptx von
Gopal Chakraborty Memorial Quiz 2.0 Prelims.pptxGopal Chakraborty Memorial Quiz 2.0 Prelims.pptx
Gopal Chakraborty Memorial Quiz 2.0 Prelims.pptxDebapriya Chakraborty
598 views81 Folien
REPRESENTATION - GAUNTLET.pptx von
REPRESENTATION - GAUNTLET.pptxREPRESENTATION - GAUNTLET.pptx
REPRESENTATION - GAUNTLET.pptxiammrhaywood
83 views26 Folien
discussion post.pdf von
discussion post.pdfdiscussion post.pdf
discussion post.pdfjessemercerail
120 views1 Folie
ISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks Effectively von
ISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks EffectivelyISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks Effectively
ISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks EffectivelyPECB
545 views18 Folien
Classification of crude drugs.pptx von
Classification of crude drugs.pptxClassification of crude drugs.pptx
Classification of crude drugs.pptxGayatriPatra14
77 views13 Folien

Último(20)

Scope of Biochemistry.pptx von shoba shoba
Scope of Biochemistry.pptxScope of Biochemistry.pptx
Scope of Biochemistry.pptx
shoba shoba124 views
REPRESENTATION - GAUNTLET.pptx von iammrhaywood
REPRESENTATION - GAUNTLET.pptxREPRESENTATION - GAUNTLET.pptx
REPRESENTATION - GAUNTLET.pptx
iammrhaywood83 views
ISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks Effectively von PECB
ISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks EffectivelyISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks Effectively
ISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks Effectively
PECB 545 views
Classification of crude drugs.pptx von GayatriPatra14
Classification of crude drugs.pptxClassification of crude drugs.pptx
Classification of crude drugs.pptx
GayatriPatra1477 views
Are we onboard yet University of Sussex.pptx von Jisc
Are we onboard yet University of Sussex.pptxAre we onboard yet University of Sussex.pptx
Are we onboard yet University of Sussex.pptx
Jisc77 views
American Psychological Association 7th Edition.pptx von SamiullahAfridi4
American Psychological Association  7th Edition.pptxAmerican Psychological Association  7th Edition.pptx
American Psychological Association 7th Edition.pptx
SamiullahAfridi482 views
Dance KS5 Breakdown von WestHatch
Dance KS5 BreakdownDance KS5 Breakdown
Dance KS5 Breakdown
WestHatch68 views
Drama KS5 Breakdown von WestHatch
Drama KS5 BreakdownDrama KS5 Breakdown
Drama KS5 Breakdown
WestHatch71 views
Community-led Open Access Publishing webinar.pptx von Jisc
Community-led Open Access Publishing webinar.pptxCommunity-led Open Access Publishing webinar.pptx
Community-led Open Access Publishing webinar.pptx
Jisc74 views
OEB 2023 Co-learning To Speed Up AI Implementation in Courses.pptx von Inge de Waard
OEB 2023 Co-learning To Speed Up AI Implementation in Courses.pptxOEB 2023 Co-learning To Speed Up AI Implementation in Courses.pptx
OEB 2023 Co-learning To Speed Up AI Implementation in Courses.pptx
Inge de Waard167 views
The Accursed House by Émile Gaboriau von DivyaSheta
The Accursed House  by Émile GaboriauThe Accursed House  by Émile Gaboriau
The Accursed House by Émile Gaboriau
DivyaSheta158 views
7 NOVEL DRUG DELIVERY SYSTEM.pptx von Sachin Nitave
7 NOVEL DRUG DELIVERY SYSTEM.pptx7 NOVEL DRUG DELIVERY SYSTEM.pptx
7 NOVEL DRUG DELIVERY SYSTEM.pptx
Sachin Nitave58 views

5 DLL-LLC- Book

  • 2. Introduction  To achieve unnecessary control over data communication link  A logic is added above the physical interface which is referred as Data Link Control/ Protocol  To see the need of data link control, some of the requirements and objectives for data communication are listed as follows  Frame synchronization- start and end should be recognizable  Flow control- the sender and receiver data rate  Error control- check the error and correct it  Addressing- identify the address  Control and Data on same link- should have control information  Link Management- the initiation, maintenance and termination  We will study the three mechanisms that are a part of data link control  Flow control, error detection and error control
  • 3. Flow Control Flow control is used to make sure that the transmitted data is not over whelming the receiver The receiver allocates a data buffer for the processing before passing it to higher level software In the absence the system may bottle neck
  • 4. Ideal Flow Control In the absence of errors, the model in figure depicts a vertical time sequence It has advantage of showing time dependencies Each arrow represents a single frame (data + control info) It was an errorless communication However, transmitted frame suffers a variable amount of delay
  • 5. Stop and Wait Flow Control Simplest form of flow control Source transmit a frame, after reception the destination indicates its willingness to accept more data by sending back an acknowledgment of the frame just received The source waits for the acknowledgment The destination can thus stop the data flow by with holding acknowledgment If a larger data is broken down into smaller blocks, this is done for the following reasons
  • 6. Stop and Wait Flow Control  Limited buffer size  Longer the transmission, more likely there will be an error  Smaller frames, errors are detected sooner and retransmitted faster  On LANs not to permit a station to hold a medium for longer time With multiple frames of a message, stop and wait may be inadequate We know about transmission time and propagation delay
  • 7. Stop and Wait Flow Control
  • 8. Stop and Wait Flow Control As per previous figure transmission time is normalized to 1 and propagation is expressed as variable ‘a’ When a<1 the propagation time is less than transmission time The frame is long and before it is transmitted it arrives destination When a>1 the propagation time is greater than transmission time The sender completes transmission before the frame arrives at receiver Note that for a>1 line is always underutilized and for a<1 line is inefficiently utilized In essence for high data rates or for long distances stop and flow control provides inefficient line utilization
  • 9. Sliding Windows Flow Control As per the previous flow control the efficiency can be improved by allowing multiple frames to be in transit at same time A and B are connected via full duplex link (A -> B) B allocates a buffer for n frames to be received from A To keep track of the frames, they are labeled B ack a frame by sending ack that includes sequence number of next expected The scheme can be used to ack multiple frames A and B both maintains a list; sent sequence numbers and received sequence numbers Each of these lists can be thought of as a window or frame Additional comments need to be made
  • 10. Sliding Windows Flow ControlTo represent a sequence number, it occupies a field in a frame For K-bit field, the range of sequence number is O through 2k -1
  • 11. Sliding Windows Flow Control Receiver can control the size of the sending window By limiting the size of the sending window data flow from sender to receiver can be limited Let 3 bits sequence has max of 7 frames, A->B After transmitting some frames without ack A shrunk its window to 4 frames B then transmits RR3 (receive ready) which is ack of receive frames With this ack A is back up to permission of transmitting 7 frames starting from 3 onwards RNR (receive not ready) a station can cut off a flow of frames if it exceeds its buffer size
  • 13. Sliding Window Transmission If 2 stations exchange data, each has to maintain 2 windows (two directional) One for transmit and one for receive And each one has to send data and ack to other Piggybank- provides efficient support for above requirement Each frame holds sequence number of frame + field that holds sequence number for ack Thus a station sends data and ack both in one frame, saving communication capacity If station has ack but no data, it sends a separate ack frame Similarly no ack but data to send, it must repeat the last ack it sent  Because data frame includes a field for ack number and some number has to be put in that field  Duplications are simply ignored  Pipe line concept
  • 14. Error detecting We talked about transmission impairments and the effect of data rate and signal-to-noise ratio on bit error rate. Regardless of the design of the transmission system, there will be errors, resulting in the change of one or more bits in a transmitted frame. So, how can a receiver know if the data received is error free?  There are several methods that can be implemented to accomplish this. Some of these methods are simple and somewhat effective – others are complicated and very effective.
  • 15. Error Detection Data transmission can contain errors Single-bit Burst errors of length n How to detect errors If only data is transmitted, errors cannot be detected  Send more information with data that satisfies a special relationship  Add redundancy
  • 16. Error Detection Methods Parity bit The simplest error-detection scheme is to append a parity bit to the end of a block of data. A typical example is ASCII transmission, in which a parity bit is attached to each 7-bit ASCII character. The value of this bit is selected so that the character has an even number of 1s (even parity) or an odd number of 1s (odd parity). If one bit (or any odd number of bits) is erroneously inverted during transmission then the receiver will detect an error. Note, however, that if two (or any even number) of bits are inverted due to error, an undetected error occurs. Typically, Even parity is used for synchronous transmission and Odd parity for asynchronous transmission
  • 17. Error Detection Methods Vertical Redundancy Check (VRC) Append a single bit at the end of data block such that the number of ones is even  Even Parity (odd parity is similar) 0110011  01100110 0110001  01100011 VRC is also known as Parity Check Performance:  Detects all odd-number errors in a data block
  • 18. Longitudinal Redundancy Check (LRC) Organize data into a table and create a parity for each column 11100111 11011101 00111001 10101001 11100111 11011101 00111001 10101001 10101010 11100111 11011101 00111001 10101001 10101010 Original Data LRC
  • 19. Checksum A checksum error detection method give us more accuracy if used with a parity bit method. The checksum field can be one or more bytes A checksum method will basically check the sum of all the '1's in a message and check that value against the checksum value added by the sender to the message. A checksum method can provide more precision to your error detection efforts, there are still limitations. A simple checksum cannot detect an even number of errors which sum to zero, an insertion of bytes which sum to zero (add 0), or even the re-ordering of bytes in the message. While there are some more advanced implementations of the checksum method, including Fletcher's checksum method
  • 20. CRC (cyclic redundancy check) A better method to detect errors in a large block of data involves the use of CRC codes. The hardware required to implement a CRC code is slightly more complicated than other error detection codes but it has an error detection effectiveness greater than 99.9%. CRC, which can be described as follows. Given a k-bit block of bits, or message, the transmitter generates an n-bit sequence, known as a frame check sequence (FCS) Making a resulting frame, consisting of k + n bits which is exactly divisible by some predetermined number. The receiver then divides the incoming frame by that number and, if there is no remainder, assumes there was no error.
  • 21. CRC Concept Let M(x) be the message polynomial Let P(x) be the generator polynomial P(x) is fixed for a given CRC scheme P(x) is known both by sender and receiver Create a block polynomial F(x) based on M(x) and P(x) such that F(x) is divisible by P(x) )( 0 )( )( )( xP xQ xP xF +=
  • 22. Cyclic Redundancy Check Sending 1.Multiply M(x) by xn 2.Divide xn M(x) by P(x) 3.Ignore the quotient and keep the reminder C(x) 4.Form and send F(x) = xn M(x)+C(x) Receiving 1.Receive F’(x) 2.Divide F’(x) by P(x) 3.Accept if remainder is 0, reject otherwise
  • 23. Generating Polynomial One way of considering CRC systems is to treat the stream of transmitted bits as a representation of a polynomial with coefficients of 1: Let us assume k message bits and n bits of redundancy Associate bits with coefficients of a polynomial 1 0 1 1 0 1 1 1x6 +0x5 +1x4 +1x3 +0x2 +1x1 +1x0 = x6 +x4 +x3 +x+1
  • 24. Generating Polynomial CRC-16: G(x) = x16 + x15 + x2 + 1 detects single and double bit errors All errors with an odd number of bits Burst errors of length 16 or less Most errors for longer bursts CRC-32: G(x) = x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 + x + 1 Used in ethernet Also 32 bits of 1 added on front of the message  Initialize the LFSR to all 1s
  • 25. Modulo 2 Arithmetic Modulo 2 arithmetic uses binary addition with no carries, which is just the exclusive-OR operation. For example:
  • 26. Example Send  M(x) = 110011  x5 +x4 +x+1 (6 bits)  P(x) = 11001  x4 +x3 +1 (5 bits, n = 4)  4 bits of redundancy  Form xn M(x)  110011 0000  x9 +x8 +x5 +x4  Divide xn M(x) by P(x) to find C(x) 100001 1001 11001 10000 11001 110011000011001 = C(x) Receive Send the block 110011 1001 00000 11001 11001 11001 110011100111001 No remainder  Accept
  • 27. Designing of CRC polynomial  The most commonly used polynomial lengths are  9 bits (CRC-8)  17 bits (CRC-16)  33 bits (CRC-32)  65 bits (CRC-64)  CRC-8: x8+x2+x+1  Used in: 802.16 (along with error correction).  CRC-CCITT: x16+x12+x5+1  Used in: HDLC, SDLC, PPP default  IBM-CRC-16 (ANSI): x16+x15+x2+1  802.3: x32+x26+x23+x22 +x16+x12+x11+x10 +x8+x7+x5+x4+x2+x+1  Append 32 bits to the message.  Detects all bursts of length 32 or less.  Used in: Ethernet, PPP option
  • 28. Hamming Distance Based Checks If we want to detect d bit errors in an n bit word we can map every n bit word into a bigger n+d+1 bit word so that the minimum Hamming distance between each valid mapping is d+1. Meaning if error-correcting bits are included with a message, and if those bits can be arranged such that different incorrect bits produce different error results, then bad bits could be identified. In a 7-bit message, there are seven possible single bit errors, so three error control bits could potentially specify not only that an error occurred but also which bit caused the error. Hamming studied the existing coding schemes. To start with he developed a nomenclature to describe the system, including the number of data bits and error-correction bits in a block.
  • 29. Calculating the Hamming Code  The key to the Hamming Code is the use of extra parity bits to allow the identification of a single error.  Create the code word as follows:  Mark all bit positions that are powers of two as parity bits. (positions 1, 2, 4, 8, 16, 32, 64, etc.)  All other bit positions are for the data to be encode  Each parity bit calculates the parity for some of the bits in the code word.  The position of the parity bit determines the sequence of bits.  Position 1: check 1 bit, skip 1 bit, check 1 bit, skip 1 bit, etc. (1,3,5,7,9,11,13,15,...)  Position 2: check 2 bits, skip 2 bits, check 2 bits, skip 2 bits, etc. (2,3,6,7,10,11,14,15,...)  Position 4: check 4 bits, skip 4 bits, check 4 bits, skip 4 bits, etc. (4,5,6,7,12,13,14,15,20,21,22,23,...)  Position 8: check 8 bits, skip 8 bits, check 8 bits, skip 8 bits, etc. (8-15,24-31,40-47,...)  Position 16: check 16 bits, skip 16 bits, check 16 bits, skip 16 bits, etc. (16-31,48-63,80-95,...)  Position 32: check 32 bits, skip 32 bits, check 32 bits, skip 32 bits, etc. (32-63,96-127,160-191,...)  Set a parity bit to 1 if the total number of ones in the positions it checked is odd and 0 if the total number of ones in the positions it checks is even.
  • 30. Example With Hamming, can find errors quickly by just looking at one pattern: Let's say error in a data bit: 100 sent 111000 became: 111001 i.e. data 101, but check bits wrong Check bit 1 - 1 - checks bits 3,5 - 1 0 - OK Check bit 2 - 1 - checks bits 3,6 - 1 1 - WRONG Check bit 4 - 0 - checks bits 5,6 - 0 1 - WRONG The bad bit is bit 2 + 4 = bit 6. Data was corrupted. Data should be 100.
  • 31. Example Let's say error in a check bit: 100 sent 111000 became: 011000 i.e. data 100, but check bits wrong Check bit 1 - 0 - checks bits 3,5 - 1 0 - WRONG Check bit 2 - 1 - checks bits 3,6 - 1 0 - OK Check bit 4 - 0 - checks bits 5,6 - 0 0 - OK The bad bit is bit 1. Check bit was corrupted. Data is fine.
  • 32. Finding and fixing a bad bit Do a example and then add an error and check the result For above example create a code word of 011100101010. Insert and error suppose the word that was received was 011100101110 instead. Then the receiver could calculate which bit was wrong and correct it. The method is to verify each check bit. Write down all the incorrect parity bits. Doing so, you will discover that parity bits 2 and 8 are incorrect. It is not an accident that 2 + 8 = 10, and that bit position 10 is the location of the bad bit. In general, check each parity bit, and add the positions that are wrong, this will give you the location of the bad bit.
  • 33. Error Correction There are various methods used to correct errors.  An obvious and simple one is to just detect the error and then do nothing, assuming that something else will fix it. This method is fine when something else is able to fix the error, but is of no use if there is no something else! _____In computers radiation can cause the gates to change state from time to time. Modern computer memory corrects these errors it is called FEC (Forward Error Control) to differentiate it from ARQ systems.
  • 34. Techniques For Error Control The most common are based on some or all of the following ingredients: Error detection. Techniques and coding of data. Positive acknowledgment. Retransmission after timeout. The source retransmits a frame that has not been acknowledged after a predetermined amount of time. Negative acknowledgment and retransmission. The estimation returns a negative acknowledgment to frames in which an error is detected. The source retransmits such frames.
  • 35. ARQ (Automatic Repeat reQuest) In data communication protocols, it is common to just ignore errors that are received, while acknowledging correct data. If an error is received, the lack of an acknowledgement eventually leads to a retransmission after some timeout period. The effect of ARQ is to turn an unreliable data link into a reliable one This technique is called ARQ (for Automatic Repeat reQuest). Three versions of ARQ have been standardized: Stop-and-wait Go-back-N Selective-reject
  • 36. Stop N Wait ARQ Based on the stop-and-wait flow-control technique The source station transmits a single frame and then must await an acknowledgment (ACK). No other data frames can be sent until the destination station's reply arrives at the source station. Error Control - Two sorts of errors could occur. First, the frame that arrives at the destination could be damaged; the receiver detects this by error detection technique referred to earlier and simply discards the frame. To account for this possibility, the source station is equipped with a timer. After a frame is transmitted, the source station waits for an acknowledgment. If no acknowledgment is received by the time the timer expires, then the same frame is sent again, keeping a copy at transmitter
  • 37. Stop N wait  Second, damaged acknowledgment.  Station A sends to station B, which responds with an acknowledgment (ACK).  The ACK is damaged in transit and is not recognized by A, which eventually ends timer & generate frame  This duplicate frame arrives and is accepted by B, which has therefore accepted two copies of the same frame as if they were separate.  To avoid this problem, frames are alternately labeled with 0 or 1  ACK are of the form ACKO and ACK1.  In keeping with the sliding-window convention, an ACKO acknowledges receipt of a frame numbered 1 and indicates that the receiver is ready for a frame numbered 0.  The sliding-window flow control technique can be adapted to provide more efficient line use.
  • 38. Go back N ARQ The form of error control based on sliding-window flow control In go-back-N ARQ, a station may send a series of frames sequentially numbered The number of unacknowledged frames outstanding is determined by window size, using the sliding-window flow control technique. While no errors occur, the destination will acknowledge (RR = receive ready) If the destination station detects an error in a frame, it sends a negative acknowledgment (REJ = reject) for that frame. The destination station will discard that frame and all future incoming frames until the frame in error is correctly received. Thus, at source station, when it receives an REJ, must retransmit the frame in error plus all succeeding frames that were transmitted in the interim.
  • 39. GO Back N  When A is sending to B the following errors could occur which is called Damaged frame.  There are three sub cases:  A transmits frame i. B detects an error and has previously successfully received frame (i - 1). B sends REJ i, indicated that frame i is rejected.  When A receives the REJ, it must retransmit frame i and all subsequent frames, since the original transmission of i.  Frame i is lost in transit. A subsequently sends frame (i + 1). B receives frame (i + 1) out of order and sends an REJ i  Frame i is lost in transit, and A does not soon send additional frames.  B receives nothing and returns neither an RR nor an REJ.  When A's timer expires, it transmits an RR frame that includes a bit known as the P bit, set to =1  B interprets the RR frame with a P bit of 1 as a command that must be acknowledged by sending an RR indicating the next frame that it expects.  When A receives the RR, it retransmits frame i.
  • 40. Go Back N  Damaged RR. There are two sub cases:  B receives frame i and sends RR (i + I), which is lost in transit.  Because acknowledgments are cumulative (e.g., RR 6 means that all frames  through 5 are acknowledged),  A will receive a subsequent RR to a subsequent frame and that it will arrive before the timer associated with frame i expires.  If A's timer expires, it transmits an RR command as in case of pervious slide. It sets another timer, called the P-bit timer.  If B fails to respond to the RR command, or if its response is damaged, then A's P-bit timer will expire. At this point  A will try again by issuing a new RR command and restarting the P-bit timer.  This procedure is tried for a number of iterations.  If A fails to obtain an Ack after some maximum number of attempts, it initiates a reset procedure.  Damaged REJ. If an REJ is lost, this is equivalent to the case lost in transit
  • 41. Selective-reject ARQ With selective-reject ARQ, the only frames retransmitted are those that receive a negative acknowledgment, in this case called SREJ, or that time-out. This would appear to be more efficient than go-back-N, because it minimizes the amount of retransmission. On the other hand, the receiver must maintain a buffer large enough to save post-SREJ frames until the frame in error is retransmitted and it must contain logic for reinserting that frame in the proper sequence. The transmitter, too, requires more complex logic to be able to send a frame out of sequence. Because of such complications, select-reject ARQ is much less used than go-back- N ARQ. The window-size limitation is more restrictive for selective-reject than for go back- N. Consider the case of a 3-bit sequence-number size for selective-reject.
  • 42. Selective reject  Allow a window size of seven, and consider the following scenario 1. Station A sends frames 0 through 6 to station B. Frame (0,1,2,3,4,5,6,7,0,1,2,3,4,5) 2. Station B receives all seven frames and cumulatively Ack with RR 7. 3. Because of some noise burst, the RR 7 is lost/corrupted 4. A’s times out and retransmits frame 0 - 6. 5. B has already advanced its receive window to accept frames 7,0,1,2,3,4, and 5 6. Thus, B assumes that frame 7 has been lost and that this is a new frame 0,which it accepts.  The problem with this scenario is that there is an overlap between the sending and receiving windows.  To overcome the problem, the maximum window size should be no more than half the range of sequence numbers.  In this above scenario, if only four unacknowledged frames may be outstanding, no confusion can result.  In general, for a k-bit sequence number field, which provides a sequence number range of 2k, the maximum window size is limited to 2k-1.
  • 43. OTHER DATA LINK CONTROL PROTOCOLS In addition to HDLC, there are a number of other important data link control protocols. LAPB LAPD Logical Link Control (LLC) Frame Relay Asynchronous Transfer Mode (ATM)
  • 45. LAPB LAPB (Link Access Procedure, Balanced) was issued by ITU-T as part of its X.25 packet-switching network-interface standard. It is a subset of HDLC that provides only the asynchronous balanced mode (ABM); it is designed for the point-to-point link between a user system and a packet-switching network node. Its frame format is the same as that of HDLC.
  • 46. LAPD LAPD (Link Access Procedure, D-Channel) was issued by ITU-T as part of its set of recommendations on ISDN (Integrated Services Digital Network). LAPD provides data link control over the D channel, which is a logical channel at the user-ISDN interface. There are several key differences between LAPD and HDLC. Like LAPB, LAPD is restricted to ABM. LAPD always uses 7-bit sequence numbers; 3-bit sequence numbers are not allowed. The FCS for LAPD is always the 16-bit CRC. Finally, the address field for LAPD is a 16-bit field that actually contains two sub-addresses:  one is used to identify one of possibly multiple devices on the user side of the interface, and  The other is used to identify one of possibly multiple logical users of LAPD on the user side of the interface.
  • 47. LLC LLC is part of the IEEE 802 family of standards for controlling operation over alocal area network (LAN). LLC is lacking some features found in HDLC and also has some features not found in HDLC. The most obvious difference between LLC and HDLC is the difference in frame format. Link control functions in the case of LLC are actually divided between two layers: A medium access control (MAC) layer, and The LLC layer, which operates on top of the MAC layer.
  • 48. LLC Above Figure shows the structure of the combined MAC/LLC frame; The shaded portion corresponds to the fields produced at the LLC layer. The unshaded portions are the header and trailer of the MAC frame. The MAC layer includes source and destination addresses for devices attached to the LAN. Two addresses are needed as there is no concept of primary and secondary in the LAN environment; therefore, both the sender and receiver must be identified. Error detection is done at the MAC level, using a 32-bit CRC. Finally, there are some control functions peculiar to medium- access control that may be included in a MAC control field.
  • 49. Frame Relay Frame relay is a data link control facility designed to provide a streamlined capability for use over high-speed packet- switched networks. It is used in place of X.25,which consists of both a data link control protocol (LAPB) and a network-layerprotocol (called X.25 packet layer). The data link control protocol defined for frame relay is LAPF (Link Access Procedure for Frame-Mode Bearer Services). There are actually two protocols: a control protocol, which has similar features to HDLC, and a core protocol, which is a subset of the control protocol. There are several key differences between the LAPF control protocol and HDLC.
  • 50. Asynchronous Transfer Mode (ATM) Like frame relay, ATM is designed to provide a streamlined data-transfer capability across high- speed networks. Unlike frame relay, ATM is not based on HDLC. Instead, ATM is based on a completely new frame format, known as a cell, that provides minimum processing overhead.