SlideShare a Scribd company logo
1
1
1
1 tohttps://github.com/syaifulahdan/
DATA COMMUNICATION
Error Control and Data Link Control
Data Communications and Networking
 Data Link Layer
 Framing
 Error Detection : Types of Error
 Parity Check
 Cyclic Redudancy Check
 Error Correction Prosess Diagram
 LIne Configuration
 Traditional Configuration
 Flow Control
 Model of Frame Transmission
Reading:
Book Chapter 7
Data and Computer Communications, 8th edition
By William Stallings
 Stop and Wait Flow Control
 Performance of Stop and Wait
 Stopand Wait Link Utilization
 Sliding WIndow Flow Control
 Sliding WIndow Diagram
 Example Sliding WIndow
 Performance of Sliding Window
 Error Control
 Automatic Repeat Request (ARQ)
 Stop and Wait (ARQ)
 Stop and Wait Diagram
 Go Back N (ARQ)
 Go Back N Damaged F
 Go Back N Lost Frame
 Go Back N Damage RR
 Go Back N Damage REJ
 Go Back N Diagram
 Selective Reject ARQ
 Selective Reject Diagram
 High Level Datalink Control
 Frame Structure
Data Communications and
Networking
Chapter 7
Error Control and Data Link Control
References:
Book Chapter 6 and 7
Data and Computer Communications, 8th edition,
by William Stallings
3
3
3
3 tohttps://github.com/syaifulahdan/ 3
Data Link Layer
• Objective:
— Achieving reliable communication between two adjacent machines
• Design Issues:
— Framing: data are sent in blocks called frames, the beginning and
end of each frame must be recognized by the receiver.
— Error control: bit errors introduced by the transmission system
should be detected and/or corrected.
— Flow control: the sending station must not send frames at a rate
faster than the receiving station can absorb them.
— Addressing: on a multipoint line, such as a LAN, the identity of the
two stations involved in a transmission must be specified.
— Transmit control information and data on the same line
4
4
4
4 tohttps://github.com/syaifulahdan/ 4
Framing
• Large block of data may be broken up into
small frames at the source because:
—limited buffer size at the receiver
—A larger block of data has higher probability of
error
• With smaller frames, errors are detected sooner, and only
a smaller amount of data needs to be retransmitted
—On a shared medium, such as Ethernet and
Wireless LAN, small frame size can prevent one
station from occupying medium for long periods
5
5
5
5 tohttps://github.com/syaifulahdan/ 5
Framing
• Need to indicate the start and end of a block of data
• Use preamble (e.g., flag byte) and postamble
• If the receiver ever loses synchronization, it can just search for
the flag byte.
• Frame: preamble + control info + data + postamble
• Problem: it is possible that the flag byte’s bit pattern occur in the
data
• Two popular solutions:
— Byte stuffing
• The sender inserts a special byte (e.g., ESC) just before each “accidental”
flag byte in the data (like in C language, “ is replaced with ”).
• The receiver’s link layer removes this special byte before the data are
given to the network layer.
— Bit stuffing: each frame starts with a flag byte “01111110”.
• Whenever the sender encounters five consecutive 1s in the data, it
automatically stuffs a 0 bit into the outgoing bit stream.
• When the receiver sees five consecutive incoming 1 bits, followed by a 0
bit, it automatically deletes the 0 bit.
6
6
6
6 tohttps://github.com/syaifulahdan/ 6
Byte Stuffing
Four examples of byte sequences before and after byte stuffing
7
7
7
7 tohttps://github.com/syaifulahdan/ 7
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 the receiver’s memory after destuffing.
8
8
8
8 tohttps://github.com/syaifulahdan/ 8
Error Detection: Types of Error
• An error occurs when a bit is altered between transmission and
reception
• Single bit errors
— One bit is altered
— Adjacent bits are not affected
— Can occur in the presence of white noise (thermal noise)
• Burst errors
— A cluster of bits with Length B
— the first and the last and a number of intermediate bits in error
(not necessarily all the bits in the cluster suffer an error)
— More common and more difficult to deal with
— Can be caused by impulse noise
9
9
9
9 tohttps://github.com/syaifulahdan/ 9
Error Detection Process
• Additional bits are added by transmitter
for error detection (called error-detecting
codes, or check bits, or checksum)
• Can be used in different network
layers
10
10
10
10 tohttps://github.com/syaifulahdan/ 10
Parity Check
• Append a parity bit to the end of a block of
data
• Value of parity bit is such that the new data
has even (even parity) or odd (odd parity)
number of ones
—E.g., original data 1110001 -> 11100011 (odd
parity)
• Even number of bit errors goes undetected
—E.g., 11100011 -> 11010011 (undetected!)
11
11
11
11 tohttps://github.com/syaifulahdan/ 11
Cyclic Redundancy Check
• For a block of k bits, transmitter generates an
(n-k)-bit sequence called Frame Check
Sequence (FCS)
• The resulting frame consisting of n bits is
exactly divisible by some predetermined
number.
• Receiver divides the incoming frame by the
predetermined number:
—If no remainder, assume no error
12
12
12
12 tohttps://github.com/syaifulahdan/ 12
Cyclic Redundancy Check
• Modulo 2 arithmetic
—Binary addition with no carries
—Binary subtraction with no carries
—The same as XOR operation
1111 + 1010 = 0101
1111 − 0101 =
1010
1010 + 1010 = 0000
13
13
13
13 tohttps://github.com/syaifulahdan/ 13
Cyclic Redundancy Check
• Define:
— T = n-bit frame to be transmitted
— D = k-bit block of data: the first k bits of T
— F = (n-k)-bit FCS: the last (n-k) bits of T
— P = pattern of (n-k+1) bits: the predetermined
divisor
• T = 2n-kD + F
• We want T/P to have no remainder.
• Problem: Given D and P, how to calculate F ?
14
14
14
14 tohttps://github.com/syaifulahdan/ 14
Cyclic Redundancy Check
P
R
Q
P
Dkn
2
quotient
remainder
Step 1:
Step 2: F = R
Verification:
Q
P
R
P
R
Q
P
R
P
D
P
RD
P
T
RDT
knkn
kn
22
2
Problem: Given D and P, how to calculate F ?
15
15
15
15 tohttps://github.com/syaifulahdan/ 15
Cyclic Redundancy Check
• Example:
—Given D = 1010001101 (10 bits)
— P = 110101 (6 bits)
—Then n = 15, k = 10, (n-k) = 5
—Multiple D by 25, yielding 101000110100000
—Divide it by P: remainder R = 01110
—Transmit D+R to the receiver: 101000110101110
—The receiver divide it by P, if no remainder, there
is no error.
16
16
16
16 tohttps://github.com/syaifulahdan/ 16
Cyclic Redundancy Check
• By choosing different P, CRC can detect
different types of errors:
—All single-bit errors if P has more than one
nonzero item
—All double-bit errors if P is a primitive polynomial
—Any odd number of errors if P contain factor 11
—……
17
17
17
17 tohttps://github.com/syaifulahdan/ 17
Error Correction
• Retransmission: correction of detected errors usually
requires data block to be retransmitted
—Retransmission may not be appropriate for some wireless
applications
• Bit error rate in wireless network is high
• Result in lots of retransmissions
—Propagation delay can be long (satellite) compared with
frame transmission time
• Result in retransmission of frame in error plus many subsequent
frames (back to this issue in next chapter)
• It would be desirable to enable the receiver to
correct errors in an incoming transmission on the
basis of the bits in that transmission.
• FEC: forward error correction
18
18
18
18 tohttps://github.com/syaifulahdan/ 18
Error Correction Process
Diagram
19
19
19
19 tohttps://github.com/syaifulahdan/ 19
Line Configuration
• Link Topology
—Physical arrangement of stations on the medium (link)
—Link has two stations: a point-to-point link
—More than two stations: a multipoint link
• local area network, satellite
• Half duplex
—Of two stations, only one station may transmit at a time
—Requires one data path
• Full duplex
—Simultaneous transmission and reception between two
stations
—Digital signaling: requires two data paths (e.g., two twisted
pairs)
—Analog signaling: can use different frequencies
20
20
20
20 tohttps://github.com/syaifulahdan/ 20
Traditional Configurations
21
21
21
21 tohttps://github.com/syaifulahdan/ 21
Flow Control
• Ensuring the sending entity does not overwhelm the
receiving entity
—Preventing buffer overflow
• Transmission time
—Time taken to emit all bits into medium at the sender’s side
—Determined by the data rate
• Propagation time
—Time for a bit to traverse the link and reach the destination
—Determined by the transmission distance
• We first assume error-free transmission.
22
22
22
22 tohttps://github.com/syaifulahdan/ 22
Model of Frame Transmission
23
23
23
23 tohttps://github.com/syaifulahdan/ 23
Stop-and-Wait Flow Control
• Source transmits a frame.
• Destination receives the frame, and replies
with a small frame called acknowledgement
(ACK).
• Source waits for the ACK before sending the
next frame.
—This is the core of the protocol !
• Destination can stop the flow by not sending
ACK (e.g., if the destination is busy …).
24
24
24
24 tohttps://github.com/syaifulahdan/ 24
Performance of Stop-and-Wait
• Assumptions
—Transmission time of the data frame is 1
—Transmission time of the ACK frame is 0
—Propagation time is a
• a is the ratio of propagation time over transmission time
—Error-free transmission
• The channel utilization ratio is 1/(1+2a)
—In a time period of 1+2a, the transmitter is only busy with 1
unit of time.
• It is not efficient for long haul transmission and high
speed transmission.
—Another type of protocol called “sliding-window” is
designed for this situation.
25
25
25
25 tohttps://github.com/syaifulahdan/ 25
Stop-and-Wait Link Utilization
26
26
26
26 tohttps://github.com/syaifulahdan/ 26
Sliding-Window Flow Control
• Idea: allow multiple frames to transmit
—Receiver has a buffer of W frames
—Transmitter can send up to W frames without
receiving ACK
• Each frame needs to be numbered: sequence
number is included in the frame header
—Sequence number is bounded by the length of
“sequence number field” in the header, e.g., k
bits
• Frames are numbered modulo 2k
• ACK includes the sequence number of the
next expected frame by the receiver
27
27
27
27 tohttps://github.com/syaifulahdan/ 27
Sliding-Window Diagram
Need to buffer
them in case of
retransmission
28
28
28
28 tohttps://github.com/syaifulahdan/ 28
Example Sliding-Window
Have been
delivered to upper
layer
More spaces for
future frames
RR3 means the receiver has
received all frames up to frame 2
and is ready to receive frame 3.
29
29
29
29 tohttps://github.com/syaifulahdan/ 29
Performance of Sliding-Window
• Assumptions
—Window size is W
—Frame transmission time is 1
—ACK transmission time is 0
—Propagation time is a
—Error-free transmission
• The channel utilization ratio is
1 2 1
2 1
2 1
W a
U W
W a
a
30
30
30
30 tohttps://github.com/syaifulahdan/ 30
Performance of Sliding-Window
≥
31
31
31
31 tohttps://github.com/syaifulahdan/ 31
Performance of Sliding-Window
32
32
32
32 tohttps://github.com/syaifulahdan/ 32
Error Control
• Error control: detection and correction of errors
• We consider two types of errors:
— Lost frames
• The receiver cannot recognize that this is a frame.
— Damaged frames
• The receiver can recognize the frame, but some bits are in error.
• Two approaches for error control
— ARQ: automatic repeat request, based on some or all of the
following ingredients:
• Error detection
• Positive acknowledgment
• Retransmission after timeout
• Negative acknowledgement and retransmission
— FEC: forward error correction
33
33
33
33 tohttps://github.com/syaifulahdan/ 33
Automatic Repeat Request
(ARQ)
• The effect of ARQ is to turn an unreliable
data link into a reliable one.
• Three versions of ARQ:
—Stop-and-wait
—Go-back-N
—Selective-reject (or, selective repeat)
34
34
34
34 tohttps://github.com/syaifulahdan/ 34
Stop-and-Wait ARQ
• Based on stop-and-wait flow control
• The source station is equipped with a timer.
• Source transmits a single frame, and waits for an ACK
• If the frame is lost…
— The timer eventually fires, and the source retransmits the frame.
• If receiver receives a damaged frame, discard it
— The timer eventually fires, and the source retransmits the frame.
• If everything goes right, but the ACK is damaged or lost, the
source will not recognize it
— The timer eventually fires, the source will retransmit the frame
— Receiver gets two copies of the same frame!
— Solution: use sequence numbers, 1 bit is enough, i.e., frame0 and
frame1, ACK0 and ACK1
35
35
35
35 tohttps://github.com/syaifulahdan/ 35
Stop-and-Wait
Diagram
Simple, but inefficient for
long distance and high
speed applications.
We can use sliding-window
technique to improve the
efficiency.
36
36
36
36 tohttps://github.com/syaifulahdan/ 36
Go-Back-N ARQ
• Based on sliding-window flow control
• Use window size to control the number of unacknowledged
frames outstanding
• If no error, the destination will send ACK as usual with next
frame expected (positive ACK, RR: receive ready)
• If error, the destination will reply with rejection (negative ACK,
REJ: reject)
— Receiver discards that frame and all future frames, until the
erroneous frame is received correctly.
— Source must go back and retransmit that frame and all succeeding
frames that were transmitted in the interim.
— This makes the receiver simple, but decreases the efficiency
37
37
37
37 tohttps://github.com/syaifulahdan/ 37
Go-Back-N: Damaged Frame
• Suppose A is sending frames to B. After each
transmission, A sets a timer for the frame.
• In Go-Back-N ARQ, if the receiver detects
error in frame i
—Receiver discards the frame, and sends REJ-i
—Source gets REJ-i
—Source retransmits frame i and all subsequent
frames
38
38
38
38 tohttps://github.com/syaifulahdan/ 38
Go-Back-N: Lost Frame (1)
• Assume receiver has received frame i-1. If
frame i is lost
—Source subsequently sends i+1
• Receiver gets frame i+1 out of order
—At data link layer, this means the lost of a frame!
• Receiver sends REJ-i
• Source gets REJ-i, and so goes back to frame
i and retransmits frame i, i+1, …
39
39
39
39 tohttps://github.com/syaifulahdan/ 39
Go-Back-N: Lost Frame (2)
• Assume receiver has received frame i-1
• Frame i is lost and no additional frame is sent
• Receiver gets nothing and returns neither
acknowledgement nor rejection
• Source times out and sends a request to
receiver asking for instructions
• Receiver responses with RR frame, including
the number of the next frame it expects, i.e.,
frame i
• Source then retransmits frame i
40
40
40
40 tohttps://github.com/syaifulahdan/ 40
Go-Back-N: Damaged RR
• Receiver gets frame i and sends RR-(i+1)
which is lost or damaged
• Acknowledgements are cumulative, so the
next acknowledgement, i.e., RR-(i+n) may
arrive before the source times out on frame i
• If source times out, it sends a request to
receiver asking for instructions, just like the
previous example
41
41
41
41 tohttps://github.com/syaifulahdan/ 41
Go-Back-N: Damaged REJ
• It is equivalent to the case of lost frame (2).
• Source times out and sends a request to
receiver asking for instructions
• Receiver responses with RR frame, including
the number of the next frame it expects
• Source then retransmits
42
42
42
42 tohttps://github.com/syaifulahdan/ 42
Go-Back-N
Diagram
Remark:
RR(P bit = 1) is a special RR which
is used by the source to ask for
instructions.
For a k-bit sequence number, the
window size can be at most 2k-1,
otherwise RR 0 is ambiguous (e.g.,
first sends frame 0 and gets back an
RR1, and then sends frames
1,…,7,0, and gets another RR1).
43
43
43
43 tohttps://github.com/syaifulahdan/ 43
Selective-Reject ARQ
• Also called selective repeat
• Pros:
—Only rejected frames are retransmitted
—Subsequent frames are accepted by the receiver
and buffered
—Minimizes the amount of retransmissions
• Cons:
—Receiver must maintain large enough buffer, and
must contain logic for reinserting the retransmitted
frame in the proper sequence
—Also more complex logic in the source
44
44
44
44 tohttps://github.com/syaifulahdan/ 44
Selective Reject -
Diagram
Remark:
For a k-bit sequence number, the window size
can be at most 2k-1, because the sending and
receiving windows overlap.
Assume k=3, and window size is 5.
1. A sends frames 0, 1, …, 4 to B.
2. B receives all 5 frames, and cumulatively
acknowledges with RR5.
3. RR5 is lost.
4. A times out, and retransmits frame 0.
5. B is expecting a new set of frames 5, 6, 7,
0, 1. So it will accept the retransmitted frame
0 and regard it as a new frame, which is
wrong.
45
45
45
45 tohttps://github.com/syaifulahdan/ 45
High-Level Data Link Control
• HDLC (ISO 33009, ISO 4335)
—Modified from SDLC (IBM)
• Used in X.25
• Basis for other data link control protocols
46
46
46
46 tohttps://github.com/syaifulahdan/ 46
Frame Structure
• Synchronous transmission
• All transmissions in frames
• Single frame format for all data and control
exchanges
47
47
47
47 tohttps://github.com/syaifulahdan/ 47
Frame Structure
•Flag: delimit frame at both ends
•Address: identify the frame receiver
•Control: specify different frame types
•FCS: frame check sequence (error detecting code)
48
48
48
48 tohttps://github.com/syaifulahdan/ 48
KEY POINTS
• Framing is performed by breaking the
information into small frames. Each frame
uses preamble and postamble to indicate the
start and end.
• Error detection is performed by calculating an
error-detecting code that is a function of the
bits being transmitted.
• Error correction operates in a fashion similar
to error detection but is capable of correcting
certain errors.
49
49
49
49 tohttps://github.com/syaifulahdan/ 49
KEY POINTS
• Data link control protocol provides functions such as
flow control, error detection, and error control.
• Flow control enables a receiver to regulate the flow
of data from a sender so that the receiver’s buffers
do not overflow.
• In a data link control protocol, error control can
achieved by retransmission of damaged frames that
have not been acknowledged or for which the other
side requests a retransmission.

