0% found this document useful (0 votes)
7 views725 pages

PDC Combined

Uploaded by

Taran Bhardwaj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views725 pages

PDC Combined

Uploaded by

Taran Bhardwaj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 725

ICT 2156: PRINCIPLES OF DATA COMMUNICATION [3 1 0 4]

Objectives:
• To understand basics of data communication
• To understand error detection and correction techniques
• To understand data link layer protocols
• To understand the performance of media access protocols
Abstract:

Introduction to Data Communication, Signals, Basic properties of data communication system,


Nyquist rate, Shannon Capacity, Signal encoding and Tx and Rx models, Modulation schemes.
Properties of Media and digital transmission systems, wired and wireless medium, Error
detection and correction, Block codes, CRC, Hamming code, Stop and wait flow control,
Sliding window flow control, ARQs, HDLC, Multiplexing, Media Access Sublayer and LAN,
Approaches to sharing transmission medium, Random access protocols, Token passing
protocols, IEEE LAN standards, Bridges, MAN, FDDI.

Syllabus:
Data Communication fundamentals: Introduction to Data Communication, Signals, Digital
representation of information, Basic properties of data communication system, Time and
frequency domain characterization of communication channels, Nyquist signaling rate,
Shannon Channel capacity, Line coding-NRZ, bipolar, Manchester, Differential Manchester
encoding, Modems and digital modulation- ASK, FSK, PSK,
QAM. [14 hours]

Properties of Media and Digital Transmission Systems: Twisted pair, Coaxial cable, Optical
fiber, Wireless transmission. [04 hours]

Error detection and correction: Asynchronous and synchronous transmission, Error


detection and correction basics, Parity check, Internet checksum, Polynomial codes, Block
codes, Hamming code. [08 hours]

Peer to Peer Protocols: Peer to peer protocols and service models, ARQ protocols- Stop and
wait, Go back N, selective repeat, Transmission efficiency of ARQ protocols, Other adaptation
functions- Sliding window flow control, Timing recovery for synchronous services, Reliable
stream service, Data link control- HDLC datalink control, point to point control. Multiplexing-
FDM, TDM, STDM. [14 hours]

Media Access sublayer and LAN: Introduction to layered architecture, Protocols, Approaches
to sharing transmission Medium, Random Access Protocols, Token Passing protocols, IEEE
LAN standards, Bridges, MAN[IEEE802.6], FDDI. [08 hours]
Course Outcome
The students will be able to
• Apply the concepts of data communication system to calculate channel capacity.
• Analyse different encoding and modultaion schemes.
• Compute frame check sequence and error correction codes.
• Analyse flow and error control protocols
• Compute the performance of media access protocols
References:
1. Stallings W., Data & Computer Communications (9e), Pearson Education Inc., Noida,
2017.
2. Frozen B., Introduction to data communication & networking (4e), Tata McGraw Hill,
New Delhi-2014.
3. Garcia A. L., Widjaja I., Communication Networks (2e), Tata McGraw Hill, 2011.
Principles of Data
Communication
[L T P C] is [3 1 0 4]
ICT 2156
Course Outcomes
• Apply the concepts of data communication systems to calculate
channel capacity.
• Analyse different encoding and modulation schemes
• Compute frame check sequence and error correction codes.
• Analyse flow and error control protocols
• Compute the performance of media access protocols
ICT 2156: PRINCIPLES OF DATA COMMUNICATION [3 1 0 4]
Objectives:
• To understand basics of data communication
• To understand error detection and correction techniques
• To understand data link layer protocols
• To understand the performance of media access protocols

Abstract:
Introduction to Data Communication, Signals, Basic properties of data communication
system, Nyquist rate, Shannon Capacity, Signal encoding and Tx and Rx models,
Modulation schemes. Properties of Media and digital transmission systems, wired and
wireless medium, Error detection and correction, Block codes, CRC, Hamming code, Stop
and wait flow control, Sliding window flow control, ARQs, HDLC, Multiplexing, Media
Access Sublayer and LAN, Approaches to sharing transmission medium, Random access
protocols, Token passing protocols, IEEE LAN standards, Bridges, MAN, FDDI.
Syllabus:
Data Communication fundamentals: Introduction to Data Communication, Signals, Digital representation of
information, Basic properties of data communication system, Time and frequency domain characterization
of communication channels, Nyquist signaling rate, Shannon Channel capacity, Line coding-NRZ, bipolar,
Manchester, Differential Manchester encoding, Modems and digital modulation- ASK, FSK, PSK, QAM.
[14 hours]

Properties of Media and Digital Transmission Systems: Twisted pair, Coaxial cable, Optical fiber, Wireless
transmission. [04 hours]

Error detection and correction: Asynchronous and synchronous transmission, Error detection and correction
basics, Parity check, Internet checksum, Polynomial codes, Block codes, Hamming code.
[08 hours]

Peer to Peer Protocols: Peer to peer protocols and service models, ARQ protocols- Stop and wait, Go back N,
selective repeat, Transmission efficiency of ARQ protocols, Other adaptation functions- Sliding window flow
control, Timing recovery for synchronous services, Reliable stream service, Data link control- HDLC datalink
control, point to point control. Multiplexing-FDM, TDM, STDM. [14 hours]
Media Access sublayer and LAN: Introduction to layered architecture, Protocols,
Approaches to sharing transmission Medium, Random Access Protocols, Token Passing
protocols, IEEE LAN standards, Bridges, MAN[IEEE802.6], FDDI. [08 hours]

Course Outcome
The students will be able to
• Apply the concepts of data communication system to calculate channel capacity.
• Analyse different encoding and modultaion schemes.
• Compute frame check sequence and error correction codes.
• Analyse flow and error control protocols
• Compute the performance of media access protocols

References:
1. Stallings W., Data & Computer Communications (9e), Pearson Education Inc., Noida,
2017.
2. Frozen B., Introduction to data communication & networking (4e), Tata McGraw Hill,
New Delhi-2014.
3. Garcia A. L., Widjaja I., Communication Networks (2e), Tata McGraw Hill, 2011.
What is Data communication?
➢ It is the physical transfer of data over a point to point or point to
multipoint communication channel.
➢ Data communications deals with the transmission of signals in a reliable
and efficient manner
➢ Networking deals with the technology and architecture of the
communications networks used to interconnect communicating devices.
1.1 Trends
• Effective and efficient data communication and networking facilities
are vital to any enterprise

• Three different forces have consistently driven the architecture and


evolution of data communications and networking facilities:
➢ traffic growth
➢ development of new services
➢ advances in technology.
1.2 A COMMUNICATIONS MODEL
a simple model of communications
The key elements of the communications model are as follows:
• Source: This device generates the data to be transmitted;
examples are telephones and personal computers.

• Transmitter:
▪the data generated not transmitted directly
▪a transmitter transforms and encodes the information in such a
way as to produce electromagnetic signals that can be
transmitted
• Transmission system: This can be a single transmission line or a
complex network connecting source and destination.
• Receiver: The receiver accepts the signal from the transmission
system and converts it into a form that can be handled by the
destination device.

• Destination: Takes the incoming data from the receiver.


Figure 1.2b presents one particular example, which is communication
between a workstation and a server over a public telephone network.

Another example is the exchange of voice signals between two telephones


over the same network.
Table 1.1 lists some of the key tasks that must be performed in a
data communications system. The list is somewhat arbitrary:
Elements could be added; items on the list could be merged;
• transmission system utilization - need to make efficient use of
transmission facilities typically shared among a number of communicating
devices
• a device must interface with the transmission system
• once an interface is established, signal generation is required for
communication
• there must be synchronization between transmitter and receiver, to
determine when a signal begins to arrive and when it ends
• there is a variety of requirements for communication between two
parties that might be collected under the term exchange management
• Error detection and correction are required in circumstances where
errors cannot be tolerated
• Flow control is required to assure that the source does not overwhelm the
destination by sending data faster than they can be processed and absorbed
• addressing and routing, so a source system can indicate the identity of the
intended destination, and can choose a specific route through this network
• Recovery allows an interrupted transaction to resume activity at the point of
interruption or to condition prior to the beginning of the exchange
• Message formatting has to do with an agreement between two parties as to
the form of the data to be exchanged or transmitted
• Frequently need to provide some measure of security in a data
communications system
• Network management capabilities are needed to configure the system,
monitor its status, react to failures and overloads, and plan intelligently for future
growth
 Book Referred for this PPT
◦ Stallings W., Data & Computer Communications (9e), Pearson Education
Inc., Noida, 2017. Chapter 1.
Data Communication
networking
Book Referred for this PPT
Stallings W., Data & Computer Communications (9e), Pearson
Education Inc., Noida, 2017. Chapter 1.
Transmission Medium
• Medium used to transmit data. Ex. Cable, air etc.
Networking
• Growth of number & power of computers is driving need for
interconnection
• Rapid integration of voice, data, image & video technologies
• Two broad categories of communications networks:
• Local Area Network (LAN)
• Wide Area Network (WAN)
 Span a large geographical area
 Cross public rights of way
 Rely in part on common carrier circuits
 Technologies used include:
◦ circuit switching
◦ packet switching
◦ frame relay
◦ Asynchronous Transfer A common carrier, in telecommunications, is
Mode (ATM) an entity that provides wired and wireless
communication services to the general public
for a fee. A common carrier can be
contrasted with a contract carrier, also called
a private carrier,
 Circuit switching is a connection-oriented network switching
technique.
 Here, a dedicated route is established between the source and the
destination and the entire message is transferred through it.
 Uses a dedicated communications path established for duration
of conversation
 Comprising a sequence of physical links with a dedicated logical
channel
 eg. telephone network
 No dedicated transmission capacity along a path through the
network.
 Rather, data is sent in a sequence of small chunks, called
packets.
 Each packet is passed through the network from node to node
along some path leading from source to destination.
 At each node, the entire packet is received, stored briefly, and
then transmitted to the next node.
 Packet-switching networks are commonly used for terminal-to-
computer and computer-to-computer communications.
 Packet switching systems have large overheads to compensate
for errors
 Modern systems are more reliable
 Errors can be caught in end system
 Frame Relay provides higher speeds with most error control
overhead removed
 Asynchronous transfer mode (ATM), is a result of developments in
circuit switching and packet switching.
 ATM can be viewed as an evolution from frame relay.
 ATM uses fixed-length packets, called cells.
 As with frame relay, ATM provides little overhead for error control.
 By using a fixed packet length, the processing overhead is reduced
even further for ATM compared to frame relay.
 Smaller scope
 Building or small campus
 Usually owned by same organization as attached devices
 Data rates much higher
 Variants:-
 Switched LANs, eg Ethernet
 Wireless LANs
 MAN
 Middle ground between LAN and WAN
 Private or public network
 High speed
 Large area
 Internet evolved from ARPANET
◦ first operational packet network
◦ applied to tactical radio & satellite nets also
◦ had a need for interoperability
◦ led to standardized TCP/IP protocols
➢ the key elements that comprise
the Internet: [whose purpose is to
interconnect end systems] called
hosts;
➢ Hosts example:PCs, workstations,
servers, mainframes
➢ Most hosts that use the Internet
are connected to a network, such
as a LAN or a WAN.
➢ These networks are in turn
connected by routers.
➢ The Internet today is made up of
thousands of overlapping
hierarchical networks,
➢ See hosts grouped into LANs,
linked to an ISP through a POP.
➢ The connection is made in a
series of steps starting with the
CPE.
➢ ISPs can be classified as regional
or backbone, with peering links
between.
ISP: Internet Service Provider
POP: Point of Presence
CPE: Customer Premises Equipment
➢an individual residential user
connected to an ISP through some sort
of subscriber connection.
➢The routers forward packets of data
from source to destination through the
Internet.
➢The lower portion shows a LAN
implemented using a single Ethernet
switch.
➢This is a common configuration at a
small business or other small
organization.
 Book Referred for this PPT
◦ Stallings W., Data & Computer Communications (9e), Pearson Education
Inc., Noida, 2017. Chapter 1.
L2 Signals
ANALOG AND DIGITAL DATA

➢ Data can be analog or digital.

➢ The term analog data refers to information that


is continuous;
➢ digital data refers to information that has
discrete states.
➢ Analog data take on continuous values. Digital
data take on discrete values.

➢ Data: Entities that convey meaning or


information
Analog and Digital Signals
• Signals can be analog or digital.

• Analog signals can have an infinite number of


values in a range.

• Digital signals can have only a limited


number of values.
Analog and Digital Signals
◼ Electric or electromagnetic representations of
data
◼ Analog signal is continuously varying
electromagnectic wave
◼ Digital signal is sequence of voltage pulses
◼ Digital signals generally cheaper and less effected
by disturbances (noise)
◼ Digital signals suffer more from signal weakening
(attenuation)

3.4
Figure 3.1 Comparison of analog and digital signals

3.5
Analog Signaling of Analog and Digital Data

3.6
Digital Signaling of Analog and Digital Data

a device that can both transmit and receive communications


A codec is a device or computer program which encodes or decodes a data stream or signal.
Ananlog/Digital Signals and Data

Spectrum refers to the invisible radio frequencies that wireless signals travel over.
➢ Analog transmission: analog signal is propagated
through amplifiers
➢ Digital transmission: analog or digital signals are
propagated through repeaters
➢ Digital transmission is preferred technology today:
digital equipment, efficiently combine signals from
different sources; security; repeaters can give more
accurate data transmission
Any signal is either periodic (the following two) or aperiodic
Any signal is either periodic (the following two) or aperiodic
3-2 PERIODIC ANALOG SIGNALS

In data communications, we commonly use periodic


analog signals and nonperiodic digital signals.

Periodic analog signals can be classified as simple or


composite. A simple periodic analog signal, a sine wave,
cannot be decomposed into simpler signals.

A composite periodic analog signal is composed of


multiple sine waves.

3.12
Figure 3.2 A sine wave

3.13
Figure 3.3 Two signals with the same phase and frequency,
but different amplitudes

3.14
Frequency
• Frequency is the rate of change with respect to time.
• Change in a short span of time means high frequency.
• Change over a long span of time means low frequency.

If a signal does not change at all, its frequency is zero.


If a signal changes instantaneously, its frequency is infinite.

3.15
Note

Frequency and period are the inverse of


each other.

3.16
Figure 3.4 Two signals with the same amplitude and phase,
but different frequencies

3.17
Table 3.1 Units of period and frequency

3.18
Example 3.1

The power we use at home has a frequency of 60 Hz.


The period of this sine wave can be determined as
follows:

3.19
Example 3.2

The period of a signal is 100 ms. What is its frequency in


kilohertz?

Solution
First we change 100 ms to seconds, and then we
calculate the frequency from the period (1 Hz = 10−3
kHz).

3.20
Figure 3.5 Three sine waves with the same amplitude and frequency,
but different phases

Phase describes the position of the waveform relative to time 0.


3.21
Example 3.3

A sine wave is offset 1/6 cycle with respect to time 0.


What is its phase in degrees and radians?

Solution
We know that 1 complete cycle is 360°. Therefore, 1/6
cycle is

3.22
Figure 3.6 Wavelength and period

➢ While the frequency of a signal is independent of the medium, the


wavelength depends on both the frequency and the medium.

➢ The wavelength is the distance a simple signal can travel in one period.
(usually, unit of measurement is meters)

3.23
Figure 3.7 The time-domain and frequency-domain plots of a sine wave

A complete sine wave in the time domain can be represented by one single spike in the
frequency domain
Figure 3.8 The time domain and frequency domain of three sine waves

frequency domain is more compact and useful when we are dealing with more than one
sine wave

3.25
Signals and Communication
◼ A single-frequency sine wave is not useful in
data communications
◼ We need to send a composite signal, a signal
made of many simple sine waves.
◼ According to Fourier analysis, any composite
signal is a combination of simple sine waves
with different frequencies, amplitudes, and
phases.

3.26
Composite Signals and
Periodicity
◼ If the composite signal is periodic, the
decomposition gives a series of signals with
discrete frequencies.
◼ If the composite signal is nonperiodic, the
decomposition gives a combination of sine
waves with continuous frequencies.

3.27
Figure 3.10 Decomposition of a composite periodic signal in the time and
frequency domains

3.28
Figure 3.11 The time and frequency domains of a nonperiodic signal

3.29
Spectrum and Bandwidth
◼ The spectrum of a signal is the range of
frequencies contained in the signal.
◼ The bandwidth is the difference between the
lowest and highest frequency in the spectrum.
◼ Bandwidth is subset of Spectrum

3.30
Figure 3.12 The bandwidth of periodic and nonperiodic composite signals

3.31
Example 3.6

If a periodic signal is decomposed into five sine waves


with frequencies of 100, 300, 500, 700, and 900 Hz, what
is its bandwidth? Draw the spectrum, assuming all
components have a maximum amplitude of 10 V.
Solution
Let fh be the highest frequency, fl the lowest frequency,
and B the bandwidth. Then

The spectrum has only five spikes, at 100, 300, 500, 700,
and 900 Hz (see Figure 3.13).
3.32
Figure 3.13 The bandwidth for Example 3.6

3.33
Example 3.7

A periodic signal has a bandwidth of 20 Hz. The highest


frequency is 60 Hz. What is the lowest frequency? Draw
the spectrum if the signal contains all frequencies of the
same amplitude.
Solution
Let fh be the highest frequency, fl the lowest frequency,
and B the bandwidth. Then

The spectrum contains all integer frequencies. We show


this by a series of spikes (see Figure 3.14).
Figure 3.14 The bandwidth for Example 3.7
Remaining topics in Signal
◼ Signal Decomposition
◼ Digital Signals

Book Referred:
Title: Data Communications And Networking
Author: Behrouz A. Forouzan
Chapter: Chapter 3, Data and Signals
L3 Data Transmission
Chapter 3
Data Transmission : Stallings W., Data & Computer Communications (9e), Pearson
Education Inc., Noida, 2017.
Periodic Signal
• The simplest sort of signal is a periodic signal, in which the same signal
pattern repeats over time.
• Mathematically, a signal s(t) is defined to be periodic if and only if

