Physical Layer and Media
Physical Layer and Media
Physical Layer and Media
1
Introduction
• This layer is involved in physically carrying
information from one node in the network to the
next.
– One major task: provides services to the data link layer
• One of these services is to convert the data link layer stream of
bits into a signal.
– Take care of the transmission medium
• Control the transmission medium.
• Decides on the directions of the data flow.
• Decides on the number of logical channels when data comes
from different sources.
2
Data & Signals
• A transmission media moves information in the form of
electromagnetic signals.
– Data in the form of 0s and 1s cannot be sent over a network.
– Data must then be transformed into electromagnetic signals to be transmitted.
– Data Transmission : Communication of data by propagation and processing of
signals
• Data and the signals that represent them can take one of the following
forms:
– Analog form
– Digital form
• Analog and digital data
– Analog data : refers to information that is continuous (i.e. takes on continuous values)
• Ex. Human voice, sound, light, temperature.
– Human voice
o When somebody speaks, a continuous wave is created in the air.
o Could be captured by a microphone and converted to an analog signal.
– Digital data : refers to information that has discrete states (i.e. takes on discrete values).
• Ex.: Text, integers, symbols stored on the computer memory in the form of 1s and 0s.
– It is usually converted to a digital signal or modulated into an analog signal to be transmitted
across a medium.
3
Analog & Digital
• Analog and digital signals
– Analog signal
• Has infinitely many levels of intensity over a period of time.
• As the signal moves from A to B, it passes and includes an infinity number of values.
– Digital signal
• Has only a limited number of defined values.
• Each value can be any number, as simple as 0 and 1.
–Illustrating signals by plots
• y axis (Strength or value of signal) – x axis (passage of time)
4
Analog & Digital
• Both analog and digital signals can take on one of the two forms:
– Periodic
– Aperiodic (nonperiodic)
• Periodic signal
– Completes a pattern within a measurable time frame called period
– Repeats (continuously) that pattern over identical subsequent periods.
– The completion of one full pattern is called a cycle.
– A period, represented by T, is defined as the amount of time (expressed in
second) required to complete one full cycle.
• Aperiodic signals
– Change constantly without exhibiting a pattern or cycle that repeats over time
(=> no repetitive pattern).
• Both analog and digital signals can be periodic and aperiodic
• In data communication, to send data there is a commonly a use of:
– Periodic analog signals
• Need less bandwidth
– Aperiodic digital signals
• Can represent variation in data
5
Periodic Analog signals
• Periodic analog signal could be classified as:
– Simple periodic analog signal
• i.e. a sine wave -cannot be decomposed into smaller signals-.
– Composite periodic analog signal
• composed of multiple sine waves
• Sine wave
– Sine wave is the most fundamental form of periodic analog signal
– Sine waves can be represented by three parameters
• 1) Peak Amplitude, 2) Frequency, and 3) Phase.
• Mathematically described as: x(t) = Asin(2pft+Ø )
– x(t): signal at time t; A: Peak Amplitude; f: frequency; Ø:the phase
6
1. Peak Amplitude (A)
• Absolute value of its highest intensity.
• For electric signals, the peak amplitude is measured in volts.
7
Periodic
•Sine wave (cont’d)
Analog signals
2. Period (T) or frequency (f)
• Period refers to the amount of time, in seconds, a signal needs to
complete 1 cycle.
• Frequency refers to the number of periods in 1s.
• Frequency = 1/Period; Period = 1/Frequency.
• Period is expressed in seconds and the frequency in Hertz (Hz) –
i.e. cycle per second-.
ms(milli)=10-3s. µs(micro)=10-6s, ns(nano)=10-
9s,ps(pico)=10-12s.
9
Periodic Analog signals
10
•Examples
–The home electricity is a sine wave with a maximal amplitude
of 155 volts and a frequency of 60Hz. Write the mathematical
equation.
•2pf = 2*3.14*60 = 377 radians/second
•x(t) = Asin (2pft+Ø ) = 155sin (377t + Ø) ; Ø usually 0.
–Write the mathematical equation of the electricity produced by a
constant (I.e. DC) six-volt battery.
•x(t) = Asin(2pft – p/2 ) = Acos(2pft) = Acos(0) = A = 6 volts
–A sine wave has a frequency of 8KHz. What is its period?
•Let T be the period and f the frequency
T = 1/f = 1/8000 = 0.000125 second = 125*10-6 s=125µs
–A sine wave completes one cycle in 4 second. What is its
frequency
•Let T be the period and f the frequency
f = 1/T = 1/4 = 0.25 Hz
11
Periodic
• Time and frequency domains
Analog signals
– The previous plots are time-domain plots.
– The time domain plot shows changes in signal amplitude with respect to time
• It is an amplitude versus time plot.
– Phase and frequency are not explicitly measured on a time-domain plot.
– To show the relationship between amplitude and frequency, use what is called a frequency-
domain plot.
• A frequency-domain plot is concerned with only the peak value and the frequency.
– An analog signal is best represented in the frequency domain
12
Periodic
• Composite signals
Analog signals
– A single-frequency sine wave is useless in data communications
• We could only represent alternating 1s and 0s.
• We will hear a buzz if it is used to convey a telephonic conversation.
– To communicate data, we need to send a composite signal.
– A composite signal is made of many simple sine waves.
– According to Fourier analysis, any composite signal, no matter how complex, can be
represented (I.e. decomposed) as a combination of simple sine waves with different
frequencies, phases, and amplitudes
• Fourier Analysis
–Using the Fourier series, a composite periodic signal with period T (frequency f0) can be
decomposed into a series of sine and cosine functions in which each function is an integral
harmonic of the fundamental frequency f0 of the composite signal
• The composite signal is decomposed in a series of signals with discrete frequencies
15
Periodic Analog signals
• Frequency Spectrum
– Frequency spectrum of a composite signal is the collections of all the
components frequencies it contains
– It is shown using a frequency-domain graph.
– The spectrum of a periodic composite signal contains only integer frequencies
while the spectrum of an nonperiodic composite signal contains all the
continuous frequencies??.
• Bandwidth
– The bandwidth of a composite signal is the width of the frequency spectrum.
– In other words, it refers to the range of component frequencies, and frequency
spectrum refers to the element within that range.
– To calculate bandwidth, subtract the lowest frequency from the highest
frequency of the range.
• Example
– The average voice has a frequency range of roughly 300 Hz to 3100 Hz(??).
– The spectrum would thus be 300 - 3100 Hz
– The bandwidth would be 2800
16
Periodic Analog signals
• Example (cont’d)
– If a periodic signal is decomposed into five sine waves with frequencies of 100,
300, 500, 700, and 900 Hz, what is the bandwidth? Draw the frequency spectrum,
assuming all components have a maximum amplitude of 10 V.
• B = fh - fl = 900 - 100 = 800 Hz
The spectrum has only five spikes, at 100, 300, 500, 700, and 900
17
–A periodic signal has a bandwidth of 20 Hz. The highest frequency is 60 Hz. What is
the lowest frequency? Draw the frequency spectrum if the signal contains all integral
frequencies of the same amplitude
B = fh - fl
20 = 60 - fl
fl = 60 - 20 = 40 Hz
18
Digital signals
• In addition to being represented by an analog signal, data can also be represented by a
digital signal.
• For example, a 1 can be encoded as a positive voltage and 0 as zero voltage.
• A digital signal can have more than two levels.
– Can then send more than 1 bit for each level
– In general, if a signal has L levels, each level needs log2L bits.
19
•Most digital signals are aperiodic and, thus, period or frequency
is not appropriate.
– Bit length
•The distance one bit occupies on the transmission medium
•Bit length = propagation speed * bit duration.
20
Digital signals
•Example.
– A digital signal has eight levels. How many bits are needed per level?
• Number of bits per level = log28= 3
–We need to download text documents at the rate of 100 pages per
minute. What is the required bit rate of the channel?
• In average a page contains 24 lines with 80 characters in each line.
If one character requires 8 bits the bit rate is: 100*24*80*8 =
1636000bps = 1.636 Mbps
22
Digital signals
• Two approaches for digital signal transmission: 1) baseband transmission, 2)
broadband transmission.
• Baseband transmission
– Means sending the digital signal over a channel without changing it into an analog
signal.
–Baseband transmission of a digital signal that preserves the shape of a digital signal is
possible only if we have a low-pass channel with an infinite or very wide bandwidth.
• A low-pass channel is a channel with a bandwidth that starts from zero.
–This is the case if we have a dedicated medium with a bandwidth constituting only one
channel.
• A low-pass channel with infinite bandwidth is ideal and not found in real life.
• Coaxial cable or optical fiber are examples of wide bandwidth medium
– 23
–Baseband transmission with a low-pass channel with
limited bandwidth is possible by approximating a digital
signal with an analog signal. Approximation depends on
available bandwidth.
•The required bandwidth is proportional to the bit rate.
Sends bits faster => more bandwidth.
24
Digital signals
•Broadband transmission (or modulation)
– Means changing the digital signal to an analog signal for
transmission when we cannot send the digital signal directly to the
channel.
– Broadband transmission allows the use of a bandpass channel.
•A bandpass channel is a channel with a bandwidth that does not
starts from zero.
– More available than low-pass channel.
25
• EX.
– An example of a dedicated channel where the entire bandwidth of the medium
is used as one single channel is a LAN.
•Almost every wired LAN today uses a dedicated channel for two stations
communicating with each other.
•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.
• Attenuation
– When a signal, simple or complex, travels through a medium, it loses some of its
energy so that it can overcome the resistance of the medium.
• I.e. Signal strength falls off with distance.
27
–Use the concept of decibels (dB) measure to show that a signal has lost or
gained strength
• dB measures the relative strength of two signals or a signal at two different
points.
– dB = 10log10(P2/P1)
• P1 is the transmitted signal power and P2 is the received signal power.
– dB is negative if a signal is attenuated and positive if the signal is
amplified.
– Example
•A signal travels through a transmission medium and its power is reduced to
half.
– This means P2=(1/2)P1, the attenuation (loss of power) can be calculated
as
10log10(P2/P1)= 10log10(0.5*P1/P1)= 10log10(0.5)= 10*(-0.3)= -3dB
Engineers knows that –3dB, or a loss of 3 dB, is equivalent to losing half
the power.
30
• Noise Transmission Impairment
– Additional signals inserted between transmitter and receiver
32
Data rate limits
• Data rate = How fast can the data be sent, in bits per second, over a channel?
• Data rate depends on three factors: 1) The available bandwidth, 2) The level of the
signal, and 3) The quality of the channel (i.e. the level of the noise).
33
•Noisy channel : Shannon bit rate.
– The reality: a channel is always noisy.
– Theoretical highest data rate for a noisy channel
• Capacity = Bandwidth*log2(1+SNR)
– There is no indication of the signal levels => no matter how many levels we have,
we cannot achieve a data rate higher than the capacity of the channel.
• Formula defines a characteristic of the channel not the method of transmission.
–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).
What is the capacity of this channel?
– 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.
– C =B*log2(1 +SNR) =B*log2 (1 +0) =B*log2(1) =B*0 =0
• We can calculate the theoretical highest bit rate of a regular telephone line. A
telephone line normally has a bandwidth of 3000. The signal-to-noise ratio is
usually 3162. For this channel the capacity is calculated as
– C =B*log2(1 +SNR) =3000*log2(1 +3162) =3000 *log2(3163)
– C =3000*11.62 =34860 bps
– This means that the highest bit rate for a telephone line is 34.860 Kbps. If we
want to send data faster than this, we can either increase the bandwidth of the
line or improve the signal-to-noise ratio
34
Data rate limits
• Assume that SNRdB = 36 and the channel bandwidth is 2 MHz. what is the theoretical
channel capacity?
– SNRdB = 10log10SNR => SNR = 10SNRdB/10 => SNR = 103.6 = 3981
– C = Bandwidth*log2(1+SNR) = 2*106*log2(3982) = 24 Mbps.
•In practice need to use both methods to find the limits and signal levels.
–Example
• We have a channel with a 1 MHz bandwidth. The SNR for this channel is 63; what is the appropriate
bit rate and signal level?
–First, we use the Shannon formula to find our upper limit.
• C =B*log2(1 +SNR) =106*log2(1 +63)=106*log2(64) =6 Mbps
–Although the Shannon formula gives us 6 Mbps, this is the upper limit. For better performance we
choose something lower, for example 4 Mbps. Then we use the Nyquist formula to find the number
of signal levels.
• 4 Mbps =2 × 1 MHz × log2L L =4
•The Shannon capacity gives us the upper limit; the Nyquist formula tells us how many
signal levels we need.
35
Performance
• Network Performance: How good is the network?
• Network performances terms: 1) Bandwidth, 2) Throughput, 3) Bandwidth-delay
product, and 4) Jitter
• Bandwidth
– This term can be used in two different contexts
• The bandwidth, in hertz, refers to the range of frequencies in a composite signal or the range of
frequencies that a channel can pass.
– Ex. Bandwidth of a subscriber telephone line is 4KHz.
• The bandwidth, in bits per second, refers to the speed of bit transmission in a channel, link, or a
network.
– Ex.: Bandwidth of a Fast Ethernet Network is a maximum of 100 Mbps.
• Relationship: an increase in bandwidth in hertz means an increase in bandwidth in bps.
• Throughput
– Measures how fast we can actually send data through a network.
– A network can have a bandwidth of B in bps but can only send T bps throughput -with B>T-
• Ex. A link with a bandwidth of 1Mbps but the connected devices may handle only 200Kbps
– Bandwidth is the potential measurement of a link; throughput is the 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?
– Throughput = 12000*10000/60 = 2Mbps 36
– The throughput is almost one-fifth of the bandwidth in this case.
Performance
•Latency (delay)
– Defines how long it takes for an entire message to completely arrives at the
destination from the time the first bit is sent out from the source :
Latency = propagation Time + Transmission Time + Queuing Time + Processing Time
– Latency components:
• Propagation time
– Measures the time required for a bit to travel from the source to the destination :
Propagation Time = Distance/(Propagation Speed)
– Propagation speed of electromagnetic signals depends on the medium and on the signal
frequency.
• Light is propagated with a speed of 3*108m/s in a vacuum. It is lower in air; it is much lower in
cable.
• Transmission time.
– Necessary time to send a message.
– Depends on the size of the message and the bandwidth of the link :
Transmission Time = (Message size)/Bandwidth
• Queuing time.
– Time needed for each intermediate (ex. Router) or end device to hold the message before it
can be processed. Not a fixed time but changes with the load imposed on the network.
• Processing delay.
– 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.
37
• Delay (cont’d)
Performance
–Example (cont’d)
• 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.
• Jitter
–The jitter issue is related to delay.
–Jitter is a problem for time-sensitive applications (ex. Audio and video) if different packets of
data encounter different delays.
• If the delay of the first packet is 20ms, for the second is 45ms, and for the third is 40ms =>
the real-time applications that uses the packets endures jitter
38
• Bandwidth-Delay product
–Defines the number of bits that can fill the link.
–EX.
• Consider a link with 1bps and the link delay is equal to 5s. The product 1*5 is the
maximum number of bits that can fill the link.
–This measurement is important if we need to send data in bursts and wait for the
acknowledgement of each burst before sending the next burst.
• To use the maximum capability of the link, need to make the size of a burst =
2*Bandwidth*Delay
39
Various approaches for conversion of data to signal
40
• Three techniques to convert digital data to digital signals:
1) Line coding, 2) Block coding, and 3) Scrambling.
– Line coding is always needed. The two others may or may not be needed
• Line coding
• At the sender, converts a sequence of bits to a digital signal.
• At the receiver, the digital data are recreated by decoding the digital signal.
Line coding characteristics
1. No of signal levels: This refers to the number values allowed in a signal, known as signal
levels, to represent data.
2. Bit rate versus Baud rate: The bit rate represents the number of bits sent per second,
whereas the baud rate defines the number of signal elements per second in the signal.
Depending on the encoding technique used, baud rate may be more than or less than the
data rate. 41
3. DC components: After line coding, the signal may have zero frequency
component in the spectrum of the signal, which is known as the direct-
current (DC) component. DC component in a signal is not desirable
because the DC component does not pass through some components of
a communication system such as a transformer. This leads to distortion
of the signal and may create error at the output. The DC component also
results in unwanted energy loss on the line.
4. Signal Spectrum: Different encoding of data leads to different spectrum
of the signal. It is necessary to use suitable encoding technique to match
with the medium so that the signal suffers minimum attenuation and
distortion as it is transmitted through a medium.
5. Synchronization: To interpret the received signal correctly, the bit
interval of the receiver should be exactly same or within certain limit of
that of the transmitter. Any mismatch between the two may lead wrong
interpretation of the received signal.
6. Cost of Implementation: It is desirable to keep the encoding technique
simple enough such that it does not incur high cost of implementation.
42
Digital-to-Digital conversion
1) Unipolar scheme
• All the signal levels are on one side of the time axis, either above or below.
1.1) NRZ (Non-Return-to-Zero)
• Positive voltage defines the bit 1; Zero voltage defines the bit 0.
• Normally not used in data communication because it is costly
43
2) Polar schemes
• The voltage are on both sides of the time axis.
– Ex. The voltage level for 0 can be positive and the voltage level for 1 can be negative.
44
Digital-to-Digital conversion: line coding
2) Polar schemes (cont’d)
2.2) Return to Zero (RZ)
• Uses three voltage values: positive, negative, and zero.
• The signal changes not between bits but during the bit.
• Some disadvantages:
- Requires two signal changes to encode a bit => more bandwidth is required.
- It is more complex to create and discern three levels.
- => not used today and has been replaced by Manchester and Differential-Manchester
schemes.
45
Digital-to-Digital conversion: line coding
2.3) Biphase (Manchester and Differential Manchester)
2.3.1) Manchester encoding
• The duration of a bit is divided in two halves.
• The voltage level moves to the other level in the second halve.
2.3.2) Differential Manchester encoding
• There is a transition at the middle of the bit.
• The bit values are determined at the beginning of the bit.
- If next bit is 0, there is then a transition. If the next bit is 1, there is none.
• Drawback
• Require more bandwidth than the NRZ because of the transition at the middle of each bit and
perhaps at the end of each bit.
46
47
Digital-to-Digital conversion: line coding
3) Bipolar schemes (also called multilevel binary)
– Three voltage level are used: positive, negative, and zero.
• One data element is at a zero voltage level.
• The other element alternates between positive and negative voltage level.
– AMI and Pseudoternary
3.1) AMI (Alternate Mark Inversion)
• Zero voltage represents the bits 0.
• Bits 1 are represented by alternating positive and negative voltage.
3.2) Pseudoternary
• Bits 1 are represented by zero voltage and bits 0 are represented by altering voltage levels.
• Commonly used for long-distance communication.
48
49
50
4) Multilevel schemes
– Goal: increase the number of bits per baud by encoding a pattern of m data elements into
a pattern of n signal elements.
• A group of m data elements produce a combination of 2m data patterns.
• Different types of signal elements produced by allowing different signal levels.
–With L levels, we can produce Ln combinations of signal patterns.
• Ln=2m => each data pattern encoded into one signal element.
• 2m>Ln => data patterns occupy only a subset of signal patterns.
• 2m<Ln => not possible because some of data patterns cannot be encoded.
51
Digital-to-Digital conversion: line coding
4.1) 2B1Q (two binary, one quaternary)
• Encodes the 2-bit patterns as one signal element belonging to a four-level signal.
–m=2, n=1, and L=4.
• Can send data 2 times faster than using NRZ-L.
• The receiver has to discern four thresholds corresponding to the four signal levels.
• Used in DSL technology to provide high speed connection to the Internet.
52
Digital-to-Digital conversion: line coding
4.2) 8B6T (eight binary, six ternary)
• Encodes a pattern of 8 bits as a pattern of 6 signal elements where the signal has three levels.
– => 28=256 different data patterns and 36=478 different signal patterns.
• 478-256=222 redundant signal elements that provide synchronization and error detection.
• Used with 100BASE-4T
54
Summary of line coding schemes
55
Quiz
• 101011100
• Unipolar NRZ, polar NRZ, NRZ-I, AMI, Manchester, Def. Manchester
1 0 1 0 1 1 1 0 0
Unipolar
NRZ
Polar NRZ
NRZ-inverted
(differential
encoding)
AMI
encoding
Manchester
encoding
Differential
Manchester
encoding