More Related Content

PPTX
PPT
2 data linklayer
PDF
Ch 03 --- the OpenFlow protocols
PDF
Introduction to TCP
PPTX
Part 4 : reliable transport and sharing resources
PPTX
12 ethernet-wifi
PPTX
New framing-protocols
PPTX
Part 9 : Congestion control and IPv6
2 data linklayer
Ch 03 --- the OpenFlow protocols
Introduction to TCP
Part 4 : reliable transport and sharing resources
12 ethernet-wifi
New framing-protocols
Part 9 : Congestion control and IPv6

What's hot (20)

PPTX
11 bgp-ethernet
PPTX
Future Internet protocols
PPT
ACIT Mumbai - OSI Model
PPTX
Part 12 : Local Area Networks
PDF
Programming Protocol-Independent Packet Processors
PDF
Ch 09 -- ARP & IP Analysis
PDF
TFTP - Trivial File Transfer Protocol
PDF
Wireshark course, Ch 03: Capture and display filters
PPTX
9 ipv6-routing
ODP
Tcp repair
PPT
Internet innovation with Multipath TCP
PPTX
Transmission Control Protocol (TCP)
PPTX
Loadbalancing In-depth study for scale @ 80K TPS
PPT
PPTX
Sanitizing PCAPs
PPT
rip, ospf 13-14
PPTX
10 routing-bgp
PPT
Unit III IPV6 UDP
PPTX
PPTX
Tcp header/IP Header/Authentication header
11 bgp-ethernet
Future Internet protocols
ACIT Mumbai - OSI Model
Part 12 : Local Area Networks
Programming Protocol-Independent Packet Processors
Ch 09 -- ARP & IP Analysis
TFTP - Trivial File Transfer Protocol
Wireshark course, Ch 03: Capture and display filters
9 ipv6-routing
Tcp repair
Internet innovation with Multipath TCP
Transmission Control Protocol (TCP)
Loadbalancing In-depth study for scale @ 80K TPS
Sanitizing PCAPs
rip, ospf 13-14
10 routing-bgp
Unit III IPV6 UDP
Tcp header/IP Header/Authentication header
Ad

