Nothing Special   »   [go: up one dir, main page]

Module 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 151

Module-1

TCP/IP Protocol Suite

Dr. Pramod T.C


Assistant Professor,
Dept. of CSE
SIT, Tumkur
pramodtc@sit.ac.in
TCP/IP PROTOCOL SUITE
(Transmission Control Protocol / Internet Protocol)

• TCP/IP is a protocol suite (a set of protocols organized in different layers)


used in the Internet today. It is a network model designed to support
network communication.

• The original TCP/IP protocol suite was defined as four software layers built
upon the hardware. Today, however, TCP/IP is thought of as a five-layer
model.
Layered Architecture

We want to use the suite in a small internet made up of three LANs (links), each with a
link-layer switch. We also assume that the links are connected by one router.

Each device is involved with a set of layers depending on the role of the device in the
internet
Layered Architecture
• Let us assume that computer A communicates with computer B.
• Five communicating devices in this communication: Source host (computer
A), the link-layer switch in link 1, the router, the link-layer switch in link 2,
and the destination host (computer B).
• Each device is involved with a set of layers depending on the role of the
device in the internet.
• The two hosts are involved in all five layers:
– The source host needs to create a message in the application layer and
send it down the layers.
– The destination host needs to receive the communication at the
physical layer and then deliver it through the other layers to the
application layer.
• The router is involved in only three layers - router is used only for routing
Layers in the TCP/IP Protocol Suite

• The duty of the application, transport, and network layers is end-to-end.


• The duty of the data-link and physical layers is hop-to-hop, in which a hop
is a host or router.
• The domain of duty of the top three layers is the internet, and the domain of
duty of the two lower layers is the link.
• In the top three layers, the data unit (packets) should not be changed by any
router or link-layer switch. In the bottom two layers, the packet created by
the host is changed only by the routers, not by the link-layer switches.
Layered Architecture
• Although a router is always involved in one network layer, it is involved in
n combinations of link and physical layers in which n is the number of links
the router is connected to.

• Each link may be using different link-layer and physical-layer protocols;


the router needs to receive a packet from link 1 based on one pair of
protocols and deliver it to link 2 based on another pair of protocols.

• Although each switch in the above figure has two different connections, the
connections are in the same link, which uses only one set of protocols
Layers in the TCP/IP Protocol Suite

• The identical objects below each layer related to each device

• The logical connection at the network layer is between the two hosts, we can
only say that identical objects exist between two hops in this case because a
router may fragment the packet at the network layer and send more packets
than received.
Description of Each Layer
Application Layer:
• Layer with which user interacts
• Responsible for providing services to the user.
• Used by user applications (google chrome, firefox, Microsoft outlook) that
pass message from one computer to another in a network. Applications use
application protocols to perform their activities.
• Communication at the application layer is between two processes (two
programs running at this layer).

Protocols:
• Hypertext Transfer Protocol (HTTP) - for accessing the World Wide Web (WWW).
• The Simple Mail Transfer Protocol (SMTP) -used in electronic mail (e-mail)
service.
• The File Transfer Protocol (FTP) -used for transferring files from one host to
another.
• The Terminal Network (TELNET) and Secure Shell (SSH) are used for accessing a
site remotely.
• The Simple Network Management Protocol (SNMP) is used by an administrator to
manage the Internet at global and local levels.
• The Domain Name System (DNS) is used by other protocols to find the network-
layer address of a computer.
Transport Layer
• Service-point addressing (Port address)
• Segmentation and reassembly (Sequence number)
• Connection control (Connectionless (UDP) or connection oriented (TCP))
• Flow control (end to end)
• Error Control (Process to Process)

Protocols: TCP, UDP, SCTP

Network Layer
• Routing
• Path determination
• Logical addressing
• IP is a connectionless protocol (unreliable) that provides no flow control,
no error control, and no congestion control services.
Protocols: IP, ICMP (ping uses), IGMP (multicasting)
Data Link Layer
• Framing (stream of bits into manageable data units)
• Physical addressing (MAC Address)
• Flow Control (mechanism for overwhelming the receiver)
• Error Control (trailer, retransmission)
• Access Control (defining master device in the same link)
• Error detection and correction
• MAC (data encapsulation, access medium) and LLC (flow control, error
control) are the sublayers of data link layer

Protocols: Ethernet, 802.11,CSMA/CD,CSMA/CA, token passing

Physical Layer
• Responsible for movements of individual bits from one hop (node) to the
next
• The purpose of the Physical layer is to create the electrical, optical, or
microwave signal that represents the bits
Protocols: Bluetooth, Ethernet (802.3), DSL, ISDN, 10 Base T
Encapsulation and Decapsulation

Encapsulation: Adding a chunk of data (header) at each layer as data goes from Application to physical layer.

Decapsulation: Reading/removing the data (header) at each layer as data goes from physical to application
layer
Encapsulation at source
Encapsulation at source:
• At the application layer, the data to be exchanged is referred to as a message.
A message normally does not contain any header or trailer.

• The transport layer adds the transport layer header to the payload,
– contains the identifiers (port numbers) of the source and destination application programs that
want to communicate
– information that is needed for the end-to end delivery of the message, such as information
needed for flow, error control, or congestion control.

• The network layer takes the transport-layer packet as data or payload and adds
its own header to the payload.
– The header contains the addresses of the source and destination hosts (IP address)
– some more information used for error checking of the header, fragmentation information

• The data-link layer takes the network-layer packet as data or payload and adds
its own header, which contains
– the link-layer addresses of the host or the next hop (the router). The result is the link-layer
packet, which is called a frame.

• The frame is passed to the physical layer for transmission.


Decapsulation and Encapsulation at the Router

• After the set of bits are delivered to the data-link layer, this layer
decapsulates the datagram from the frame and passes it to the network
layer.

• The network layer only inspects the source and destination addresses in the
datagram header and consults its forwarding table to find the next hop to
which the datagram is to be delivered.

• The contents of the datagram should not be changed by the network layer
in the router unless there is a need to fragment the datagram if it is too big
to be passed through the next link.

• The data-link layer of the next link encapsulates the datagram in a


frame and passes it to the physical layer for transmission
Decapsulation at the Destination Host

• At the destination host, each layer only decapsulates the packet received,
removes the payload, and delivers the payload to the next-higher layer
protocol until the message reaches the application layer.