• where the constant T is the period of the signal. Otherwise, a signal is


aperiodic.
Periodic analog signal

Periodic analog signal characterized by 3 parameters.[Amplitude :A, Frequency: f


and Phase φ]

Representation of sine wave

s (t) = A sin (2πft + φ)

Where A is peak amplitude.

2π radians = 360° = 1 period

.
the frequency components of the square wave with amplitudes A and –A
can be expressed as follows: [using Fourier Series]
.
UNITS of Parameter

Amplitude : volts, milli (10-3) volt, KV(103)

Frequency : Hz, KHz(103), MHz(106), GHz(109), THz(1012)

Time : second, milli second(10-3), micro second(10-6), ns(10-9), ps(10-12)

Phase : degree , radian

.
.
Frequency Domain Concepts

➢The spectrum of a signal is the range of frequencies that it contains. For the
signal of Figure 3.4c, the spectrum extends from f to 3f.

.
Frequency Domain Concepts

➢The absolute bandwidth of a signal is the width of the spectrum. In the case
of Figure 3.4c, the bandwidth is 2f.

➢most of the energy in the signal is contained in a relatively narrow band of


frequencies. This band is referred to as the effective bandwidth, or just
bandwidth.
.
dc component:-
• If a signal includes a component of zero frequency, that component is a direct
current (dc) or constant component.
• For example, Figure 3.6 shows the result of adding a dc component to the
signal.

No DC component if average amplitude = 0


By adding together sine waves at frequencies f
and 3f, we get a waveform that begins to
resemble the original square wave.

adding a sine wave of frequency 5f, as shown


in Figure 3.7a,

and then adding a sine wave of frequency 7f, as


shown in Figure 3.7b.

As we add additional odd multiples of f,


suitably scaled, the resulting waveform
approaches that of a square wave more and
more closely.
Relationship between Data Rate and Bandwidth

consider the square wave.

let positive pulse represent binary 0


negative pulse represent binary 1.

Then the waveform represents the binary stream 0101. . . .

The duration of each pulse is T/2 = 1/(2f )

thus the data rate is 2f bits per second (bps).

.
Relationship between Data Rate and Bandwidth

• Waveform has an infinite number of frequency components and hence an


infinite bandwidth.

• What happens if we limit the bandwidth to just the first three frequency
components?

• Suppose a digital transmission system is capable of transmitting signals with a


bandwidth of 4 MHz.

• What data rate can be achieved? We look at 3 cases.

.
What data rate can be achieved? We look at three cases.

Case 1:

• Let f be 1MHz
• Bandwidth = (5x10^6)-(1x10^6) = 4MHz
• T=1/f=1/(10^6)=1x(10^-6)s=1μsecs
• Bit interval = 0.5T=0.5 μ secs
• data rate=1/(Bit interval)=1/0.5μ secs = 2Mbps
What data rate can be achieved? We look at three cases.

Case 2:

• Let f be 2MHz
• Bandwidth = (5x2x10^6)-(2x10^6) = 8MHz
• T=1/f=1/(2x10^6)=1x(2x10^-6)s=0.5μsecs
• Bit interval = 0.5T=0.5*(0.5 μ secs)=0.25 μsecs
• data rate=1/(Bit interval)=1/0.25μ secs = 4Mbps
What data rate can be achieved? We look at three cases.

Case 3:

• Let frequency(f) be 2MHz


• Bandwidth = (3x2x10^6)-(2x10^6) = 4MHz
• Period(T)=1/f=1/(2x10^6)=1x(2x10^-6)s=0.5μsecs
• Bit interval = 0.5T=0.5*(0.5 μ secs)=0.25 μsecs
• data rate=1/(Bit interval)=1/(0.25μ secs) = 4Mbps
Bandwidth
• A nonperiodic composite signal has a bandwidth of 200 kHz, with a middle frequency
of140 kHz and peak amplitude of 20 V.
• The two extreme frequencies have an amplitude of 0.
• Draw the frequency domain of the signal..

Solution

.
wavelength

• Distance occupied in space by a single period.

• Wavelength = propagation speed / frequency.

Example : wavelength of redlight (frequency = 4*1014 Hz) is

c/f = 3*108m/s /4*1014


= 0.75 micro meter

.
Transmission Impairment
Transmission Impairment
• The signal that is received may differ from the signal that is
transmitted due to various transmission impairment.

• Consequences

• For analog signals, these impairments can degrade the signal quality.

• For digital signals, bit errors may be introduced, such that a binary 1 is
transformed into a binary 0 or vice versa.
Impairment Causes
Transmission
Impairments

Attenuation Distortion Noise

The imperfections of the medium causes impairments in the signal. What are
the possible impairments? First is the attenuation, then distortion and noise.
Transmission Impairment considerations
• Attenuation introduces three considerations for the transmission
engineer.

• First, a received signal must have sufficient strength so that the electronic
circuitry in the receiver can detect the signal.

• Second, the signal must maintain a level sufficiently higher than noise to be
received without error.

• Third, attenuation varies with frequency


➢The first and second problems are dealt with by attention to signal
strength and the use of amplifiers or repeaters.

➢The third problem is dealt with equalizing attenuation across a band of


frequencies. Another approach is to use amplifiers that amplify high
frequencies more than lower frequencies.
Attenuation:
the loss of energy as the signal passes through a medium.
Unit of measurement: Decibel

Figure refer by Techterm youtube channel


An amplifier can be used to compensate the
attenuation of the medium
Amplifier

Figure refer by Techterm youtube channel


Unit to measure Strength is Decibel(dB)

dB = 10log10 P2/P1
Where,
P2 is the power at the destination or point 2
P1 is the power at the transmitting end or point P1.

Figure refer by Techterm youtube channel


A signal travels through a transmission medium and its
power is reduced to one half. Calculate the Attenuation
Transmission medium

P1 P2

P2 = 0.5 P1
dB = 10 log 10(P2/P1)
= 10 log 10(0.5 P1/P1)
= 10 log 10(0.5)
= 10 *(-0.3010)
= -3dB (Approx)
A signal travels through a amplifier and its power
increased 20 times. Calculate the power gain

P1 P2

P2 = 20 P1
dB = 10 log 10(P2/P1)
= 10 log 10(20 P1/P1)
= 10 log 10(20)
= 10 *(1.301)
= 13dB (Approx)
Delay distortion
• Delay distortion arises particularly in a guided media but not in air.
• Delay distortion arises because velocity of propagation varies with
frequency.
• That means this signal components that we are sending will have
different velocities for different frequency components as it passes
through a guided media and this leads to delay distortion.
Delay distortion (contd…)
• Because of delay distortion, some of the signal components of one bit
position will spill over into other bit positions, causing intersymbol
interference

• 10001010➔10001001

• Equalizing techniques(Delay Equalizer) can also be used to avoid


delay distortion.
Noise

➢unwanted signals that are inserted somewhere between


transmission and reception.

➢undesired signals are referred to as noise.

➢Noise is the major limiting factor in communications system


performance.
Noise

Original Signal

Noise Signal

receiver side the sender


signal combine with nois
Noise
• Noise may be divided into four categories:

Noise

Thermal Intermodulation Crosstalk Impulse


Noise Type1: Thermal Noise (White noise)
• Random motion of electrons in wire creates extra signal which is not sent by
transmitter
• Due to random motion of electrons.
• Present in all transmission devices and media
• is a Function of temperature
• A kind of noise where the irregular electron movement in wire produces an additional
signal.
• Thermal noise is uniformly distributed across the bandwidths and hence is often
referred to as white noise
1°C + 273.15 = 274.15K
17°C + 273.15 = 290.15K
Noise Type2: Intermodulation Noise
➢ When signals at different frequencies share the same transmission medium, the result may be
intermodulation noise.

➢ The effect of intermodulation noise is to produce signals at a frequency that is the sum or
difference of the two original frequencies or multiples of those frequencies.

➢ For instance, consider two signals S1 and S2 generate signals of frequencies (S1 + S2) and (S1
- S2) that may interfere with the signals of the same frequencies sent by the sender. In any part
of the communication system, intermodulation noise is introduced because of this situation.

➢ Intermodulation noise is produced by nonlinearities in the transmitter, receiver and/or


intervening transmission medium.
Noise Type3: Cross Talk
• crosstalk is due to unwanted coupling between two media.

• In telephone network, we frequently encounter crosstalk.

• We hear some unwanted talk going on in the background. This is because of


this unwanted coupling between two transmission media that means cables.

• It can occur by electrical coupling between nearby twisted pairs or rarely


coaxial cable lines carrying multiple signals
Noise Type4: Impulse noise
• All of the types of noise discussed so far have reasonably
predictable and relatively constant magnitudes.
• Thus, it is possible to engineer a transmission system to cope with
them.
• Impulse noise, however, is noncontinuous, consisting of irregular
pulses or noise spikes of short duration and of relatively high
amplitude.
• It is generated from a variety of causes, including external
electromagnetic disturbances, such as lightning, and faults and flaws
in the communications system.
Channel Capacity
• The maximum rate at which data can be transmitted over a given communication
path, or channel, under given conditions, is referred to as the channel capacity.

• There are four concepts here that we are trying to relate to one another.
• Data rate : The rate, in bits per second (bps), at which data can be communicated
• Bandwidth: The bandwidth of the transmitted signal as constrained by the transmitter and the
nature of the transmission medium, expressed in cycles per second, or Hertz
• Noise : The average level of noise over the communications path
• Error rate : The rate at which errors occur, where an error is the reception of a 1 when a 0 was
transmitted or the reception of a 0 when a 1 was transmitted

Two theoretical models: (Calculate Data rate)


Nyquist Capacity : assumes noise-free environment
Shannon Capacity : considers noise
Nyquist Capacity
• Assumes channel that is noise free
• Given a bandwidth of B, the highest signal rate is 2B
• Single signal element may carry more than 1 bit; signal with M levels may
carry log2 M bits
C = 2B log2M
Where, B is Bandwidth, M is the number of discrete signal or voltage levels.
• Tradeoffs:
• Increase the bandwidth, increases the data rate.
• Increase the signal levels, increases the data rate.
• Increase the signal levels, harder for receiver to interpret the bits (practical
limit to M)
➢For a given bandwidth, the data rate can be increased by increasing the
number of different signal elements(M).

➢However, this places an increased burden on the receiver:


▪ Instead of distinguishing one of two possible signal elements during each
signal time, it must distinguish one of M possible signal elements.
▪ Noise and other impairments on the transmission line will limit the
practical value of M.
Channel Capacity
Channel Capacity
• The maximum rate at which data can be transmitted over a given communication
path, or channel, under given conditions, is referred to as the channel capacity.

• There are four concepts here that we are trying to relate to one another.
• Data rate : The rate, in bits per second (bps), at which data can be communicated
• Bandwidth: The bandwidth of the transmitted signal as constrained by the
transmitter and the nature of the transmission medium, expressed in cycles per
second, or Hertz
• Noise : The average level of noise over the communications path
• Error rate : The rate at which errors occur, where an error is the reception of a1
when a 0 was transmitted or the reception of a 0 when a 1 was transmitted

Two theoretical models: (Calculate Data rate)


Nyquist Capacity : noise-free environment or Noiseless channel
Shannon Capacity : Noisy Channel
Nyquist Bandwidth
• Channel that is noise free
• Given a bandwidth of B, the highest signal rate is 2B
• Single signal element may carry more than 1 bit; signal with M levels may
carry log2 M bits
C = 2B log2M

• Tradeoffs:
• Increase the bandwidth, increases the data rate.
• Increase the signal levels, increases the data rate.
• Increase the signal levels, harder for receiver to interpret the bits (practical limit to
M)
A noiseless channel has a bandwidth of 4000 Hz and is transmitting a signal with two
signal levels. Calculate the maximum bit rate

B=4000Hz
M=2
C = 2B log2M
Bit Rate = 2 * 4000 * log22
= 2 * 4000 * 1
=8000 bps
A noiseless channel has a bandwidth of 4000 Hz and is transmitting a signal with two
signal with four signal levels. Calculate the maximum bit rate

B=4000Hz
M=4
C = 2B log2M
Bit Rate = 2 * 4000 * log24
= 2 * 4000 * 2
=16000 bps
Consider a noiseless channel with a bandwidth of 20 KHz. We need to send 280 Kbps
over a channel. How many signal levels are required?

C =280 Kbps
B = 20 KHz
C = 2B log2M Log a x = y
280 = 2 * 20 * log2 M x = ay
280/40 = log2 M
7 = log2 M
M = 27
M = 128
Shannon Capacity
➢ With noise, some bits may be corrupted;
➢ higher data rate, more bits corrupted
➢ Increasing signal strength overcomes noise
› Signal-to-noise ratio:
signalpower
SNR =
noisepower
High SNR➔ high-quality signal ➔ less intermediate repeaters

• Shannon capacity: C = B log2 (1 + SNR)


• Tradeoffs:
• Increase bandwidth or signal power, increases data rate
• Increase of noise, reduces data rate
• Increase bandwidth, allows more noise
Shannon Capacity : Noisy channel
Capacity = Bandwidth * log2(1+SNR)

𝑺𝒊𝒈𝒏𝒂𝒍 𝒑𝒐𝒘𝒆𝒓
SNR=
𝑵𝒐𝒊𝒔𝒆 𝑷𝒐𝒘𝒆𝒓

𝑺𝒊𝒈𝒏𝒂𝒍 𝒑𝒐𝒘𝒆𝒓
SNRdB=10 log 10 (SNR or )
𝑵𝒐𝒊𝒔𝒆 𝑷𝒐𝒘𝒆𝒓
Example of Shannon and Nyquist Capacity
A channel uses spectrum of between 3MHz and 4MHz, with SNRdB = 24dB.
How many signal levels are required to achieve Shannon capacity?

OR

Let us consider an example that relates the Nyquist and Shannon formulations.
Suppose that the spectrum of a channel is between 3 MHz and 4 MHz and SNRdB =
24 dB. Then
Solution
B = 4 MHz - 3 MHz = 1 MHz Nyquist formula,
SNRdB = 24 dB = 10 log 10(SNR) B= 106 Hz
SNR = 251 C = 8 Mbps
Using Shannon’s formula, C = 2B log2M Log a x = y
C = 106 * log 2 (1+251) 8 * 106 = 2 * 106 * log2 M x = ay
= 106 * 8 4 = log2 M
= 8 Mbps M = 16
Consider a extremely noisy channel in which signal to noise ratio is almost zero.
Calculate the capacity of the channel

Capacity = Bandwidth * log2(1+SNR)


𝑺𝒊𝒈𝒏𝒂𝒍 𝒑𝒐𝒘𝒆𝒓
SNR=
𝑵𝒐𝒊𝒔𝒆 𝑷𝒐𝒘𝒆𝒓

C = B * log2(1+SNR)
= B * log2(1+0)
= B * log2(1)
=B*0
=0
Calculate the highest bit rate(capacity of the channel) if the bandwidth is 3000 Hz and
signal to noise ration(SNR) is 3162

B = 3000 Hz
SNR = 3162
C = B * log2(1+SNR)
= 3000 * log2(1+3162)
= 3000 * log2(3163)
= 3000 * 11.627
= 34881 bps
Tutorial-1 Questions

1. A channel has B=4kHz and SNR =30dB. Determine maximum


information rate for 128 level encoding.
2. We need to send 256 kbps over a noiseless channel with a
bandwidth 20 KHz. How many signal levels do we need?
3. We have a channel with a 1 Mhz bandwidth. The SNR_db for this
channel is 63db.What are the appropriate bit rate and signal level?
4. A telephone system with modem allows bandwidth of 3100 Hz.
What is the maximum data rate? M=2
Tutorial-1 Question-1 Solution
1. A channel has B=4kHz and SNR =30dB. Determine maximum
information rate for 128 level encoding.

B=4KHz C = B log2 (1 + SNR) C = 2B log2 M


SNR=30db C=4k log2(1+1000) C=8k *log2(128)
C=4k*9.96 C=8k*7
SNR_db=10 log10(SNR)
C=39.8Kbps C=56Kbps
30=10 lag10(SNR)
SNR=10^(30/10)=1000

Nyquist capacity=56kbps
Shannon capacity=39.8kbps
Smallest of two values decide channel capacity.
Tutorial 1 Question-2 Solution

2)We need to send 256 kbps over a


noiseless channel with a bandwidth 20
KHz. How many signal levels do we
need?
Tutorial 1 Question-3
3) We have a channel with a 1 Mhz bandwidth. The SNRdb for this channel is
63db.What are the appropriate bit rate and signal level?
Tutorial 1 Question-4
A telephone system with modem allows bandwidth of 3100 Hz. What is the maximum
data rate? M=2

C = 2B log2M Nyquist Formula


C=2*B log2 (2)
C=2*3100*1
C=6200 bps
Data Communications and
Networking

Chapter 5
Signal Encoding Techniques:Part1

References:
Book Chapter 5
Data and Computer Communications, 8th
edition, by William Stallings

1
Outline
• Overview
—Encoding and Modulation
• Digital data, digital signal
• Digital data, analog signal
• Analog data, digital signal
• Analog data, analog signal

2
Analog Signaling of Analog and
Digital Data

3
Digital Signaling of Analog and
Digital Data

4
5
6
7
Encoding and Modulation

8
Modulation
• Modulation is the process of encoding source data onto
a carrier signal with frequency fc.
— The frequency of the carrier signal is chosen to be compatible
with the transmission medium being used.
— Modulation techniques involve operation on one or more of the
three parameters: amplitude, frequency, and phase
• According to the input source signal m(t) (either analog
or digital), which is called baseband signal (or
modulating signal) , the carrier signal fc(t) will be
modulated into modulated signal s(t).

