0% found this document useful (0 votes)
42 views7 pages

Questions: Encoding and Framing

This document discusses encoding and framing in computer networks. It begins by explaining the difference between analog and digital signals, and periodic and aperiodic signals. It then discusses how data is converted to signals for transmission, and how signals are affected by noise over communication links. Modulation techniques are introduced for transmitting encoded signals over links. The document outlines key topics like the relationship between bandwidth and link rate, Fourier transforms, Nyquist's theorem, Shannon's theorem, encoding, and framing.

Uploaded by

meazaw
Copyright
© Attribution Non-Commercial (BY-NC)
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)
42 views7 pages

Questions: Encoding and Framing

This document discusses encoding and framing in computer networks. It begins by explaining the difference between analog and digital signals, and periodic and aperiodic signals. It then discusses how data is converted to signals for transmission, and how signals are affected by noise over communication links. Modulation techniques are introduced for transmitting encoded signals over links. The document outlines key topics like the relationship between bandwidth and link rate, Fourier transforms, Nyquist's theorem, Shannon's theorem, encoding, and framing.

Uploaded by

meazaw
Copyright
© Attribution Non-Commercial (BY-NC)
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/ 7

Questions

EECS 122: Why are some links faster than others?


Introduction to Computer Networks What limits the amount of information we can send on a
Encoding and Framing link?
How can we increase the capacity of a link?
Computer Science Division
Department of Electrical Engineering and Computer Sciences
University of California, Berkeley
Berkeley, CA 94720-1776

EECS F05 EECS F05 2

Signals: Analog vs. Digital Signals: Periodic vs. Aperiodic



Period: repeat over and over again, once per period

Signal: a function s(t) that varies with time (t stands for time)
- Period (T) is the time it takes to make one complete cycle

Analog: varies continuously - Frequency (f) is the inverse of period, f = 1/T;measured in hz
- Example: voltage representing audio (analog phone call)
Signal strength

T = 1/f

Digital: discrete values; varies abruptly 
Aperiodic: don’t repeat according to any particular pattern
- Example: voltage representing 0s an 1s

EECS F05 3 EECS F05 4

Attenuation
Data vs. Signal

data signal data


communication medium

data signal
Analog Telephone Analog

Digital Modem Analog

Analog CODEC Digital

Digital Digital Digital



Links become slower with distance because of signal
Transmitter attenuation

Amplifiers and repeaters can help
EECS F05 5 EECS F05 6

1
Noise Noise Limits the Link Rate

A signal s(t) sent over a link is generally
- Distorted by the physical nature of the medium
Suppose there were no noise
• This distortion may be known and reversible at the - Then, if send s(t) always receive s(t+ )
receiver - Take a message of N bits say b1b2….bN, and send a
n(t) - noise
- Affected by random physical effects pulse of amplitude of size 0.b1b2….bN
• Fading - Can send at an arbitrarily high rate
s(t) r(t)
• Multipath effects
transmitted signal received signal - This is true even if the link distorts the signal but in a
- Also interference from other links link known way
• Wireless
• Crosstalk
In practice the signal always gets distorted in an
unpredictable (random) way

Dealing with noise is what communications engineers do
- Receiver tries to estimate the effects but this lowers
the effective rate

EECS F05 7 EECS F05 8

Physical Layer Functions Block Diagram

Signal
Adaptor
Adaptor Adaptor
Adaptor

Adaptor: convert bits into physical signal and physical


signal back into bits
NRZI

Functions
1. Encode bit sequence into analog signal
2. Transmit bit sequence on a physical medium (Modulation)
3. Receive analog signal
4. Convert Analog Signal to Bit Sequence

EECS F05 9 EECS F05 10

Modulation Outline
The function of transmitting the encoded signal over a 

link, often by combining it with another (carrier signal) Relation between bandwidth and link rate


- E.g., Frequency Modulation (FM) Fourier transform


• Combine the signal with a carrier signal in such a way that the i - Nyquist’s Theorem
frequency of the received signal contains the information of - Shannon’s Theorem
the carrier
Encoding
1 1 0 0 1 1 1 0 0 1 1 1 0 0 1 1 1 0 0 1
Framing

Bit sequence Modulated signal Received signal Received


bit sequence
- E.g., Frequency Hopping (OFDM)
• Signal transmitted over multiple frequencies
• Sequence of frequencies is pseudo random
EECS F05 11 EECS F05 12

2
Fourier Transform Fourier Transform: Example

