SlideShare ist ein Scribd-Unternehmen logo
1 von 61
The Data Link Layer
Chapter 3
Data Link Layer Design Issues
‱ Services Provided to the Network Layer
‱ Framing
‱ Error Control
‱ Flow Control
Functions of the Data Link Layer
‱ Provide service interface to the network layer
‱ Dealing with transmission errors
‱ Regulating data flow
‱ Slow receivers not swamped by fast senders
Functions of the Data Link Layer (2)
Relationship between packets and frames.
Each frame contains a frame header,
A payload field for holding the packet, and
A frame trailer
Services Provided to Network Layer
(a) Virtual communication.
(b) Actual communication.
The principal service is transferring data from the network layer on the source
machine to the network layer on the destination machine.
Services Provided to Network Layer
Unacknowledged connectionless service.
 source machine send independent frames to the destination
machine without having the destination machine acknowledge them.
Acknowledged connectionless service.
 When this service is offered, there are still no logical connections used, but
each frame sent is individually acknowledged. In this way, the sender knows
whether a frame has arrived correctly.
Acknowledged connection-oriented service.
Services Provided to Network Layer
 WAN subnet consisting of routers connected by point-to-point
leased telephone lines.
 When a frame arrives at a router, the hardware checks it for
errors
 Then passes the frame to the data link layer software.
 The data link layer software checks to see if this is the frame
expected,
 Gives the packet contained in the payload field to the routing
software.
 The routing software then chooses the appropriate outgoing line
 Passes the packet back down to the data link layer software,
which then transmits it
Services Provided to Network Layer
(2)
Placement of the data link protocol.
Framing
Data link layer must use the service provided to it by the
physical layer.
This bit stream is not guaranteed to be error free.
Data link layer to break the bit stream up into discrete
frames and compute the checksum for each frame.
When a frame arrives at the destination, the checksum is
recomputed.
If the newly-computed checksum is different from the one
contained in the frame, the data link layer knows that an
error has occurred and takes steps to deal with it
Framing
It is too risky to count on timing to mark the start and end of each
frame, we will look at four methods:
Character count.
Flag bytes with byte stuffing.
Starting and ending flags, with bit stuffing.
Physical layer coding violations.
Framing Character count.
A character stream. (a) Without errors. (b) With one error.
Framing Flag Byte
(a) A frame delimited by flag bytes.
(b) Four examples of byte sequences before and after stuffing.
Framing Flag Byte
 A serious problem occurs with this method when binary data, such as object programs or
floating-point numbers, are being transmitted.
 It may easily happen that the flag byte's bit pattern occurs in the data.
 This situation will usually interfere with the framing.
 One way to solve this problem is to have the sender's data link layer insert a special
escape byte (ESC) just before each ''accidental'' flag byte in the data.
 The data link layer on the receiving end removes the escape byte before the data are
given to the network layer.
 This technique is called byte stuffing or character stuffing.
 Thus, a framing flag byte can be distinguished from one in the data by the absence or
presence of an escape byte before it.
Framing 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 destuffing.
Types of Error Single Bit Errors
In a single bit error, only 1 bit in the data unit changes:
Burst Errors
Error Detection and Correction
‱ Error-Correcting Codes
‱ Error-Detecting Codes
 Computer data always sent in blocks of bits.
 Suppose that the block size is 1000 bits and the error
rate is 0.001 per bit.
 If errors were independent, most blocks would contain
an error.
 If the errors came in bursts of 100 however, only one or
two blocks in 100 would be affected, on average
Error-Correcting Codes
 Block of data sent,
 Include only enough redundancy to allow the receiver to deduce that an error occurred, but
not which error, and have it request a retransmission.
 it is necessary to look closely at what an error really is.
 Normally, a frame consists of m data (i.e., message) bits and r redundant, or
check, bits.
 Let the total length be n (i.e., n = m + r). An n-bit unit containing data and check
bits is often referred to as an n-bit codeword.
Given any two codewords, say, 10001001 and 10110001, it is possible to determine how many
corresponding bits differ.
The number of bit positions in which two codewords differ is called the Hamming distance
here 3 (Hamming, 1950).
Error-Correcting Codes
Error-detecting code, consider a code in which a single parity bit is
appended to the data.
The parity bit is chosen so that the number of 1 bits in the codeword
is even (or odd).
For example, when 1011010 is sent in even parity, a bit is added to
the end to make it 10110100.
With odd parity 1011010 becomes 10110101.
A code with a single parity bit has a distance 2, since any single-bit
error produces a codeword with the wrong parity.
0000000000, 0000011111, 1111100000, and 1111111111
This code has a distance 5,
Which means that it can correct double errors.
If the codeword 0000000111 arrives, the receiver knows that the
original must have been 0000011111.
 If, however, a triple error changes 0000000000 into 0000000111,