9
Encoding/modulation Techniques
• Digital data, digital signal
— The equipment for encoding digital data into a digital signal is
less complex and less expensive than digital-to-analog
modulation equipment.
• Analog data, digital signal
— Conversion of analog data (e.g., voice, video) to digital form
permits the use of modern digital transmission & switching.
• Digital data, analog signal
— Optical system and unguided media (wireless system) only
propagate analog signals.
• Analog data, analog signal
— Baseband: easy and cheap, e.g., in voice-grade telephone lines,
voice signals are transmitted over telephone lines at their
original spectrum
— Modulation permits frequency division multiplexing, e.g., AM/FM
radios

10
(I) Digital Data, Digital Signal
• Digital signal is a sequence of discrete,
discontinuous voltage pulses.
• Each pulse is a signal element.
• Binary data are transmitted by encoding the bit
stream into signal elements.
• In the simplest case, one bit is represented by
one signal element.
—E.g., 1 is represented by a lower voltage level, and 0
is represented by a higher voltage level

11
Terminologies
• Unipolar
— If all signal elements have the same algebraic sign (all positive or all
negative), then the signal is unipolar.
• Polar
— One logic state represented by positive voltage, the other by negative
voltage
• Data rate
— Rate of data transmission measured in bps: bits per second
• Duration or length of a bit
— Time taken for transmitter to emit the bit
• Modulation rate/Signalling rate How are they
— Rate at which the signal level changes related?
— Measured in baud: signal elements per second

12
Interpreting Signals at the Receiver
• The receiver needs to know
— The timing of each signal element, i.e., when a signal element begins
and ends
— signal levels
— These tasks are performed by sampling each element position in the
middle of the interval and comparing the value to a threshold.
• Factors affecting successful interpreting of signals
— Signal-to-noise ratio (SNR)
— Data rate
— Bandwidth
• Some principles:
— An increase in data rate increases bit error rate (BER)
— An increase in SNR decreases BER
— An increase in bandwidth allows an increase in data rate
• Another factor that can improve performance:
— Encoding scheme: the mapping from data bits to signal elements

13
Evaluation of Encoding
Schemes (1)
• Signal Spectrum
— Lack of high frequencies reduces required bandwidth
— Lack of dc component allows ac coupling via transformer,
providing electrical isolation and reducing interference
— Concentrate power in the middle of the bandwidth
• Clocking
— Need to determine the beginning and end of each bit
— Synchronizing transmitter and receiver
1. Use external clock, which is expensive; or
2. Synchronization mechanism based on the transmitted signal

14
Comparison of Encoding
Schemes (2)
• Error detection
— Various error-detection techniques will be covered in Chapter 9
— Some error detection capability can be built into signal encoding
scheme
• Signal interference and noise immunity
— Some codes are better than others in the presence of noise
— Performance is usually expressed in terms of BER
• Cost and complexity
— Higher signal rate (thus data rate) leads to higher cost
— Some codes require a signal rate greater than the actual data
rate

15
Basic categories

16
Encoding Schemes
• Nonreturn to Zero (NRZ)
— Nonreturn to Zero-Level (NRZ-L)
— Nonreturn to Zero Inverted (NRZI)
• Multilevel Binary
— Bipolar-AMI
— Pseudoternary
• Biphase
— Manchester
— Differential Manchester
• Scrambling techniques
— B8ZS
— HDB3

17
NRZ

18
Nonreturn to Zero-Level (NRZ-L)
• Two different voltages for 0 and 1 bits
• Voltage is constant during a bit interval
—no transition, i.e. no return to zero voltage
• E.g. absence of voltage for zero, constant
positive voltage for one
• More often, negative voltage for one value and
positive for the other
• This is known as NRZ-L

19
Nonreturn to Zero Inverted
• NRZI: Nonreturn to zero, invert on ones
• Constant voltage pulse for duration of bit
• Data are encoded as presence or absence of
signal transition at the beginning of the bit time
• A transition (low to high or high to low) denotes
a binary 1
• No transition denotes binary 0
• NRZI is an example of differential encoding
technique

20
Differential Encoding
• Data are represented in terms of the changes
between successive signal elements, rather than
the signal elements themselves.
• It is more reliable to detect a transition in the
presence of noise than to compare a value to a
threshold.
• With a complex transmission layouts, it is easy
to lose the sense of the polarity of the signal.

21
NRZ pros and cons
• Pros
—Easy to engineer
—Make efficient use of bandwidth
• Cons
—The presence of dc component
—The lack of synchronization capability
• NRZ codes are commonly used for digital
magnetic recording, but not often used for
signal transmission.

22
Multilevel Binary
• Use more than two levels
• Bipolar-AMI: alternate mark inversion
—zero represented by no line signal
—one represented by a positive or negative pulse
—one pulses must alternate in polarity
—Advantages:
• No loss of synchronization if a long string of 1s occurs (0s
still be a problem)
• No net dc component
• Provides a simple means of error detection

23
Pseudoternary
• 1 represented by the absence of line signal
• 0 represented by alternating positive and
negative pulses
• No advantage or disadvantage over bipolar-AMI

24
Bipolar-AMI and Pseudoternary
0 1 0 0 1 1 0 0 0 1 1

25
Trade-off for Multilevel Binary
• Not as efficient as NRZ
—However, in bipolar-AMI & pseudoternary, each signal
element only represents one bit
—Receiver must distinguish between three levels
(+A, -A, 0)
—Requires approx. 3dB more signal power for same
probability of bit error, or
—The BER for NRZ codes, at a given SNR, is
significantly less than for mulitlevel binary.

26
Biphase
• Manchester
— There is a transition at the middle of each bit period.
— The midbit transition serves as a clock mechanism and also as
data: low to high represents 1, high to low represents 0
— Used by IEEE 802.3 Ethernet LAN
• Differential Manchester
— The midbit transition is used only to provide clocking.
— 0 is represented by the presence of a transition at the beginning
of a bit period.
— 1 is represented by the absence of a transition at the beginning
of a bit period.
— Note: this is a differential encoding scheme
— Used by IEEE 802.5 token ring LAN

27
Manchester Encoding

28
Differential Manchester
Encoding

29
Biphase Pros and Cons
• Pros
—Self-clocking: Because there is a predictable
transition during each bit time, the receiver can
synchronize on that transition.
—No dc component
—Error detection: the absence of an expected
transition can be used to detect errors
• Con
—Requires at least one transition per bit time and may
have as many as two transitions, thus,
—The maximum modulation rate is twice that for NRZ
—Requires more bandwidth

30
Scrambling
• Use scrambling to replace sequences that would
produce constant voltage
• Main idea:
— Sequences that would result in a constant voltage are replaced
by filling sequences that will provide sufficient transitions for the
receiver’s clock to maintain synchronization.
— Filling sequences must be recognized by receiver and replaced
with original data sequence.
— Filling sequence is the same length as original sequence.
• Design goals:
— No dc component
— No long sequences of zero-level line signals
— No reduction in data rate
— Error detection capability

31
B8ZS
• Bipolar With 8-Zeros Substitution
• Based on bipolar-AMI, whose drawback is a long string
of zeros may result in loss of synchronization.
• If octet of all zeros occurs and the last voltage pulse
preceding this octet was positive, encode as 000+-0-+
• If octet of all zeros occurs and the last voltage pulse
preceding this octet was negative, encode as 000-+0+-

• Unlikely to occur as a result of noise


• Receiver recognizes the pattern and interprets the octet
as consisting of all zeros.

32
HDB3
• High-Density Bipolar-3 Zeros
• Based on bipolar-AMI
• String of four zeros is replaced with sequences
containing one or two pulses.

Number of Bipolar Pulses since last


substitution
Polarity of Odd Even
Preceding Pulse
- 000- +00+

+ 000+ -00-

33
B8ZS and HDB3

34
Modulation Rate

35
Tutorial Question
• For the bit stream 01001110, sketch the
waveforms for each of the line coding
technique: NRZL,NRZI,Manchester,Differential
Manchester.
• Assume that the signal level for the preceding
bit for NRZI was high;
• the most recent preceding 1 bit (AMI) has a
negative voltage;
• and the most recent preceding 0
bit(pseudoternary) has a negative voltage.

36
Digital data to digital signal
Line Coding
• Data as well as signals that represents data can either be digital or analog.

• Line coding is the process of converting digital data to digital signals. By below
mention techniques we converts a sequence of bits to a digital signal.

• At the sender side digital data are encoded into a digital signal and at the receiver
side the digital data are recreated by decoding the digital signal.

• We can roughly divide line coding schemes into five categories:


1. Unipolar (eg. NRZ scheme).
2. Polar (eg. NRZ-L, NRZ-I, RZ, and Biphase – Manchester and differential
Manchester).
3. Bipolar (eg. AMI and Pseudoternary).
4. Multilevel
5. Multitransition
Unipolar

0 1 0 0 1 1 0
+ve

Axis

-ve
Nonreturn to Zero level (NRZ-L)

0 1 0 0 1 1 0
+ve

Axis

-ve
Nonreturn to Zero Inverted (NRZI)

0 1 0 0 1 1 0
+ve

Axis

-ve
Bipolar(Alternate mark inversion (AMI))

0 1 0 0 1 1 0
+ve

Axis

-ve

Most recent preceding 1 bit has negative Voltage


Bipolar(Pseudo ternary)

0 1 0 0 1 1 0
+ve

Axis

-ve

Most recent preceding 0 bit has negative Voltage


Manchester

0 1 0 0 1 1 0
+ve

Axis

-ve

Voltage started from positive side


Differential Manchester

0 1 0 0 1 1 0
+ve

Axis

-ve

Voltage started from positive side


Differential Manchester Encoding
Modulation Rate
Modulation rate
Scrambling
• Use scrambling to replace sequences that would produce
constant voltage
• Filling sequence
– Must produce enough transitions to sync
– Must be recognized by receiver and replace with original
– Same length as original
• No dc component
• No long sequences of zero level line signal
• No reduction in data rate
• Error detection capability
B8ZS
• Bipolar With 8 Zeros Substitution
• Based on bipolar-AMI
• If octet of all zeros and last voltage pulse
preceding was positive encode as 000+-0-+
• If octet of all zeros and last voltage pulse
preceding was negative encode as 000-+0+-
• Causes two violations of AMI code
• Unlikely to occur as a result of noise
• Receiver detects and interprets as octet of all
zeros
HDB3
• High Density Bipolar 3 Zeros
• Based on bipolar-AMI
• String of four zeros replaced with one or two
pulses
HDB3 Rules
B8ZS and HDB3
Digital data, Analog signals
Binary amplitude shift keying
Binary amplitude shift keying
Implementation of binary ASK
Example
• Given a bandwidth of 10,000 Hz (1000 to
11,000 Hz), draw the full-duplex ASK diagram
of the system. Find the carriers and the
bandwidths in each direction. Assume there is
no gap between the bands in the two
directions.
• For full-duplex ASK, the bandwidth for each direction is
• BW = 10000 / 2 = 5000 Hz
• The carrier frequencies can be chosen at the middle of each
band
• fc (backward) = 1000 + 5000/2 = 3500 Hz
• fc (forward) = 11000 – 5000/2 = 8500 Hz
Binary frequency shift keying
Multiple FSK (MFSK)

❑More than two frequencies (M frequencies)


are used
❑More bandwidth efficient compared to BFSK
❑More susceptible to noise compared to BFSK
❑MFSK signal:

si (t ) = A cos(2f i t ), 1 i  M
where
f i = f c + (2i − 1 − M ) f d
f c = the carrier frequency
f d = the difference frequency
M = number of different signal elements = 2 L
L = number of bits per signal element
❑MFSK signal:
si (t ) = A cos( 2f i t ), 1 i  M
where
f i = f c + ( 2i − 1 − M ) f d
M = number of different signal elements = 2 L
L = number of bits per signal element

❑Period of signal element


Ts = LTb , Ts : signal element period Tb : bit period

❑Minimum frequency separation


1 / Ts = 2 f d  1 /( LTb ) = 2 f d  1 / Tb = 2 Lf d (bit rate)

❑MFSK signal bandwidth: Wd = M ( 2 f d ) = 2 Mf d


Example
• With fc=250KHz, fd=25KHz, and M=8 (L=3
bits), we have the following frequency
assignment for each of the 8 possible 3-bit
data combinations:

f i = f c + (2i − 1 − M ) f d
000 → f1 = 75KHz 
001 → f 2 = 125KHz 
010 → f 3 = 175KHz 

011 → f 4 = 225KHz 
 bandwidth = Ws = 2Mf d = 400 KHz
100 → f 5 = 275KHz 
101 → f 6 = 325KHz 

110 → f 7 = 375KHz 
111 → f 8 = 425KHz 

❑ This scheme can support a data rate of:

1 / Tb = 2 Lf d = 2(3bits )(25 Hz ) = 150 Kbps


Example
• We need to send data 3 bits at a time at a bit
rate of 3 Mbps. The carrier frequency is 10
MHz. Calculate the number of levels (different
frequencies), the baud rate, and the bandwidth.
• We can have L=3,M = 23 = 8.
• The baud rate is D=R/L
• D= 3 Mbps/3 = 1 Mbaud.
• The bandwidth is : W = M (2 f
d d ) = 2 Mf d

• T=Bit period=1/3 micro sec


• TS=LT=3*(1/3) =1 micro sec
• 2fd=1/T =1MHz
S

• Bandwidth=8MHz
f i = f c + (2i − 1 − M ) f d
Phase Shift Keying
• Phase of the carrier is varied to represent
digital data (binary 0 or 1)
• Amplitude and frequency remains constant.
• If phase 0 deg to represent 0, 180 deg to
represent 1. (2-PSK)
• PSK is not susceptible to noise degradation
that affects ASK or bandwidth limitations of
FSK
Differential PSK (DPSK)
❑ In DPSK, the phase shift is with reference to the previous bit
transmitted rather than to some constant reference signal
❑ Binary 0:signal burst with the same phase as the previous one
❑ Binary 1:signal burst of opposite phase to the preceding one
4-PSK (Quadrature PSK) method
Quadrature PSK
• To increase the bit rate, we can code 2 or
more bits onto one signal element.
• In QPSK, we parallelize the bit stream so that
every two incoming bits are split up and PSK a
carrier frequency. One carrier frequency is
phase shifted 90o from the other - in
quadrature.
• The two PSKed signals are then added to
produce one of 4 signal elements. L = 4
QPSK and Offset QPSK (OQPSK) Modulators

1 1
QPSK : s (t ) = I (t ) cos(2f c t ) − Q(t ) sin( 2f c t )
2 2
1 1
OQPSK : s (t ) = I (t ) cos(2f c t ) − Q(t − Tb ) sin( 2f c t )
2 2
for QPSK :

1 1→1 1→
4
3
0 1 → −1 1 →
4
− 3
0 0 → −1 − 1 →
4
−
1 0 → 1 −1 →
4
• Transmission bandwidth BT for ASK, PSK and
FSK is of the form
– BT =(1+r)R
– R- Bit rate
– r- Related to technique typically 0<r<1
❑Bandwidth Efficiency
data rate R 1
= =
➢ ASK/PSK: transmission bandwidth B 1 + r , 0  r 1
T

R log 2 M
➢ MPSK: = , M : number of different signal elements
BT 1+ r

➢ MFSK: R log 2 M
=
BT (1 + r ) M
Example
• Find the baud rate and bandwidth for a signal
transmitting at 12 Mbps, The value of r = 0.
• (for QPSK )
• The baud rate is D=R/L
• L=2, R=12Mbps, r=0
• D=6Mbps
• For QPSK, 2 bits is carried by one signal
element R=R/2=6Mbps
• BT=(1+r)R=6MHZ
Example
• We have an available bandwidth of 100 kHz
which spans from 200 to 300 kHz. What should
be the carrier frequency and the bit rate if we
modulated our data by using FSK with r = 1?
• The midpoint of the band is at 250 kHz.
B=100KHz, r=1
– BT=(1+r)R
– 100=2R
– R=100/2=50kbps
Example
• We have an available bandwidth of 100 kHz
which spans from 200 to 300 kHz. What are
the carrier frequency and the bit rate if we
modulated our data by using ASK with r= 1?
– B =(1+r)R
T
Quadrature Amplitude Modulation (QAM)

❑QAM used on asymmetric digital subscriber line


(ADSL) and some wireless standards
❑combination of ASK and PSK
❑logical extension of QPSK
❑send two different signals simultaneously on same
carrier frequency
➢ use two copies of carrier, one shifted by 90°
➢ each carrier is ASK modulated

s (t ) = d1 (t ) cos 2f c t + d 2 (t )sin 2f c t


QAM modulator

QAM : s (t ) = d1 (t ) cos(2f c t ) + d 2 (t ) sin( 2f c t )


 
ASK ASK
QAM Variants

❑Two level ASK (two different amplitude levels)


➢each of two streams in one of two states
➢four state system
➢essentially QPSK
❑Four level ASK (four different amplitude levels)
➢combined stream in one of 16 states
❑Have 64 and 256 state systems
❑Improved data rate for given bandwidth
➢but increased potential error rate
ASK

0 1 0 0 1 1 0
+ve

Axis

-ve

Voltage started from positive side


FSK

0 1 0 0 1 1 0
+ve

Axis

-ve

Voltage started from positive side


PSK

0 1 0 0 1 1 0
+ve

Axis

-ve

Voltage started from positive side


DPSK

0 1 0 0 1 1 0
+ve

Axis

-ve

Voltage started from positive side


Transmission Media

CHAPTER 4 – William Stallings


TYPES OF TRANSMISSION MEDIA

➢ Guided transmission media


➢ Unguided (Wireless)transmission media
GUIDED TRANSMISSION MEDIA

➢ Twisted Pair
➢ Coaxial cable

➢ Optical Fiber
TWISTED PAIR
• A twisted pair consists
of two insulated copper
wires arranged in a
regular spiral pattern.
• Twisting tends to
decrease cross talk.
• Neighbouring pairs will
have different twist
length to reduce cross
talk.
TWISTED PAIR - TRANSMISSION
CHARACTERISTICS