https://www.youtube.com/watch?v=FJIFfkpUO7o
Addressing
Addressing
• At the application layer, we normally use names to define the site that
provides services, such as someorg.com, or the e-mail address, such as
somebody@coldmail.com.

• At the transport layer, addresses are called port numbers, and these define
the application-layer programs at the source and destination. Port numbers
are local addresses that distinguish between several programs running at
the same time.

• A network-layer address uniquely defines the connection of a device to the


Internet (logical address).

• The link-layer addresses, sometimes called MAC addresses (physical


address) , are locally defined addresses, each of which defines a specific
host or router in a network (LAN or WAN)
Port Numbers -example
Multiplexing and Demultiplexing

• Multiplexing in this case means that a protocol at a layer can encapsulate a


packet from several next-higher layer protocols (one at a time).

• Demultiplexing means that a protocol can decapsulate and deliver a packet to


several next-higher layer protocols.
Multiplexing and Demultiplexing

• To be able to multiplex and demultiplex, a protocol needs to have a field in


its header to identify to which protocol the encapsulated packets belong.

• At the transport layer, either UDP or TCP can accept a message from
several application-layer protocols.

• At the network layer, IP can accept a segment from TCP or a user


datagram from UDP.

• IP can also accept a packet from other protocols such as ICMP, IGMP,
and At the data-link layer, a frame may carry the payload coming from
IP or other protocols such as ARP so on.
Example
DATA RATE LIMITS
• A very important consideration in data communications is how fast we can
send data, in bits per second, over a channel.

• Data rate depends on three factors:


1. The bandwidth available
2. The level of the signals we use
3. The quality of the channel (the level of noise)

• Two theoretical formulas were developed to calculate the data rate:


1. Nyquist for a noiseless channel,
2. Shannon for a noisy channel.
DATA RATE LIMITS
Bandwidth: The bandwidth of a signal is the difference between the highest
and the lowest frequencies contained in that signal.

Signal Levels:

In general, if a signal has L levels, each level needs log2 L bits. log24 = 2 bits
Noiseless Channel: Nyquist Bit Rate
Bitrate: the rate at which bits are transferred from one location to another. It
measures how much data is transmitted in a given amount of time.

Nyquist Bit rate

• Bandwidth - bandwidth of the channel


• L - number of signal levels used to represent data
• BitRate - the bit rate in bits per second

According to the formula, we might think that, given a specific bandwidth, we


can have any bit rate we want by increasing the number of signal levels.
Nyquist Bit Rate
1)

2)

3)
Tradeoff

• When we increase the number of signal levels, we impose a burden on the


receiver.

• If the number of levels in a signal is just 2, the receiver can easily


distinguish between a 0 and a 1.

• If the level of a signal is 64, the receiver must be very sophisticated to


distinguish between 64 different levels.
Noisy Channel: Shannon Capacity

• We cannot have a noiseless channel; the channel is always noisy


• In 1944, Claude Shannon introduced a formula, called the Shannon
capacity, to determine the theoretical highest data rate for a noisy channel:

• Bandwidth is the bandwidth of the channel


• SNR is the signal-to noise ratio
• Capacity is the capacity of the channel in bits per second
• No indication of the signal level, which means that no matter how many
levels we have, we cannot achieve a data rate higher than the capacity of
the channel.
SNR (Signal to Noise Ratio)
Noisy Channel: Shannon Capacity
1)

2)
Using Both Limits
Note

• The Shannon capacity gives us the upper limit; The


equation sets the theoretical upper limit on data rate,
which of course is not fully achieved in practice
• The Nyquist formula tells us how many signal levels we
need
Digital-to-Digital conversion

Line coding Block coding Scrambling

Always needed may or may not be needed


Line Coding
• Line coding converts a sequence of digital bits to a digital signal.

• At the sender, digital data are encoded into a digital signal; at the receiver, the
digital data are recreated by decoding the digital signal.
Characteristics of line coding schemes/ Factors to consider in digital
signaling
• Data Element Versus Signal Element
A data element is the smallest entity that A signal element carries data elements.
can represent a piece of information: this is
the bit
Data elements are what we need to send Signal elements are what we can send.
Data elements are being carried Signal elements are the carriers

ratio r - which is the number of data elements carried by each signal element
Characteristics of line coding schemes
• Data Rate Versus Signal Rate

The data rate defines the number of data The signal rate is the number of signal
elements (bits) sent in 1s elements sent in 1s.
The unit is bits per second (bps). The unit is the baud.
The data rate is sometimes called the bit The signal rate is sometimes called the
rate pulse rate, the modulation rate, or the
baud rate.

“One goal in data communications is to increase the data rate while decreasing the
signal rate”

• Increasing the data rate increases the speed of transmission; decreasing the signal rate
decreases the bandwidth requirement.

• In our vehicle-people analogy, we need to carry more people in fewer vehicles to


prevent traffic jams. We have a limited bandwidth in our transportation system.
Characteristics of line coding schemes
Data Rate Versus Signal Rate
We now need to consider the relationship between data rate (N) and signal rate (S)

This relationship, of course, depends on the value of r. It also depends on the


data pattern. If we have a data pattern of all 1s or all 0s, the signal rate may be
different from a data pattern of alternating 0s and 1s.

The relationship between data rate (N) and signal rate (S), we need to define three
cases: the worst, best, and average.

• The worst case is when we need the maximum signal rate.


• The best case is when we need the minimum.
• In data communications, we are usually interested in the average case.

Save = c X N X (1/r) baud

N is the data rate (bps);


c is the case factor, which varies for each case (worst, best & avg.)
S is the number of signal elements per second;
r is the previously defined factor.
Example 4.1

A signal is carrying data in which one data element is encoded as one signal
element ( r = 1/1). If the bit rate is 100 kbps, what is the average value of the
baud rate if c is between 0 and 1?

Solution
We assume that the average value of c is 1/2 . The baud rate is then

4.38
Characteristics of line coding schemes
• Self-synchronization

• The clocks at the sender and the receiver must have the same bit interval.

• If the receiver clock is faster or slower it will misinterpret the incoming bit stream.

• The sender sends 10110001, while the receiver receives 110111000011.

A self-synchronizing digital signal includes timing information in the data being


transmitted. This can be achieved if there are transitions in the signal that alert the
receiver to the beginning, middle, or end of the pulse. If the receiver‟s clock is out of
synchronization, these points can reset the clock.
Characteristics of line coding schemes
Self-synchronization

