1 physical layer: data encoding & transmission. 2 network interface card (nic) ll in part, pl in...
Post on 20-Dec-2015
221 views
TRANSCRIPT
1
Physical Layer:Data Encoding &
Transmission
2
Network Interface Card (NIC)
• LL in part, PL in total are implemented in NIC– Ethernet card, 802.11 card, …– NIC is semi-autonomous
• Listens to the link independent of the CPU• Talks to CPU after reception of a new frame• CPU talks to the card to send a frame
– Has connectivity to both the I/O bus and the network link
CPU
cache
Memory
I/O Bus Link
Businterface
Linkinterface
NICI/O Bus Interface
PCILink
Interface
LinkInterface
3
Steps in Transmission of a Datagram to a Neighbor
Datagram
DatagramH
DatagramH EDC
Bit error prone link
Datagram
DatagramH
D’ EDC‘
LL
Allbits in D’
OK?N
Detected error
Y
Encode Bits to the Link
LL
Decode Bits from the Link
PL PL
4
Encoding - Definitions• Data: Something which
carries meaning– Can be analog, e.g., radio, TV
signals or digital such as data files etc.
– For this course, we are ONLY interested in digital data encoding
• Signal: Encoded data, i.e., what is transferred on the link (wired or wireless)– Analog: Represents data with
continuously varying electromagnetic waves
– Digital: Represents data with a sequence of voltage pulses
LL Frame
Datagram
DatagramH
DatagramH EDC
Add Framing Information
Encode Bits to the Link PL
LL
Link
5
Encoding Digital Data• Digital Data (0s and 1s) can be encoded as
an Analog Signal– Signal on the link is an electromagnetic wave of
some frequency– Signal can also be photonic pulses of a given
wavelength over optical fiber
• 3 general methods– Amplitude Shift Keying– Frequency Shift Keying– Phase Shift Keying
6
Digital Data to Analog Signal:ASK
Digital Data = m(t) Modem Analog Signal = s(t)
s(t) = A cos(2*PI*fc*t) – binary 1s(t) = 0 – binary 0
7
Digital Data to Analog Signal:FSK
Digital Data = m(t) Modem Analog Signal = s(t)
s(t) = A cos(2*PI*f1*t) – binary 1s(t) = A cos(2*PI*f2*t) – binary 0
8
FDM + FSK on Voice Grade Line
• Full-duplex FSK transmission on a Voice-Grade Line:– The frequency band 300Hz-3400Hz is divided into to halves:
• 300Hz-1850Hz & 1850-3400Hz – Frequency Division Multiplexing– Then– Frequencies 2025 & 2225 are used to encode 1 and 0 in one direction– Frequencies 1070 & 1270 are used to encode 1 and 0 in the other direction
9
Digital Data to Analog Signal: PSK
Digital Data Modem Analog Signal
s(t) = A cos(2*PI*fc*t + PI) – binary 1s(t) = A cos(2*PI*fc*t) – binary 0
QPSK usess(t) = A cos(2*PI*fc*t + PI/4) – binary 11s(t) = A cos(2*PI*fc*t + 3*PI/4) – binary 10s(t) = A cos(2*PI*fc*t + 5*PI/4) – binary 00s(t) = A cos(2*PI*fc*t + 7*PI/4) – binary 01
• Each signaling element carries 2 data elements
– Signaling element rate: Baud-rate– Data element rate: Bit-rate
10
Encoding Digital Data• Digital Data (0s and 1s) can also be encoded as a
“Digital Signal”– Signal on the link are discrete, discontinuous voltage pulses– Each pulse is a signal element– Binary data encoded into signal elements– E.g., 2 voltage levels, one of them representing digital 0, the
other one representing digital 1
• Lots of different encoding methods– Non-Return to Zero (NRZ)– Manchester Encoding– 4B/5B– NRZ-I– NRZ-M– Bi-Phase-Mark, Bi-Phase-Space– Differential Bi-Phase-Space, Differential Bi-Phase-Mark– …
11
Digital Data to Digital Signal: NRZ
• Non-Return to Zero (NRZ)– 1=high signal (+5V), 0=lower signal (-5V)– One-to-one correspondence between data &
signal0 1 0 0 1 1 0 0 0 1 1
Digital Data
Digital Signal
Digital Data Encoder
Digital Signal
12
Manchester Encoding
0 1 0 0 1 1 0 0 0 1 1Digital Data
• Manchester Encoding – Used in Ethernet– 0 is encoded as low to high transition– 1 is encoded as high to low transition– Not very efficient
• Signaling rate (baud-rate) is twice the data rate (bit-rate)
Clock
Digital Signal
13
4B/5B• Attempts to address the inefficiency of the Manchester
encoding without suffering from the problem of having extended durations of high or low signals as was the case in NRZ
• Idea is to insert extra bits into the bit stream so as to break up long sequences of 0s and 1s– Specifically, every 4-bit of actual data is encoded into a 5-bit
code that is then transmitted to the receiver using NRZI
0000 111100001 010010010 101000011 101010100 010100101 010110110 011100111 01111
1000 10010
1001 10011
1010 10110
1011 10111
1100 11010
1101 11011
1110 11100
1111 11101
4-bitData Symbol
5-bitCode
4-bitData Symbol
5-bitCode
14
Encoding Digital Data
• Why use an analog signal to carry digital data?– Because some mediums only propagate analog
signals• Optical fiber, air (unguided media)
– Because the network was designed to receive, switch and transmit analog signals
• PSTN handles analog signals in the voice range of about 300-3400Hz.
• Why do digital data-to-digital signal encoding?– Equipment for encoding digital data into digital
signal is less complex and less expensive
15
Transmission of Encoded DataSender Receiver
Digital SignalNRZ
• After encoding the digital data, the sender simply puts the signal on the wire as shown above
• How does the receiver decode this signal?– Receiver must sample on the middle of each signaling
element as shown above
• Problem:– How do you synchronize the sender & receiver clocks?
16
Sender/Receiver Clocking• Timing problems require a mechanism to
synchronize the sender and the receiver• Two mechanisms
– Provide a separate line to send the clock signal from the sender to the receiver. The receiver then uses the same clock to decode the incoming signal
• OK for short distances, but not practical for long distances• Way too $$
– Let the sender and receiver use independent clocks• Independent clocks can easily get out of sync. Then,• Have the receiver synch its clock from the incoming signal• Called Self-Clocking
17
Self-Clocking Transmission• Two ways to sync the sender and the receiver
during self-clocking transmission– Asynchronous Transmission
• Data transmitted one character at a time with start/stop bits
– Each char is 5 to 8 bits
• Timing only needs to be maintained within each character• Re-sync after each character
– Synchronous Transmission• Data transmitted as a stream of bits with no start or stop
bits• The receiver must synch itself using the incoming signal
– Signal must have enough transitions to let the receiver sync itself from the signal
18
Asynchronous (diagram)
19
Asynchronous - Behavior• In a steady stream, interval between characters is
uniform (length of stop element)• In idle state, receiver looks for transition 1 to 0
– Start bit
• Then samples next 7 or 8 intervals (char length)• Then looks for next 1 to 0 for next char
• Simple• Cheap• Overhead of 2 or 3 bits per char (~20%)• Good for data with large gaps (keyboard)• Used in RS-232 Serial Port Communication
20
Synchronous Transmission• Block of data transmitted without start or
stop bits• How to synchronize clocks?
– Need to have enough transitions on the signal• Manchester encoding: a transition for every bit makes
clock recovery very easy
• 4B/5B: Make sure there will be enough transitions within the signal regardless of the bit-stream, while keeping the overhead at 20% -- Used by some Ethernets
• NRZ: Long stream of 0’s or 1’s make clock recovery almost impossible. So NRZ is almost never used in synchronous transmission
21
Summary• Covered Digital Data Encoding Methods
– Digital Data-to-Analog Signal Encoding (Modulation)• ASK• FSK• PSK
– Digital Data-to-Digital Signal Encoding• NRZ• Manchester• 4B/5B• …
• Covered transmission of encoded data over the link– Asynchronous Transmission: Data transmitted one
character at a time with start/stop bits
– Synchronous transmission: Data transmitted as a stream of bits with no start or stop bits