➢ Analog
• Needs amplifiers every 5km to 6km
➢ Digital
• Needs a repeater every 2-3km
➢ Limited distance
➢ Limited bandwidth (1MHz)
➢ For long distance- limited data rate (100Mbps)
➢ For short distance(10Gbps)
➢ Less expensive
VARIETIES OF TWISTED PAIRS
➢ Unshielded Twisted Pair (UTP)
• Ordinary telephone wire
• Cheapest
• Easiest to install
• Suffers from external EM interference from
nearby twisted pair. (No electromagnetic shielding)
• Commonly used for local area networks.

➢ Shielded Twisted Pair (STP)


• Metal braid or sheathing that reduces interference
• Better performance at higher data rates.
• More expensive
• Harder to handle (thick, heavy)
CONT…
COAXIAL CABLE
• Consists of two conductors but is constructed differently to TP
to permit it to operate over a wider range of frequencies.

• It consists of a hollow outer cylindrical conductor that surrounds


a single inner wire conductor.

• The inner conductor is held in place by either regularly spaced


insulating rings or a solid dielectric material.

• The outer conductor is covered with a jacket or shield.

• A single coaxial cable has a diameter of from 1 to 2.5 cm.


COAXIAL CABLE - TRANSMISSION
CHARACTERISTICS

➢ Superior frequency characteristics to TP


➢ Performance limited by attenuation & noise
🞤 Analog signals
• amplifiers every few km
• closer if higher frequency
• up to 500MHz

🞤 Digital signals
• repeater every 1 to 9km
• closer for higher data rates
OPTICAL FIBER
• An optical fiber cable has a cylindrical shape and consists of three concentric
sections: the core, the cladding, and the jacket

• The core is the innermost section and consists of one or more very thin
strands, or fibers, made of glass or plastic.

• Each fiber is surrounded by its own cladding, a glass or plastic coating that
has optical properties different from those of the core .

• The interface between the core and cladding acts as a reflector to confine
light that would otherwise escape the core. The outermost layer, surrounding
one or a bundle of cladded fibers, is the jacket.

• The jacket is composed of plastic and other material layered to protect


against moisture, abrasion, crushing, and other environmental dangers.
OPTICAL FIBER - BENEFITS

➢ Bandwidth of 370THz
➢ Greater capacity
• Data rates of hundreds of Gbps
➢ Smaller size & weight
➢ Lower attenuation
➢ Greater repeater spacing: 10s of km.
➢ Electromagnetic isolation: Not affected by
external electromagnetic interference
OPTICAL FIBER - TRANSMISSION
CHARACTERISTICS

• Optical fiber transmits a signal-encoded beam of light by means of


total internal reflection.

• Total internal reflection can occur in any transparent medium that


has a higher index of refraction than the surrounding medium.

➢ Acts as wave guide for 1014 to 1015 Hz


➢ Can use several different light sources
• Light Emitting Diode (LED)
o cheaper, wider operating temp range, lasts
longer
• Injection Laser Diode (ILD)
o more efficient, has greater data rate
OPTICAL FIBER TRANSMISSION MODES

• Light from a source enters the cylindrical glass or plastic core.

• Rays at shallow angles are reflected and propagated along the fiber;
other rays are absorbed by the surrounding material

• Multiple propagation path exists each with a different path length


and hence time to traverse the fiber.

• Signals will spread out and limits the rate at which it is received.
• When the fiber core radius is reduced, fewer angles will reflect.

• By reducing the radius of the core to the order of a wavelength, only a


single angle or mode can pass.

• Used for long-distance applications, including telephone and cable


television.
• The higher refractive index (discussed subsequently) at the center makes the light
rays moving down the axis advance more slowly than those near the
cladding.
• Rather than zig-zagging off the cladding, light in the core curves helically because
of the graded index, reducing its travel distance.

• The shortened path and higher speed allows light at the periphery to arrive at a
receiver at about the same time as the straight rays in the core axis.
Step Index VS Graded Index
Wired LAN Ethernet
Tutorials:
• Draw the table for the following and write its properties:
• Ethernet evolution through four generations.
• Categories of standard Ethernet w.r.t implementation.
• Categories of Fast Ethernet w.r.t implementation.
• Categories of Gigabit Ethernet w.r.t implementation.

• Draw the diagram of 802.3MAC frame and explain each fields in the frame.
Reference :
Chapter 13:
• Forouzan, Behrouz A. Data communications and networking I Behrouz A Forouzan. -
4th ed.
Wireless Transmission
Four Wireless Communication Techniques
(1) Broadcast Radio
(2) Terrestrial Microwave
(3) Satellite Microwave
(4) Infrared Communication

First one is radio wave [radio frequency range]


second one is microwave [microwave range]
the last one is infrared. [infrared range]
Wireless transmission
3 general range of frequencies
• Radio frequency 30MHz to 1 GHz
• Microwave frequency 1GHz to 40GHz
• Infrared frequency 3x1011 to 2x1012 Hz
Wireless Communication Techniques
First one is radio wave [radio frequency range]
➢ range 30 MHz to 1 GHz
➢ Omnidirectional [means it propagates in all directions from the
antenna]
➢ antenna is the center point
➢ wave is propagating in all possible directions
Second and third are microwave [microwave range]
➢ Terrestrial Microwave
➢ Satellite Microwave
the last one is infrared. [infrared range]
Unguided Media
• unguided media it provides a means for transmitting electromagnetic
signals through air but do not guide them so we may call it wireless
communication
Antennas
• electrical conductor used to radiate or collect
electromagnetic energy
• transmission antenna
– radio frequency energy from transmitter
– converted to electromagnetic energy by antenna
– radiated into surrounding environment
• reception antenna
– converted to radio frequency electrical energy
– fed to receiver
• same antenna is often used for both purposes
Antenna

• Wireless Communication is dependent on the antenna.


• Antenna plays a big role in wireless communication.
• The characteristics of the antenna and the frequency spectrum that it
transmits in the air will play an important role.
• Antenna will decide the quality of transmission, the bandwidth of
signal and various other things.
ANTENNAS
Electrical conductor used to radiate or collect electromagnetic energy
➢ transmission antenna
• electrical energy from transmitter converted to electromagnetic energy by
antenna radiated into surrounding environment

➢reception antenna
• electromagnetic energy contact on antenna converted to electrical energy
fed to receiver

• same antenna is often used for both purposes


Isotropic Antenna
• Idealized antenna known as the Isotropic Antenna (Conceptual)
• An isotropic antenna is a point in space that radiates power in all directions
equally.
• The actual radiation pattern for the isotropic antenna is a sphere with the
antenna at the center.
Parabolic Reflective Antenna

• used in terrestrial
microwave and satellite
applications
Antenna Gain
➢Antenna gain is defined as the degree of directivity of the antenna’s radiation
pattern.
➢It is equal to the product of the antenna’s electrical efficiency and directivity

The relationship between antenna gain and effective area is


Antenna Gain
➢Antenna gain is defined as the degree of directivity of the antenna’s radiation pattern.

➢Antenna gain is defined as the power output, in a particular direction, compared to that
produced in any direction by a perfect omnidirectional antenna (isotropic antenna).

𝐺𝑑𝑏 =10 log (𝑃2 / 𝑃1 ) where,


G is antenna gain,
𝑃1 is the radiated power of the directional antenna (Parabolic Antenna)
𝑃2 is the radiated power from the reference antenna (Isotropic Antenna)
Antenna Gain
• measure of directionality of antenna
• power output in particular direction verses that produced by
an isotropic antenna
• measured in decibels (dB)
• effective area relates to size and shape
– related to gain
Antenna Gain Problem
Consider a directional antenna that has a gain of 6 dB over a reference antenna
and that radiates 700 W. How much power must the reference antenna radiate
to provide the same signal power in the preferred direction? To solve, we have

6 = 10 log(P2 /700)
P2/700 = 10^(0.6) = 3.98
P2 = 2786W
Antenna Gain and Effective Area Relationship
• A concept related to that of antenna gain is the effective area of an
antenna.
• The effective area of an antenna is related to the physical size of the
antenna and to its shape.
• The relationship between antenna gain and effective area is
λ = c/f
Effective Area (A) Calculation

• The effective area (A) of an ideal isotropic antenna is with a power


gain of 1;

• the effective area of a parabolic antenna with a face area of A is


0.56A, with a power gain of 7A/ λ2.
(1) Broadcast Radio
First one is radio wave [radio frequency range]
➢ range 30 MHz to 1 GHz
➢ Omnidirectional [means it propagates in all directions from the
antenna]
➢ antenna is the center point the wave is propagating in all possible
directions
➢ The typical applications of broadcast radio communication are
FM radio, television
(1) Broadcast Radio (Contd..)
• Physical Description: The principal difference between broadcast
radio and microwave is that the former is omnidirectional and the
latter is directional.
(2) Terrestrial Microwave
• used for long haul telecommunications
• and short point-to-point links
• requires fewer repeaters but line of sight
• use a parabolic dish to focus a narrow beam onto a
receiver antenna
• 1-40GHz frequencies
• higher frequencies give higher data rates
• main source of loss is attenuation
• also interference
(2) Terrestrial Microwave
• As with any transmission system, a main source of loss is
attenuation. For microwave (and radio frequencies), the loss
can be expressed as

• where d is the distance and λ is the wavelength, in the same


units
(3) Satellite Microwave
• satellite is relay station
• receives on one frequency, amplifies or repeats
signal and transmits on another frequency
– eg. uplink 5.925-6.425 GHz & downlink 3.7-4.2 GHz
• typically requires geo-stationary orbit
– height of 35,784km
– spaced at least 3-4° apart
• typical uses
– television
– long distance telephone
– private business networks
– global positioning
Satellite Point to Point Link
(3) Satellite Microwave
(3) Satellite Microwave
Satellite Broadcast Link
(4) Infrared
• Infrared communications is achieved using transmitters/receivers
(transceivers) that modulate noncoherent infrared light.
• Transceivers must be within the line of sight of each other either
directly or via reflection
• One important difference between infrared and microwave
transmission is that the former does not enter walls.
• security and interference problems encountered in microwave
systems are not present.
• Furthermore, there is no frequency allocation issue with infrared,
because no licensing is required.

typical uses: TV remote control


Wireless Propagation
• A signal radiated from an antenna travels along one of three
routes:
1. ground wave,
2. sky wave, or
3. line of sight (LOS)
Wireless Propagation
1. Ground Wave
➢ follows the curve of the
earth
➢ can propagate considerable
distances, well over the
visual horizon.
➢ This effect is found in
frequencies up to about 2
MHz.
Wireless Propagation
1. Ground Wave (Contd..)
➢ electromagnetic waves follow earth’s curve due to many factors.

➢ Some of them are listed below:-

❖ Factor 1: electromagnetic wave induces a current in the earth's


surface
❖ Factor 2:- diffraction Electromagnetic waves scattered by the
atmosphere that they do not penetrate the upper atmosphere
Wireless Propagation
2. Sky Wave
➢ A sky wave signal can travel
through a number of hops,
bouncing back and forth between
the ionosphere and the earth's
surface

➢ With this propagation mode, a


signal can be picked up thousands
of kilometers from the transmitter.
Wireless Propagation
3. Line of Sight
Wireless Propagation
3. Line of Sight (Contd..)
➢Above 30 MHz, neither ground wave nor sky wave propagation
modes operate

➢ For satellite communication,


A signal above 30 MHz is not reflected by the ionosphere and therefore
a signal can be transmitted between an earth station and a satellite
overhead that is not beyond the horizon.
Wireless Propagation
3. Line of Sight (Contd..)
➢For ground-based communication,
▪ the transmitting and receiving antennas must be within an effective
line of sight of each other.
▪ The term effective is used because microwaves are bent or
refracted by the atmosphere.
▪ but generally microwaves are bent with the curvature of the earth
and will therefore propagate farther than the optical line of sight
Refraction
• Refraction occurs because the velocity of an electromagnetic
wave is a function of the density of the medium through which
it travels.
• In a vacuum, an electromagnetic wave travels at speed of light
• In air, water, glass, and other transparent or partially transparent
media, electromagnetic waves travel at speeds less than c.
Moving from a less dense to a more
dense medium, the electromagnetic
wave will bend toward the more
dense medium.

The index of refraction, or refractive


index, of one medium relative to
another
is the sine of the angle of incidence
divided by the sine of the angle of
refraction.
With no intervening obstacles, the optical line of sight can be
expressed as
With no intervening obstacles, the optical line of sight can be
expressed as
Line of Sight (LoS)
Transmission
Impairments
LoS Wireless Transmission
Impairments
1. Free space loss
◼ loss of signal with distance
2. Atmospheric Absorption
◼ from water vapour and oxygen absorption
3. Multipath
◼ multiple interfering signals from reflections
4. Refraction
◼ bending signal away from receiver
Attenuation
 Strength of signal falls off with distance over transmission
medium
 Attenuation factors for unguided media:
◼ Received signal must have sufficient strength so that circuitry in the
receiver can interpret the signal
◼ Signal must maintain a level sufficiently higher than noise to be received
without error
◼ Attenuation is greater at higher frequencies, causing distortion
Free Space Loss
 Free space loss, ideal isotropic antenna

Pt (4d ) (4fd )
2 2
= =
Pr 2
c 2

 Pt = signal power at transmitting antenna


 Pr = signal power at receiving antenna

  = carrier wavelength

 d = propagation distance between antennas

 c = speed of light (» 3 x10^8 m/s)

where d and  are in the same units (e.g., meters)


Free Space Loss
 Free space loss equation can be recast:

Pt  4d 
LdB = 10 log = 20 log 
Pr   
= −20 log ( ) + 20 log (d ) + 21 .98 dB

 4fd 
= 20 log  = 20 log( f ) + 20 log(d ) − 147.56 dB
 c 
Free Space Loss
 Free space loss accounting for gain of other antennas

Pt (4 ) (d ) (d ) (cd )


2 2 2 2
= = =
Pr Gr Gt 2
Ar At 2
f Ar At

 Gt = gain of transmitting antenna


 Gr = gain of receiving antenna

 At = effective area of transmitting antenna

 Ar = effective area of receiving antenna


Free Space Loss
 Free space loss accounting for gain of other antennas
can be recast as

LdB = 20 log ( ) + 20 log (d ) − 10 log ( At Ar )

= −20 log ( f ) + 20 log(d ) − 10 log( At Ar ) + 169 .54 dB


1 Example
• Show that doubling the transmission
frequency or doubling the distance between
transmitting antenna and receiving antenna
attenuates the power received by 6 dB.
free space loss is

• 4.2
• From Equation 4.2, the ratio of transmitted
power to received power is
• Pt/Pr1 = (4πd/λ)2 (1)

• If we double the frequency, we halve λ, or if


we double the distance, we double d,
• so the new ratio for either of these events is:
• Pt/Pr2 = (8πd/λ)2 (2)

• Therefore:
(2)/(1)
• 10 log (Pr1/Pr2) = 10 log (22) = 6 dB
2 Example
The audio power of the human voice is concentrated at about 300 Hz.
Antennas of the appropriate size for this frequency are impracticably large.So
to send voice by radio the voice signal must be used to modulate a higher
(carrier) frequency for which the natural antenna size is smaller.
a. What is the length of an antenna half the wavelength long for
sending radio at 300 Hz?
b. An alternative is to use a modulation scheme, for transmitting the
voice signal by modulating a carrier frequency, so that the bandwidth of the
signal is a narrow band centered on the carrier frequency. Suppose we would
like a half-wave antenna to have a length of 1 meter. What carrier frequency
would we use?
• a. Using λf = c, we have λ = (3 × 108
m/sec)/(300 Hz) = 1,000 km, so that
λ/2 = 500 km.
• b. The carrier frequency corresponding to
λ/2 = 1 m is given by:
• f = c/λ = (3 × 108 m/sec)/(2 m) = 150 MHz.
3 Example
• You are communicating between two satellites. The
transmission obeys the free space law. The signal is too weak.
Your vendor offers you two options. The vendor can use a
higher frequency that is twice the current frequency or can
double the effective area of both of the antennas. Which will
offer you more received power or will both offer the same
improvement, all other factors remaining equal? How much
improvement in the received power do you obtain from the
best option?
• The received signal is, essentially, the same
• The received power will increase by a factor of
4
4 Example
Suppose a transmitter produces 50 W of power.
a. Express the transmit power in units of dBm and dBW.
b. If the transmitter’s power is applied to a unity gain antenna
with a 900-MHz carrier frequency, what is the received power
in dBm at a free space distance of 100 m?
c. Repeat (b) for a distance of 10 km.
d. Repeat (c) but assume a receiver antenna gain of 2.
• dBm and dBW - the basics
• A decibel is not an absolute level - it is a comparison between
two levels, and on its own it cannot be used to measure an
absolute level. As a result of this the quantities of dBm and
dBW are used:

• dBm - This is a power expressed in decibels relative to one


milliwatt.
• dBW - This is a power expressed in decibels relative to one
watt.
a
• PowerdBW = 10 log (PowerW) = 10 log (50) =
17 dBW
• PowerdBm = 10 log (PowermW) = 10 log
(50,000) = 47 dBm

Note that to convert from dBm to dBW, simply