the error will not be corrected properly
Error-Correcting Codes
The bits of the codeword are numbered consecutively, starting with
bit 1 at the left end, bit 2 to its immediate right, and so on.
The bits that are powers of 2 (1, 2, 4, 8, 16, etc.) are check bits.
The rest (3, 5, 6, 7, 9, etc.) are filled up with the m data bits.
For example, 11 = 1 + 2 + 8 and 29 = 1 + 4 + 8 + 16. A bit is
checked by just those check bits occurring in its expansion
(e.g., bit 11 is checked by bits 1, 2, and 8).
When a codeword arrives, the receiver initializes a counter to
zero. It then examines each check bit, k (k = 1, 2, 4, 8, ...), to
see if it has the correct parity. If not, the receiver adds k to the
counter
Error-Correcting Codes
Use of a Hamming code to correct burst errors.
Lecture 4: 9-6-01 22
Error Detection – CRC
a) View data bits, D, as a binary number
b) Choose r+1 bit pattern (generator), G
c) Goal: choose r CRC bits, R, such that
– <D,R> exactly divisible by G (modulo 2)
– Receiver knows G, divides <D,R> by G. If non-zero remainder: error
detected!
– Can detect all burst errors less than r+1 bits
a) Widely used in practice (ATM, HDCL)
(Cyclic Redundancy Check)
Lecture 4: 9-6-01 23
CRC Example
Want:
D.2r XOR R = nG
equivalently:
D.2r = nG XOR R
equivalently:
if we divide D.2r by G,
want reminder Rb
R = remainder[ ]
D.2r
G
10111010011
Flow and Error ControlFlow and Error Control
a) The most important responsibilities of the data link
layer are flow control and error control. these
functions are known as :
b) data link control.
10.
Data link control.
Data must be checked and processed before
they can be used.
The rate of such processing is often slower
than the rate of transmission.
For this reason , each receiver has a buffer to
store incoming data until they are processed.
If buffer begin to fill up, the sender must slow
or halt transmission.
Flow Control
a) Necessary when data is being sent faster than it can be
processed by receiver
b) Computer to printer is typical setting
c) Can also be from computer to computer, when a processing
program is limited in capacity
d) Flow control is needed since the sending entity should not
overwhelm the receiving entity
– Recipient needs some time to process incoming packets
– If sender sends faster than recipient processes, then buffer overflow
occurs
‱ flow control prevents buffer overflow
26
10.
Flow control refers to a set of procedures
used to restrict the amount of data that the
sender can send before waiting for
acknowledgment.
Note
Stop and Wait Flow Control
a) Source transmits frame
b) Destination receives frame and replies with acknowledgement
(ACK)
c) Source waits for ACK before sending next frame
d) Destination can stop flow by not sending ACK
e) Works well for large frames
f) Inefficient for smaller frames
Stop and Wait Flow Control
a) However, generally large block of data split into small frames
– Called “Fragmentation”
‱ Limited buffer size at receiver
‱ Errors detected sooner (when whole frame received)
– On error, retransmission of smaller frames is needed
‱ Prevents one station occupying medium for long periods
Stop and Wait
Sliding Window Flow Control
a) The problem of “Stop and Wait” is not be able to send
multiple frames
b) Sliding Window Protocol allows multiple frames to be in
transit
c) Receiver has buffer of W (called window size) frames
d) Transmitter can send up to W frames without ACK
e) Each frame is numbered
– Sequence number bounded by size of the sequence number field (k
bits)
– thus frames are numbered modulo 2k
(0 
 2k-1
)
a) ACK includes number of next frame expected
Sliding Window
Sender Sliding Window
Receiver Sliding Window
Sliding Window Example
Error Control
a) Actions to be taken against
– Lost frames
– Damaged frames
a) Automatic repeat request (ARQ) mechanism components
– Error detection
– Positive acknowledgment
– Retransmission after timeout
– Negative acknowledgement and retransmission
10.
Error control : is both error detection and
correction. Error correction in data link layer is
implemented simply: anytime an error is detected
in exchange, specified frames are retransmitted.
This process is called Automatic Repeat Request
Data link control.
10.
Error control in the data link layer is based
on automatic repeat request, which is the
retransmission of data.
Note
Error Control
 Having solved the problem of marking the start and end of each
frame,
 How make sure all frames delivered to the network layer
destination and proper order.
 To ensure reliable delivery is to provide the sender with some
feedback about what is happening
 If the sender receives a positive acknowledgement about a
frame, it knows the frame has arrived safely.
 On the other hand, a negative acknowledgement means that
something has gone wrong, and the frame must be transmitted
again.
Error Control
 When the sender transmits a frame, it generally also starts a
timer.
 The timer is set to expire after an interval long enough for the
frame to reach the destination
 Acknowledgement propagate back to the sender.
 The frame correctly received and the acknowledgement will get
back before the timer runs out,
 If either the frame or the acknowledgement is lost, the timer will
go off, alerting the sender to a potential problem.
 The obvious solution is to just transmit the frame again.
 To prevent this from happening, it is generally necessary to assign
sequence numbers to outgoing frames, so that the receiver can
distinguish retransmissions from originals
PROTOCOLS
Now let us see how the data link layer can
combine flow control , and error control to
achieve the delivery of data from one node to
another . The protocols are normally
implemented in software.
Stop-and-Wait ARQ
Go-Back-N ARQ
Selective Repeat ARQ
PROTOCOLS
 A transmitter sends a frame then stops and waits for
an acknowledgment.
 Stop-and-Wait ARQ has the following features:
 The sending device keeps a copy of the sent frame
transmitted until it receives an
acknowledgment( ACK)
 The sender starts a timer when it sends a frame. If
an ACK is not received within an allocated time
period, the sender resends it
 Both frames and acknowledgment (ACK) are
numbered alternately 0 and 1( two sequence number
only)
 This numbering allows for identification of frames in
case of duplicate transmission
Stop-and-Wait ARQ
 The acknowledgment number defines the number of
next expected frame. (frame 0 received ACK 1 is
sent)
 A damage or lost frame treated by the same manner
by the receiver
 If the receiver detects an error in the received frame,
or receives a frame out of order it simply discards
the frame
 The receiver send only positive ACK for frames
received safe; it is silent about the frames damage
or lost.
 The sender has a control variable Sthat holds the
number of most recently sent frame (0 or 1). The
receiver has control variable R, that holds the
Stop-and-Wait ARQ
Cases of Operations:
1.Normal operation
2.The frame is lost
3.The Acknowledgment (ACK) is lost
4.The Ack is delayed
Stop-and-Wait
ARQ
 The sender will not
send the next frame
until it is sure that the
current one is
correctly receive
 sequence number is
necessary to check
for duplicated frames
Stop-and-Wait ARQ
1. Stop and Wait ARQ
2. Lost or damaged frame
 A damage or lost frame
treated by the same
manner by the receiver.
 No NACK when frame is
corrupted / duplicate
3. Lost ACK frame
 Importance of frame
numbering
Stop-and-Wait ARQ
10.
In Stop and-Wait ARQ, numbering frames
prevents the retaining of duplicate
frames.
Note
4. Delayed ACK and lost frame
 Importance of
