SlideShare a Scribd company logo
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
UNIT-III
DATA LINK LAYER
Vignan’s Institute of Engineering for Women
Affiliated to JNTUK
Visakhapatnam, Andhra Pradesh.
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
2
Data Link Layer Design Issues
• The main functions and the design issues of this layer are
 Providing services to the network layer
 Framing
 Error Control
 Flow Control
 The types of services provided can be of three types −
 Unacknowledged connectionless service
 Acknowledged connectionless service
 Acknowledged connection - oriented service
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
Services Provided to Network Layer
(a) Virtual communication.
(b) Actual communication.
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
4
Framing
 The data link layer encapsulates each data packet from the
network layer into frames that are then transmitted.
 A frame has three parts, namely −
 Frame Header
 Payload field that contains the data packet from network layer
 Trailer
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
Services Provided to Network Layer (2)
Placement of the data link protocol.
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
6
Framing Methods
• There are 4 types of framing methods:-
• 1. Character Count
• 2. Flag bytes with byte/char stuffing
• 3. Starting and Ending flags with bit stuffing.
• 4. Physical layer coding violations
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
Framing
Character Count:-
(a) Without errors
(b) With one error
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
Flag Byte with byte/Char Stuffing
(a) A frame delimited by flag bytes.
(b) Four examples of byte sequences before and after stuffing.
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
Framing (3)
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.
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
10
Error Control
• The data link layer ensures error free link for data
transmission. The issues it caters to with respect to
error control are −
Dealing with transmission errors
Sending acknowledgement frames in reliable
connections
Retransmitting lost frames
Identifying duplicate frames and deleting them
Controlling access to shared channels in case of
broadcasting
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
11
Flow Control
 The data link layer regulates flow control so that a fast sender
does not drown a slow receiver.
 When the sender sends frames at very high speeds, a slow
receiver may not be able to handle it. There will be frame
losses even if the transmission is error-free.
 The two common approaches for flow control are −
 Feedback based flow control
 Rate based flow control
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
Error Detection and Correction
• Error-Correcting Codes
• Error-Detecting Codes
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
13
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
Error-Correcting Codes
Use of a Hamming code to correct burst errors.
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
15
Hamming Code Sender Sequence Generation
• Design the structure of 8 bit hamming code
with information bits as 11000010111.
• Structure the complete sequence with parity
bits:-
• Note:
• The 8 bit data structure doesn't exist with 4 bit
information.
• P1 = 0 P2=0 P4=0 P8=1
• Complete Sequence :-110000110110100
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
16
• Design the structure of 8 bit hamming code
with information bits as 01001011.
• Complete Structure with parity bits:
• Identify the parity bit positions and parity bit
values and complete the sequence.
• Say the complete structure.
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
17
• A 7 bit hamming code is received as 1100101.
Assume odd parity and state whether the
received code is correct or wrong. Identify the
bit position of error and say the correct
sequence?
• Correct sequence:- 1100100
• Error is in 1st
bit position.
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
18
• A 8 bit hamming code is received as
110000110110100. Assume Even parity and
state whether the received code is correct or
wrong. Identify the bit position of error and
say the correct sequence?
• Correct sequence:- Same as input received
• Error bit position:-no Error
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
Error-Detecting Codes
Calculation of the polynomial code checksum.
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
20
Redundancy
• Redundancy is a form of error detection
mechanism is sending every data unit twice.
• Comparison of data takes place at receiver and
know the transmission error and verified.
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
21
Block Coding
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
22
Checksum
• Checksum Generator:-
 In the sender, the checksum generator subdivides the data unit into
equal segments of n bits. These segments are added with each other by
using one’s complement arithmetic in such a way that the total is also
n bits long. That total is then complemented and appended to the end of
the data unit.
• Checksum Checker:
 The receiver subdivides the data unit as above and adds all segments
together and complements the result. If the extended data unit is intact,
the total value found by adding the data segments and the checksum
field should be zero. Otherwise the packet contains an error and the
receiver rejects it.
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
23
EXAMPLE for Checksum:
At the sender
• Data unit:10101001 00111001
10101001
00111001
• Sum 11100010
• Checksum 00011101
• At the receiver
• Received data: 10101001 00111001 00011101
10101001
00111001
00011101
Sum 11111111
Complement 00000000
• It means that the patter is ok.
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
24
Example of Check Sum
• Sender Data as :- 1101001100101011
• Data Unit into equal bits:-
• 11010011
• 00101011
• Checksum :- 00000001
• Received data :- 11010011 00101011 00000001
• No Error in the information.
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
25
CYCLIC REDUNDANCY CHECK (CRC)
CRC Generator
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
26
CRC Checker
Data word Accepted Data word not accepted
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
27
Elementary Data Link Protocol
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
28
• Positive ACK - When the receiver receives a correct frame, it should acknowledge
it.
• Negative ACK - When the receiver receives a damaged frame or a duplicate
frame, it sends a NACK back to the sender and the sender must retransmit the
correct frame.
• Retransmission: The sender maintains a clock and sets a timeout period. If an
acknowledgement of a data-frame previously transmitted does not arrive before
the timeout the sender retransmits the frame, thinking that the frame or its
acknowledgement is lost in transit.
• Piggybacking: In two way communication, whenever a data frame is received, the
receiver waits and does not send the control frame (acknowledgement) back to
the sender immediately. The receiver waits until its network layer passes in the
next data packet. The delayed acknowledgement is then attached to this outgoing
data frame. His technique of temporarily delaying the acknowledgement so that it
can be hooked with next outgoing data frame is known as piggybacking.
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
29
Noiseless Channel
Example of Communication Simplest Protocol
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
30
No Damaged Frames And No Lost Frames
(Perfect Channel)
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
31
Stop and Wait Protocol
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
32
Stop and Wait Protocol Flow Diagram
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
33
Noisy Channels
• Noisy channel Mechanisms:-
Stop-and-Wait ARQ
Go-Back-N ARQ
Selective Repeat ARQ
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
34
STOP AND WAIT ARQ
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
35
Stop and Wait ARQ Flow Diagram
Stop and Wait ARQ Normal Operation
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
36
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
37
Go-Back-N Automatic Repeat Request
 In this protocol we can send several frames before receiving