subtract 30 from the dBm value.
For example:
30 dBm = 0 dBW, which is another way of saying
that 1,000 milliwatts equals one Watt.
b
• LdB = 20 log(900 × 106) +20 log (100) – 147.56 =
120 + 59.08 +40 – 147.56 = 71.52
• Therefore, received power in dBm = 47 –
71.52 = –24.52 dBm
c
• LdB = 120 + 59.08 +80 – 147.56 =111.52;
• Pr,dBm = 47 – 111.52 = –64.52 dBm
d
• The antenna gain results in an increase of 3
dB, so that Pr,dBm = –61.52 dBm
5 Example
A microwave transmitter has an output of 0.1 W at 2 GHz. Assume that this
transmitter is used in a microwave communication system where the
transmitting and receiving antennas are parabolas, each 1.2 m in diameter.
a. What is the gain of each antenna in decibels?
b. Taking into account antenna gain, what is the effective radiated power of
the transmitted signal?
c. If the receiving antenna is located 24 km from the transmitting antenna
over a free space path, find the available signal power out of the receiving
antenna in dBm units.
a
G = 7A/λ2 = 7Af2/c2
= 7 ×(3.141)x (0.6)2 × (2×109)2/(3 × 108)2
= 351.85
GdB = 25.46 dB(transmitting and receiving
antennas )
b
• 0.1 W x 351.85 = 35.185 W
c
• Use LdB = 20 log (4π) + 20 log (d) + 20 log (f) –
20 log (c) – 10 log(Gr) – 10 log (Gt)
• LdB = 21.98 + 87.6 + 186.02 – 169.54 – 25.46 –
25.46 = 75.14 dB
• The transmitter power, in dBm is
10 log (100) = 20 for (0.1W)
• The available received signal power is
20 – 75.14 = –55.14 dBm
Pt (4 ) (d ) (d ) (cd )
2 2 2 2
= = = 2
Pr Gr Gt 2
Ar At f Ar At
6 Example
• Determine the height of an antenna for a TV
station that must be able to reach customers
up to 80 km away.
• For radio line of sight, we use d = 3.57( Kh )1/2,
with K = 4/3, we have
• 802 = (3.57)2 × 1.33 × h.
• Solving for h, we get h = 376.6 m.
Other Impairments
 Atmospheric absorption –
◼ water vapor and oxygen contribute to attenuation
◼ Rain and fog (suspended water droplets) cause scattering of
radio waves that results in attenuation

 Multipath – obstacles reflect signals so that multiple


copies with varying delays are received
Other Impairments
 Refraction –
◼ bending of radio waves as they propagate through the
atmosphere
◼ Radio waves are refracted (or bent) when they propagate
through the atmosphere.
◼ The refraction is caused by changes in the speed of the signal
with altitude or by other spatial changes in the atmospheric
conditions.
◼ Normally, the speed of the signal increases with altitude,
causing radio waves to bend downward.
Multipath Propagation
 Reflection - occurs when signal encounters a surface that is large
relative to the wavelength of the signal
 Diffraction - occurs at the edge of an impenetrable body that is
large compared to wavelength of radio wave
 Scattering – occurs when incoming signal hits an object whose
size in the order of the wavelength of the signal or less
Flow Control
chap-7
Data Link Control Protocols
• Physical layer concentrates on sending signals over
transmission link
• More control and management is needed to send data over
data communications link
– Frame synchronization: start and end of each frame
– Flow control: ensure sender does not send too fast for
receiver
– Error control: correct bit errors introduced by transmission
system
– Addressing: must specify identity of two stations
communicating
– Control and data: receiver must distinguish between
control and data information
– Link management: setup and maintain the link
• We will focus on Flow Control and Error Control
Flow Control
• Flow control aims to ensure sending entity
does not overwhelm receiving entity.
– If sender sends too fast for receiver, then buffer
may overflow
– Result of buffer overflow: data is lost, possibly
need to retransmit, which reduces performance
– Flow control tries to prevent buffer overflow
– Assume no errors but varying delays
Model of Frame Transmission
Stop-and-Wait Flow Control
• Frame Types
– DATA: contains information to be sent
– ACKnowledgement: acknowledges receipt of data
• Rules
– Source transmits a DATA frame
– Source waits for ACK frame before sending next DATA
frame
– Destination receives DATA frame and replies with an
ACK if ready for more data
– Destination can stop flow of data by not sending ACK
Stop-and-Wait Flow Control
Stop and Wait Link Utilization
• Propagation delay is the time it takes for a bit to travel from sender to
receiver, depends on
– transmission media and
– the distance between sender and receiver
• B = R x (d/V)
– B: length of the link in bits
– R: data rate of the link, in bps
– d: length or distance of the link in meters
– V: velocity of propagation, in m/s
• a = B/L
– a: the propagation delay (with frame tx time = 1)
– L: the number of bits in the frame
– Propagation delay=d/V
– Round-Trip Time = 2 × propagation delay
Stop and Wait Link Utilization
Example
What Size Frames To Use?
• Protocols often limit size of packets (frames), i.e.
maximum number of bytes of data or payload
• Large frames minimize header overheads
• Small frames:
– Allow more data to be sent when receive buffers are
limited
– Introduce small overhead if a retransmission is
required
– Allow fair sharing amongst multiple users
• Optimal packet size depends on overheads, and
desired throughput and delay performance
Efficiency of Stop-and-Wait Flow
Control
• Best-case efficiency n, for stop-and-wait flow
control:

• where: Data, Hdr, Ack are transmission times of


original data in DATA frame, header in DATA
frame and ACK frame respectively; Prop is link
propagation time
Sliding-Window Flow Control
• Stop-and-wait allows only 1 frame to be in
transit at a time
• Sliding-window flow control allows multiple
frames to be in transit at a time
• Sequence Numbers
– Each frame header contains k-bit sequence
number (wraps back to 0 after 2k -1)
– Keep track of frames sent and acknowledged
Sliding-Window Flow Control
The Sender
• Sender is allowed to send up to W frames without receiving
ACK
• Sender records:
– Last frame acknowledged
– Last frame transmitted
– Current window size
Sliding-Window Flow Control
The Receiver
• Receiver has buffer space for W frames
• Receiver records:
– Last frame acknowledged
– Last frame received
– Current window size
• Receiver sends an ACK (or Receiver Ready, RR) frame
• ACK contains sequence number of next expected DATAframe
Example
Example
Additional Features of Sliding Window
• Receive Not Ready frame: acknowledges
received frames but does not allow any more
data
• Piggybacking: DATA frame header contains
sequence number of DATA and sequence
number of ACK (acknowledgement number)
• If no DATA to send, normal ACK is transmitted
• If no new ACK, previous ACK number is
repeated in DATA frame
Example
• A channel has a data rate of 4 kbps and a
propagation delay of 20 ms. For what range of
frame sizes does stop-and-wait give an
efficiency of at least 50%?
Stop-and-Wait Flow Control
• Station sends F1
• Station sends an acknowledgment.
• Station sends F2
• Station sends an acknowledgment.
• Station sends Fn
• Station sends an acknowledgment.
Error Control
• Need to detect and correct errors such as:
– Lost frames: frame not received
– Damaged frames: frame received with errors
• Common techniques used:
– Error detection and FEC
– Positive acknowledgment: destination returns a positive
ACK after successfully receiving error-free frames
– Retransmission after timeout: source retransmits a frame
that has not been ACKed after predetermined time
– Negative acknowledgement and retransmission:
destination returns negative ACK for frames in which an
error is detected
• Last 3 techniques are called automatic repeat
request (ARQ). Three versions:
– Stop-and-wait ARQ
– Go-back-N ARQ
– Selective-reject ARQ
Stop-and-Wait ARQ
• Based on Stop-and-Wait flow control
• Source transmits single frame, starts timer and maintains
copy
– If ACK received, stop timer and transmit next frame
– If no ACK received before timer expires, retransmit copy of
frame
• Destination sends ACK if frame received (with no errors); if
damaged frame, then discard frame
• Frames have 1-bit sequence number (alternate between 0
and 1)
– Used for destination to distinguish between duplicate DATA
frames in case of damaged ACK
• Stop-and-Wait ARQ is simple, but inefficient
Go-Back-N ARQ
• Based on Sliding Window flow control
• If no error, ACK as in sliding window (contains sequence
number of next expected frame)
• If error detected by Destination, reply with negative ACK
(NACK or rejection, REJ)
• Destination will discard that frame and all future frames
until error frame received correctly
• Transmitter must go back and retransmit that frame and all
subsequent frames
• If no response from Destination after timeout, then Source
may send special ACK (ACKRequest or RR(P bit = 1))
– The ACKRequest from Source to Destination, is a request for an
ACK from the Destination
– Upon receipt of ACKRequest, the Destination sends an ACK
• Maximum window size: 2k -1
Go Back N - Handling
• Suppose that station A is sending frames to
station B. After each transmission,
• A sets an acknowledgment timer for the frame
just transmitted. Suppose that B has
previously successfully received frame (i –
1)and A has just transmitted frame i.
Go Back N - Handling
1. Damaged Frame
– error in frame i so receiver rejects frame i
– transmitter retransmits frames from i
(a) Within a reasonable period of time,A subsequently sends frame (i
+ 1).B receives frame (i + 1)out of order and sends a REJ i. A must
retransmit frame i and all subsequent frames.
(b) A does not soon send additional frames. B receives nothing and
returns neither an RR nor a REJ. When A’s timer expires, it
transmits an RR frame that includes a bit known as the P bit,
which is set to 1. B interprets the RR frame with a P bit of 1 as a
command that must be acknowledged by sending an RR indicating
the next frame that it expects, which is frame i. When A receives
the RR, it retransmits frame i. Alternatively, A could just retransmit
frame i when its timer expires.
Go Back N - Handling
2. Damaged RR. There are two subcases:
(a) B receives frame i and sends RR which suffers an error in transit. Because
acknowledgments are cumulative (e.g., RR 6 means that all frames through 5
are acknowledged), it may be that A will receive a subsequent RR to a
subsequent frame and that it will arrive before the timer associated with
frame i expires.
(b) If A’s timer expires, it transmits an RR (i+1) command as in Case 1b. It sets
another timer, called the P-bit timer. If B fails to respond to the RR command,
or if its response suffers an error in transit, then A’s P-bit timer will expire. At
this point, A will try again by issuing a new RR command and restarting the P-
bit timer. This procedure is tried for a number of iterations. If A fails to obtain
an acknowledgment after some maximum number of attempts, it initiates a
reset procedure.
3. Damaged REJ. If a REJ is lost, this is equivalent to Case
Go Back N
• Setup – Sender sliding window
• Frames are numbered sequentially using m-bit in the frame header
– For m bits frame sequence numbers 0 – (2m –1), repeated
– m=3 ➔ (0,1,2,3,4,5,6,7,0, 1,2,3,4,5,6,7,…)
• Sender can send multiple frames while waiting for ACK, but total number
of unacknowledged frames should not exceed 2m –1 which is called
window
• Window is an imaginary placeholder that covers the frames sequence
numbers which can be in transit
• The frames to the left of the window are already acknowledged and to the
right can not be sent until window slides over them
• Frames inside the window are outstanding (have been sent but not yet
acknowledged OR will be sent soon once received from upper-layer)
• Sender window will slide to frame number (i ) when (ACK i) is received.
Go Back N - Handling
• Setup –Receiver sliding window
• The size of the receiver window is always 1 and points to the next expected frame
number to arrive
• This means that frames should arrive in order
• If the expected frame is received without errors, the receiver window slides over the next
sequence number.
• Operation
• The receiver sends a positive ACK if a frame has arrived without error and in order
(with the expected sequence number )
• Receiver does not have to acknowledge each individual frame received correctly and in
order.
• Receiver can send cumulative ACK for several frames (ACK 5 acknowledges frames
(0,1,2,3,4) and expecting frame 5)
• If the frame is damaged or out-of-order, the receiver discards it (and stay silent) and
also discards all subsequent frames until it receives the one expected.
– In this case, no ACK will be transmitted
• If the sender timer expires before receiving an ACK, it will resend ALL frames
beginning with the one expired until the last one sent (Go-Back-N).
Go-Back-N ARQ, normal operation

Sender window will slide to frame number (i )


when (ACK i) is received.
Go-Back-N ARQ, lost frame
Window size for Go-Back-N ARQ
Performance

• Better than Stop and wait because it keeps the sender busy
while waiting for acknowledgement
• Does not allow error free but out of order frames to be
accepted by the receiver
• This protocol can waste a lot of bandwidth if the error
rate is high because it requests the sender to retransmit the
frame in error and all the subsequently transmitted frames
Selective-Reject ARQ
• Also called selective retransmission or selective repeat
• Only frames that are rejected or timeout are retransmitted
• Subsequent frames are accepted by the destination and
buffered
• Maximum window size: 2k-1
• Minimizes retransmission (GOOD)
• Destination must maintain large enough buffer for frames
received out- of-order (BAD)
• More complex logic in transmitter (BAD)
• Not as widely used as Go-Back-N; useful for satellite links
with long propagation delays
Selective-Reject ARQ
• Setup-Window size (for both sender and receiver)
– For m bit sequence number the maximum window size 2m-1
• Operation
– Sender in case of damaged or lost frame retransmits
• Those which are negatively acknowledged
• Those for which timer expires
– Receiver can accept out of order frames and buffer (store) them until
the lost, damaged, or delayed frame arrives.
– Receiver does not acknowledge out of order frames but buffers
them only
– If the receiver receives an out-of-order, error free frame, it will send
a frame called Negative Acknowledge (NAK) with the number of the
frame to be retransmitted only.
– NAK improves the performance because it requests retransmission of
the lost frame before the corresponding sender timer expires
Selective Repeat ARQ, lost frame
Selective Repeat ARQ, window size
Performance
• More efficient than the other two protocols
because it reduces number of retransmissions
for noisy links
• The receiver and transmitter processing logic is
more complex
– Receiver must be able to reinsert the retransmitted
(lost, delayed, damaged) frame in the proper sequence
after it arrives
– The sender should be able to send out of order frame
when requested by the sender using NAK
– Needs more memory than Go-Back-N ARQ at the
receiver side. The receiver memory is large if the
window size is large
Error-Free Sliding-Window Flow
Control
For sliding-window flow control, the throughput
on the line depends on both the window size W
and the value of a. For convenience, let us again
normalize frame transmission time to a value of
1; thus, the propagation time is a.
• Case 1: The acknowledgment for frame 1 reaches
B before A has exhausted its window. Thus, A can
transmit continuously with no pause.
• Case 2: A exhausts its window at and cannot send
additional frames until Thus, normalized
throughput is W time units out of a period of
time units.
• Therefore, we can express the utilization as
– U=1 , W >= 2a + 1
– U= W/2a + 1 , W < 2a + 1
Example
• Consider the use of 1000-bit frames on a 1-
Mbps satellite channel with a 270-ms delay.
What is the maximum link utilization for
a) Stop-and-wait flow control?
b) Continuous flow control with a window size of
7?
c) Continuous flow control with a window size of
127?
d) Continuous flow control with a window size of
255?
L=103, R=106
• a= propagation Time/(L/R)
• a=270 ×10−3/(103/ 106) = 270
a) U = 1/(1 + 2a) = 1/541 = 0.002
b) U = W/(1 + 2a) = 7/541 = 0.013
c) U = 127/541 = 0.23
d) U = 255/541 = 0.47
Example
• A system uses the Stop-and-Wait ARQ
Protocol. If each frame carries 1000 bits of
data, how long does it take to send 1 million
bits of data if the distance between the sender
and receiver is 5000 Km and the propagation
speed is 2 x 108 m? Ignore transmission,
waiting, and processing delays. We assume no
data or control frame is lost or damaged.
• Propagation delay=d/V
• d=5000km=5 x 106 m, V= 2 x 108 m
• Propagation delay=5 x 106 / 2 x 108 =25ms
• Nr of frame=1000000/1000=1000
• Time delay for one successful frame delivery is
50ms(Ignore transmission, waiting, and processing
delays. We assume no data or control frame is lost or
damaged)
• For 1000 frame, time delay=1000x50ms=50s
Example
• Repeat using the Go-back-N ARQ Protocol
with a window size of 7.Ignore the overhead
due to the header and trailer. (Assume
transmission time of frame=1ms)
• We need to send w=7 frame
• 1000000/7000=143 windows
• Transmission time of window =7x1ms=7ms
• Delay for 1 window
• =twframe+2tprop =7+50=57ms
• Delay for 143 windows
• =143x57ms=8.151s
Example
• Using 5-bit sequence numbers, what is the
maximum size of the send and receive
windows for each of the following protocols?
a. Stop-and-Wait ARQ
b. Go-Back-NARQ
c. Selective-Repeat ARQ
a) Stop-and-Wait ARQ=20
b) Go-Back-NARQ=25 -1
c) Selective-Repeat ARQ=25-1
Example
• A sender sends a series of frame to the same
destination using 5-bit sequence numbers. If
the sequence number starts with 0, what is
the sequence number after sending 100
frame?
• A five-bit sequence number can create
sequence numbers from 0 to 31
• The sequence number in the Nth frame is (N
mod 32)
• 101th frame has the sequence number (101
mod 32) or 5.
HDLC Station Types
• Primary station
– Controls operation of link
– Frames issued are called commands
– Maintains separate logical link to each secondary
station
• Secondary station
– Under control of primary station
– Frames issued called responses
• Combined station
– May issue commands and responses
HDLC Link Configurations
• Unbalanced
– One primary and one or more secondary stations
– Supports full duplex and half duplex
• Balanced
– Two combined stations
– Supports full duplex and half duplex
HDLC Transfer Modes (1)
• Normal Response Mode (NRM)
– Unbalanced configuration
– Primary initiates transfer to secondary
– Secondary may only transmit data in response to
command from primary
HDLC Transfer Modes (2)
• Asynchronous Balanced Mode (ABM)
– Balanced configuration
– Either station may initiate transmission without
receiving permission
– Most widely used
HDLC Transfer Modes (3)
• Asynchronous Response Mode (ARM)
– Unbalanced configuration
– Secondary may initiate transmission without
permission form primary
– Primary responsible for line
Frame Structure
• Synchronous transmission
• All transmissions in frames
• Single frame format for all data and control
exchanges
Frame Structure
Flag Fields
• Delimit frame at both ends
• 01111110
• May close one frame and open another
• Receiver hunts for flag sequence to synchronize
• Bit stuffing used to avoid confusion with data containing
01111110
– 0 inserted after every sequence of five 1s
– If receiver detects five 1s it checks next bit
– If 0, it is deleted
– If 1 and seventh bit is 0, accept as flag
– If sixth and seventh bits 1, sender is indicating abort
Bit Stuffing
• Example with
possible errors
Address Field
• Identifies secondary station that sent or will receive frame
• Usually 8 bits long
• May be extended to multiples of 7 bits
– LSB of each octet indicates that it is the last octet (1) or not (0)
• All ones (11111111) is broadcast
Control Field
• Different for different frame type
– Information - data to be transmitted to user (next
layer up)
• Flow and error control piggybacked on information
frames
– Supervisory - ARQ when piggyback not used
– Unnumbered - supplementary link control
• First one or two bits of control filed identify
frame type
Control Field Diagram
Poll/Final Bit
• Use depends on context
• Command frame
– P bit
– 1 to solicit (poll) response from peer
• Response frame
– F bit
– 1 indicates response to soliciting command
Information Field
• Only in information and some unnumbered
frames
• Must contain integral number of octets
• Variable length
Frame Check Sequence Field
• FCS
• Error detection
• 16 bit CRC
• Optional 32 bit CRC
HDLC Operation
• Exchange of information, supervisory and
unnumbered frames
• Three phases
– Initialization
– Data transfer
– Disconnect
Examples of Operation (1)
Examples of Operation (2)
Hamming Code Basics

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
10.
Note