frame numbering
Stop-and-Wait ARQ
10.
Numbered acknowledgments are needed
if an acknowledgment is delayed and the
next frame is lost.
Note
Go-Back-N ARQ
a) Based on sliding window
b) If no error, ACK as usual with next frame expected
– ACKi means “I am ready to receive frame i” and “I received all
frames between i and my previous ack”
a) Sender uses window to control the number of
unacknowledged frames
b) If error, reply with rejection (negative ack)
– Discard that frame and all future frames until the frame in error
received correctly
– Transmitter must go back and retransmit that frame and all
subsequent frames
Go-Back-N ARQ
Example: The sender has sent frame 6 , and timer expires for frame 3(
frame 3 has not been acknowledge); the sender goes back and
resends frames 3, 4,5 and 6
Go-Back-N ARQ
Normal operation
 How many frame scan be
transmitted Without
acknowledgment?
 ACK1 is not necessary if
ACK2 is sent: Cumulative
ACK
Go-Back-N ARQ -
Damaged Frame
a) Receiver detects error in frame i
b) Receiver sends “reject i”
c) Transmitter gets “reject i”
d) Transmitter retransmits frame i and all subsequent frames
Go-Back-N ARQ
Damage or Lost Frame
Correctly received out of
order packets are not
Buffered
What is the disadvantage of
this?
Go-Back-N ARQ - Lost Frame
a) Frame i lost
b) Transmitter sends frame i+1
c) Receiver gets frame i+1 out of sequence
d) Receiver sends “reject i”
e) Transmitter goes back to frame i and
retransmits it and all subsequent frames
Go-Back-N ARQ
Damage or Lost Frame
Correctly received out of
order packets are not
Buffered
What is the disadvantage of
this?
10.
Stop-and-Wait ARQ is a special case of
Go-Back-N ARQ in which the size of
the send window is 1
Note
Selective Repeat ARQ
Go-Back-N ARQ is inefficient of a noisy link.
In a noisy link frames have higher probability of damage , which
means the resending of multiple frames.
this resending consumes the bandwidth and slow down the
transmission .
Solution:
Selective Repeat ARQ protocol : resent only the damage frame
It defines a negative Acknolgment (NAK) that report the sequence
number of a damaged frame before the timer expires
It is more efficient for noisy link, but the processing at the receiver
is more complex
Selective Repeat ARQ

Weitere Àhnliche Inhalte

Was ist angesagt?

Media Access Control
Media Access ControlMedia Access Control
Media Access ControlVijayaLakshmi514
 
Network Layer design Issues.pptx
Network Layer design Issues.pptxNetwork Layer design Issues.pptx
Network Layer design Issues.pptxAcad
 
Computer Network - Network Layer
Computer Network - Network LayerComputer Network - Network Layer
Computer Network - Network LayerManoj Kumar
 
Transmission media (data communication)
Transmission media (data communication)Transmission media (data communication)
Transmission media (data communication)Pritom Chaki
 
Introduction to Data-Link Layer
Introduction to Data-Link LayerIntroduction to Data-Link Layer
Introduction to Data-Link LayerAbdullaziz Tagawy
 
data-link layer protocols
data-link layer protocols  data-link layer protocols
data-link layer protocols BE SmĂąrt
 
ALOHA Protocol (in detail)
ALOHA Protocol (in detail)ALOHA Protocol (in detail)
ALOHA Protocol (in detail)Hinal Lunagariya
 
Routing algorithm
Routing algorithmRouting algorithm
Routing algorithmBushra M
 
Guided Transmission Media
Guided Transmission MediaGuided Transmission Media
Guided Transmission Mediaasrabatool
 
Network Layer,Computer Networks
Network Layer,Computer NetworksNetwork Layer,Computer Networks
Network Layer,Computer Networksguesta81d4b
 
Computer Networks Unit 1 Introduction and Physical Layer
Computer Networks Unit 1 Introduction and Physical Layer Computer Networks Unit 1 Introduction and Physical Layer
Computer Networks Unit 1 Introduction and Physical Layer Dr. SELVAGANESAN S
 
Stop and-wait protocol
Stop and-wait protocolStop and-wait protocol
Stop and-wait protocolVenkata Sreeram
 
Presentation Routing algorithm
Presentation Routing algorithmPresentation Routing algorithm
Presentation Routing algorithmBasit Hussain
 
Structure of switches
Structure of switchesStructure of switches
Structure of switchesAnam Sana
 
Error detection and correction
Error detection and correctionError detection and correction
Error detection and correctionMaria Akther
 
Computer networks - Channelization
Computer networks - ChannelizationComputer networks - Channelization
Computer networks - ChannelizationElambaruthi Elambaruthi
 

Was ist angesagt? (20)

Media Access Control
Media Access ControlMedia Access Control
Media Access Control
 
Network Layer design Issues.pptx
Network Layer design Issues.pptxNetwork Layer design Issues.pptx
Network Layer design Issues.pptx
 
Computer Network - Network Layer
Computer Network - Network LayerComputer Network - Network Layer
Computer Network - Network Layer
 
Transmission media (data communication)
Transmission media (data communication)Transmission media (data communication)
Transmission media (data communication)
 
Introduction to Data-Link Layer
Introduction to Data-Link LayerIntroduction to Data-Link Layer
Introduction to Data-Link Layer
 
Error control
Error controlError control
Error control
 
data-link layer protocols
data-link layer protocols  data-link layer protocols
data-link layer protocols
 
Application Layer
Application Layer Application Layer
Application Layer
 
ALOHA Protocol (in detail)
ALOHA Protocol (in detail)ALOHA Protocol (in detail)
ALOHA Protocol (in detail)
 
Routing algorithm
Routing algorithmRouting algorithm
Routing algorithm
 
Guided Transmission Media
Guided Transmission MediaGuided Transmission Media
Guided Transmission Media
 
Network Layer,Computer Networks
Network Layer,Computer NetworksNetwork Layer,Computer Networks
Network Layer,Computer Networks
 
Computer Networks Unit 1 Introduction and Physical Layer
Computer Networks Unit 1 Introduction and Physical Layer Computer Networks Unit 1 Introduction and Physical Layer
Computer Networks Unit 1 Introduction and Physical Layer
 
