Chapter 3
Chapter 3
2
❶ Services Provided to the Network Layer
⚫ The network layer wants to be able to send packets to its neighbors
without worrying about the details of getting it there in one piece.
❷ Framing
⚫ Group the physical layer bit stream into units called frames. Frames are nothing
more than "packets" or "messages". By convention, we use the term "frames"
when discussing DLL.
Error Control
⚫ Sender checksums the frame and transmits checksum together with
data. Receiver re-computes the checksum and compares it with the received
value.
Flow Control
⚫ Prevent a fast sender from overwhelming a slower receiver.
DATA LINK LAYER DESIGN ISSUES
Providing a well-defined service interface to the network
layer.
Dealing with transmission errors.
7
The function of the data link layer is to provide services to the network layer.
The principal service is transferring data from the network layer on the
source machine to the network layer on the destination machine.
The data link layer can be designed to offer various services. The actual
services offered can vary from system to system. Three reasonable
possibilities that are commonly provided are
This class of service is appropriate when the error rate is very low so
that recovery is left to higher layers. It is also appropriate for real- time
traffic, such as voice, in which late data are worse than bad data. Most
LANs use unacknowledged connectionless service in the data link layer.
1
0
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. If it
has not arrived within a specified time interval, it can be sent again. This
service is useful over unreliable channels, such as wireless systems.
Adding Ack in the DLL rather than in the Network Layer is just an
optimization and not a requirement. If individual frames are acknowledged
and retransmitted, entire packets get through much faster. On reliable
channels, such as fiber, the overhead of a heavyweight data link protocol
may be unnecessary, but on wireless channels, with their inherent
unreliability, it is well worth the cost.
1
1
ACKNOWLEDGED CONNECTION-ORIENTED SERVICE
Here, the source and destination machines establish a connection
before any data are transferred. Each frame sent over the connection
is numbered, and the data link layer
guarantees that each frame sentis indeed
Furthermore, received. it guarantees that each frame is
exactly once and received
that all frames are received in the
right
order.
13
DLL translates the physical layer's raw bit
stream into discrete units (messages) called frames.
14
Prof. Arathi Boyanapalli 15
FRAMING – CHARACTER COUNT
The first framing method uses a field in the header to specify the
number of characters in the frame. When the data link layer at the
destination sees the character count, it knows how many characters
follow and hence where the end of the frame is.
11
The trouble with this algorithm is that the count can be garbled by a
transmission error.
FRAMING – BYTE STUFFING
Use reserved characters to indicate the start and end of a frame. For instance,
use the two-character sequence DLE STX (Data-Link Escape, Start of TeXt)
to signal the beginning of a frame, and the sequence DLE ETX (End of TeXt)
to flag the frame's end.
The second framing method, Starting and ending character stuffing, gets
around the problem of resynchronization after an error by having each frame
start with the ASCII character sequence DLE STX and end with the
sequence DLE ETX.
Problem: What happens if the two-character sequence DLE
ETX
happens to appear in the frame itself?
Solution: Use character stuffing; within the frame, replace every occurrence
of DLE with the two-character sequence DLE DLE. The receiver reverses the
processes, replacing every occurrence of DLE DLE with a single DLE.
Example: If the frame contained ``A B DLE D E DLE'', the characters
transmitted over the channel would be ``DLE STX A B DLE DLE D E DLE
DLE DLE ETX''.
12
Disadvantage: character is the smallest unit that can be operated on; not
all
architectures are byte oriented.
18
19
FRAMING – BIT STUFFING
This technique allows data frames to contain an arbitrary number of bits and
allows character codes with an arbitrary number of bits per character. It
works like this. Each frame begins and ends with a special bit pattern,
01111110 (in fact, a flag byte).
Whenever the sender's data link layer encounters five consecutive 1s in
the
data, it automatically stuffs a 0 bit into the outgoing bit stream.
This bit stuffing is analogous to byte stuffing, in which an escape byte is
stuffed into the outgoing character stream before a flag byte in the data.
When the receiver sees five consecutive incoming 1 bits, followed by a 0 bit,
it automatically destuffs (i.e., deletes) the 0 bit
20
BIT STUFFING EXAMPLE
21
22
This Framing Method is used only in those networks in which
Encoding on the Physical Medium contains some redundancy.
Some LANs encode each bit of data by using two Physical Bits
i.e. Manchester coding is Used. Here, Bit 1 is encoded into high-
low(10) pair and Bit 0 is encoded into low-high(01) pair.
The scheme means that every data bit has a transition in the middle,
making it easy for the receiver to locate the bit boundaries. The
combinations high-high and low-low are not used for data but are
used for delimiting frames in some protocols.
ERROR CONTROL
Error control is concerned with insuring that all frames are eventually
delivered (possibly in order) to a destination. How? Three items are required.
Two Approaches:
⚫ feedback-based flow control, the receiver sends back information
to the sender giving it permission to send more data or at least
telling the sender how the receiver is doing
⚫ rate-based flow control, the protocol has a built-in mechanism
that limits the rate at which senders may transmit data, without
using feedback from the receiver.
2. Burst error : It means two or more bits in data unit are changed from 1 to 0
from 0 to 1. In burst error, it is not necessary that only consecutive bits are
changed. The length of burst error is measured from first changed bit to last
changed bit
27
ERROR DETECTION VS ERROR
CORRECTION
There are two types of attacks against errors:
Error Detecting Codes: Include enough redundancy bits to detect
errors and use ACKs and retransmissions to recover from the errors.
Error Correcting Codes: Include enough redundancy to detect and
correct errors. The use of error-correcting codes is often referred to as
forward error correction.
28
ERROR DETECTION
Error detection means to decide whether the received data is correct or
not without having a copy of the original message.
29
Append a single bit at the end of data block such that the number of
ones is even
Even Parity (odd parity is similar)
0110011 01100110
0110001 01100011
VRC is also known as Parity Check. Detects all odd-number errors in
a data block
30
EXAMPLE OF VRC
The problem with parity is that it can only detect odd numbers of bit
substitution errors, i.e. 1 bit, 3bit, 5, bit, etc. errors. If there two,
four, six, etc. bits which are transmitted in error, using VRC will not
be able to detect the error.
31
Longitudinal Redundancy Checks (LRC) seek to overcome the weakness of
simple, bit-oriented, one-directional parity checking.
LRC adds a new character (instead of a bit) called the Block Check Character
(BCC) to each block of data. Its determined like parity, but counted
longitudinally through the message (also vertically)
Its has better performance over VRC as it detects 98% of the burst errors (>10
errors) but less capable of detecting single errors
If two bits in one data units are damaged and two bits in exactly the same
positions in another data unit are also damaged, the LRC checker will not detect
an error.
11100111 11011101 00111001 10101001
11100111
11011101
Even 1s 0
00111001
Odd 1s 1 10101001
10101010
27
11100111 11011101 00111001 10101001 10101010
Original Data LRC
TWO DIMENSIONAL PARITY CHECK
Upon receipt, each character is checked according to its VRC parity
value and then the entire block of characters is verified using the
LRC block check character.
33
34
ANOTHER EXAMPLE OF TWO DIMENSIONAL PARITY CHECK
Consider the following bit stream that has been encoded using
VRC, LRC and even parity. Locate the error if present
35
36
37
38
39
The cyclic redundancy check, or CRC, is a technique for detecting
errors in digital data, but not for making corrections when errors are
detected. It is used primarily in data transmission
In the CRC method, a certain number of check bits, often called a
checksum, are appended to the message being transmitted. The
receiver can determine whether or not the check bits agree with the
data, to ascertain with a certain degree of probability whether or not
an error occurred in transmission
The CRC is based on polynomial arithmetic, in particular, on
computing the remainder of dividing one polynomial in GF(2)
(Galois field with two elements) by another.
Can be easily implemented with small amount of hardware
⚫ Shift registers
⚫ XOR (for addition and subtraction) 31
Generator Polynomial
A cyclic redundancy check (CRC) is a non-secure hash function designed to
detect accidental changes to raw computer data, and is commonly used in
digital networks and storage devices such as hard disk devices.
CRCs are so called because the check (data verification) code is
a redundancy (it adds zero information) and the algorithm is based on cyclic
codes.
The term CRC may refer to the check code or to the function that calculates it,
which accepts data streams of any length as input but always outputs a fixed-
length code
The divisor in a cyclic code is normally called the generator polynomial or
simply the generator. The proper
1. It should have at least two terms.
42
CYCLIC REDUNDANCY CHECK
Let M(x) be the message polynomial
Let P(x) be the generator polynomial
⚫ P(x) is fixed for a given CRC scheme
⚫ P(x) is known both by sender and receiver
Create a block polynomial F(x) based on M(x) and P(x)
such that F(x) is divisible by P(x)
0
F ( x)
P(x) Q(x) P(x)
CYCLIC REDUNDANCY CHECK
Sending
1. Multiply M(x) by xn
2. Divide xnM(x) by P(x)
3. Ignore the quotient and keep the reminder C(x)
4. Form and send F(x) = xnM(x)+C(x)
Receiving
1. Receive F’(x)
2. Divide F’(x) by P(x)
3. Accept if remainder is 0, reject otherwise
CRC Example
Consider a message 110010 represented by the polynomial M(x) = x5 + x4 + x
Consider a generating polynomial G(x) = x3 + x2 + 1 (1101)
This is used to generate a 3 bit CRC = C(x) to be appended to M(x).
Steps:
1. Multiply M(x) by x3 (highest power in G(x)). i.e. Add 3 zeros. 110010000
2. Divide the result by G(x). The remainder = C(x).
1101 long division into 110010000 (with subtraction mod 2)
= 100100 remainder 100
3. Transmit 110010000 + 100
To be precise, transmit: T(x) = x3M(x) + C(x)
= 110010100
4. Receiver end: Receive T(x). Divide by G(x), should have remainder 0.
Note if G(x) has order n - highest power is xn, then G(x) will cover
(n+1) bits
and the remainder will cover n bits. i.e. Add n bits to message. 36
46
47
Example of CRC
39
CRC Division in Polynomial Form
49
50
CRC PERFORMANCE
CRC is a very effective error detection technique. If the divisor is chosen
according to the previously mentioned rules, its performance can be
summarized as follows:
CRC can detect all single-bit errors
CRC can detect all double-bit errors (three 1’s)
CRC can detect any odd number of errors (X+1)
CRC can detect all burst errors of less than the degree of the polynomial.
CRC detects most of the larger burst errors with a high probability. 42
52
53
Example
54
Q) For a pattern of, 10101001 00111001 00011101 Find out whether any
transmission errors have occurred or not
55
56
57
58
Checksum Vs CRC
CRC is more thorough as opposed to Checksum in checking for
errors and reporting.
Checksum is the older of the two programs.
CRC has a more complex computation as opposed
to checksum.
Checksum mainly detects single-bit changes in data while CRC
can check and detect double-digit errors.
CRC can detect more errors than checksum due to its
more complex function.
A checksum is mainly employed in data validation
when implementing software.
A CRC is mainly used for data evaluation in analogue
da5t0a transmission.
Once detected, the errors must be corrected
P1 = 1
P2 = 1 For code: 10101101011
P4 = 0
P8 = 1
Even parity calculated for each bit position
P1 (1, 3, 5, 7, 9, 11, 13, 15)
P2 (2, 3, 6, 7, 10, 11, 14, 15)
P4 (4, 5, 6, 7, 12, 13, 14, 15)
P8(8, 9, 10, 11, 12, 13, 14, 15)
Hamming Code (1 error)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 0 1 0 1 1 0 1 0 1 1
P1 P1 P1 P1 P1 P1 P1 P1
P2 P2 P2 P2 P2 P2 P2 P2
P4 P4 P4 P4 P4 P4 P4 P4
P8 P8 P8 P8 P8 P8 P8 P8
1 1 1 0 0 1 0 1 1 1 0 1 0 1 1
Xmit 1 1 1 0 0 1 0 1 1 1 0 1 0 0 1
Rec
A S A = Actual Parity
P1 = 1 1 S = Should be Parity
P2 = 1 0
P4 = 0 1
P8 = 1 0 Even parity calculated for each bit position
P1 (1, 3, 5, 7, 9, 11, 13, 15)
2, 4, and 8 incorrect P2 (2, 3, 6, 7, 10, 11, 14, 15)
2 + 4 + 8 = 14 P4 (4, 5, 6, 7, 12, 13, 14, 15)
P8(8, 9, 10, 11, 12, 13, 14, 15)
Hamming Code (2 errors)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 0 1 0 1 1 0 1 0 1 1
P1 P1 P1 P1 P1 P1 P1 P1
P2 P2 P2 P2 P2 P2 P2 P2
P4 P4 P4 P4 P4 P4 P4 P4
P8 P8 P8 P8 P8 P8 P8 P8
1 1 1 0 0 1 0 1 1 1 0 1 0 1 1
Xmit 1 1 1 0 0 1 0 1 0 1 0 1 0 0 1
Rec
A S A = Actual Parity
P1 = 1 0 S = Should be Parity
P2 = 1 0
P4 = 0 1
P8 = 1 1 Even parity calculated for each bit position
P1 (1, 3, 5, 7, 9, 11, 13, 15)
1,2, and 4 incorrect P2 (2, 3, 6, 7, 10, 11, 14, 15)
1+2+4=7 P4 (4, 5, 6, 7, 12, 13, 14, 15)
Fix 7, will still have parity problem P8(8, 9, 10, 11, 12, 13, 14, 15)
Example
• A byte of data: 10011010
• Create the data word, leaving spaces for the parity bits:
__1_001_1010
• Calculate the parity for each parity bit (a ? represents the bit position
being set):
• Position 1 checks bits 1,3,5,7,9,11:
? _ 1 _ 0 0 1 _ 1 0 1 0. Even parity so set position 1 to a 0:
0_1_001_1010
• Position 2 checks bits 2,3,6,7,10,11:
0 ? 1 _ 0 0 1 _ 1 0 1 0. Odd parity so set position 2 to a 1:
011_001_1010
• Position 4 checks bits 4,5,6,7,12:
0 1 1 ? 0 0 1 _ 1 0 1 0. Odd parity so set position 4 to a 1:
0111001_1010
• Position 8 checks bits 8,9,10,11,12:
0 1 1 1 0 0 1 ? 1 0 1 0. Even parity so set position 8 to a 0:
011100101010
• Code word: 011100101010
Finding and Fixing a Bad Bit
123456789012
• Transmitted word: 011100101010
• Received word: 011100101110
• Calculate the parity bits from received word
SB A
• P1 (1, 3, 5, 7, 9, 11) = 0 0 1
• P2 (2, 3, 6, 7, 10, 11) = 0 1 2
• P4 (4, 5, 6, 7, 12) = 1 1 4
• P8 (8, 9, 10, 11, 12) = 1 0 8
• 2 + 8 = 10
• Bit position 10 is incorrect
Finding and Fixing a Bad Bit
123456789012
• Transmitted word:
• Received word: 010101100011
• Calculate the parity bits from received word
SB A
• P1 (1, 3, 5, 7, 9, 11) = 0 0
• P2 (2, 3, 6, 7, 10, 11) = 1 0
• P4 (4, 5, 6, 7, 12) = 0 1
• P8 (8, 9, 10, 11, 12) = 0 0
• Bit positions 2 & 4 are incorrect
2+4=6
• Correct code is 010100100011
Finding and Fixing a Bad Bit
123456789012
• Transmitted word:
• Received word: 111110001100
• Calculate the parity bits from received word
SB A
• P1 (1, 3, 5, 7, 9, 11) = 0 1
• P2 (2, 3, 6, 7, 10, 11) = 1 1
• P4 (4, 5, 6, 7, 12) = 0 1
• P8 (8, 9, 10, 11, 12) = 0 0
• Bit positions 1 & 4 are incorrect
1+4=5
• Correct code is 111100001100
Finding and Fixing a Bad Bit
123456789012
• Transmitted word:
• Received word: 000010001010
• Calculate the parity bits from received word
SB A
• P1 (1, 3, 5, 7, 9, 11) = 1 0
• P2 (2, 3, 6, 7, 10, 11) = 1 0
• P4 (4, 5, 6, 7, 12) = 1 0
• P8 (8, 9, 10, 11, 12) = 0 0
• Bit positions 1, 2 & 4 are incorrect
1+2+4=7
• Correct code is: 000010101010
A (7,4) hamming code is received as 1010111.
Determine the correct code when even parity is there.
78
An unrestricted simplex protocol
In order to appreciate the step by step development of efficient and
complex protocols we will begin with a simple but unrealistic protocol. In
this protocol: Data are transmitted in one direction only
The transmitting (Tx) and receiving (Rx) hosts are always ready
Processing time can be ignored
Infinite buffer space is available
No errors occur; i.e. no damaged frames and no lost frames
(perfect
channel)
79
A simplex stop and wait protocol
In this protocol we assume that Data are transmitted in one direction
only
No errors occur (perfect channel)
The receiver can only process the received information at a finite rate
The sender sends one frame and waits for feedback from the
receiver. When the ACK arrives, the sender sends the next
frame
81
A SIMPLEX PROTOCOL FOR A NOISY CHANNEL
In this protocol the unreal "error free" assumption in protocol 2 is dropped.
Frames may be either damaged or lost completely. We assume that
transmission errors in the frame are detected by the hardware checksum. One
suggestion is that the sender would send a frame, the receiver would send an
ACK frame only if the frame is received correctly. If the frame is in error the
receiver simply ignores it; the transmitter would time out and would retransmit
it.
One fatal flaw with the above scheme is that if the ACK frame is lost or
damaged, duplicate frames are accepted at the receiver without the receiver
knowing it.
82
Imagine a situation where the receiver has just sent an ACK frame back to the sender
saying that it correctly received and already passed a frame to its host. However, the
ACK frame gets lost completely, the sender times out and retransmits the frame.
There is no way for the receiver to tell whether this frame is a retransmitted frame or
a new frame, so the receiver accepts this duplicate happily and transfers it to the
host. The protocol thus fails in this aspect.
STOP-AND-WAIT, LOST FRAME STOP-AND-WAIT, LOST ACK FRAME
66
To overcome this problem it is required that the receiver be able to
distinguish a frame that it is seeing for the first time from a
retransmission. One way to achieve this is to have the sender put a
sequence number in the header of each frame it sends. The receiver
then can check the sequence number of each arriving frame to see if it
is a new frame or a duplicate to be discarded.
68
After transmitting a frame and starting the timer, the sender waits for
something exciting to happen.
⚫ Only three possibilities exist: an acknowledgement frame arrives
undamaged, a damaged acknowledgement frame staggers in, or the timer
expires.
If a valid acknowledgement comes in, the sender fetches the next
packet from its network layer and puts it in the buffer, overwriting
the previous packet. It also advances the sequence number. If a
damaged frame arrives or no frame at all arrives, neither the buffer
nor the sequence number is changed so that a duplicate can be sent.
When a valid frame arrives at the receiver, its sequence number is checked
to see if it is a duplicate. If not, it is accepted, passed to the network layer,
and an acknowledgement is generated. Duplicates and damaged frames
69
are
not passed to the network layer.
SLIDING WINDOW
PROTOCOLS
87
DATA FRAME TRANSMISSION
Unidirectional in previous elementary
assumption protocols
Not general
Full-duplex - approach 1
⚫ Two separate communication channels(physical circuits)
Forward channel for data
Reverse channel for acknowledgement
and 1 only
Sending and Receiving Windows
At any instance of time
⚫ Sender maintains a set of sequence numbers of frames permitted to
send
These frames fall within sending window
Lower limit, upper limit, and size of two windows need not be the
same - Fixed or variable size
Senders Window contains frames can be sent or have been sent but
not yet acknowledged – outstanding frames
When a packet arrives from network layer
⚫ Next highest sequence number assigned
⚫ Upper edge of window advanced by 1
75
When an acknowledgement arrives
⚫ Lower edge of window advanced by 1
If the maximum window size is n, the sender needs n buffers to hold the
unacknowledged frames. If the window ever grows to its maximum
size, the sending data link layer must forcibly shut off the network layer
until another buffer becomes free.
The receiving data link layer's window corresponds to the frames it may
accept. Any frame falling outside the window is discarded without
comment. When a frame whose sequence number is equal to the lower
edge of the window is received, it is passed to the network layer, an
acknowledgement is generated, and the window is rotated by one.
Unlike the sender's window, the receiver's window always remains at its
initial size.
76
SENDER SLIDING WINDOW
• At the sending site, to hold
the outstanding frames until
they are acknowledged, we
use the concept of a
window.
79
80
A sliding window of size 1, with a 3-bit sequence number.
(a) Initially.
(b) After the first frame has been sent.
81
(c) After the first frame has been received.
(d) After the first acknowledgement has been received.
(a) Case 1: Normal case. (b) Case 7: Abnormal case.
The notation is (seq, ack, packet number). An asterisk 82
indicates
where a network layer accepts a packet.
ONE BIT SLIDING WINDOW PROTOCOL
Case 1: no error Case 2: data lost
A B
A B
Time (0,1,A0) Exp=0 Time Exp=0 (0,1,A0) Exp=0
Exp=0
83
X
* Timeout
(0,0,B0) Exp=1
* (1,0,A1)
Exp=1 (0,1,A0)
*
(1,1,B1) Exp=0 *
(0,0,B0) Exp=1
* (0,1,A2)
Exp=0 *
Exp=1
*
(0,0,B2) Exp=1
*
ONE BIT SLIDING WINDOW PROTOCOL
84
Exp=0
Timeout Error Timeout (0,0,B0) *
Exp=1
X
(0,1,A0) (0,1,A0)
* duplicate,
(0,0,B0) Exp=1 (0,0,B0)
discarded
* *
Exp=1 Exp=1
ONE BIT SLIDING WINDOW PROTOCOL
85
Timeout * Exp=0 (0,1,A0) Exp=0
(0,0,B0) Exp=1
*
(0,1,A0) Exp=1
*
duplicate, ACK 0
Exp=1 (1,0,A1) Timeout
*discarded
Exp=0 (1,1,A1)
(1,1,B1)
* *
Exp=0 (0,1,B0) Exp=0
*
Exp=
1
Performance of Stop and Wait Protocol
Assumption of previous
protocols:
⚫ Transmission time is negligible
t ⚫ False, when transmission time is long
0
20
Example - satellite communication
⚫ channel capacity: 50 kbps, frame size:
1kb round-trip propagation delay: 500
86
270
⚫ msec
Time: t=0 start to send 1st bit in
t=20 msec frame frame sent
t=270 msec completely frame arrives
520
t=520 best case of ack. Received
msec
Sender blocked 500/520 = 96% of time
Bandwidth utilization 20/520 = 4%
Conclusion:
Long transit time + high bandwidth + short frame length
Performance of Stop-and-Wait Protocol
• In stop-and-wait, at any point in time, there is only one frame that
is sent and waiting to be acknowledged.
• This is not a good use of transmission medium.
• To improve efficiency, multiple frames should be in transition
while waiting for ACK.
Solution:
⚫ Allowing w frames sent before blocking
Problem: errors
Solutions
⚫
89
Frames 0 and 1 are correctly received and acknowledged. Frame
2, however, is damaged or lost. The sender, unaware of this
problem, continues to send frames until the timer for frame 2
expires. Then it backs up to frame 2 and starts all over with it,
sending 2, 3, 4, etc. all over again.
GO-BACK-N ARQ WITH WINDOW=4
90
GO-BACK-N ARQ, SENDER WINDOW SIZE
• Size of the sender window must be less than 2 m. Size of the
receiver is always 1. If m = 2, window size = 2 m – 1 = 3.
• Fig compares a window size of 3 and 4.
Accepts as
the 1st
frame in
the next
cycle-an
error
Selective Repeat Protocol
Receiver stores correct frames following the bad one
Sender retransmits the bad one after noticing
95
SELECTIVE REPEAT ARQ, LOST FRAME
• Frames 0 and 1
are accepted when
received because
they are in the
range specified by
the
receiver window.
Same for frame 3.
• Receiver sends a
NAK2 to show
that frame 2 has
not been received
and then sender
resends only
frame 2 and it is
accepted as it is in
the range of the
window.
SELECTIVE REPEAT
DILEMMA
Example:
seq #’s: 0, 1, 2, 3
window size=3
receiver sees no
difference in two
scenarios!
incorrectly passes
duplicate data as new in
(a)
Q: what relationship
between seq # size and
window size?
97
SELECTIVE REPEAT ARQ, SENDER WINDOW SIZE
• Size of the sender and receiver windows must be at most one-half of 2 m.
• If m = 2, window size should be 2 m /2 = 2. Fig compares a window size
of 2 with a window size of 3. Window size is 3 and all ACKs are lost, sender
sends duplicate of frame 0, window of the receiver expect to receive frame 0
(part of the window), so accepts frame 0, as the 1st frame of the next cycle –
an error.
SELECT REPEAT PROTOCOL - WINDOW SIZE
99
Solution
⚫ Window size=(MAX_SEQ+1)/2
⚫ E.g., if 4-bit window is used, MAX_SEQ = 15
• window size = (15+1)/2 = 8
Number of buffers needed
• = window size
SELECT REPEAT PROTOCOL
100
(a) Initial situation with a window size seven.
(b) After seven frames sent and received, but not acknowledged.
(c) Initial situation with a window size of four.
(d) After four frames sent and received, but not acknowledged.
ACKNOWLEDGEMENT TIMER
Problem
⚫ If the reverse traffic is light, effect?
If there is no reverse traffic, effect?
101
⚫
Solution
⚫ Acknowledgement timer:
If no reverse traffic before timeout send
separate acknowledgement
⚫ Essential: ack timeout < data frame
timeout Why?
Contents
12.126
Pure ALOHA (2)
• Frame time – the amount of time needed to transmit
the standard fixed length frame
• An infinite population of users generates new frames
according to a Poisson distribution, with mean N
frames per time frame.
• If N >1 than more frames than the channel can handle
• 0<N<1 for reasonable throughput
Pure ALOHA (3)
12.130
Pure ALOHA (4)
• The probability that k frames are generated during a given
frame time is given by Poisson distribution:
Pros Cons
• single active node can • collisions, wasting slots
continuously transmit at full • idle slots
rate of channel
• nodes may be able to
• highly decentralized: only
detect collision in less than
slots in nodes need to be in time to transmit packet
sync
• clock synchronization
• simple
12.134
Figure 12.7 Vulnerable time for slotted ALOHA protocol
12.135
Slotted ALOHA
• The time is divided into discrete intervals, each interval
corresponding to one frame.
• The users will need to be synchronized with the beginning of
the slot
• Special station can emit a pip at the start of each interval
• A computer is not allowed to send data at any arbitrary times,
it will be forced to wait until the next valid time interval
• Since the vulnerable period is now halved, the throughput of
this method would be:
• Slotted ALOHA peaks at G=1 :: so S=1/e=.368 (i.e. 37 %
success)…..a small increase in channel load will drastically
reduce its performance.
Pure ALOHA vs. Slotted ALOHA
Throughput versus offered traffic for ALOHA systems.
CSMA Protocols