The Hamming distance between two


words is the number of differences
between corresponding bits.

10.
Example 10.4

Let us find the Hamming distance between two pairs of


words.

1. The Hamming distance d(000, 011) is 2 because

2. The Hamming distance d(10101, 11110) is 3 because

10.
Note

The minimum Hamming distance is the


smallest Hamming distance between
all possible pairs in a set of words.

10.
Example 10.2
Find the minimum Hamming distance of the
coding scheme in Table 10.1.
Solution
We first find all Hamming distances.

The dmin in this case is 2.

10.
Example 10.3
Find the minimum Hamming distance of the
coding scheme in Table 10.2.
Solution
We first find all the Hamming distances.

The dmin in this case is 3.

10.
Note

To guarantee the detection of up to s


errors in all cases, the minimum
Hamming distance in a block
code must be dmin = s + 1.

10.
Example 10.7

The minimum Hamming distance for our first code


scheme (Table 10.1) is 2. This code guarantees detection of
only a single error. For example, if the third codeword
(101) is sent and one error occurs, the received codeword
does not match any valid codeword. If two errors occur,
however, the received codeword may match a valid
codeword and the errors are not detected.

10.
Example 10.8

Our second block code scheme (Table 10.2) has dmin = 3.


This code can detect up to two errors. Again, we see that
when any of the valid codewords is sent, two errors create
a codeword which is not in the table of valid codewords.
The receiver cannot be fooled.

However, some combinations of three errors change a


valid codeword to another valid codeword. The receiver
accepts the received codeword and the errors are
undetected.

10.
Figure 10.8 Geometric concept for finding dmin in error detection

10.
Figure 10.9 Geometric concept for finding dmin in error correction

10.
Note

To guarantee correction of up to t errors


in all cases, the minimum Hamming
distance in a block code
must be dmin = 2t + 1.

10.
Example 10.9

A code scheme has a Hamming distance dmin = 4. What is


the error detection and correction capability of this
scheme?

Solution
This code guarantees the detection of up to three errors
(s = 3), but it can correct up to one error. In other words,
if this code is used for error correction, part of its capability
is wasted. Error correction codes need to have an odd
minimum distance (3, 5, 7, . . . ).

10.
Note

A simple parity-check code is a


single-bit error-detecting
code in which
n = k + 1 with dmin = 2.
Even parity (ensures that a codeword
has an even number of 1’s) and odd
parity (ensures that there are an odd
number of 1’s in the codeword)

10.
Table 10.3 Simple parity-check code C(5, 4)

10.
Figure 10.10 Encoder and decoder for simple parity-check code

10.
Example 10.12

Let us look at some transmission scenarios. Assume the


sender sends the dataword 1011. The codeword created
from this dataword is 10111, which is sent to the receiver.
We examine five cases:

1. No error occurs; the received codeword is 10111. The


syndrome is 0. The dataword 1011 is created.
2. One single-bit error changes a1 . The received
codeword is 10011. The syndrome is 1. No dataword
is created.
3. One single-bit error changes r0 . The received codeword
is 10110. The syndrome is 1. No dataword is created.
10.
Example 10.12 (continued)

4. An error changes r0 and a second error changes a3 .


The received codeword is 00110. The syndrome is 0.
The dataword 0011 is created at the receiver. Note that
here the dataword is wrongly created due to the
syndrome value.
5. Three bits—a3, a2, and a1—are changed by errors.
The received codeword is 01011. The syndrome is 1.
The dataword is not created. This shows that the simple
parity check, guaranteed to detect one single error, can
also find any odd number of errors.

10.
Note

A simple parity-check code can detect an


odd number of errors.

10.
Note

All Hamming codes discussed in this


book have dmin = 3 (2 bit error detection
and single bit error correction).
A codeword consists of n bits of which k
are data bits and r are check bits.
Let m = r, then we have: n = 2m -1
and k = n-m

10.
Error Detection
and Correction

• Types of Errors
• Detection
• Correction
What is data transmission?

• Data transmission refers to the process of


transferring data between two or more
digital devices.
• Data is transmitted from one device to
another in analog or digital format.
• Basically, data transmission enables devices
or components within devices to speak to
each other.
How does data transmission
work between digital devices?
• Data is transferred in the form of bits
between two or more digital devices.
• There are two methods used to transmit data
between digital devices:
– serial transmission
– parallel transmission.
What is serial transmission?
• When is serial transmission used to send
data?
– Serial transmission is normally used for long-
distance data transfer.
– It is also used in cases where the amount of
data being sent is relatively small.
– It ensures that data integrity is maintained as it
transmits the data bits in a specific order, one
after another.
• In this way, data bits are received in-sync
with one another.
What is parallel transmission?
• When data is sent using parallel data transmission, multiple
data bits are transmitted over multiple channels at the same
time.
• This means that data can be sent much faster than using serial
transmission methods.
• The main advantages of parallel transmission over serial transmission
are:
– it is easier to program;
– and data is sent faster.

• Disadvantage:
– Although parallel transmission can transfer data faster, it requires more
transmission channels than serial transmission.
– This means that data bits can be out of sync, depending on transfer distance
and how fast each bit loads.

• Parallel transmission is used when:


– a large amount of data is being sent;
– the data being sent is time-sensitive;
– and the data needs to be sent quickly.
Basic concepts
 Networks must be able to transfer data from
one device to another with complete accuracy.
 Data can be corrupted during transmission.
 For reliable communication, errors must be
detected and corrected.

Error detection and correction are


implemented either at the data link layer or the
transport layer of the OSI model.
Types of Errors
Single-bit error
• Single bit errors are the least likely type of
errors in serial data transmission because
the noise must have a very short duration
which is very rare.
• However this kind of errors can happen in
parallel transmission.

Example:
• If data is sent at 1Mbps then each bit lasts
only 1/1,000,000 sec. or 1 μs.
• For a single-bit error to occur, the noise
must have a duration of only 1 μs, which is
very rare.
Burst error
The term burst error means that two or
more bits in the data unit have changed
from 1 to 0 or from 0 to 1.

Burst errors does not necessarily mean that


the errors occur in consecutive bits, the
length of the burst is measured from the first
corrupted bit to the last corrupted bit. Some
bits in between may not have been
corrupted.
Burst error is most likely to happen in serial
transmission since the duration of noise is
normally longer than the duration of a bit.
The number of bits affected depends on the data
rate and duration of noise.
Example:
– If data is sent at rate = 1Kbps then a noise of 1/100 sec can
affect 10 bits.(1/100*1000)
– If same data is sent at rate = 1Mbps then a noise of 1/100 sec
can affect 10,000 bits.(1/100*106)
Error detection
Error detection means to decide whether the
received data is correct or not without having a
copy of the original message.

Error detection uses the concept of redundancy,


which means adding extra bits for detecting
errors at the destination.
• Assume that data are transmitted as one or more
contiguous sequences of bits called frames.
• We define these probabilities with respect to errors
in transmitted frames:
– Pb-Probability that a bit is received in error; also known
as the bit error rate(BER)
– P1-Probability that a frame arrives with no bit errors
– P2-Probability that, with an error-detecting algorithm in
use, a frame arrives with one or more undetected errors
– P3-Probability that, with an error-detecting algorithm in
use, a frame arrives with one or more detected bit errors
but no undetected bit errors
To express the remaining probabilities, assume the
probability that any bit is in error Pb is constant and
independent for each bit.
Then we have

Where F is the number of bits per frame.

In words,
• The probability that a frame arrives with no bit errors
decreases when the probability of a single bit error increases.
• The probability that a frame arrives with no bit errors
decreases with increasing frame length.
• The longer the frame, the more bits it has and the higher the
probability that one of these is in error.
Error detecting code(Check bits/Redundancy check)
Four types of redundancy checks are used
in data communications
Vertical Redundancy Check
VRC
Performance

It can detect single bit error


It can detect burst errors only if the total
number of errors is odd.
Longitudinal Redundancy Check
LRC
Performance

• LRC increases the likelihood of detecting burst


errors.
• If two bits in one data units are damaged and
two bits in exactly the same positions in another
data unit are also damaged, the LRC checker
will not detect an error.
Two Dimensional Parity Check
VRC and LRC
• VRC-Each Character Block
• LRC – Entire Block of codes
Cyclic Redundancy Check
CRC
Cyclic Redundancy Check
• Given a k-bit frame or message, the
transmitter generates an n-bit sequence,
known as a frame check sequence (FCS), so
that the resulting frame, consisting of (k+n)
bits, is exactly divisible by some
predetermined number.
• The receiver then divides the incoming
frame by the same number and, if there is
no remainder, assumes that there was no
error.
Modulo 2 arithmetic

Data:100100 (6 bits) –(k-bits)


Generated Pattern (P): 1101 (4 bits)-
(n-bits)
Redundant bits (F) : ? (n-1)
(3 bits)

Transmitted :100100001 (n bits)


CRC :001 (n-k bits)
There is no remainder, and therefore T is exactly divisible by P.
Thus, the errors in an n-bit frame can be represented by an n-bit
field with 1s in each error position.

If there is an error(E != 0) the receiver will fail to detect the error if


and only if Tr is divisible by P, which is equivalent to E divisible by
P.
Polynomial
A second way of viewing the CRC process is to express all
values as polynomials in a dummy variable X, with binary
coefficients.
The coefficients correspond to the bits in the binary number.
Arithmetic operations are again modulo 2

P = 11001

D = 110011
The CRC process can now be described as
• D(X)=1010001101
• P(X)=110101
Polynomial and Divisor
Polynomial??
Standard Polynomials
• An error E(X) will only be undetectable if it is divisible by P(X).

• It can be shown [PETE 61, RAMA88] that all of the following


errors are not divisible by a suitably chosen P(X) and hence are
detectable:
– All single-bit errors, if P(X) has more than one nonzero term
– All double-bit errors, as long as P(X) is a special type of polynomial,
called a primitive polynomial, with maximum exponent L, and the frame
length is less than 2L - 1.
– Any odd number of errors, as long as P(X) contains a factor (X+1)
– Any burst error for which the length of the burst is
less than or equal to n-k; that is, less than or equal
to the length of the FCS
– A fraction of error bursts of length n-k, the fraction
equals 1-2-(n-k-1) .
– A fraction of error bursts of length n-k+1 the
fraction equals 1-2-(n-k)
Digital Logic
• The CRC process can be represented by, and indeed
implemented as, a dividing circuit consisting of XOR gates and a
shift register.

• The shift register is a string of 1-bit storage devices.

• Each device has an output line, which indicates the value


currently stored, and an input line.

• At discrete time instants, known as clock times, the value in the


storage device is replaced by the value indicated by its input line.

• The entire register is clocked simultaneously, causing a 1-bit shift


along the entire register.
The circuit is implemented as follows:
• Draw the circuit with shift registers and find
the CRC.
• Data:1010
• Pattern :1011
• Draw the circuit with shift registers for
dividing the polynomial.

• P(X):X5+X4+X2+1
• D(X): X9+X7+X3+X2+1
P(X):X5+X4+X2+1
D(X): X9+X7+X3+X2+1
Tutorial 6

• D= 10111001
• P= 11001
Tutorial 6
• A wants to send a message “HI” to B. The
divisor used is 11001. What is the codeword
that is sent to B? The Hexadecimal
equivalent of H is 0x48 (110000) and I is
0x49 (110001). (Use polynomials)
• “1100 0011 0001 1101” is received by B. B
checks for error using hardware
implementation. What is the conclusion?
(Divisor=11001)
Checksum
At the sender
The unit is divided into k sections, each of n
bits.
All sections are added together using one’s
complement to get the sum.
The sum is complemented and becomes the
checksum.
The checksum is sent with the data
At the receiver
The unit is divided into k sections, each of n
bits.
All sections are added together using one’s
complement to get the sum.
The sum is complemented.
If the result is zero, the data are accepted:
otherwise, they are rejected.
Performance
The checksum detects all errors involving an
odd number of bits.
It detects most errors involving an even number
of bits.
If one or more bits of a segment are damaged
and the corresponding bit or bits of opposite
value in a second segment are also damaged, the
sums of those columns will not change and the
receiver will not detect a problem.
• Find the checksum at sender aand receiver
for the following sequence.
– 10110011 10101011 01011010 11010101
Tutorial 6
• What does “cyclic” signify in CRC?
• CRC versus Checksum versus Parity
check?
• VRC versus LRC?
• Calculate (and verify) the checksum of
“CHECKSUM”.
Error Correction
It can be handled in two ways:
1) receiver can have the sender retransmit the
entire data unit.
2) The receiver can use an error-correcting
code, which automatically corrects certain
errors.
Single-bit error correction
To correct an error, the receiver reverses the value
of the altered bit. To do so, it must know which bit
is in error.
Number of redundancy bits needed
• Let data bits = m
• Redundancy bits = r
Total message sent = m+r
The value of r must satisfy the following relation:
2r ≥ m+r+1
Error Correction
Hamming Code
Hamming Code
Hamming Code
Example of Hamming Code
Single-bit error
Error
Detection
Tutorial 7
• Calculate the number of parity(Redundancy
bits).
– If m=4
– m=7
Tutorial 7
• A bit word 1011 is to be transmitted ..
– Find the number of redundancy bits.
– Construct the even parity seven bit hamming code
for this data.
• If 7 bit hamming code is received as
1011011 .Assuming even parity state
whether it is correct or not ?If not, locate the
bit error.
HDLC
High Level Data Link Control
HDLC : High-level Data Link Control

❑It is a bit-oriented data link protocol


❑Designed to support both half duplex and full duplex
communication over point-to-point and multipoint links.
❑It implements the ARQ mechanisms.
❑The HDLC protocol embeds information in a data frame
that allows devices to control data flow and correct errors

2
HDLC : High-level Data Link Control

 Each piece of data is encapsulated in an HDLC frame by adding a


trailer and a header.
 The header contains an HDLC address and an HDLC control field.
 The trailer is found at the end of the frame, and contains a (CRC)
which detects any errors which may occur during transmission.
 The frames are separated by HDLC flag sequences which are
transmitted between each frame and whenever there is no data to be
transmitted.

3
HDLC Station Types
• Primary station
• Controls operation of link
• Frames issued are called commands
• Maintains separate logical link to each secondary station
• Secondary station
• Under control of primary station
• Frames issued called responses
• Combined station
• May issue commands and responses
HDLC Link Configurations
• Unbalanced
• One primary and one or more secondary stations
• Supports full duplex and half duplex
• Balanced
• Two combined stations
• Supports full duplex and half duplex
HDLC Transfer Modes (1)
• Normal Response Mode (NRM)
• Unbalanced configuration
• Primary initiates transfer to secondary
• Secondary may only transmit data in response to command from primary
HDLC Transfer Modes (2)
• Asynchronous Balanced Mode (ABM)
• Balanced configuration
• Either station may initiate transmission without receiving permission
• Most widely used
HDLC Transfer Modes (3)
• Asynchronous Response Mode (ARM)
• Unbalanced configuration
• Secondary may initiate transmission without permission form primary
• Primary responsible for line
HDLC frame types

9
HDLC Frame Fields
Flag field
• is 8 bits of a fixed pattern (0111 1110).
• There is one flag at the beginning and one at the end frame.
• The ending flag of one Frame can be used as the beginning flag of the next
frame.
• To guarantee that the flag does not appear anywhere else in the frame
• HDLC uses a process called Bit Stuffing.
• Every time a sender wants to transmit a bit sequence having more than 6
consecutive 1’s, it inserts 1 redundant 0 after the 5th 1

10
Bit Stuffing
• the process of adding one extra zero whenever there are 5 consecutive 1’s in the
data, so that the receiver doesn’t mistake the data for a flag.

A frame before bit stuffing:


01111110 01111100 101101111 110010

After
011111010 011111000 101101111 1010010

11
How does the receiver identify a stuffed bit?

• Receiver reads incoming bits and counts 1’s.


• When number of consecutive 1s after a zero is 5, it checks the next bit
(7th bit).
• If 7th bit = zero ➔ receiver recognizes it as a stuffed bit, discard it and
resets the counter.
• If the 7th bit = 1 ➔ then the receiver checks the 8th bit; If the 8th bit =
0, the sequence is recognized as a flag.

01111010 011111000 101101111 1010010

12
Address Field
• Identifies secondary station that sent or will receive frame
• Usually 8 bits long
• May be extended to multiples of 7 bits
• LSB of each octet indicates that it is the last octet (1) or not (0)
• All ones (11111111) is broadcast
HDLC Control Field

14
Control Field

• all three types contain a bit called (Poll/Final) P/F bit


I-Frame
• N(S) : sequence # of the sent frame
• N(R) : sequence # of frame expected in return
• ➔ N(R) is ACK field
• If last frame received is error free
➔N(R) number will be the next frame in sequence
• If the frame was not received correctly
➔ N( R) number will be the number of damaged frame indicating the need for retransmission

15
Control Field Diagram
Information Field
• Only in information and some unnumbered frames
• Must contain integral number of octets
• Variable length
I frame

18
Information Field

19
Information Field

 Contains user data in I-frame and network management information in


a U-frame.
 It is possible to include flow and error control information in an I-frame
