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

Chapter 4 data link layer

  • 1.
    The Data LinkLayer Chapter 3
  • 2.
    Data Link LayerDesign Issues • Services Provided to the Network Layer • Framing • Error Control • Flow Control
  • 4.
    Functions of theData 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 theData 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 toNetwork 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 toNetwork 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 toNetwork 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 toNetwork Layer (2) Placement of the data link protocol.
  • 10.
    Framing Data link layermust 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 toorisky 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. Acharacter 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 Bitstuffing (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 ErrorSingle Bit Errors In a single bit error, only 1 bit in the data unit changes: Burst Errors
  • 17.
    Error Detection andCorrection • 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  Blockof 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 bitsof 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 ofa Hamming code to correct burst errors.
  • 22.
    Lecture 4: 9-6-0122 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-0123 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 ErrorControlFlow 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. Datamust 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) Necessarywhen 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 refersto a set of procedures used to restrict the amount of data that the sender can send before waiting for acknowledgment. Note
  • 29.
    Stop and WaitFlow 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 WaitFlow 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
  • 31.
  • 32.
    Sliding Window FlowControl 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
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
    Error Control a) Actionsto 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 inthe data link layer is based on automatic repeat request, which is the retransmission of data. Note
  • 40.
    Error Control  Havingsolved 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  Whenthe 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 ussee 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 transmittersends 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 acknowledgmentnumber 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.Normaloperation 2.The frame is lost 3.The Acknowledgment (ACK) is lost 4.The Ack is delayed Stop-and-Wait ARQ
  • 46.
     The senderwill 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 andWait 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 ACKframe  Importance of frame numbering Stop-and-Wait ARQ
  • 49.
    10. In Stop and-WaitARQ, numbering frames prevents the retaining of duplicate frames. Note
  • 50.
    4. Delayed ACKand lost frame  Importance of frame numbering Stop-and-Wait ARQ
  • 51.
    10. Numbered acknowledgments areneeded if an acknowledgment is delayed and the next frame is lost. Note
  • 52.
    Go-Back-N ARQ a) Basedon 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: Thesender 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 - DamagedFrame 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 orLost 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 orLost Frame Correctly received out of order packets are not Buffered What is the disadvantage of this?
  • 59.
    10. Stop-and-Wait ARQ isa special case of Go-Back-N ARQ in which the size of the send window is 1 Note
  • 60.
    Selective Repeat ARQ Go-Back-NARQ 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
  • 61.