Any periodic signal g(t) with period T (=1/f) can be
constructed by summing a (possibly infinite) number of sin(2  f t) +
sines and cosines
∞ ∞
c + an sin (2πnft ) + bn cos (2πnft )
1
g (t ) =
2 n =1 n =1

1/3 sin(6 f t) =

To construct signal g(t) we need to compute the values a0,
a1, …, b0, b1, …, and c !

But it’s an infinite series...

Often the magnitude of the an’s and bn’s get smaller as the
frequency (n times 2πf ) gets higher.

g3(t)
Key point: a “reasonable reconstruction” can be often be
made from just the first few terms (harmonics)
Note: f = 1/T
- Tough the more harmonics the better the reconstruction…
EECS F05 13 EECS F05 14

Bandwidth & Data Rate Outline

 Physical media attenuate (reduce) different harmonics at 


Signal study
different amounts - Fourier transform
 After a certain point, no harmonics get through. 
Nyquist’s Theorem
 Bandwidth: the range of frequencies that can get through - Shannon’s Theorem
the link  Encoding
 Example:  Framing
- Voice grade telephone line 300Hz – 3300Hz
- The bandwidth is 3000Hz
 Data rate: highest frequency at which hardware can send
signal

EECS F05 15 EECS F05 16

Nyquist’s Theorem
(aka Nyquist’s Limit) Why Double the Frequency?
 Establish the connection between data rate and bandwidth (actually  Assume a sine signal, then
the highest frequency) in the absence of noise - We need two samples in each period to identify sine function
- Developed in the context of analog to digital conversion (ACDs) - More samples won’t help
 Say how often one needs to sample an analog signal to reproduce it
faithfully
 Suppose signal s(t) has highest frequency f
max
- Assume B = fmax, i.e., lowest frequency is 0

 Then, if T  1/(2B) it is possible to reconstruct s(t) correctly


 Niquist’s Theorem: Data rate (bits/sec) <= 2*B (hz)
EECS F05 17 EECS F05 18

3
Nyguist’s Theorem (cont’d) Outline

 Can you do better than Nyquist’s limit? 


Signal study
- Yes, if clocks are synchronized sender and receiver, we only need - Fourier transform
one sample per period - Nyquist’s Theorem
- This is because the synchronized starting sample counts as one 
Shannon’s Theorem
of the two points  Encoding
 Framing

EECS F05 19 EECS F05 20

Shannon Theorem Shannon Theorem (cont’d)

 Establish the connection between bandwidth and  Data rate in the presence of S/N is bounded as
data rate in the presence of noise follows
 Noisy channel
- Consider ratio of signal power to noise power. Data rate <= B log 2 (1 + S/N)
- Consider noise to be super-imposed signal
- Decibel (dB) = 10 log 10 (S/N) Example:
- S/N of 10 = 10 dB - Voice grade line: S/N = 1000, B=3000, C=30Kbps
- S/N of 100 = 20 dB - Technology has improved S/N and B to yield higher
- S/N of 1000 = 30 dB speeds such as 56Kb/s
 Higher bandwidth 

higher rate; Intuition:


- Signal has more space to “hide” from noise
- Noise gets “diluted” across frequency space

EECS F05 21 EECS F05 22

Outline Encoding

 Signal study 
Specify how bits are represented in the
- Fourier transform analog signal
- Nyquist’s Theorem - This service is provided by the physical layer
- Shannon’s Theorem Challenges: achieve:

Encoding - Efficiency – ideally, bit rate = clock rate
 Framing - Robust – avoid de-synchronization between sender
and receiver when there is a large sequence of 1’s
or 0’s

EECS F05 23 EECS F05 24

4
Assumptions Non-Return to Zero (NRZ)
 1 high signal; 0 low signal
 We use two discrete signals, high and low, to
 Disadvantages: when there is a long sequence of 1’s or 0’s
encode 0 and 1 - Sensitive to clock skew, i.e., difficult to do clock recovery
 The transmission is synchronous, i.e., there is a
- Difficult to interpret 0’s and 1’s (baseline wander)
clock used to sample the signal
- In general, the duration of one bit is equal to one or two
clock ticks 0 0 1 0 1 0 1 1 0
 If the amplitude and duration of the signals is
large enough, the receiver can do a reasonable NRZ
job of looking at the distorted signal and (non-return to zero)
estimating what was sent.
Clock

EECS F05 25 EECS F05 26