acknowledgments; we keep a copy of these frames until the
acknowledgments arrive.
 These frames must be numbered differently. Frame numbers
are called Sequence numbers.
 Frames must be received in the correct order
 If a frame is lost, the lost frame and all of the following frames
must be retransmitted
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
38
• Go-Back-N: Window Sizes
• For m-bit sequence numbers. Send window
size: at most 2m
•  Up to 2m
-1 frames can be sent without ACK
• Receive window size: 1
•  Frames must be received in order
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
39
Go-Back-N Automatic Repeat Request
Diagram
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
40
Go-Back-N ARQ Normal Flow Diagram
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
41
Go-Back-N ARQ Normal Lost Diagram
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
42
Window Size for Go-Back-N ARQ
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
43
Selective Repeat ARQ
Send Window
Receive Window
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
44
Design of Selective Repeat ARQ
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
45
Frame Exchange
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
46
Negative ACK
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
47
Design of piggybacking in Go-Back-N ARQ
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
48
High -Level Data Link Control (HDLC)
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
49
Asynchronous Balanced Mode
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
50
• HDLC defines three types of frames:
1. Information frames :(I-frames)
2. Supervisory frames (S-frames)
3. Unnumbered frames (U-frames)
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
51
HDLC Frame Format
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
52
N(S) – Frame sequence number,
N(R) – Ack sequence number
P/F
Poll (primary  secondary)
Final (secondary  primary)
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
53
CASE STUDY
NO ACK
IN GIVEN
TIME PERIOD
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
54
Multiple Access Protocols
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
55
Random Access Protocols
Random access protocols assign uniform priority to all
connected nodes. Any node can send data if the
transmission channel is idle. No fixed time or fixed
sequence is given for data transmission.
The four random access protocols are−
1. ALOHA
2. Carrier sense multiple access (CMSA)
3. Carrier sense multiple access with collision detection
(CMSA/CD)
4. Carrier sense multiple access with collision avoidance
(CMSA/CA)
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
56
ALOHA
• It is designed for wireless LAN (Local Area Network) but can also be
used in a shared medium to transmit data.
• Using this method, any station can transmit data across a network
simultaneously when a data frameset is available for transmission.
ALOHA RULES:-
• Any station can transmit data to a channel at any time.
• It does not require any carrier sensing.
• Collision and data frames may be lost during the transmission of
data through multiple stations.
• Acknowledgment of the frames exists in Aloha. Hence, there is no
collision detection.
• It requires retransmission of data after some random amount of
time.
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
57
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
58
ALOHA
1 2 3 3 2
Time
Collision
Retransmission Retransmission
Node 1 Packet
Collision mechanism in ALOHA
Waiting a random time
Node 2 Packet
Node 3 Packet
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
59
Throughput of ALOHA
n
( )
!
n
(2G)
n
P
e 2G
-
=
• The probability that n packets arrive in two packets time is given by
where G is traffic load.
  G
e
P 2
0 

• The probability P(0) that a packet is successfully received without
collision is calculated by letting n=0 in the above equation. We get
  G
e
G
P
G
S 2
0 




• We can calculate throughput S with a traffic load G as follows:
184
.
0
2
1
max 

e
S
• The Maximum throughput of ALOHA is
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
60
SLOTTED ALOHA
• The slotted Aloha is designed to overcome the pure Aloha's
efficiency because pure Aloha has a very high possibility of frame
hitting.
• In slotted Aloha, the shared channel is divided into a fixed time
interval called slots.
• So that, if a station wants to send a frame to a shared channel, the
frame can only be sent at the beginning of the slot, and only one
frame is allowed to be sent to each slot.
• And if the stations are unable to send data to the beginning of the
slot, the station will have to wait until the beginning of the slot for
the next time. However, the possibility of a collision remains when
trying to send a frame at the beginning of two or more station time
slot.
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
61
Slotted ALOHA
1 2&3 2
Time
Collision
Retransmission Retransmission
3
Slot
Node 1 Packet
Nodes 2 & 3 Packets
Collision mechanism in slotted ALOHA
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
62
Throughput of Slotted ALOHA
  G
e
P 

0
• The probability of no collision is given by
  G
e
G
P
G
S 



 0
• The throughput S is
368
.
0
1
max 

