You are on page 1of 136

COLLATE

Data
Communication
& Networks
Notes
Unit 2
02

Syllabus
UNIT – II
Data Link Layer: Design issues, Data Link Control and Protocols:
Flow and Error Control, Stop-and-wait
ARQ. Sliding window protocol, Go-Back-N ARQ, Selective Repeat
ARQ, HDLC, Point-to –Point Access: PPP
Point –to- Point Protocol, PPP Stack,
Medium Access Sub layer: Channel allocation problem, Controlled
Access, Channelization, multiple access
protocols, IEEE standard 802.3 & 802.11 for LANS and WLAN, high-
speed LANs, Token ring, Token Bus,
FDDI based LAN, Network Devices-repeaters, hubs, switches
bridges.

COLLATE
SOURCE - IPU
Unit 2

Data Link Control


Topics to be covered in this unit . . . . . . . . .

 Framing
 Flow Control
 Error Control
 Protocols
~ for Noiseless ( ideal ) Channels
~ for Noisy (practical or real ) Channels
 HDLC Protocol
2-1 FRAMING

 The data link layer needs to pack bits into frames,


so that each frame is distinguishable from another.
 Our postal system practices a type of framing.
The simple act of inserting a letter into an envelope
separates one piece of information from another;
the envelope serves as the delimiter.
Topics discussed in this section:
a) Fixed-Size Framing
[ The size itself acts as delimiter or frame boundary ]
b) Variable-Size Framing
[ special character or bit pattern called flag is used as delimiter ]
A frame in a character-oriented protocol

A frame in a bit-oriented protocol


Byte stuffing and unstuffing

Note

Byte stuffing is the process of adding 1 extra byte


whenever there is a flag or escape character in the text.
Bit stuffing and unstuffing

Note

Bit stuffing is the process of adding one extra 0 whenever


five consecutive 1s follow a 0 in the data, so that the receiver
does not mistake the pattern 01111110 for a flag.
2-2 FLOW AND ERROR CONTROL

The most important responsibilities of the data link


layer are flow control and error control. Collectively,
these functions are known as data link control.

Topics discussed in this section:


a) Flow Control
b) Error Control
Flow control refers to a set of procedures
used to restrict the amount of data
that the sender can send before
waiting for acknowledgment.

Error control in the data link layer is


based on automatic repeat request (ARQ),
which is the retransmission of data.
2-3 PROTOCOLS

 The protocols are normally implemented in software by using one


of the common programming languages.
To make our discussions language-free, we have written in
pseudo code a version of each protocol that concentrates mostly on
the procedure instead of delving into the details of language rules.
2-3 a) NOISELESS CHANNELS

 Let us first assume we have an ideal channel in


which no frames are lost, duplicated, or corrupted.
 In other words, the channel is error free and as a
result we don’t require any error control
mechanism in the corresponding protocols.
 We introduce two protocols for this type of channel.
Topics discussed in this section:
a) Simplest Protocol
b) Stop-and-Wait Protocol
1. Simplest Protocol

 We assume that the receiver can immediately handle any frame


it receives with a processing time that is small enough to be
negligible.
 In other words, the receiver can never be overwhelmed with
incoming frames.
 Hence there is no need for flow control in this scheme.
a) Design
Reciever Site Sender Site
b) Algorithms
c) Flow Diagram [ for Simplest Protocol ]
2. Stop-and-Wait Protocol

 If the data frames arrives at the receiver site faster than they can
processed, the frames must be stored until their use.
 Normally, the receiver does not have enough storage space, especially
if it is receiving data from many sources.
 Hence to prevent the receiver from becoming overwhelmed with
incoming frames, we somehow need to tell the sender to slow down. As
such there must be feedback from the receiver to the sender. In other
words we need to employ a flow control mechanism in the protocol.
 Acknowledgement (ACK) frames that are auxiliary frames help in this
regard.

 The protocol is called Stop-and-Wait protocol because the sender


sends one frame, stops until it receives confirmation from the receiver
(okay to go ahead ) and then sends the next frame.
a) Design