In a digital transmission, the receiver clock is 0.1 percent faster than the sender
clock. How many extra bits per second does the receiver receive if the data rate is 1
kbps?

1. 1 bps
2. 10 bps
3. 100 bps
4.1000 bps

At 1 kbps bits send by sender = 1000

Receiver clock is 0.1% faster than sender clock. so Extra bits received by receiver
= 1000 * 0.1/100 =1 bit

Total bits received by received= 1001 bits

Extra bit per second received by receiver= 1 bps


Characteristics of line coding schemes
Self-synchronization

In a digital transmission, the receiver clock is 0.1 percent faster than the sender clock.
How many extra bits per second does the receiver receive if the data rate is 1 Mbps?

1.10 bps
2.100 bps
3.1000 bps
4.10000 bps
Characteristics of line coding schemes
Self-synchronization

In a digital transmission, the receiver clock is 0.1 percent faster than the sender clock.
How many extra bits per second does the receiver receive if the data rate is 1 Mbps?

1.10 bps
2.100 bps
3.1000 bps
4.10000 bps

At 1 Mbps bits send by sender = 1000000

Receiver clock is 0.1% faster than sender clock. so Extra bits received by receiver
= 1000000 * 0.1/100 =1000 bits

Total bits received by received= 1001000 bits

Extra bit per second received by receiver= 1000 bps


Characteristics of line coding schemes
• Baseline Wandering
– In decoding a digital signal, the receiver calculates a running average of the received
signal power. This average is called the baseline.
Average signal power ----> Baseline

– The incoming signal power is evaluated against this baseline to determine the value
of the data element.

– A long string of 0s or 1s can cause a drift in the baseline (baseline wandering) and
make it difficult for the receiver to decode correctly. So, we need to select a line
coding scheme that eliminates this problem.

In decoding a digital signal, the receiver calculates a running average of the received signal
power, called the .
a. baseline
b. base
c. line
d. broadline
Characteristics of line coding schemes
• DC Components
When the voltage level in a digital signal is constant for a while, the spectrum creates very low
frequencies. These frequencies around zero, called DC (direct-current) components, present
problems for a system that cannot pass low frequencies or a system that uses electrical coupling
(via a transformer). For these systems, we need a scheme with no DC component. The signal with
a DC component cannot pass through a transformer.

E.g., in a binary system that transmits a „1‟ as +1 volt and a „0‟ as -1 volt, making the total number
of „0‟and „1‟bits roughly equal over some interval gives a DC balanced signal.

• Complexity
A complex scheme is more costly to implement than a simple one. For example, a scheme that uses
four signal levels is more difficult to interpret than one that uses only two levels.

• Immunity to Noise and Interference


Another desirable code characteristic is a code that is immune to noise and other interferences.
Line Coding Schemes

Line coding converts a sequence of digital bits to a digital signal


(Digital Signal) Line Coding Schemes
Unipolar Scheme
In a unipolar scheme, all the signal levels are on one side of the time axis, either above or
below. Unipolar encoding uses only one voltage level.

NRZ (Non-Return-to-Zero)
• The positive voltage defines bit 1 and the zero voltage defines bit 0. The signal level
does not return to zero during a symbol transmission.
(Digital Signal) Line Coding Schemes
Polar Schemes
• In polar schemes, the voltages are on both sides of the time axis
• The voltage level for 0 can be positive and the voltage level for 1 can be negative.

• There are two versions:


NZR - Level (NRZ-L) - the level of the voltage determines the value of the bit.
positive voltage for one symbol and negative for the other
+ve volt encodes 0
–ve volt encodes 1

NRZ - Inversion (NRZ-I) - the change or lack of change in the level of the voltage
determines the value of the bit. If there is no change, the bit is 0; if there is a change,
the bit is 1.
Note on Unipolar and Polar Line Coding
Unipolar Non return to zero (NRZ)
• Uses more power
• For continuous set of zeros or ones there will be self-synchronization and base line
wandering problem.

Polar NRZ-L and NRZ-I


• Both have an average signal rate of N/2 Bd. Where N is the data rate
• DC component problem and baseline wandering
• Both have no self synchronization & no error detection.
• Both are relatively simple to implement.
Return-to-Zero (RZ)

• It uses three values: positive, negative, and zero.

• The signal goes to 0 in the middle of each bit. It remains there until the beginning
of the next bit.

Note
• This scheme has more signal transitions (two per symbol) and therefore requires a wider
bandwidth.

• No DC components or baseline wandering.

• Self synchronization - transition indicates symbol value.

• More complex as it uses three voltage level. It has no error detection capability.
Biphase: Manchester and Differential Manchester

Manchester encoding, the duration of the bit is divided into two halves. The voltage
remains at one level during the first half and moves to the other level in the second
half.

Differential Manchester, If the next bit is 0, there is a transition; if the next bit is 1,
there is none.
Bipolar Schemes

• In bipolar encoding (sometimes called multilevel binary), there are three voltage
levels:positive, negative, and zero.

Alternate mark inversion (AMI)


• AMI means alternate 1 inversion. A neutral zero voltage represents binary 0.
Binary 1s are represented by alternating positive and negative voltages.

Pseudoternary
• The 1 bit is encoded as a zero voltage and the 0 bit is encoded as alternating
positive and negative voltages.
Multilevel Schemes

The code designers have classified these types of coding as mBnL,


where m is the length of the binary pattern,
B means binary data,
n is the length of the signal pattern, and
L is the number of levels in the signaling.

A letter is often used in place of L:


B (binary) for L = 2,
T (ternary) for L = 3, and
Q (quaternary) for L = 4.

2B1Q (two binary, one quaternary)


Multilevel Schemes
2B1Q (two binary, one quaternary)

m = 2, n = 1, and L = 4 (quaternary).

0011011001

Note: The 2B1Q scheme is used in DSL (Digital Subscriber Line) technology to provide a
high-speed connection to the Internet by using subscriber telephone lines
Multilevel Schemes
2B1Q

Digitaldata: 11001100101110
Multilevel Schemes
8B6T (eight binary, six ternary)
• This code is used with 100BASE-4T cable
• The idea is to encode a pattern of 8 bits as a pattern of six signal elements, where the
signal has three levels (ternary).
• 2^8 = 256 different data patterns and 3^6 = 729 different signal patterns.

Three data patterns encoded as three signal patterns

