0% found this document useful (0 votes)
92 views844 pages

DCC FULL Data Communications Cusat

This document provides an overview of data communication and networking concepts. It discusses topics such as telecommunication, data communication systems, networks, network criteria, physical structures of networks, network types (LANs, WANs, internetworks), switching (circuit-switched and packet-switched), the Internet, protocols, Internet standards, addressing in TCP/IP, analog and digital signals, and periodic analog signals. The document appears to be lecture notes or textbook material introducing fundamental concepts in data communication and computer networking.

Uploaded by

Gemeny Ganeshan
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)
92 views844 pages

DCC FULL Data Communications Cusat

This document provides an overview of data communication and networking concepts. It discusses topics such as telecommunication, data communication systems, networks, network criteria, physical structures of networks, network types (LANs, WANs, internetworks), switching (circuit-switched and packet-switched), the Internet, protocols, Internet standards, addressing in TCP/IP, analog and digital signals, and periodic analog signals. The document appears to be lecture notes or textbook material introducing fundamental concepts in data communication and computer networking.

Uploaded by

Gemeny Ganeshan
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/ 844

19-202-0306

DATA AND COMPUTER


COMMUNICATION
Reference Textbooks

1) Behrouz A. Forouzan, Data


Communication and Networking, 4th
Edition, McGraw Hill, 2006.
2) Behrouz A. Forouzan, Data
Communication and Networking, 5th
Edition, McGraw Hill, 2012
Chapter 1
Introduction
DATA
COMMUNICATIONS

•The term telecommunication means communication at


a distance.
•The word data refers to information presented in
whatever form is agreed upon by the parties creating
and using the data.
•Data communications are the exchange of data
between two devices via some form of transmission
medium such as a wire cable.
•Factors affecting effectiveness of data communication
system : delivery, accuracy, timeliness, jitter
Components of a data communication system
Data flow (simplex, half-duplex, and full-duplex)
NETWORKS

A network is a set of devices (often referred to as nodes)


connected by communication links. A node can be a
computer, printer, or any other device capable of sending
and/or receiving data generated by other nodes on the
network. A link can be a cable, air, optical fiber, or any
medium which can transport a signal carrying
information.
Network Criteria

■ Performance
■ Depends on Network Elements
■ Measured in terms of Delay and Throughput
■ Reliability
■ Failure rate of network components
■ Measured in terms of availability/robustness
■ Security
■ Data protection against corruption/loss of data due to:
■ Errors
■ Malicious users
Physical Structures

■ Type of Connection
■ Point to Point - single transmitter and receiver
■ Multipoint - multiple recipients of single transmission
■ Physical Topology
■ Connection of devices
Types of connections: point-to-point and multipoint
Categories of topology
A fully connected mesh topology (five devices)
A star topology connecting four stations
A bus topology connecting three stations
A ring topology connecting six stations
A hybrid topology: a star backbone with three bus networks
Network Types

■ Local Area Networks (LANs)


■ Short distances
■ Designed to provide local interconnectivity
■ Wide Area Networks (WANs)
■ Long distances
■ Provide connectivity over large areas
■ Internetworks
■ Two or more networks connected
An isolated LAN in the past and today
WANs: a point-to-point WAN and a switched
WAN
An internetwork made of two LANs and one point-to-point WAN
Switching

• a switch connects at least two links together


• two types :circuit-switched and packet-switched
• In a circuit-switched network, a dedicated connection,
called a circuit, is always available between the two end
systems; the switch can only make it active or inactive.
• In a packet-switched network, the communication
between the two ends is done in blocks of data called
packets
Circuit Switched Network
Packet Switched Network
THE INTERNET

The Internet has revolutionized many aspects of our daily


lives. It has affected the way we do business as well as the
way we spend our leisure time. The Internet is a
communication system that has brought a wealth of
information to our fingertips and organized it for our use.
The Internet today
PROTOCOLS

A protocol is synonymous with rule. It consists of a set of


rules that govern data communications. It determines
what is communicated, how it is communicated and when
it is communicated. The key elements of a protocol are
syntax, semantics and timing
Elements of a Protocol

■ Syntax
■ Structure or format of the data
■ Indicates how to read the bits - field delineation
■ Semantics
■ Interprets the meaning of the bits
■ Knows which fields define what action
■ Timing
■ When data should be sent and what
■ Speed at which data should be sent or speed at which it is being
received.
Internet Standards
■ Thoroughly tested specification that is useful to and
adhered to by those who work with the Internet
Internet Administration
Chapter 2
Network Models
LAYERED
TASKS
We use the concept of layers in our daily life. As an
example, let us consider two friends who communicate
through postal mail. The process of sending a letter to a
friend would be complex if there were no services
available from the post office.
Tasks involved in sending a letter
THE OSI MODEL
Established in 1947, the International Standards
Organization (ISO) is a multinational body dedicated to
worldwide agreement on international standards. An ISO
standard that covers all aspects of network
communications is the Open Systems Interconnection
(OSI) model. It was first introduced in the late 1970s.
Note

ISO is the organization.


OSI is the model.
Seven layers of the OSI model
An exchange using the OSI model
LAYERS IN THE OSI MODEL

In this section we briefly describe the functions of each


layer in the OSI model.
Physical layer
Note

The physical layer is responsible for movements of


individual bits from one hop (node) to the next.
Physical layer- other functionalities

• Defines physical characteristics of interface and


medium
• Defines type of encoding
• Defines the duration of a bit
• Defines the direction of transmission
• Concerned with the synchronization of sender and
receiver at the bit level.
Data link layer
Note

The data link layer is responsible for moving


frames from one hop (node) to the next.
Data link layer-other functionalities

• Framing
• Flow control
• Error control
• Access control
• Physical addressing
Hop-to-hop delivery
Network layer
Note

The network layer is responsible for the


delivery of individual packets from
the source host to the destination host.
Network layer-other functionalities

• Logical Addressing
• Routing
Source-to-destination delivery
Transport layer
Note

The transport layer is responsible for the delivery


of a message from one process to another.
Reliable process-to-process delivery of a message
Transport layer-other functionalities

• Service point addressing


• Segmentation and reassembly
• Connection control
Session layer
Note

The session layer is responsible for dialog


control and synchronization.
Presentation layer
Note

The presentation layer is responsible for translation,


compression, and encryption.
Application layer
Note

The application layer is responsible for


providing services to the user.
Summary of layers
Data Format in different layers

Physical layer- bits


Data link layer- frames
Network layer-packets
Transport layer-segments
Higher layers- message
Devices in different layers
TCP/IP PROTOCOL SUITE

The layers in the TCP/IP protocol suite do not exactly


match those in the OSI model. The original TCP/IP
protocol suite was defined as having four layers:
host-to-network, internet, transport, and application.
However, when TCP/IP is compared to OSI, we can say
that the TCP/IP protocol suite is made of five layers:
physical, data link, network, transport, and application.
TCP/IP and OSI model
TCP/IP vs OSI model
ADDRESSING

Four levels of addresses are used in an internet employing


the TCP/IP protocols: physical, logical, port, and specific.
Addresses in TCP/IP
Relationship of layers and addresses in TCP/IP
Physical Address

• Address of a node
• Included in the frame used by data link layer
• Lowest level address
Physical addresses
Physical Address

Physical addresses are 48-bit (6-byte) written as 12


hexadecimal digits; every byte (2 hexadecimal digits) is
separated by a colon, as shown below:

07:01:02:01:2C:4B
A 6-byte (12 hexadecimal digits) physical address.
Logical Address

• Universal addressing system in which each host can


be uniquely identified , regardless of underlying
physical network
• 32-bit address that can uniquely define a host
connected to the Internet
Logical addresses
Note

The physical addresses will change from hop to hop,


but the logical addresses usually remain the same.
Port Address

• For processes to receive data simultaneously, we


need to label the different processes
• The label assigned to a process is called port
address
• Port address is 16 bits in length
Figure 2.21 Port addresses
Port Address

A port address is a 16-bit address represented by one


decimal number as shown below

753
A 16-bit port address represented
as one single number.
Specific Address

Some applications have user-friendly addresses that are


designed for that specific application .
Eg:- e-mail address , URL
Chapter 3
Data and Signals

.
Note

To be transmitted, data must be


transformed to electromagnetic signals.
ANALOG AND DIGITAL

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.
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.
Comparison of analog and digital signals
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.
A sine wave

Sine wave is represented by 3 parameters: peak amplitude, frequency and


phase.
Two signals with the same phase and frequency, but different amplitudes
Note

Frequency and period are the inverse of


each other.
Two signals with the same amplitude and phase, but different frequencies
Units of period and frequency
Example

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


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

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).
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.
Note

If a signal does not change at all, its


frequency is zero.
If a signal changes instantaneously, its
frequency is infinite.
Note

Phase describes the position of the


waveform relative to time 0.
Three sine waves with the same amplitude and frequency, but different phases
Example

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
Wavelength and period

Wavelength=propagation speed * period


The time-domain and frequency-domain plots of a sine wave
Note

A complete sine wave in the time


domain can be represented by one
single spike in the frequency domain.
Example

The frequency domain is more compact and


useful when we are dealing with more than one
sine wave. For example, the figure in the
following slide shows three sine waves, each
with different amplitude and frequency. All can
be represented by three spikes in the frequency
domain.
The time domain and frequency domain of three sine waves
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.
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.
Example-A composite periodic signal
Decomposition of a composite periodic signal in the time and frequency
domains
The time and frequency domains of a nonperiodic signal
Bandwidth and Signal
Frequency
■ The bandwidth of a composite signal is
the difference between the highest and the
lowest frequencies contained in that
signal.
The bandwidth of periodic and nonperiodic composite signals
Example

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.
The bandwidth for Example
Example

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
The bandwidth for Example
Example

A nonperiodic composite signal has a bandwidth of 200


kHz, with a middle frequency of 140 kHz and peak
amplitude of 20 V. The two extreme frequencies have an
amplitude of 0. Draw the frequency domain of the
signal.

Solution
The lowest frequency must be at 40 kHz and the highest
at 240 kHz. Figure shows the frequency domain and the
bandwidth.
The bandwidth for Example
Real Life examples of non periodic composite signal

• The signal propagated by an AM radio station.


• The signal propagated by an FM radio station.
• The signal received by an old-fashioned analog
black-and-white TV.
DIGITAL
SIGNALS
In addition to being represented by an analog signal,
information can also be represented by a digital signal.
For example, a 1 can be encoded as a positive voltage
and a 0 as zero voltage. A digital signal can have more
than two levels. In this case, we can send more than 1 bit
for each level.
Two digital signals: one with two signal levels and the
other with four signal levels
Example

A digital signal has eight levels. How many bits are


needed per level?
We calculate the number of bits from the formula

Each signal level is represented by 3 bits.


Example

A digital signal has nine levels. How many bits are


needed per level?
We calculate the number of bits by using the formula.
Each signal level is represented by 3.17 bits. However,
this answer is not realistic. The number of bits sent per
level needs to be an integer .For this example, 4 bits can
represent one level.
Example

Assume we need to download text documents at the rate


of 100 pages per sec. A page is an average of 24 lines
with 80 characters in each line. Assume that one
character requires 8 bits . What is the required bit rate of
the channel?
Solution
The bit rate is
Example

A digitized voice channel, is made by digitizing a 4-kHz


bandwidth analog voice signal. We need to sample the
signal at twice the highest frequency (two samples per
hertz). We assume that each sample requires 8 bits.
What is the required bit rate?
Solution
The bit rate can be calculated as
Digital Signal as a Composite Analog Signal

• Based on Fourier analysis, a digital signal is a composite


analog signal
• If digital signal is periodic, the decomposed signal has a
frequency domain representation with infinite bandwidth
and discrete frequencies
• If digital signal is non- periodic, the decomposed signal has
a frequency domain representation with infinite
bandwidth and continuous frequencies
The time and frequency domains of periodic and nonperiodic digital signals
Note

A digital signal is a composite analog


signal with an infinite bandwidth.
Digital Signal Transmission-Baseband transmission

Baseband transmission means sending digital signal


over a channel without changing the digital signal to
analog signal.

Baseband transmission requires a low-pass channel, a


channel with a bandwidth that starts from zero
Bandwidths of two low-pass channels
Case 1:Low pass channel with wide bandwidth
Example

• An example of a dedicated channel where the entire


bandwidth of the medium is used as one single
channel is a LAN.
• In a bus topology LAN with multipoint connections,
only two stations can communicate with each other at
each moment in time (timesharing); the other stations
need to refrain from sending data.
• In a star topology LAN, the entire channel between
each station and the hub is used for communication
between these two entities.
Note

Baseband transmission of a digital


signal that preserves the shape of the
digital signal is possible only if we have
a low-pass channel with an infinite or
very wide bandwidth.
Case 2: Low Pass Channel with Limited Bandwidth

• Approximate the digital signal with an analog signal


• Level of approximation depends on the bandwidth available
• 3 levels of approximation
• Rough approximation is achieved using first harmonic
frequency
• B= N/2, where B is the bandwidth and N is the bit rate
• Better approximation is achieved using first and third
harmonic frequency
• Third harmonic, B= 3N/2

Case 2: Low Pass Channel with Limited Bandwidth
Note

InInbaseband
baseband transmission, the required bandwidth is
transmission, the required
bandwidth proportional to the bit rate;
is proportional to the bit rate;
ifif we
weneed to send bits faster, we need more bandwidth.
need to send bits faster, we need
more bandwidth.
Bandwidth requirements
Example

What is the required bandwidth of a low-pass channel if


we need to send 1 Mbps by using baseband transmission?
Solution
The answer depends on the accuracy desired.
a. The minimum bandwidth, is B = bit rate /2, or 500 kHz.

b. A better solution is to use the first and the third


harmonics with B = 3 × 500 kHz = 1.5 MHz.
c. Still a better solution is to use the first, third, and fifth
harmonics with B = 5 × 500 kHz = 2.5 MHz.
Example

We have a low-pass channel with bandwidth 100 kHz.


What is the maximum bit rate of this channel?
Solution
The maximum bit rate can be achieved if we use the first
harmonic. The bit rate is 2 times the available bandwidth,
or 200 kbps.
Digital Signal Transmission-Broadband transmission

• Broadband transmission or modulation means changing the


digital signal to analog signal for transmission
• Uses bandpass channel- a channel with a bandwidth that
does not start from zero
Note

If the available channel is a bandpass


channel, we cannot send the digital
signal directly to the channel;
we need to convert the digital signal to
an analog signal before transmission.
Modulation of a digital signal for transmission on a bandpass channel
Example

An example is sending of computer data through a


telephone subscriber line, the line connecting a resident
to the central telephone office. These lines are designed
to carry voice with a limited bandwidth. The channel is
considered a bandpass channel. We convert the digital
signal from the computer to an analog signal, and send
the analog signal. We can install two converters to
change the digital signal to analog and vice versa at the
receiving end. The converter, in this case, is called a
modem
Example

A second example is the digital cellular telephone .


Although the bandwidth allocated to a company
providing digital cellular phone service is very wide, we
still cannot send the digital signal without conversion.
The reason is that we only have a bandpass channel
available between caller and callee. We need to convert
the digitized voice to a composite analog signal before
sending.
TRANSMISSION IMPAIRMENT

Signals travel through transmission media, which are not


perfect. The imperfection causes signal impairment. This
means that the signal at the beginning of the medium is
not the same as the signal at the end of the medium.
What is sent is not what is received. Three causes of
impairment are attenuation, distortion, and noise.
Causes of impairment
Attenuation

■ Means loss of energy -> weaker signal


■ When a signal travels through a medium it
loses energy overcoming the resistance of
the medium
■ Amplifiers are used to compensate for this
loss of energy by amplifying the signal.
Attenuation
Measurement of Attenuation

■ To show the loss or gain of energy the unit


“decibel” is used.

dB = 10log10P2/P1
P1 - input signal
P2 - output signal
Example

Suppose a signal travels through a transmission medium


and its power is reduced to one-half. This means that P2
is (1/2)P1. In this case, the attenuation (loss of power)
can be calculated as

A loss of 3 dB (–3 dB) is equivalent to losing one-half


the power.
Example

A signal travels through an amplifier, and its power is


increased 10 times. This means that P2 = 10P1 . In this
case, the amplification (gain of power) can be calculated
as
Example

One reason that engineers use the decibel to measure the


changes in the strength of a signal is that decibel
numbers can be added (or subtracted) when we are
measuring several points (cascading) instead of just two.
In the following figure a signal travels from point 1 to
point 4. In this case, the decibel value can be calculated
as
Decibels for Example
Example

Sometimes the decibel is used to measure signal power


in milliwatts. In this case, it is referred to as dBm and is
calculated as dBm = 10 log10 Pm , where Pm is the power
in milliwatts. Calculate the power of a signal with dBm =
−30.

Solution
We can calculate the power in the signal as
Example

The loss in a cable is usually defined in decibels per


kilometer (dB/km). If the signal at the beginning of a
cable with −0.3 dB/km has a power of 2 mW, what is the
power of the signal at 5 km?
Solution
The loss in the cable in decibels is 5 × (−0.3) = −1.5 dB.
We can calculate the power as
Distortion
■ Means that the signal changes its form or
shape
■ Distortion occurs in composite signals
■ Each frequency component has its own
propagation speed traveling through a
medium.
■ The different components therefore arrive
with different delays at the receiver.
■ That means that the signals have different
phases at the receiver than they did at the
source.
Distortion
Noise
■ There are different types of noise
■ Thermal - random noise of electrons in the
wire creates an extra signal
■ Induced - from motors and appliances,
devices act as transmitter antenna and
medium as receiving antenna.
■ Crosstalk - same as above but between
two wires.
■ Impulse - Spikes that result from power
lines, lightning, etc.
Noise
Signal to Noise Ratio (SNR)
■ To measure the quality of a system the SNR is
often used. It indicates the strength of the signal
with respect to the noise power in the system.
■ It is the ratio between two powers.

■ It is usually given in dB and referred to as SNRdB.


Two cases of SNR: a high SNR and a low SNR
Example

The power of a signal is 10 mW and the power of the


noise is 1 μW; what are the values of SNR and SNRdB ?