Stop and-wait protocol
Stop and-wait protocolStop and-wait protocol
Stop and-wait protocol
 
Presentation Routing algorithm
Presentation Routing algorithmPresentation Routing algorithm
Presentation Routing algorithm
 
Structure of switches
Structure of switchesStructure of switches
Structure of switches
 
Error detection and correction
Error detection and correctionError detection and correction
Error detection and correction
 
HDLC
HDLCHDLC
HDLC
 
Token bus
Token busToken bus
Token bus
 
Computer networks - Channelization
Computer networks - ChannelizationComputer networks - Channelization
Computer networks - Channelization
 

Ähnlich wie Chapter 4 data link layer

Unit 4 data link layer
Unit 4 data link layerUnit 4 data link layer
Unit 4 data link layermekind
 
chp2 - data link layer.pptx
chp2 - data link layer.pptxchp2 - data link layer.pptx
chp2 - data link layer.pptxChakra Pani
 
Jaimin chp-3 - data-link layer- 2011 batch
Jaimin   chp-3 - data-link layer- 2011 batchJaimin   chp-3 - data-link layer- 2011 batch
Jaimin chp-3 - data-link layer- 2011 batchJaimin Jani
 
Chapter 2.1.1.pptx
Chapter 2.1.1.pptxChapter 2.1.1.pptx
Chapter 2.1.1.pptxbotAlert
 
data link layer - Chapter 3
data link layer - Chapter 3data link layer - Chapter 3
data link layer - Chapter 3SakthiVinoth78
 
Ch3 datalink
Ch3 datalinkCh3 datalink
Ch3 datalinkRamesh Kumar
 
Data linklayer
Data linklayerData linklayer
Data linklayersheikhshakir
 
COmputer Networks Andrew tanenbaum CHAPTER 3
COmputer Networks Andrew tanenbaum CHAPTER 3COmputer Networks Andrew tanenbaum CHAPTER 3
COmputer Networks Andrew tanenbaum CHAPTER 3MrMRajaCSESTAFF
 
computer Networks Error Detection and Correction.ppt
computer Networks Error Detection and Correction.pptcomputer Networks Error Detection and Correction.ppt
computer Networks Error Detection and Correction.pptJayaprasanna4
 
data link layer to print
data link layer to printdata link layer to print
data link layer to printBishalWosti1
 
error detection.ppt
error detection.ppterror detection.ppt
error detection.pptJayaprasanna4
 
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptxU2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptxk2w9psdb96
 
Data link layar
Data link layarData link layar
Data link layarjaysans
 
Error detection.ppt
Error detection.pptError detection.ppt
Error detection.pptPawanRaj48
 
chapter-3-data-link-layer.ppt
chapter-3-data-link-layer.pptchapter-3-data-link-layer.ppt
chapter-3-data-link-layer.pptYashikaAsrani
 
Error detection and correction
Error detection and correctionError detection and correction
Error detection and correctionSisir Ghosh
 

Ähnlich wie Chapter 4 data link layer (20)

Unit 4 data link layer
Unit 4 data link layerUnit 4 data link layer
Unit 4 data link layer
 
chp2 - data link layer.pptx
chp2 - data link layer.pptxchp2 - data link layer.pptx
chp2 - data link layer.pptx
 
Jaimin chp-3 - data-link layer- 2011 batch
Jaimin   chp-3 - data-link layer- 2011 batchJaimin   chp-3 - data-link layer- 2011 batch
Jaimin chp-3 - data-link layer- 2011 batch
 
Unit 2 [autosaved]
Unit 2 [autosaved]Unit 2 [autosaved]
Unit 2 [autosaved]
 
Chapter 2.1.1.pptx
Chapter 2.1.1.pptxChapter 2.1.1.pptx
Chapter 2.1.1.pptx
 
Data link layar
Data link layarData link layar
Data link layar
 
Data link layar
Data link layarData link layar
Data link layar
 
data link layer - Chapter 3
data link layer - Chapter 3data link layer - Chapter 3
data link layer - Chapter 3
 
Data link layer
Data link layerData link layer
Data link layer
 
Ch3 datalink
Ch3 datalinkCh3 datalink
Ch3 datalink
 
Data linklayer
Data linklayerData linklayer
Data linklayer
 
COmputer Networks Andrew tanenbaum CHAPTER 3
COmputer Networks Andrew tanenbaum CHAPTER 3COmputer Networks Andrew tanenbaum CHAPTER 3
COmputer Networks Andrew tanenbaum CHAPTER 3
 
computer Networks Error Detection and Correction.ppt
computer Networks Error Detection and Correction.pptcomputer Networks Error Detection and Correction.ppt
computer Networks Error Detection and Correction.ppt
 
data link layer to print
data link layer to printdata link layer to print
data link layer to print
 
error detection.ppt
error detection.ppterror detection.ppt
error detection.ppt
 
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptxU2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
 
Data link layar
Data link layarData link layar
Data link layar
 
Error detection.ppt
Error detection.pptError detection.ppt
Error detection.ppt
 
chapter-3-data-link-layer.ppt
chapter-3-data-link-layer.pptchapter-3-data-link-layer.ppt
chapter-3-data-link-layer.ppt
 
Error detection and correction
Error detection and correctionError detection and correction
Error detection and correction
 

Mehr von Naiyan Noor

Diploma in Computer Science and ICT.pdf
Diploma in Computer Science and ICT.pdfDiploma in Computer Science and ICT.pdf
Diploma in Computer Science and ICT.pdfNaiyan Noor
 
Advanced Learning Algorithms.pdf
Advanced Learning Algorithms.pdfAdvanced Learning Algorithms.pdf
Advanced Learning Algorithms.pdfNaiyan Noor
 
HTML and CSS in depth.pdf
HTML and CSS in depth.pdfHTML and CSS in depth.pdf
HTML and CSS in depth.pdfNaiyan Noor
 