Note :The regions highlighted with red shade indicate additions to the previous protocol.
b) Algorithms

Sender Site
Receiver Site
c) Flow Diagram [ for Stop & Wait Protocol ]
2-3 b) NOISY CHANNELS

Although the Stop-and-Wait Protocol gives us an idea


of how to add flow control to its predecessor, noiseless
channels are nonexistent. We discuss three protocols
in this section that use error control.

Topics discussed in this section:


a) Stop-and-Wait Automatic Repeat Request
b) Go-Back-N Automatic Repeat Request
c) Selective Repeat Automatic Repeat Request
3. Stop-and-Wait ARQ Protocol

 Error correction in Stop-and-Wait ARQ is done by


keeping a copy of the sent frame and retransmitting of
the frame when the timer expires.
 In Stop-and-Wait ARQ, we use sequence numbers to
number the frames. The sequence numbers are based
on modulo-2 arithmetic.

 In Stop-and-Wait ARQ, the acknowledgment number


always announces in modulo-2 arithmetic the sequence
number of the next frame expected.
a) Design
b) Algorithm
Sender Site

(continued) . . . . .
(continued) . . . . . .
Receiver Site
c) Flow Diagram

Data Frame lost in the


middle of transmission.

Acknowledgement Frame lost


in the middle of transmission.
Efficiency & Pipelining
 The Stop & Wait ARQ discussed in the previous section is
very inefficient if our channel is thick and long. By thick it is
meant that the channel has a large bandwidth; by long, we
mean the round-trip delay is long.
 The product of these two is called the bandwidth-delay
product. The bandwidth-delay product is a measure of the
number of bits we can send out of our system while waiting
for news from the receiver.
 Pipelining is a technique in which a task is often begun before
the previous task has ended. This is known as pipelining.
 If we employ pipelining concept then several frames can be
sent before we receive news about the previous frames.
 Pipelining improves efficiency of the transmission if the
number of bits in transition is large with respect to the
bandwidth-delay product.
Efficiency : 1st Numerical
1) Assume that, in a Stop-and-Wait ARQ system, the bandwidth of
the line is 1 Mbps, and 1 bit takes 20 ms to make a round trip. What
is the bandwidth-delay product? If the system data frames are 1000
bits in length, what is the utilization percentage of the link?

Solution
The bandwidth-delay product is

The system can send 20,000 bits during the time it takes for the
data to go from the sender to the receiver and then back again.
However, the system sends only 1000 bits. We can say that the link
utilization is only 1000/20,000, or 5 percent. For this reason, for a
link with a high bandwidth or long delay, the use of Stop-and-Wait
ARQ wastes the capacity of the link.
Efficiency : 2nd Numerical

What is the utilization percentage of the link in


previous numerical example, if we have a protocol that
can send up to 15 frames before stopping and
worrying about the acknowledgments?
Solution
The bandwidth-delay product is still 20,000 bits. The
system can send up to 15 frames or 15,000 bits during a
round trip. This means the utilization is 15,000/20,000, or
75 percent. Of course, if there are damaged frames, the
utilization percentage is much less because frames have
to be resent.
4. Go-Back-N ARQ Protocol

 To improve efficiency of transmission, we should have a


protocol in which multiple frames must be in transition
while waiting for acknowledgement.
 In other words, we need to let more than one frame be
outstanding to keep the channel busy while the sender is
waiting for acknowledgement.
 Go-Back-N is one such protocol. In this protocol
we can send several frames before receiving
acknowledgements; we keep a copy of these frames
until the acknowledgements arrive.
i) Sequence Numbers

In the Go-Back-N Protocol, the sequence


numbers are modulo 2m, where m is the
size of the sequence number field in bits.

For example,
~ if m=2 then the sequence numbers will range from 0 to 3.
( 0, 1, 2, 3 )
~ If m=4 then the sequence numbers will range from 0 to 15.
( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 )
ii) Windows :
a) Send Window :
The send window is an abstract concept
defining an imaginary box of size 2m − 1
with three variables: Sf, Sn, and Ssize.