Solution
The values of SNR and SNRdB can be calculated as
follows:
Example

The values of SNR and SNRdB for a noiseless channel


are

We can never achieve this ratio in real life; it is an ideal.


DATA RATE
LIMITS
A very important consideration in data communications
is how fast we can send data, in bits per second, over a
channel. Data rate depends on three factors:
1. The bandwidth available
2. The level of the signals we use
3. The quality of the channel (the level of noise)
Capacity of a System
■ The bit rate of a system increases with an increase
in the number of signal levels we use to denote a
symbol.
■ A symbol can consist of a single bit or “n” bits.
■ The number of signal levels = 2n.
■ As the number of levels goes up, the spacing
between level decreases -> increasing the
probability of an error occurring in the presence of
transmission impairments.
■ Increasing the levels of a signal reduces the
reliability of the system
Noiseless channel: Nyquist Bit Rate

■ Nyquist bit rate formula defines the


theoretical maximum bit rate
■ Nyquist theorem states that for a noiseless
channel:
C = 2 B log22n
Where,
C= capacity in bps
B = bandwidth in Hz
Example

Consider a noiseless channel with a bandwidth of 3000


Hz transmitting a signal with two signal levels. The
maximum bit rate can be calculated as
Example

Consider the same noiseless channel transmitting a


signal with four signal levels (for each level, we send 2
bits). The maximum bit rate can be calculated as
Example

We need to send 265 kbps over a noiseless channel with


a bandwidth of 20 kHz. How many signal levels do we
need?
Solution
We can use the Nyquist formula as shown:

Since this result is not a power of 2, we need to either


increase the number of levels or reduce the bit rate. If we
have 128 levels, the bit rate is 280 kbps. If we have 64
levels, the bit rate is 240 kbps.
Noisy Channel: Shannon Capacity
■ Shannon’s theorem gives the theoretical
highest data rate for a noisy channel.
■ The formula defines the characteristic of a
channel.
C = B log2(1 + SNR)
where,
C= capacity in bps
B = bandwidth in Hz

SNR=Signal to Noise Ratio


Example

Consider an extremely noisy channel in which the value


of the signal-to-noise ratio is almost zero. In other
words, the noise is so strong that the signal is faint. For
this channel the capacity C is calculated as

This means that the capacity of this channel is zero


regardless of the bandwidth. In other words, we cannot
receive any data through this channel.
Example

We can calculate the theoretical highest bit rate of a


regular telephone line. A telephone line normally has a
bandwidth of 3000 Hz. The signal-to-noise ratio is
usually 3162. For this channel the capacity is calculated
as
Example

The signal-to-noise ratio is often given in decibels.


Assume that SNRdB = 36 and the channel bandwidth is 2
MHz. The theoretical channel capacity can be calculated
as
Example

We have a channel with a 1-MHz bandwidth. The SNR


for this channel is 63. What are the appropriate bit rate
and signal level?

Solution
First, we use the Shannon formula to find the upper
limit.
Example

The Shannon formula gives us 6 Mbps, the upper limit.


For better performance we choose something lower, 4
Mbps, for example. Then we use the Nyquist formula to
find the number of signal levels.
Note

The Shannon capacity gives us the


upper limit; the Nyquist formula tells us
how many signal levels we need.
PERFORMANCE

One important issue in networking is the performance of


the network—how good is it? In this section, we
introduce terms that we need for future chapters.

Topics discussed in this section:


▪ Bandwidth - capacity of the system
▪ Throughput - no. of bits that can be pushed through
▪ Latency (Delay) - delay incurred by a bit from start to finish
▪ Bandwidth-Delay Product
Bandwidth
Note
In networking, we use the term
bandwidth in two contexts.
▪ The first, bandwidth in hertz, refers to the
range of frequencies in a composite signal
or the range of frequencies that a channel
can pass.
▪ The second, bandwidth in bits per second,
refers to the speed of bit transmission in a
channel or link. Often referred to as
Capacity.
Examples

1. The bandwidth of a subscriber line is 4 kHz for voice


or data. The bandwidth of this line for data
transmission can be up to 56,000 bps using a
sophisticated modem to change the digital signal to
analog.
2. If the telephone company improves the quality of the
line and increases the bandwidth to 8 kHz, we can
send 112,000 bps by using the same technology as
mentioned in Example 1
Throughput

• Amount of data transmitted per specified


time
• measure of how fast we can actually send
data through a network
• at first glance, bandwidth in bits per
second and throughput seem the same ,but
they are different.
• bandwidth is a potential measurement of a
link; the throughput is an actual
measurement of how fast we can send data
Example

A network with bandwidth of 10 Mbps can pass only an


average of 12,000 frames per minute with each frame
carrying an average of 10,000 bits. What is the
throughput of this network?

Solution
We can calculate the throughput as

The throughput is almost one-fifth of the bandwidth in


this case.
Propagation & Transmission delay

■ Propagation speed - speed at which a


bit travels though the medium from
source to destination.
■ Transmission speed - the speed at
which all the bits in a message arrive at
the destination. (difference in arrival
time of first and last bit)
Propagation and Transmission Delay

■ Propagation Delay = Distance/Propagation


speed

■ Transmission Delay = Message size/bandwidth

■ Latency = Propagation delay + Transmission delay +


Queueing time + Processing time
Example

What is the propagation time if the distance between the


two points is 12,000 km? Assume the propagation speed
to be 2.4 × 108 m/s in cable.

Solution
We can calculate the propagation time as
Example

What are the propagation time and the transmission time


for a 2.5-kbyte message (an e-mail) if the bandwidth of
the network is 1 Gbps? Assume that the distance between
the sender and the receiver is 12,000 km and that light
travels at 2.4 × 108 m/s.

Solution
We can calculate the propagation and transmission time
as shown on the next slide:
Example (continued)

Note that in this case, because the message is short and


the bandwidth is high, the dominant factor is the
propagation time, not the transmission time. The
transmission time can be ignored.
Example

What are the propagation time and the transmission time


for a 5-Mbyte message (an image) if the bandwidth of
the network is 1 Mbps? Assume that the distance
between the sender and the receiver is 12,000 km and
that light travels at 2.4 × 108 m/s.

Solution
We can calculate the propagation and transmission
times as shown on the next slide.
Example (continued)

Note that in this case, because the message is very long


and the bandwidth is not very high, the dominant factor
is the transmission time, not the propagation time. The
propagation time can be ignored.
Bandwidth Delay Product- Case 1
Bandwidth Delay Product- Case 2
Note

The bandwidth-delay product defines


the number of bits that can fill the link.
Chapter 4
Digital Transmission
DIGITAL-TO-DIGITAL CONVERSION

In this section, we see how we can represent digital


data by using digital signals. The conversion involves
three techniques: line coding, block coding, and
scrambling. Line coding is always needed; block
coding and scrambling may or may not be needed.
Line Coding

■ Converting a string of 1’s and 0’s


(digital data) into a sequence of signals
that denote the 1’s and 0’s.
■ For example a high voltage level (+V)
could represent a “1” and a low voltage
level (0 or -V) could represent a “0”.
Line coding and decoding
Data Element vs Signal
Element
■ Data element is the smallest entity that can
represent a piece of information (bit)
■ Signal element carries data elements.
■ Data elements are what we need to send,
signal elements are what we can send
■ ‘r’ is the ratio which denotes the number of
data elements carried by each signal element
Signal element versus data element
Relationship between data
rate and signal rate
■ The data rate defines the number of bits sent
per sec - bps. It is often referred to the bit
rate.
■ The signal rate is the number of signal
elements sent in a second and is measured in
bauds. It is also referred to as the modulation
rate.
■ Goal is to increase the data rate whilst
reducing the baud rate.
Data rate and Baud rate

■ The baud or signal rate can be


expressed as:
S = c x N x 1/r bauds
where N is data rate
c is the case factor (worst, best & avg.)
r is the ratio between data element &
signal element
Example

A signal is carrying data in which one data element is


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

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

Note: c = 1/2 for the avg. case as worst case is 1 and


best case is 0
Note

Although the actual bandwidth of a


digital signal is infinite, the effective
bandwidth is finite.
Line encoding characteristics
■ Baseline wandering - a receiver will evaluate
the average power of the received signal
(called the baseline) and use that to determine
the value of the incoming data elements. If the
incoming signal does not vary over a long
period of time, the baseline will drift and thus
cause errors in detection of incoming data
elements.
■ A good line encoding scheme will prevent long
runs of fixed amplitude.
Line encoding characteristics

■ DC components - when the voltage


level remains constant for long periods
of time, there is an increase in the low
frequencies of the signal. Most channels
are bandpass and may not support the
low frequencies.
■ This will require the removal of the dc
component of a transmitted signal.
Line encoding characteristics

■ Self synchronization - the clocks at the


sender and the receiver must have the
same bit interval.
■ If the receiver clock is faster or slower it
will misinterpret the incoming bit
stream.
Effect of lack of synchronization
Example

In a digital transmission, the receiver clock is 0.1 percent


faster than the sender clock. How many extra bits per
second does the receiver receive if the data rate is
1 kbps? How many if the data rate is 1 Mbps?
Solution
At 1 kbps, the receiver receives 1001 bps instead of 1000
bps.

At 1 Mbps, the receiver receives 1,001,000 bps instead of


1,000,000 bps.
Line encoding characteristics

■ Error detection - errors occur during


transmission due to line impairments.
■ Some codes are constructed such that
when an error occurs it can be
detected. For example: a particular
signal transition is not part of the code.
When it occurs, the receiver will know
that a symbol error has occurred.
Line encoding characteristics

■ Immunity to Noise and interference -


there are line encoding techniques that
make the transmitted signal “immune”
to noise and interference.
■ This means that the signal cannot be
corrupted, it is stronger than error
detection.
Line encoding characteristics

■ Complexity - the more robust and


resilient the code, the more complex it
is to implement and the price is often
paid in baud rate or required
bandwidth.
Line coding schemes
Unipolar NRZ scheme
■ All signal levels are on one side of the time axis
- either above or below
■ NRZ - Non Return to Zero scheme is an
example of this code. The signal level does not
return to zero during a symbol transmission
■ Costly
Polar - NRZ

■ The voltages are on both sides of the time


axis.
■ There are two versions:
■ NRZ - Level (NRZ-L) - positive voltage for
one symbol and negative for the other
■ NRZ - Inversion (NRZ-I) - the change or
lack of change in polarity determines the
value of a symbol. E.g. a “1” symbol inverts
the polarity a “0” does not.
Polar NRZ-L and NRZ-I schemes
Note

In NRZ-L the level of the voltage


determines the value of the bit.
In NRZ-I the inversion
or the lack of inversion
determines the value of the bit.
Note

NRZ-L and NRZ-I both have a DC


component problem and baseline
wandering, it is worse for NRZ-L. Both
have no self synchronization &no error
detection. Both are relatively simple to
implement.
Polar - RZ
■ The Return to Zero (RZ) scheme uses three
voltage values. +, 0, -.
■ Each symbol has a transition in the middle.
Either from high to zero or from low to zero.
■ This scheme has more signal transitions (two
per symbol) and therefore requires a wider
bandwidth.
■ No DC components or baseline wandering.
■ Self synchronization - transition indicates
symbol value.
■ More complex as it uses three voltage level. It
has no error detection capability.
Polar RZ scheme
Polar - Biphase: Manchester and
Differential Manchester
■ Manchester coding consists of combining the
NRZ-L and RZ schemes.
■ Duration of each bit is divided into 2 halves.
Voltage remains at one level during first half and
moves to the other level in the second half.
■ Differential Manchester coding consists of
combining the NRZ-I and RZ schemes.
■ Every symbol has a level transition in the middle.
But the level at the beginning of the symbol is
determined by the symbol value. One symbol
causes a level change, the other does not.
Polar biphase: Manchester and differential Manchester schemes
Note

In Manchester and differential


Manchester encoding, the transition
at the middle of the bit is used for
synchronization.
Note

The minimum bandwidth of Manchester


and differential Manchester is 2 times
that of NRZ. The is no DC component
and no baseline wandering. None of
these codes has error detection.
Bipolar - AMI and Pseudoternary
■ Code uses 3 voltage levels: +, 0, -, to
represent the symbols (note not transitions to
zero as in RZ).
■ The voltage level for one data element is at
zero, while the voltage level for the other
element alternates between + ve and – ve .
■ Alternate Mark Inversion (AMI) - the “0”
symbol is represented by zero voltage and
the “1” symbol alternates between +V and
-V.
■ Pseudoternary is the reverse of AMI.
Bipolar schemes: AMI and pseudoternary
Bipolar Characteristics

■ Has no DC component or baseline


wandering.
■ Has synchronization problems when
long runs of “0”s are present.
■ No error detection.
Multilevel Schemes

■ In these schemes we increase the number of


data bits per symbol thereby increasing the
bit rate.
■ In mBnL schemes, a pattern of m data
elements is encoded as a pattern of n signal
elements in which 2m ≤ Ln.
Representing Multilevel Codes

■ We use the notation mBnL, where m is


the length of the binary pattern, B
represents binary data, n represents the
length of the signal pattern and L the
number of levels.
■ L = B for 2 (binary), L = T for 3
(ternary), L = Q for 4 (quaternary).
Multilevel: 2B1Q(2 binary 1 quaternary) scheme
Multilevel: 8B6T scheme
Multilevel using multiple channels
■ In some cases, we split the signal transmission
up and distribute it over several links.
■ The separate segments are transmitted
simultaneously. This reduces the signalling
rate per link -> lower bandwidth.
■ This requires all bits for a code to be stored.
■ Codes are represented as: xD-YYYz
■ xD: means that we use ‘x’ links
■ YYYz: We use ‘z’ levels of modulation where
YYY represents the type of modulation (e.g.
pulse ampl. mod. PAM).
■ Error detection
Multilevel: 4D-PAM5 scheme
Multiline transition Coding-
MLT3
■ Uses three levels (+V, 0, -V) and three
transition rules to move between the levels
1) If the next bit is 0, there is no transition
2) If the next bit is 1 and the current level is
not 0, the next level is 0.
3) If the next bit is 1 and the current level is 0,
the next level is the opposite of the last
nonzero level
Multitransition: MLT-3 scheme
Summary of line coding schemes
Block Coding
■ For a code to be capable of error detection,
we need to add redundancy, i.e., extra bits to
the data bits.
■ Synchronization also requires redundancy -
transitions are important in the signal flow
and must occur frequently.
■ Block coding is done in three steps: division,
substitution and combination.
Note

Block coding is normally referred to as


mB/nB coding;
it replaces each m-bit group with an
n-bit group.
Block coding concept
Using block coding 4B/5B with NRZ-I line coding scheme
4B/5B mapping codes
Substitution in 4B/5B block coding
8B/10B block encoding
More bits - better error detection

■ The 8B/10B block code adds more


redundant bits and can thereby choose code
words that would prevent a long run of a
voltage level that would cause DC
components.
Scrambling
■ The best code is one that does not increase
the bandwidth for synchronization and has no
DC components.
■ Scrambling is a technique used to create a
sequence of bits that has the required
characteristics for transmission - self clocking,
no low frequencies, no wide bandwidth.
■ It is implemented at the same time as
encoding, the bit stream is created on the fly.
B8ZS- Bipolar with 8 zero substitutions

■ 8 consecutive zero-level voltages are replaced


by the sequence 000VB0VB
■ V denotes violation, a nonzero voltage that
breaks an AMI rule of encoding(opposite
polarity from the previous).
■ B denotes bipolar, a nonzero voltage in
accordance with the AMI rule.
AMI used with scrambling
Two cases of B8ZS scrambling technique
HDB3- High Density Bipolar 3-zero

HDB3 substitutes four consecutive


zeros with 000V or B00V depending
on the number of nonzero pulses after
the last substitution.
If # of non zero pulses is even the
substitution is B00V to make total # of
non zero pulse even.
If # of non zero pulses is odd the
substitution is 000V to make total # of
non zero pulses even.
Different situations in HDB3 scrambling technique
ANALOG-TO-DIGITAL CONVERSION

A digital signal is superior to an analog signal because


it is more robust to noise and can easily be recovered,
corrected and amplified. For this reason, the tendency
today is to change an analog signal to digital data. In
this section we describe two techniques, pulse code
modulation and delta modulation.
PCM
■ PCM consists of three steps to digitize an analog
signal:
1. Sampling
2. Quantization
3. Binary encoding
▪ Before we sample, we have to filter the signal to
limit the maximum frequency of the signal as it
affects the sampling rate.
▪ Filtering should ensure that we do not distort the
signal, i.e. remove high frequency components
that affect the signal shape.
Components of PCM encoder
Sampling
■ Analog signal is sampled every TS secs.
■ Ts is referred to as the sampling interval.
■ fs = 1/Ts is called the sampling rate or
sampling frequency.
■ There are 3 sampling methods:
■ Ideal - an impulse at each sampling instant
■ Natural - a high speed switch is turned on for a
small period of time when sampling occurs
■ Sample and hold - creates flat-top samples using a
circuit
■ The process is referred to as pulse amplitude
modulation PAM and the outcome is a signal
with analog (non integer) values
Three different sampling methods for PCM
Note

According to the Nyquist theorem, the


sampling rate must be
at least 2 times the highest frequency
contained in the signal.
Nyquist sampling rate for low-pass and bandpass signals
Example for Nyquist Sampling Rate

For an intuitive example of the Nyquist theorem, let us


sample a simple sine wave at three sampling rates: fs = 4f
(2 times the Nyquist rate), fs = 2f (Nyquist rate), and
fs = f (one-half the Nyquist rate). Figure in the following
slide shows the sampling and the subsequent recovery of
the signal.

It can be seen that sampling at the Nyquist rate can create


a good approximation of the original sine wave (part a).
Oversampling in part b can also create the same
approximation, but it is redundant and unnecessary.
Sampling below the Nyquist rate (part c) does not produce
a signal that looks like the original sine wave.
Recovery of a sampled sine wave for different sampling rates
Example

Telephone companies digitize voice by assuming a


maximum frequency of 4000 Hz. The sampling rate
therefore is 8000 samples per second.
Example