Similar to Dc ch07 : error control and data link control (20)

PPTX
module 2 cn new.pptx
PPT
Unit 2 ppt 3.ppt
PPT
CN_unit2.ppt Data Link Layer characteristics, categories
PPTX
Data link layer
PPT
lec 3 4 Core Delays Thruput Net Arch.ppt
PPT
TCP Over Wireless
PPT
CS553_ST7_Ch06-DigitalDataComm.ppt
PPT
datalink.ppt
PPTX
Network protocols and vulnerabilities
PPT
Networks-part17-Bridges-RP1.pptjwhwhsjshh
PPT
Datalinklayer tanenbaum
PPTX
UDEC_Redes_Comp_diapo_U1_p2_rev1_2024.pptx
PPT
Learn TransportLayer of the OSI model to day with me.
PPT
Ch3datalinklayerand layeraa linkdata.ppt
PPT
ppt presentasi kelompok data link layer
PPT
Ch3.ppt
PPT
datalink.ppt
PPT
DLL PPT.ppt
PPT
UNIT-2 Data Link Layer Services, Functions PPT.ppt
PPTX
Dcn ppt on data link layer
module 2 cn new.pptx
Unit 2 ppt 3.ppt
CN_unit2.ppt Data Link Layer characteristics, categories
Data link layer
lec 3 4 Core Delays Thruput Net Arch.ppt
TCP Over Wireless
CS553_ST7_Ch06-DigitalDataComm.ppt
datalink.ppt
Network protocols and vulnerabilities
Networks-part17-Bridges-RP1.pptjwhwhsjshh
Datalinklayer tanenbaum
UDEC_Redes_Comp_diapo_U1_p2_rev1_2024.pptx
Learn TransportLayer of the OSI model to day with me.
Ch3datalinklayerand layeraa linkdata.ppt
ppt presentasi kelompok data link layer
Ch3.ppt
datalink.ppt
DLL PPT.ppt
UNIT-2 Data Link Layer Services, Functions PPT.ppt
Dcn ppt on data link layer
Ad