Each signal pattern has a weight of 0 or +1 DC values. This means that there is no pattern with
the weight −1. To make the whole stream DC-balanced, the sender keeps track of the weight. If
two groups of weight 1 are encountered one after another, the first one is sent as is, while the next
one is totally inverted to give a weight of −1.
Multilevel Schemes
4D-PAM5 four-dimensional five level pulse amplitude modulation

• 4D means that data is sent over four wires at the same time
• It uses five voltage levels, such as −2, −1, 0, 1, and 2
• All 8 bits can be fed into a wire simultaneously and sent by using one signal element.
The point here is that the four signal elements comprising one signal group are sent
simultaneously in a four dimensional setting.
• Gigabit LANs use this encoding technique to transmit 1 Gbps data over four copper
cables which can handle 125 Mbaud.
Multitransition: MLT-3

The multiline transmission, three-level (MLT-3) scheme uses three levels (+V, 0, and −V)
and three transition rules to move between the levels.
1. If the next bit is 0, there is no transition.
2. If the next bit is 1 and the current level is not 0, the next level is 0.
3. If the next bit is 1 and the current level is 0, the next level is the opposite of the last
nonzero level.
Multitransition: MLT-3

1. If the next bit is 0, there is no transition.


2. If the next bit is 1 and the current level is not 0, the next
level is 0.
3. If the next bit is 1 and the current level is 0, the next level is
the opposite of the last nonzero level.

+ve neutral -ve


Consider the binary sequence: 011101110.
Draw the line coding graph for the following:
NRZ-L
NRZ-I
Polar RZ
Manchester encoding
Differential Manchester encoding
AMI encoding
Psuedometry encoding
Block Coding
• We need redundancy to ensure synchronization and to provide some kind of inherent
error detecting. Block coding is normally referred to as mB/nB coding, where n is
larger than m; it replaces each m-bit group with an n-bit group.

• Block coding normally involves three steps: division, substitution, and combination

• In the division step, a sequence of bits is divided into groups of m bits. For example,
in 4B/5B encoding, the original bit sequence is divided into 4-bit groups.

• In the substitution step, we substitute an m-bit group with an n-bit group. For
example, in 4B/5B encoding we substitute a 4-bit group with a 5-bit group.

• In the combination step, the n-bit groups are combined to form a stream. The new
stream has more bits than the original bits.
4B/5B (four binary/five binary)

• NRZ-I has a good signal rate. But it has a synchronization problem. A long
sequence of 0s can make the receiver clock lose synchronization.

• The 4B/5B scheme achieves this goal. The block-coded stream does not have more
that three consecutive 0s.

• At the receiver, the NRZ-I encoded digital signal is first decoded into a stream of
bits and then decoded to remove the redundancy.
4B/5B (four binary/five binary)

• The first two columns pair a 4-bit group with a 5-bit group.
• A group of 4 bits can have only 16 different combinations. while a group of 5 bits can
have 32 different combinations.
• This means that there are 16 groups that are not used for 4B/5B encoding. Some of these
unused groups are used for control purposes; the others are not used at all. The latter
provide a kind of error detection.
8B/10B (eight binary/ten binary)
• Similar to 4B/5B encoding except that a group of 8 bits of data is now substituted
by a 10-bit code. Provides greater error detection capability than 4B/5B.

• The 8B/10B block coding is actually a combination of 5B/6B and 3B/4B encoding

• The five most significant bits of a 10-bit block are fed into the 5B/6B encoder; the
three least significant bits are fed into a 3B/4B encoder. The split is done to
simplify the mapping table.

• To prevent a long run of consecutive 0s or 1s, the code uses a disparity controller
which keeps track of excess 0s over 1s (or 1s over 0s)

2^10 − 2^8 = 768 redundant groups that can be used for disparity checking and error
detection.
Scrambling – convert digital data to digital signal

Scrambling is a technique that does not increase the number of bits and does provide
synchronization. Problem with technique like Bipolar AMI(Alternate Mark Inversion)
is that continuous sequence of zero‟s create synchronization problems one solution to
this is Scrambling.
There are two common scrambling techniques:
• B8ZS(Bipolar with 8-zero substitution)
• HDB3(High-density bipolar3-zero)
B8ZS (Bipolar with 8-zero substitution)
It is commonly used in North America. eight consecutive zero-level voltages are replaced
by the sequence 000VB0VB (V- violation and B-bipolar)

Zero – no changes. One- Changes based on the previous value


HDB3 (High-density bipolar 3-zero)
Four consecutive zero-level voltages are replaced with a sequence of 000V or B00V.

1. If the number of nonzero pulses after the last substitution is odd, the substitution
pattern will be 000V, which makes the total number of nonzero pulses even.

2. If the number of nonzero pulses after the last substitution is even, the substitution
pattern will be B00V, which makes the total number of nonzero pulses even.

B00V -even +00+


000V -odd 000-
ANALOG-TO-DIGITAL CONVERSION

A digital signal is superior to an analog signal because it is more robust to noise


and can easily be recovered, corrected and amplified. For this reason, the
tendency today is to change an analog signal to digital data

Techniques
1. Pulse Code Modulation (PCM)
2. Delta Modulation (DM)

https://www.youtube.com/watch?v=cmc-BPtkdAU
Example
Example
Pulse Code Modulation (PCM)
• A technique by which analog signal gets converted into digital form
• A PCM encoder has three processes:
1. Sampling
2. Quantization
3. Binary encoding
Sampling
• The process of obtaining amplitudes of a signal at regular intervals.
• Analog signal is sampled every TS secs.
• Ts is referred to as the sampling interval.
• fs = 1/Ts is called the sampling rate or sampling frequency (is the number
of samples per second).
• There are 3 sampling methods:
– Ideal - an impulse at each sampling instant
– Natural - a pulse of short width with varying amplitude
– Flattop - sample and hold, like natural but with single amplitude value
• The sampling process is sometimes referred to as pulse amplitude
modulation (PAM)..

Ts

4.73
Figure 4.22 Three different sampling methods for PCM

4.74
Note
Impulse/Ideal sampling can be performed by multiplying input signal x(t) with impulse train of
period 'T'. Here, the amplitude of impulse changes with respect to amplitude of input signal x(t)

Natural sampling is similar to impulse sampling, except the impulse train is replaced by
pulse train of period T.

Flat top: Here, the top of the samples are flat i.e. they have constant amplitude. Hence,
it is called as flat top sampling or practical sampling. Flat top sampling makes use of
sample and hold circuit.
Sampling Rate
Note