Non-Return to Zero Inverted (NRZI) Manchester


 1 

make transition; 0


stay at the same level  1  high-to-low transition; 0  low-to-high transition


 Solve previous problems for long sequences of 1’s,  Addresses clock recovery and baseline wander problems
 Disadvantage: needs a clock that is twice as fast as the transmission
but not for 0’s rate
- Efficiency of 50%

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

NRZI
Manchester
(non-return to zero
intverted)

Clock Clock

EECS F05 27 EECS F05 28

4-bit/5-bit (100Mb/s Ethernet) Outline


 Goal: address inefficiency of Manchester encoding, while avoiding long  Signal study
periods of low signals
 Solution: - Fourier transform
- Use 5 bits to encode every sequence of four bits such that no 5 bit code has - Nyquist’s Theorem
more than one leading 0 and two trailing 0’s
- Use NRZI to encode the 5 bit codes - Shannon’s Theorem
- Efficiency is 80%
 Encoding

4-bit 5-bit 4-bit 5-bit Framing
0000 11110 1000 10010
0001 01001 1001 10011
0010 10100 1010 10110
0011 10101 1011 10111
0100 01010 1100 11010
0101 01011 1101 11011
0110 01110 1110 11100
0111 01111 1111 11101

EECS F05 29 EECS F05 30

5
Byte-Oriented Protocols: Sentinel
Framing Approach
8 8

Specify how blocks of data are transmitted between STX Text (Data) ETX
two nodes connected on the same physical media
 STX – start of text
- This service is provided by the data link layer
 ETX – end of text
Challenges  Problem: what if ETX appears in the data portion of the
- Decide when a frame starts/ends frame?
 Solution
- If use special delimiters, differentiate between the true frame
delimiters and delimiters appearing in the payload data - If ETX appears in the data, introduce a special character DLE
(Data Link Escape) before it
- If DLE appears in the text, introduce another DLE character
before it
 Protocol examples
- BISYNC, PPP, DDCMP

EECS F05 31 EECS F05 32

Byte-Oriented Protocols: Byte


Counting Approach Bit-Oriented Protocols
8 8
 Sender: insert the length of the data (in bytes) at Start
Text (Data)
End
sequence sequence
the beginning of the frame, i.e., in the frame

header Both start and end sequence can be the same
 Receiver: extract this length and decrement it - E.g., 01111110 in HDLC (High-level Data Link Protocol)
 Sender: in data portion inserts a 0 after five consecutive 1s
every time a byte is read. When this counter  Receiver: when it sees five 1s makes decision on the next two bits
becomes zero, we are done - If next bit 0 (this is a stuffed bit), remove it
- If next bit 1, look at the next bit
• If 0 this is end-of-frame (receiver has seen 01111110)
• If 1 this is an error, discard the frame (receiver has seen 01111111)

EECS F05 33 EECS F05 34

Clock-Based Framing (SONET) SONET Multiplexing

 SONET (Synchronous Optical NETwork) FH STS-1


 Developed to transmit data over optical links
FH STS-1 FH STS-3c
- Example: SONET ST-1: 51.84 Mbps
- Many streams on one link FH STS-1
 SONET maintains clock synchronization across

several adjacent links to form a path STS-3c has the payloads of three STS-1’s byte-wise
interleaved.
- This makes the format and scheme very complicated  STS-3 is a SONET link w/o multiplexing
 For STS-N, frame size is always 125 microseconds
- STS-1 frame is 810 bytes
- STS-3 frame is 810x3 =2430 bytes

EECS F05 35 EECS F05 36

6
STS-1 Frame Clock-Based Framing (SONET)

 First two bytes of each frame contain a special bit pattern that  Details:
allows to determine where the frame starts
 - Overhead bytes are encoded using NRZ
No bit-stuffing is used
 Receiver looks for the special bit pattern every 810 bytes - To avoid long sequences of 0’s or 1’s the payload is
XOR-ed with a special 127-bit pattern with many
- Size of frame = 9x90 = 810 bytes
transitions from 1 to 0

Data (payload)
overhead
9 rows

SONET STS-1 Frame

90 columns

EECS F05 37 EECS F05 38

What do you need to know?

 Concept of bandwidth and data rate


 Nyquist’s Theorem
 Shannon’s Theorem
 Encoding
- Understand (not memorize) NRZ, NRZI, Manchester,
4/5 bit
 Framing
- Understand framing for bit/byte oriented protocols and
clock based framing

EECS F05 39

You might also like