0% found this document useful (0 votes)
21 views24 pages

Week 04 - M5 Frames and Errors

Computer communications Framing and Errors

Uploaded by

Pankaj
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)
21 views24 pages

Week 04 - M5 Frames and Errors

Computer communications Framing and Errors

Uploaded by

Pankaj
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/ 24

EEL5718/4598

Frames and Errors

• Reading Reference: Leon-Garcia textbook


• Section 3.9 Error Detection and Correction
Reminder: Physical Layer

• Definition:
• Defines the transmission and reception of an unstructured raw bit
stream over a physical medium.
• Transmission technique (digital, analog)
• Modifies the simple digital signal pattern to better accommodate the
characteristics of the physical medium, and to aid in bit and frame
synchronization
• Electrical/optical, mechanical, and functional interfaces to the
physical medium
• Electrical/optical: modulation, signal strength, voltage levels, bit times…
• Mechanical: cable, plugs, pins...
• functional/procedural: how to activate, maintain, and deactivate links…
• Carries the signals for all of the higher layers

McNair EEL5718/4598 Computer Communications 2


Reminder: Data Link Layer

• Definition from Leon-Garcia, Chapter 2:


• “Provides for the transfer of frames (blocks of
information) across a transmission link that
directly connects two nodes.”
• Framing, Synchronization (Section 5.4)
• “Also inserts control info, local address info and
check bits to enable recovery from transmission
errors, as well as flow control.“
• Error Control (Chapter 3), Flow Control (Chapter 5)

McNair EEL5718/4598 Computer Communications 3


Reminder: One hop Communication System
Telecommunication System
Generates Processes Signals Processes
Generates Signals
Data Data
Signals pass through the
Source Transmitter Transmission Channel
Receiver Destination

Include:
Sampling/interpolating
Quantizing
Amplification
Filtering
Etc.

McNair EEL5718/4598 Computer Communications 4


Data Link Layer Frames and
Acknowledgements (ACKs)
Data Frame

Generates CRC Processes


Data Datagram Header Data
(Higher layers) Data frames (Higher layers)

Receiver
Transmitter
Data frame Error Check. Then
Control frames Processes Send ACK or NACK
Generates Signals pass through the Signals
Signals Transmission Channel
Control frame

Header contains
CRC
ACK or NAK
McNair EEL5718/4598 Computer Communications 5
Framing Synchronous Transmissions
• Two levels
• Clock
• Separate clock line (one short pulse per bit time)
• Embedded clock within the data
(e.g., Manchester, or use of Sinusoids)
• Frame delineation
• Send long streams of bits in frames

Preamble Postamble
Bits Control Control Bits
Fields Data Bits Fields
(aka Start Flag) (akaEndFlag)

McNair EEL5718/4598 Computer Communications 6


Clocked Data versus Non-Clocked Data
Data Transmitted 0 1 0 1 1 0 0

+5 volts

Manchester Code

-5 volts

+5 volts
NRZ

-5 volts

McNair EEL5718/4598 Computer Communications 7


Frame Delineation
• Use flags to mark the beginning and end of a frame.
• The flag is usually a pattern that is not allowed to appear
within the data of the frame.

• Some common patterns


Preamble | frame contents | Post-amble
• 01111110 | …data… | 01111110
• DLE STX |…data…| DLE ETX
• Encoding Violations
E.g., for Manchester Coding, several bit periods with no transitions
could be used to indicate start/end frame

• Need agreed upon protocol to remove flags that randomly


appear in the data field:
• Bit Stuffing
• If flag is 01111110, then the transmitter inserts a 0 every time 5
consecutive ones appear in the data.
McNair EEL5718/4598 Computer Communications 8
Framing Example
The bits below represent a data stream.
If the transmitter protocol uses the start/end flag
“01111110” and the bit stuffing protocol…
A) What bit pattern will be transmitted?
B) How does the receiver interpret the incoming pattern?

10110111111011111010

McNair EEL5718/4598 Computer Communications 9


Framing Example (continued)
Communication System
Generates
Data
(Higher layers)

10110111111011111010
Processes Signals Processes
Generates Signals
Data
Signals pass through the
Source Transmitter Transmission Channel
Receiver Destination

McNair EEL5718/4598 Computer Communications 10


Asynchronous Transmission

• Receiver clock is free-running and not


synchronized to the transmitter clock
• Transmit data in short blocks (no slippage)
with start/end bits
Idle
Data Parity Stop Line
Idle Start Data or
Line bit Bit 1 Bit 8 bit element
Start
bit

Short Block - Character


McNair EEL5718/4598 Computer Communications 11
Universal Asynchronous
Receiver/Transmitter (UART) Interface

McNair EEL5718/4598 Computer Communications 12


UART Interface Frame