According to the Nyquist theorem, the


sampling rate must be
at least 2 times the highest frequency
contained in the signal.
Why so?
If the sampling is performed at a proper rate, no info is lost about the original signal
and it can be properly reconstructed later on.

Sampling rate for telephone : 8Khz (8000 samples per second)


Sampling rate for Mp3 : 44Khz
Sampling rate for Blueray disc :1Mhz
4.76
Figure 4.23 Nyquist sampling rate for low-pass and bandpass signals

4.77
Example 4.6

For an intuitive example of the Nyquist theorem, let us sample a simple sine wave
at three sampling rates:
fs = 4f (2 times the Nyquist rate),
fs = 2f ( Nyquist rate), and
fs = f (one-half the Nyquist rate). Figure 4.24 shows the sampling and the
subsequent recovery of the signal.

It can be seen that sampling at the Nyquist rate can create a good
approximation of the original sine wave (part a).

Oversampling in part b can also create the same approximation, but it is redundant
and unnecessary.

Sampling below the Nyquist rate (part c) does not produce a signal that looks like
the original sine wave.

4.78
Figure 4.24 Recovery of a sampled sine wave for different sampling rates

4.79
Example 4.9
Telephone companies digitize voice by assuming a maximum frequency of 4000 Hz. The
sampling rate therefore is 2x4000= 8000 samples per second.

Example 4.10
A complex low-pass signal has a bandwidth of 200 kHz. What is the minimum sampling
rate for this signal?
Solution
The bandwidth of a low-pass signal is between 0 and f, where f is the maximum
frequency in the signal. Therefore, we can sample this signal at 2 times the highest
frequency (200 kHz). The sampling rate is therefore 400,000 samples per second.

Example 4.11
A complex bandpass signal has a bandwidth of 200 kHz. What is the minimum sampling
rate for this signal?
Solution
We cannot find the minimum sampling rate in this case because we do not know where
the bandwidth starts or ends. We do not know the maximum frequency in the signal.
Example 4.9
Let us assume, VOIP application digitize voice by assuming a maximum frequency of
7000 Hz. What is the sampling rate?

Ans:2*7000=14000 samples per second


Quantization
• Sampling results in a series of pulses of varying amplitude values ranging between
two limits: a min and a max.
• The amplitude values are infinite between the two limits.
• We need to map the infinite amplitude values onto a finite set of known values. So,
we have to make discrete amplitude levels and sample at any point can take only
these values (Rounding off of the signal to its nearest level-quantization level)

The following are the steps in quantization:


Quantization
• Assume we have a voltage signal with amplitudes Vmin=-20V and
Vmax=+20V.

• We want to use L=8 quantization levels.

• Zone width  = ((+20) – (-20))/8 = 5

• The 8 zones are: -20 to -15, -15 to -10, -10 to -5, -5 to 0, 0 to +5, +5 to +10,
+10 to +15, +15 to +20

• The midpoints are: -17.5, -12.5, -7.5, -2.5, 2.5, 7.5, 12.5, 17.5

+20

-20
Quantization
• Assume we have a voltage signal with amplitudes Vmin=-20V and
Vmax=+20V.

• We want to use L=8 quantization levels.

• Zone width  = ((+20) – (-20))/8 = 5

• The 8 zones are: -20 to -15, -15 to -10, -10 to -5, -5 to 0, 0 to +5, +5 to +10,
+10 to +15, +15 to +20

• The midpoints are: -17.5, -12.5, -7.5, -2.5, 2.5, 7.5, 12.5, 17.5
Rounding off of the signal to its nearest level-quantization level
Levels
7 +20
6 15
5 10
4
5
0
3
-5
2 -10
1 -15
0 -20
Quantization
Assigning Codes to Zones
Encoding
• Each zone is then assigned a binary code.
• The number of bits required to encode the zones, or the number of bits per
sample as it is commonly referred to, is obtained as follows:
nb = log2 L
• Given our example, nb = log2 8 =3
• Digital representation: The 8 zone (or level) codes are therefore: 000, 001,
010, 011, 100, 101, 110, and 111
• Assigning codes to zones:
– 000 will refer to zone -20 to -15
– 001 to zone -15 to -10, etc.

101 110

4.86
Figure 4.26
Quantization
nine samples

• Quantization is an approximation process.


• The assignment of a specific range of values to signal amplitudes
Note

Sample frequency = 8 samples per second

Quantized using 2 bits = 4 levels (-1, -0.5, 0, +0.5)


–quantized values

 = ((+1) – (-1))/4 = 0.5


Log2 2^2 =2

10 11 11 11 10 01 00 01
Quantization
Note: The choice of L, the number of levels, depends on the range of the amplitudes of the analog
signal and how accurately we need to recover the signal.

• If the amplitude of a signal fluctuates between two values only, we need only two levels.
• In audio digitizing, L is normally chosen to be 256;
• If the signal, like voice, has many amplitude values, we need more quantization levels.
• In video it is normally thousands.

Choosing lower values of L increases the quantization error if there is a lot of


fluctuation in the signal.
Quantization Error
• When a signal is quantized, we introduce an error - the coded signal is an
approximation of the actual amplitude value.
• The difference between actual and coded value (midpoint) is referred to as
the quantization error.
• This can be minimized by increasing the number of quantization levels – more
zones.
• The more zones, the smaller  which results in smaller errors.
• BUT, the more zones the more bits required to encode the samples -> higher bit
rate

Example
• If the input value is also at the middle of the zone, there is no quantization error;
otherwise, there is an error.
• The normalized amplitude of the third sample is 3.24, but the normalized
quantized value is 3.50. This means that there is an error of 3.50-3.24= +0.26.

4.91
Quantization Error and SNQR
• SNR is actually the ratio of what is wanted (signal) to what is not wanted (noise).
A high SNR means the signal is less corrupted by noise; a low SNR means the
signal is more corrupted by noise.

• Shannon Capacity: To determine the theoretical highest data rate for a noisy
channel:

• The quantization error changes the signal-to-noise ratio of the signal, which
in turn reduces the upper limit capacity according to Shannon

• It can be proven that, the Quantization error to the SNRdB of the signal
depends on the number of quantization levels L, or the bits per sample nb,

SNRdB = 6.02nb + 1.76 dB


Quantization Error and SNQR
Example 4.12
• What is the SNRdB in the example of Figure 4.26?