The send window can slide one


or more slots when a valid
acknowledgment arrives.
b) Receive Window :
The receive window is an abstract concept defining an
imaginary box of size 1 with one single variable Rn.
The window slides when a correct frame has arrived;
sliding occurs one slot at a time.
a) Design

Multiple Frames
Window size for Go-Back-N ARQ

Will work correctly


Will work erroneously

Note

In Go-Back-N ARQ, the size of the send window must be less than 2m;
the size of the receiver window is always 1.
b) Algorithm
Sender Site

(continued . . . . . . . . )
(continued . . . . . . . . . )
Receiver Site

No significant changes here compared to previous protocol


c) Flow Diagram [ for Example 1 ]

Acknowledgement Frame-2 lost.

Note : ACK3 acts as cumulative acknowledgement for both Frames 1 & 2.


Flow Diagram [ for Example 2 ]

Data Frame lost in the


middle of transmission.

Retransmission of
Frames 1, 2 and 3.
Note

Stop-and-Wait ARQ is a special case of


Go-Back-N ARQ in which the size of the
send window is 1.
5. Selective Repeat ARQ Protocol
 Go-Back-N ARQ simplifies the process at the receiver
site. The receiver keeps track of only one variable, and
there is no need to buffer out-of-order frames; they are
simply discarded.
 However, this protocol is very inefficient for a noisy link.
In a noisy link a frame has higher probability of damage,
which means the resending of multiple frames. This
resending uses up the bandwidth and slows down the
transmission.
 For noisy links, there is another mechanism that does
not resend N frames when just one frame is damaged;
only the damaged frame is resent. This mechanism is
called Selective Repeat ARQ. It is more efficient for noisy
links, but processing at the receiver is more complex.
Windows
a) Send window for Selective Repeat ARQ

b) Receive window for Selective Repeat ARQ


a) Design
Selective Repeat ARQ, window size

Will work correctly


Will work erroneously

Note : In Selective Repeat ARQ, the size of the sender and


receiver window must be at most one-half of 2m.
b) Algorithms
Sender Site

(continued . . . . . . . . . )
(continued . . . . . . . . . )
Receiver Site

(continued . . . . . . . . . )
(continued . . . . . . . . . )
Delivery of data in Selective Repeat ARQ
c) Flow diagram

Data Frame lost in the


middle of transmission.

Frame 2 is received and


NAK is sent for Frame 1

Note : ACK4 acts as cumulative acknowledgement for Frames 1, 2 and 3.


Design of piggybacking in Go-Back-N ARQ
11-6 HDLC

High-level Data Link Control (HDLC) is a bit-oriented


protocol for communication over point-to-point and
multipoint links. It implements the ARQ mechanisms
we discussed in this chapter.

Topics discussed in this section:


a) Configurations and Transfer Modes
~ Normal Response Mode [NRM]
~ Asynchronous Balanced Mode [ABM]
b) Frames
c) Control Field
i) Normal Response Mode [ NRM ]
ii) Asynchronous Balanced Mode [ ABM ]
b) HDLC Frames

11.58
c) Control Field Format ( for the different frame types )
U-frame control command and response
Numerical 1 on connection & disconnection in HDLC
Figure in the next slide shows how U-frames can be used
for connection establishment and connection release.
Node A asks for a connection with a set asynchronous
balanced mode (SABM) frame; node B gives a positive
response with an unnumbered acknowledgment (UA)
frame. After these two exchanges, data can be transferred
between the two nodes (not shown in the figure). After
data transfer, node A sends a DISC (disconnect) frame to
release the connection; it is confirmed by node B
responding with a UA (unnumbered acknowledgment).
Example of connection and disconnection
Numerical 2 on piggybacking without error in HDLC

Figure in the next slide shows an exchange using piggybacking. Node