Skills Development for Mobile Game and Application Project..Naiyan noor
Skills Development for Mobile Game and Application Project..Naiyan noorSkills Development for Mobile Game and Application Project..Naiyan noor
Skills Development for Mobile Game and Application Project..Naiyan noorNaiyan Noor
 
English for Career Development Naiyan Noor.pdf
English for Career Development Naiyan Noor.pdfEnglish for Career Development Naiyan Noor.pdf
English for Career Development Naiyan Noor.pdfNaiyan Noor
 
Data Visualization with Python.....Naiyan Noor.pdf
Data Visualization with Python.....Naiyan Noor.pdfData Visualization with Python.....Naiyan Noor.pdf
Data Visualization with Python.....Naiyan Noor.pdfNaiyan Noor
 
Databases and SQL for Data Science with Python...Naiyan Noor.pdf
Databases and SQL for Data Science with Python...Naiyan Noor.pdfDatabases and SQL for Data Science with Python...Naiyan Noor.pdf
Databases and SQL for Data Science with Python...Naiyan Noor.pdfNaiyan Noor
 
Data Science Methodology...Naiyan Noor.pdf
Data Science Methodology...Naiyan Noor.pdfData Science Methodology...Naiyan Noor.pdf
Data Science Methodology...Naiyan Noor.pdfNaiyan Noor
 
Tools for Data Science ...Naiyan Noor.pdf
Tools for Data Science ...Naiyan Noor.pdfTools for Data Science ...Naiyan Noor.pdf
Tools for Data Science ...Naiyan Noor.pdfNaiyan Noor
 
What is Data Science? ... Naiyan Noor.pdf
What is Data Science? ... Naiyan Noor.pdfWhat is Data Science? ... Naiyan Noor.pdf
What is Data Science? ... Naiyan Noor.pdfNaiyan Noor
 
Programming for Everybody (Getting Started with Python)...Naiyan Noor.pdf
Programming for Everybody (Getting Started with Python)...Naiyan Noor.pdfProgramming for Everybody (Getting Started with Python)...Naiyan Noor.pdf
Programming for Everybody (Getting Started with Python)...Naiyan Noor.pdfNaiyan Noor
 
HTML, CSS, and Javascript for Web Developers ...Naiyan Noor.pdf
HTML, CSS, and Javascript for Web Developers ...Naiyan Noor.pdfHTML, CSS, and Javascript for Web Developers ...Naiyan Noor.pdf
HTML, CSS, and Javascript for Web Developers ...Naiyan Noor.pdfNaiyan Noor
 
Introduction to Data Science Naiyan Noor.pdf
Introduction to Data Science Naiyan Noor.pdfIntroduction to Data Science Naiyan Noor.pdf
Introduction to Data Science Naiyan Noor.pdfNaiyan Noor
 
Coursera Programming Foundations with JavaScript, HTML and CSS ....Naiyan Noo...
Coursera Programming Foundations with JavaScript, HTML and CSS ....Naiyan Noo...Coursera Programming Foundations with JavaScript, HTML and CSS ....Naiyan Noo...
Coursera Programming Foundations with JavaScript, HTML and CSS ....Naiyan Noo...Naiyan Noor
 
Social Media Marketing powered by HP....Naiyan Noor.pdf
Social Media Marketing powered by HP....Naiyan Noor.pdfSocial Media Marketing powered by HP....Naiyan Noor.pdf
Social Media Marketing powered by HP....Naiyan Noor.pdfNaiyan Noor
 
Motor Driving Training with Basic Maintenance. SEIP ..Naiyan Noor.pdf
Motor Driving Training with Basic Maintenance. SEIP  ..Naiyan Noor.pdfMotor Driving Training with Basic Maintenance. SEIP  ..Naiyan Noor.pdf
Motor Driving Training with Basic Maintenance. SEIP ..Naiyan Noor.pdfNaiyan Noor
 
Web Application Development using PHP and Laravel -Naiyan Noor .pdf
Web Application Development using PHP and Laravel -Naiyan Noor .pdfWeb Application Development using PHP and Laravel -Naiyan Noor .pdf
Web Application Development using PHP and Laravel -Naiyan Noor .pdfNaiyan Noor
 
Python Course Basic
Python Course BasicPython Course Basic
Python Course BasicNaiyan Noor
 
Linux Presentation
Linux PresentationLinux Presentation
Linux PresentationNaiyan Noor
 
UQx ieltsx certificate | edX
UQx ieltsx certificate | edXUQx ieltsx certificate | edX
UQx ieltsx certificate | edXNaiyan Noor
 

Mehr von Naiyan Noor (20)

Diploma in Computer Science and ICT.pdf
Diploma in Computer Science and ICT.pdfDiploma in Computer Science and ICT.pdf
Diploma in Computer Science and ICT.pdf
 
Advanced Learning Algorithms.pdf
Advanced Learning Algorithms.pdfAdvanced Learning Algorithms.pdf
Advanced Learning Algorithms.pdf
 
HTML and CSS in depth.pdf
HTML and CSS in depth.pdfHTML and CSS in depth.pdf
HTML and CSS in depth.pdf
 
Skills Development for Mobile Game and Application Project..Naiyan noor
Skills Development for Mobile Game and Application Project..Naiyan noorSkills Development for Mobile Game and Application Project..Naiyan noor
Skills Development for Mobile Game and Application Project..Naiyan noor
 
English for Career Development Naiyan Noor.pdf
English for Career Development Naiyan Noor.pdfEnglish for Career Development Naiyan Noor.pdf
English for Career Development Naiyan Noor.pdf
 
Data Visualization with Python.....Naiyan Noor.pdf
Data Visualization with Python.....Naiyan Noor.pdfData Visualization with Python.....Naiyan Noor.pdf
Data Visualization with Python.....Naiyan Noor.pdf
 
Databases and SQL for Data Science with Python...Naiyan Noor.pdf
Databases and SQL for Data Science with Python...Naiyan Noor.pdfDatabases and SQL for Data Science with Python...Naiyan Noor.pdf
Databases and SQL for Data Science with Python...Naiyan Noor.pdf
 