We can use the formula to find the quantization. We have eight levels and 3 bits
per sample, so SNRdB = 6.02(3) + 1.76 = 19.82 dB.

Increasing the number of levels increases the SNR.

Example 4.13
A telephone subscriber line must have an SNRdB above 40. What is the minimum
number of bits per sample?
Solution
We can calculate the number of bits as Telephone companies usually assign 7 or 8 bits
per sample.
SNRdB = 6.02nb + 1.76

6.02nb+1.76=40
nb=(40-1.76)/6.02 =6.35
Uniform Versus Nonuniform Quantization

• In nonuniform, the height of Δ is not fixed; it is greater near the lower amplitudes and less
near the higher amplitudes.
• Nonuniform quantization can also be achieved by using a process called companding and
expanding
• Companding means reducing the instantaneous voltage amplitude for large values; expanding
is the opposite process.
Companding refers to a technique for compressing and then expanding (or decompressing) an
analog or digital signal.
Original Signal Recovery (PCM Decoder)
To recover an analog signal from a digitized signal we follow the
following steps:
• The decoder first uses circuitry to convert the code words into a pulse
that holds the amplitude until the next pulse.
• After the staircase signal is completed, it is passed through a low-pass
filter to smooth the staircase signal into an analog signal.
• The filter has the same cutoff frequency as the original signal at the
sender.
The higher the value of L, the less distorted a signal is recovered.
Bit rate and bandwidth requirements of PCM

• The bit rate of a PCM signal can be calculated


Bit rate = nb (number of bits per sample) x fs (sampling rate)

• The bandwidth required to transmit this signal depends on the type of


line encoding used.

• A digitized signal will always need more bandwidth than the original
analog signal. Price we pay for robustness and other features of digital
transmission.

4.96
Example 4.14

We want to digitize the human voice. What is the bit


rate, assuming 8 bits per sample?

Solution
The human voice normally contains frequencies from 0
to 4000 Hz. So the sampling rate and bit rate are
calculated as follows:

Maximum Freq = 4000 Hz


Fs = 2 x fmax
Bit rate = nb x fs

4.97
Delta Modulation (DM) – Analog to Digital

step size is
constant

1 bit per sample

• This scheme sends only the difference between pulses, if the pulse at time tn+1 is
higher in amplitude value than the pulse at time tn, then a single bit, say a “1”, is
used to indicate the positive value. If the pulse is lower in value, resulting in a
negative value, a “0” is used.

• This scheme works well for small changes in signal values between samples.

• If changes in amplitude are large, this will result in large errors.

The process records the small positive or negative changes, called delta δ. If the delta
is positive, the process records a 1; if it is negative, the process records a 0.
Delta Modulation (DM)

• The modulator, at each sampling interval, compares the value of the analog signal
with the last value of the staircase signal. If the amplitude of the analog signal is
larger, the next bit in the digital data is 1; otherwise, it is 0.

• The output of the comparator, however, also makes the staircase itself. If the next bit
is 1, the staircase maker moves the last point of the staircase signal δ up; if the next
bit is 0, it moves it δ down.

• Delay unit - to hold the staircase function for a period between two comparisons.
Delta Modulation (DM)

The demodulator takes the digital data and, using the staircase maker and the delay
unit, creates the analog signal. The created analog signal, however, needs to pass
through a low-pass filter for smoothing.
Error Detection- Introduction
• For most applications, a system must guarantee that the data received are
identical to the data transmitted.

• Many factors (Attenuation - loss of energy, distortion - changes its form or


shape, noise, and interference-unwanted signals) can alter one or more bits
of a message. Some applications require a mechanism for detecting and
correcting errors.

• Some applications can tolerate a small level of error. For example, random
errors in audio or video transmissions may be tolerable, but when we
transfer text, we expect a very high level of accuracy.

• Data link layer – error detection and correction functionality


Types of Errors

• Whenever bits flow from one point to another, they are subject to
unpredictable changes because of interference (change the shape of the
signal).

• Single-bit error: changed from 1 to 0 or from 0 to 1.


• Burst error: Two or more bits in the data unit have changed from 1 to 0 or
from 0 to 1
Cyclic Redundancy Check (CRC)
• Cyclic Redundancy Check (CRC) is an error detection method.
• It is based on binary division.
• The communicating parties agrees upon the size of message block and the
CRC divisor.
• For example, the block chosen may be CRC (7, 4), where 7 is the total
length of the block and 4 is the number of bits in the data segment. The
divisor chosen may be 1011.
• Used in networks such as LANs and WANs
Figure 10.15 Division in CRC encoder

Dataword:1001000
Divisor: 1011

10.
Figure 10.16 Division in the CRC decoder for two cases

10.
Assume the data to be transmitted is
Data: 100100
Divisor:1101
Sender 100100 000 (one number less than the divisor)
111101
1101 100100000
1101
1000
1101 Sender sends the codeword to receiver:
1010 100100001
1101
1110
1101
0110
0000
1100
1101
001
Assume the data to be transmitted is
Data: 100100
Divisor:1101
Receiver received 100100001

111101
1101 100100001
1101
1000
1101
1010
1101
1110
1101
0110
0000
1101
1101
Syndrome=0 ---- no errors
0000
CRC encoder and decoder

• The dataword has k bits (4 here); the codeword has n bits (7 here).
• The size of the dataword is augmented by adding n − k (3 here) 0s to the right hand side
of the word. The n-bit result is fed into the generator.
• The generator uses a divisor of size n − k + 1 (4 here), predefined and agreed upon.
• The generator divides the augmented dataword by the divisor (modulo-2 division).
• The quotient of the division is discarded; the remainder (r2r1r0) is appended to the
dataword to create the codeword.
Question
A bit stream 10011101 is transmitted using the standard CRC
method. The divisor is 1001.
• What is the actual bit string transmitted?
Polynomials
• We can use a polynomial to represent a binary word.

Note
• The degree of a polynomial is the highest power in the polynomial. For example, the
degree of the polynomial x6 + x + 1 is 6. Note that the degree of a polynomial is 1 less
than the number of bits in the pattern.

Addition: x5 + x4 + x2 Multiplication: x3 × x4 is x7
x6 + x4 + x2
x6 + x5 Division: x6/x3, or x3
Polynomials
1. The information sequence (x) =100100000. Write the corresponding polynomial
equation.

100100000 = 1. x^8+0.x^7+0.x^6+1.x^5+0.x^4+0.x^3+0.x^2+0.x^1+0.x^0 = x^8 + x^5