• UART (Serial Port) Interface


One frame

Start b b b b b b
3.3V
Serial port
0 2 3 4 b b 7
Stop
1 5 6 0V

• Send/receive a frame of (5-8) data bits with a single


(start) bit prefix and a single or double (stop) bit
suffix

McNair EEL5718/4598 Computer Communications 13


UART Serial data-transmission
The Transmitter Holding Register (8-bits) Software outputs a byte
of data to the THR
0 1 1 0 0 0 0 1
The bits are immediately
copied into an internal
‘shift’-register

The bits are then shifted out,


one-at-a-time, in sync
with a clock-pulse

0 1 1 0 0 0 0 1 1-0-1-1-0-0-0-0-1-0

The transmitter’s internal ‘shift’ register data-bits

Adds Adds
clock clock-pulses stop start
trigger bit-shifts bit bit
McNair EEL5718/4598 Computer Communications 14
UART Serial data reception
input voltage

clock
Receiver clock-pulses trigger
voltage-sampling and
bit-shifts at regular intervals
The receiver’s internal ‘shift’ register

1-0-1-1-0-0-0-0-1-0 0 1 1 0 0 0 0 1
data-bits

Detect and Detect and


delete delete
stop start
bit bit Higher layer
software can
0 1 1 0 0 0 0 1 process the
received Byte
from the RBR
The Receiver Buffer Register (RBR) (8-bits)

McNair EEL5718/4598 Computer Communications 15


Example

• An asynchronous transmission scheme uses


• 8 data bits, an even parity bit, and a stop element of
length 2 bits.
• Assuming…
• Bit samples are taken at the middle of the clock period.
• At the beginning of the start bit the clock and incoming
bits are in phase
• What percentage of clock inaccuracy can be
tolerated at the receiver with respect to the
framing error?

McNair EEL5718/4598 Computer Communications 16


Outline

• Data Link Layer


• Framing
• Bit Errors
• Error Control Coding

McNair EEL5718/4598 Computer Communications 17


Sources of Transmission Channel Errors

• Thermal noise {Shannon}


• Impulse noise (e..g, arcing relays)
• Signal distortion during transmission (attenuation)
• Crosstalk
• Voice amplitude signal compression (companding)
• Quantization noise (PCM)
• Jitter (variations in signal timings)
• Receiver and transmitter out of synch

McNair EEL5718/4598 Computer Communications 18


Errors - Noise versus Interference
• Noise
• Signals produced by natural sources
(random and unpredictable signals produced
internal or external to the system, e.g.,
thermal noise)
• Interference
• Contamination from human sources
(other transmitters, machinery, circuits, etc.)

McNair EEL5718/4598 Computer Communications 19


Characterizing Errors – Error Patterns

• Transmitted Signal: T = (b1,b2, …, bn)


• Error Vectors in Channel: E = (e1,e2,…,en)
• ei = 0  no error at bi
ei = 1  error occurred at bi
• Random Error Vector
• All possible patterns of E are equally likely
• Random Bit Error
• Each bit error occurs independently, with probability p
Bit Error Rate (BER) = p
• Received signal: T + E = b XOR e
• Where XOR: 1(+)1=0, 1(+)0=1, 0(+)0=0)

McNair EEL5718/4598 Computer Communications 20


Bit Error Rate (BER)

• Bit Error
• BER=10-2 means:
On average, 1 out of every 100 bits is an error
• Burst Errors
• BER=10-2 burst adds more info about channel conditions.
For example, say 100 out the first 100 bits are errors, and
the next 9900 bits are correct
• Typical BER values:
• Electrical link, BER 10-9
• Optical link, BER 10-12
• Wireless link, BER 10-2

McNair EEL5718/4598 Computer Communications 21


Example

• Suppose 2 bits are being transmitted in a


channel, i.e., T = (b1,b2,…bn), n=2.
• Calculate the probability that there is a one-bit
error in the transmitted codeword?
• A) Assume random error patterns (vectors)
• B) Assume random independent bit errors

McNair EEL5718/4598 Computer Communications 22


(Will do this one in the Problem Session)

Example

• For a frame of n=1000 bits, what is the


probability that the frame has arrived at
the receiver with errors, i.e., what is the
probability that there is at least one bit
error in the frame?
• Assume random independent bit errors, with
BER=10-3

McNair EEL5718/4598 Computer Communications 23


Summary
• Transmission media carry varying levels of noise and
errors. Especially wireless networks, where the
correct set of bits may never arrive.
• Error control protocols can be implemented to ensure
that the frames arrive correctly at the destination or to
be able to detect when there are errors.
• The first step is to characterize the transmission
channel, which means to determine the correct
mathematical model to represent the channel errors.

McNair EEL5718/4598 Computer Communications 24

You might also like