Data Science Methodology...Naiyan Noor.pdf
Data Science Methodology...Naiyan Noor.pdfData Science Methodology...Naiyan Noor.pdf
Data Science Methodology...Naiyan Noor.pdf
 
Tools for Data Science ...Naiyan Noor.pdf
Tools for Data Science ...Naiyan Noor.pdfTools for Data Science ...Naiyan Noor.pdf
Tools for Data Science ...Naiyan Noor.pdf
 
What is Data Science? ... Naiyan Noor.pdf
What is Data Science? ... Naiyan Noor.pdfWhat is Data Science? ... Naiyan Noor.pdf
What is Data Science? ... Naiyan Noor.pdf
 
Programming for Everybody (Getting Started with Python)...Naiyan Noor.pdf
Programming for Everybody (Getting Started with Python)...Naiyan Noor.pdfProgramming for Everybody (Getting Started with Python)...Naiyan Noor.pdf
Programming for Everybody (Getting Started with Python)...Naiyan Noor.pdf
 
HTML, CSS, and Javascript for Web Developers ...Naiyan Noor.pdf
HTML, CSS, and Javascript for Web Developers ...Naiyan Noor.pdfHTML, CSS, and Javascript for Web Developers ...Naiyan Noor.pdf
HTML, CSS, and Javascript for Web Developers ...Naiyan Noor.pdf
 
Introduction to Data Science Naiyan Noor.pdf
Introduction to Data Science Naiyan Noor.pdfIntroduction to Data Science Naiyan Noor.pdf
Introduction to Data Science Naiyan Noor.pdf
 
Coursera Programming Foundations with JavaScript, HTML and CSS ....Naiyan Noo...
Coursera Programming Foundations with JavaScript, HTML and CSS ....Naiyan Noo...Coursera Programming Foundations with JavaScript, HTML and CSS ....Naiyan Noo...
Coursera Programming Foundations with JavaScript, HTML and CSS ....Naiyan Noo...
 
Social Media Marketing powered by HP....Naiyan Noor.pdf
Social Media Marketing powered by HP....Naiyan Noor.pdfSocial Media Marketing powered by HP....Naiyan Noor.pdf
Social Media Marketing powered by HP....Naiyan Noor.pdf
 
Motor Driving Training with Basic Maintenance. SEIP ..Naiyan Noor.pdf
Motor Driving Training with Basic Maintenance. SEIP  ..Naiyan Noor.pdfMotor Driving Training with Basic Maintenance. SEIP  ..Naiyan Noor.pdf
Motor Driving Training with Basic Maintenance. SEIP ..Naiyan Noor.pdf
 
Web Application Development using PHP and Laravel -Naiyan Noor .pdf
Web Application Development using PHP and Laravel -Naiyan Noor .pdfWeb Application Development using PHP and Laravel -Naiyan Noor .pdf
Web Application Development using PHP and Laravel -Naiyan Noor .pdf
 
Python Course Basic
Python Course BasicPython Course Basic
Python Course Basic
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
UQx ieltsx certificate | edX
UQx ieltsx certificate | edXUQx ieltsx certificate | edX
UQx ieltsx certificate | edX
 

KĂŒrzlich hochgeladen

Solving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.pptSolving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.pptJasonTagapanGulla
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptMadan Karki
 
Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - GuideGOPINATHS437943
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleAlluxio, Inc.
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm Systemirfanmechengr
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substationstephanwindworld
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction managementMariconPadriquez1
 
lifi-technology with integration of IOT.pptx
lifi-technology with integration of IOT.pptxlifi-technology with integration of IOT.pptx
lifi-technology with integration of IOT.pptxsomshekarkn64
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgsaravananr517913
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHC Sai Kiran
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsSachinPawar510423
 

KĂŒrzlich hochgeladen (20)

Solving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.pptSolving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.ppt
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.ppt
 
Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - Guide
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at Scale
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm System
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substation
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction management
 
lifi-technology with integration of IOT.pptx
lifi-technology with integration of IOT.pptxlifi-technology with integration of IOT.pptx
lifi-technology with integration of IOT.pptx
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECH
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documents
 