2. What is the corresponding polynomial of i) 100 ii) 1101 iii) 1 0 1 0 1 0


100 – x^2
1101 – x^3+X^2+1
101010 - X^5 +X^3 +X
1101101 - X6+x5+x3+x2+1

The divisor in a cyclic code is normally called the generator polynomial g(x) or
simply the generator.
Let Divisor / g(x)=x^3 + x+1. Consider the information sequence:1001000
1001000=x^6 +X^3

Sender
X^3+x

x^3 + x+1 x^6 +x^3


x^6+x^4+x^3
x^4
x^4+x^2+x Sender sends the codeword to receiver:
x^2+x x^6 +x^3+x^2+x

Note: we continue to divide until the degree of the remainder is less than the degree of
the divisor.
Let g(x)=x^3 + x+1. Consider the information sequence:1001011
1001011=x^6 +X^3

Receiver
X^3+x^1

x^3 + x+1 x^6 +x^3+x^2+x


X^6+x^4+x^3
X^4+X^2+X
X^4+X2+X Sender sends the codeword to receiver:
000
Question
• Generator: x^3 +X^2+1 Data :x^8 +x^5 Find the codeword
X5+X4
x^3 +X^2+1 x^8 +x^5
X^8+X^7+X5
X^7
X^7+x^5+x4
x^5+x4

x^3 +X^2+1 x^8 +x^5+1

0
Does CRC detect all errors (1 bit, 2bits and burst errors) ?
• Divisor polynomial (generator): x^2 which corresponds to 1 0 0 and

• The message to be transmitted: 1 0 1 0 1 0 (x^5+x^3+x^1)

• After appending CRC bits ( when we divide 101011 with the generator 100 , CRC is
0 0) we get 1 0 1 0 1 0 0 0.

• Assuming during the data transmission, the 3rd bit is in error and the message received
at the receiver is 1 0 1 0 1 ˆ1 0 0. On performing CRC check on 1 0 1 0 1 1 0 0, we see
that the remainder is zero and the receiver wrongly concludes that there is no error in
transmission

• The reason this error is undetected by the receiver is that the message received is
perfectly divisible by the divisor 1 0 0.

Message received = 1 0 1 0 1 1 0 0
Message received = message transmitted + error polynomial, i.e.,
1 0 1 0 1 1 0 0= 1 0 1 0 1 0 0 0 + 0 0 0 0 0 1 0 0
Does CRC detect all errors (1 bit, 2bits and burst errors) ?
Divisor: 1 0 0
Message received = 1 0 1 0 1 1 0 0
Message received = message transmitted + error polynomial, i.e.,
1 0 1 0 1 1 0 0= 1 0 1 0 1 0 0 0 + 0 0 0 0 0 1 0 0

100 ) 1 0 1 0 1 1 0 0

000
• Clearly both are divisible by the divisor 1 0 0. In general, if the error polynomial is
divisible by the divisor, then such errors are undetected by the receiver. The receiver
wrongly concludes that there is no error in transmission

If the divisor is 1 0 1, then both errors are detected by the receiver. Thus,
choosing an appropriate divisor is crucial in detecting errors at the
receiver if any during the transmission.
Cyclic Code Analysis
• We can analyze a cyclic code to find its capabilities by using polynomials.
We define the following, where f(x) is a polynomial with binary
coefficients.

Dataword: d(x) Codeword: c(x) Generator: g(x) Syndrome: s(x) Error: e(x)

In a cyclic code,
If s(x) ≠ 0, one or more bits is corrupted.
If s(x) = 0, either

a. No bit is corrupted. or
b. Some bits are corrupted, but the decoder failed to detect them.
Cyclic Code Analysis
In our analysis we want to find the criteria that must be imposed on the
generator, g(x) to detect the type of error we especially want to be detected.

The received codeword is the sum of the sent codeword and the error.
Received codeword = c(x) + e(x)

The receiver divides the received codeword by g(x) to get the syndrome.

In a cyclic code, those e(x) errors that are divisible by g(x) are not caught.

Hence choosing an appropriate divisor (generator) is very important


to detect the errors
Cyclic Code Analysis
Let us show some specific errors and see how they can be caught by a well
designed g(x).

• Single-Bit Error
• Two Isolated Single-Bit Errors
• Odd Numbers of Errors
• Burst Errors
Note on Polynomials
• If a polynomial has no factors other than 1 and itself, it is a prime
polynomial or an Irreducible Polynomial.

• x2 + 1 (= 101) is not prime. because it has factors.

• Note any bitstring ending in 0 represents a polynomial that is not prime


since it has x as a factor.

• All primes look like 1....1

https://www.ece.unb.ca/tervo/ee4253/polytable.shtml

http://www.ee.unb.ca/cgi-bin/tervo/factor.pl?binary=11000001
Cyclic Code Analysis

What should the structure of G(x) be to guarantee the detection of a single-bit


error?

If the generator has more than one term and the coefficient of x0 is 1,
all single errors can be caught.

Example: x+1 , x^3+x+1, x^3+x^2+1


Cyclic Code Analysis
Which of the following g(x) values guarantees that a single-bit error is caught? For
each case, what is the error that cannot be caught?
a. 1 b. x3 c. x4 d. x + 1

Solution
a. All values of i make xi divisible by g(x). xi/1
No single-bit error can be caught. This g(x) is useless.

b. If i is equal to or greater than 3, xi is divisible by g(x). The remainder of xi/x3 is


zero, and the receiver is fooled into believing that there is no error, although there
might be one.

All single-bit errors in positions 1 to 3 are caught

C. All single-bit errors in positions 1 to 4 are only caught.

D. No xi can be divisible by x + 1. In other words, xi/(x + 1) always has a


remainder. Any single-bit error can be caught. Also, (x + 1) is irreducible.
Odd Numbers of Errors
• A generator with a factor of x + 1 can catch all odd numbers of errors.
This means that we need to make x + 1 a factor of any generator.

• For example, x4 + x2 + x + 1 can catch all odd-numbered errors since it


can be written as a product of the two polynomials x + 1 and x3 + x2 + 1.

In another way,

If we make G(x) not prime but a multiple of (x+1), then E(x) can't be divided by G(x). can
detect all odd no. of errors.

G(x) =x8+x2+x+1 which is not prime. Factors are (x+1) (x7+x6+x5+x4+x3+x2+1)