A complex low-pass signal has a bandwidth of 200 kHz.


What is the minimum sampling rate for this signal?

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

A complex bandpass signal has a bandwidth of 200 kHz.


What is the minimum sampling rate for this signal?

Solution
We cannot find the minimum sampling rate in this case
because we do not know where the bandwidth starts or
ends. We do not know the maximum frequency in the
signal.
Quantization
■ Sampling results in a series of pulses of varying
amplitude values ranging between two limits: a
min and a max.
■ The amplitude values are infinite between the two
limits.
■ We need to map the infinite amplitude values onto
a finite set of known values.
Steps in Quantization
1)The original analog signal has instantaneous
amplitude between Vmin and Vmax
2) Divide the range into L zones, each of
height Δ(delta)
Δ = (Vmax - Vmin)/L
3) Assign quantized values of 0 to L-1 to
midpoint of each zone
4) Approximate the value of sample amplitude
to the quantized values
Quantization Example
■ Assume we have a voltage signal with
amplitudes Vmin=-20V and Vmax=+20V.
■ We want to use L=8 quantization levels.
■ Zone width Δ = (20 - -20)/8 = 5
■ The 8 zones are: -20 to -15, -15 to -10, -10
to -5, -5 to 0, 0 to +5, +5 to +10, +10 to
+15, +15 to +20
■ The midpoints are: -17.5, -12.5, -7.5, -2.5,
2.5, 7.5, 12.5, 17.5
Encoding
■ Each zone is then assigned a binary code.
■ The number of bits required to encode the zones,
or the number of bits per sample as it is commonly
referred to, is obtained as follows:
nb = log2 L
■ Given our example, nb = 3
■ The 8 zone (or level) codes are therefore: 000,
001, 010, 011, 100, 101, 110, and 111
■ Assigning codes to zones:
■ 000 will refer to zone -20 to -15
■ 001 to zone -15 to -10, etc.
Quantization and encoding of a sampled signal
Quantization Error
■ When a signal is quantized, we introduce an error
- the coded signal is an approximation of the
actual amplitude value.
■ The difference between actual and coded value
(midpoint) is referred to as the quantization error.
■ The value of error for any sample is less than Δ/2.
i.e., -Δ/2 ≤ error ≤ Δ/2
■ Contribution of quantization error to SNRdB
depends on the bits per sample nb
SNRdB =6.02 nb + 1.76 dB
Example

What is the SNRdB in the previous example that we used


for Quantization?

Solution
We have 8 levels and 3 bits per sample,
SNRdB =6.02 *3 + 1.76 dB
SNRdB = 19.82 dB
Bit rate and bandwidth
requirements of PCM
■ The bit rate of a PCM signal can be calculated
form the number of bits per sample x the sampling
rate
Bit rate = nb x fs
■ A digitized signal will always need more
bandwidth than the original analog signal. Price
we pay for robustness and other features of digital
transmission.
Example

We want to digitize the human voice which normally


contains frequencies from 0 to 4000 Hz. What is the bit
rate, assuming 8 bits per sample?

Solution
The sampling rate and bit rate are calculated as follows:
Recovery of original signal-PCM
Decoder
■ To recover an analog signal from a digitized signal
we follow the following steps:
■ We use a hold circuit that holds the amplitude value of
a pulse till the next pulse arrives.
■ We pass this signal through a low pass filter to smooth
the staircase signal into an analog signal.
■ The higher the value of L, the less distorted a
signal is recovered.
Components of a PCM decoder
Delta Modulation
■ This scheme sends only the difference between
pulses, if the pulse at time tn+1 is higher in
amplitude value than the pulse at time tn, then a
single bit, say a “1”, is used to indicate the
positive value.
■ If the pulse is lower in value, resulting in a
negative value, a “0” is used.
■ This scheme works well for small changes in
signal values between samples.
■ If changes in amplitude are large, this will result in
large errors.
The process of delta modulation
Modulator

• Modulator creates a stream of bits from an analog signal


• The process records the small positive or negative changes, called
delta δ
• If the delta is +ve, process records a 1; else 0
• To find the change, process compares the analog signal with a base
signal(staircase signal)
• Value of analog signal is compared with the last value of staircase
signal
• If the amplitude of analog signal is larger, next bit in the digital data is
1; otherwise it is 0
Delta modulation components
Demodulator

• Demodulator takes the digital data and using the staircase


maker and the delay unit, creates the analog signal.
• The created analog signal then passes through a low-pass filter
for smoothing
TRANSMISSION MODES

The transmission of binary data across a link can be


accomplished in either parallel or serial mode. In
parallel mode, multiple bits are sent with each clock
tick. In serial mode, 1 bit is sent with each clock tick.
While there is only one way to send parallel data, there
are three subclasses of serial transmission:
asynchronous, synchronous, and isochronous.
Data transmission and modes
Parallel transmission
• All n bits of one group can be transmitted with each clock tick
from one device to another
• Advantage- speed
• Disadvantage -cost
Serial transmission
Note

In asynchronous transmission, we send


1 start bit (0) at the beginning and 1 or
more stop bits (1s) at the end of each
byte. There may be a gap between
each byte.
Note

Asynchronous here means


“asynchronous at the byte level,”
but the bits are still synchronized;
their durations are the same.
Asynchronous transmission
Note

In synchronous transmission, we send


bits one after another without start or
stop bits or gaps. It is the responsibility
of the receiver to group the bits. The bits
are usually sent as bytes and many
bytes are grouped in a frame. A frame is
identified with a start and an end byte.
Synchronous transmission
Isochronous

■ In isochronous transmission we cannot have


uneven gaps between frames.
■ Entire stream of bits must be synchronized
■ Ensures that data arrive at a fixed rate
■ Real-time audio and video
Chapter 5
Analog Transmission
DIGITAL-TO-ANALOG CONVERSION

Digital-to-analog conversion is the process of


changing one of the characteristics of an analog
signal based on the information in digital data.
Digital to Analog Conversion

■ Digital data needs to be carried on an


analog signal.
■ A carrier signal (frequency fc) performs
the function of transporting the digital
data in an analog waveform.
■ The analog carrier signal is manipulated
to uniquely identify the digital data
being carried.
Digital-to-analog conversion
Types of digital-to-analog conversion
Data Element vs Signal Element

Bit rate, N, is the number of bits per


second (bps).
Baud rate, S, is the number of signal
elements per second (bauds).
In the analog transmission of digital
data, the signal or baud rate is less than
or equal to the bit rate.
S=Nx1/r bauds
Where r is the number of data bits per
signal element.
Example

An analog signal carries 4 bits per signal element. If


1000 signal elements are sent per second, find the bit
rate.

Solution
In this case, r = 4, S = 1000, and N is unknown. We can
find the value of N from
Example

An analog signal has a bit rate of 8000 bps and a baud


rate of 1000 baud. How many data elements are
carried by each signal element? How many signal
elements do we need?
Solution
In this example, S = 1000, N = 8000, and r and L are
unknown. We find first the value of r and then the value
of L.
Amplitude Shift Keying (ASK)

■ ASK is implemented by changing the


amplitude of a carrier signal to reflect
amplitude levels in the digital signal.
■ For example: a digital “1” could not affect the
signal, whereas a digital “0” would, by
making it zero. (Binary ASK or on-off keying)
■ Phase and frequency remains constant
■ Multilevel ASK is also available
Binary amplitude shift keying
Bandwidth of ASK

■ The bandwidth B of ASK is proportional


to the signal rate S.
B = (1+d)S
■ “d” is due to modulation and filtering,
lies between 0 and 1.
Frequency Shift Keying

■ The digital data stream changes the


frequency of the carrier signal, fc.
■ We use 2 carrier frequencies f1 , f2
(binary FSK)
■ For example, a “1” could be represented
by f1=fc +Δf, and a “0” could be
represented by f2=fc-Δf.
■ Multilevel FSK is also available
Binary frequency shift keying
Bandwidth of FSK

■ If the difference between the two


frequencies (f1 and f2) is 2Δf, then the
required Bandwidth B will be:
B = (1+d)x S +2Δf
Phase Shift Keyeing

■ We vary the phase shift of the carrier


signal to represent digital data.
■ The bandwidth requirement, B is:
B = (1+d)xS
■ PSK is much more robust than ASK as it
is not that vulnerable to noise, which
changes amplitude of the signal.
■ Binary and Quadrature PSK
Binary phase shift keying
Note

Quadrature amplitude modulation is a


combination of ASK and PSK.
ANALOG TO ANALOG CONVERSION

Analog-to-analog conversion is the representation of


analog information by an analog signal. One may ask
why we need to modulate an analog signal; it is
already analog. Modulation is needed if the medium is
bandpass in nature or if only a bandpass channel is
available to us.
Types of analog-to-analog modulation
Amplitude Modulation

■ A carrier signal is modulated only in


amplitude value
■ The modulating signal is the envelope of the
carrier
■ Frequency and phase of the carrier remains
the same
Amplitude modulation
Note

The total bandwidth required for AM


can be determined
from the bandwidth of the audio
signal: BAM = 2B.
AM band allocation

• Bandwidth of an audio signal (speech and music) is 5


kHz
• AM radio station needs a bandwidth of 10 kHz.
• Carrier frequencies range from 530 to 1700 kHz
• Each station’s carrier frequency must be separated
from those on either side of it by atleast 10 kHz to avoid
interference
Frequency Modulation

■ The modulating signal changes the freq.


fc of the carrier signal
■ The bandwidth for FM is high
■ It is approx. 10x the signal frequency
Note

The total bandwidth required for FM can


be determined from the bandwidth
of the audio signal: BFM = 2(1 + β)B.
Where β is usually 4.
Frequency modulation
FM band allocation

• FM station needs a bandwidth of 200 kHz


• Carrier frequencies range from 88 to 108 MHz
• Stations should be separated by atleast 200 kHz to
keep their bandwidths from overlapping
Phase Modulation (PM)

■ The modulating signal only changes the


phase of the carrier signal.
■ The phase change manifests itself as a
frequency change but the instantaneous
frequency change is proportional to the
derivative of the amplitude of the
modulating signal.
Phase modulation
Note

The total bandwidth required for PM can


be determined from the bandwidth
and maximum amplitude of the
modulating signal:
BPM = 2(1 + β)B.
Where β = 2 most often.
MODULE 2

Chapter 6
Bandwidth Utilization:
Multiplexing and
Spreading
Note

Bandwidth utilization is the wise use of


available bandwidth to achieve
specific goals.
Efficiency can be achieved by
multiplexing; i.e., sharing of the
bandwidth between multiple users.
MULTIPLEXING
Whenever the bandwidth of a medium linking two
devices is greater than the bandwidth needs of the
devices, the link can be shared. Multiplexing is the set
of techniques that allows the (simultaneous)
transmission of multiple signals across a single data
link. As data and telecommunications use increases, so
does traffic.
Dividing a link into channels
Categories of multiplexing
Frequency-division multiplexing (FDM)

• Signals generated by each sending device modulate


different carrier frequencies
• These modulated signals are combined into a
composite signal that is transported through the
link
• The demultiplexer uses a series of filters to
decompose the multiplexed signal into its
constituent component signals
• The individual signals are then passed to a
demodulator that separates them from their
carriers and passes them to the output lines
• Guard bands are strips of unused bandwidth ,
used to prevent signals from overlapping
FDM process
FDM demultiplexing
Example

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 the Figure in next slide.
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.
Figure
Example

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,
as shown in Figure in next slide
Figure
Wavelength-division multiplexing (WDM)

• Designed to use high data rate capability of fiber


optic cable
• WDM is conceptually same as FDM, combining
different signals of different frequencies.
Difference is that the frequencies are very high
Note

WDM is an analog multiplexing


technique to combine optical signals.
Prisms in wavelength-division multiplexing and
demultiplexing
• We need to combine multiple light sources into
single light at the multiplexer and the reverse at the
demultiplexer
• Prism bends a beam of light based on angle of
incidence and frequency. This concept can be used
at multiplexer
Time Division Multiplexing (TDM)
Each connection occupies a portion of time in the link
Note

TDM is a digital multiplexing technique


for combining several low-rate digital
channels into one high-rate one.
Synchronous time-division multiplexing
A round of data units from each input connection is
collected into a frame
Note

In synchronous TDM, the data rate


of the link is n times faster, and the unit
duration is n times shorter.
Example

For the figure in previous slide, the data rate for each one
of the 3 input connection is 1 kbps. If 1 bit at a time is
multiplexed (a unit is 1 bit), what is the duration of (a)
each input slot, (b) each output slot, and (c) each frame?

Solution
We can answer the questions as follows:
a. The data rate of each input connection is 1 kbps. This
means that the bit duration is 1/1000 s or 1 ms. The
duration of the input time slot is 1 ms (same as bit
duration).
Example (continued)

b. The duration of each output time slot is one-third of


the input time slot. This means that the duration of the
output time slot is 1/3 ms.

c. Each frame carries three output time slots. So the


duration of a frame is 3 × 1/3 ms, or 1 ms.

Note: The duration of a frame is the same as the duration


of an input unit.
Example

Figure shows synchronous TDM with 4 1Mbps data


stream inputs and one data stream for the output. The
unit of data is 1 bit. Find (a) the input bit duration, (b) the
output bit duration, (c) the output bit rate, and (d) the
output frame rate.
Example(continued)

Solution
a. The input bit duration is the inverse of the bit rate:
1/1 Mbps = 1 μs.
b. The output bit duration is one-fourth of the input bit
duration, or ¼ μs.
c. The output bit rate is the inverse of the output bit
duration or 1/(4μs) or 4 Mbps. This can also be
deduced from the fact that the output rate is 4 times as
fast as any input rate; so the output rate = 4 × 1 Mbps
= 4 Mbps.
d. The frame rate is always the same as any input rate.
So the frame rate is 1,000,000 frames per second
Example

Four channels are multiplexed using TDM. If each


channel sends 100 bytes /s and we multiplex 1 byte per
channel, calculate the size of the frame, the frame rate,
and the bit rate for the link.

Solution
Each frame carries 1 byte from each channel; the size of
each frame, therefore, is 4 bytes, or 32 bits. Because each
channel is sending 100 bytes/s and a frame carries 1 byte
from each channel, the frame rate must be 100 frames
per second. The bit rate is 100 × 32, or 3200 bps.
Interleaving

■ The process of taking a group of bits


from each input line for multiplexing is
called interleaving.
■ We interleave bits (1 - n) from each
input onto one output.
Interleaving
Data Rate Management

■ Not all input links maybe have the same


data rate.
■ Some links maybe slower. There maybe
several different input link speeds
■ There are three strategies that can be
used to overcome the data rate
mismatch: multilevel, multi slot and
pulse stuffing
Data rate matching

■ Multilevel: used when the data rate of an


input link is a multiple of others
■ Multislot: sometimes it is more efficient to
allot more than one slot in a frame to a single
input line.
■ Pulse Stuffing: Sometimes the bit rates of
sources are not multiples of each other. The
slowest speed link will be brought up to the
speed of the other links by bit insertion, this
is called pulse stuffing.
Multilevel multiplexing
Multiple-slot multiplexing
Pulse stuffing
Synchronization
■ If multiplexer and demultiplexer are not
synchronized, a bit belonging to one
channel may be received by wrong channel
■ Thus, one or more synchronization bits are
added to beginning of each frame
■ These bits are called framing bits
■ Synchronization information consists of 1
bit per frame, alternating between 0 and 1
Framing bits
Inefficient use of Bandwidth

■ Sometimes an input link may have no


data to transmit.
■ When that happens, one or more slots
on the output link will go unused.
■ That is wasteage of bandwidth.
Empty slots
Statistical TDM

• Slots are dynamically allocated to improve


bandwidth
• Number of slots in a frame is less than the
number of input lines
• Multiplexer checks each input line in
round-robin fashion; it allocates a slot for an
input line if the line has data to send; otherwise
it skips the line and checks the next line
• A slot carries both data and address
• No synchronization bit
TDM slot comparison
SPREAD SPECTRUM
In spread spectrum (SS), we combine signals from
different sources to fit into a larger bandwidth, but our
goals are to prevent eavesdropping and jamming. To
achieve these goals, spread spectrum techniques add
redundancy.
Spread Spectrum
■ A signal that occupies a bandwidth of B, is
spread out to occupy a bandwidth of Bss
■ All signals are spread to occupy the same
bandwidth Bss
■ Signals are spread with different codes so
that they can be separated at the receivers.
■ Signals can be spread in the frequency
domain or in the time domain.
■ Designed to be used in wireless applications
Spread spectrum
Frequency hopping spread spectrum (FHSS)

• Uses M different carrier frequencies that are


modulated by the source signal
• At one moment, signal modulates one carrier
frequency, next moment signal modulates another
carrier frequency.
• Although modulation is done using one carrier
frequency at a time, M frequencies are used in the
long run
Frequency hopping spread spectrum (FHSS)
Frequency hopping spread spectrum (FHSS)

• Pseudorandom code generator, creates a


k-bit pattern for every hopping period
• Frequency table uses this pattern to find the
frequency to be used and passes it to
frequency synthesizer.
• Frequency synthesizer creates a carrier
signal of that frequency and source signal
modulates carrier signal.
Frequency selection in FHSS
FHSS cycles
Bandwidth sharing
• In FDM, each station uses 1/M of the bandwidth, but
allocation is fixed.
• In FHSS, each station uses 1/M of the bandwidth,
but allocation changes hop to hop
Direct Sequence Spread Spectrum

• Each data bit is replaced with n bits using


a spreading code.
DSSS example
• In this example, Barker sequence is
used(10110111000)
• Chip Generator uses NRZ encoding.
DSSS
• Spread signal can provide privacy if the
intruder does not know the code
• It can provide immunity against interference
if each station uses a different code
Chapter 7
Transmission Media

.
Classes of transmission media
Twisted-pair cable

• Consists of two conductors(normally copper),