More from Syaiful Ahdan (20)

PDF
Sertifikat EC00202128391
PDF
SP2JPB - Aplikasi Sistem Pelayanan Pemesanan Jasa Perbaikan Pada Bengkel Alam...
PDF
Sertifikat ec00202059774
PDF
Sertifikat ec00202059775
PDF
Sertifikat EC00202045078
PDF
Sertifikat EC00202044723
PDF
Sertifikat EC00202023523
PDF
Sertifikat EC00201826309
PDF
Sertifikat EC00202023149
PDF
Sertifikat EC00202022868
PDF
Sertifikat EC00202021343
PDF
Sertifikat EC00202022755
PDF
Sertifikat EC00201987196
PDF
Sertifikat EC00201856484
PDF
Sertifikat EC00201856352
PDF
Sertifikat EC00201856994
PDF
Sertifikat EC00201856895
PDF
Meeting 2 introdcution network administrator
PDF
Pertemuan 5
PDF
Pertemuan 4
Sertifikat EC00202128391
SP2JPB - Aplikasi Sistem Pelayanan Pemesanan Jasa Perbaikan Pada Bengkel Alam...
Sertifikat ec00202059774
Sertifikat ec00202059775
Sertifikat EC00202045078
Sertifikat EC00202044723
Sertifikat EC00202023523
Sertifikat EC00201826309
Sertifikat EC00202023149
Sertifikat EC00202022868
Sertifikat EC00202021343
Sertifikat EC00202022755
Sertifikat EC00201987196
Sertifikat EC00201856484
Sertifikat EC00201856352
Sertifikat EC00201856994
Sertifikat EC00201856895
Meeting 2 introdcution network administrator
Pertemuan 5
Pertemuan 4

