T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

53
THE PHYSICAL LAYER Dr. Nawaporn Wisitpongphan

Transcript of T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

Page 1: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

THE PHYSICAL LAYERDr. Nawaporn Wisitpongphan

Page 2: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

OUTLINE

Introduction to some random topic about Computer Networks

Let’s get down the physical layer! What happen before things get onto the wire?

Page 3: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

What is Self-Similarity?

SELF-SIMILARITY

Page 4: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

SELF-SIMILAR BACKBONE TRAFFIC

Page 5: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

ONE PICTURE SAYS A THOUSAND WORD

Page 6: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

BUTTERFLY EFFECT

Small variations of the initial condition of a dynamical system may produce large variations in the long term behavior of the system

Page 7: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

D(t)

A(t)

time

Q(t)

d(t)

PROBLEM REVISITCumulative

number of bits

Example: Every second, a train of 100 bits arrive at rate 1000b/s. The maximum departure rate is 500b/s.What is the average queue occupancy?

( ( ) ( ) 0) 0.5 (0.1 5

: During each cycle, the queue fi lls at rate 500b/ s f or 0.1s,

then drains at rate 500b/ s f or 0.1s.The average queue occupancy when

the queue is non-empty is theref ore: Q t Q t

Solution

00) 25 .

( ) (0.2 25) (0.8 0) 5 .

bits

The queue is empty f or 0.8s each cycle, and so: bits