A begins the exchange of information with an I-frame numbered 0
followed by another I-frame numbered 1. Node B piggybacks its
acknowledgment of both frames onto an I-frame of its own. Node B’s
first I-frame is also numbered 0 [N(S) field] and contains a 2 in its
N(R) field, acknowledging the receipt of A’s frames 1 and 0 and
indicating that it expects frame 2 to arrive next. Node B transmits its
second and third I-frames (numbered 1 and 2) before accepting
further frames from node A. Its N(R) information, therefore, has not
changed: B frames 1 and 2 indicate that node B is still expecting A’s
frame 2 to arrive next. Node A has sent all its data. Therefore, it
cannot piggyback an acknowledgment onto an I-frame and sends an
S-frame instead. The RR code indicates that A is still ready to receive.
The number 3 in the N(R) field tells B that frames 0, 1, and 2 have all
been accepted and that A is now expecting frame number 3.
Example of piggybacking without error
Numerical 3 on piggybacking with error in HDLC

Figure in the next slide shows an exchange in which a


frame is lost. Node B sends three data frames (0, 1, and
2), but frame 1 is lost. When node A receives frame 2, it
discards it and sends a REJ frame for frame 1. Note that
the protocol being used is Go-Back-N with the special use
of an REJ frame as a NAK frame. The NAK frame does
two things here: It confirms the receipt of frame 0 and
declares that frame 1 and any following frames must be
resent. Node B, after receiving the REJ frame, resends
frames 1 and 2. Node A acknowledges the receipt by
sending an RR frame (ACK) with acknowledgment
number 3.
Example of piggybacking with error
UNIT – III
DATA LINK LAYER INTRODUCTION
Data Link Layer is second layer of OSI Layered Model. This layer is one of
the most complicated layers and has complex functionalities and liabilities.
Data link layer hides the details of underlying hardware and represents
itself to upper layer as the medium to communicate.

Data link layer works between two hosts which are directly connected in
some sense. This direct connection could be point to point or broadcast.
Systems on broadcast network are said to be on same link. The work of
data link layer tends to get more complex when it is dealing with multiple
hosts on single collision domain.

Data link layer is responsible for converting data stream to signals bit by
bit and to send that over the underlying hardware. At the receiving end,
Data link layer picks up data from hardware which are in the form of
electrical signals, assembles them in a recognizable frame format, and
hands over to upper layer.

Data link layer has two sub-layers:

 Logical Link Control: It deals with protocols, flow-control, and error control

 Media Access Control: It deals with actual control of media

Functionality of Data-link Layer


Data link layer does many tasks on behalf of upper layer. These are:

 Framing

Data-link layer takes packets from Network Layer and encapsulates them into
Frames.Then, it sends each frame bit-by-bit on the hardware. At receiver’ end,
data link layer picks up signals from hardware and assembles them into
frames.

 Addressing

Data-link layer provides layer-2 hardware addressing mechanism. Hardware


address is assumed to be unique on the link. It is encoded into hardware at
the time of manufacturing.

 Synchronization
When data frames are sent on the link, both machines must be synchronized
in order to transfer to take place.

 Error Control

Sometimes signals may have encountered problem in transition and the bits
are flipped.These errors are detected and attempted to recover actual data
bits. It also provides error reporting mechanism to the sender.

 Flow Control

Stations on same link may have different speed or capacity. Data-link layer
ensures flow control that enables both machine to exchange data on same
speed.

 Multi-Access

When host on the shared link tries to transfer the data, it has a high probability
of collision. Data-link layer provides mechanism such as CSMA/CD to equip
capability of accessing a shared media among multiple Systems.

Error Detection & Correction


There are many reasons such as noise, cross-talk etc., which may help
data to get corrupted during transmission. The upper layers work on some
generalized view of network architecture and are not aware of actual
hardware data processing.Hence, the upper layers expect error-free
transmission between the systems. Most of the applications would not
function expectedly if they receive erroneous data. Applications such as
voice and video may not be that affected and with some errors they may
still function well.

Data-link layer uses some error control mechanism to ensure that frames
(data bit streams) are transmitted with certain level of accuracy. But to
understand how errors is controlled, it is essential to know what types of
errors may occur.