that also contains data.
 In 2-way exchange of data ( full-duplex), the 2nd station can ACK receipt
of data from the 1st station in the control field of its own data frame
rather than sending a separate frame just for ACK.
 Combining data to be sent & ACK of the frame received in one single
frame is called PIGGYBACKING.

20
Poll/Final Bit
• Use depends on context
• Command frame
• P bit
• 1 to solicit (poll) response from peer
• Response frame
• F bit
• 1 indicates response to soliciting command
Poll/Final

• P/F = 1 ➔POLL or Final


• Poll if frame is sent by the primary
• Final if frame is sent by the secondary

22
Frame Check Sequence Field
• FCS
• Error detection
• 16 bit CRC
• Optional 32 bit CRC
HDLC FCS Field

24
S-frame control field in HDLC

25
26
• Receive Ready (RR)
• Positive ACK of a received I- frame
• Receive Not Ready (RNR)
• Is RR frame with additional duties
• It Ack the receipt of a frame and announces that the
receiver is busy
• Reject (REJ)
• This is a NAK frame that can be used in Go-back-n
• Selective reject (SREJ)
• This is a NAK frame used in Selective Repeat ARQ

27
HDLC Operation
• Exchange of information, supervisory and unnumbered frames
• Three phases
• Initialization
• Data transfer
• Disconnect
Examples of Operation (1)
Examples of Operation (2)
Multiplexing
Introduction
• Under the simplest conditions, a medium can
carry only one signal at any moment in time.
• For multiple signals to share one medium, the
medium must somehow be divided
Why multiplexing?
• The communication media usually have much
higher bandwidth
• On the other hand individual users have lesser
data to send. And as a consequence the two
communicating stations do not utilize the full
capacity of a data link.
Multiplexing techniques can be categorized
into the following three types:

• Frequency-division multiplexing (FDM): It is


most popular and is used extensively in radio
and TV transmission. Here the frequency
spectrum is divided into several logical
channels, giving each user exclusive
possession of a particular frequency band.
• Time-division Multiplexing (TDM): It is also
called synchronous TDM, which is commonly
used for multiplexing digitized voice stream.
The users take turns using the entire channel
for short burst of time.
• Statistical TDM: This is also called
asynchronous TDM, which simply improves on
the efficiency of synchronous TDM.
Frequency-Division Multiplexing
FDM is an analog multiplexing technique that combines analog signals.
Frequency Division Multiplexing
• Basic approach is to divide the available
bandwidth of a single physical medium into a
number of smaller, independent frequency
channels.
• Using modulation, independent message signals
are translated into different frequency bands.
• All the modulated signals are combined to form a
composite signal for transmission.
• The carriers used to modulate the individual
message signals are called sub-carriers,
• If the channels are very close to one other, it
leads to inter-channel cross talk.
• Channels must be separated by strips of
unused bandwidth to prevent inter-channel
cross talk.
• These unused channels between each
successive channel are known as guard bands
Assume that a voice channel occupies a bandwidth of 4
kHz. We need to combine three voice channels into a link
with a bandwidth of 12 kHz, from 20 to 32 kHz. Show the
configuration, using the frequency domain. Assume there
are no guard bands.
Solution
We shift (modulate) each of the three voice channels to a
different bandwidth, as shown in Figure. We use the 20- to
24-kHz bandwidth for the first channel, the 24- to 28-kHz
bandwidth for the second channel, and the 28- to 32-kHz
bandwidth for the third one. Then we combine them as
shown in Figure.
Five channels, each with a 100-kHz bandwidth, are to be
multiplexed together. What is the minimum bandwidth of
the link if there is a need for a guard band of 10 kHz
between the channels to prevent interference?
Solution
For five channels, we need at least four guard bands. This
means that the required bandwidth is at least
5 × 100 + 4 × 10 = 540 kHz,
Wavelength-Division Multiplexing
• Wavelength-division multiplexing (WDM) is
conceptually same as the FDM, except that
the multiplexing and demultiplexing involves
light signals transmitted through fibre-optic
channels.
• WDM system with 100 beams each operating
at 10 Gbps, for a total data rate of 1 trillion
bits per second
Time-Division Multiplexing
• In frequency division multiplexing, all signals
operate at the same time with different
frequencies, but in Time-division multiplexing
all signals operate with same frequency at
different times.
Synchronous Time Division
Multiplexing
• The multiplexor accepts input from attached devices in a
round-robin fashion and transmit the data in a never
ending pattern.
• Synchronous TDM is called synchronous because the time
slots are preassigned to sources and fixed.
• The sequence of slots dedicated to one source, from frame
to frame, is called a channel.
• The slot length equals the transmitter buffer length,
typically a bit or a byte (character).
• The time slots for each source are transmitted whether or
not the source has data to send
• it is possible for a synchronous TDM device to handle
sources of different data rates. For example, the slowest
input device could be assigned one slot per cycle, while
faster devices are assigned multiple slots per cycle.
Synchronous Time Division
Multiplexing
Synchronous time-division multiplexing
Data link control on TDM channel
• We assume two data sources, each using HDLC.
• One is transmitting a stream of HDLC frames containing
three octets of data each
• the other is transmitting HDLC frames containing four
octets of data.
• The octets of the HDLC frames from the two sources
are shuffled together for transmission over the
multiplexed line.
• The FCS is not in one piece. However, the pieces are
reassembled correctly before they are seen by the
device on the other end of the HDLC protocol.
Framing
• Some means is needed to assure frame
synchronization.
• Important to maintain framing synchronization
because, if the source and destination are out of
step, data on all channels are lost.
• Added- digit framing
– one control bit added to each TDM frame
– identifiable bit pattern used on control channel
– eg. alternating 01010101…
– compare incoming bit patterns on each channel with known
sync pattern
Pulse Stuffing
• If each source has a separate clock, any variation
among clocks could cause loss of synchronization.
• the data rates of the input data streams may vary.
• For both these problems, a technique known as
pulse stuffing is an effective remedy
– Outgoing data rate (excluding framing bits) higher
than sum of incoming rates
– Stuff extra dummy bits or pulses into each incoming
signal until it matches local clock
– Stuffed pulses inserted at fixed locations in frame and
removed at demultiplexer
TDM of Analog and Digital Sources

Sampling rate at least


twice the maximum
frequency
Statistical Time Division Multiplexing

• A statistical multiplexor transmits only the data


from active workstations.
• If a workstation is not active, no space is wasted
on the multiplexed stream.
• A statistical multiplexor accepts the incoming
data streams and creates a frame containing only
the data to be transmitted.

35
Statistical TDM Frame Format
Performance

M represents the maximum rate at which


data bits can be transmitted (OR)link
capacity

The average arrival rate

Time it takes to
transmit one bit
• Five 4800-bps lines are to be multiplexed using TDM. Ignoring
overhead bits in the TDM frame, what is the total capacity
required for synchronous TDM? Assuming that we wish to
limit average TDM link utilization to 0.8, and assuming that
each TDM link is busy 60% of the time, what is the capacity
required for statistical TDM?
• total capacity required for synchronous
TDM=4800bpsx5=24kbps
• capacity required for statistical
TDM=(4800bpsx5x0.6)/0.8=18kbps
Example
• Show the contents of the five output frames for a
synchronous TDM multiplexer that combines four
sources sending the following characters. Note
that the characters are sent in the same order
that they are typed. The third source is silent.
a) Source 1 message: HELLO
b) Source 2 message: HI
c) Source 3 message:
d) Source 4 message: BYE
Example
• A character-interleaved time division multiplexer is
used to combine the data streams of a number of 110-
bps asynchronous terminals for data transmission over
a 2400-bps digital line. Each terminal sends
asynchronous characters consisting of 7 data bits, 1
parity bit, 1 start bit, and 2 stop bits. At least 3% of the
line capacity is reserved for pulse stuffing to
accommodate speed variations from the various
terminals.
a) Determine the number of bits per character.
b) Determine the number of terminals that can be
accommodated by the multiplexer.
a) n = 7 + 1 + 1 + 2 = 11 bits/character
b) Available capacity = 2400 × 0.97 = 2328 bps
If we use 20 terminals sending one character at
a time in TDM, the total capacity used is:
20x110 bps=220bps<2328
21 × 110 bps = 2310 bps available capacity
22 x 110bps=2420>2328
Statistical Time Division Multiplexing

• A statistical multiplexor transmits only the data


from active workstations.
• If a workstation is not active, no space is wasted
on the multiplexed stream.
• A statistical multiplexor accepts the incoming
data streams and creates a frame containing only
the data to be transmitted.

45
To identify each piece of data,
an address is included
If the data is of variable size, a length
is also included
More precisely, the transmitted frame
contains a collection of data groups.
Example
We need to use synchronous TDM and combine 20
digital sources, each of 100 Kbps. Each output slot
carries 2 bit from each digital source, but one extra
bit is added to each frame for synchronization.
Answer the following questions:
a. What is the size of an output frame in bits?
b. What is the output frame rate?
c. What is the duration of an output frame?
d. What is the output data rate?
e. What is the efficiency of the system (ratio of useful
bits to the total bits).
• Each output frame carries 2 bits from each
source plus one extra bit for synchronization.
a) Frame size = 20 × 2 + 1 = 41 bits.
b) Each frame carries 2 bit from each source.
Frame rate = 100,000/2 = 50,000 frames/s.
c) Frame duration = 1 /(frame rate) = 1 /50,000
= 20 μs.
d) Data rate = (50,000 frames/s) × (41
bits/frame) = 2.05 Mbps.
e) In each frame 40 bits out of 41 are useful.
Efficiency = 40/41= 97.5%.
Example
• Ten sources, six with a bit rate of 200 kbps and
four with a bit rate of 400 kbps are to be
combined using TDM with no synchronizing bits.
Answer the following questions about the final
stage of the multiplexing:
a) What is the size of a frame in bits?
b) What is the frame rate?
c) What is the duration of a frame?
d) What is the data rate?
[Each output slot carries 1 bit from each digital source]
• We combine six 200-kbps sources into three 400-
kbps. Now we have seven 400-kbps channel.
a) Each output frame carries 1 bit from each of the
seven 400-kbps line. Frame size = 7 × 1 = 7 bits.
b) Each frame carries 1 bit from each 400-kbps
source. Frame rate = 400,000 frames/s.
c) Frame duration = 1 /(frame rate) = 1 /400,000 =
2.5 μs.
d) Output data rate = (400,000 frames/s) × (7
bits/frame) = 2.8 Mbps. We can also calculate
the output data rate as the sum of input data
rate because there is no synchronizing bits.
Output data rate = 6 × 200 + 4 × 400 = 2.8 Mbps.
Chapter 12
Multiple Access
Multiple Access

 Broadcast link used in LAN consists of multiple sending and


receiving nodes connected to or use a single shared link

Broadcast links Examples


Figure 12.1 Data link layer divided into two functionality-oriented sublayers

Responsible for error


and flow control

Link Layer Control (LLC)

Control
MAC

Responsible framing
and MAC address and
Multiple Access Control
Multiple Access
 Problem: When two or more nodes transmit at the same time, their
frames will collide and the link bandwidth is wasted during collision
 How to coordinate the access of multiple sending/receiving nodes to
the shared link???
• Solution: We need a protocol to coordinate the transmission of the
active nodes
• These protocols are called Medium or Multiple Access Control
(MAC) Protocols belong to a sublayer of the data link layer called
MAC (Medium Access Control)
• What is expected from Multiple Access Protocols:
• Main task is to minimize collisions in order to utilize the bandwidth by:
• Determining when a station can use the link (medium)
• what a station should do when the link is busy
• what the station should do when it is involved in collision
Taxonomy of multiple-access protocols discussed in this chapter

For wireless not


included with us
Random Access
•Random Access (or contention) Protocols:

•No station is superior to another station and none is


assigned the control over another.

•A station with a frame to be transmitted can use


the link directly based on a procedure defined by
the protocol to make a decision on whether or not
to send.
• .
ALOHA Protocols
• Was designed for wireless LAN and can be used for any shared medium
• Pure ALOHA Protocol Description
• All frames from any station are of fixed length (L bits)
• Stations transmit at equal transmission time (all stations produce frames with
equal frame lengths).
• A station that has data can transmit at any time
• After transmitting a frame, the sender waits for an acknowledgment for an
amount of time (time out) equal to the maximum round-trip propagation
delay = 2* tprop
• If no ACK was received, sender assumes that the frame or ACK has been
destroyed and resends that frame after it waits for a random amount of time
• If station fails to receive an ACK after repeated transmissions, it gives up
• Channel utilization or efficiency or Throughput is the percentage of the
transmitted frames that arrive successfully (without collisions) or the
percentage of the channel bandwidth that will be used for transmitting frames
without collisions
Frames in a pure ALOHA network

Pure ALOHA:
1. Each station sends a frame whenever is has a frame to send
2. One channel to share, possibility of collision between frames from different stations

12.8
Procedure for ALOHA protocol
Critical time for pure ALOHA protocol

Tfr= Frame
Transmission time

If the frame transmission time is T sec, then the vulnerable time is = 2 T sec.
This means no station should send during the T-sec before this station starts
transmission and no station should start sending during the T-sec period that the
current station is sending.
Pure ALOHA

In pure ALOHA, frames are transmitted at completely arbitrary times.


Note

The throughput ( S) for pure ALOHA is


S = G × e −2G .
The maximum throughput
Smax = 0.184 when G= (1/2).
G = Average number of frames generated by the system (all stations) during
one frame transmission time

ALOHA Maximum channel utilization is 18%


(i.e, if the system produces F frames/s, then 0.18 * F frames will arrive
successfully on average without the need of retransmission)
Random Access – Slotted ALOHA
• Time is divided into slots equal to a frame transmission
time (Tfr)
• A station can transmit at the beginning of a slot only
• If a station misses the beginning of a slot, it has to wait until
the beginning of the next time slot.
• A central clock or station informs all stations about the start
of a each slot
• Maximum channel utilization is 37%
Frames in a slotted ALOHA network

Slotted ALOHA:
1. We divide the time into slots and force the station to send only at the beginning of
the time slot

12.17
In danger time for slotted ALOHA protocol
Random Access – Slotted ALOHA
Note

The throughput for slotted ALOHA is


S = G × e−G .
The maximum throughput
Smax = 0.368 when G = 1.

G = Average number of frames generated by the system (all stations)


during one frame transmission time
Efficiency of Aloha

0.4

0.3
Slotted Aloha
0.2

0.1
Pure Aloha

0.5 1.0 1.5 2.0


G = offered load rate= new frames+ retransmitted
= Total frames presented to the link per
the transmission time of a single frame
Advantage of ALOHA protocols

A node that has frames to be transmitted can transmit


continuously at the full rate of channel (R bps) if it is
the only node with frames
Simple to be implemented
No master station is needed to control the medium

Disadvantage

If (M) nodes want to transmit, many collisions can occur


and the rate allocated for each node will not be on
average R/M bps
 This causes low channel utilization
Random Access – Carrier Sense Multiple
Access (CSMA)
• To improve performance, avoid transmissions that are certain to
cause collisions
• Based on the fact that in LAN propagation time is very small
•  If a frame was sent by a station, All stations knows
immediately so they can wait before start sending
•  A station with frames to be sent, should sense the
medium for the presence of another transmission (carrier)
before it starts its own transmission
• This can reduce the possibility of collision but it cannot eliminate it.
• Collision can only happen when more than one station begin
transmitting within a short time (the propagation time period)
Space/time model of the collision in CSMA

CSMA – each station first listen to the medium before sending


Principle : “sense before transmit” or “listen before talk”
Random Access – Carrier Sense Multiple Access (CSMA)

 Vulnerable time for CSMA is the maximum propagation


time
 The longer the propagation delay, the worse the performance
of the protocol because of the above case.
Types of CSMA Protocols

Different CSMA protocols that determine:


 What a station should do when the medium is
idle?
 What a station should do when the medium is
busy?

1. Non-Persistent CSMA
2. 1-Persistent CSMA
3. p-Persistent CSMA
Nonpersistent CSMA
 A station with frames to be sent, should sense the medium
1. If medium is idle, transmit; otherwise, go to 2
2. If medium is busy, (backoff) wait a random amount of time and
repeat 1
 Non-persistent Stations are deferential (respect others)
 Performance:
 Random delays reduces probability of collisions because two stations
with data to be transmitted will wait for different amount of times.
 Bandwidth is wasted if waiting time (backoff) is large because
medium will remain idle following end of transmission even if one or
more stations have frames to send

Random Waiting
times

Wasted time
1-persistent CSMA
 To avoid idle channel time, 1-persistent protocol used
 Station wishing to transmit listens to the medium:
1. If medium idle, transmit immediately;
2. If medium busy, continuously listen until medium becomes idle; then
transmit immediately with probability 1
 Performance
 1-persistent stations are selfish
 If two or more stations becomes ready at the same time, collision
guaranteed
P-persistent CSMA
 Time is divided to slots where each Time unit (slot) typically equals
maximum propagation delay
 Station wishing to transmit listens to the medium:
1. If medium idle,
 transmit with probability (p), OR
 wait one time unit (slot) with probability (1 – p), then repeat 1.
2. If medium busy, continuously listen until idle and repeat step 1
3. Performance
 Reduces the possibility of collisions like nonpersistent
 Reduces channel idle time like 1-persistent
Flow diagram for three persistence methods
Persistent and Nonpersistent CSMA

Comparison of the channel utilization versus load for various random


access protocols.
CSMA/CD (Collision Detection)
 CSMA (all previous methods) has an inefficiency:
 If a collision has occurred, the channel is unstable until

colliding packets have been fully transmitted


 CSMA/CD (Carrier Sense Multiple Access with Collision

Detection) overcomes this as follows:


 While transmitting, the sender is listening to medium for
collisions.
 Sender stops transmission if collision has occurred
reducing channel wastage .
CSMA/CD is Widely used for bus topology LANs (IEEE 802.3,
Ethernet).
of its own
signal, it means collision occurred
CSMA/CD Protocol
• Use one of the CSMA persistence algorithm
(non-persistent, 1-persistent, p-persistent) for transmission.