e
S
• The Maximum throughput of slotted ALOHA is
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
63
Throughput
G
8
6
4
2
0
0.5
0.4
0.3
0.2
0.1
0
Slotted Aloha
Aloha
0.368
0.184
G
S
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
64
CSMA (Carrier Sense Multiple Access)
• Max throughput achievable by slotted ALOHA is
0.368.
• CSMA gives improved throughput compared to Aloha
protocols.
• Listens to the channel before transmitting a packet
(avoid avoidable collisions).
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
65
Collision Mechanism in CSMA
1 2 3
Time
Collision
4
Node 4 sense
Delay
5
Node 5 sense
Delay
Node 1 Packet
Node 2 Packet
Node 3 Packet
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
66
Kinds of CSMA
CSMA
Nonpersistent CSMA
Persistent CSMA
Unslotted Nonpersistent CSMA
Unslotted persistent CSMA
Slotted Nonpersistent CSMA
Slotted persistent CSMA
1-persistent CSMA
p-persistent CSMA
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
Behavior of three persistence methods
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
Flow diagram for three persistence methods
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
69
Nonpersistent/x-persistent CSMA Protocols
• Non persistent CSMA Protocol:
Step 1: If the medium is idle, transmit immediately
Step 2: If the medium is busy, wait a random amount of time and
repeat Step 1
– Random backoff reduces probability of collisions
– Waste idle time if the backoff time is too long
• 1-persistent CSMA Protocol:
Step 1: If the medium is idle, transmit immediately
Step 2: If the medium is busy, continue to listen until medium
becomes idle, and then transmit immediately
– There will always be a collision if two nodes want to retransmit
(usually you stop transmission attempts after few tries)
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
70
Nonpersistent/x-persistent CSMA Protocols
• p-persistent CSMA Protocol:
Step 1: If the medium is idle, transmit with probability p, and delay
for worst case propagation delay for one packet with probability
(1-p)
Step 2: If the medium is busy, continue to listen until medium
becomes idle, then go to Step 1
Step 3: If transmission is delayed by one time slot, continue with Step 1
– A good tradeoff between nonpersistent and 1-persistent CSMA
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
71
How to Select Probability p ?
• Assume that N nodes have a packet to send and the
medium is busy
• Then, Np is the expected number of nodes that will
attempt to transmit once the medium becomes idle
• If Np > 1, then a collision is expected to occur
Therefore, network must make sure that Np < 1 to
avoid collision, where N is the maximum number of
nodes that can be active at a time
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
72
Throughput
0 1 2 3 4 5 6 7 8 9
G
1.0
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
S
Aloha
Slotted Aloha
1-persistent CSMA
0.5-persistent CSMA
0.1-persistent CSMA
0.01-persistent CSMA
Nonpersistent CSMA
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
73
CSMA/CD (CSMA with Collision Detection)
• In CSMA, if 2 terminals begin sending packet at the same
time, each will transmit its complete packet (although
collision is taking place).
• Wasting medium for an entire packet time.
• CSMA/CD
Step 1: If the medium is idle, transmit
Step 2: If the medium is busy, continue to listen until
the channel is idle then transmit
Step 3: If a collision is detected during transmission,
cease transmitting
Step 4: Wait a random amount of time and repeats
the same algorithm
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
74
CSMA/CA (CSMA with collision Avoidance)
• All terminals listen to the same medium as CSMA/CD.
• Terminal ready to transmit senses the medium.
• If medium is busy it waits until the end of current
transmission.
• It again waits for an additional predetermined time period
DIFS (Distributed inter frame Space).
• Then picks up a random number of slots (the initial value of
backoff counter) within a contention window to wait before
transmitting its frame.
• If there are transmissions by other terminals during this time
period (backoff time), the terminal freezes its counter.
• It resumes count down after other terminals finish
transmission + DIFS. The terminal can start its transmission
when the counter reaches to zero.
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
75
CSMA/CA (Cont’d)
Time
Node A’s frame
Nodes B & C sense
the medium
Nodes B resenses the medium
and transmits its frame.
Node C freezes its counter.
Node B’s frame
Nodes C starts
transmitting.
Delay: B
Delay: C
Nodes C resenses the
medium and starts
decrementing its counter.
Node C’s frame
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
76
CSMA/CA Explained
DIFS
Next Frame
Medium Busy
DIFS Contention window
Defer access
Backoff after defer
Slot
Time
DIFS – Distributed Inter Frame Spacing
Contention
window
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
77
CSMA/CA with ACK
• Immediate Acknowledgements from receiver
upon reception of data frame without any need
for sensing the medium.
• ACK frame transmitted after time interval SIFS
(Short Inter-Frame Space) (SIFS < DIFS)
• Receiver transmits ACK without sensing the
medium.
• If ACK is lost, retransmission done.
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
78
CSMA/CA/ACK
DIFS
Next Frame
ACK
Data
Other
Source
Destination
DIFS
SIFS
Contention window
Defer access Backoff after defer
SIFS – Short Inter Frame Spacing
Time
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
Collision of the first bit in CSMA/CD
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
Collision and abortion in CSMA/CD
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
Flow diagram for the CSMA/CD
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
Energy level during transmission, idleness, or collision
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
Timing in CSMA/CA
In CSMA/CA, the IFS can also be used to
define the priority of a station or a frame.
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
84
• In CSMA/CA, if the station finds the channel
busy, it does not restart the timer of the
contention window;
• it stops the timer and restarts it when the
channel becomes idle.
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
Flow diagram for CSMA/CA
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
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 popular controlled-access methods.
Reservation
Polling
Token Passing
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
Reservation access method
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
Select and poll functions in polling access method
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
Logical ring and physical topology in token-passing access method
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
12-3 CHANNELIZATION
Channelization is a multiple-access method in which the available bandwidth of a link
is shared in time, frequency, or through code, between different stations. In this
section, we discuss three channelization protocols.
Frequency-Division Multiple Access (FDMA)
Time-Division Multiple Access (TDMA)
Code-Division Multiple Access (CDMA)
Topics discussed in this section:
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
Frequency-division multiple access (FDMA)
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
Time-division multiple access (TDMA)
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
Simple idea of communication with code
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
Chip sequences
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
Data representation in CDMA
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
Sharing channel in CDMA
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
Digital signal created by four stations in CDMA
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
Decoding of the composite signal for one in CDMA
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
6-99
frame
control
duration
address
1
address
2
address
4
address
3
payload CRC
2 2 6 6 6 2 6 0 - 2312 4
seq
control
Type
From
AP
Subtype
To
AP
More
frag
WEP
More
data
Power
mgt
Retry Rsvd
Protocol
version
2 2 4 1 1 1 1 1 1
1 1
duration of reserved
transmission time (RTS/CTS)
frame seq #
(for RDT)
frame type
(RTS, CTS, ACK, data)
802.11 frame: more
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
100
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
101
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
102
Conclusion
• Error Control
• Flow Control
• Framing concepts
• Error Detection
• Hamming code Error Detection and Correction
• Redundancy
• Checksum
• Elementary Data Link Protocol
• Noiseless and Noisy Channels
• Simplest, Stop and Wait Protocol
• Stop and Wait, Go-Back N ARQ Protocol
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
103
Assignment Questions
1. Calculate the polynomial checksum for the following frame
and generator
Frame: 1101011011and Generator: x4+x+1
2. What are the various types of error detection methods?
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
104
FAQs – Short Answers
1. What is the meaning of P/F field in HDLC control field?
2. Write about Hamming code.
3. With suitable example explain checksum.
4. Differentiate the process of error correction and error
detection in block coding.
5. How to achieve flow control and error control in data link
layer.
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
105
FAQs – Long Answers
1. What are the various types of error detection methods?
2. What are the draw backs of stop and wait protocol? How can
they overcome by sliding window protocol?
3. Explain elementary data link layer protocols.
4. Explain HDLC Protocol.
5. What is the need of Flow control? Explain the common
approaches for flow control in data link layer.
6. Calculate the polynomial checksum for the following frame
and generator
Frame: 1101011011and Generator: x4+x+1 - Long Division
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
106
Interactions
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women, Visakhapatnam
107
B.Sashi Kanth
Assistant Professor
Department of Electronics and Communication Engineering
Vignan’s Institute of Engineering for Women
Affiliated to JNTUK
Visakhapatnam, Andhra Pradesh.
Email ID: sashis2@gmail.com
THANK YOU