(You' ll probably have to think about this f or a while...).

Q t

0.1s 0.2s 1.0s

100

7

Page 8: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

PHYSICAL LAYER

Formatting and transmission of baseband signals

From: Digital Communicatoins Fundamental and Applications by Bernard Sklar

Page 9: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

ANALOG SIGNAL (PRO/CON)

Advantanges Disadvantages

Analog signal has infinite amount of signal resolution

Processing may be achieved more simply than with the digital equivalent

Analog signal is prone to noise so it needs better shielding

Distorted signal is hard to recover.

Page 10: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

BANDWIDTH VS. CHANNEL

Digital Bandwidth: a measure of available or

consumed data communication resources expressed in bit/s

Analog Bandwidth: frequency bandwidth or radio

bandwidth: a measure of the width of a range of frequencies, measured in hertz

Set of allocated/allowed frequencies Example: WLAN has a

total of 14 channels with 3 non-overlapping channels

BANDWIDTH CHANNEL

Page 11: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

SIGNAL IMPAIRMENTS

Attenuation:

Distortion:

Noise:

Page 12: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

WHAT ARE THE SOURCES OF NOISE IN THE CHANNEL?

Foreign signals show up

Thermal agitation of electrons Spikes, pulses of all sorts

Frequency independent (white noise)

Depends on temperature

CrossTalk, Impulse noise Pick up signals from near by conductor

Or sources of electromagnetic energy

12

Page 13: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

SIGNAL/NOISE PARAMETERS

Noise Power : N [Joule/sec =Watts]

Signal Assume signal encoding bits at rate R bits/sec

Power (energy/sec): S [Watts]

Signal to Noise Ratio (S/N)

SNRdB ≡ 10*log10(S/N)

13

Page 14: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

SHANNON THEOREM

In a noisy channel, bandwidth B, with signal to noise ratio S/N

The rate of transmitting bits through that channel is bounded by

Rmax < B*log2(1+ S/N) Example:

Calculate the maximum data rate on a channel with a range from 3 MHz to 4 MHz has SNRdB = 24 dB

channel bandwidth B = 4 – 3 = 1 MHz 10*log10(S/N) = 24 (S/N) = 102.4 = 250 Rmax = 106*log2(1+251) = 8*106 bps Rmax = 8 Mbps

14

Page 15: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

ANALOG TO DIGITAL

Formatting and transmission of baseband signals

From: Digital Communicatoins Fundamental and Applications by Bernard Sklar

Page 16: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

TEXT TO BINARY (TEXTBITS)

ASCII Code: Seven-bit American standard code for information interchange

From: Digital Communicatoins Fundamental and Applications by Bernard Sklar

Page 17: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

GROUP OF BITS SYMBOL

A group of k bits can be combined to form M symbols such that M = 2k

The symbol set of size M is called “M-ary system” Example: k = 1 2-ary system or binary system

Page 18: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

“THINK” IN A BINARY FORM

ข้�อความ

bit

Symbol

Waveform

Page 19: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

SAMPLING & QUANTIZING

Amplitude and time coordinates of source data. (a) Originalanalog waveform. (b) Natural-sampled data. (c) Quantized samples. (d)Sample and hold.

Page 20: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

SAMPLE

Page 21: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

SAMPLING THEOREM

Undersampling

More samples allow for better signal recovery

Page 22: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

SAMPLING THEOREM: EXAMPLE Audio (MP3)

32 kbps – AM Quality 96 kbps – FM Quality 128 kbps – Standard Quality 224 – 320 kbps – Near CD quality

Audio ประเภทอื่�นๆ 800 bps – Recognizable speech 8 kbps – Telephone quality

Video 16 kbps – videophone quality (สำ��หร�บผู้��ใช้�ท� วไป) 128 – 384 kbps – vdo conferencing (เช้�งธุ�รกิ�จ) 1.25 Mbps – VCD quality 5 Mbps – DVD quality 8 – 15 Mbps – HDTV quality 29.4 Mbps – HD DVD 40 Mbps – Blu-ray Disc

Page 23: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

NYQUIST THEOREM

Nyquist Sampling Theorem: “an analog signal that has been sampled can be perfectly reconstructed from the samples if the sampling rate exceeds 2B samples per second, where B is the highest frequency in the original signal.”

Sampling rate?

Nyquist Capacity: “Given a channel with bandwidth B, a signal through this channel can have max symbol Rate Dmax < 2B (symbols/sec)”

Rmax = Dmax* log2M

Rmax < 2B* log2M

Rmax is called the channel capacity1 symbol = log2M bits

Page 24: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

QUANTIZE

Page 25: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

QUANTIZATION LEVEL

Page 26: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

SAMPLING QUANTIZING

Page 27: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

ENCODE (LINE CODING)

Page 28: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

28

NON-RETURN TO ZERO (NRZ) 1 high signal; 0 low signal

0 0 1 0 1 0 1 1 0

Clock

– Does not posses any clocking component for ease of synchronization.– Is not Transparent. Long string of zeros causes loss of synchronization.

NRZ(non-return to zero)

Page 29: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

29

NON-RETURN TO ZERO INVERTED (NRZI) 1 make transition; 0 stay at the same level ว�ธุ น !สำ�ม�รถแกิ�ป%ญห�ข้�อื่ม�ล bit 1 ติ�ดติ+อื่กิ�นน�นๆได� แติ+ไม+

สำ�ม�รถแกิ�ป%ญห�ข้�อื่ม�ล bit 0 ติ�ดติ+อื่กิ�นได�

0 0 1 0 1 0 1 1 0

Clock

NRZI(non-return to zero

inverted)

Page 30: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

30

MANCHESTER 1 high-to-low transition; 0 low-to-high transition Solve Clock skew problem Disadvantages

signal transition rate doubled Because of the greater number of transitions it occupies a

significantly large bandwidth. Efficiency = 50%

0 0 1 0 1 0 1 1 0

Clock

Manchester

Page 31: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

T. S. Eugene Ng

eugeneng at cs.rice.edu

Rice University

31

4-BIT/5-BIT (100MB/S ETHERNET) Goal: address inefficiency of Manchester encoding, while avoiding

long periods of low signals Solution:

Use 5 bits to encode every sequence of four bits such that no 5 bit code has more than one leading 0 and two trailing 0’s

Use NRZI to encode the 5 bit codes Efficiency is 80%

0000 111100001 010010010 101000011 101010100 010100101 010110110 011100111 01111

1000 100101001 100111010 101101011 101111100 110101101 110111110 111001111 11101

4-bit 5-bit 4-bit 5-bit

Page 32: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

32

OTHER WAYS OF OTHER WAYS OF ENCODINGENCODING

Page 33: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

LET’S PUT THINGS TO THE PERSPECTIVE

Voice: 4 KHz requires 8000 sample per second

Quantization: Sample encoded by 7 bit

number 8000 samples/sec of 7 bits each

56kbps data stream

Color TV channel: about 5 MHz analog data 106 samples/sec, each encoded 10 bits:

100 Mbps data stream

Page 34: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

PULSE CODE MODULATION(PCM): VOICE Digitized voice: 56 Kbps data rate What’s the required channel bandwidth? Use Nyquist Theorem

Nyquist: Rmax < 2B* log2M

For Rmax = 56 Kbps, with M =2 we can use a

channel of B = 28 KHz channel

However, the original voice (analog)’s maximum frequency was 4KHz Why don’t we just use 4 KHz channel? Why do we have to digitize the voice?

34

Page 35: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

TYPES OF ERROR An error occurs when a bit is altered

between transmission and reception Single bit errors

only one bit alteredcaused by white noise

Burst errorsContiguous sequence of B bits in

which all of them are in errorCaused by impulse noise or by

fading in wirelessEffect greater at higher data rates

35

Page 36: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

ERROR DETECTION

Errors : change of ≥ 1 bit in a transmitted frame

Detection: using error-detecting code, called “Check Bits” added by transmitter recalculated and checked by receiver still chance of undetected error

36

Page 37: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

37

ERROR DETECTION PROCESS

Page 38: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

ERROR DETECTION SCHEME: PARITY CHECK Parity bit set so character has even (even parity) or

odd (odd parity) number of ones Example: If “A” (ASCII Code = 41 : 01000001) is

transmitted with “Odd Parity” algorithm. The transmitter will add “1” to the data, i.e. 101000001, to

make bit “1” to be odd (3 bits)

Correction Capability: Can only detect error but cannot correct error 38

7 bits of data

(number of 1s)

8 bits including parity

even odd

0000000 (0)

00000000 10000000

1010001 (3)

11010001 01010001

1101001 (4)

01101001 11101001

1111111 (7)

11111111 01111111

Page 39: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

ERROR DETECTION SCHEME: CYCLIC REDUNDANCY CHECK (CRC)

One of most common and powerful checks For block of k bits transmitter generates an

(n-k) bits frame check sequence (FCS) Transmits n bits which is exactly divisible by

some number Receiver divides frame by that number

No remainder assume no error

39

Page 40: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

40

TransmitterTransmitter

CYCLIC REDUNDANCY CHECK (CRC)

Data

FCSData

K bits

n-k bits

(Can be divided by predetermined number)n bits

FCSData

Divided by the same numberIf no remainder assume no error

ReceReceiveiverr

Page 41: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

41

Modulo 2 Arithmetic Polynomial Digital Logic

CYCLIC REDUNDANCY CHECK (CRC)

Page 42: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

42

MODULO 2 ARITHMETIC

T = transmitted frame (n bits)

D = Message or Block of Data (the first k bits of T)

F = FCS (the last n-k bits of T)

T = 2 n-k D + F

Page 43: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

43

P = the predetermined divisor (n-k+1 bits) Q = Quotient R = Remainder Note: Pattern of P depends on the types of

errors expected, but at least the highest & the lowest order of P must be “1”

Example: Using the preceding example, where

D = 1010001101 ; D(x) = x9 + x7 + x3 + x2 + 1

P = 110101 ; P(x) = x5 + x4 + x2 + 1

MODULO 2 ARITHMETIC2 n-k D = Q + R P P

Page 44: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

44

POLYNOMIALS

Page 45: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

WIDELY USED POLYNOMIALS CRC-12 = x12 + x11 + x3 + x2 + x + 1

CRC-12 (12-bits FCS) : for streams of 6-bits characters

CRC-16 = x16 + x15 + x2 + 1 CRC-16 (16-bits FCS) : for 8-bits characters, used in

North America

CRC-CCITT = x16 + x12 + x5 + 1 CRC-CCITT (16-bits FCS) : for 8-bits characters, used in

Europe

CRC-32 = x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10

+ x8 + x7 + x5 + x4 + x2 + x + 1 CRC-32 (32-bits FCS) : for some point-to-point

synchronous transmission and IEEE 802 LAN Standards45

Page 46: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

DIGITAL LOGIC Represented by a dividing circuit, consists of

XOR Gates and a Shift Register Shift Register

a string of 1-bit storage device has 1 output line & I Input line at each clock time, the value in the storage device is

replaced by the value indicated by its input line The circuit is implemented, as follows;

The Register contains n-k bits, equal to the length of the FCS

There are up to n-k XOR Gates. The presence or absence of a gate corresponds

to the presence or absence of a term in the divisor polynomial, P(x), excluding the term 1 and Xn-k.

46

Page 47: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

47

DIGITAL LOGIC

General CRC Architecture of Implement Divisor (1 + A1X + A2X2 + … + An-1Xn-k-1 + Xn-k)

Page 48: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

48

+ ++

+

ExampleData D = 1010001101 ; D(x) = x9 + x7 + x3

+ x2 + 1Divisor P = 110101 ; P(x) = x5 + x4 + x2 + 1

Page 49: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

MODULATING

Page 50: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

50

ANALOG ENCODING OF DIGITAL DATA: MODULATION

modulates a carrier signal A*cos(2fct + )

ASK change A FSK changes f PSK change

Page 51: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

HOMEWORK!!!: HAND IN AT THE BEGINNING OF THE NEXT CLASS

1. Encode 10010011100010101 using the following line codes:

a) NRZb) NRZIc) Manchester

2. Explain how the following line codes work and use them to encode the string of bits in the previous question

a) Bipolar or AMIb) Pseudoternaryc) Differential Manchester

Page 52: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

WORKSHEET FOR PROBLEM 1

1 0 0 1 0 0 1 1 1 0 0 0 1 0 1 0 1

Clock

NRZ 0

NRZI 0

Manchester 0

Page 53: T HE P HYSICAL L AYER Dr. Nawaporn Wisitpongphan.

WORKSHEET FOR PROBLEM 2

1 0 0 1 0 0 1 1 1 0 0 0 1 0 1 0 1

Clock

Differential Manchester 0

Pseudoternary0

Bipolar 0