Types of Errors
There may be three types of errors:

 Single bit error


In a frame, there is only one bit, anywhere though, which is corrupt.

 Multiple bits error

Frame is received with more than one bits in corrupted state.

 Burst error

Frame contains more than1 consecutive bits corrupted.

Error control mechanism may involve two possible ways:

 Error detection

 Error correction

Error Detection
Errors in the received frames are detected by means of Parity Check and
Cyclic Redundancy Check (CRC). In both cases, few extra bits are sent
along with actual data to confirm that bits received at other end are same
as they were sent. If the counter-check at receiver’ end fails, the bits are
considered corrupted.

Parity Check
One extra bit is sent along with the original bits to make number of 1s
either even in case of even parity, or odd in case of odd parity.

The sender while creating a frame counts the number of 1s in it. For
example, if even parity is used and number of 1s is even then one bit with
value 0 is added. This way number of 1s remains even.If the number of 1s
is odd, to make it even a bit with value 1 is added.
The receiver simply counts the number of 1s in a frame. If the count of 1s
is even and even parity is used, the frame is considered to be not-
corrupted and is accepted. If the count of 1s is odd and odd parity is used,
the frame is still not corrupted.

If a single bit flips in transit, the receiver can detect it by counting the
number of 1s. But when more than one bits are erro neous, then it is very
hard for the receiver to detect the error.

Cyclic Redundancy Check (CRC)


CRC is a different approach to detect if the received frame contains valid
data. This technique involves binary division of the data bits being sent.
The divisor is generated using polynomials. The sender performs a division
operation on the bits being sent and calculates the remainder. Before
sending the actual bits, the sender adds the remainder at the end of the
actual bits. Actual data bits plus the remainder is called a codeword. The
sender transmits data bits as codewords.

At the other end, the receiver performs division operation on codewords


using the same CRC divisor. If the remainder contains all zeros the data
bits are accepted, otherwise it is considered as there some data corruption
occurred in transit.

Error Correction
In the digital world, error correction can be done in two ways:

 Backward Error Correction When the receiver detects an error in the data
received, it requests back the sender to retransmit the data unit.

 Forward Error Correction When the receiver detects some error in the data
received, it executes error-correcting code, which helps it to auto-recover and
to correct some kinds of errors.

The first one, Backward Error Correction, is simple and can only be
efficiently used where retransmitting is not expensive. For example, fiber
optics. But in case of wireless transmission retransmitting may cost too
much. In the latter case, Forward Error Correction is used.

To correct the error in data frame, the receiver must know exactly which
bit in the frame is corrupted. To locate the bit in error, redundant bits are
used as parity bits for error detection.For example, we take ASCII words
(7 bits data), then there could be 8 kind of information we need: first seven
bits to tell us which bit is error and one more bit to tell that there is no
error.

For m data bits, r redundant bits are used. r bits can provide 2r
combinations of information. In m+r bit codeword, there is possibility that
the r bits themselves may get corrupted. So the number of r bits used
must inform about m+r bit locations plus no-error information, i.e.
m+r+1.

Data-link Control & Protocols


Data-link layer is responsible for implementation of point-to-point flow and
error control mechanism.

Flow Control
When a data frame (Layer-2 data) is sent from one host to another over a
single medium, it is required that the sender and receiver should work at
the same speed. That is, sender sends at a speed on which the receiver
can process and accept the data. What if the speed (hardware/software)
of the sender or receiver differs? If sender is sending too fast the receiver
may be overloaded, (swamped) and data may be lost.

Two types of mechanisms can be deployed to control the flow:

 Stop and Wait


This flow control mechanism forces the sender after transmitting a data frame
to stop and wait until the acknowledgement of the data-frame sent is
received.

 Sliding Window

In this flow control mechanism, both sender and receiver agree on the number
of data-frames after which the acknowledgement should be sent. As we learnt,
stop and wait flow control mechanism wastes resources, this protocol tries to
make use of underlying resources as much as possible.

Error Control
When data-frame is transmitted, there is a probability that data-frame
may be lost in the transit or it is received corrupted. In both cases, the
receiver does not receive the correct data-frame and sender does not know
anything about any loss.In such case, both sender and receiver are
equipped with some protocols which helps them to detect transit errors
such as loss of data-frame. Hence, either the sender retransmits the data-
frame or the receiver may request to resend the previous data-frame.

Requirements for error control mechanism:

 Error detection - The sender and receiver, either both or any, must ascertain
that there is some error in the transit.
 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 it’s acknowledgement is lost in transit.

There are three types of techniques available which Data-link layer may
deploy to control the errors by Automatic Repeat Requests (ARQ):

 Stop-and-wait ARQ

The following transition may occur in Stop-and-Wait ARQ:


o The sender maintains a timeout counter.

o When a frame is sent, the sender starts the timeout counter.

o If acknowledgement of frame comes in time, the sender transmits the


next frame in queue.

o If acknowledgement does not come in time, the sender assumes that


either the frame or its acknowledgement is lost in transit. Sender
retransmits the frame and starts the timeout counter.

o If a negative acknowledgement is received, the sender retransmits the


frame.
 Go-Back-N ARQ
Stop and wait ARQ mechanism does not utilize the resources at their
best.When the acknowledgement is received, the sender sits idle and does
nothing. In Go-Back-N ARQ method, both sender and receiver maintain a
window.
The sending-window size enables the sender to send multiple frames without
receiving the acknowledgement of the previous ones. The receiving-window
enables the receiver to receive multiple frames and acknowledge them. The
receiver keeps track of incoming frame’s sequence number.

When the sender sends all the frames in window, it checks up to what
sequence number it has received positive acknowledgement. If all frames are
positively acknowledged, the sender sends next set of frames. If sender finds
that it has received NACK or has not receive any ACK for a particular frame, it
retransmits all the frames after which it does not receive any positive ACK.

 Selective Repeat ARQ


In Go-back-N ARQ, it is assumed that the receiver does not have any buffer
space for its window size and has to process each frame as it comes. This
enforces the sender to retransmit all the frames which are not acknowledged.
In Selective-Repeat ARQ, the receiver while keeping track of sequence
numbers, buffers the frames in memory and sends NACK for only frame which
is missing or damaged.

The sender in this case, sends only packet for which NACK is received.
Multiple Access Links and Protocols
Two types of “links”:
• point-to-point
– PPP for dial-up access
– point-to-point link between Ethernet switch and host
• broadcast (shared wire or medium)
– old-fashioned Ethernet
– 802.11 wireless LAN

humans at a
cocktail party
shared wire (e.g., shared RF
shared RF (shared air, acoustical)
cabled Ethernet) (e.g., 802.11 WiFi)
(satellite)

MUNESH MEENA
MCA 3rd Sem (MLSU)
Point-to-point networks

Point-to-point networks are those in which,when a message is sent from


one computer to another, it usually has to be sent via other computers in
the network.

MUNESH MEENA
MCA 3rd Sem (MLSU)
Broadcast networks

Broadcast networks have a single communication channel that is shared by all the
machines on the network.

Shared channel

MUNESH MEENA
MCA 3rd Sem (MLSU)
Multiple Access protocols

• single shared broadcast channel


• two or more simultaneous transmissions by nodes:
interference
– collision if node receives two or more signals at the same time
multiple access protocol
• distributed algorithm that determines how nodes share
channel, i.e., determine when node can transmit
• communication about channel sharing must use channel itself!
– no out-of-band channel for coordination

MUNESH MEENA
MCA 3rd Sem (MLSU)
Need of protocols in Broadcast channel

Issues in multi-access channel :

• WHO is going to use the channel ?


• WHEN the channel is going to be used ?
• For HOW much time the channel is used ?

MUNESH MEENA
MCA 3rd Sem (MLSU)
Types of Multiple –access protocol

MUNESH MEENA
MCA 3rd Sem (MLSU)
RANDOM ACCESS