each with its own plastic insulation, twisted
together
• One of the wires is used to carry signals to the
receiver and the other is used as ground reference.
Receiver uses the difference between the two.
Unshielded Twisted Pair and Shielded Twisted Pair cables
UTP connector
Coaxial cable
Coaxial cable(continued)
• has a central core conductor of solid or stranded wire
(usually copper) enclosed in an insulating sheath, which is,
encased in an outer conductor of metal foil, braid, or a
combination of the two.
• outer conductor is also enclosed in an insulating sheath, and
the whole cable is protected by a plastic cover.
Categories of coaxial cables
Bayone-Neill-Concelman(BNC) connectors
Optical fiber cables

• Made of glass or plastic and transmits signals in the form


of light
• A glass or plastic core is surrounded by a cladding of less
dense glass or plastic
• beam of light moving through the core is reflected off the
cladding
Propagation modes for optical channels
Modes

• Multimode: multiple beams from a light source move


through the core in different paths.
• multimode step-index fiber: the density of the core remains
constant from the center to the edges. beam of light moves in
a straight line until it reaches the interface of the core and the
cladding. At the interface, there is an abrupt change due to a
lower density; this alters the angle of the beam's motion
• multimode graded-index fiber: is one with varying
densities. Density is highest at the center of the core and
decreases gradually to its lowest at the edge.
• Single-mode uses step-index fiber and a highly focused
source of light that limits beams to a small range of angles, all
close to the horizontal.
Modes
Fiber-optic cable connectors
UNGUIDED MEDIA: WIRELESS

Unguided media transport electromagnetic waves


without using a physical conductor. This type of
communication is often referred to as wireless
communication.
Propagation methods
Propagation methods
• In ground propagation, radio waves travel through the
lowest portion of the atmosphere, hugging the earth. These
low-frequency signals emanate in all directions from the
transmitting antenna and follow the curvature of the planet.
• In sky propagation, higher-frequency radio waves radiate
upward into the ionosphere where they are reflected back to
earth.
• In line-of-sight propagation, very high-frequency signals are
transmitted in straight lines directly from antenna to antenna.
Antennas must be directional, facing each other and either tall
enough or close enough together not to be affected by the
curvature of the earth
Wireless transmission waves
Note

Radio waves are used for multicast


communications, such as radio and
television, and paging systems. They
can penetrate through walls.
Highly regulated. Use omni directional
antennas
Omnidirectional antenna
Note

Microwaves are used for unicast


communication such as cellular
telephones, satellite networks,
and wireless LANs.
Higher frequency ranges cannot
penetrate walls.
Use directional antennas - point to point
line of sight communications.
Unidirectional antennas
Note

Infrared signals can be used for


short-range communication in a closed
area using line-of-sight propagation.
Chapter 8
Switching
Switched network
• switched network consists of a series of interlinked nodes,
called switches
• Switches create temporary connections between two or more
devices linked to the switch
Taxonomy of switched networks
CIRCUIT-SWITCHED NETWORKS

A circuit-switched network consists of a set of switches


connected by physical links. A connection between two
stations is a dedicated path made of one or more links.
However, each connection uses only one dedicated
channel on each link.. Each link is normally divided
into n channels by using FDM or TDM.
Note

A circuit-switched network is made of


a set of switches connected by
physical links, in which each link is
divided into n channels.
A trivial circuit-switched network
Note

In circuit switching, the resources


need to be reserved during the setup
phase; the resources remain
dedicated for the entire duration of
data transfer until the teardown phase.
Example

As a trivial example, let us use a circuit-switched network


to connect eight telephones in a small area.
Communication is through 4-kHz voice channels. We
assume that each link uses FDM to connect a maximum
of two voice channels. The bandwidth of each link is then
8 kHz. The figure in the following shows the situation.
Telephone 1 is connected to telephone 7; 2 to 5; 3 to 8;
and 4 to 6. Of course the situation may change when new
connections are made. The switch controls the
connections.
Circuit-switched network used in Example
Delay in a circuit-switched network

The total delay is due to the time needed to create the connection,
transfer data, and disconnect the circuit
Note

Switching at the physical layer in


the traditional telephone network
uses the circuit-switching
approach.
DATAGRAM NETWORKS

In data communications, we need to send messages


from one end system to another. If the message is
going to pass through a packet-switched network, it
needs to be divided into packets of fixed or variable
size.. The size of the packet is determined by the
network and the governing protocol.
Note

In a packet-switched network, there


is no resource reservation;
resources are allocated on
demand.
A datagram network with four switches (routers)
• Each packet is treated independently of all others
• Datagram switching is normally done at the network layer
• The switches in a datagram network are referred to as routers.
• Packets may travel different paths to reach their destination
• Packets arrive at their destination out of order with different
delays between the packets
Routing table in a datagram network
• Each switch has a routing table which is based on the
destination address.
• Routing tables are dynamic and are updated periodically.
• The destination addresses and the corresponding
forwarding output ports are recorded in the tables.
Note

The destination address in the header


of a packet in a datagram network
remains the same during the
entire journey of the packet.
Delay in a datagram network

Total delay = 3T + 3τ+ W1+ W2


Note

Switching in the Internet is done


by using the datagram approach
to packet switching
at the network layer.
VIRTUAL-CIRCUIT NETWORKS

A virtual-circuit network is a cross between a


circuit-switched network and a datagram
network. It has some characteristics of both.
Virtual-circuit network-characteristics

• There are setup and teardown phases in addition to the


data transfer phase
• Resources can be allocated during the setup phase or on
demand
• Data are packetized and each packet carries an address
in the header. The address in the header has local
jurisdiction
• All packets follow the same path established during the
connection
• Virtual-circuit network is normally implemented in the
data link layer
Virtual-circuit network
Virtual-circuit identifier

• Identifier that is used for data transfer


• Used by a frame between two switches
• When a frame arrives at a switch, it has a VCI; when it leaves,
it has a different VCI
Switch and tables in a virtual-circuit network
Setup request in a virtual-circuit network
Setup acknowledgment in a virtual-circuit network
Source-to-destination data transfer in a virtual-circuit
network
Note

In virtual-circuit switching, all


packets belonging to the same
source and destination travel the
same path; but the packets may
arrive at the
destination with different delays
if resource allocation is on demand.
Delay in a virtual-circuit network

Total delay = 3T + 3τ+ setup delay+ teardown


delay
Note

Switching at the data link layer in


a switched WAN is normally
implemented by using
virtual-circuit techniques.
STRUCTURE OF A SWITCH

• We use switches in circuit-switched and


packet-switched networks.
• Circuit switching today can use either of two
technologies: the space-division switch or the
time-division switch.
• Packet switch has four components: input ports,
output ports, the routing processor, and the
switching fabric
Space division switch : Crossbar switch
Connects n inputs to m outputs in a grid, using electronic
microswitches (transistors) at each cross point.
Space division switch : Multistage switch
• combines crossbar switches in several (normally three) stages
• In a single crossbar switch, only one row or column (one path) is
active for any connection. So we need N x N cross points.
• If we can allow multiple paths inside the switch, we can decrease
the number of cross points. Each cross point in the middle stage
can be accessed by multiple cross points in the first or third stage
Note

In a three-stage switch, the total


number of crosspoints is
2kN + k(N/n)2
which is much smaller than the number of
crosspoints in a single-stage switch (N2).
Example

Design a three-stage, 200 × 200 switch (N = 200) with


k = 4 and n = 20.

Solution
In the first stage we have N/n or 10 crossbars, each of size
20 × 4. In the second stage, we have 4 crossbars, each of
size 10 × 10. In the third stage, we have 10 crossbars,
each of size 4 × 20. The total number of crosspoints is
2kN + k(N/n)2, or 2000 crosspoints. This is 5 percent of
the number of crosspoints in a single-stage switch (200 ×
200 = 40,000).
Note
According to the Clos criterion:
n = (N/2)1/2
k > 2n – 1

The multistage switch in has one drawback: blocking during periods of


heavy traffic. Blocking refers to times when one input cannot be
connected to an output because there is no path available between
them-all the possible intermediate switches are occupied. Clos came
up with the formula for non-blocking switch
Example

Redesign the previous three-stage, 200 × 200 switch,


using the Clos criteria with a minimum number of
crosspoints.

Solution
We let n = (200/2)1/2, or n = 10. We calculate k = 2n − 1 =
19. In the first stage, we have 200/10, or 20, crossbars,
each with 10 × 19 crosspoints. In the second stage, we
have 19 crossbars, each with 20 × 20 crosspoints. In the
third stage, we have 20 crossbars each with 19 × 10
crosspoints. The total number of crosspoints is 20(10 ×
19) + 19(20 × 20) + 20(19 ×10) = 15200.
Time Division Switch: Time-slot interchange(TSI)
• TDM multiplexer, a TDM demultiplexer, and a TSI consisting of
random access memory (RAM) with several memory locations.
• The size of each location is the same as the size of a single time slot.
• The number of locations is the same as the number of inputs.
• RAM fills up with incoming data from time slots in the order
received.
• Slots are then sent out in an order based on the decisions of a control
unit.
Time-space-time switch(TST)
Time-space-time switch(TST)

• Two time stages and one space stage and has 12 inputs and 12
outputs.
• divides the inputs into three groups and directs them to three
timeslot interchanges
• Thus the average delay is one-third of what would result from
using one time-slot interchange to handle all 12 inputs
• The last stage is a mirror image of the first stage.
• The middle stage is a space division switch (crossbar) that
connects the TSI groups to allow connectivity between all
possible input and output pairs
Packet switch components
Input port

• Performs the physical and data link functions of the packet


switch.
• The bits are constructed from the received signal.
• The packet is decapsulated from the frame.
• Errors are detected and corrected.
• It also has buffers (queues) to hold the packet before it is directed
to the switching fabric.
Output port and Routing Processor

• First the outgoing packets are queued.


• Then the packet is encapsulated in a frame, and
• finally the physical layer functions are applied to the
frame to create the signal to be sent on the line

The routing processor performs the functions of the


network layer. The destination address is used to find the
address of the next hop and, at the same time, the output
port number from which the packet is sent out.
Switching Fabrics: Banyan switch
Switching Fabrics: Banyan switch

• multistage switch with microswitches at each stage that


route the packets based on the output port represented
as a binary string.
• For n inputs and n outputs, we have log2 n stages with
n/2 microswitches at each stage
• The first stage routes the packet based on the
high-order bit of the binary string.
• The second stage routes the packet based on the second
high-order bit, and so on.
Examples of routing in a banyan switch

The problem with the banyan switch is the possibility of


internal collision even when two packets are not heading
for the same output port
Switching Fabrics: Batcher-banyan switch
Batcher-banyan switch

• Sort the arriving packets based on their destination port


• Batcher designed a switch that comes before the banyan
switch and sorts the incoming packets according to their
final destinations
• Another hardware module called trap is added between
the Batcher switch and the banyan switch
• The trap module prevents duplicate packets (packets with
the same output destination) from passing to the banyan
switch simultaneously.
• Only one packet for each destination is allowed at each
tick; if there is more than one, they wait for the next tick.
Selective Repeat ARQ
• Go-Back-N ARQ is very inefficient for a noisy link.
In a noisy link a frame has a higher probability of
damage, which means the resending of multiple
frames.
• Resending uses up the bandwidth and slows down
the transmission.
• When just one frame is damaged; only the damaged
frame is resent. This mechanism is called Selective
Figure: Send window for Selective Repeat ARQ
Figure : Receive window for Selective Repeat ARQ
Figure: Design of Selective Repeat ARQ
Figure: Selective Repeat ARQ, window size
Note

In Selective Repeat ARQ, the size of the


sender and receiver window
must be at most one-half of 2m.
Algorithm: Sender-site Selective Repeat algorithm

(continued
)
Algorithm: Sender-site Selective Repeat algorithm
(continued
)