More Related Content

PPTX
Computer Networks LAN WAN and MAN PPT-Unit I.pptx
PPTX
Data Communications Physical Layer of OSI
PPT
Computers network Chapter 3 The data link layer.ppt
PPTX
Computer Networks Resource records PPT-Unit VI.pptx
PPTX
Computer Networks shielded PPT-Unit II.pptx
PPT
CN UNIT-I PPT.ppt compuetr networks well material
PPTX
Lecture 2 data link layer 1 v1
PPTX
Lecture18Lecture18Lecture18Lecture18.pptx
Computer Networks LAN WAN and MAN PPT-Unit I.pptx
Data Communications Physical Layer of OSI
Computers network Chapter 3 The data link layer.ppt
Computer Networks Resource records PPT-Unit VI.pptx
Computer Networks shielded PPT-Unit II.pptx
CN UNIT-I PPT.ppt compuetr networks well material
Lecture 2 data link layer 1 v1
Lecture18Lecture18Lecture18Lecture18.pptx

Similar to Computer Networks data link layer PPT-Unit III.pptx (20)

PDF
Lecture Notes Unit III The DataLink Layer
PDF
"Exploring Segment Trees: Concepts and Applications" If you'd like something...
PPTX
Dcn ppt by roma
PPTX
Dcn ppt on data link layer
PPTX
5CS4-03 CN Lecture Unit-2 complete .PPTX
PPTX
CN module for the second od momodule.ppt
PPT
Common Network Architecture:X.25 Networks, Ethernet (Standard and Fast): fram...
PPTX
Computer network coe351- part4- final
PPTX
Data communication network ppt_Unit_4.pptx
PDF
DATA LINK LAYER.pdf
PPTX
III_UNIT_ErrorCorrecting.pptx
PPTX
Chapter 2.1.1.pptx
PDF
Monitoring and Maintenance of Highway Bridges Using Wireless Sensor Networks
PDF
Chapter3-DataLinkLayer-EzharulShort2.pdf
PPTX
Datagram Switching and Virtual Control Switching
PPTX
PPTX
Presentation of computer network on data link layer
PPT
Unit 2 ppt 3.ppt
Lecture Notes Unit III The DataLink Layer
"Exploring Segment Trees: Concepts and Applications" If you'd like something...
Dcn ppt by roma
Dcn ppt on data link layer
5CS4-03 CN Lecture Unit-2 complete .PPTX
CN module for the second od momodule.ppt
Common Network Architecture:X.25 Networks, Ethernet (Standard and Fast): fram...
Computer network coe351- part4- final
Data communication network ppt_Unit_4.pptx
DATA LINK LAYER.pdf
III_UNIT_ErrorCorrecting.pptx
Chapter 2.1.1.pptx
Monitoring and Maintenance of Highway Bridges Using Wireless Sensor Networks
Chapter3-DataLinkLayer-EzharulShort2.pdf
Datagram Switching and Virtual Control Switching
Presentation of computer network on data link layer
Unit 2 ppt 3.ppt
Ad