• Single channel shared by a large number of hosts


• No coordination between hosts
• Control is completely distributed
• Examples: ALOHA, CSMA, CSMA/CD

MUNESH MEENA
MCA 3rd Sem (MLSU)
ALOHA
There are two versions of Aloha system which differ with respect to
whether or not time is divided up into discrete slots into which all
frames must fit. :

PURE ALOHA

SLOTTED ALOHA

MUNESH MEENA
MCA 3rd Sem (MLSU)
Pure Aloha

MUNESH MEENA
MCA 3rd Sem (MLSU)
If the first bit of a new frame overlaps with just the last bit of a frame
almost finished, both the frames will be totally destroyed. It does not
distinguish between a total loss or a near miss.

MUNESH MEENA
MCA 3rd Sem (MLSU)
Slotted Aloha

• Divide time up into discrete intervals, each corresponding to one packet.

• The stations can only transmit data in one of the time slots only.

• The vulnerable period is now reduced in half. If the frames collide they will
overlap completely instead of partially.

MUNESH MEENA
MCA 3rd Sem (MLSU)
Vulnerable time for slotted ALOHA protocol

MUNESH MEENA
MCA 3rd Sem (MLSU)
MUNESH MEENA
MCA 3rd Sem (MLSU)
CSMA (Carrier Sense Multiple Access)
CSMA: listen before transmit:

• If channel sensed idle: transmit entire frame


• If channel sensed busy, defer transmission

• human analogy: don’t interrupt others!

MUNESH MEENA
MCA 3rd Sem (MLSU)
CSMA collisions
spatial layout of nodes

collisions can still occur:


propagation delay means
two nodes may not hear
each other’s transmission

collision:
entire packet transmission
time wasted

note:
role of distance & propagation delay in
determining collision probability

MUNESH MEENA
MCA 3rd Sem (MLSU)
Carrier sense multiple access with collision detection
• Carrier Sense:- listen for traffic on medium and determines gap between frames.
• Multiple Access:- Station can transmit any time when find network quite.
• Collision Detection:- Occurs when two stations transmits at same time. It gets detected
and trans. Holds for random time.

MUNESH MEENA
MCA 3rd Sem (MLSU)
CSMA/CD (Collision Detection)

CSMA/CD: carrier sensing, deferral as in


CSMA
– collisions detected within short time
– colliding transmissions aborted,
reducing channel wastage
• collision detection:
– easy in wired LANs: measure signal
strengths, compare transmitted,
received signals
– difficult in wireless LANs: received
signal strength overwhelmed by local
transmission strength
• human analogy: the polite
conversationalist

MUNESH MEENA
MCA 3rd Sem (MLSU)
Station is
Station is ready to send
ready to send

New attempt
Wait according to
backoff
Station strategy
is ready to send
(6)

Sense
channel
(1) Channel busy (3)

Channel free
(2)

Collision detected Transmit


Transmit data and sense jam signal
Station is ready to send
Station channel
is ready to send (5)
(4)

MUNESH MEENA
MCA 3rd Sem (MLSU)
Carrier sense multiple access with collision avoidance(CSMA/CA)
• Motivation
– In a wireless network, the received signal has very little energy due
to energy loss in transmission  a collision may add only 5~10%
additional energy  not useful for effective collision detection
• Features
– Tries to avoids collision
– Used in Wireless LAN
 Difficult to detect collisions
 Hidden node problem!
(CTS/RTS used in 802.11)

MUNESH MEENA
MCA 3rd Sem (MLSU)
• Timing in CSMA/CA

• Interframe Space (IFS)