Chapter 4 data link layer

  • 1. The Data Link Layer Chapter 3
  • 2. Data Link Layer Design Issues ‱ Services Provided to the Network Layer ‱ Framing ‱ Error Control ‱ Flow Control
  • 3.
  • 4. Functions of the Data Link Layer ‱ Provide service interface to the network layer ‱ Dealing with transmission errors ‱ Regulating data flow ‱ Slow receivers not swamped by fast senders
  • 5. Functions of the Data Link Layer (2) Relationship between packets and frames. Each frame contains a frame header, A payload field for holding the packet, and A frame trailer
  • 6. Services Provided to Network Layer (a) Virtual communication. (b) Actual communication. The principal service is transferring data from the network layer on the source machine to the network layer on the destination machine.
  • 7. Services Provided to Network Layer Unacknowledged connectionless service.  source machine send independent frames to the destination machine without having the destination machine acknowledge them. Acknowledged connectionless service.  When this service is offered, there are still no logical connections used, but each frame sent is individually acknowledged. In this way, the sender knows whether a frame has arrived correctly. Acknowledged connection-oriented service.
  • 8. Services Provided to Network Layer  WAN subnet consisting of routers connected by point-to-point leased telephone lines.  When a frame arrives at a router, the hardware checks it for errors  Then passes the frame to the data link layer software.  The data link layer software checks to see if this is the frame expected,  Gives the packet contained in the payload field to the routing software.  The routing software then chooses the appropriate outgoing line  Passes the packet back down to the data link layer software, which then transmits it
  • 9. Services Provided to Network Layer (2) Placement of the data link protocol.
  • 10. Framing Data link layer must use the service provided to it by the physical layer. This bit stream is not guaranteed to be error free. Data link layer to break the bit stream up into discrete frames and compute the checksum for each frame. When a frame arrives at the destination, the checksum is recomputed. If the newly-computed checksum is different from the one contained in the frame, the data link layer knows that an error has occurred and takes steps to deal with it
  • 11. Framing It is too risky to count on timing to mark the start and end of each frame, we will look at four methods: Character count. Flag bytes with byte stuffing. Starting and ending flags, with bit stuffing. Physical layer coding violations.
  • 12. Framing Character count. A character stream. (a) Without errors. (b) With one error.
  • 13. Framing Flag Byte (a) A frame delimited by flag bytes. (b) Four examples of byte sequences before and after stuffing.
  • 14. Framing Flag Byte  A serious problem occurs with this method when binary data, such as object programs or floating-point numbers, are being transmitted.  It may easily happen that the flag byte's bit pattern occurs in the data.  This situation will usually interfere with the framing.  One way to solve this problem is to have the sender's data link layer insert a special escape byte (ESC) just before each ''accidental'' flag byte in the data.  The data link layer on the receiving end removes the escape byte before the data are given to the network layer.  This technique is called byte stuffing or character stuffing.  Thus, a framing flag byte can be distinguished from one in the data by the absence or presence of an escape byte before it.
  • 15. Framing 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 destuffing.
  • 16. Types of Error Single Bit Errors In a single bit error, only 1 bit in the data unit changes: Burst Errors
  • 17. Error Detection and Correction ‱ Error-Correcting Codes ‱ Error-Detecting Codes  Computer data always sent in blocks of bits.  Suppose that the block size is 1000 bits and the error rate is 0.001 per bit.  If errors were independent, most blocks would contain an error.  If the errors came in bursts of 100 however, only one or two blocks in 100 would be affected, on average
  • 18. Error-Correcting Codes  Block of data sent,  Include only enough redundancy to allow the receiver to deduce that an error occurred, but not which error, and have it request a retransmission.  it is necessary to look closely at what an error really is.  Normally, a frame consists of m data (i.e., message) bits and r redundant, or check, bits.  Let the total length be n (i.e., n = m + r). An n-bit unit containing data and check bits is often referred to as an n-bit codeword. Given any two codewords, say, 10001001 and 10110001, it is possible to determine how many corresponding bits differ. The number of bit positions in which two codewords differ is called the Hamming distance here 3 (Hamming, 1950).
  • 19. Error-Correcting Codes Error-detecting code, consider a code in which a single parity bit is appended to the data. The parity bit is chosen so that the number of 1 bits in the codeword is even (or odd). For example, when 1011010 is sent in even parity, a bit is added to the end to make it 10110100. With odd parity 1011010 becomes 10110101. A code with a single parity bit has a distance 2, since any single-bit error produces a codeword with the wrong parity. 0000000000, 0000011111, 1111100000, and 1111111111 This code has a distance 5, Which means that it can correct double errors. If the codeword 0000000111 arrives, the receiver knows that the original must have been 0000011111.  If, however, a triple error changes 0000000000 into 0000000111, the error will not be corrected properly
  • 20. Error-Correcting Codes The bits of the codeword are numbered consecutively, starting with bit 1 at the left end, bit 2 to its immediate right, and so on. The bits that are powers of 2 (1, 2, 4, 8, 16, etc.) are check bits. The rest (3, 5, 6, 7, 9, etc.) are filled up with the m data bits. For example, 11 = 1 + 2 + 8 and 29 = 1 + 4 + 8 + 16. A bit is checked by just those check bits occurring in its expansion (e.g., bit 11 is checked by bits 1, 2, and 8). When a codeword arrives, the receiver initializes a counter to zero. It then examines each check bit, k (k = 1, 2, 4, 8, ...), to see if it has the correct parity. If not, the receiver adds k to the counter
  • 21. Error-Correcting Codes Use of a Hamming code to correct burst errors.
  • 22. Lecture 4: 9-6-01 22 Error Detection – CRC a) View data bits, D, as a binary number b) Choose r+1 bit pattern (generator), G c) Goal: choose r CRC bits, R, such that – <D,R> exactly divisible by G (modulo 2) – Receiver knows G, divides <D,R> by G. If non-zero remainder: error detected! – Can detect all burst errors less than r+1 bits a) Widely used in practice (ATM, HDCL) (Cyclic Redundancy Check)
  • 23. Lecture 4: 9-6-01 23 CRC Example Want: D.2r XOR R = nG equivalently: D.2r = nG XOR R equivalently: if we divide D.2r by G, want reminder Rb R = remainder[ ] D.2r G 10111010011
  • 24. Flow and Error ControlFlow and Error Control a) The most important responsibilities of the data link layer are flow control and error control. these functions are known as : b) data link control.
  • 25. 10. Data link control. Data must be checked and processed before they can be used. The rate of such processing is often slower than the rate of transmission. For this reason , each receiver has a buffer to store incoming data until they are processed. If buffer begin to fill up, the sender must slow or halt transmission.
  • 26. Flow Control a) Necessary when data is being sent faster than it can be processed by receiver b) Computer to printer is typical setting c) Can also be from computer to computer, when a processing program is limited in capacity d) Flow control is needed since the sending entity should not overwhelm the receiving entity – Recipient needs some time to process incoming packets – If sender sends faster than recipient processes, then buffer overflow occurs ‱ flow control prevents buffer overflow 26
  • 27. 10. Flow control refers to a set of procedures used to restrict the amount of data that the sender can send before waiting for acknowledgment. Note
  • 28.
  • 29. Stop and Wait Flow Control a) Source transmits frame b) Destination receives frame and replies with acknowledgement (ACK) c) Source waits for ACK before sending next frame d) Destination can stop flow by not sending ACK e) Works well for large frames f) Inefficient for smaller frames
  • 30. Stop and Wait Flow Control a) However, generally large block of data split into small frames – Called “Fragmentation” ‱ Limited buffer size at receiver ‱ Errors detected sooner (when whole frame received) – On error, retransmission of smaller frames is needed ‱ Prevents one station occupying medium for long periods
  • 32. Sliding Window Flow Control a) The problem of “Stop and Wait” is not be able to send multiple frames b) Sliding Window Protocol allows multiple frames to be in transit c) Receiver has buffer of W (called window size) frames d) Transmitter can send up to W frames without ACK e) Each frame is numbered – Sequence number bounded by size of the sequence number field (k bits) – thus frames are numbered modulo 2k (0 
 2k-1 ) a) ACK includes number of next frame expected
  • 37. Error Control a) Actions to be taken against – Lost frames – Damaged frames a) Automatic repeat request (ARQ) mechanism components – Error detection – Positive acknowledgment – Retransmission after timeout – Negative acknowledgement and retransmission
  • 38. 10. Error control : is both error detection and correction. Error correction in data link layer is implemented simply: anytime an error is detected in exchange, specified frames are retransmitted. This process is called Automatic Repeat Request Data link control.
  • 39. 10. Error control in the data link layer is based on automatic repeat request, which is the retransmission of data. Note
  • 40. Error Control  Having solved the problem of marking the start and end of each frame,  How make sure all frames delivered to the network layer destination and proper order.  To ensure reliable delivery is to provide the sender with some feedback about what is happening  If the sender receives a positive acknowledgement about a frame, it knows the frame has arrived safely.  On the other hand, a negative acknowledgement means that something has gone wrong, and the frame must be transmitted again.
  • 41. Error Control  When the sender transmits a frame, it generally also starts a timer.  The timer is set to expire after an interval long enough for the frame to reach the destination  Acknowledgement propagate back to the sender.  The frame correctly received and the acknowledgement will get back before the timer runs out,  If either the frame or the acknowledgement is lost, the timer will go off, alerting the sender to a potential problem.  The obvious solution is to just transmit the frame again.  To prevent this from happening, it is generally necessary to assign sequence numbers to outgoing frames, so that the receiver can distinguish retransmissions from originals
  • 42. PROTOCOLS Now let us see how the data link layer can combine flow control , and error control to achieve the delivery of data from one node to another . The protocols are normally implemented in software. Stop-and-Wait ARQ Go-Back-N ARQ Selective Repeat ARQ PROTOCOLS
  • 43.  A transmitter sends a frame then stops and waits for an acknowledgment.  Stop-and-Wait ARQ has the following features:  The sending device keeps a copy of the sent frame transmitted until it receives an acknowledgment( ACK)  The sender starts a timer when it sends a frame. If an ACK is not received within an allocated time period, the sender resends it  Both frames and acknowledgment (ACK) are numbered alternately 0 and 1( two sequence number only)  This numbering allows for identification of frames in case of duplicate transmission Stop-and-Wait ARQ
  • 44.  The acknowledgment number defines the number of next expected frame. (frame 0 received ACK 1 is sent)  A damage or lost frame treated by the same manner by the receiver  If the receiver detects an error in the received frame, or receives a frame out of order it simply discards the frame  The receiver send only positive ACK for frames received safe; it is silent about the frames damage or lost.  The sender has a control variable Sthat holds the number of most recently sent frame (0 or 1). The receiver has control variable R, that holds the Stop-and-Wait ARQ
  • 45. Cases of Operations: 1.Normal operation 2.The frame is lost 3.The Acknowledgment (ACK) is lost 4.The Ack is delayed Stop-and-Wait ARQ
  • 46.  The sender will not send the next frame until it is sure that the current one is correctly receive  sequence number is necessary to check for duplicated frames Stop-and-Wait ARQ
  • 47. 1. Stop and Wait ARQ 2. Lost or damaged frame  A damage or lost frame treated by the same manner by the receiver.  No NACK when frame is corrupted / duplicate
  • 48. 3. Lost ACK frame  Importance of frame numbering Stop-and-Wait ARQ
  • 49. 10. In Stop and-Wait ARQ, numbering frames prevents the retaining of duplicate frames. Note
  • 50. 4. Delayed ACK and lost frame  Importance of frame numbering Stop-and-Wait ARQ
  • 51. 10. Numbered acknowledgments are needed if an acknowledgment is delayed and the next frame is lost. Note
  • 52. Go-Back-N ARQ a) Based on sliding window b) If no error, ACK as usual with next frame expected – ACKi means “I am ready to receive frame i” and “I received all frames between i and my previous ack” a) Sender uses window to control the number of unacknowledged frames b) If error, reply with rejection (negative ack) – Discard that frame and all future frames until the frame in error received correctly – Transmitter must go back and retransmit that frame and all subsequent frames
  • 53. Go-Back-N ARQ Example: The sender has sent frame 6 , and timer expires for frame 3( frame 3 has not been acknowledge); the sender goes back and resends frames 3, 4,5 and 6
  • 54. Go-Back-N ARQ Normal operation  How many frame scan be transmitted Without acknowledgment?  ACK1 is not necessary if ACK2 is sent: Cumulative ACK
  • 55. Go-Back-N ARQ - Damaged Frame a) Receiver detects error in frame i b) Receiver sends “reject i” c) Transmitter gets “reject i” d) Transmitter retransmits frame i and all subsequent frames
  • 56. Go-Back-N ARQ Damage or Lost Frame Correctly received out of order packets are not Buffered What is the disadvantage of this?
  • 57. Go-Back-N ARQ - Lost Frame a) Frame i lost b) Transmitter sends frame i+1 c) Receiver gets frame i+1 out of sequence d) Receiver sends “reject i” e) Transmitter goes back to frame i and retransmits it and all subsequent frames
  • 58. Go-Back-N ARQ Damage or Lost Frame Correctly received out of order packets are not Buffered What is the disadvantage of this?
  • 59. 10. Stop-and-Wait ARQ is a special case of Go-Back-N ARQ in which the size of the send window is 1 Note
  • 60. Selective Repeat ARQ Go-Back-N ARQ is inefficient of a noisy link. In a noisy link frames have higher probability of damage , which means the resending of multiple frames. this resending consumes the bandwidth and slow down the transmission . Solution: Selective Repeat ARQ protocol : resent only the damage frame It defines a negative Acknolgment (NAK) that report the sequence number of a damaged frame before the timer expires It is more efficient for noisy link, but the processing at the receiver is more complex