Recently uploaded (20)

PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPT
Mechanical Engineering MATERIALS Selection
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
DOCX
573137875-Attendance-Management-System-original
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PPT
Project quality management in manufacturing
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PDF
PPT on Performance Review to get promotions
PPTX
CH1 Production IntroductoryConcepts.pptx
PDF
Well-logging-methods_new................
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PDF
Digital Logic Computer Design lecture notes
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
Welding lecture in detail for understanding
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
Mechanical Engineering MATERIALS Selection
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Automation-in-Manufacturing-Chapter-Introduction.pdf
573137875-Attendance-Management-System-original
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
Project quality management in manufacturing
bas. eng. economics group 4 presentation 1.pptx
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPT on Performance Review to get promotions
CH1 Production IntroductoryConcepts.pptx
Well-logging-methods_new................
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Digital Logic Computer Design lecture notes
UNIT 4 Total Quality Management .pptx
Welding lecture in detail for understanding
Model Code of Practice - Construction Work - 21102022 .pdf
Ad

Computer Networks data link layer PPT-Unit III.pptx

  • 1. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam UNIT-III DATA LINK LAYER Vignan’s Institute of Engineering for Women Affiliated to JNTUK Visakhapatnam, Andhra Pradesh.
  • 2. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 2 Data Link Layer Design Issues • The main functions and the design issues of this layer are  Providing services to the network layer  Framing  Error Control  Flow Control  The types of services provided can be of three types −  Unacknowledged connectionless service  Acknowledged connectionless service  Acknowledged connection - oriented service
  • 3. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam Services Provided to Network Layer (a) Virtual communication. (b) Actual communication.
  • 4. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 4 Framing  The data link layer encapsulates each data packet from the network layer into frames that are then transmitted.  A frame has three parts, namely −  Frame Header  Payload field that contains the data packet from network layer  Trailer
  • 5. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam Services Provided to Network Layer (2) Placement of the data link protocol.
  • 6. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 6 Framing Methods • There are 4 types of framing methods:- • 1. Character Count • 2. Flag bytes with byte/char stuffing • 3. Starting and Ending flags with bit stuffing. • 4. Physical layer coding violations
  • 7. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam Framing Character Count:- (a) Without errors (b) With one error
  • 8. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam Flag Byte with byte/Char Stuffing (a) A frame delimited by flag bytes. (b) Four examples of byte sequences before and after stuffing.
  • 9. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam Framing (3) 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.
  • 10. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 10 Error Control • The data link layer ensures error free link for data transmission. The issues it caters to with respect to error control are − Dealing with transmission errors Sending acknowledgement frames in reliable connections Retransmitting lost frames Identifying duplicate frames and deleting them Controlling access to shared channels in case of broadcasting
  • 11. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 11 Flow Control  The data link layer regulates flow control so that a fast sender does not drown a slow receiver.  When the sender sends frames at very high speeds, a slow receiver may not be able to handle it. There will be frame losses even if the transmission is error-free.  The two common approaches for flow control are −  Feedback based flow control  Rate based flow control
  • 12. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam Error Detection and Correction • Error-Correcting Codes • Error-Detecting Codes
  • 13. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 13
  • 14. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam Error-Correcting Codes Use of a Hamming code to correct burst errors.
  • 15. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 15 Hamming Code Sender Sequence Generation • Design the structure of 8 bit hamming code with information bits as 11000010111. • Structure the complete sequence with parity bits:- • Note: • The 8 bit data structure doesn't exist with 4 bit information. • P1 = 0 P2=0 P4=0 P8=1 • Complete Sequence :-110000110110100
  • 16. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 16 • Design the structure of 8 bit hamming code with information bits as 01001011. • Complete Structure with parity bits: • Identify the parity bit positions and parity bit values and complete the sequence. • Say the complete structure.
  • 17. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 17 • A 7 bit hamming code is received as 1100101. Assume odd parity and state whether the received code is correct or wrong. Identify the bit position of error and say the correct sequence? • Correct sequence:- 1100100 • Error is in 1st bit position.
  • 18. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 18 • A 8 bit hamming code is received as 110000110110100. Assume Even parity and state whether the received code is correct or wrong. Identify the bit position of error and say the correct sequence? • Correct sequence:- Same as input received • Error bit position:-no Error
  • 19. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam Error-Detecting Codes Calculation of the polynomial code checksum.
  • 20. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 20 Redundancy • Redundancy is a form of error detection mechanism is sending every data unit twice. • Comparison of data takes place at receiver and know the transmission error and verified.
  • 21. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 21 Block Coding
  • 22. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 22 Checksum • Checksum Generator:-  In the sender, the checksum generator subdivides the data unit into equal segments of n bits. These segments are added with each other by using one’s complement arithmetic in such a way that the total is also n bits long. That total is then complemented and appended to the end of the data unit. • Checksum Checker:  The receiver subdivides the data unit as above and adds all segments together and complements the result. If the extended data unit is intact, the total value found by adding the data segments and the checksum field should be zero. Otherwise the packet contains an error and the receiver rejects it.
  • 23. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 23 EXAMPLE for Checksum: At the sender • Data unit:10101001 00111001 10101001 00111001 • Sum 11100010 • Checksum 00011101 • At the receiver • Received data: 10101001 00111001 00011101 10101001 00111001 00011101 Sum 11111111 Complement 00000000 • It means that the patter is ok.
  • 24. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 24 Example of Check Sum • Sender Data as :- 1101001100101011 • Data Unit into equal bits:- • 11010011 • 00101011 • Checksum :- 00000001 • Received data :- 11010011 00101011 00000001 • No Error in the information.
  • 25. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 25 CYCLIC REDUNDANCY CHECK (CRC) CRC Generator
  • 26. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 26 CRC Checker Data word Accepted Data word not accepted
  • 27. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 27 Elementary Data Link Protocol
  • 28. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 28 • Positive ACK - When the receiver receives a correct frame, it should acknowledge it. • Negative ACK - When the receiver receives a damaged frame or a duplicate frame, it sends a NACK back to the sender and the sender must retransmit the correct frame. • Retransmission: The sender maintains a clock and sets a timeout period. If an acknowledgement of a data-frame previously transmitted does not arrive before the timeout the sender retransmits the frame, thinking that the frame or its acknowledgement is lost in transit. • Piggybacking: In two way communication, whenever a data frame is received, the receiver waits and does not send the control frame (acknowledgement) back to the sender immediately. The receiver waits until its network layer passes in the next data packet. The delayed acknowledgement is then attached to this outgoing data frame. His technique of temporarily delaying the acknowledgement so that it can be hooked with next outgoing data frame is known as piggybacking.
  • 29. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 29 Noiseless Channel Example of Communication Simplest Protocol
  • 30. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 30 No Damaged Frames And No Lost Frames (Perfect Channel)
  • 31. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 31 Stop and Wait Protocol
  • 32. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 32 Stop and Wait Protocol Flow Diagram
  • 33. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 33 Noisy Channels • Noisy channel Mechanisms:- Stop-and-Wait ARQ Go-Back-N ARQ Selective Repeat ARQ
  • 34. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 34 STOP AND WAIT ARQ
  • 35. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 35 Stop and Wait ARQ Flow Diagram Stop and Wait ARQ Normal Operation
  • 36. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 36
  • 37. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 37 Go-Back-N Automatic Repeat Request  In this protocol we can send several frames before receiving acknowledgments; we keep a copy of these frames until the acknowledgments arrive.  These frames must be numbered differently. Frame numbers are called Sequence numbers.  Frames must be received in the correct order  If a frame is lost, the lost frame and all of the following frames must be retransmitted
  • 38. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 38 • Go-Back-N: Window Sizes • For m-bit sequence numbers. Send window size: at most 2m •  Up to 2m -1 frames can be sent without ACK • Receive window size: 1 •  Frames must be received in order
  • 39. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 39 Go-Back-N Automatic Repeat Request Diagram
  • 40. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 40 Go-Back-N ARQ Normal Flow Diagram
  • 41. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 41 Go-Back-N ARQ Normal Lost Diagram
  • 42. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 42 Window Size for Go-Back-N ARQ
  • 43. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 43 Selective Repeat ARQ Send Window Receive Window
  • 44. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 44 Design of Selective Repeat ARQ
  • 45. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 45 Frame Exchange
  • 46. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 46 Negative ACK
  • 47. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 47 Design of piggybacking in Go-Back-N ARQ
  • 48. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 48 High -Level Data Link Control (HDLC)
  • 49. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 49 Asynchronous Balanced Mode
  • 50. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 50 • HDLC defines three types of frames: 1. Information frames :(I-frames) 2. Supervisory frames (S-frames) 3. Unnumbered frames (U-frames)
  • 51. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 51 HDLC Frame Format
  • 52. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 52 N(S) – Frame sequence number, N(R) – Ack sequence number P/F Poll (primary  secondary) Final (secondary  primary)
  • 53. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 53 CASE STUDY NO ACK IN GIVEN TIME PERIOD
  • 54. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 54 Multiple Access Protocols
  • 55. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 55 Random Access Protocols Random access protocols assign uniform priority to all connected nodes. Any node can send data if the transmission channel is idle. No fixed time or fixed sequence is given for data transmission. The four random access protocols are− 1. ALOHA 2. Carrier sense multiple access (CMSA) 3. Carrier sense multiple access with collision detection (CMSA/CD) 4. Carrier sense multiple access with collision avoidance (CMSA/CA)
  • 56. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 56 ALOHA • It is designed for wireless LAN (Local Area Network) but can also be used in a shared medium to transmit data. • Using this method, any station can transmit data across a network simultaneously when a data frameset is available for transmission. ALOHA RULES:- • Any station can transmit data to a channel at any time. • It does not require any carrier sensing. • Collision and data frames may be lost during the transmission of data through multiple stations. • Acknowledgment of the frames exists in Aloha. Hence, there is no collision detection. • It requires retransmission of data after some random amount of time.
  • 57. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 57
  • 58. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 58 ALOHA 1 2 3 3 2 Time Collision Retransmission Retransmission Node 1 Packet Collision mechanism in ALOHA Waiting a random time Node 2 Packet Node 3 Packet
  • 59. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 59 Throughput of ALOHA n ( ) ! n (2G) n P e 2G - = • The probability that n packets arrive in two packets time is given by where G is traffic load.   G e P 2 0   • The probability P(0) that a packet is successfully received without collision is calculated by letting n=0 in the above equation. We get   G e G P G S 2 0      • We can calculate throughput S with a traffic load G as follows: 184 . 0 2 1 max   e S • The Maximum throughput of ALOHA is
  • 60. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 60 SLOTTED ALOHA • The slotted Aloha is designed to overcome the pure Aloha's efficiency because pure Aloha has a very high possibility of frame hitting. • In slotted Aloha, the shared channel is divided into a fixed time interval called slots. • So that, if a station wants to send a frame to a shared channel, the frame can only be sent at the beginning of the slot, and only one frame is allowed to be sent to each slot. • And if the stations are unable to send data to the beginning of the slot, the station will have to wait until the beginning of the slot for the next time. However, the possibility of a collision remains when trying to send a frame at the beginning of two or more station time slot.
  • 61. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 61 Slotted ALOHA 1 2&3 2 Time Collision Retransmission Retransmission 3 Slot Node 1 Packet Nodes 2 & 3 Packets Collision mechanism in slotted ALOHA
  • 62. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 62 Throughput of Slotted ALOHA   G e P   0 • The probability of no collision is given by   G e G P G S      0 • The throughput S is 368 . 0 1 max   e S • The Maximum throughput of slotted ALOHA is
  • 63. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 63 Throughput G 8 6 4 2 0 0.5 0.4 0.3 0.2 0.1 0 Slotted Aloha Aloha 0.368 0.184 G S
  • 64. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 64 CSMA (Carrier Sense Multiple Access) • Max throughput achievable by slotted ALOHA is 0.368. • CSMA gives improved throughput compared to Aloha protocols. • Listens to the channel before transmitting a packet (avoid avoidable collisions).
  • 65. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 65 Collision Mechanism in CSMA 1 2 3 Time Collision 4 Node 4 sense Delay 5 Node 5 sense Delay Node 1 Packet Node 2 Packet Node 3 Packet
  • 66. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 66 Kinds of CSMA CSMA Nonpersistent CSMA Persistent CSMA Unslotted Nonpersistent CSMA Unslotted persistent CSMA Slotted Nonpersistent CSMA Slotted persistent CSMA 1-persistent CSMA p-persistent CSMA
  • 67. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam Behavior of three persistence methods
  • 68. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam Flow diagram for three persistence methods
  • 69. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 69 Nonpersistent/x-persistent CSMA Protocols • Non persistent CSMA Protocol: Step 1: If the medium is idle, transmit immediately Step 2: If the medium is busy, wait a random amount of time and repeat Step 1 – Random backoff reduces probability of collisions – Waste idle time if the backoff time is too long • 1-persistent CSMA Protocol: Step 1: If the medium is idle, transmit immediately Step 2: If the medium is busy, continue to listen until medium becomes idle, and then transmit immediately – There will always be a collision if two nodes want to retransmit (usually you stop transmission attempts after few tries)
  • 70. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 70 Nonpersistent/x-persistent CSMA Protocols • p-persistent CSMA Protocol: Step 1: If the medium is idle, transmit with probability p, and delay for worst case propagation delay for one packet with probability (1-p) Step 2: If the medium is busy, continue to listen until medium becomes idle, then go to Step 1 Step 3: If transmission is delayed by one time slot, continue with Step 1 – A good tradeoff between nonpersistent and 1-persistent CSMA
  • 71. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 71 How to Select Probability p ? • Assume that N nodes have a packet to send and the medium is busy • Then, Np is the expected number of nodes that will attempt to transmit once the medium becomes idle • If Np > 1, then a collision is expected to occur Therefore, network must make sure that Np < 1 to avoid collision, where N is the maximum number of nodes that can be active at a time
  • 72. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 72 Throughput 0 1 2 3 4 5 6 7 8 9 G 1.0 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 S Aloha Slotted Aloha 1-persistent CSMA 0.5-persistent CSMA 0.1-persistent CSMA 0.01-persistent CSMA Nonpersistent CSMA
  • 73. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 73 CSMA/CD (CSMA with Collision Detection) • In CSMA, if 2 terminals begin sending packet at the same time, each will transmit its complete packet (although collision is taking place). • Wasting medium for an entire packet time. • CSMA/CD Step 1: If the medium is idle, transmit Step 2: If the medium is busy, continue to listen until the channel is idle then transmit Step 3: If a collision is detected during transmission, cease transmitting Step 4: Wait a random amount of time and repeats the same algorithm
  • 74. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 74 CSMA/CA (CSMA with collision Avoidance) • All terminals listen to the same medium as CSMA/CD. • Terminal ready to transmit senses the medium. • If medium is busy it waits until the end of current transmission. • It again waits for an additional predetermined time period DIFS (Distributed inter frame Space). • Then picks up a random number of slots (the initial value of backoff counter) within a contention window to wait before transmitting its frame. • If there are transmissions by other terminals during this time period (backoff time), the terminal freezes its counter. • It resumes count down after other terminals finish transmission + DIFS. The terminal can start its transmission when the counter reaches to zero.
  • 75. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 75 CSMA/CA (Cont’d) Time Node A’s frame Nodes B & C sense the medium Nodes B resenses the medium and transmits its frame. Node C freezes its counter. Node B’s frame Nodes C starts transmitting. Delay: B Delay: C Nodes C resenses the medium and starts decrementing its counter. Node C’s frame
  • 76. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 76 CSMA/CA Explained DIFS Next Frame Medium Busy DIFS Contention window Defer access Backoff after defer Slot Time DIFS – Distributed Inter Frame Spacing Contention window
  • 77. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 77 CSMA/CA with ACK • Immediate Acknowledgements from receiver upon reception of data frame without any need for sensing the medium. • ACK frame transmitted after time interval SIFS (Short Inter-Frame Space) (SIFS < DIFS) • Receiver transmits ACK without sensing the medium. • If ACK is lost, retransmission done.
  • 78. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 78 CSMA/CA/ACK DIFS Next Frame ACK Data Other Source Destination DIFS SIFS Contention window Defer access Backoff after defer SIFS – Short Inter Frame Spacing Time
  • 79. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam Collision of the first bit in CSMA/CD
  • 80. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam Collision and abortion in CSMA/CD
  • 81. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam Flow diagram for the CSMA/CD
  • 82. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam Energy level during transmission, idleness, or collision
  • 83. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam Timing in CSMA/CA In CSMA/CA, the IFS can also be used to define the priority of a station or a frame.
  • 84. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 84 • In CSMA/CA, if the station finds the channel busy, it does not restart the timer of the contention window; • it stops the timer and restarts it when the channel becomes idle.
  • 85. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam Flow diagram for CSMA/CA
  • 86. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 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 popular controlled-access methods. Reservation Polling Token Passing
  • 87. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam Reservation access method
  • 88. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam Select and poll functions in polling access method
  • 89. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam Logical ring and physical topology in token-passing access method
  • 90. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 12-3 CHANNELIZATION Channelization is a multiple-access method in which the available bandwidth of a link is shared in time, frequency, or through code, between different stations. In this section, we discuss three channelization protocols. Frequency-Division Multiple Access (FDMA) Time-Division Multiple Access (TDMA) Code-Division Multiple Access (CDMA) Topics discussed in this section:
  • 91. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam Frequency-division multiple access (FDMA)
  • 92. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam Time-division multiple access (TDMA)
  • 93. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam Simple idea of communication with code
  • 94. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam Chip sequences
  • 95. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam Data representation in CDMA
  • 96. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam Sharing channel in CDMA
  • 97. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam Digital signal created by four stations in CDMA
  • 98. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam Decoding of the composite signal for one in CDMA
  • 99. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 6-99 frame control duration address 1 address 2 address 4 address 3 payload CRC 2 2 6 6 6 2 6 0 - 2312 4 seq control Type From AP Subtype To AP More frag WEP More data Power mgt Retry Rsvd Protocol version 2 2 4 1 1 1 1 1 1 1 1 duration of reserved transmission time (RTS/CTS) frame seq # (for RDT) frame type (RTS, CTS, ACK, data) 802.11 frame: more
  • 100. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 100
  • 101. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 101
  • 102. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 102 Conclusion • Error Control • Flow Control • Framing concepts • Error Detection • Hamming code Error Detection and Correction • Redundancy • Checksum • Elementary Data Link Protocol • Noiseless and Noisy Channels • Simplest, Stop and Wait Protocol • Stop and Wait, Go-Back N ARQ Protocol
  • 103. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 103 Assignment Questions 1. Calculate the polynomial checksum for the following frame and generator Frame: 1101011011and Generator: x4+x+1 2. What are the various types of error detection methods?
  • 104. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 104 FAQs – Short Answers 1. What is the meaning of P/F field in HDLC control field? 2. Write about Hamming code. 3. With suitable example explain checksum. 4. Differentiate the process of error correction and error detection in block coding. 5. How to achieve flow control and error control in data link layer.
  • 105. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 105 FAQs – Long Answers 1. What are the various types of error detection methods? 2. What are the draw backs of stop and wait protocol? How can they overcome by sliding window protocol? 3. Explain elementary data link layer protocols. 4. Explain HDLC Protocol. 5. What is the need of Flow control? Explain the common approaches for flow control in data link layer. 6. Calculate the polynomial checksum for the following frame and generator Frame: 1101011011and Generator: x4+x+1 - Long Division
  • 106. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 106 Interactions
  • 107. Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women, Visakhapatnam 107 B.Sashi Kanth Assistant Professor Department of Electronics and Communication Engineering Vignan’s Institute of Engineering for Women Affiliated to JNTUK Visakhapatnam, Andhra Pradesh. Email ID: sashis2@gmail.com THANK YOU