lecture3logicallinklayer__2014_08_22_07_26_57.pptx
Post on 02-Jun-2018
214 Views
Preview:
TRANSCRIPT
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 1/108
Logical Link Layer
Prof. Hemang Kothari
Assistant Professor
Computer Engineering DepartmentMEFGI, Rajkot.
Email: hemang.kothari@marwadieducation.edu.in
Slide Share: http://www.slideshare.net/hemangkoth
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 2/108
Function Provided By Logical Link La
•
Provide service interface to the network layer• Dealing with transmission errors
• Regulating data flow
– Slow receivers not swamped by fast senders
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 3/108
Content
•
Design Issue1. Framing.
2. Error control.
3. Flow control.
4. Error detection and correction.
• Elementary data link protocols: Simplex, Stop a
Sliding window protocol, HDLC.
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 4/108
Framing Methods
• Character Count.
• Starting & Ending Bytes (FLAG) With Byte Stuffi
• Starting & Ending Bit Pattern (Flag) With Bit Stu
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 5/108
Character Count - Framing
• This method specifies the number of characters
present in particular frame.
• This information is specified by using a special fi
header frame.
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 6/108
A character stream. (a) Without errors. (b) With on
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 7/108
Byte Stuffing – Framing
(a) A frame delimited by flag bytes.
(b) Four examples of byte sequences before and after stuffing.
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 8/108
Bit Stuffing
Bit stuffing
(a) The original data.
(b) The data as they appear on the line.
(c) The data as they are stored in receiver’s memory after d
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 9/108
Review
• In a data link protocol, the frame delimiter flag is give
0111. Assuming that bit stuffing is employed, the tran
sends the data sequence 01110110 as
(A) 01101011
(B) 011010110
(C) 011101100
(D) 0110101100
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 10/108
Review
• The following data fragment occurs in the middle of a
stream for which the bytestuffing algorithm describe
text is used: A B ESC C ESC FLAG FLAG D. What is the
after stuffing?
• Answer : A B ESC ESC C ESC ESC ESC FLAG ESC FLAG D
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 11/108
Review
• A bit string, 0111101111101111110, needs to be tran
at the data link layer. What is the string actually trans
after bit stuffing?
• Answer: The output is 011110111110011111010.
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 12/108
Flow Control & Error Control
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 13/108
Flow Control
• Flow control coordinates the amount of data that ca
before receiving acknowledgement
• Flow control is a set of procedures that tells the se
much data it can transmit before it must wa
acknowledgement from the receiver.
• Receiver has a limited speed at which it can process
data and a limited amount of memory in which
incoming data.
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 14/108
Flow Control
• Receiver must inform the sender before the limits ar
and request that the transmitter to send fewer fram
temporarily.
• Since the rate of processing is often slower than t
transmission, receiver has a block of memory (b
storing incoming data until they are processed.
Feedback is the breakfast of champions – Ken Blanch
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 15/108
Error Control
• Error control includes both error detection – corre
notification about error.
• It allows the receiver to inform the sender if a fram
damaged during transmission and coordin
retransmission of those frames by the sender.
• Error control in the data link layer is based on autom
request (ARQ). Whenever an error is detected,
frames are retransmitted.
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 16/108
Error and Flow Control Mechanism
• Stop-and-Wait
• Go-Back-N ARQ
• Selective-Repeat ARQ
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 17/108
Stop and Wait• Sender keeps a copy of the last f
receives an acknowledgement.
• For identification, both data acknowledgements (ACK) frames aalternatively 0 and 1.
• Sender has a control variable (S) tnumber of the recently sent frame.
• Receiver has a control variable (R) tnumber of the next frame expected
• Sender starts a timer when it sendan ACK is not received within a aperiod, the sender assumes that thlost or damaged and resends it
• Receiver send only positive ACK ifintact.
• ACK number always defines the nunext expected frame.
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 18/108
Stop-and-Wait ARQ, Corrupt fram
•
When a receivdamaged fram
it and keeps its
• After the tim
sender expir
copy of frame
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 19/108
Stop-and-Wait, lost ACK frame
• If the sender
damaged ACK, it
• When the tim
sender expires,
retransmits fram
• Receiver has
received framexpecting to rece
(R=0). Therefore
the second copy
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 20/108
Stop-and-Wait, delayed ACK frame
• The ACK can bethe receiver some problem
• It is receivedtimer for fraexpired.
• Sender retrancopy of frame 0
R =1 meanexpects to seeReceiver discduplicate frame
• Sender receivediscards the se
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 21/108
Disadvantage of Stop-and-Wait
• In stop-and-wait, at any point in time, there is only on
that is sent and waiting to be acknowledged.
• This is not a good use of transmission medium.
• To improve efficiency, multiple frames should be in tr
while waiting for ACK.
• Two protocol use the above concept,
– Go-Back-N ARQ
– Selective Repeat ARQ
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 22/108
Mathematical Review of Stop & Wa
• The Stop and Wait protocol is executed on a 10km wir
your modem and your ISPs edge router. The propagatioan electrical signal on the wire is 200,000 km/sec. The is 1000 bytes. The time to generate an acknowledgemreceiver is 4 microseconds. The channel capacity is (Mbps = megabit per second).
a) What is the propagation delay on the wire?
b) What is the packet transmission delay?
c) What is the maximum efficiency of the protocol maximum percentage of time is your modem actuadata)?
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 23/108
Mathematical Review of Stop & Wa
• What is the propagation delay on the wire?
• Answer: 50 microseconds, or 0.00005 seconds – Prop
delay is equal to the distance that the data must trav
by the speed that data travels on the wire, which in t
turns out to be 10 km / 200000 km/sec.
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 24/108
Mathematical Review of Stop & Wa
• What is the packet transmission delay?
• Answer: 80 microseconds, or 0.00008 seconds – Tran
delay is equal to the packet size divided by the chann
capacity, which in this case turns out to be (1000 * 8)
100,000,000. A common mistake was to forget to mu
packet size by 8 because it is in bytes not bits, and als
100 Mbps is equivalent to 100,000,000 bits per secon
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 25/108
Mathematical Review of Stop & Wa
• What is the maximum efficiency of the protocol (i.e., wh
maximum percentage of time is your modem actually sedata)?
• Answer: 43.48% - The time that the modem is actually seis equivalent to the packet transmission delay. The consists of the transmission delay at the modempropagation delay to get to the receiver plus the time create an acknowledgement plus the propagation delay to the sender.
• so we are left with the equation T / (T + 2P + Ack) = ((0.00008 + 2 * 0.00005 + 0.000004).
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 26/108
Sliding Window Protocols
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 27/108
Sliding Window
Sender
• Maintain sequence number of frames it is permitted to sSending window
Receiver
•
Maintain sequence number of frames it is expected to aReceiver window
Sliding window protocol allow us to send multiple packet
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 28/108
Go Back ARQ
• We can send up to W frames before worrying about ACK
• We keep a copy of these frames until the ACKs arrive.
• This procedure requires additional features to be added and-Wait ARQ.
– Frames from a sender are numbered sequentially.
– We need to set a limit since we need to include the sequence neach frame in the header.
– If the header of the frame allows m bits for sequence number,sequence numbers range from 0 to 2 m – 1. for m = 3, sequencare: 0,1, 2, 3, 4, 5, 6, 7.
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 29/108
Sender Sliding Window – Go Back A
• At the sending side, to hold the outstanding frames unt
acknowledged, we use the concept of a window.
• The size of the window is at most 2m -1 where m is the number o
sequence number.
• The window slides to include new unsent frames when the corr
received
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 30/108
Receiver Sliding Window – Go Back A
• Size of the window at the receiving site is always 1 in this pro
• Receiver is always looking for a specific frame to arrive in a sp
order.
• Any frame arriving out of order is discarded and needs to be
Receiver is waiting for frame 0 in part a.
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 31/108
Acknowledgement• Receiver sends positive ACK if a frame arrived safe and in order
• If the frames are damaged/out of order, receiver is silent and d
subsequent frames until it receives the one it is expecting.• The silence of the receiver causes the timer of the unacknowle
expire.
• Then the sender resends all frames, beginning with the one wittimer.
•
For example, suppose the sender has sent frame 6, but the timexpires (i.e. frame 3 has not been acknowledged), then the senand sends frames 3, 4, 5, 6 again. Thus it is called Go-Back-N-A
• The receiver does not have to acknowledge each frame receiveone cumulative ACK for several frames.
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 32/108
Go-Back-N ARQ, normal operation
• The sender keeps track of the outstanding frames and updat
variables and windows as the ACKs arrive.
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 33/108
Go-Back-N ARQ, lost frame• Frame 2
• When th
receives
discards
expectin
(accordi
• After the
frame 2
sender s
sends fr(go back
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 34/108
Go-Back-N ARQ, damaged/lost/delayed ACK
• If an ACK is damaged/lost, we can have two situations:
•
If the next ACK arrives before the expiration of any timer, therneed for retransmission of frames because ACKs are cumulativ
protocol.
• If ACK1, ACK2, and ACk3 are lost, ACK4 covers them if it arrive
the timer expires.
• If ACK4 arrives after time-out, the last frame and all the framethat are resent.
• Receiver never resends an ACK (i.e. no timer is maintain for AC
• A delayed ACK also triggers the resending of frames.
Go Back N ARQ sender window size
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 35/108
Go-Back-N ARQ, sender window size
• Size of the sender window must be less than 2 m. Size of the receiver is a
window size = 2 m – 1 = 3.
• Fig compares a window size of 3 and 4.
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 36/108
Selective Repeat ARQ
l l f
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 37/108
Selective Repeat ARQ, lost frame • Fra
acc
rec
are
spe
rec
for
• Re
to
ha
an
res
an
is iwin
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 38/108
I n Selective Repeat ARQ, the size of the send
receiver window must be at most one-half o
Selective Repeat ARQ sender window size
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 39/108
Selective Repeat ARQ, sender window size
• Size of the sender and receiver windows must be at most one-half of 2 m. If m = 2, windo
2 m /2 = 2. Fig compares a window size of 2 with a window size of 3. Window size is 3 and
sender sends duplicate of frame 0, window of the receiver expect to receive frame 0 (par
so accepts frame 0, as the 1st frame of the next cycle – an error.
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 40/108
Review
• Frames of 1000 bits are sent over a 1 Mbps satellite
propagation delay of 270 msec. Acknowledgements
piggybacked onto data frames.. Headers are very sh
bit sequence numbers are used. What is the
achievable channel utilization in frames per sec for
(a) stop-and-wait protocol
(b) protocol with go-back-n
(c) protocol with selective-repeat ?
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 41/108
Piggybacking
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 42/108
Solution
• Let t = 0 denote the start of transmission. At t = 1 mse
first frame has been fully transmitted. At t = 271 mseframe has fully arrived.
• At t = 272 msec, the frame acknowledging the first onbeen fully sent.
•
At t = 542 msec, the acknowledgement-bearing framarrived.
• Thus, the cycle is 542 msec. A total of k frames are semsec, for an efficiency of k/542.
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 43/108
Approx Solution
(a) k = 1, efficiency = 1/542 = 0.18%
(b) k = 7, efficiency = 7/542 = 1.29%
(c) k = 4, efficiency = 4/542 = 0.74%
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 44/108
Precise Solution
A. Channel utilization is 1 frame in 542 msec = 1
frames per sec
B. Pipeline 7 frames (3 bit seq number) with rou
548 msec giving channel utilization 7/548 = 1
frames per secC. pipeline 4 frames ( window size is sequence-s
in 545 msec giving channel utilization 4/545 =
frames per sec
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 45/108
Error Detection & Correction
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 46/108
Motivation
• Networks must be able to transfer data from one
another with complete accuracy.
• Data can be corrupted during transmission.
• For reliable communication, errors must be dete
corrected
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 47/108
Types of Error
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 48/108
Single Bit Error
Multiple Bits Error
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 49/108
Observation
• Single bit errors are the least likely type of errors in
transmission because the noise must have a vduration which is very rare. However this kind of happen in parallel transmission.
Example:
•
If data is sent at 1Mbps then each bit lasts only 1/1,0sec. or 1 μs.
• For a single-bit error to occur, the noise must have a dof only 1 μs, which is very rare.
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 50/108
Burst Error
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 51/108
Observation
• Burst error is most likely to happen in serial transmissio
duration of noise is normally longer than the duration of• The number of bits affected depends on the data rate an
of noise.
Example:
• If data is sent at rate = 1Kbps then a noise of 1/100 sec ca10 bits.(1/100*1000)
• If same data is sent at rate = 1Mbps then a noise of 1/10affect 10,000 bits.(1/100*106)
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 52/108
Error Detection
• Error detection means to decide whether the receive
correct or not without having a copy of the original m
• Error detection uses the concept of redundancy, whic
adding extra bits for detecting errors at the destinatio
To detect error you require some extra knowled
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 53/108
Redundancy
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 54/108
Error Detection Schemes
• Single Parity Check
• Two-Dimensional Parity Check
• Cyclic Redundancy Check
• Check Sum
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 55/108
Single Parity Check - VRC
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 56/108
Even Parity
• Add a parity bit to 7 bits of data to make an eve
of 1’s
• 0110100
• 1011010
• How many bits of error can be detected by a pa
• What’s the overhead?
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 57/108
Performance
• It can detect single bit error
• It can detect burst errors only if the total numb
errors is odd.
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 58/108
Two Dimension Parity Check
• Add one extra bit to a 7-bit code such
that the number of 1’s in the resulting 8bits is even (for even parity, and odd for
odd parity)
• Add a parity byte for the packet
• Example: five 7-bit character packet,even parity
0110100
1011010
0010110
1110101
1001011
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 59/108
Two Dimension Parity Check
0110100 1
1011010 0
0010110 1
1110101 1
1001011 0
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 60/108
Two Dimension Parity Check – Parity
0110100 1
1011010 0
0010110 1
1110101 1
1001011 0
___________________
1000110 1
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 61/108
All 1 Bit Error Will Be Detected
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 62/108
All 2 bit Error will be detected
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 63/108
Exceptional Case – Error Undetecte
0110100
1011010
0000111
1100100
1001011
_________________
1000110
0110100 1
1011010 0
0010110 1
1110101 1
1001011 0
___________________
1000110 1
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 64/108
Performance Summary
• If two bits in one data units are damaged and tw
exactly the same positions in another data unitdamaged, the 2-D checker will not detect an error.
• It can detect multiple bit and burst errors.
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 65/108
Review
• Assuming even parity, find the parity bit for ea
following data units.
a. 1001011
b. 0001100
c. 1000000d. 1110111
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 66/108
Review
• Suppose the information content of a packet is the b
1110 1011 1001 1101 and an even parity schemused. What would the value of the field containing
bits for the case of a two-dimensional parity sche
the input data should be represented by 4X4 2D array
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 67/108
Cyclic Redundancy Check
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 68/108
Cyclic Redundancy Check
• Given a k-bit frame or message, the transmitter gen
n-bit sequence, known as a frame check sequencethat the resulting frame, consisting of (k+n) bits,
divisible by some predetermined number.
• The receiver then divides the incoming frame by
number and, if there is no remainder, assumes that no error.
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 69/108
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 70/108
With & Without Error
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 71/108
Review - CRC
• Consider the following message M=1010001101. The
this message using the divisor polynomial x5 + x4 + x2
A. 01110
B. 01011
C. 10101
D. 10110
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 72/108
Example of Polynomial to Binary Fo
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 73/108
Review - CRC
GTU – 2012 / May
• Show the calculation polynomial code checksum for a
1101011011 using the generator x4 + x + 1
Check Sum
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 74/108
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 75/108
Check Sum
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 76/108
At Sender - Checksum
• The unit is divided into k sections, each of
• All sections are added together usin
complement to get the sum.
• The sum is complemented and becom
checksum.
• The checksum is sent with the data
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 77/108
At Receiver - Checksum
• The unit is divided into k sections, each of
• All sections are added together usin
complement to get the sum.
• The sum is complemented.
• If the result is zero, the data are a
otherwise, they are rejected.
Internet Checksum Example
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 78/108
Internet Checksum Example
• Note
–
When adding numbers, a carryout from the most significanneeds to be added to the result
• Example: add two 16-bit integers
1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0
1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1
1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 0
1 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1
Wraparound
Sum
Checksum
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 79/108
Review
• You are using the IP (Internet Protocol) Checksum for
Detection. Only, you do it based on 8 bit words, not 1in the real Internet. You must send the message 0011
1010 0101 1001.
• Show what sender does to create the checksum.
• Show what receiver does to verify no error occurs.
d k
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 80/108
Answer – Sender Work
1. Add zeros to get an integer number times 8 bits:
0011 1100
1010 0101
1001 0000
2. Add the three 8-bit ``words'' using one's complemen
0111 0010 .3. Take one's complement: 1000 1101 . That is the che
A i W k
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 81/108
Answer – Receiver Work
• The destination adds the four words
1000 1101
0011 1100
1010 0101
1001 0000
• Using (one's compl) and checks that the result is 1111and complement it gives 0000 0000. i.e. No Error
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 82/108
T f E C i
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 83/108
Types of Error Correction
• One is when an error is discovered; the receiver can
sender retransmit the entire data unit. This is backward error correction.
• In the other, receiver can use an error-correcting co
automatically corrects certain errors. This is known a
error correction.
E C i C
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 84/108
Error Correction Concept
• For correcting an error one has to know the exact p
error, i.e. exactly which bit is in error (to locate the in• For example, to correct a single-bit error in an ASCII
the error correction must determine which one of
bits is in error. To do this, we have to add some
redundant bits.• To calculate the numbers of redundant bits (r) re
correct d data bits. We use this relation 2r >= d + r +
H i C d B d E C t
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 85/108
Hamming Code Based - Error Correct
R d d t Bit C l l ti
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 86/108
Redundant Bit Calculation
R d d t Bit C l l ti
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 87/108
Redundant Bit Calculation
Example of Hamming Code Correcti
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 88/108
Example of Hamming Code Correcti
Si l Bit E O d
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 89/108
Single Bit Error Occurred
Error Detection & Correction
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 90/108
Error Detection & Correction
R i
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 91/108
Review
• Let us consider an example for 7-bit data. Assume t
transmission bit 5 has been changed from 1 to 0 asFigure. Find redundant bit and correct error.
Review
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 92/108
Review
• Sixteen-bit messages are transmitted using a Hammin
How many check bits are needed to ensure that the rcan detect and correct single-bit errors?
• Show the bit pattern transmitted for the message
• Assume that even parity is used in the Hamming code
Answer
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 93/108
Answer
• Parity bits are needed at positions 1, 2, 4, 8, and 16, s
messages that do not extend beyond bit 31 (includingparity bits) fit. Thus, 5 parity bits are sufficient.
• The bit pattern transmitted is 0110101100110011101
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 94/108
Extra Topics
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 95/108
High Level Data Link Control Protoc
HDLC Basic
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 96/108
HDLC Basic
• HDLC is a bit-oriented protocol.
•It specifies a packitization standard for serial links.
• It has been so widely implemented because it supportsduplex and full-duplex communication lines, point-to-to peer) and multi-point networks, and switched or nochannels.
• HDLC supports several modes of operation, includinsliding-window mode for reliable delivery. Since Internretransmission at higher levels (i.e., TCP), mosapplications use HDLC's unreliable delivery mode.
HDLC Stations and Configuration
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 97/108
HDLC Stations and Configuration
• Primary & Secondary Station: Primary has the respocontrolling all other stations on the link (usually stations).
• A primary issues commands and secondary issues Despite this important aspect of being on the link, tstation is also responsible for the organization of data flink.
• The secondary station is under the control of the primarhas no ability, or direct responsibility for controlling thonly activated when requested by the primary station.
• A combined station is a combination of a primary andstation.
HDLC Configuration
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 98/108
HDLC Configuration
• HDLC also defines three types of configurations for
types of stations. The word configuration referelationship between the hardware devices on a link.
• Following are the three configurations defined by HD
– Unbalanced Configuration
– Balanced Configuration – Symmetrical Configuration
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 99/108
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 100/108
HDLC Operation Modes
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 101/108
HDLC Operation Modes
• A mode in HDLC is the relationship between tw
involved in an exchange; the mode describes who colink. HDLC offers three different modes of operati
three modes of operations are:
– Normal Response Mode (NRM)
– Asynchronous Response Mode (ARM) – Asynchronous Balanced Mode (ABM)
Summary of Modes
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 102/108
Summary of Modes
HDLC Frames Types – I frame
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 103/108
HDLC Frames Types – I frame
• The function of the information command and
frame is to transfer sequentially numbered fram
containing an information field, across the data link.
HDLC Frames Types – S frame
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 104/108
HDLC Frames Types – S frame
• Supervisory (S) commands and responses frames are
perform numbered supervisory functions su
acknowledgment, polling, temporary suspension of inf
transfer, or error recovery. Frames with the S forma
field cannot contain an information field.
HDLC Frames Types – U frame
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 105/108
HDLC Frames Types – U frame
• The unnumbered format commands and responses fr
used to extend the number of data link control funct
unnumbered format frames have 5 modifier bits, wh
for up to 32 additional commands and 32 additional
functions.
Control Field of Frame
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 106/108
Control Field of Frame
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 107/108
Thank You
8/10/2019 Lecture3LogicalLinkLayer__2014_08_22_07_26_57.pptx
http://slidepdf.com/reader/full/lecture3logicallinklayer20140822072657pptx 108/108
top related