(continued
Algorithm: Sender-site Selective Repeat (continued
algorithm
)
Algorithm: Receiver-site Selective Repeat algorithm
Algorithm:Receiver-site Selective Repeat algorithm
Figure: Delivery of data in Selective Repeat ARQ
Example

We show how Selective Repeat behaves in the case 1


frame is lost. Figure in the following slide shows the
situation. One main difference is the number of timers.
Here, each frame sent or resent needs a timer, which
means that the timers need to be numbered (0, 1, 2, and
3). The timer for frame 0 starts at the first request, but
stops when the ACK for this frame arrives. The timer for
frame 1 starts at the second request, restarts when a NAK
arrives, and finally stops when the last ACK arrives. The
other two timers start when the corresponding frames are
sent and stop at the last arrival event.
Example (continued)

At the receiver site we need to distinguish between the


acceptance of a frame and its delivery to the network
layer. At the second arrival, frame 2 arrives and is stored
and marked, but it cannot be delivered because frame 1 is
missing. At the next arrival, frame 3 arrives and is
marked and stored, but still none of the frames can be
delivered. Only at the last arrival, when finally a copy of
frame 1 arrives, can frames 1, 2, and 3 be delivered to the
network layer. There are two conditions for the delivery of
frames to the network layer: First, a set of consecutive
frames must have arrived. Second, the set starts from the
beginning of the window.
Example (continued)

Another important point is that a NAK is sent after the


second arrival, but not after the third, although both
situations look the same. The reason is that the protocol
does not want to crowd the network with unnecessary
NAKs and unnecessary resent frames. The second NAK
would still be NAK1 to inform the sender to resend frame
1 again; this has already been done. The first NAK sent is
remembered (using the nakSent variable) and is not sent
again until the frame slides. A NAK is sent once for each
window position and defines the first slot in the window.
Example (continued)

The next point is about the ACKs. Notice that only two
ACKs are sent here. The first one acknowledges only the
first frame; the second one acknowledges three frames. In
Selective Repeat, ACKs are sent when data are delivered to
the network layer. If the data belonging to n frames are
delivered in one shot, only one ACK is sent for all of them.
Figure: Flow diagram for Example
Piggybacking
• In real life, data frames are normally flowing in
both directions
• A technique called piggybacking is used to
improve the efficiency of the bidirectional
protocols
• When a frame is carrying data from A to B, it can
also carry control information about arrived (or
lost) frames from B; when a frame is carrying
data from B to A, it can also carry control
information about the arrived (or lost) frames
from A.
Figure: Design of piggybacking in Go-Back-N ARQ
Link Utilization / Selective Repeat ARQ

Efficiency (η) = N / (1+2a)


where,
N is the window size
a = Tp / Tt
What is Data Compression?

Data compression is the representation of an information source


(e.g. a data file, a speech signal, an image, or a video signal) as
accurately
as possible using the fewest number of bits.

Compressed data can only be understood if the decoding method is


known by the receiver.
Why Data Compression?
• Data storage and transmission cost money. This cost increases with the
amount of data available.

• This cost can be reduced by processing the data so


that it takes less memory and less transmission time.

• Some data types consist of many chunks of repeated data (e.g. multimedia
data such as audio, video, images, …)

• Such “raw” data can be transformed into a


compressed data representation form saving a lot
of storage and transmission costs.

• Disadvantage of Data compression:


Compressed data must be decompressed to be viewed (or heard), thus extra
processing is required.
Lossless and Lossy Compression Techniques
• Data compression techniques are broadly classified into lossless and lossy.

• Lossless techniques enable exact reconstruction of the original document from the
compressed information.

• Exploit redundancy in data


• Applied to general data
• Examples: Run-length, Huffman and LZW

• Lossy compression - reduces a file by permanently eliminating certain redundant


information

• Exploit redundancy and human perception


• Applied to audio, image, and video
• Examples: JPEG and MPEG

• Lossy techniques usually achieve higher compression rates than lossless ones but
Classification of Lossless Compression Techniques
• Lossless techniques are classified into static, adaptive (or dynamic), and hybrid.
• In a static method the mapping from the set of messages to the set of codewords is fixed
before transmission begins, so that a given message is represented by the same codeword
every time it appears in the message being encoded.

• Static coding requires two passes: one pass to compute probabilities (or frequencies)
and determine the mapping, and a second pass to encode.
• Examples: Static Huffman Coding

• In an adaptive method the mapping from the set of messages to the set of codewords
changes over time.

• All of the adaptive methods are one-pass methods; only one scan of the message is
required.
• Examples: LZW, and Adaptive Huffman Coding

• An algorithm may also be a hybrid, neither completely static nor completely dynamic.
Run-length encoding
The following string:
BBBBHHDDXXXXKKKKWWZZZZ

can be encoded more compactly by replacing each repeated string of characters by a single instance
of the repeated character and a number that represents the number of times it is repeated:

B4H2D2X4K4W2Z4

Here "B4" means four B's, and “H2” means two H's, etc. Compressing a string in this way is called
run-length encoding.

B0 = # bits required before compression

B1 = # bits required after compression

Compression Ratio = B0 / B1.


Run-length
encoding
As another example, consider the storage of a rectangular image. As a single color bitmapped
image, it can be stored as:

The rectangular image can be compressed with run-length encoding by counting identical
bits as follows:
0, 40
0, 40 The first line says that the first line of the bitmap consists of 40 0's.
The third line says that the third line of the bitmap consists of 10 0's
0,10 1,20 0,10 followed by 20 1's followed by 10 more 0's, and so on for the other

0,10 1,1 0,18 1,1 lines


Run-length encoding

This compression technique is most useful where symbols appear in long


runs, and thus can sometimes be useful for images that have areas where
the pixels all have the same value, cartoons for example
Relative encoding
• Relative encoding is a transmission technique that attempts to improve
efficiency by transmitting the difference between each value and its
predecessor, in place of the value itself .
• Eg:-15106433003 would be transmitted as 1+4-4-1+6-2-1+0-3+0+3.
• In effect the transmitter is predicting that each value is the same as its
predecessor and the data transmitted is the difference between the
predicted and actual values.
• Differential Pulse Code Modulation (DPCM)
is an example of relative encoding.
Huffman coding

■ a variable-length code is assigned to input


different characters
■ Most frequent characters have the smallest
codes
■ least frequent characters have longer codes
■ In the first pass create a Huffman tree, and in
the second pass traverse the tree to find
codes.
Huffman coding- Building Huffman
Tree
1. Create a leaf node for each unique character and
build a min heap of all leaf nodes
2. Extract two nodes with the minimum frequency
from the min heap
3. Create a new internal node with a frequency equal
to the sum of the two nodes frequencies. Make the
first extracted node as its left child and the other
extracted node as its right child. Add this node to the
min heap
4. Repeat steps#2 and #3 until the heap contains only
one node. The remaining node is the root node and
the tree is complete.
Huffman coding- Example

Message : 100 character string with the frequencies of


each character given below

character Frequency
a 5
b 9
c 12
d 13
e 16
f 45
Huffman coding- Example(contd.)
Extract two minimum frequency nodes from min
heap. Add a new internal node with frequency 5 + 9 =
14.

character Frequency
c 12
d 13
Internal Node 14
e 16
f 45
Huffman coding- Example(contd.)
Extract two minimum frequency nodes from heap.
Add a new internal node with frequency 12 + 13 = 25

character Frequency
Internal Node 14
e 16
Internal Node 25
f 45
Huffman coding- Example(contd.)
Extract two minimum frequency nodes. Add a new
internal node with frequency 14 + 16 = 30

character Frequency
Internal Node 25
Internal Node 30
f 45
Huffman coding- Example(contd.)
Extract two minimum frequency nodes. Add a new internal
node with frequency 25 + 30 = 55

character Frequency
f 45
Huffman coding- Example(contd.)
Extract two minimum frequency nodes. Add a new
internal node with frequency 45 + 55 = 100

character Frequency
Internal Node 100
Huffman coding- Generating the
code
Traverse the tree formed starting from the root. While
moving to the left child, write 0 . While moving to the
right child, write 1
Huffman coding- Generating the
codes
character code-word
f 0
e 111
d 101
c 100
b 1101
a 1100
Chapter 9
Using Telephone
and Cable Networks
for Data Transmission
TELEPHONE NETWORK

Telephone networks use circuit switching. The


telephone network had its beginnings in the late 1800s.
The entire network, which is referred to as the plain
old telephone system (POTS), was originally an analog
system using analog signals to transmit voice.
Telephone Network- Major Components

Local loop: twisted-pair cable that connects the subscriber telephone


to the nearest end office or local central office.
Trunks: transmission media that handle the communication between
offices
Switching Offices: telephone company has switches located in a
switching office. A switch connects several local loops or trunks and
allows a connection between different subscribers
LATA (local-access transport area)
• LATA can be a small or large metropolitan area
• The services offered by the common carriers(telephone
companies) inside a LATA are called intra-LATA services
• Carrier that handles these services is called a local exchange
carrier (LEC)
• Since 1996, there are two types of LECs: incumbent local
exchange carriers and competitive
local exchange carriers
• The services between LATAs are handled by interexchange
carriers (IXCs). IXC provide communication services between
two customers in different LATAs
• The carriers interact with one another via a switching office
called a point of presence (POP)
Point of presences (POPs)
Normally digitized data
Note

The tasks of data transfer and signaling


are separated in modern telephone
networks: data transfer is done by one
network, signaling by another.
Data transfer and signaling networks

Packet-switch

Packet-switch or circuit-switch
Layers in SS7 (signaling system seven)
Protocol that is used in the signaling network is called
Signaling System Seven (SS7).
Layers in SS7 (signaling system seven)
MTP Level 1: uses several physical layer specifications
MTP Level 2: provides services such as packetizing, using source
and destination address in the packet header, and CRC for error
checking
MTP Level 3: provides end-to-end connectivity, route the signal
packets from the source to the destination.
SCCP: The signaling connection control point (SCCP) is used
for special services such as 800-call processing.
Telephone user port (TUP) is responsible for setting up voice
calls. It receives the dialed digits and routes the calls
Transaction capabilities application port (TCAP) provides
remote calls that let an application program on a computer invoke
a procedure on another computer
ISDN user port (ISUP) can replace TUP to provide services
similar to those of an ISDN network
Services Provided by Telephone Networks

• Two types of services: analog and digital


• Analog services is further classified into analog switched
services and analog leased services.
• Analog switched services : service most often encountered
when a home telephone is used
• Analog leased services: offers customers the opportunity to
lease a line, sometimes called a dedicated line, that is
permanently connected to another customer
• Digital services: Switched/56 Service and Digital Data Service
DIAL-UP MODEMS

Traditional telephone lines can carry frequencies


between 300 and 3300 Hz, giving them a bandwidth of
3000 Hz. All this range is used for transmitting voice,
where a great deal of interference and distortion can
be accepted without loss of intelligibility.
Traditional Telephone line bandwidth

Modern phone line has higher bandwidth


Note

Modem
stands for modulator/demodulator.

Modulator creates
a bandpass analog signal from binary
data
demodulator recovers the binary data
from the modulated signal
Modulation/demodulation
Modem Standards
V-series Modulation Data Rate Baud Rate
standard
V.32 32-QAM 9600 bps 2400 baud Only 4 bits
represent
data
V.32 bis 128-QAM 14,400 bps 2400 baud Only 6 bits
represent
data
V.34 bis M-QAM 28,800-33,60
0 bps
V.90 M-QAM 56 Kbps
(downstream)
33.6 Kbps
(upstream)
V.92 M-QAM 56 Kbps A modem
(downstream) adjusts its
48 Kbps speed
(upstream)
DIGITAL SUBSCRIBER LINE

After traditional modems reached their peak data rate,


telephone companies developed another technology,
DSL, to provide higher-speed access to the Internet.
Digital subscriber line (DSL) technology is one of the
most promising for supporting high-speed digital
communication over the existing local loops.
Asymmetric DSL (ADSL)

Note

ADSL is an asymmetric communication


technology designed for residential
users; it is not suitable for businesses.
ADSL-Using Existing Loops

Note

The existing local loops (twisted-pair


lines) can handle bandwidths up to
1.1 MHz.

Traditional phone has a low-pass filter in front of it,


Which limits its bandwidth to 4KHz.
Note

ADSL is an adaptive technology.


The system uses a data rate
based on the condition of
the local loop line.
Discrete multitone technique
Discrete multitone technique (DMT)
• Standard modulation technique for ADSL
• QAM + FDM
• available bandwidth of 1.104 MHz is divided into 256
channels
• Each channel uses a bandwidth of 4.312 kHz
• Channel 0 is reserved for voice communication.
• Channels 1 to 5 are not used and provide a gap between
voice and data communication
Discrete multitone technique (DMT)
• Channels 6 to 30 (25 channels) are used for upstream
data transfer and control. One channel is for control,
and 24 channels are for data transfer. If there are 24
channels, each using 4 kHz (out of 4.312 kHz
available) with QAM modulation, we have 24 x 4000
x 15, or a 1.44-Mbps bandwidth, in the upstream
direction
• Channels 31 to 255 (225 channels) are used for
downstream data transfer and control. One channel is
for control, and 224 channels are for data. If there are
224 channels, we can achieve up to 224 x 4000 x 15, or
13.4 Mbps
Bandwidth division in ADSL
Customer site: ADSL modem

Splitter and data line need installation


(maybe expensive)
Telephone company site: DSLAM

DSLAM: Digital subscriber line access multiplexer


Other DSL technologies

• ADSL Lite (or Universal ADSL or splitter less ADSL):


allows an ASDL Lite modem to be plugged directly into a
telephone jack and connected to the computer. The splitting is
done at the telephone company
• High-bit-rate digital subscriber line (HDSL) : uses 2B1Q
encoding which is less susceptible to attenuation and provides a
higher data rate.
• Symmetric digital subscriber line (SDSL) is a one
twisted-pair version of HDSL. It provides full-duplex
symmetric communication supporting up to 768 kbps in each
direction.
• Very high-bit-rate digital subscriber line (VDSL) is similar
to ADSL, uses coaxial, fiber-optic, or twisted-pair cable.
Summary of DSL technologies
CABLE TV NETWORKS

The cable TV network started as a video service


provider, but it has moved to the business of Internet
access. In this section, we discuss how this network
can be used to provide high-speed access to the
Internet.
Traditional cable TV network
Traditional cable TV network
• The cable TV office, called the head end, receives
video signals from broadcasting stations and feeds the
signals into coaxial cables
• signals became weaker and weaker with distance, so
amplifiers were installed through the network to renew
the signals
• At the other end, splitters split the cable, and taps and
drop cables make the connections to the subscriber
premises
Note

Communication in the traditional cable


TV network is unidirectional.
Hybrid fiber-coaxial (HFC) network
Hybrid fiber-coaxial (HFC) network
• The network uses a combination of fiber-optic and
coaxial cable
• The regional cable head (RCH) feed the distribution
hubs.
• Modulation and distribution of signals are done at
distribution hubs; the signals are then fed to the fiber
nodes through fiber-optic cables
• The fiber node splits the analog signals so that the
same signal is sent to each coaxial cable.
• Each coaxial cable serves up to 1000 subscribers
Note

Communication in an HFC cable TV


network can be bidirectional.
CABLE TV FOR DATA TRANSFER

Cable companies are competing with telephone


companies for the residential customer who wants
high-speed data transfer.
Division of coaxial cable band by CATV

• All three bands are divided into 6-MHz channels


Note

Downstream data are modulated using


the 64-QAM modulation technique.
Note

The theoretical downstream data rate


is 30 Mbps.
Note

Upstream data are modulated using the


QPSK modulation technique.
Note

The theoretical upstream data rate


is 12 Mbps.
Sharing: Upstream sharing

■ The upstream bandwidth is 37 MHz.


■ There are six 6-MHz channels available.
■ How can the channels be shared in an area
with 1000,2000 or even 200,000 subscribers?
■ Using FDM/timesharing.
■ Subscribers have to contend for the channels
with others.
Sharing: Downstream sharing
■ The downstream band has 33 channels of 6 MHz.
■ Each channel must be shared between a group of
subscribers
■ We have a multicast situation.
■ If there is data for any of subscribers in the group, the
data are sent to that channel.
■ The cable modem for the group matches the address
carried with the data to the address assigned by the
provider. If the address matches, the data are kept;
otherwise, they are discarded.
Cable modem (CM)
The cable modem (CM) is installed on the subscriber
premises. It is similar to an ADSL modem.
In cable company: Cable modem transmission system(CMTS)
• installed inside the distribution hub
• receives data from the Internet and passes them to the combiner,
which sends them to the subscriber
• also receives data from the subscriber and passes them to the
Internet
Data Transmission Schemes: Data Over Cable
System Interface Specification(DOCSIS)
■ Defines all the protocols necessary to transport data
from a CMTS to a Cable Modem.
■ Upstream Communication
■ CM checks for specific packets sent by CMTS.

The packet asks any new CM to announce itself on


a specific upstream channel
■ The CMTS sends a packet to CM, defining its

allocated downstream and upstream channels.


■ The CM starts ranging process (to determine the

distance between CM and CMTS for


synchronization).
Data Transmission Schemes: Data Over Cable System
Interface Specification(DOCSIS)
■ The CM sends a packet to the ISP, asking for the

IP address.
■ The CM and CMTS exchange some packets to

establish security parameters.


■ The CM sends its unique identifier to the CMTS.

■ Upstream communication can start in the allocated

upstream channel.
■ Downstream Communication

■ No contention because only one sender.

■ The CMTS sends the packet with the address of

the receiving CM, using the allocated downstream


channel.
MODULE 3

Chapter 10
Error Detection
and
Correction

.
Note

Data can be corrupted


during transmission.
Some applications require that
errors be detected and corrected.
Types of Errors- Single bit error

Note

In a single-bit error, only 1 bit in the data


unit has changed.
Single-bit error
Types of Errors- Burst error

Note

A burst error means that 2 or more bits


in the data unit have changed.
Burst error of length 8

The length of the burst is measured from the first


corrupted bit to the last corrupted bit.
Note

To detect or correct errors, we need to


send extra (redundant) bits with data.
Detection versus Correction
• In error detection, we are looking only to
see if any error has occurred
• In error correction, we need to know the
exact number of bits that are corrupted and
more importantly, their location in the
message.
• The number of the errors and the size of the
message are important factors
Forward Error Correction versus Retransmission
• Two main methods for error correction
• Forward error correction is the process in
which the receiver tries to guess the
message by using redundant bits.
• Correction by retransmission is a technique
in which the receiver detects the occurrence
of an error and asks the sender to resend the
message. Resending is repeated until a
message arrives that the receiver believes is
error-free
Coding
• Redundancy is achieved through various coding
schemes
• Sender adds redundant bits through a process that
creates a relationship between the redundant bits
and the actual data bits. The receiver checks the
relationships between the two sets of bits to
detect or correct the errors
• There are broadly 2 coding categories : block
coding and convolution coding
The structure of encoder and decoder
Note

In modulo-N arithmetic, we use only the


integers in the range 0 to N −1,
inclusive.
In a modulo-N system, if a
number is greater than N, it is divided by
N and the remainder is the result
XORing of two single bits or two words
BLOCK CODING

In block coding, we divide our message into blocks,


each of k bits, called datawords. We add r redundant
bits to each block to make the length n = k + r. The
resulting n-bit blocks are called codewords.
Datawords and codewords in block coding
Example

The 4B/5B block coding discussed in Chapter 4 is a good


example of this type of coding. In this coding scheme,
k = 4 and n = 5. As we saw, we have 2k = 16 datawords
and 2n = 32 codewords. We saw that 16 out of 32
codewords are used for message transfer and the rest are
either used for other purposes or unused.
Error Detection
■ Enough redundancy is added to detect an error.
■ If the following two conditions are met, the receiver
can detect a change in the original codeword.
1. The receiver has (or can find) a list of valid
codewords.
2. The original codeword has changed to an invalid
one.
■ The receiver knows an error occurred but does not
know which bit(s) is(are) in error.
■ Has less overhead than error correction.
Process of error detection in block coding

• However, if the codeword is corrupted during transmission but the


received word still matches a valid codeword, the error remains
undetected.
• can detect only single errors
Example

Let us assume that k = 2 and n = 3. The table shows the


list of data words and codewords.
Example (continued)

Assume the sender encodes the dataword 01 as 011 and


sends it to the receiver. Consider the following cases:

1. The receiver receives 011. It is a valid codeword. The


receiver extracts the dataword 01 from it.
2. The codeword is corrupted during transmission, and
111 is received. This is not a valid codeword and is
discarded.
3. The codeword is corrupted during transmission, and
000 is received. This is a valid codeword. The receiver
incorrectly extracts the dataword 00. Two corrupted
bits have made the error undetectable.
Note

An error-detecting code can detect


only the types of errors for which it is
designed; other types of errors may
remain undetected.
Structure of encoder and decoder in error correction
Example

Let us add more redundant bits to previous example to see


if the receiver can correct an error without knowing what
was actually sent. We add 3 redundant bits to the 2-bit
dataword to make 5-bit codewords.
Example(continued)

Assume the dataword is 01. The sender creates the


codeword 01011. The codeword is corrupted during
transmission, and 01001 is received. First, the receiver
finds that the received codeword is not in the table. This
means an error has occurred. The receiver, assuming that
there is only 1 bit corrupted, uses the following strategy to
guess the correct dataword.
Example (continued)
1. Comparing the received codeword with the first
codeword in the table (01001 versus 00000), the
receiver decides that the first codeword is not the one
that was sent because there are two different bits.

2. By the same reasoning, the original codeword cannot


be the third or fourth one in the table.

3. The original codeword must be the second one in the


table because this is the only one that differs from the
received codeword by 1 bit. The receiver replaces
01001 with 01011 and consults the table to find the
dataword 01.
Hamming distance

Note

The Hamming distance between two


words is the number of differences
between corresponding bits.
Example

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


Note

The minimum Hamming distance is the


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

Find the minimum Hamming distance of the coding


scheme in the following table
Example (contd)

Solution
We first find all Hamming distances.

The dmin in this case is 2.


Example

Find the minimum Hamming distance of the coding


scheme in Table
Example

Find the minimum Hamming distance of the coding


scheme in Table

Solution
We first find all the Hamming distances.

The dmin in this case is 3.


Hamming distance for error detection

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.
Example

The minimum Hamming distance for our first code


scheme 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.
Example

Our second block code scheme 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.
Hamming distance for error correction

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.
Example

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.
GATE-2017

Consider a binary code that consists only four valid


codewords as given below.

00000, 01011, 10101, 11110


Let minimum Hamming distance of code be p and
maximum number of erroneous bits that can be
corrected by the code be q. The value of p and q are:
(A) p = 3 and q = 1
(B) p = 3 and q = 2
(C) p = 4 and q = 1
(D) p = 4 and q = 2
LINEAR BLOCK CODES

Almost all block codes used today belong to a subset


called linear block codes. A linear block code is a code
in which the exclusive OR (addition modulo-2) of two
valid codewords creates another valid codeword.
Example

The scheme in Table is a linear block code


because the result of XORing any codeword with any
other codeword is a valid codeword. For example, the
XORing of the second and third codewords creates the
fourth one.
Linear Block Codes- Simple parity check

Note

A simple parity-check code is a


single-bit error-detecting
code in which
n = k + 1 with dmin = 2.(k is size of
dataword and n is the size of code word)
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)
Simple parity-check code C(5, 4)
Encoder and decoder for simple parity-check code
Encoder and decoder for simple parity-check code
• Encoder uses a generator that takes a copy of a 4-bit
dataword and generates a parity bit
• Parity bit is generated by adding the 4 bits of the
dataword .
• If the number of 1s is even, the result is 0; if the number of
1s is odd, the result is 1. In both cases, the total number of
1s in the codeword is even
• Receiver receives a 5-bit word
• The checker performs addition over all 5 bits and the
result is called syndrome.
• The syndrome is 0 when the number of 1s in the received
codeword is even; otherwise, it is 1.
• Syndrome is passed to the decision logic analyzer. If the
syndrome is 0, there is no error and the data portion of the
received codeword is accepted as the dataword
Example

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 . 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.
Example (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.
Note

A simple parity-check code can detect an


odd number of errors.
Two-dimensional parity-check code
Two-dimensional parity-check code
Two-dimensional parity-check code
Hamming Code

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.
n = 2r -1
and n=k+r
The structure of the encoder and decoder for a Hamming code
Calculating the parity bits at the transmitter

Modulo 2 arithmetic:

r0 = a 2 + a 1 + a 0
r1 = a 3 + a 2 + a 1
r2 = a 1 + a 0 + a 3
Calculating the syndrome at the receiver:

s0 = b2 + b1 + b0 +q0
s1 = b3 + b2 + b1 + q1
s2 = b1 + b0 + b3+ q2
Hamming code C(7, 4) - n=7, k = 4
Logical decision made by the correction logic analyzer
Example
Let us trace the path of three datawords from the sender to
the destination:
1. The dataword 0100 becomes the codeword 0100011.
The codeword 0100011 is received. The syndrome is
000, the final dataword is 0100.
2. The dataword 0111 becomes the codeword 0111001.
The received codeword is: 0011001. The syndrome is
011. After flipping b2 (changing the 1 to 0), the final
dataword is 0111.
3. The dataword 1101 becomes the codeword 1101000.
The codeword 0001000 is received (two errors).The
syndrome is 101. After flipping b0, we get 0000,
the wrong dataword. This shows that our code cannot
correct two errors.
Example

We need a dataword of at least 7 bits. Calculate values of k


and n that satisfy this requirement.
Solution
1. If we set r = 3, the result is n = 23 − 1=7 and k = 7 − 3,
or 4, which is < 7.
2. If we set r = 4, then n = 24 − 1 = 15 and k = 15 − 4 =
11, which satisfies the condition k>7. So the code is

C(15, 11)
Hamming Code for Burst Errors
■ Split a burst error between several codewords, one
error for each codeword
■ For a burst error of size N, make N codewords out
of our frame.
■ Then, arrange the codewords in a table and send
the bits in the table, a column at a time.
■ In each column, the bits are sent from the bottom
to the top.
■ When a burst error of size 4 corrupts the frame,
only 1 bit from each codeword is corrupted.
■ The corrupted bit in each codeword can then
easily be corrected at the receiver
Burst error correction using Hamming code
CYCLIC CODES

Cyclic codes are special linear block codes with one


extra property. In a cyclic code, if a codeword is
cyclically shifted (rotated), the result is another
codeword.

eg:- if 1011000 is a codeword and we cyclically


left-shift, then 0110001 is also a codeword
Cyclic Redundancy Check(CRC) encoder and decoder
Cyclic Redundancy Check(CRC) encoder and decoder
• In the encoder, the dataword has k bits (4 here); the
codeword has n bits (7 here).
• The size of the dataword is augmented by adding n - k (3
here) 0s to the right-hand side of the word.
• The generator uses a divisor of size n - k + 1 (4 here),
predefined and agreed upon.
• The generator divides the augmented dataword by the
divisor (modulo-2 division).
• The remainder is appended to the dataword to create the
codeword.
• At the decoder, checker divides the codeword by the same
divisor and generates the syndrome. If the syndrome is
000(3 here), then dataword is accepted
Division in CRC encoder
Division in the CRC decoder for two cases
Using Polynomials for CRC

■ We can use a polynomial to represent a binary


word.
■ Each bit from right to left is mapped onto a power
term.
■ The rightmost bit represents the “0” power term.
The bit next to it the “1” power term, etc.
■ If the bit is of value zero, the power term is
deleted from the expression.
A polynomial to represent a binary word
CRC division using polynomials
Previous GATE question( 2017 GATE)

The message 11001001 is to be transmitted using the CRC


polynomial x^3 + 1 to protect it from errors. The message that should
be transmitted is:

A. 11001001000

B. 11001001011

C. 11001010

D. 110010010011
Note

The divisor in a cyclic code is normally


called the generator polynomial
or simply the generator.
Note

In a cyclic code,
If s(x) ≠ 0, one or more bits is corrupted.
If s(x) = 0, either
a. No bit is corrupted. or
b. Some bits are corrupted, but the
decoder failed to detect them.
Note

In a cyclic code, those e(x) errors that


are divisible by g(x) are not caught.
Received codeword (c(x) + e(x))/g(x) =
c(x)/g(x) + e(x)/g(x)
The first part is by definition divisible the
second part will determine the error. If
“0” conclusion -> no error occurred.
Note: that could mean that an error went
undetected.
Single-bit error

Note

If the generator has more than one term


and the coefficient of x0 is 1,
all single errors can be caught.
Example

Which of the following g(x) values guarantees that a


single-bit error is caught? For each case, what is the error
that cannot be caught?
a. x + 1 b. x3 c. 1
Solution
a. No xi can be divisible by x + 1. Any single-bit error can
be caught.
b. If i is equal to or greater than 3, xi is divisible by g(x).
All single-bit errors in positions 1 to 3 are caught.
c. All values of i make xi divisible by g(x). No single-bit
error can be caught. This g(x) is useless.
Representation of two isolated single-bit errors
using polynomials
Two Isolated Single-Bit Errors

Note

If a generator cannot divide xt + 1


(t between 2 and n – 1),
then all isolated double errors
can be detected.
Example

Find the status of the following generators related to two


isolated, single-bit errors.
a. x + 1 b. x7 + x6 + 1
Solution
a.This is a very poor choice for a generator.
b.This is a good choice for this purpose.
Odd Numbers of Errors

Note

A generator that contains a factor of


x + 1 can detect all odd-numbered errors.

Eg:- x4 + x2 + x + 1 can catch all odd-numbered errors


since it can be written as a product of the two
polynomials x + 1 and x3 + x2 + 1
Burst Errors

Note

❏ All burst errors with L ≤ r will be


detected.
❏ All burst errors with L = r + 1 will be
detected with probability 1 – (1/2)r–1.
❏ All burst errors with L > r + 1 will be
detected with probability 1 – (1/2)r.

L- length of burst error


r- number of check bits
Example

Find the suitability of the x6 + 1 in relation to burst errors


of different lengths.
Solution
a.This generator can detect all burst errors with a length
less than or equal to 6 bits;
b.L = r + 1 , L=6+1
Probability= 1 – (1/2)r–1
Probability= 1- (0.5)^5=0.96875
97% of burst errors with length 7 can be detected
c. L > r + 1 , L>7
Probability= 1 – (1/2)r
Probability= 1- (0.5)^6=0.9843
98.4% of burst errors with length greater than 7 can be
detected
Criteria for a good polynomial generator

Note

A good polynomial generator needs to


have the following characteristics:
1. It should have at least two terms.
2. The coefficient of the term x0 should
be 1.
3. It should not divide xt + 1, for t
between 2 and n − 1.
4. It should have the factor x + 1.
Standard polynomials
CHECKSUM

The checksum is used in the Internet by several


protocols although not at the data link layer.
Concept of checksum-Example

Suppose our data is a list of five 4-bit numbers that we


want to send to a destination. In addition to sending these
numbers, we send the sum of the numbers. For example, if
the set of numbers is (7, 11, 12, 0, 6), we send (7, 11, 12, 0,
6, 36), where 36 is the sum of the original numbers. The
receiver adds the five numbers and compares the result
with the sum. If the two are the same, the receiver assumes
no error, accepts the five numbers, and discards the sum.
Otherwise, there is an error somewhere and the data are
not accepted.
Concept of checksum-Example(contd)

We can make the job of the receiver easier if we send the


negative (complement) of the sum, called the checksum.
In this case, we send (7, 11, 12, 0, 6, −36). The receiver
can add all the numbers received (including the
checksum). If the result is 0, it assumes no error;
otherwise, there is an error.
One's Complement

• The previous example has one major drawback. All of


our data can be written as a 4-bit word (they are less than
15) except for the checksum
• Solution is to use one's complement arithmetic
• We can represent unsigned numbers between 0 and 2^n -
1 using only n bits. If the number has more than n bits,
the extra leftmost bits need to be added to the n
rightmost bits (wrapping)
Example

How can we represent the number 21 in one’s


complement arithmetic using only four bits?

Solution
The number 21 in binary is 10101 (it needs five bits). We
can wrap the leftmost bit and add it to the four rightmost
bits. We have (0101 + 1) = 0110 or 6.
Example

How can we represent the number −6 in one’s


complement arithmetic using only four bits?

Solution
In one’s complement arithmetic, the negative or
complement of a number is found by inverting all bits.
Positive 6 is 0110; negative 6 is 1001. If we consider only
unsigned numbers, this is 9. In other words, the
complement of 6 is 9.
Figure : Example
Example

The sender initializes the checksum to 0 and adds all data


items and the checksum (the checksum is considered as
one data item and is shown in color). The result is 36.
However, 36 cannot be expressed in 4 bits. The extra two
bits are wrapped and added with the sum to create the
wrapped sum value 6. The sum is then complemented,
resulting in the checksum value 9 .The sender now sends
six data items to the receiver including the checksum 9.
Example (continued)

The receiver adds all data items (including the


checksum); the result is 45. The sum is wrapped and
becomes 15. The wrapped sum is complemented and
becomes 0. Since the value of the checksum is 0, this
means that the data is not corrupted. The receiver drops
the checksum and keeps the other data items. If the
checksum is not zero, the entire packet is dropped.
Internet Checksum

Note

Sender site:
1. The message is divided into 16-bit words.
2. The value of the checksum word is set to 0.
3. All words including the checksum are
added using one’s complement addition.
4. The sum is complemented and becomes the
checksum.
5. The checksum is sent with the data.
Internet Checksum

Note

Receiver site:
1. The message (including checksum) is
divided into 16-bit words.
2. All words are added using one’s
complement addition.
3. The sum is complemented and becomes the
new checksum.
4. If the value of checksum is 0, the message
is accepted; otherwise, it is rejected.
Example

Let us calculate the checksum for a text of 8 characters


(“Forouzan”). The text needs to be divided into 2-byte
(16-bit) words. We use ASCII (see Appendix A, page no:
1032 onwards) to change each byte to a 2-digit
hexadecimal number. For example, F is represented as
0x46 and o is represented as 0x6F. The following figure
shows how the checksum is calculated at the sender and
receiver sites. In part a of the figure, the value of partial
sum for the first column is 0x36. We keep the rightmost
digit (6) and insert the leftmost digit (3) as the carry in the
second column. The process is repeated for each column.
Note that if there is any corruption, the checksum
recalculated by the receiver is not all 0s.
Figure : Example
Performance of Check Sum
• It is not as strong as the CRC in error-checking
capability.
• For example, if the value of one word is incremented
and the value of another word is decremented by the
same amount, the two errors cannot be detected because
the sum and checksum remain the same.
• Also if the values of several words are incremented but
the total change is a multiple of 65535, the sum and the
checksum does not change, which means the errors are
not detected
• The tendency in the Internet is to replace the checksum
with a CRC
Chapter 11
Data Link Control
FRAMING

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


that each frame is distinguishable from another.
Framing in the data link layer separates a message
from one source to a destination, or from other
messages to other destinations, by adding a sender
address and a destination address
Framing(cont.)

• Frames can be of fixed or variable size.


• In fixed-size framing, there is no need for defining
the boundaries of the frames; the size itself can be
used as a delimiter . Example is framing in ATM
wide-area network
• In variable-size framing, we need a way to define the
end of the frame and the beginning of the next. Used
in LANs.
A frame in a character-oriented protocol

• Data to be carried are 8-bit characters from a coding system


such as ASCII
• The header, which normally carries the source and destination
addresses and other control information, and the trailer, which
carries error detection or error correction redundant bits, are
also multiples of 8 bits
• To separate one frame from the next, an 8-bit (I-byte) flag is
Byte stuffing and unstuffing
Byte stuffing and unstuffing
• In byte stuffing (or character stuffing), a special byte is
added to the data section of the frame when there is a
character with the same pattern as the flag.
• The data section is stuffed with an extra byte. This byte
is usually called the escape character (ESC), which has
a predefined bit pattern.
• Whenever the receiver encounters the ESC character, it
removes it from the data section and treats the next
character as data, not a delimiting flag
Note

Byte stuffing is the process of adding 1


extra byte whenever there is a flag or
escape character in the text.
A frame in a bit-oriented protocol

Most protocols use a special 8-bit pattern flag 01111110 as


the delimiter to define the beginning and the end of the frame
Bit stuffing and unstuffing
Note

Bit stuffing is the process of adding one


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

The most important responsibilities of the data link


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

Flow control refers to a set of procedures


used to restrict the amount of data
that the sender can send before
waiting for acknowledgment.
Note

Error control in the data link layer is


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

Now let us see how the data link layer can combine
framing, flow control, and error control to achieve the
delivery of data from one node to another. The
protocols are normally implemented in software by
using one of the common programming languages. To
make our discussions language-free, we have written
in pseudocode a version of each protocol that
concentrates mostly on the procedure instead of
delving into the details of language rules.
Taxonomy of protocols
NOISELESS CHANNELS

Let us first assume we have an ideal channel in which


no frames are lost, duplicated, or corrupted. We
introduce two protocols for this type of channel.
The design of the simplest protocol with no flow or
error control
Algorithm: Sender-site algorithm for the simplest protocol
Algorithm: Receiver-site algorithm for the simplest protocol
Example

The Figure in the next slide shows an example of


communication using this protocol. It is very simple. The
sender sends a sequence of frames without even thinking
about the receiver. To send three frames, three events
occur at the sender site and three events at the receiver
site. Note that the data frames are shown by tilted boxes;
the height of the box defines the transmission time
difference between the first bit and the last bit in the
frame.
Flow diagram for Example
Design of Stop-and-Wait Protocol
Algorithm: Sender-site algorithm for Stop-and-Wait Protocol
Algorithm: Receiver-site algorithm for Stop-and-Wait Protocol
Example

The figure in the following slides shows an example of


communication using this protocol. It is still very simple.
The sender sends one frame and waits for feedback from
the receiver. When the ACK arrives, the sender sends the
next frame. Note that sending two frames in the protocol
involves the sender in four events and the receiver in two
events.
Flow diagram for Example
NOISY CHANNELS

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


of how to add flow control to its predecessor, noiseless
channels are nonexistent. We discuss three protocols
in this section that use error control.
Stop and Wait
ARQ
• To detect and correct corrupted frames, we need to add
redundancy bits to our data frame. When the frame arrives at
the receiver site, it is checked and if it is corrupted, it is silently
discarded. The detection of errors in this protocol is manifested
by the silence of the receiver.
• To identify lost frames the solution is to number the frames.
When the receiver receives a data frame that is out of order, this
means that frames were either lost or duplicated.
Note

Error correction in Stop-and-Wait ARQ is


done by keeping a copy of the sent
frame and retransmitting of the frame
when the timer expires.
Note

In Stop-and-Wait ARQ, we use sequence


numbers to number the frames.
The sequence numbers are based on
modulo-2 arithmetic.
Note

In Stop-and-Wait ARQ, the


acknowledgment number always
announces in modulo-2 arithmetic the
sequence number of the next frame
expected.
Design of the Stop-and-Wait ARQ Protocol
Algorithm: Sender-site algorithm for Stop-and-Wait ARQ

(continued
)
Algorithm: Sender-site algorithm for Stop-and-Wait ARQ
(continued)
Algorithm: Receiver-site algorithm for Stop-and-Wait ARQ Protocol
Example

The Figure in the following slide shows an example of


Stop-and-Wait ARQ. Frame 0 is sent and acknowledged.
Frame 1 is lost and resent after the time-out. The resent
frame 1 is acknowledged and the timer stops. Frame 0 is
sent and acknowledged, but the acknowledgment is lost.
The sender has no idea if the frame or the
acknowledgment is lost, so after the time-out, it resends
frame 0, which is acknowledged.
Figure: Flow diagram for Example
Example

Assume that, in a Stop-and-Wait ARQ system, the


bandwidth of the line is 1 Mbps, and 1 bit takes 20 ms to
make a round trip. What is the bandwidth-delay product?
If the system data frames are 1000 bits in length, what is
the utilization percentage of the link?

Solution
The bandwidth-delay product is
Example (continued)

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

What is the utilization percentage of the link in the


previous example, if we have a protocol that can send
up to 15 frames before stopping and worrying about
the acknowledgments?

Solution
The bandwidth-delay product is still 20,000 bits. The
system can send up to 15 frames or 15,000 bits during a
round trip. This means the utilization is 15,000/20,000, or
75 percent. Of course, if there are damaged frames, the
utilization percentage is much less because frames have
to be resent.
Link Utilization / Efficiency of Stop and Wait ARQ

Efficiency (η) = 1 / (1+2a)


where,
a = Tp / Tt

Example: If the bandwidth of the line is 1.5 Mbps,


Propagation delay is 22.5 ms and packet size is 1 KB, then
find the link utilization in stop and wait.
Solution:
Transmission delay (Tt) = Frame size / Bandwidth
Link Utilization / Efficiency of Stop and WaitARQ

a = Tp / Tt
a = 22.5 / 5.461 = 4.12
Efficiency, η = 1 / (1+2a)
= 1 / (1 + 2 x 4.12) = 0.108 or 10.8%
Note

In the Go-Back-N Protocol, the sequence


numbers are modulo 2m,
where m is the size of the sequence
number field in bits.
Sliding Window
• Sliding window is an abstract concept that
defines the range of sequence numbers that is
the concern of the sender and receiver
• The range which is the concern of the sender is
called the send sliding window; the range that is
the concern of the receiver is called the receive
sliding window.
• Maximum size is 2m − 1
Send window for Go-Back-N ARQ
Note

The send window is an abstract concept


defining an imaginary box of size 2m − 1
with three variables: Sf, Sn, and Ssize.
Note

The send window can slide one


or more slots when a valid
acknowledgment arrives.
Receive window for Go-Back-N ARQ
Note

The receive window is an abstract


concept defining an imaginary box
of size 1 with one single variable Rn.
The window slides
when a correct frame has arrived;
sliding occurs one slot at a time.
Figure: Design of Go-Back-N ARQ
Figure : Window size for Go-Back-N ARQ
Note

In Go-Back-N ARQ, the size of the send


window must be less than 2m;
the size of the receiver window
is always 1.
Algorithm: Go-Back-N sender algorithm

(continued
Algorithm: Go-Back-N sender algorithm
(continued
)
Algorithm: Go-Back-N receiver algorithm
Example
Following Figure shows an example of Go-Back-N. This
is an example of a case where the forward channel is
reliable, but the reverse is not. No data frames are lost,
but some ACKs are delayed and one is lost. The example
also shows how cumulative acknowledgments can help if
acknowledgments are delayed or lost. After initialization,
there are seven sender events. Request events are
triggered by data from the network layer; arrival events
are triggered by acknowledgments from the physical
layer. There is no time-out event here because all
outstanding frames are acknowledged before the timer
expires. Note that although ACK 2 is lost, ACK 3 serves
as both ACK 2 and ACK 3.
Figure: Flow diagram for Example
Example

Following figure shows what happens when a frame is


lost. Frames 0, 1, 2, and 3 are sent. However, frame 1 is
lost. The receiver receives frames 2 and 3, but they are
discarded because they are received out of order. The
sender receives no acknowledgment about frames 1, 2, or
3. Its timer finally expires. The sender sends all
outstanding frames (1, 2, and 3) because it does not know
what is wrong. Note that the resending of frames 1, 2, and
3 is the response to one single event. When the sender is
responding to this event, it cannot accept the triggering of
other events. This means that when ACK 2 arrives, the
sender is still busy with sending frame 3.
Example (continued)

The physical layer must wait until this event is completed


and the data link layer goes back to its sleeping state. We
have shown a vertical line to indicate the delay. It is the
same story with ACK 3; but when ACK 3 arrives, the
sender is busy responding to ACK 2. It happens again
when ACK 4 arrives. Note that before the second timer
expires, all outstanding frames have been sent and the
timer is stopped.
Figure: Flow diagram for Example
Note

Stop-and-Wait ARQ is a special case of


Go-Back-N ARQ in which the size of the
send window is 1.
Link Utilization / Efficiency of Go Back N ARQ

Efficiency (η) = N / (1+2a)


where,
N is the window size
a = Tp / Tt

Example: A 20 Kbps satellite link has a propagation delay of


400 ms. The transmitter employs the “go back n ARQ”
scheme with N set to 10. Assuming that each frame is 100
bytes long, what is the maximum data rate possible?
Link Utilization / Efficiency of Go Back N ARQ

Solution:
Transmission delay (Tt) = Frame size / Bandwidth
= 100 bytes / 20 Kbps=40 ms

Propagation delay = 400 ms


a = Tp / Tt
a = 400 / 40 = 10
Efficiency, η = N / (1+2a)
= 10 / (1 + 2 x 10) = 0.476 or 47.6%
Selective Repeat ARQ
• Go-Back-N ARQ is very inefficient for a noisy link.
In a noisy link a frame has a higher probability of
damage, which means the resending of multiple
frames.
• Resending uses up the bandwidth and slows down
the transmission.
• When just one frame is damaged; only the damaged
frame is resent. This mechanism is called Selective
Figure: Send window for Selective Repeat ARQ
Figure : Receive window for Selective Repeat ARQ
Figure: Design of Selective Repeat ARQ
Figure: Selective Repeat ARQ, window size
Note

In Selective Repeat ARQ, the size of the


sender and receiver window
must be at most one-half of 2m.
Algorithm: Sender-site Selective Repeat algorithm

(continued
)
Algorithm: Sender-site Selective Repeat algorithm
(continued
)

(continued
Algorithm: Sender-site Selective Repeat (continued
algorithm
)
Algorithm: Receiver-site Selective Repeat algorithm
Algorithm:Receiver-site Selective Repeat algorithm
Figure: Delivery of data in Selective Repeat ARQ
Example

We show how Selective Repeat behaves in the case 1


frame is lost. Figure in the following slide shows the
situation. One main difference is the number of timers.
Here, each frame sent or resent needs a timer, which
means that the timers need to be numbered (0, 1, 2, and
3). The timer for frame 0 starts at the first request, but
stops when the ACK for this frame arrives. The timer for
frame 1 starts at the second request, restarts when a NAK
arrives, and finally stops when the last ACK arrives. The
other two timers start when the corresponding frames are
sent and stop at the last arrival event.
Example (continued)

At the receiver site we need to distinguish between the


acceptance of a frame and its delivery to the network
layer. At the second arrival, frame 2 arrives and is stored
and marked, but it cannot be delivered because frame 1 is
missing. At the next arrival, frame 3 arrives and is
marked and stored, but still none of the frames can be
delivered. Only at the last arrival, when finally a copy of
frame 1 arrives, can frames 1, 2, and 3 be delivered to the
network layer. There are two conditions for the delivery of
frames to the network layer: First, a set of consecutive
frames must have arrived. Second, the set starts from the
beginning of the window.
Example (continued)

Another important point is that a NAK is sent after the


second arrival, but not after the third, although both
situations look the same. The reason is that the protocol
does not want to crowd the network with unnecessary
NAKs and unnecessary resent frames. The second NAK
would still be NAK1 to inform the sender to resend frame
1 again; this has already been done. The first NAK sent is
remembered (using the nakSent variable) and is not sent
again until the frame slides. A NAK is sent once for each
window position and defines the first slot in the window.
Example (continued)

The next point is about the ACKs. Notice that only two
ACKs are sent here. The first one acknowledges only the
first frame; the second one acknowledges three frames. In
Selective Repeat, ACKs are sent when data are delivered to
the network layer. If the data belonging to n frames are
delivered in one shot, only one ACK is sent for all of them.
Figure: Flow diagram for Example
Piggybacking
• In real life, data frames are normally flowing in
both directions
• A technique called piggybacking is used to
improve the efficiency of the bidirectional
protocols
• When a frame is carrying data from A to B, it can
also carry control information about arrived (or
lost) frames from B; when a frame is carrying
data from B to A, it can also carry control
information about the arrived (or lost) frames
from A.
Figure: Design of piggybacking in Go-Back-N ARQ
Link Utilization / Selective Repeat ARQ

Efficiency (η) = N / (1+2a)


where,
N is the window size
a = Tp / Tt
What is Data Compression?

Data compression is the representation of an information source


(e.g. a data file, a speech signal, an image, or a video signal) as
accurately
as possible using the fewest number of bits.

Compressed data can only be understood if the decoding method is


known by the receiver.
Why Data Compression?
• Data storage and transmission cost money. This cost increases with the
amount of data available.

• This cost can be reduced by processing the data so


that it takes less memory and less transmission time.

• Some data types consist of many chunks of repeated data (e.g. multimedia
data such as audio, video, images, …)

• Such “raw” data can be transformed into a


compressed data representation form saving a lot
of storage and transmission costs.

• Disadvantage of Data compression:


Compressed data must be decompressed to be viewed (or heard), thus extra
processing is required.
Lossless and Lossy Compression Techniques
• Data compression techniques are broadly classified into lossless and lossy.

• Lossless techniques enable exact reconstruction of the original document from the
compressed information.

• Exploit redundancy in data


• Applied to general data
• Examples: Run-length, Huffman and LZW

• Lossy compression - reduces a file by permanently eliminating certain redundant


information

• Exploit redundancy and human perception


• Applied to audio, image, and video
• Examples: JPEG and MPEG

• Lossy techniques usually achieve higher compression rates than lossless ones but
Classification of Lossless Compression Techniques
• Lossless techniques are classified into static, adaptive (or dynamic), and hybrid.
• In a static method the mapping from the set of messages to the set of codewords is fixed
before transmission begins, so that a given message is represented by the same codeword
every time it appears in the message being encoded.

• Static coding requires two passes: one pass to compute probabilities (or frequencies)
and determine the mapping, and a second pass to encode.
• Examples: Static Huffman Coding

• In an adaptive method the mapping from the set of messages to the set of codewords
changes over time.

• All of the adaptive methods are one-pass methods; only one scan of the message is
required.
• Examples: LZW, and Adaptive Huffman Coding

• An algorithm may also be a hybrid, neither completely static nor completely dynamic.
Run-length encoding
The following string:
BBBBHHDDXXXXKKKKWWZZZZ

can be encoded more compactly by replacing each repeated string of characters by a single instance
of the repeated character and a number that represents the number of times it is repeated:

B4H2D2X4K4W2Z4

Here "B4" means four B's, and “H2” means two H's, etc. Compressing a string in this way is called
run-length encoding.

B0 = # bits required before compression

B1 = # bits required after compression

Compression Ratio = B0 / B1.


Run-length
encoding
As another example, consider the storage of a rectangular image. As a single color bitmapped
image, it can be stored as:

The rectangular image can be compressed with run-length encoding by counting identical
bits as follows:
0, 40
0, 40 The first line says that the first line of the bitmap consists of 40 0's.
The third line says that the third line of the bitmap consists of 10 0's
0,10 1,20 0,10 followed by 20 1's followed by 10 more 0's, and so on for the other

0,10 1,1 0,18 1,1 lines


Run-length encoding

This compression technique is most useful where symbols appear in long


runs, and thus can sometimes be useful for images that have areas where
the pixels all have the same value, cartoons for example
Relative encoding
• Relative encoding is a transmission technique that attempts to improve
efficiency by transmitting the difference between each value and its
predecessor, in place of the value itself .
• Eg:-15106433003 would be transmitted as 1+4-4-1+6-2-1+0-3+0+3.
• In effect the transmitter is predicting that each value is the same as its
predecessor and the data transmitted is the difference between the
predicted and actual values.
• Differential Pulse Code Modulation (DPCM)
is an example of relative encoding.
Huffman coding

■ a variable-length code is assigned to input


different characters
■ Most frequent characters have the smallest
codes
■ least frequent characters have longer codes
■ In the first pass create a Huffman tree, and in
the second pass traverse the tree to find
codes.
Huffman coding- Building Huffman
Tree
1. Create a leaf node for each unique character and
build a min heap of all leaf nodes
2. Extract two nodes with the minimum frequency
from the min heap
3. Create a new internal node with a frequency equal
to the sum of the two nodes frequencies. Make the
first extracted node as its left child and the other
extracted node as its right child. Add this node to the
min heap
4. Repeat steps#2 and #3 until the heap contains only
one node. The remaining node is the root node and
the tree is complete.
Huffman coding- Example

Message : 100 character string with the frequencies of


each character given below

character Frequency
a 5
b 9
c 12
d 13
e 16
f 45
Huffman coding- Example(contd.)
Extract two minimum frequency nodes from min
heap. Add a new internal node with frequency 5 + 9 =
14.

character Frequency
c 12
d 13
Internal Node 14
e 16
f 45
Huffman coding- Example(contd.)
Extract two minimum frequency nodes from heap.
Add a new internal node with frequency 12 + 13 = 25

character Frequency
Internal Node 14
e 16
Internal Node 25
f 45
Huffman coding- Example(contd.)
Extract two minimum frequency nodes. Add a new
internal node with frequency 14 + 16 = 30

character Frequency
Internal Node 25
Internal Node 30
f 45
Huffman coding- Example(contd.)
Extract two minimum frequency nodes. Add a new internal
node with frequency 25 + 30 = 55

character Frequency
f 45
Huffman coding- Example(contd.)
Extract two minimum frequency nodes. Add a new
internal node with frequency 45 + 55 = 100

character Frequency
Internal Node 100
Huffman coding- Generating the
code
Traverse the tree formed starting from the root. While
moving to the left child, write 0 . While moving to the
right child, write 1
Huffman coding- Generating the
codes
character code-word
f 0
e 111
d 101
c 100
b 1101
a 1100
LZW (Lempel–Ziv–Welch)
•It is lossless, meaning no data is lost when
compressing
•is typically used in GIF and Unix file compression
utility compress
•works by reading a sequence of symbols, grouping
the symbols into strings, and converting the strings
into codes
•The strings are replaced by their corresponding
codes and so the input file is compressed.
•The efficiency of the algorithm increases as the
number of long, repetitive words in the input data
increases.
LZW ENCODING
1 Initialize table with single character strings
2 P = first input character
3 WHILE not end of input stream
4 C = next input character
5 IF P + C is in the string table
6 P=P+C
7 ELSE
8 output the code for P
9 add P + C to the string table
10 P=C
11 END WHILE
12 output code for P
LZW Encoding Example
Data word : a b a b a b a b a
Dictionary
1 a
2 b
ababababa

Dictionary
1a Encoded word : 1
2b
3 ab
LZW Encoding Example(cont.)

ababababa

Dictionary
1a Encoded word : 1 2
2b
3 ab
4 ba

ababababa
ab already available in the dictionary, append next character
LZW Encoding Example(cont.)

ababababa
Dictionary
1a Encoded word : 1 2 3
2b
3 ab
4 ba
5 aba
ababababa
ab already available in the dictionary, append next character
ababababa
aba already available in the dictionary, append next character
LZW Encoding Example(cont.)
ababababa
Dictionary
1a Encoded word : 1 2 3 5
2b
3 ab
4 ba
5 aba
6 abab
ababababa
ba already available in the dictionary. Since, end of loop,
output code for ba
Encoded word: 1 2 3 5 4
Image Compression Standards
Image Compression Standards
•Tagged image file format (TIFF) : used widely in
printing business as photograph file standard and not
used in browsers
•Portable network graphics (PNG) :created as an
open-source alternative to GIF. Designed to transfer
images over the internet.
•Joint Photographic Experts Group (JPEG): working
group which creates the standard for still image
compression.
•JPEG 2000 : image compression standard compatible
with multimedia technologies with the features such as
superior bit rate performance progressive transmission
by pixel and by accuracy, coding of interested region,
and not error prone to bit errors
JPEG vs JPEG 2000

JPEG JPEG2000
Created for natural images Created for computer generated images
Discrete Cosine Transform Discrete Wavelet Transform
Video Compression Standards
Standard Application
H.261 Video conferencing over ISDN
MPEG-1 Video on digital storage media
(CD-ROM)

MPEG-2 Digital Television


H.263 Video telephony over PSTN
MPEG-4 Object-based coding, synthetic
content, interactivity

H.264/ MPEG-4 AVC Improved video compression


NETWORK TOPOLOGIES

The physical topology of a network refers to the


configuration of cables, computers, and other
peripherals.
Bus
• Topology
Each machine is connected to a single cable through some kind
of connector.
• A signal from the source travels in both directions to all
machines connected on the bus cable until it finds the address on
the network that is the intended recipient.
• If the machine address does not match the intended address for
the data, the machine ignores the data.
• Alternatively, if the data does match the machine address, the
data is accepted
Bus
Topology
Star
Topology
• Each machine is connected to a central hub or switch.

• It allows each machine on the network to have a point to


point connection to the central hub.

• All of the traffic which transverses the network passes


through the central hub.

• The hub acts as a signal booster or repeater which in turn


allows the signal to travel greater distances.

• Most widely implemented

• Hub is the single point of failure


Star
Topology
Star
Topology
Advantages Disadvantages

Easily expanded without disruption Requires more cable


to the network

Cable failure affects only a single A central connecting device allows


user for a single point of failure

Easy to troubleshoot and isolate More expensive than bus


problems. topologies because of the cost of
the hubs
Ring Topology
• Each computer is connected to the network in a closed loop or
ring

• Each machine or computer has a unique address that is used for


identification purposes

• The signal passes through each machine or computer connected


to the ring in one direction

• Ring topologies typically utilize a token passing scheme, used


to control access to the network

• By utilizing this scheme, only one machine can transmit on the


network at a time
Ring Topology
Ring Topology
Mesh Topology

• In a mesh network each station is connected directly


to every other station in the network.
• It is a viable solution only for smaller networks.
• The huge cabling cost and awkwardness of laying so
many direct links make the mesh topology
unattractive for LAN’s with a large number of
stations.
• On the other hand since all stations are directly
linked to all other stations on exclusive links, this
topology allows simultaneous communications
between a number of pairs of stations.
Mesh Topology
Tree
•A Topology
collection of busses connected by a
branching cable with no closed loops
• Allows users to create networks using bridges
• Message from any site can be received by all
other sites, until it reaches an end point
• End point controller absorbs a message if it
reaches end point controller without being
accepted by a host
• Advantage: Message traffic can still flow
through the network even if a single node fails
Tree
Topology
Hybrid Topology

Selects among the strong points of each topology and


combines them to meet that system’s communications
requirements most effectively

Figure: Hybrid topology combining a star and a ring


using a bridge
Hybrid Topology

Figure: Hybrid topology combining a star and a bus


CONNECTING DEVICES

In this section, we divide connecting devices into five


different categories based on the layer in which they
operate in a network.
Five categories of connecting devices
Five categories of connecting devices

1.Those which operate below the physical layer such as a


passive hub.
2. Those which operate at the physical layer (a repeater
or an active hub).
3. Those which operate at the physical and data link
layers (a bridge or a two-layer switch).
4. Those which operate at the physical, data link, and
network layers (a router or a three-layer switch).
5. Those which can operate at all five layers (a gateway).
Passive Hub and Repeater
Passive Hub : A passive hub is just a connector. It
connects the wires coming from different branches. This
type of a hub is part of the media.

Repeater : A repeater receives a signal and, before it


becomes too weak or corrupted, regenerates the original
bit pattern. The repeater then sends the refreshed signal.
A repeater can extend the physical length of a LAN
A repeater connecting two segments of a LAN

Repeater connects two segments of the same LAN. The segments


connected are still part of one single LAN
Note

A repeater connects segments of a LAN.


Note

A repeater forwards every frame;


it has no filtering capability.
Note

A repeater is a regenerator,
not an amplifier.

An amplifier cannot discriminate between the intended


signal and noise; it amplifies equally everything fed
into it.
When repeater receives a weakened or corrupted
signal, it creates a copy, bit for bit, at the original
strength
Function of a repeater
Active Hub and Bridge

Active Hub : It is a multipart repeater. It is normally


used to create connections between stations in a physical
star topology. hubs can also be used to create multiple
levels of hierarchy

Bridge: As a physical layer device, it regenerates the


signal it receives. As a data link layer device, the bridge
can check the physical (MAC) addresses (source and
destination) contained in the frame
A hierarchy of hubs
Note

A bridge has a table used in


filtering decisions.
A bridge connecting two LANs
Note

A bridge does not change the physical


(MAC) addresses in a frame.
Transparent Bridge
• A transparent bridge is a bridge in which the stations
are completely unaware of the bridge's existence. If a
bridge is added or deleted from the system,
reconfiguration of the stations is unnecessary
• According to the IEEE 802.1 d specification, a system
equipped with transparent bridges must meet three
criteria:
1. Frames must be forwarded from one station to another.
2. The forwarding table is automatically made by learning
frame movements in the network.
3. Loops in the system must be prevented.
Learning bridge and the process of learning
• The earliest bridges had forwarding tables that
were static. The system administrator would
manually enter each table entry during bridge
setup.
• To make a table dynamic, we need a bridge that
gradually learns from the frame movements.
• The bridge inspects both the destination and the
source addresses.
• The destination address is used for the
forwarding decision (table lookup); the source
address is used for adding entries to the table and
for updating purposes
A learning bridge and the process of learning
Loop problem in a learning bridge

• Transparent bridges work fine as long as


there are no redundant bridges in the system.
• Systems administrators, however, like to have
redundant bridges (more than one bridge
between a pair of LANs) to make the system
more reliable.
• If a bridge fails, another bridge takes over
until the failed one is repaired or replaced.
• Redundancy can create loops in the system,
which is very undesirable
Loop problem in a learning bridge
Solution to Loop Problem

1) IEEE specification requires that bridges use the


spanning tree algorithm to create a loopless
topology.
2) Another way is to use source routing bridges. In
source routing, a sending station defines the bridges
that the frame must visit. The addresses of these
bridges are included in the frame. The frame
contains not only the source and destination
addresses, but also the addresses of all bridges to be
visited. The source gets these bridge addresses
through the exchange of special frames with the
destination prior to sending the data frame
Two-Layer Switches
• Two-layer switch performs at the physical and data
link layers
• A two-layer switch is a bridge, a bridge with many
ports and a design that allows better (faster)
performance
• A bridge with many ports may be able to allocate a
unique port to each station, with each station on its
own independent entity
• makes a filtering decision based on the MAC address
of the frame it received
• It can have a buffer to hold the frames for processing.
• It can have a switching factor that forwards the
frames faster.
Routers

• a three-layer device that routes packets based


on their logical addresses
• connects LANs and WANs in the Internet and
has a routing table that is used for making
decisions about the route
• The routing tables are normally dynamic and
are updated using routing protocols
Routers connecting independent LANs and WANs
Three Layer Switches and Gateway

A three-layer switch is a router, but a faster and


more sophisticated. The switching fabric in a
three-layer switch allows faster table lookup and
forwarding
Gateway is normally a computer that operates in
all five layers of the Internet or seven layers of
OSI model. A gateway takes an application
message, reads it, and interprets it. It can be used
as a connecting device between two internetworks
that use different models
Chapter 13
Wired LANs: Ethernet

.
IEEE STANDARDS

In 1985, the Computer Society of the IEEE started a


project, called Project 802, to set standards to enable
intercommunication among equipment from a variety
of manufacturers. Project 802 is a way of specifying
functions of the physical layer and the data link layer
of major LAN protocols.
IEEE standard for LANs
Logical Link Control (LLC)
• LLC provides one single data link control protocol for
all IEEE LANs
• purpose of the LLC is to provide flow and error
control for the upper-layer protocols that actually
demand these services
• Eg:-if a LAN or several LANs are used in an isolated
system, LLC may be needed to provide flow and error
control for the application layer protocols
Media Access Control(MAC)

• MAC sublayer contains a number of distinct


modules; each defines the access method and
the framing format specific to the
corresponding LAN protocol
• Eg:-it defines CSMA/CD as the media access
method for Ethernet LANs and the token
passing method for Token Ring and Token Bus
LANs.
STANDARD ETHERNET

The original Ethernet was created in 1976 at Xerox’s


Palo Alto Research Center (PARC). Since then, it has
gone through four generations.
Ethernet evolution through four generations
802.3 MAC frame
802.3 MAC frame
Preamble: Sequence of alternating 0s and 1s that alerts
the receiving system to the coming frame and enables it
to synchronize its input timing.
Start frame delimiter (SFD) signals the beginning of
the frame. The SFD warns the station or stations that this
is the last chance for synchronization
Destination address (DA) contains the physical address
of the destination station or stations to receive the packet
Source address (SA) contains the physical address of
the sender of the packet
802.3 MAC frame
Length or type: The original Ethernet used this field as
the type field to define the upper-layer protocol using the
MAC frame. The IEEE standard used it as the length
field to define the number of bytes in the data field. Both
uses are common today
Data: This field carries data encapsulated from the
upper-layer protocols
CRC: The last field contains error detection information,
in this case a CRC-32
Minimum and maximum lengths
Note

Frame length:
Minimum: 64 bytes (512 bits)
Maximum: 1518 bytes (12,144 bits)
Example of an Ethernet address in hexadecimal notation
Unicast and multicast addresses
Note

The least significant bit of the first byte


defines the type of address.
If the bit is 0, the address is unicast;
otherwise, it is multicast.
Note

The broadcast destination address is a


special case of the multicast address in
which all bits are 1s.
Example

Define the type of the following destination addresses:


a. 4A:30:10:21:10:1A b. 47:20:1B:2E:08:EE
c. FF:FF:FF:FF:FF:FF
Solution
To find the type of the address, we need to look at the
second hexadecimal digit from the left. If it is even, the
address is unicast. If it is odd, the address is multicast. If
all digits are F’s, the address is broadcast. Therefore, we
have the following:
a. This is a unicast address because A in binary is 1010.
b. This is a multicast address because 7 in binary is 0111.
c. This is a broadcast address because all digits are F’s.
Categories of Standard Ethernet-Physical Layer
Implementation
Encoding in a Standard Ethernet implementation
10Base5 implementation

• Also called thick Ethernet, or Thicknet


• Uses a bus topology with an external transceiver
(transmitter/receiver) connected via a tap to a thick coaxial
cable
• transceiver is connected to the station via a transceiver
cable that provides separate paths for sending and
receiving
10Base2 implementation

• Also called thin Ethernet, or Cheapernet


• Uses a bus topology
• Transceiver is normally part of the network interface
card (NIC), which is installed inside the station
10Base-T implementation

• Also called twisted-pair Ethernet


• Uses physical star topology
• Stations are connected to a hub via two pairs of twisted
cable
• two pairs of twisted cable create two paths (one for
sending and one for receiving) between the station and
the hub
10Base-F implementation

• Uses a star topology to connect stations to a


hub
• Stations are connected to the hub using two
fiber-optic cables
Summary of Standard Ethernet implementations
CHANGES IN THE STANDARD

The 10-Mbps Standard Ethernet has gone through


several changes before moving to the higher data
rates. These changes actually opened the road to the
evolution of the Ethernet to become compatible with
other high-data-rate LANs.
Unbridged Ethernet-Sharing bandwidth

• If only one station has frames to send, it benefits from the


total capacity (10 Mbps).
• if two stations have a lot of frames to send, they probably
alternate in usage. When one station is sending, the other one
refrains from sending. We can say that, in this case, each
station on average, sends at a rate of 5 Mbps.
A network with and without a bridge

• A bridge divides the network into two or more networks.


• Bandwidth-wise, each network is independent.
• Eg:- a network with 12 stations is divided into two networks,
each with 6 stations. Now each network has a capacity of 10
Mbps. The 10-Mbps capacity in each segment is now shared
between 6 stations (actually 7 because the bridge acts as a
station in each segment), not 12 stations
Collision domains in an unbridged network and a
bridged network

Without bridging, 12 stations contend for access to the medium; with


bridging only 3 stations contend for access to the medium
Switched Ethernet

• N-port switch is used


• The bandwidth is shared only between the station and
the switch.
• The collision domain is divided into N domains
Full-duplex switched Ethernet

• Each station is connected to the switch via two separate links


• To provide for flow and error control in full-duplex switched
Ethernet, a new sublayer, called the MAC control, is added
between the LLC sublayer and the MAC sublayer
FAST ETHERNET

Fast Ethernet was designed to compete with LAN


protocols such as FDDI or Fiber Channel. IEEE
created Fast Ethernet under the name 802.3u. Fast
Ethernet is backward-compatible with Standard
Ethernet, but it can transmit data 10 times faster at a
rate of 100 Mbps.
Autonegotiation

• Autonegotiation allows two devices to negotiate


the mode or data rate of operation.
• Allows incompatible devices to connect to one
another. For example, a device with a maximum
capacity of 10 Mbps can communicate with a
device with a 100 Mbps capacity (but can work
at a lower rate)
• Allows one device to have multiple capabilities
• Allows a station to check a hub's capabilities
Fast Ethernet topology

If there are only two stations, they can be


connected point-to-point. Three or more stations
need to be connected in a star topology with a
hub or a switch at the center
Fast Ethernet implementations
Encoding for Fast Ethernet implementation
Summary of Fast Ethernet implementations
GIGABIT ETHERNET

The need for an even higher data rate resulted in the


design of the Gigabit Ethernet protocol (1000 Mbps).
The IEEE committee calls the standard 802.3z.
Note

In the full-duplex mode of Gigabit


Ethernet, there is no collision;
the maximum length of the cable is
determined by the signal attenuation
in the cable.
Topologies of Gigabit Ethernet
Gigabit Ethernet implementations
Encoding in Gigabit Ethernet implementations
Summary of Gigabit Ethernet implementations
TEN GIGABIT ETHERNET

The IEEE committee created Ten-Gigabit Ethernet


and called it Standard 802.3ae. Ten-Gigabit Ethernet
operates only in full duplex mode. The physical layer
in Ten-Gigabit Ethernet is designed for using
fiber-optic cable over long distances
Summary of Ten-Gigabit Ethernet implementations
Chapter 14
Wireless LANs

.
IEEE 802.11

IEEE has defined the specifications for a wireless


LAN, called IEEE 802.11, which covers the physical
and data link layers.

The standard defines two kinds of services: the basic


service set (BSS) and the extended service set (ESS)
Note

A BSS without an AP is called an ad hoc


network;
a BSS with an AP is called an
infrastructure network.
Basic service sets (BSSs)

Ad hoc : stations can form a network without the need of


an AP; they can locate one another and agree to be part of
a BSS
Extended service sets (ESSs)

• made up of two or more BSSs with APs


• BSSs are connected through a distribution system,
which is usually a wired LAN
Types of Stations

• Station with no-transition mobility is either


stationary (not moving) or moving only inside a
BSS.
• Station with BSS-transition mobility can move
from one BSS to another, but the movement is
confined inside one ESS
• Station with ESS-transition mobility can move
from one ESS to another
MAC layers in IEEE 802.11 standard
Why CSMA/CD cannot be used with IEEE 802.11
• For collision detection a station must be able to
send data and receive collision signals at the
same time. This can mean costly stations and
increased bandwidth requirements.
• Collision may not be detected because of the
hidden station problem.
• The distance between stations can be great.
Signal fading could prevent a station at one end
from hearing a collision at the other end.
CSMA/CA flowchart

DCF uses CSMA/CA


as the access method
CSMA/CA
1.Before sending a frame, the source station senses
the medium by checking the energy level at the
carrier frequency
a. The channel uses a persistence strategy with
back-off until the channel is idle.
b. After the channel is found to be idle, the station
waits for a period of time called the distributed
interframe space (DIFS); then the station sends a
control frame called the request to send (RTS).
CSMA/CA
2. After receiving the RTS and waiting a period of
time called the short interframe space (SIFS), the
destination station sends a control frame, called the
clear to send (CTS), to the source station. This
control frame indicates that the destination station
is ready to receive data.
3. The source station sends data after waiting an
amount of time equal to SIFS.
4. The destination station, after waiting an amount
of time equal to SIFS, sends an acknowledgment to
show that the frame has been received.
CSMA/CA and
NAV
Network Allocation Vector ( NAV
•) When a station sends an RTS frame, it includes
the duration of time that it needs to occupy the
channel.
• The stations that are affected by this
transmission create a timer called a network
allocation vector (NAV) that shows how much
time must pass before these stations are
allowed to check the channel for idleness.
• Each time a station accesses the system and
sends an RTS frame, other stations start their
NAV
Point Coordination Function (PCP)
• an optional access method that can be
implemented in an infrastructure network (not
in an ad hoc network).
• It is implemented on top of the DCF and is
used mostly for time-sensitive transmission
• a repetition interval has been designed to cover
both contention-free (PCF) and
contention-based (DCF) traffic
Example of repetition interval

When the stations hear the beacon frame, they start their NAV
for the duration of the contention-free period of the repetition
interval
Frame format
Frame format
Frame control : defines the type of frame and some control
information.
D : defines the duration of the transmission that is used to
set the value of NAV
Addresses: There are four address fields
Sequence control: This field defines the sequence number
of the frame to be used in flow control
Frame body : This field, contains information based on the
type and the subtype defined in the FC field
FCS : contains a CRC-32 error detection sequence
Subfields in FC field
Types of Frames
• Management frames are used for the initial
communication between stations and access
points
• Control frames are used for accessing the
channel and acknowledging frames
• Data frames are used for carrying data and
control information.
Control frames

Values of subfields in control frames


Addresses
Addressing mechanisms
Addressing mechanisms
Case 1: The frame is going from one station in a BSS to
another without passing through the distribution system.
The ACK frame should be sent to the original sender
Case 2: The frame is coming from an AP and going to a
station. The ACK should be sent to the AP. address 3
contains the original sender of the frame (in another BSS)
Case 3: The frame is going from a station to an AP. The
ACK is sent to the original station. address 3 contains the
final destination of the frame (in another BSS).
Case 4: The frame is going from one AP to another AP in
a wireless distribution system. we need four addresses to
define the original sender, the final destination, and two
intermediate APs
Hidden station problem

Assume that station B is sending data to station A. In the


middle of this transmission, station C also has data to
send to station A. However, station C is out of B's range
and transmissions from B cannot reach C. Therefore C
thinks the medium is free. Station C sends its data to A,
which results in a collision at A
.
Note

The CTS frame in CSMA/CA handshake


can prevent collision from
a hidden station.
Use of handshaking to prevent hidden station problem

Since both Band C are within the range of A, the CTS


message, which contains the duration of data transmission
from B to A reaches C. Station C knows that some hidden
station is using the channel and refrains from transmitting
until that duration is over
Exposed station problem

Station A is transmitting to station B. Station C has some


data to send to station D which can be sent without
interfering with the transmission from A to B. However,
station C is exposed to transmission from A; it hears what
A is sending and thus refrains from sending
Use of handshaking in exposed station problem

The handshaking messages RTS and CTS cannot


help in this case
Physical layers
BLUETOOTH

Bluetooth is a wireless LAN technology designed to


connect devices of different functions such as
telephones, notebooks, computers, cameras, printers,
coffee makers, and so on. A Bluetooth LAN is an ad
hoc network, which means that the network is formed
spontaneously.

Bluetooth defines two types of networks: piconet and


scatternet
Piconet
Piconet
• Can have up to eight stations, one of which is called the
primary, the rest are called secondaries.
• All the secondary stations synchronize their clocks and
hopping sequence with the primary.
• The communication between the primary and the
secondary can be one-to-one or one-to-many
• an additional eight secondaries can be in the parked
state. A secondary in a parked state is synchronized with
the primary, but cannot take part in communication until
it is moved from the parked state.
• activating a station from the parked state means that an
active station must go to the parked state
Scatternet
Scatternet

• Piconets can be combined to form what is called


a scatternet
• A secondary station in one piconet can be the
primary in another piconet.
• This station can receive messages from the
primary in the first piconet (as a secondary) and,
acting as a primary, deliver them to secondaries
in the second piconet.
• A station can be a member of two piconets
Bluetooth layers
Bluetooth layers
• The radio layer is roughly equivalent to the physical
layer of the Internet model. Bluetooth devices are
low-power and have a range of 10 m. Bluetooth uses
the frequency-hopping spread spectrum (FHSS) method
in the physical layer to avoid interference from other
devices or other networks. To transform bits to a signal,
Bluetooth uses a sophisticated version of FSK, called
GFSK (FSK with Gaussian bandwidth filtering)
• The baseband layer is roughly equivalent to the MAC
sublayer in LANs. The access method is TDMA. The
primary and secondary communicate with each other
using time slots. Bluetooth uses a form of TDMA of
called TDD-TDMA (timedivision duplex TDMA)
Single-secondary communication

The time is divided into slots of 625 μs. The primary uses even
numbered slots (0, 2, 4, ...); the secondary uses odd-numbered slots (1,
3, 5, ...). TDD-TDMA allows the primary and the secondary to
communicate in half-duplex mode.
Multiple-secondary communication

the primary uses the even-numbered slots, but a secondary sends in


the next odd-numbered slot if the packet in the previous slot was
addressed to it. All secondaries listen on even-numbered slots, but
only one secondary sends in any odd-numbered slot.
Physical Links
Synchronous connection-oriented (SCQ) link is used
when avoiding latency (delay in data delivery) is more
important than integrity (error-free delivery). In an SCQ
link, a physical link is created between the primary and a
secondary by reserving specific slots at regular intervals. If
a packet is damaged, it is never retransmitted. SCQ is used
for real-time audio where avoiding delay is all-important
Asynchronous connectionless link (ACL) is used when
data integrity is more important than avoiding latency. In
this type of link, if a payload encapsulated in the frame is
corrupted, it is retransmitted
Bluetooth Layers
L2CAP is used for data exchange on an ACL link
L2CAP has specific duties:
•multiplexing
•segmentation and reassembly
•Quality of service (QoS)
•group management
Frame format

Access code: This 72-bit field normally contains


synchronization bits and the identifier of the primary to
distinguish the frame of one piconet from another
Payload: It contains data or control information coming
from the upper layers.
Frame format
Header: has the following subfields
1.Address: The 3-bit address subfield can define up to
seven secondaries (l to 7). If the address is zero, it is used
for broadcast communication from the primary to all
secondaries.
2. Type: defines the type of data coming from the upper
layers.
3. F: for flow control. When set (1), it indicates that the
device is unable to receive more frames (buffer is full).
4. A: for acknowledgment. Bluetooth uses Stop-and-Wait
ARQ;
5. S: holds a sequence number.
6. HEC: header error correction subfield is a checksum to
detect errors
L2CAP data packet format

Length field defines the size of the data, in bytes, coming


from the upper layers.
Data can be up to 65,535 bytes.
The channel ID (CID) defines a unique identifier for the
virtual channel created at this level

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy