The Data Link Layer
Unit-2
Data Link Protocols
Data Links Services
Examples
Data link
layer
Physical
layer
Physical
layer
Data link
layer
A
B
Packets
Packets
Frames
Data Link Layer Services:
Framing Methods:
1.3
Framing
0110110111
Framing
received
frames
0111110101
transmitted
frames
Example Data Link Protocols
Data Link Sublayers
1.6
Error:
Data transmitted in the network
The data can be corrupted during transmission
Transmission error
For reliable communication, errors must be detected and corrected.
Error detection and correction are implemented either at the data link layer or the transport layer of the OSI model
Errors can be classified into different types. They are
Content Error:
These errors are nothing but errors in the content of a message.
Ex: ‘0’ may received as ‘1’ & vice-versa.
These errors may occurred due to noise added into the data signal during transmission.
Flow Integrity Errors:
It means the missing the blocks of data. It is possible that data block may be loss in the network as it has been delivered to the wrong destination
1.19
Depending upon the number of bits errors can be classified into 2 types. They are
Single-bit error:
The term single-bit error consists of only one bit get corrupted in parallel transmission.
Burst error:
More than 1 bit get corrupted in serial transmission due to occurrences of noise. A byte changed from 1 to 0 or from 0 to 1 then burst errors are occurred.
The length of the burst is measured from first corrupted bit to the last corrupted bit.
1.20
Error:
CODES
How to Detect the Errors?
Error Correction :
It can be handled by two ways:
1.28
Codeword:
Message bit + Parity bit = Codeword
Code Rate: It is defined as the ratio of the number of message bits(m) to the total number of bits(n).
r= m/n
Code Efficiency:
It is defined as the ratio of message bits to the number of transmitted bits per block.
Code efficiency = Code rate= m/n
Party bits or Check bits or Redundant bits:
Parity bits means extra bits are added to data. By using parity bit, we can correct & detect the errors.
Error Detection Techniques:
P- Parity bit
D6-D0= Data Bits
1.30
P | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
7 bits of Data | Count of 1 bits | 8 Bits including parity bits
EVEN ODD | |
1010001 | 3 | 11010001 | 01010001 |
1101001 |
4 | 01101001 | 11101001 |
1111111 | 7 |
11111111 | 01111111 |
1.31
Single Parity Check
Info Bits: b1, b2, b3, …, bk
Check Bit: bk+1= b1+ b2+ b3+ …+ bk modulo 2
Codeword: (b1, b2, b3, …, bk,, bk+!)
Example of Single Parity Code
Simple Parity Check:
1.34
It is not suitable for detection of multiple errors
Ex:(2,4,6)
Parity checking method cannot reveal the location of error
bits and it cannot be corrected.
Two-Dimensional Parity Check:
1.35
Two-Dimensional Parity Check
1 0 0 1 0 0
0 1 0 0 0 1
1 0 0 1 0 0
1 1 0 1 1 0
1 0 0 1 1 1
Bottom row consists of check bit for each column
Last column consists of check bits for each row
Multiple errors in rows and columns can only be detected but they cannot be corrupted.
Check Sum for Error Detection:
1.37
Word A: 1 0 1 1 0 1 1 1
Word B: 0 0 1 0 0 0 1 0
Sum: 1 1 0 1 1 0 0 1
Checksum: 0 0 1 0 0 1 1 0 ( 1’s complement)
Receiver side:
Word A: 1 1 0 1 1 0 0 1
Word B: 0 0 1 0 0 1 1 0
sum: 1 1 1 1 1 1 1 1
Checksum: 0 0 0 0 0 0 0 0 (1’s complement)
Ex: 10110001, 10101011, 00110101,10100001 Find the checksum of the following message
1.38
Sol: Receiver Data
1 0 1 1 0 0 0 1 1 0 1 1 0 0 0 1
1 0 1 0 1 0 1 1 1 0 1 0 1 0 1 1
1 0 1 0 1 1 1 0 0 1 0 1 0 1 1 1 0 0
1 1
0 1 0 1 1 1 0 1 0 1 0 1 1 1 0 1
0 0 1 1 0 1 0 1 0 0 1 1 0 1 0 1
1 0 0 1 0 0 1 0 1 0 0 1 0 0 1 0
1 0 1 0 0 0 0 1 1 0 1 0 0 0 0 1
1 0 0 1 1 0 0 1 1 1 0 0 1 1 0 0 1 1
1 1
Sum 0 0 1 1 0 1 0 0 1 1 1 1 1 1 1 1
Check sum 1 1 0 0 1 0 1 1 Check Sum 0 0 0 0 0 0 0 0
1.39
Cyclic Redundancy Check
1.41
CRC Idea - Checkbits & Error Detection
Calculate check bits
Channel
Recalculate check bits
Compare
Information k bits
Received information bits
Sent check
bits
Information accepted if check bits match
Received check bits
k bits
n – k bits
Generator
Polynomial
Generator
Polynomial
Procedure for CRC Generation:
In CRC, check sum method, the transmitted message is 1101011011 & the generator polynomial is g(x)= x^4+x+1. So what is the dividend at the receiver.
Sol: g(x)= x^4+x+1-> 10011
X^3+1=1001 X^5+x+1=100011
1.43
An Example – Step-by-Step
An Example – Step 1
An Example – Step 2
An Example – Step 3
An Example – Step 4
An Example – Step 5
An Example – Step 6
An Example – Step 7
An Example – Step 8
An Example – Step 9
An Example – Step 10
Overall
Hamming Code:
7-Bit Hamming code
4 –Data Bits , 3 –Parity Bits
1.56
D7 | D6 | D5 | P4 | D3 | P2 | P1 |
The Parity bits are inserted at each 2^n bit where n=0,1,2,3---
(i.e) P1 is 2^0=1 at first bit P2 is 2^1=2
Selection of Parity Bits:
Selection of P1: P1 is adjusted to ‘0’ or ‘1’. So establish even parity over bits 1,3,5,7(i.e P1,D3,D5,D7).
Selection of P2: P2 is adjusted to ‘0’ or ‘1’. So establish even parity over bits 2,3,6,7(i.e P2,D3,D6,D7).
Selection of P4: P1 is adjusted to ‘0’ or ‘1’. So establish even parity over bits 4,5,6,7(i.e P4,D5,D6,D7).
1.57
D15 | D14 | D13 | D12 | D11 | D10 | D9 | P8 | D7 | D6 | D5 | P4 | D3 | P2 | P1 |
D7 D6 D5 P4 D3 P2 P1
i) Decide P1:
P1 may be (0 or 1) i.e P1 => 1, 3, 5, 7 => 1 1 1 1 => To become even parity ‘1’ is substituted.
ii) Decide P2:
P2 may be ( 0 or 1) i.e P2=> 2, 3, 6, 7 => 0 1 0 1 => It is in even parity So P2= 0.
iii) Decide P4:
P4 may be (0 or 1) i.e P4 => 4, 5 ,6, 7 => 1 0 1 0 => To make even parity P4 should be ‘0’
1.58
1 | 0 | 1 | | 1 | | |
D7 D6 D5 P4 D3 P2 P1
D7 D6 D5 P4 D3 P2 P1
D7 D6 D5 P4 D3 P2 P1
D7 D6 D5 P4 D3 P2 P1
1.59
1 | 0 | 1 |
| 1 | | 1 |
1 | 0 | 1 | 0 | 1 | 0 | 1 |
1 | 0 | 1 | | 1 | 0 | 1 |
1 | 0 | 1 | 0 | 1 | 0 | 1 |
D7 D6 D5 P4 D3 P2 P1
Step 1: Analyze bits 4,5,6,7 i.e P4 1 1 0 1 (Odd Parity) . Error exist here
Hence we put P4=1 in the 4th position of the error word.
Step 2: Analyze bits 2,3,6,7 i.e P2 1 0 0 1 (Even Parity) . No error
Hence we put ‘0’ in P2 i.e P2 = 0
Step 3: Analyze bits 1,3,5,7 i.e 1 0 1 1 (Odd Parity). Error exists here
Hence we put P1 = 1 in the 1st position of the error word.
Step 4: Write the error word
Error word E =>
E= = (5)10
1.60
1 | 0 | 1 | 1 | 0 | 1 | 1 |
P4 | P2 | P1 |
1 | 0 | 1 |
Incorrect bit
Step 5: Correct the error . Correct codeword is given below
1.61
1 | 0 | 1 | 1 | 0 | 1 | 1 |
1 | 0 | 0 | 1 | 0 | 1 | 1 |
Pulse Code Modulation & Delta Modulation:
The term “Analog” refers to the information i.e continuous. Analog signals can have an infinite number of values in a ray.
Ex: Analog clock that has hours, minutes, seconds gives information in a continuous form.
Digital Signal:
The term “Digital” refers to information that has discrete states. Digital signals can have only a limited number of values.
Ex: Digital clock that repeats hours, minutes change suddenly from 8:05 pm to 8:06 pm.
1.62
1.63
It refers to amount of time in seconds signal needs to complete one cycle.
It refers to number of periods in one second.
Period is the inverse of frequency and vice versa
F = 1 / T
Period is expressed in seconds. Frequency is expressed in Hertz.
Transmission Impairments:
There are 3 factors for impairment. They are
1.64
It means a loss of energy. When a signal i.e simple or composite travels through a medium, it loses some of its energy in overcoming the resistance of the medium.
The signal changes its shape. It occur in composite signal made of different frequencies.
External energy that corrupts the signal is called noise. Several types of noises are: Thermal noise, Induced noise, Impulse noise, and Cross Talk noise may corrupt the signal.
The bandwidth of a composite continuous sine wave signal is the difference between the highest and lowest frequencies contained in the signal.
Composite means a signal is made up of many simple sign waves
1.65
It means sending a digital signal over a channel without changing the digital signal to the analog signal.
SNR = Average Signal Power/ Average Noise Power
SNRdB =10 log10SNR
It defines the maximum bit rate.
Bit rate = 2 * Band width * log2l
Where l is number of signal levels represent data.
Bit rate- Number of bits per second
1.66
The Maximum Data Rate of a Channel
1.67
Ans: Bandwidth = 3000 Hz
Level l= 2
Bit rate = 2 * bandwidth * logl2
= 2 * 3000 * log22
= 6000
Ans: Bandwidth = 3000 Hz
Level l= 4
Bit rate = 2 * bandwidth * logl2
= 2 * 3000 * log42
= 12000
1.68
Analog to Digital Conversion:-��Pulse Code Modulation:
1.69
1.70
1.71
i) Transmitter ii) Transmission Path iii) Receiver
The operations on the transmitter in PCM system are:
i) Sampling ii) Quantizing iii) Encoding
Sampling:
It is defined as process of measuring instaneous values of continuous time signal into discrete form (or) the discretization of analog signal called sampling.
Quantizing:
The method of sampling chooses a few points on the analog signal and then these points are jointed to round of the value to the nearest stabilized value. Such process is called quantizing or quantization.
Encoding:
It means to convert body of information from one system to another system in the form of codes.
1.72
Delta Modulation:
1.73
1.74
It is used to covert the analog signal to digital signal.
De-Modulator:
It is used to covert the digital signal to analog signal.
Transmission Modes:
Data transmission can be done in two ways . They are
1. Parallel 2. Serial
Parallel Transmission:
Dis-advantages:
Parallel transmission requires n-communication lines to transmit the data stream because this is expensive for short distances.
1.75
In this mode one bit follows another . So we need only one communication channel rather than to transmit the data between 2 connected devices.
There are different types in serial transmission
Synchronous Transmission:
Ex: Chat rooms, Video conferencing, Telephone Conversation.
Asynchronous Transmission:
1.76
Ex: Letters , emails, forums, televisions and radios.
Q) How many 8-bits can be transmitted per second over a 9600 baud serial communication link using asynchronous mode of transmission with one start bit, 8 data bits , 2 stop bits & 1 parity bit.
Ans: Data sent = 1 bit (start) + 8 (char size) + 2 bits (stop) + 1 bit (parity)
=12 bits.
No of characters that can be transmitted per seconds = 9600/12=
= 800 bits
Q) Assume that each character code consists of 8 bits the no of characters that can be transmitted per second through an synchronous serial line at 2400 baud rate with 2 stop bits.
Ans: Data sent = 8 bits
No of characters that can be transmitted per second = 2400/8= 300 bits
1.77
Multiplexing
CRC Information Header
Header Information CRC
Host computer
Terminal
Terminal
. . .
Terminal
Multiplexer
Frame
In multiplexing system , n input lines given to the system , it gives only one output.
In this system one input line is given to the system, it gives n output lines.
There are 3 types of techniques:
FDM (Frequency Division Multiplexing):
1.79
TDM(Time Division Multiplexing):
When data transmission rate of media is greater than of the source and each signal is allotted a definite amount of time.
In FDM, all the signals operate at the same time using different frequencies, but in TDM all the signals operate with same frequency with different time.
TDM is divided into 2 types.
Asynchronous TDM: The slots are dynamically assigned depending on the speed of the source.
Synchronous TDM: The time slots are pre-assigned and fixed. It statistically allocates the time slots according to different i/p channel needs.
1.80
1.81
Bandwidth
Latency: Latency refers to the amount of time, including delays, for data to travel from one given point to another.
Throughput: Throughput is the measure of the transfer of bits across the media over a given period of time.
Goodput:
1.82
Types of Wireless Media
1.83
Data Link Layer Flow Control Protocols:
Protocols
Noise Less Channel Noisy Channel
Simplest (utopia) 1-bit Stop-and Wait
Go-Back-N ARQ
Stop-and-wait Selective Repeat ARQ
Elementary Data Link Protocols
This protocol is the simplest possible protocol. The transmission of data takes place in only one direction.
Sender Side Algorithm for the simplest Protocol:
While(true) // Repeat forever
{
waitforEvent(); // sleep until an event oocur
if( Event(RequestToSend)) // There is a packet to send
{
GetData();
MakeFrame();
SendFrame(); // send frame
}
}
Receiver side Algorithm for the simplest protocol:
While(true) //Repeat forver
{
WaitforEvent(); //sleep until an event occurs
if(Event (Arrival Notification)) // Data frame arrived
{
Receiver Frame();
Extract Data();
Deliver Data(); // Deliver data to network layer
}
}
Protocol Definitions
Continued 🡪
Some definitions needed in the protocols to follow. These are located in the file protocol.h.
Unrestricted �Simplex �Protocol
Stop-and-wait protocols:
Sender Side Algorithm:
While(true) //Repeat forever
Cansend=true // Allow the first frame togo
{
waitforEvent();
if(Event(Request to send() and Can send)
{
GetData();
MakeFrame();
SendFrame(); //send frame
CanSend= False; //cannot send until ACK arrives
}
WaitforEvent(); // Sleep until an event occurs
if(Event(Arrival Notification)) // An ack has arrived
{
ReceiverFrame(); // Receive the frame
Cansend= True;
}}
Receiver Side Algorithm:
While(true) // Repeat forver
{
WaitforEvent(); // sleep until an event occur
if(Event(Arrival Notification)) // Data frame arrives
{
Receiver Frame();
Extract Data();
Deliver Data(); //Deliver data to n/w layer
Send Frame(); //send an Ack frame
}
}
Simplex Stop-and-Wait Protocol
A Simplex Protocol for a Noisy Channel
A positive acknowledgement with retransmission protocol.
Continued 🡪
A Simplex Protocol for a Noisy Channel (ctd.)
A positive acknowledgement with retransmission protocol.
Piggy Backing:
Advantages:
It is better use of available channel bandwidth.
Disadvantages:
Additional system complexity
Sliding Window Protocols
Sliding Window Protocols (2)
A sliding window of size 1, with a 3-bit sequence number.
(a) Initially.
(b) After the first frame has been sent.
(c) After the first frame has been received.
(d) After the first acknowledgement has been received.
1-Bit Stop-and-Wait ARQ Protocol:
Operation of Protocol:
–ve acknowledgement (NAK) it retransmits the same frame.
When retransmission necessary?
Drawbacks of Stop-and-Wait ARQ Protocol:
It is very inefficient. At any one moment, only one frame is transmitted . The sender will have to wait at-least one round trip time before sending next frame.
Sender Side Algorithm:
Sn=0; // frame 0 should be sent first
Cansend=true; //allow the first request to go
While(true) // repeat forever
{
WaitforEvent(); // sleep until an event occurs
if(Event(RequestToSend)AND cansend)
{
GetData();
MakeFrame(Sn); // the seqno is Sn
StoreFrame(Sn); // Keep copy
SendFrame(Sn);
StartTimer();
Sn=Sn+1;
}
WaitforEvent()
if(Event(ArrivalNotification))
{
ReceiveFrame(ackno);
if(notCorrupted AND ackno==S0)
{
Stoptimer();
PurgeFrame(Sn-1); // Duplicate frame copy is not allowed
Cansend=true;
}
}
if(Event (Timeout))
{
StartTimer();
ResendFrame(Sn-1);
}
}
Receiver Side Algorithm:
Rn=0; // Frame 0 expected to arrive first
While(true)
{
WaitforEvent(); //sleep until an event occurs.
if(Event(Arrival Notification)) // data frame arrives
{
Receive Frame();
if(corrupted (frame))
sleep();
if(seqno==Rn) // Valid data frame
{
Extract Data();
Deliver Data(); // Deliver data
Rn= Rn+ 1;
}
SendFrame(Rn); //send an ACK
}
}
Sliding Window Protocol :
A Protocol Using Go Back N
Pipelining and error recovery. Effect on an error when
(a) Receiver’s window size is 1.
(b) Receiver’s window size is large.
Go-Back-N ARQ protocol is used to overcome the ineffiency of stop-and-wait ARQ by allowing the transmitter to continuously sending the frames. So that the channel is kept busy. In this method, if one frame is damaged or lost, all frames are send. Since last frame acknowledged or retransmitted.
Principle of Go-Back-N ARQ:
Sliding Window Protocol Using Go Back N
Continued 🡪
Sliding Window Protocol Using Go Back N
Continued 🡪
Sliding Window Protocol Using Go Back N
Continued 🡪
Sliding Window Protocol Using Go Back N
Selective Repeat ARQ Protocol:
A Sliding Window Protocol Using Selective Repeat
Continued 🡪
A Sliding Window Protocol Using Selective Repeat (2)
Continued 🡪
A Sliding Window Protocol Using Selective Repeat (3)
Continued 🡪
A Sliding Window Protocol Using Selective Repeat (4)
A Sliding Window Protocol Using Selective Repeat (5)
(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.
1) Station A needs to send a message consisting of 9 packets to station B using a sliding window (window size 3) and go-back-n error control strategy. All packets are ready and immediately available for transmission. If every 5th packet that A transmits gets lost (but no Acks from B ever get lost) , then what is the number of packets that A will transmit for sending the message to B? [GATE CS 2006]
A) 12 B) 14 C) 16 D) 18
2) Host A wants to send 10 frames to host B. The hosts agreed to go with Go-Back-4 . How many number of frames are transmitted by Host A if every 6th frame that is transmitted by host A is either corrupted or lost?
A) 12 B) 14 C) 17 D) 18
Introduction To Data-Link Layer
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
9.145
9.9.3 Two Categories of Links
Although two nodes are physically connected by a transmission medium such as cable or air, we need to remember that the data-link layer controls how the medium is used.
We can have a data-link layer that uses the whole capacity of the medium; we can also have a data-link layer that uses only part of the capacity of the link.
In other words, we can have a point-to-point link or a broadcast link.
9.146
9.9.4 Two Sublayers
To better understand the functionality of and the services provided by the link layer,
we can divide the data-link layer into two sublayers:
9.147
Figure 9.3: Dividing the data-link layer into two sublayers
9.148
5-4 LINK-LAYER ADDRESSING
IP addresses as the identifiers at the network layer.
However, in a internetwork such as the Internet we cannot make a datagram reach its destination using only IP addresses.
The source and destination IP addresses define the two ends but cannot define which links the packet should pass through.
9.149
9.2.1 Three Types of addresses
Some link-layer protocols define three types of addresses:
Media Access Control
(MAC)
Chapter 5: Outline
12.1 RANDOM ACCESS
�
12.2 CONTROLLED ACCESS
�
12.3 CHANNELIZATION
�
�
Multiple Access Protocols:
Random Access Protocols:
12.153
transmission?
Controlled Access Protocols:
12.154
Channelization Protocols:
12.155
12.156
Figure 12.1: Taxonomy of multiple-access protocols
Classification of Multiple Access Protocols
12.158
Media Access Control Protocol
When nodes or stations are connected and use a common link, called a multipoint or broadcast link.
we need a multiple-access protocol to coordinate access to the link.
Many protocols have been devised to handle access to a shared link.
All of these protocols belong to a sub layer in the data-link layer called media access control (MAC).
12.159
RANDOM ACCESS
In random-access or contention no station is superior to another station and none is assigned control over another.
At each instance, a station that has data to send uses a procedure defined by the protocol to make a decision on whether or not to send.
This decision depends on the state of the medium (idle or busy).
Also called contention-based access
12.160
Two features give this method its name.
First:
there is no scheduled time for a station to transmit.
Transmission is random among the stations.
That is why these methods are called random access.
Second:
no rules specify which station should send next.
Stations compete with one another to access the medium.
if more than one station tries to send, there is an access conflict-collision-and the frames will be either destroyed or modified.
12.161
each station follows a procedure that answers the following questions:
transmission?
12.162
ALOHA
ALOHA Network
12.164
Pure ALOHA
12.165
12.166
Figure 12.2: Frames in a pure ALOHA network
Pure Aloha
12.168
Figure 12.3: Procedure for pure ALOHA protocol
12.169
Figure 12.4: Vulnerable time for pure ALOHA protocol
Vulnerable time:
Let us find the vulnerable time, the length of time in which there is a possibility of collision.
12.170
Throughput:
Let us call G the average number of frames generated by the system during one frame transmission time.
Then it can be proven that the average number of successfully transmitted frames for pure ALOHA is S = G x e-2G. The maximum throughput Smax is 0.184, for G = 1/2.
12.171
Slotted ALOHA:
12.172
Figure 12.5: Frames in a slotted ALOHA network
Slotted ALOHA
12.174
Figure 12.6: Vulnerable time for slotted ALOHA protocol
Slotted ALOHA vulnerable time=Tfr
12.175
Throughput
It can be proven that the average number of successful transmissions for slotted ALOHA is S = G x e-G.
The maximum throughput Smax is 0.368, when G = 1.
Pure ALOHA
G*e^-2G
Slotted ALOHA
= G * e ^-G
12.176
12.177
CSMA
12.178
Figure 12.7: Space/time model of a collision in CSMA
12.179
Figure 12.8: Vulnerable time in CSMA
Vulnerable Time
The vulnerable time for CSMA is the propagation time Tp. This is the time needed for a signal to propagate from one end of the medium to the other. When a station sends a frame and any other station tries to send a frame during this time, a collision will result.
12.180
Persistence Methods
What should a station do if the channel is busy?
What should a station do if the channel is idle?
Three methods have been devised to answer these questions:
12.181
Figure 12.9: Behavior of three persistence methods
12.182
1-Persistent CSMA:
12.183
Non-persistent CSMA
If the line is idle, it sends immediately.
If the line is not idle, it waits a random amount of time and then senses the line again.
P-Persistent CSMA
12.184
12.185
Figure 12.10: Flow diagram for three persistence methods
12.186
CSMA
12.187
CSMA/CD:
To better understand CSMA/CD, let us look at the first bits transmitted by the two stations involved in the collision.
12.188
12.189
12.190
Figure 12.11: Collision of the first bits in CSMA/CD
12.191
At time t1, station A has executed its persistence procedure and starts sending the bits of its frame.
At time t2, station C has not yet sensed the first bit sent by A. Station C executes its persistence procedure and starts sending the bits in its frame, which propagate both to the left and to the right.
The collision occurs sometime after time t2' Station C detects a collision at time t3 when it receives the first bit of A's frame.
Station C immediately (or after a short time, but we assume immediately) aborts transmission.
Station A detects collision at time t4 when it receives the first bit of C's frame; it also immediately aborts transmission.
12.192
Figure 12.12: Collision and abortion in CSMA/CD
Time durations for the two transmissions, in a complete graph
12.193
Figure 12.13: Flow diagram for the CSMA/CD
12.194
Figure 12.14: Energy level during transmission, idleness, or collision
12.195
12.1.4 CSMA/CA
Carrier sense multiple access with collision avoidance (CSMA/CA) was invented for wireless networks.
Collisions are avoided through the use of CSMA/CA’s three strategies:
CSMA/CA
12.196
Advantages of CSMA/CA:
Disadvantage of CSMA/CA
12.197
12.198
Interframe Space (IFS).
First, collisions are avoided by deferring transmission even if the channel is found idle. When an idle channel is found, the station does not send immediately.
It waits for a period of time called the interframe space or IFS.
Even though the channel may appear idle when it is sensed, a distant station may have already started transmitting. The distant station's signal has not yet reached this station.
12.199
The IFS time allows the front of the transmitted signal by the distant station to reach this station.
After waiting an IFS time, if the channel is still idle, the station can send, but it still needs to wait a time equal to the contention window.
The IFS variable can also be used to prioritize stations or frame types.
For example, a station that is assigned a shorter IFS has a higher priority.
12.200
Contention Window
The contention window is an amount of time divided into slots.
A station that is ready to send chooses a random number of slots as its wait time.
The number of slots in the window changes according to the binary exponential backoff strategy.
This means that it is set to one slot the first time and then doubles each time the station cannot detect an idle channel after the IFS time.
12.201
Acknowledgment
With all these precautions, there still may be a collision resulting in destroyed data.
In addition, the data may be corrupted during the transmission.
The positive acknowledgment and the time-out timer can help guarantee that the receiver has received the frame.
12.202
Figure 12.15: Flow diagram for CSMA/CA
12.203
Figure 12.16: Contention window
12.204
Figure 12.17: CMACA and NAV
CSMA/CD
CSMA/CA
12.205
12.206
Collision During Handshaking
What happens if there is a collision during the time when RTS or CTS control frames are in transition, often called the handshaking period?
Two or more stations may try to send RTS frames at the same time. These control frames may collide.
However, because there is no mechanism for collision detection, the sender assumes there has been a collision if it has not received a CTS frame from the receiver.
The backoff strategy is employed, and the sender tries again.
12.207
Hidden-Station Problem
The solution to the hidden station problem is the use of the handshake frames (RTS and CTS).
Figure also shows that the RTS message from B reaches A, but not C.
However, because both B and C are within the range of A, the CTS message, which contains the duration of data transmission from B to A, reaches C.
Station C knows that some hidden station is using the channel and refrains from transmitting until that duration
is over.
12.208
CSMA/CA and Wireless Networks
CSMA/CA was mostly intended for use in wireless networks.
The procedure described above, however, is not sophisticated enough to handle some particular issues related to wireless networks, such as hidden terminals or exposed terminals.
12.209
12-2 CONTROLLED ACCESS
In controlled access, the stations consult one another to find which station has the right to send.
A station cannot send unless it has been authorized by other stations.
We discuss three controlled-access methods.
12.210
12.2.1 Reservation
12.211
Figure 12.18: Reservation access method
12.212
12.2.2 Polling
Poll function: If the primary wants to receive data, it asks the secondaries if they have anything to send.
Select Function:
If the primary wants to send data, it tells the secondary to get ready to receive.
12.213
12.214
Figure 12.19: Select and poll functions in polling-access method
12.215
12.2.3 Token Passing
S= 1/1+a/N : for a<1
S = 1/ (a(1+1/N) : for a>1
a = Tp/Tt
S= Throughput N= No of stations Tp= Propagation Delay Tt= Transmission delay
12.216
Token Ring
Predecessor : Station which is logically before the station in Ring.
Successor : Station which is logically after the station in Ring.
Token :
A special packet , which circulates in Ring.
Possession of Token gives right to station of accessing Link and sending Data
12.218
Figure 12.20: Logical ring and physical topology in token-passing
access method
12.219
12-3 CHANNELIZATION
Channelization (or channel partition, as it is sometimes called) is a multiple-access method in which the available bandwidth of a link is shared in time, frequency, or through code, among different stations.
In this section, we discuss three protocols:
12.220
12.3.1 FDMA
In frequency-division multiple access (FDMA), the available bandwidth is divided into frequency bands.
Each station is allocated a band to send its data. In other words, each band is reserved for a specific station, and it belongs to the station all the time.
Each station also uses a bandpass filter to confine the transmitter frequencies.
12.221
Figure 12.21: Frequency-division multiple access (FDMA)
12.222
12.3.2 TDMA
In time-division multiple access (TDMA), the stations share the bandwidth of the channel in time.
Each station is allocated a time slot during which it can send data.
Each station transmits its data in its assigned time slot. Figure shows the idea behind TDMA.
12.223
Figure 12.22: Time-division multiple access (TDMA)
12.224
12.3.3 CDMA
Code-division multiple access (CDMA) was conceived several decades ago.
Recent advances in electronic technology have finally made its implementation possible.
CDMA differs from FDMA in that only one channel occupies the entire bandwidth of the link.
It differs from TDMA in that all stations can send data simultaneously; there is no timesharing.
12.225
Figure 12.23: Simple idea of communication with code
12.226
Figure 12.24: Chip sequences
12.227
Figure 12.25: Data representation in CDMA
12.228
Figure 12.26: Sharing channel in CDMA
12.229
Figure 12.27: Digital signal created by four stations in CDMA