Two Isolated Single-Bit Errors
• Now imagine there are two single-bit isolated errors. Under what
conditions can this type of error be caught?

• We can show this type of error as e(x) = xj + xi. The values of i and j define
the positions of the errors, and the difference j − i defines the distance
between the two errors,

e(x) = xj + xi.
We can write e(x) = xi(xj–i + 1).
Two Isolated Single-Bit Errors

We can write e(x) = xi(xj–i + 1).

If g(x) has more than one term and one term is x0, it cannot divide xi, as we saw in the
previous section. g(x) = more than one term +1 xi / (more than one term + 1)

g(x) must not divide xt + 1, where t is between 0 and n − 1.

If a generator cannot divide xt + 1


(t between 0 and n – 1),
then all isolated double errors
can be detected.
Find the status of the following generators related to two isolated,
single-bit errors.
a. x4 + 1 b. x6 + 1 b. x7 + x6 + 1 c. x15 + x14 + 1
0 1 1 1 1 1 1
Solution
a. This generator cannot detect two errors that are four
positions apart. The two errors can be anywhere, but if their distance is 4,
they remain undetected.

b. This generator cannot detect two errors that are six


positions apart. The two errors can be anywhere, but if their distance is 6,
they remain undetected.

c. This is a good choice for this purpose. (Irreducible polynomial)

d. This polynomial cannot divide xt + 1 if t is less than


32,768. A codeword with two isolated errors up to
32,768 bits apart can be detected by this generator. (Irreducible polynomial)
10.
Note on polynomial generator selection
Burst Errors

• where L is the length of the error. All burst errors with length
smaller than or equal to the number of check bits r will be
detected
Burst Errors
Standard polynomials
The divisor polynomials are such that it detects almost all odd bit errors and a few even
bit errors. The commonly used polynomials in the literature are

Note
• Asynchronous Transfer Mode and refers to a communication protocol which can be used to
transfer data, videos and speech.

• ATM adoption layer is basically a software layer that accepts user data, which may be digitized
voice, video or computer data, and makes them suitable for transmission over an ATM network.

• HDLC is a group of data link (Layer 2) protocols used to transmit synchronous data packets
between point-to-point nodes.
Access Control

Access Control Methods

Flow Control Flow Control


Multi Access Protocols

• When nodes or stations are connected and use a common link, called a
multipoint or broadcast link, we need a multiple-access protocol to
coordinate access to the link.

• To handle access to a shared link


Note (Pure Aloha and Slotted Aloha)
CSMA
• The chance of collision can be reduced if a station senses the medium
before trying to use it.

• Principle “sense before transmit” or “listen before talk.”

• The possibility of collision still exists because of propagation delay, when


a station sends a frame, it still takes time (although very short) for the first
bit to reach every station and for every station to sense it.

vulnerable time : time in which there is a possibility of collision.


Carrier Sense Multiple Access
Carrier Sense Multiple Access

The cable propagates the signal in both directions, so that


the signal (eventually) reaches the NICs in all four of the
computers.
CSMA

• At time t1, station B senses the medium and finds it idle, so it sends a
frame.
• At time t2 (t2 > t1), station C senses the medium and finds it idle because,
at this time, the first bits from station B have not reached station C. Station
C also sends a frame.
• Vulnerable Time= Propagation time (the time needed for a signal to
propagate from one end of the medium to the other)
CSMA

• 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.
Persistence Methods
What should a station do if the channel is busy? What should a station do
if the channel is idle?
• 1-Persistent: After the station finds the line idle, it sends its frame
immediately. This method has the highest chance of collision.

• Nonpersistent: A station that has a frame to send senses the line. If the line
is idle, it sends immediately. If the line is not idle, it waits a random amount
of time and then senses the line again. It reduces the chance of collision. it
is unlikely that two or more stations will wait the same amount of time
and retry to send simultaneously
Persistence Methods

P-Persistent
In this method, after the station finds the line idle it follows these steps:
1. With probability p, the station sends its frame.
2. With probability q = 1 − p, the station waits for the beginning of the next
time slot and checks the line again.
a. If the line is idle, it goes to step 1.
b. If the line is busy, it acts as though a collision has occurred and uses the
backoff procedure.
P=0.3
R=0.2
R=0.8
CSMA/CD

Send

Station
Listen to the medium

Principle: Transmission and collision detection are continuous processes


CSMA/CD

• It was used in Ethernet technology (Wired)


• We will not use Ack to detect the collision (No ACK).
• Uses collision signal

• A station monitors the medium after it sends a frame to see if the


transmission was successful. If so, the station is finished. If, however, there
is a collision, the frame is sent again.

1. We need to sense the channel before we start sending the frame by using one
of the persistence processes (nonpersistent, 1-persistent, or p-persistent).

2. Transmission and collision detection are continuous processes.


CSMA/CD

• 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 aborts transmission.
• Station A detects collision at time t4 when it receives the first bit of C‟s
frame; it also immediately aborts transmission
CSMA/CD
CSMA/CD
Transmit and Listening to medium

After a maximum number of Alarm


retransmission attempts Kmax,
a station must give up and try
later
Throughput of CSMA/CD

• The maximum throughput occurs at a different value of G and is based on


the persistence method and the value of p in the p-persistent approach.

G - the average number of frames generated by the system during one frame
transmission time
• For the 1-persistent method, the maximum throughput is around 50 percent
when G = 1.
• For the nonpersistent method, the maximum throughput can go up to 90
percent when G is between 3 and 8.
CSMA/CA
• Invented for wireless networks (wlan (IEEE 802.11) uses).
• Collisions are avoided through the use of CSMA/CA‟s three strategies:
– the interframe space
– the contention window
– acknowledgments

Interframe Space (IFS):


• When an idle channel is found, the station does not send immediately. It
waits for a period of time called the IFS.
• 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.
CSMA/CA
• Contention Window: amount of time divided into slots. A station that is
ready to send chooses a random number of slots as its wait time.
• The number of slots in the window changes according to the binary
exponential backoff strategy. This means that it is set to one slot the first
time and then doubles each time the station cannot detect an idle channel
after the IFS time

Send
Frame

• Acknowledgment: The positive acknowledgment and the time-out timer can help
guarantee that the receiver has received the frame
CSMA/CA Flow Diagram

Continuous checking

K=1 0-1 Contention window


Size is 2^k -1
K=2 0-3
K=3 0-7
K=4 0-15

You might also like