UNIT-2.pptx
UNIT-2.pptx
Examples
• PPP
• HDLC
a) Directly connected, wire-like • Ethernet LAN
b) Losses & errors, but no out-of-sequence • IEEE 802.11 (Wi Fi)
frames LAN
c) Applications: Direct Links; LANs;
Connections across WANs
Data Link Layer Services:
1.3
Framing
transmitted received
frames frames
a) Mapping stream of physical layer
bits into frames
b) Mapping frames into bit stream
c) Frame boundaries can be
determined using: Framing
a) Character Counts
b) Control Characters
c) Flags
d) CRC Checks
0110110111
0111110101
sent .
Starting & Ending characters with character stuffing:
3 1 2 8 1 2 3 4 5 6 7 4 1 2 3
M N O
1.5
Character-Oriented Framing (Byte Stuffing)
Data to be sent
DL ET DL ST
A B E
E X E X
After stuffing and framing
DL ST DL DL ET DL DL ST DL ET
A B E
E X E E X E E X E X
0110111111111100
0111111001101111101111100001111110
0110111111111100
a) Types of Errors:
Errors can be classified into different types. They are
i) Content Error
ii) Flow Integrity Error
Content Error:
These errors are nothing but errors in the content of a message.
Ex: ‘0’ may received as ‘1’ & vice-versa.
These errors may occurred due to noise added into the data signal
during transmission.
Flow Integrity Errors:
It means the missing the blocks of data. It is possible that data
block may be loss in the network as it has been delivered to
the wrong destination
1.10
Depending upon the number of bits errors can be classified into 2
types. They are
i) Single-bit error
ii) Burst error
Single-bit error:
The term single-bit error consists of only one bit get corrupted in
parallel transmission.
Burst error:
More than 1 bit get corrupted in serial transmission due to
occurrences of noise. A byte changed from 1 to 0 or from 0
to 1 then burst errors are occurred.
The length of the burst is measured from first corrupted bit to the
last corrupted bit.
1.11
Codeword:
P D6 D5 D4 D3 D2 D1 D0
P- Parity bit
D6-D0= Data Bits
1.13
7 bits of Data Count of 1 bits 8 Bits including parity bits
EVEN ODD
1.14
Single Parity Check
a) Append an overall parity check to k information bits
Info Bits: b1, b2, b3, …, bk
1.17
a) Limitations of simple parity check:
It is not suitable for detection of multiple errors
Ex:(2,4,6)
Parity checking method cannot reveal the location of error
bits and it cannot be corrected.
Two-Dimensional Parity Check:
❑ Data is in the form of rows and columns. It is applicable for
only 2 errors.
❑ It is used for only detecting error. It doesn’t correct the error.
❑ It is one of the important method of error detection.
❑ When large no of binary words are transmitted or received
i.e a block of data with rows & columns.
1.18
Two-Dimensional Parity Check
1 0 0 1 0 0
0 1 0 0 0 1
1 0 0 1 0 0 Last column consists of
1 1 0 1 1 0 check bits for each row
1 0 0 1 1 1
1.20
a) Sender side
Word A: 1 0 1 1 0 1 1 1
Word B: 0 0 1 0 0 0 1 0
Sum: 11011001
Checksum: 0 0 1 0 0 1 1 0 ( 1’s complement)
Receiver side:
Word A: 1 1 0 1 1 0 0 1
Word B: 0 0 1 0 0 1 1 0
sum: 1 1 1 1 1 1 1 1
Checksum: 0 0 0 0 0 0 0 0 (1’s complement)
Ex: 10110001, 10101011, 00110101,10100001 Find the checksum
of the following message
1.21
Sol: Receiver Data
10110001 10110001
10101011 10101011
101011100 101011100
1 1
01011101 01011101
00110101 00110101
10010010 10010010
10100001 10100001
100110011 100110011
1 1
Sum 0 0 1 1 0 1 0 0 11111111
Check sum 1 1 0 0 1 0 1 1 Check Sum 00000000
1.22
Cyclic Redundancy Check
a) CRC is a block of code that was invented by Wesley Peterson in
1961. It is most commonly used technique to detect the errors in
data transmission.
b) CRC is a type of polynomial code in which a bit stream is
represented in the form of polynomial with coefficients of 0 &
1 only.
c) In CRC code, the sender and receiver should agree upon a
generator polynomial [g(x)]. A codeword generated for a given
data word. Polynomial [m(x)] with the help of long binary
division.
d) CRC is based upon binary division.
e) A sequence of redundant bits is called CRC remainder is
appended at the end of the data unit such as byte.
a) The resulting data unit after adding CRC remainder becomes
exactly divisible by another pre-determined binary number.
b) At the receiver, this data unit is divided by the same binary
number. If the result is 0 , then there is no error in the data
bit.
1.26
CRC Idea - Checkbits & Error
Detection
Information k bits
Received information bits
Recalculate Generator
check bits Polynomial
k bits
Channel
Calculate
check bits Compare
Sent Information
check Received accepted if
bits check bits check bits
Generator match
Polynomial n – k bits
Procedure for CRC Generation:
❑ Append a string of n i.e 0’s to the data unit where n is 1 less
than no of bits in a predefined device.
❑ Divide the newly generated data unit in step 1 by the divisor
using binary division.
❑ The remainder is obtained after division in step-2, the n-bit
CRC.
❑ The CRC will replace the no’s appended to the data unit in
step-1 to get the code-word to be transmitted.
In CRC, check sum method, the transmitted message is
1101011011 & the generator polynomial is g(x)= x^4+x+1.
So what is the dividend at the receiver.
Sol: g(x)= x^4+x+1-> 10011
X^3+1=1001 X^5+x+1=100011
1.28
An Example – Step-by-Step
An Example – Step 1
An Example – Step 2
An Example – Step 3
An Example – Step 4
An Example – Step 5
An Example – Step 6
An Example – Step 7
An Example – Step 8
An Example – Step 9
An Example – Step 10
Overall
Hamming Code:
a) Hamming code was invented by Richard Hamming in 1950.
b) These codes are linear block codes. It is a set of error
correction codes that can be used to detect and correct bit
error that can be occur when computer data is moved or
stored.
c) It can detect up to two simultaneous bit errors and is capable
of correcting single bit error.
d) Structure of Hamming Code:
7-Bit Hamming code
4 –Data Bits , 3 –Parity Bits
D7 D6 D5 P4 D3 P2 P1
1.42
a) 15-bit Hamming Code:
The Parity bits are inserted at each 2^n bit where n=0,1,2,3---
(i.e) P1 is 2^0=1 at first bit P2 is 2^1=2
Selection of Parity Bits:
Selection of P1: P1 is adjusted to ‘0’ or ‘1’. So establish even parity
over bits 1,3,5,7(i.e P1,D3,D5,D7).
Selection of P2: P2 is adjusted to ‘0’ or ‘1’. So establish even parity
over bits 2,3,6,7(i.e P2,D3,D6,D7).
Selection of P4: P1 is adjusted to ‘0’ or ‘1’. So establish even parity
over bits 4,5,6,7(i.e P4,D5,D6,D7).
1.43
a) A Bit word 1011 is to be transmitted. Construct the even
parity 7-bit Hamming code for the data.
D7 D6 D5 P4 D3 P2 P1
1 0 1 1
i) Decide P1:
P1 may be (0 or 1) i.e P1 => 1, 3, 5, 7 => 1 1 1 1 => To become even parity ‘1’
is substituted.
ii) Decide P2:
P2 may be ( 0 or 1) i.e P2=> 2, 3, 6, 7 => 0 1 0 1 => It is in even parity So P2=
0.
iii) Decide P4:
P4 may be (0 or 1) i.e P4 => 4, 5 ,6, 7 => 1 0 1 0 => To make even parity P4
should be ‘0’
1.44
a) Decide P1:
D7 D6 D5 P4 D3 P2 P1
1 0 1 1 1
a) Decide P2:
D7 D6 D5 P4 D3 P2 P1
1 0 1 1 0 1
a) Decide P4:
D7 D6 D5 P4 D3 P2 P1
1 0 1 0 1 0 1
D7 D6 D5 P4 D3 P2 P1
1 0 1 0 1 0 1
1.45
a) If the 7-bit Hamming code received by a receiver is 1011011.Assuming the
even parity, state whether the received codeword is correct or wrong. If
wrong locate the bit in error.
D7 D6 D5 P4 D3 P2 P1
1 0 1 1 0 1 1
Step 1: Analyze bits 4,5,6,7 i.e P4 1 1 0 1 (Odd Parity) . Error exist here
Hence we put P4=1 in the 4th position of the error word.
Step 2: Analyze bits 2,3,6,7 i.e P2 1 0 0 1 (Even Parity) . No error
Hence we put ‘0’ in P2 i.e P2 = 0
Step 3: Analyze bits 1,3,5,7 i.e 1 0 1 1 (Odd Parity). Error exists here
Hence we put P1 = 1 in the 1st position of the error word.
Step 4: Write the error word
Error word E => P4 P2 P1
E= = (5)10
1 0 1
1.46
a) Here , bit 5 of the transmitted codeword is in error.
1 0 1 1 0 1 1
Incorrect bit
Step 5: Correct the error . Correct codeword is given below
1 0 0 1 0 1 1
1.47
Pulse Code Modulation & Delta Modulation:
a) In Physical Layer, It moves the data in the form of electro-magnetic
signals across the transmission medium. The signals can be either
Analog (or) Digital.
b) Analog Signal:
The term “Analog” refers to the information i.e continuous. Analog signals
can have an infinite number of values in a ray.
Ex: Analog clock that has hours, minutes, seconds gives information in a
continuous form.
Digital Signal:
The term “Digital” refers to information that has discrete states. Digital
signals can have only a limited number of values.
Ex: Digital clock that repeats hours, minutes change suddenly from 8:05 pm to
8:06 pm.
1.48
1.49
a) Period:
It refers to amount of time in seconds signal needs to complete one cycle.
❖ Frequency:
It refers to number of periods in one second.
Period is the inverse of frequency and vice versa
F=1/T
Period is expressed in seconds. Frequency is expressed in Hertz.
Transmission Impairments:
There are 3 factors for impairment. They are
1) Attenuation
2) Distortion
3) Noise
1.50
a) Attenuation:
It means a loss of energy. When a signal i.e simple or composite travels
through a medium, it loses some of its energy in overcoming the
resistance of the medium.
a) Distortion:
The signal changes its shape. It occur in composite signal made of different
frequencies.
a) Noise:
External energy that corrupts the signal is called noise. Several types of
noises are: Thermal noise, Induced noise, Impulse noise, and Cross Talk
noise may corrupt the signal.
a) Bandwidth:
The bandwidth of a composite continuous sine wave signal is the difference
between the highest and lowest frequencies contained in the signal.
Composite means a signal is made up of many simple sign waves
1.51
a) Base Band Transmission:
It means sending a digital signal over a channel without changing the digital
signal to the analog signal.
a) Signal to Noise Ratio:
SNR = Average Signal Power/ Average Noise Power
SNRdB =10 log10SNR
1.52
The Maximum Data Rate of a Channel
a) Nyquist’s theorem
1.53
a) Consider a noise less channel with a bandwidth of 3000HZ transmitting
a signal with two signal levels. The maximum bit rate can be calculated
as?
Ans: Bandwidth = 3000 Hz
Level l= 2
Bit rate = 2 * bandwidth * logl2
= 2 * 3000 * log22
= 6000
a) Consider a noise less channel with a bandwidth of 3000HZ transmitting
a signal with four signal levels. The maximum bit rate can be calculated
as?
Ans: Bandwidth = 3000 Hz
Level l= 4
Bit rate = 2 * bandwidth * logl2
= 2 * 3000 * log42
= 12000
1.54
Analog to Digital Conversion:-
1.55
1.56
1.57
a) The Most common technique to change an analog signal to digital data is
called pulse code modulation(PCM). It consists of 3 components.
i) Transmitter ii) Transmission Path iii) Receiver
The operations on the transmitter in PCM system are:
i) Sampling ii) Quantizing iii) Encoding
Sampling:
It is defined as process of measuring instaneous values of continuous time
signal into discrete form (or) the discretization of analog signal called
sampling.
Quantizing:
The method of sampling chooses a few points on the analog signal and then
these points are jointed to round of the value to the nearest stabilized
value. Such process is called quantizing or quantization.
Encoding:
It means to convert body of information from one system to another system
in the form of codes.
1.58
a) PCM was originally developed for telephone communication system.
This is used in digital audio formats such as audio CD’s , DVD’s & Blue
Ray disks.
Delta Modulation:
▪ It is an analog to digital and digital to analog signal conversion
technique. It is used for transmission of voice information.
▪ Delta modulation is the simplest form of Differential Pulse Code
Modulation (DPCM).
▪ In PCM system no of binary digits are transmitted for quantized sample.
Hence the signaling rate and bandwidth of the transmission channel are
very large. These disadvantages are overcome by Delta Modulation.
▪ DM transmits only one bit per sample instead of n bits transmitted in
PCM.
▪ If the step is reduced, 0 is transmitted and if the step is increased , 1 is
transmitted.
1.59
1.60
a) Modulator:
It is used to covert the analog signal to digital signal.
De-Modulator:
It is used to covert the digital signal to analog signal.
Transmission Modes:
Data transmission can be done in two ways . They are
1. Parallel 2. Serial
Parallel Transmission:
▪ We can send the data n-bits at a time instead of 1-bit is called parallel
transmission .
▪ Use n-wires to send n-bits at one-time.
Dis-advantages:
Parallel transmission requires n-communication lines to transmit the data
stream because this is expensive for short distances.
1.61
a) Serial Transmission:
In this mode one bit follows another . So we need only one communication
channel rather than to transmit the data between 2 connected devices.
There are different types in serial transmission
i) Synchronous ii) Asynchronous iii) Isochronous
Synchronous Transmission:
▪ In this type the data flows in full-duplex mode in form of blocks of
frames. In Synchronous requires a clock signal between sender and
receiver so as to inform the receiver about a new byte.
▪ It is efficient and reliable and is used for transferring a large amount of
data.
Ex: Chat rooms, Video conferencing, Telephone Conversation.
Asynchronous Transmission:
▪ In this mode data flows in half-duplex mode i.e 1 byte or a character at a
time.
▪ It transmits the data in continuous stream of bytes.
1.62
a) It doesn’t require a clock for synchronization .
Ex: Letters , emails, forums, televisions and radios.
Q) How many 8-bits can be transmitted per second over a 9600 baud serial
communication link using asynchronous mode of transmission with one
start bit, 8 data bits , 2 stop bits & 1 parity bit.
Ans: Data sent = 1 bit (start) + 8 (char size) + 2 bits (stop) + 1 bit (parity)
=12 bits.
No of characters that can be transmitted per seconds = 9600/12=
= 800 bits
Q) Assume that each character code consists of 8 bits the no of characters that
can be transmitted per second through an synchronous serial line at 2400
baud rate with 2 stop bits.
Ans: Data sent = 8 bits
No of characters that can be transmitted per second = 2400/8= 300 bits
1.63
Multiplexing
Terminal
Frame
Header Information CRC
..
.
Terminal
Host Multiplexer
computer
a) Multiplexing:
In multiplexing system , n input lines given to the system , it gives only one
output.
a) De-multiplexing:
In this system one input line is given to the system, it gives n output lines.
There are 3 types of techniques:
i) FDM (Frequency Division Multiplexing)
ii) TDM (Time Division Multiplexing)
iii) WDM (Wavelength Division Multiplexing)
FDM (Frequency Division Multiplexing):
▪ In the FDM technique no of signals are transmitted at the same time, and
each source transfer it signals in the allotted frequency range.
▪ There is suitable frequency gap between the two adjacent signals to avoid
overlapping.
▪ The signals are transmitted in allotted time. So this decreases the
probability of collision.
1.65
a) The frequency spectrum is divided into several logical channels. Each
channel have separate frequency band to each signal.
b) It is used in Radio broad casting & Telecommunication.
1.66
1.67
Bandwidth
▪Bandwidth is the capacity at which a medium can carry data. Digital
bandwidth measures the amount of data that can flow from one place to
another in a given amount of time. Bandwidth is typically measured in kilobits
per second (kbps), megabits per second (Mbps), or gigabits per second
(Gbps).
▪Bandwidth Terminology the quality of bandwidth include:
•Latency
•Throughput
•Goodput
Latency: Latency refers to the amount of time, including delays, for data to
travel from one given point to another.
Throughput: Throughput is the measure of the transfer of bits across the
media over a given period of time.
Goodput:
a)There is a third measurement to assess the transfer of usable data; it is known
as goodput. Goodput is the measure of usable data transferred over a given
period of time.
1.68
Types of Wireless Media
•Wi-Fi (IEEE 802.11) - Wireless LAN (WLAN) technology, commonly
referred to as Wi-Fi. WLAN uses a contention-based protocol known as carrier
sense multiple access/collision avoidance (CSMA/CA). The wireless NIC must
first listen before transmitting to determine if the radio channel is clear. If
another wireless device is transmitting, then the NIC must wait until the
channel is clear. Wi-Fi is a trademark of the Wi-Fi Alliance. Wi-Fi is used with
certified WLAN devices based on the IEEE 802.11 standards.
•Bluetooth (IEEE 802.15) - This is a wireless personal area network (WPAN)
standard, commonly known as “Bluetooth.” It uses a device pairing process to
communicate over distances from 1 to 100 meters.
•WiMAX (IEEE 802:16) - Commonly known as Worldwide Interoperability
for Microware Access (WiMAX), this wireless standard uses a
point-to-multipoint topology to provide wireless broadband access.
•Zigbee (IEEE 802.15.4) - Zigbee is a specification used for low-data rate,
low-power communications. It is intended for applications that require
short-range, low data-rates and long battery life. Zigbee is typically used for
industrial and Internet of Things (IoT) environments such as wireless light
switches and medical device data collection.
1.69
Data Link Sublayers
•Logical Link Control (LLC) - This IEEE 802.2 sublayer communicates
between the networking software at the upper layers and the device hardware at
the lower layers. It places information in the frame that identifies which network
layer protocol is being used for the frame. This information allows multiple
Layer 3 protocols, such as IPv4 and IPv6, to use the same network interface and
media.
•Media Access Control (MAC) – Implements this sublayer (IEEE 802.3, 802.11,
or 802.15) in hardware. It is responsible for data encapsulation and media access
control. It provides data link layer addressing and it is integrated with various
physical layer technologies.
a)The MAC sublayer provides data encapsulation:
•Frame delimiting - The framing process provides important delimiters to
identify fields within a frame. These delimiting bits provide synchronization
between the transmitting and receiving nodes.
•Addressing - Provides source and destination addressing for transporting the
Layer 2 frame between devices on the same shared medium.
•Error detection - Includes a trailer used to detect transmission errors.
1.70
Data Link Layer Flow Control Protocols:
Protocols
Continued
A positive
acknowledgement
with retransmission
protocol.
Continued
A Simplex Protocol for a Noisy Channel (ctd.)
Continued
Sliding Window Protocol Using Go Back N
Continued
Sliding Window Protocol Using Go Back N
Continued
Sliding Window Protocol Using Go Back N
Selective Repeat ARQ Protocol:
❑In Selective Repeat ARQ, only the erroneous or lost frames are
retransmitted, while correct frames are received and buffered.
❑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 will send / retransmit packet for which NACK is received.
A Sliding Window Protocol Using Selective Repeat
Continued
A Sliding Window Protocol Using Selective Repeat (2)
Continued
A Sliding Window Protocol Using Selective Repeat (3)
Continued
A Sliding Window Protocol Using Selective Repeat (4)
A Sliding Window Protocol Using Selective Repeat (5)
Control field of
(a) An information frame.
(b) A supervisory frame.
(c) An unnumbered frame.
HDLC –Frame Format:
Beginning and Ending Sequence: 01111110
This sequence is also transmitted during any times that the link is idle so
the sender and receiver can keep their clocks synchronized.
Header: Address and Control Field
Body: Payload (variable size)
CRC: Cyclic Redundancy Check (Error Detection)
Types of HDLC Frames:
I-Frame: Information Frame –Ist bit is 0
S-Frame: Supervisory Frame-Ist two bits is 10
U-Frame: Un-Numbered Frame-Ist two bits is 11
Byte Oriented Approach:
❑It simply views the frame as a collection of bytes or characters
Byte Oriented Protocols:
❑BISYNC: Binary Synchronous Communication Protocol
❑PPP: Point to Point Protocol
❑DDCMP: Digital Data Communication Message Protocol
❑PPP(Point to Point Protocol):
❑PPP is a data link layer protocol
❑PPP is a WAN protocol and which is commonly run over internet links.
❑It is widely used in broad band communications having heavy loads and
high speeds.
❑It is used to transmit multiprotocol data between two directly connected
(point-to-point) computers.
PPP – Point to Point Protocol
A) 12 B) 14 C) 17 D) 18
Introduction To Data-Link Layer
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
9.9.3 Two Categories of Links
9.141
Figure 9.3: Dividing the data-link layer into two sublayers
9.142
5-4 LINK-LAYER ADDRESSING
9.143
9.2.1 Three Types of addresses
9.144
Media Access Control
(MAC)
Chapter 5: Outline
12.3 CHANNELIZATION
❑ The first section discusses random-access protocols. Four
protocols, ALOHA, CSMA, CSMA/CD, and CSMA/CA, are
described in this section. These protocols are mostly used in LANs
and WANs.
❑ The second section discusses controlled-access protocols. Three
protocols, reservation, polling, and token-passing, are described in
this section. Some of these protocol are used in LANs, but others
have some historical value.
12.148
a) If more than one station tries to send there is an access
conflict (collision) and the frames will be either destroyed or
modified.
b) To avoid access conflict each station follows procedure.
✔ When can the station access the medium?
✔ What can the station do if the medium is busy?
✔ How can the station determine the success or failure of the
transmission?
✔ What can the station do if there is an access conflict?
Controlled Access Protocols:
❖ 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.
12.149
Channelization Protocols:
❖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.
12.150
Figure 12.1: Taxonomy of multiple-access protocols
12.151
Classification of Multiple Access Protocols
Media Access Control Protocol
12.153
RANDOM ACCESS
12.154
Two features give this method its name.
First:
there is no scheduled time for a station to transmit.
Transmission is random among the stations.
That is why these methods are called random access.
Second:
no rules specify which station should send next.
Stations compete with one another to access the medium.
12.156
ALOHA
❖ ALOHA, the earliest random access method, was developed
at the University of Hawaii in early 1970.
❖ 12.157
The data from the two stations collide and become garbled.
ALOHA Network
Pure ALOHA
12.159
❖ The pure ALOHA protocol relies on acknowledgments from
the receiver. When a station sends a frame, it expects the
receiver to send an acknowledgment. If the acknowledgment
does not arrive after a time-out period, the station assumes
that the frame (or the acknowledgment) has been destroyed
and resends the frame.
❖ A collision involves two or more stations. If all these stations
try to resend their frames after the time-out, the frames will
collide again.
❖ Pure ALOHA dictates that when the time-out period passes,
each station waits a random amount of time before resending
its frame.
❖ The randomness will help avoid more collisions. We call this
time the back-offtime TB.
❖ 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
12.160
destroyed and both will have to be transmitted later.
Figure 12.2: Frames in a pure ALOHA network
12.161
Pure Aloha
Figure 12.3: Procedure for pure ALOHA protocol
12.163
Figure 12.4: Vulnerable time for pure ALOHA protocol
Vulnerable time:
Let us find the vulnerable time, the length of time in which there
is a possibility of collision.
12.164
Throughput:
Let us call G the average number of frames generated by the
system during one frame transmission time.
Then it can be proven that the average number of successfully
transmitted frames for pure ALOHA is S = G x e-2G. The
maximum throughput Smax is 0.184, for G = 1/2.
12.165
Slotted ALOHA:
12.166
Figure 12.5: Frames in a slotted ALOHA network
12.167
Slotted ALOHA
Figure 12.6: Vulnerable time for slotted ALOHA protocol
12.169
Throughput
It can be proven that the average number of successful
transmissions for slotted ALOHA is S = G x e-G.
The maximum throughput Smax is 0.368, when G = 1.
12.170
Pure ALOHA Slotted ALOHA
❖ Any station can transmit the a) Any station can transmit the
data at any time. data at the beginning of
❖ The time is continuous and not anytime slot.
globally synchronized. b) The time is discrete and
❖ Vulnerable time in which globally synchronize.
collision may occur= 2*Tfr c) Vulnerable time in which
❖ Probability of successful collision may occur = Tfr
transmission of data packet is d) Probability of successful
G*e^-2G transmission of data packet.
❖ Maximum efficiency = 18.4 % = G * e ^-G
❖ Simplicity in implementation ❖ Maximum efficiency = 36.8%
occurs at G.
❖ It reduces the number of
collisions to half and doubles
the efficiency of pure aloha.
12.171
CSMA
12.173
Figure 12.8: Vulnerable time in CSMA
Vulnerable Time
The vulnerable time for CSMA is the propagation time Tp. This is
the time needed for a signal to propagate from one end of the
medium to the other. When a station sends a frame and any other
station tries to send a frame during this time, a collision will result.
12.174
Persistence Methods
12.175
Figure 12.9: Behavior of three persistence methods
12.176
1-Persistent CSMA:
❖Before sending the data, the station first listens to the channel to
see if anyone else is transmitting the data at the moment.
❖If the channel is idle, the station transmits a frame.
❖If busy, then it senses the transmission medium continuously until
becomes idle.
❖Since the station transmits the frame with the probability of 1
when the carrier or channel is idle, this scheme of CSMA is
called l-persistent CSMA.
❖The l-persistent method is simple and straightforward. In this
method, after the station finds the line idle, it sends its frame
immediately (with probability 1).
❖ The propagation delay has an important effect on the
performance of the protocol.
❖The longer the propagation delay, the more important this effect
becomes, and the worse the performance of the protocol.
12.177
Non-persistent CSMA
12.178
P-Persistent CSMA
•It applies to slotted channels
•When station becomes ready to send, it senses the channel.
•If it is idle, it transmits with probability P.
•With a probability Q=1-P. It defers until the next slot.
•If that slot is also idle, it either transmits or defers again with
probabilities P and Q.
•This process is repeated until either the frame has been
transmitted or another station has begun transmitting.
•If the station initially senses the channel busy. It waits until the
next slot and applies the above algorithm.
•O-Persistent CSMA :
•Each node is assigned a transmission order by a supervisory
node.
12.179
Figure 12.10: Flow diagram for three persistence methods
12.180
CSMA
12.181
CSMA/CD:
❖If two stations sense the channel to be idle and begin transmitting
simultaneously, then will both detect the collision almost
immediately.
❖Rather than finish transmitting their frames, which are irretrievably
grabbled anyway, they should abruptly stop transmitting as soon as
the collision is detected.
❖Quickly terminating damaged frames saves time and bandwidth.
❖This protocol, known as CSMA/CD is widely used on LANs in the
MAC sublayer.
❖Access method used by ethernet: CSMA/CD
To better understand CSMA/CD, let us look at the first bits
transmitted by the two stations involved in the collision.
12.182
a) The Carrier Sense Multiple Access/ Collision
Detection protocol is used to detect a collision in the media
access control (MAC) layer.
b) Once the collision was detected, the CSMA/CD immediately
stopped the transmission by sending the signal so that the
sender does not waste all the time to send the data packet.
c) Suppose a collision is detected from each station while
broadcasting the packets. In that case, the CSMA/CD
immediately sends a jam signal to stop transmission and
waits for a random time context before transmitting another
data packet.
d) If the channel is found free, it immediately sends the data
and returns it.
12.183
a) Advantages of CSMA/CD:
1. It is used for collision detection on a shared channel within a very short time.
2. CSMA/CD is better than CSMA for collision detection.
3. CSMA/CD is used to avoid any form of waste transmission.
4. When necessary, it is used to use or share the same amount of bandwidth at
each station.
5. It has lower CSMA/CD overhead as compared to the CSMA /CA.
a) Disadvantage of CSMA/CD
1. It is not suitable for long-distance networks because as the distance increases,
CSMA/CD efficiency decreases.
2. It can detect collision only up to 2500 meters, and beyond this range, it cannot
detect collisions.
3. When multiple devices are added to a CSMA/CD, collision detection
performance is reduced.
12.184
Figure 12.11: Collision of the first bits in CSMA/CD
12.185
At time t1, station A has executed its persistence procedure and
starts sending the bits of its frame.
At time t2, station C has not yet sensed the first bit sent by A.
Station C executes its persistence procedure and starts sending
the bits in its frame, which propagate both to the left and to the
right.
The collision occurs sometime after time t2' Station C detects a
collision at time t3 when it receives the first bit of A's frame.
Station C immediately (or after a short time, but we assume
immediately) aborts transmission.
Station A detects collision at time t4 when it receives the first
bit of C's frame; it also immediately aborts transmission.
12.186
Figure 12.12: Collision and abortion in CSMA/CD
12.187
Figure 12.13: Flow diagram for the CSMA/CD
12.188
Figure 12.14: Energy level during transmission, idleness, or collision
12.189
12.1.4
CSMA/CA
Carrier sense multiple access with collision avoidance
(CSMA/CA) was invented for wireless networks.
12.190
CSMA/CA
•CSMA/CA stands for Carrier Sense Multiple Access with Collision Avoidance.
•It means that it is a network protocol that uses to avoid a collision rather than
allowing it to occur, and it does not deal with the recovery of packets after a
collision.
•It is similar to the CSMA CD protocol that operates in the media access control
layer. In CSMA CA, whenever a station sends a data frame to a channel, it checks
whether it is in use.
•If the shared channel is busy, the station waits until the channel enters idle mode.
Hence, we can say that it reduces the chances of collisions and makes better use of
the medium to send data packets more efficiently.
12.191
Advantages of CSMA/CA:
1.When the size of data packets is large, the chances of collision in CSMA/CA is less.
2.It controls the data packets and sends the data when the receiver wants to send them.
3.It is used to prevent collision rather than collision detection on the shared channel.
4.CSMA/CA avoids wasted transmission of data over the channel.
5.It is best suited for wireless transmission in a network.
6.It avoids unnecessary data traffic on the network with the help of the RTS/ CTS
extension.
Disadvantage of CSMA/CA
1.Sometime CSMA/CA takes much waiting time as usual to transmit the data packet.
2.It consumes more bandwidth by each station.
3.Its efficiency is less than a CSMA/CD.
12.192
Interframe Space (IFS).
12.193
The IFS time allows the front of the transmitted signal by the
distant station to reach this station.
After waiting an IFS time, if the channel is still idle, the station
can send, but it still needs to wait a time equal to the contention
window.
12.194
Contention Window
This means that it is set to one slot the first time and then
doubles each time the station cannot detect an idle channel after
the IFS time.
12.195
Acknowledgment
12.196
Figure 12.15: Flow diagram for CSMA/CA
12.197
Figure 12.16: Contention window
12.198
Figure 12.17: CMACA and NAV
12.199
CSMA/CD CSMA/CA
❖ CSMA/CD means Carrier Sense a) CSMA/CA means Carrier Sense
Multiple Access and Collision Multiple Access and Collision
Detection Avoidance
❖ It is the type of CSMA to detect the
collision on a shared channel. b) It is the type of CSMA to avoid
❖ It is the collision detection protocol collision on a shared channel..
❖ It is used in 802.3 Ethernet network c) It is the collision avoidance protocol.
cable. d) It is used in the 802.11 wireless
❖ It works in wired networks. network.
❖ It is effective after collision
detection on a network. e) It works in wireless networks
❖ Whenever a data packet conflicts in f) It is effective before collision
a shared channel, it resends the data detection on a network.
frame. g) Whereas the CSMA/CA waits until the
❖ It minimizes the recovery time. channel is busy and does not recover
❖ The efficiency of CSMA/CD is high after a collision.
as compared to CSMA. h) It minimizes the risk of collision.
❖ It is more popular than the i) The efficiency of CSMA/CA is similar
CSMA/CA protocol. to CSMA.
12.200 j) It is less popular than CSMA/CD.
Collision During Handshaking
12.201
Hidden-Station Problem
12.203
12-2 CONTROLLED ACCESS
12.204
12.2.1 Reservation
12.205
Figure 12.18: Reservation access method
12.206
12.2.2 Polling
12.209
12.2.3 Token Passing
12.210
a) If a node does have frames to transmit when it receives the
token, it sends up to a maximum number of frames and then
forwards the token to the next node.
b) Token passing is decentralized and highly efficient. But it
has problems as well.
c) For example, the failure of one node can crash the entire
channel or if a node accidentally neglects to release token,
then some recovery procedure must be invoked to get the
token back in circulation.
d) Performance of Token Passing:
S= 1/1+a/N : for a<1
S = 1/ (a(1+1/N) : for a>1
a = Tp/Tt
S= Throughput N= No of stations Tp= Propagation Delay Tt=
Transmission delay
12.211
Token Ring
Predecessor : Station which is logically before the station in Ring.
Successor : Station which is logically after the station in Ring.
Token :
A special packet , which circulates in Ring.
Possession of Token gives right to station of accessing Link and
sending Data
Figure 12.20: Logical ring and physical topology in token-passing
access method
12.213
12-3 CHANNELIZATION
12.214
12.3.1 FDMA
12.215
Figure 12.21: Frequency-division multiple access (FDMA)
12.216
12.3.2 TDMA
12.217
Figure 12.22: Time-division multiple access (TDMA)
12.218
12.3.3 CDMA
12.219
Figure 12.23: Simple idea of communication with code
12.220
Figure 12.24: Chip sequences
12.221
Figure 12.25: Data representation in CDMA
12.222
Figure 12.26: Sharing channel in CDMA
12.223
Figure 12.27: Digital signal created by four stations in CDMA
12.224