– When an idle channel is found, the station does not send immediately but
waits for a period of time call IFS
– The IFS time allows the front of the transmitted signal by the distant station
to reach this station
– The IFS variable can also be used to prioritize stations or frame types
• e.g., DIFS(Distributed IFS) , SIFS((Short)

MUNESH MEENA
MCA 3rd Sem (MLSU)
1-persistent

MUNESH MEENA
MCA 3rd Sem (MLSU)
Controlled Access
• Approach
– The stations consult one another to find which station has the right
to send
• Controlled access methods
– Reservation
• Ex. DQDB, Cable modem, …
– Polling
• Select and Poll
• Ex. HDLC (normal response mode)
– Token passing
• Ex. Token ring (FDDI), token bus, …

MUNESH MEENA
MCA 3rd Sem (MLSU)
Reservation
• Features
– Time is divided into intervals
• In each interval, a reservation frame precedes the data frames sent in
that interval
– N stations  N reservation minislots in the reservation frame
• When a station needs to send a data frame  it makes a reservation
in its own minislot

MUNESH MEENA
MCA 3rd Sem (MLSU)
Polling
• Motivation and features
– Communication for primary-secondary stations topology
• Ex. NRM mode of HDLC
– The primary station is always the initiator of a session
• By polling (PS) and selecting (PS)
• Select and Poll

MUNESH MEENA
MCA 3rd Sem (MLSU)
Token Passing
• Features
– A station is authorized to send data when it receives a special frame called
a token
– Stations are arranged around a ring (physically or logically)
• A token circulates around the ring
– If a station needs to send data, it waits for the token
– The station captures the token and sends one or more frames as long as
the allocated time has not expired
– It releases the token to be used by the successor station

MUNESH MEENA
MCA 3rd Sem (MLSU)
• Procedure

MUNESH MEENA
MCA 3rd Sem (MLSU)
Channelization
• Definition
– A Multiple-access method in which the available BW of a link is
shared in time, frequency, or through code, between different
stations
• Features
– FDMA, TDMA are based on FDM and TDM in the physical layer
– CDMA is a data link multiple-access protocol

MUNESH MEENA
MCA 3rd Sem (MLSU)
FDMA
• Approach and features
– A data link layer protocol that uses FDM at the physical layer
– The available BW is shared by all stations
– Each stations uses its allocated band to send its data
– Ex. AMPS (1G cellular networks)

MUNESH MEENA
MCA 3rd Sem (MLSU)
MUNESH MEENA
MCA 3rd Sem (MLSU)
TDMA
• Approach and features
– A data link layer protocol that uses TDM at the physical layer
– The stations share the capacity of the channel in time
– Each station is allocated a time slot during which it can send data
– Ex. GSM (2G cellular networks - Europe)

MUNESH MEENA
MCA 3rd Sem (MLSU)
MUNESH MEENA
MCA 3rd Sem (MLSU)
Code Division Multiple Access (CDMA)
• used in several wireless broadcast channels (cellular, satellite,
etc) standards
• unique “code” assigned to each user; i.e., code set partitioning
• all users share same frequency, but each user has own “chipping”
sequence (i.e., code) to encode data
• encoded signal = (original data) X (chipping sequence)
• decoding: inner-product of encoded signal and chipping
sequence
• allows multiple users to “coexist” and transmit simultaneously
with minimal interference (if codes are “orthogonal”)

MUNESH MEENA
MCA 3rd Sem (MLSU)
CDMA Encode/Decode

.
d0 = 1
Zi,m= di cm
data d1 = -1
1 1 1 1 1 1 1 1

sender bits -1 -1 -1 -1 -1 -1 -1 -1

slot 1 slot 0
1 1 1 1 1 1 1 1
channel channel
code -1 -1 -1 -1 -1 -1 -1 -1 output output

slot 1 slot 0

M
.
Di = S Zi,m cm
m=1

1 1 1 1 1 1
M
received 1 1
d0 = 1
-1 -1 -1 -1 -1 -1 -1 -1
receiver input d1 = -1

slot 1 slot 0
1 1 1 1 1 1 1 1
channel channel
code -1 -1 -1 -1 -1 -1 -1 -1 output output

slot 1 slot 0

MUNESH MEENA
MCA 3rd Sem (MLSU)
CDMA: two-sender interference

MUNESH MEENA
MCA 3rd Sem (MLSU)
Thanks!

MUNESH MEENA
MCA 3rd Sem (MLSU)

You might also like