Recently uploaded (20)

PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
GDM (1) (1).pptx small presentation for students
PPTX
Institutional Correction lecture only . . .
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Computing-Curriculum for Schools in Ghana
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
Cell Types and Its function , kingdom of life
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
Insiders guide to clinical Medicine.pdf
PPTX
Pharma ospi slides which help in ospi learning
PDF
01-Introduction-to-Information-Management.pdf
PDF
Classroom Observation Tools for Teachers
Pharmacology of Heart Failure /Pharmacotherapy of CHF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Final Presentation General Medicine 03-08-2024.pptx
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
GDM (1) (1).pptx small presentation for students
Institutional Correction lecture only . . .
FourierSeries-QuestionsWithAnswers(Part-A).pdf
O5-L3 Freight Transport Ops (International) V1.pdf
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Computing-Curriculum for Schools in Ghana
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Cell Types and Its function , kingdom of life
STATICS OF THE RIGID BODIES Hibbelers.pdf
VCE English Exam - Section C Student Revision Booklet
Anesthesia in Laparoscopic Surgery in India
Insiders guide to clinical Medicine.pdf
Pharma ospi slides which help in ospi learning
01-Introduction-to-Information-Management.pdf
Classroom Observation Tools for Teachers

Dc ch07 : error control and data link control

  • 1. 1 1 1 1 tohttps://github.com/syaifulahdan/ DATA COMMUNICATION Error Control and Data Link Control Data Communications and Networking  Data Link Layer  Framing  Error Detection : Types of Error  Parity Check  Cyclic Redudancy Check  Error Correction Prosess Diagram  LIne Configuration  Traditional Configuration  Flow Control  Model of Frame Transmission Reading: Book Chapter 7 Data and Computer Communications, 8th edition By William Stallings  Stop and Wait Flow Control  Performance of Stop and Wait  Stopand Wait Link Utilization  Sliding WIndow Flow Control  Sliding WIndow Diagram  Example Sliding WIndow  Performance of Sliding Window  Error Control  Automatic Repeat Request (ARQ)  Stop and Wait (ARQ)  Stop and Wait Diagram  Go Back N (ARQ)  Go Back N Damaged F  Go Back N Lost Frame  Go Back N Damage RR  Go Back N Damage REJ  Go Back N Diagram  Selective Reject ARQ  Selective Reject Diagram  High Level Datalink Control  Frame Structure
  • 2. Data Communications and Networking Chapter 7 Error Control and Data Link Control References: Book Chapter 6 and 7 Data and Computer Communications, 8th edition, by William Stallings
  • 3. 3 3 3 3 tohttps://github.com/syaifulahdan/ 3 Data Link Layer • Objective: — Achieving reliable communication between two adjacent machines • Design Issues: — Framing: data are sent in blocks called frames, the beginning and end of each frame must be recognized by the receiver. — Error control: bit errors introduced by the transmission system should be detected and/or corrected. — Flow control: the sending station must not send frames at a rate faster than the receiving station can absorb them. — Addressing: on a multipoint line, such as a LAN, the identity of the two stations involved in a transmission must be specified. — Transmit control information and data on the same line
  • 4. 4 4 4 4 tohttps://github.com/syaifulahdan/ 4 Framing • Large block of data may be broken up into small frames at the source because: —limited buffer size at the receiver —A larger block of data has higher probability of error • With smaller frames, errors are detected sooner, and only a smaller amount of data needs to be retransmitted —On a shared medium, such as Ethernet and Wireless LAN, small frame size can prevent one station from occupying medium for long periods
  • 5. 5 5 5 5 tohttps://github.com/syaifulahdan/ 5 Framing • Need to indicate the start and end of a block of data • Use preamble (e.g., flag byte) and postamble • If the receiver ever loses synchronization, it can just search for the flag byte. • Frame: preamble + control info + data + postamble • Problem: it is possible that the flag byte’s bit pattern occur in the data • Two popular solutions: — Byte stuffing • The sender inserts a special byte (e.g., ESC) just before each “accidental” flag byte in the data (like in C language, “ is replaced with ”). • The receiver’s link layer removes this special byte before the data are given to the network layer. — Bit stuffing: each frame starts with a flag byte “01111110”. • Whenever the sender encounters five consecutive 1s in the data, it automatically stuffs a 0 bit into the outgoing bit stream. • When the receiver sees five consecutive incoming 1 bits, followed by a 0 bit, it automatically deletes the 0 bit.
  • 6. 6 6 6 6 tohttps://github.com/syaifulahdan/ 6 Byte Stuffing Four examples of byte sequences before and after byte stuffing
  • 7. 7 7 7 7 tohttps://github.com/syaifulahdan/ 7 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 the receiver’s memory after destuffing.
  • 8. 8 8 8 8 tohttps://github.com/syaifulahdan/ 8 Error Detection: Types of Error • An error occurs when a bit is altered between transmission and reception • Single bit errors — One bit is altered — Adjacent bits are not affected — Can occur in the presence of white noise (thermal noise) • Burst errors — A cluster of bits with Length B — the first and the last and a number of intermediate bits in error (not necessarily all the bits in the cluster suffer an error) — More common and more difficult to deal with — Can be caused by impulse noise
  • 9. 9 9 9 9 tohttps://github.com/syaifulahdan/ 9 Error Detection Process • Additional bits are added by transmitter for error detection (called error-detecting codes, or check bits, or checksum) • Can be used in different network layers
  • 10. 10 10 10 10 tohttps://github.com/syaifulahdan/ 10 Parity Check • Append a parity bit to the end of a block of data • Value of parity bit is such that the new data has even (even parity) or odd (odd parity) number of ones —E.g., original data 1110001 -> 11100011 (odd parity) • Even number of bit errors goes undetected —E.g., 11100011 -> 11010011 (undetected!)
  • 11. 11 11 11 11 tohttps://github.com/syaifulahdan/ 11 Cyclic Redundancy Check • For a block of k bits, transmitter generates an (n-k)-bit sequence called Frame Check Sequence (FCS) • The resulting frame consisting of n bits is exactly divisible by some predetermined number. • Receiver divides the incoming frame by the predetermined number: —If no remainder, assume no error
  • 12. 12 12 12 12 tohttps://github.com/syaifulahdan/ 12 Cyclic Redundancy Check • Modulo 2 arithmetic —Binary addition with no carries —Binary subtraction with no carries —The same as XOR operation 1111 + 1010 = 0101 1111 − 0101 = 1010 1010 + 1010 = 0000
  • 13. 13 13 13 13 tohttps://github.com/syaifulahdan/ 13 Cyclic Redundancy Check • Define: — T = n-bit frame to be transmitted — D = k-bit block of data: the first k bits of T — F = (n-k)-bit FCS: the last (n-k) bits of T — P = pattern of (n-k+1) bits: the predetermined divisor • T = 2n-kD + F • We want T/P to have no remainder. • Problem: Given D and P, how to calculate F ?
  • 14. 14 14 14 14 tohttps://github.com/syaifulahdan/ 14 Cyclic Redundancy Check P R Q P Dkn 2 quotient remainder Step 1: Step 2: F = R Verification: Q P R P R Q P R P D P RD P T RDT knkn kn 22 2 Problem: Given D and P, how to calculate F ?
  • 15. 15 15 15 15 tohttps://github.com/syaifulahdan/ 15 Cyclic Redundancy Check • Example: —Given D = 1010001101 (10 bits) — P = 110101 (6 bits) —Then n = 15, k = 10, (n-k) = 5 —Multiple D by 25, yielding 101000110100000 —Divide it by P: remainder R = 01110 —Transmit D+R to the receiver: 101000110101110 —The receiver divide it by P, if no remainder, there is no error.
  • 16. 16 16 16 16 tohttps://github.com/syaifulahdan/ 16 Cyclic Redundancy Check • By choosing different P, CRC can detect different types of errors: —All single-bit errors if P has more than one nonzero item —All double-bit errors if P is a primitive polynomial —Any odd number of errors if P contain factor 11 —……
  • 17. 17 17 17 17 tohttps://github.com/syaifulahdan/ 17 Error Correction • Retransmission: correction of detected errors usually requires data block to be retransmitted —Retransmission may not be appropriate for some wireless applications • Bit error rate in wireless network is high • Result in lots of retransmissions —Propagation delay can be long (satellite) compared with frame transmission time • Result in retransmission of frame in error plus many subsequent frames (back to this issue in next chapter) • It would be desirable to enable the receiver to correct errors in an incoming transmission on the basis of the bits in that transmission. • FEC: forward error correction
  • 19. 19 19 19 19 tohttps://github.com/syaifulahdan/ 19 Line Configuration • Link Topology —Physical arrangement of stations on the medium (link) —Link has two stations: a point-to-point link —More than two stations: a multipoint link • local area network, satellite • Half duplex —Of two stations, only one station may transmit at a time —Requires one data path • Full duplex —Simultaneous transmission and reception between two stations —Digital signaling: requires two data paths (e.g., two twisted pairs) —Analog signaling: can use different frequencies
  • 21. 21 21 21 21 tohttps://github.com/syaifulahdan/ 21 Flow Control • Ensuring the sending entity does not overwhelm the receiving entity —Preventing buffer overflow • Transmission time —Time taken to emit all bits into medium at the sender’s side —Determined by the data rate • Propagation time —Time for a bit to traverse the link and reach the destination —Determined by the transmission distance • We first assume error-free transmission.
  • 23. 23 23 23 23 tohttps://github.com/syaifulahdan/ 23 Stop-and-Wait Flow Control • Source transmits a frame. • Destination receives the frame, and replies with a small frame called acknowledgement (ACK). • Source waits for the ACK before sending the next frame. —This is the core of the protocol ! • Destination can stop the flow by not sending ACK (e.g., if the destination is busy …).
  • 24. 24 24 24 24 tohttps://github.com/syaifulahdan/ 24 Performance of Stop-and-Wait • Assumptions —Transmission time of the data frame is 1 —Transmission time of the ACK frame is 0 —Propagation time is a • a is the ratio of propagation time over transmission time —Error-free transmission • The channel utilization ratio is 1/(1+2a) —In a time period of 1+2a, the transmitter is only busy with 1 unit of time. • It is not efficient for long haul transmission and high speed transmission. —Another type of protocol called “sliding-window” is designed for this situation.
  • 26. 26 26 26 26 tohttps://github.com/syaifulahdan/ 26 Sliding-Window Flow Control • Idea: allow multiple frames to transmit —Receiver has a buffer of W frames —Transmitter can send up to W frames without receiving ACK • Each frame needs to be numbered: sequence number is included in the frame header —Sequence number is bounded by the length of “sequence number field” in the header, e.g., k bits • Frames are numbered modulo 2k • ACK includes the sequence number of the next expected frame by the receiver
  • 27. 27 27 27 27 tohttps://github.com/syaifulahdan/ 27 Sliding-Window Diagram Need to buffer them in case of retransmission
  • 28. 28 28 28 28 tohttps://github.com/syaifulahdan/ 28 Example Sliding-Window Have been delivered to upper layer More spaces for future frames RR3 means the receiver has received all frames up to frame 2 and is ready to receive frame 3.
  • 29. 29 29 29 29 tohttps://github.com/syaifulahdan/ 29 Performance of Sliding-Window • Assumptions —Window size is W —Frame transmission time is 1 —ACK transmission time is 0 —Propagation time is a —Error-free transmission • The channel utilization ratio is 1 2 1 2 1 2 1 W a U W W a a
  • 32. 32 32 32 32 tohttps://github.com/syaifulahdan/ 32 Error Control • Error control: detection and correction of errors • We consider two types of errors: — Lost frames • The receiver cannot recognize that this is a frame. — Damaged frames • The receiver can recognize the frame, but some bits are in error. • Two approaches for error control — ARQ: automatic repeat request, based on some or all of the following ingredients: • Error detection • Positive acknowledgment • Retransmission after timeout • Negative acknowledgement and retransmission — FEC: forward error correction
  • 33. 33 33 33 33 tohttps://github.com/syaifulahdan/ 33 Automatic Repeat Request (ARQ) • The effect of ARQ is to turn an unreliable data link into a reliable one. • Three versions of ARQ: —Stop-and-wait —Go-back-N —Selective-reject (or, selective repeat)
  • 34. 34 34 34 34 tohttps://github.com/syaifulahdan/ 34 Stop-and-Wait ARQ • Based on stop-and-wait flow control • The source station is equipped with a timer. • Source transmits a single frame, and waits for an ACK • If the frame is lost… — The timer eventually fires, and the source retransmits the frame. • If receiver receives a damaged frame, discard it — The timer eventually fires, and the source retransmits the frame. • If everything goes right, but the ACK is damaged or lost, the source will not recognize it — The timer eventually fires, the source will retransmit the frame — Receiver gets two copies of the same frame! — Solution: use sequence numbers, 1 bit is enough, i.e., frame0 and frame1, ACK0 and ACK1
  • 35. 35 35 35 35 tohttps://github.com/syaifulahdan/ 35 Stop-and-Wait Diagram Simple, but inefficient for long distance and high speed applications. We can use sliding-window technique to improve the efficiency.
  • 36. 36 36 36 36 tohttps://github.com/syaifulahdan/ 36 Go-Back-N ARQ • Based on sliding-window flow control • Use window size to control the number of unacknowledged frames outstanding • If no error, the destination will send ACK as usual with next frame expected (positive ACK, RR: receive ready) • If error, the destination will reply with rejection (negative ACK, REJ: reject) — Receiver discards that frame and all future frames, until the erroneous frame is received correctly. — Source must go back and retransmit that frame and all succeeding frames that were transmitted in the interim. — This makes the receiver simple, but decreases the efficiency
  • 37. 37 37 37 37 tohttps://github.com/syaifulahdan/ 37 Go-Back-N: Damaged Frame • Suppose A is sending frames to B. After each transmission, A sets a timer for the frame. • In Go-Back-N ARQ, if the receiver detects error in frame i —Receiver discards the frame, and sends REJ-i —Source gets REJ-i —Source retransmits frame i and all subsequent frames
  • 38. 38 38 38 38 tohttps://github.com/syaifulahdan/ 38 Go-Back-N: Lost Frame (1) • Assume receiver has received frame i-1. If frame i is lost —Source subsequently sends i+1 • Receiver gets frame i+1 out of order —At data link layer, this means the lost of a frame! • Receiver sends REJ-i • Source gets REJ-i, and so goes back to frame i and retransmits frame i, i+1, …
  • 39. 39 39 39 39 tohttps://github.com/syaifulahdan/ 39 Go-Back-N: Lost Frame (2) • Assume receiver has received frame i-1 • Frame i is lost and no additional frame is sent • Receiver gets nothing and returns neither acknowledgement nor rejection • Source times out and sends a request to receiver asking for instructions • Receiver responses with RR frame, including the number of the next frame it expects, i.e., frame i • Source then retransmits frame i
  • 40. 40 40 40 40 tohttps://github.com/syaifulahdan/ 40 Go-Back-N: Damaged RR • Receiver gets frame i and sends RR-(i+1) which is lost or damaged • Acknowledgements are cumulative, so the next acknowledgement, i.e., RR-(i+n) may arrive before the source times out on frame i • If source times out, it sends a request to receiver asking for instructions, just like the previous example
  • 41. 41 41 41 41 tohttps://github.com/syaifulahdan/ 41 Go-Back-N: Damaged REJ • It is equivalent to the case of lost frame (2). • Source times out and sends a request to receiver asking for instructions • Receiver responses with RR frame, including the number of the next frame it expects • Source then retransmits
  • 42. 42 42 42 42 tohttps://github.com/syaifulahdan/ 42 Go-Back-N Diagram Remark: RR(P bit = 1) is a special RR which is used by the source to ask for instructions. For a k-bit sequence number, the window size can be at most 2k-1, otherwise RR 0 is ambiguous (e.g., first sends frame 0 and gets back an RR1, and then sends frames 1,…,7,0, and gets another RR1).
  • 43. 43 43 43 43 tohttps://github.com/syaifulahdan/ 43 Selective-Reject ARQ • Also called selective repeat • Pros: —Only rejected frames are retransmitted —Subsequent frames are accepted by the receiver and buffered —Minimizes the amount of retransmissions • Cons: —Receiver must maintain large enough buffer, and must contain logic for reinserting the retransmitted frame in the proper sequence —Also more complex logic in the source
  • 44. 44 44 44 44 tohttps://github.com/syaifulahdan/ 44 Selective Reject - Diagram Remark: For a k-bit sequence number, the window size can be at most 2k-1, because the sending and receiving windows overlap. Assume k=3, and window size is 5. 1. A sends frames 0, 1, …, 4 to B. 2. B receives all 5 frames, and cumulatively acknowledges with RR5. 3. RR5 is lost. 4. A times out, and retransmits frame 0. 5. B is expecting a new set of frames 5, 6, 7, 0, 1. So it will accept the retransmitted frame 0 and regard it as a new frame, which is wrong.
  • 45. 45 45 45 45 tohttps://github.com/syaifulahdan/ 45 High-Level Data Link Control • HDLC (ISO 33009, ISO 4335) —Modified from SDLC (IBM) • Used in X.25 • Basis for other data link control protocols
  • 46. 46 46 46 46 tohttps://github.com/syaifulahdan/ 46 Frame Structure • Synchronous transmission • All transmissions in frames • Single frame format for all data and control exchanges
  • 47. 47 47 47 47 tohttps://github.com/syaifulahdan/ 47 Frame Structure •Flag: delimit frame at both ends •Address: identify the frame receiver •Control: specify different frame types •FCS: frame check sequence (error detecting code)
  • 48. 48 48 48 48 tohttps://github.com/syaifulahdan/ 48 KEY POINTS • Framing is performed by breaking the information into small frames. Each frame uses preamble and postamble to indicate the start and end. • Error detection is performed by calculating an error-detecting code that is a function of the bits being transmitted. • Error correction operates in a fashion similar to error detection but is capable of correcting certain errors.
  • 49. 49 49 49 49 tohttps://github.com/syaifulahdan/ 49 KEY POINTS • Data link control protocol provides functions such as flow control, error detection, and error control. • Flow control enables a receiver to regulate the flow of data from a sender so that the receiver’s buffers do not overflow. • In a data link control protocol, error control can achieved by retransmission of damaged frames that have not been acknowledged or for which the other side requests a retransmission.