• If a collision is detected by a station during its transmission then


it should do the following:

i. Abort transmission and


ii. Transmit a jam signal (48 bit) to notify other stations of collision so that
they will discard the transmitted frame also to make sure that the collision
signal will stay until detected by the furthest station
iii. After sending the jam signal,
backoff (wait) for a random amount of time, then transmit the frame
again
CSMA/CD
• Question: How long does it take to detect a collision?
• Answer: In the worst case, twice the maximum propagation delay of
the medium
Note: a = maximum propagation delay
Minimum Frame Size
• For CSMA/CD to work, we need a restriction on the frame size.
Before sending the last bit of the frame, the sending station must
detect a collision, if any, and abort the transmission.
• This is so because the station, once the entire frame is sent, does
not keep a copy of the frame and does not monitor the line for
collision detection.
• In the worst case scenario, If the two stations involved in a
collision are the maximum distance apart, the signal from the
first takes time Tp to reach the second, and the effect of the
collision takes another time Tp to reach the first
• Therefore, the frame transmission time Tfr must be at least two
times the maximum propagation time Tp
Tfr = 2 X Tp
CSMA/CD

Restrictions of CSMA / CD:


Packet transmission time should be at least as
long as the time needed to detect a collision (2 *
maximum propagation delay + jam sequence
transmission time)
Otherwise, CSMA/CD does not have an
advantage over CSMA
Exponential Backoff Algorithm
• Ethernet uses the exponential backoff algorithms to determine the
best duration of the random waiting period after the collision
happens
• Algorithm:
 Set “slot time” equal to 2*maximum propagation delay + Jam
sequence transmission time (= 51.2 usec for Ethernet 10-Mbps LAN)
 After Kth collision, select a random number (R) between 0 and
2k –1 and wait for a period equal to (R*slot time) then retransmit
when the medium is idle, for example:
 After first collision (K=1), select a number (R) between 0 and 21 –1 {0
,1} and wait for a period equal to R*slot times (Wait for a period 0 usec
or 1x51.2 usec) then retransmit when the medium is idle
 Do not increase random number range, if K=10
  Maximum interval {0 – 1023}
 Give up after 16 unsuccessful attempts and report failure to higher
layers
Figure 12.14 Flow diagram for the CSMA/CD

N=0

Wait R*slot time

Choose R between
0 & 2k - 1

K=10 K=N

Yes
No

No
N < 10 N==16
N=N+1

Yes

Abort
Exponential Backoff Algorithm

• Reduces the chance of two waiting stations picking the same


random waiting time
• When network traffic is light, it results in minimum waiting
time before transmission
• As congestion increases ( traffic is high), collisions increase,
stations backoff by larger amounts to reduce the
probability of collision.
• Exponential Back off algorithm gives last-in, first-out
effect
• Stations with no or few collisions will have the chance to transmit
before stations that have waited longer because of their previous
unsuccessful transmission attempts.
Performance of Random Access Protocols
•Simple and easy to implement
•Decentralized (no central device that can fail and bring down the
entire system)
•In low-traffic, packet transfer has low-delay
•However, limited throughput and in heavier traffic, packet delay has
no limit.
•In some cases, a station may never have a chance to transfer its
packet. (unfair protocol)
•A node that has frames to be transmitted can transmit continuously
at the full rate of channel (R) if it is the only node with frames
•If (M) nodes want to transmit, many collisions can occur and the rate
for each node will not be on average R/M
Example
A network using CSMA/CD has a bandwidth of 10 Mbps. If the
maximum propagation time (including the delays in the
devices and ignoring the time needed to send a jamming
signal, as we see later) is 25.6 μs, what is the minimum size
of the frame?

Solution
The frame transmission time is Tfr = 2 × Tp = 51.2 μs. This
means, in the worst case, a station needs to transmit for a
period of 51.2 μs to detect the collision. The minimum size of
the frame is 10 Mbps × 51.2 μs = 512 bits or 64 bytes. This is
actually the minimum size of the frame for Standard Ethernet.
Problem
• In a CSMA/CD network with a data rate of 10 Mbps,
the minimum frame size is found to be 512 bits for the
correct operation of the collision detection process.
What should be the minimum frame size if we increase
the data rate to 100 Mbps? To 1 Gbps? To 10 Gbps?
Solution
• Let us find the relationship between the minimum frame size and the data rate. We
• know that
Tfr = (frame size) / (data rate) = 2 × Tp = 2 × distance / (propagation speed)
or
(frame size) = [2 × (distance) / (propagation speed)] × (data rate)]
or
(frame size) = K × (data rate)
This means that minimum frame size is proportional to the data rate (K is a constant).
• When the data rate is increased, the frame size must be increased in a network with a
fixed length to continue the proper operation of the CSMA/CD.
• We calculate the minimum frame size based on the above proportionality relationship
• Data rate = 10 Mbps → minimum frame size = 512 bits
• Data rate = 100 Mbps → minimum frame size = 5120 bits
• Data rate = 1 Gbps → minimum frame size = 51,200 bits
• Data rate = 10 Gbps → minimum frame size = 512,000 bits
Collision of the first bit in CSMA/CD

In the above figure, the data rate is 10 Mbps, the distance between station A and C
is 2000 m, and the propagation speed is 2 x 10^8 m/s. Station A starts sending a
long frame at time t1 =0; station C starts sending a long frame at time t2 =3μs. The
size of the frame is long enough to guarantee the detection of collision by both
stations. Find:
a. The time when station C hears the collision (t3)'
b. The time when station A hears the collision (t4)'
c. The number of bits station A has sent before detecting the collision.
d. The number of bits station C has sent before detecting the collision.
Collision of the first bit in CSMA/CD

We have t1 = 0 and t2 = 3 μs
a. t3 − t1= (2000 m) / (2 × 10^8 m/s) =10 μs → t3 = 10 μs + t1 = 10 μs
b. t4 − t2 = (2000 m) / (2 × 10^8 m/s) =10 μs → t4 = 10 μs + t2 = 13 μs
c. Tfr(A) = t4 − t1 = 13 − 0 = 13 μs → BitsA = 10 Mbps × 13 μs = 130
bits
d. Tfr(C) = t3 − t2 = 10 − 3 = 07μs → BitsC = 10 Mbps × 07 μs = 70
bits.
13.2 Controlled Access or Scheduling (reservation
and Polling only for reference)

• Provides in order access to shared medium so that every


station has chance to transfer (fair protocol)

• Eliminates collision completely


• Three methods for controlled access:
• Reservation
• Polling
• Token Passing
1-Reservation access method
 Stations take turns transmitting a single frame at a
full rate ( R ) bps
 Transmissions are organized into variable length cycles
 Each cycle begins with a reservation interval that consists of
(N) minislots. One minislot for each of the N stations
When a station needs to send a data frame, it makes a
reservation in its own minislot.
By listening to the reservation interval, every station knows
which stations will transfer frames, and in which order.
The stations that made reservations can send their data
frames after the reservation frame.
2- Polling

Stations take turns accessing the medium


Two models: Centralized and distributed polling
Centralized polling
 One device is assigned as primary station and the others as secondary
stations
 All data exchanges are done through the primary
 When the primary has a frame to send it sends a select frame that includes
the address of the intended secondary
 When the primary is ready to receive data it send a Poll frame for each
device to ask if it has data to send or not. If yes, data will be transmitted
otherwise NAK is sent.
 Polling can be done in order (Round-Robin) or based on predetermined order
Distributed polling
 No primary and secondary
 Stations have a known polling order list which is made based on some
protocol
• station with the highest priority will have the access right first, then it passes
the access right to the next station (it will send a pulling message to the next
station in the pulling list), which will passes the access right to the following
next station, …
Figure 12.19 Select and poll functions in polling access method

Primary is sending to
Secondary Secondary is sending
to Primary
3- Token-Passing network
Implements Distributed
Polling System

bits are copied to the output bits with a one


bit delay Bits are inserted by the station

listen mode transmit mode


input 1 bit delay output
from to delay
ring ring
to station from station to station from station
Station Interface is in two states:
Listen state: Listen to the arriving bits and check the destination address to
see if it is its own address. If yes the frame is copied to the station otherwise
it is passed through the output port to the next station.
Transmit state: station captures a special frame called free token and
transmits its frames. Sending station is responsible for reinserting the free
token into the ring medium and for removing the transmitted frame from the
medium.
Figure 13.13 Token-passing procedure
TOKEN PASSING
• In the token-passing method, the stations in a network are organized in a
logical ring.
• In other words, for each station, there is a predecessor and a successor.
• The predecessor is the station which is logically before the station in the
ring; the successor is the station which is after the station in the ring.
• The current station is the one that is accessing the channel now.
• The right to this access has been passed from the predecessor to the
current station.
• The right will be passed to the successor when the current station has no
more data to send.
• In this method, a special packet called a token circulates through the ring.
• The possession of the token gives the station the right to access the channel and
send its data.
• When a station has some data to send, it waits until it receives the token from its
predecessor.
• It then holds the token and sends its data.
• When the station has no more data to send, it releases the token, passing it to the
next logical station in the ring.
• The station cannot send data until it receives the token again in the next round.
• In this process, when a station receives the token and has no data to send, it just
passes the token to the next station
• Token management is needed for this access method.
• Stations must be limited in the time they can have possession of the token. The
token must be monitored to ensure it has not been lost or destroyed.
• And finally, token management is needed to make low-priority stations release
the token to high priority stations.
Figure Logical ring and physical topology in token-passing access method
• In the physical ring topology, when a station sends the token to its
successor, the token cannot be seen by other stations; the successor is the
next one in line. This means that the token does not have to have the
address of the next successor.
• The problem with this topology is that if one of the links-the medium
between two adjacent stations fails, the whole system fails.
• The dual ring topology uses a second (auxiliary) ring which operates in
the reverse direction compared with the main ring.
• The second ring is for emergencies only. If one of the links in the main
ring fails, the system automatically combines the two rings to form a
temporary ring.
• After the failed link is restored, the auxiliary ring becomes idle again.
• Note that for this topology to work, each station needs to have two
transmitter ports and two receiver ports.
• In the bus ring topology, also called a token bus, the stations are
connected to a single cable called a bus.
• They, however, make a logical ring, because each station knows the
address of its successor (and also predecessor for token management
purposes).
• When a station has finished sending its data, it releases the token and
inserts the address of its successor in the token.
• Only the station with the address matching the destination address of the
token gets the token to access the shared media
• In a star ring topology, the physical topology is a star.
• There is a hub, however, that acts as the connector. The wiring inside the
hub makes the ring; the stations are connected to this ring through the
two wire connections.
• This topology makes the network less prone to failure because if a link
goes down, it will be bypassed by the hub and the rest of the stations can
operate. Also adding and removing stations from the ring is easier.
Syllabus

• Alberto Leon Garcia – “ Communuication Networks” – 6.1


• Chapter 12 of “Data Communications and Networking” by Forouzan.
OSI Model

OSI MODEL
OSI Model

Communication Architecture
Strategy for connecting host computers and other
communicating equipment.
Defines necessary elements for data communication
between devices.
A communication architecture, therefore, defines a
standard for the communicating hosts.
A programmer formats data in a manner defined by the
communication architecture and passes it on to the
communication software.
Separating communication functions adds flexibility, for
example, we do not need to modify the entire host software
to include more communication devices.
OSI Model

Layer Architecture
Layer architecture simplifies the network design.
It is easy to debug network applications in a layered
architecture network.
The network management is easier due to the layered
architecture.
Network layers follow a set of rules, called protocol.
The protocol defines the format of the data being
exchanged, and the control and timing for the handshake
between layers.
OSI Model

Open Systems Interconnection (OSI) Model

International standard organization (ISO) established a


committee in 1977 to develop an architecture for computer
communication.
Open Systems Interconnection (OSI) reference model is the
result of this effort.
In 1984, the Open Systems Interconnection (OSI) reference
model was approved as an international standard for
communications architecture.
Term “open” denotes the ability to connect any two
systems which conform to the reference model and
associated standards.
OSI Model

OSI Reference Model


The OSI model is now considered the primary Architectural
model for inter-computer communications.
The OSI model describes how information or data makes its
way from application programmes (such as spreadsheets)
through a network medium (such as wire) to another
application programme located on another network.
The OSI reference model divides the problem of moving
information between computers over a network medium
into SEVEN smaller and more manageable problems .
This separation into smaller more manageable functions is
known as layering.
OSI Model

OSI Reference Model: 7 Layers


OSI Model

OSI: A Layered Network Model


The process of breaking up the functions or tasks of networking
into layers reduces complexity.
Each layer provides a service to the layer above it in the protocol
specification.
Each layer communicates with the same layer’s software or
hardware on other computers.
The lower 4 layers (transport, network, data link and physical —
Layers 4, 3, 2, and 1) are concerned with the flow of data from end
to end through the network.
The upper four layers of the OSI model (application, presentation
and session—Layers 7, 6 and 5) are orientated more toward
services to the applications.
Data is Encapsulated with the necessary protocol information as it
moves down the layers before network transit.
The interaction between layers in the OSI model

2.8
Figure 2.4 An exchange using the OSI model

2.9
OSI Model

Physical Layer
Provides physical interface for transmission of information.
Defines rules by which bits are passed from one system to
another on a physical communication medium.
Covers all - mechanical, electrical, functional and procedural
- aspects for physical communication.
Such characteristics as voltage levels, timing of voltage
changes, physical data rates, maximum transmission
distances, physical connectors, and other similar attributes
are defined by physical layer specifications.
Figure 2.5 Physical layer

2.11
Note

The physical layer is responsible for movements of


individual bits from one hop (node) to the next.

2.12
OSI Model

Data Link Layer


Data link layer attempts to provide reliable communication
over the physical layer interface.

Breaks the outgoing data into frames and reassemble the


received frames.
Create and detect frame boundaries.
Handle errors by implementing an acknowledgement and
retransmission scheme.(error control)
Implement flow control.
Supports points-to-point as well as broadcast
communication.
Supports simplex, half-duplex or full-duplex communication.
Figure 2.6 Data link layer

2.14
Figure 2.7 Hop-to-hop delivery

2.15
Note

The data link layer is responsible for moving


frames from one hop (node) to the next.

2.16
OSI Model

Network Layer
Implements routing of frames (packets) through the
network.

Defines the most optimum path the packet should take from
the source to the destination
Defines logical addressing so that any endpoint can be
identified.
Handles congestion in the network.
Facilitates interconnection between heterogeneous
networks (Internetworking).
The network layer also defines how to fragment a packet
into smaller packets to accommodate different media.
Figure 2.8 Network layer

2.18
Figure 2.9 Source-to-destination delivery

2.19
OSI Model

Transport Layer
Purpose of this layer is to provide a reliable mechanism for
the exchange of data between two processes in different
computers.

Ensures that the data units are delivered error free.


Ensures that data units are delivered in sequence.
Ensures that there is no loss or duplication of data units.
Provides connectionless or connection oriented service.
Provides for the connection management.
Multiplex multiple connection over a single channel.
Figure 2.10 Transport layer

2.21
Figure 2.11 Reliable process-to-process delivery of a message

2.22
OSI Model

Session Layer
Session layer provides mechanism for controlling the dialogue
between the two end systems. It defines how to start, control and
end conversations (called sessions) between applications.

This layer requests for a logical connection to be established on


an end-user’s request.
Any necessary log-on or password validation is also handled by
this layer.
Session layer is also responsible for terminating the connection.
This layer provides services like dialogue discipline which can be
full duplex or half duplex.
Session layer can also provide check-pointing mechanism such
that if a failure of some sort occurs between checkpoints, all data
can be retransmitted from the last checkpoint.
Figure 2.12 Session layer

2.24
OSI Model

Presentation Layer
Presentation layer defines the format in which the data is to
be exchanged between the two communicating entities.
Also handles data compression and data encryption
(cryptography).
Figure 2.13 Presentation layer

2.26
OSI Model

Application Layer
Application layer interacts with application programs and is
the highest level of OSI model.
Application layer contains management functions to
support distributed applications.
Examples of application layer are applications such as file
transfer, electronic mail, remote login etc.
Figure 2.14 Application layer

2.28
OSI Model

OSI in Action
A message begins at the top application
layer and moves down the OSI layers to
the bottom physical layer.
As the message descends, each
successive OSI model layer adds a
header to it.
A header is layer-specific information
that basically explains what functions
the layer carried out.
Conversely, at the receiving end,
headers are striped from the message
as it travels up the corresponding
layers.
TCP/IP Model

TCP/IP MODEL
TCP/IP Model

OSI & TCP/IP Models


TCP/IP Model

TCP/IP Model
Application Layer
Application programs using the network
Transport Layer (TCP/UDP)
Management of end-to-end message transmission,
error detection and error correction
Network Layer (IP)
Handling of datagrams : routing and congestion
Data Link Layer
Management of cost effective and reliable data delivery,
access to physical networks
Physical Layer
Physical Media
TCP/IP PROTOCOL SUIT
• TCP/IP, or the Transmission Control Protocol/Internet
Protocol, is a suite of communication protocols used to
interconnect network devices on the internet.
• TCP/IP can also be used as a communications protocol in a
private network (an intranet or an extranet)
• TCP/IP specifies how data is exchanged over the internet by
providing end-to-end communications that identify how it
should be broken into packets, addressed, transmitted,
routed and received at the destination.
• TCP/IP requires little central management, and it is designed
to make networks reliable, with the ability to recover
automatically from the failure of any device on the network.
TCP IP
• TCP defines how • IP defines how to
applications can create address and route each
channels of
communication across a packet to make sure it
network. reaches the right
• It also manages how a destination.
message is assembled into • Each gateway computer
smaller packets before on the network checks
they are then transmitted
over the internet and this IP address to
reassembled in the right determine where to
order at the destination forward the message.
address.
TCP/IP (Transmission Control
Protocol/Internet Protocol)
Types of addressing:

You might also like