# lecture 03 Data encoding

```Lecture 03
Data Encoding and transmission
ECEG 4291
1
Introduction
• Data transmission occurs between transmitter
and receiver over some transmission medium.
• Transmission media may be classified as guided
or unguided.
• With guided media, the waves are guided along a
physical path
– E.g: twisted pair, coaxial cable, and optical fiber.
• Unguided media, also called wireless, provide a
means for transmitting electromagnetic waves
but do not guide them
– E.g: propagation through air, vacuum, and seawater.
2
Terminologies
• Direct link: used to refer to the transmission path
between two devices in which signals propagate directly
from transmitter to receiver with no intermediate
devices
• Point to point: is a direct link between two devices and
those are the only two devices sharing the medium.
• Multipoint: more than two devices share the same
medium.
3
Terminologies (Cont’d)
• Simplex transmission: signals are transmitted in
only one direction; one station is transmitter
• Half-duplex operation: both stations may
transmit, but only one at a time
• Full-duplex operation: both stations may
transmit simultaneously
4
Data Transmission
5
Introduction
• All of the forms of information (voice, data,
image, video) can be represented by EM signals.
• Computer networks are designed to transfer
data from one point to another. During transit
data is in the form of electromagnetic signals.
• Depending on the transmission medium and the
communications environment, either analog or
digital signals can be used to convey information
6
Time Domain Concepts
• An analog signal is one in which the signal intensity varies in
a smooth fashion over time
 There are no breaks or discontinuities in the signal
 Has infinite values in a range
• A digital signal is one in which the signal intensity maintains
a constant level for some period of time and then abruptly
changes to another constant level
 Has limited number of defined values
• Periodic signals
 The same signal pattern repeats over time
 s(t) = s(t + T)
• Aperiodic signals
 Pattern not repeated over time
7
Analog vs Digital signals
8
Periodic Signals
9
Frequency Domain Concepts
• In practice, an electromagnetic signal will be made
up of many frequencies.
• For example, the signal:
– Has two components of sine waves with freq of f and 3f
• By adding together enough sinusoidal signals, each
with the appropriate amplitude, frequency, and
phase, any electromagnetic signal can be
constructed.
10
11
Analog and Digital Data Transmission
• Data
Entities that convey meaning
• Signals
Electromagnetic representations of data
• Transmission
Communication of data by propagation and
processing of signals
12
Analog and Digital Data
• Analog
Continuous values within some interval
e.g. sound, video
• Digital
Discrete values
e.g. text, integers
13
Data and Signals
• Usually use digital signals for digital data and
analog signals for analog data
• Can use analog signal to carry digital data
Modem
• Can use digital signal to carry analog data
Compact Disc audio
14
Analog Signals Carrying Analog and
Digital Data
15
Digital Signals Carrying Analog and
Digital Data
16
Analog Transmission
• Analog signal is transmitted without regard to
content
May be analog or digital data
• The signal is attenuated over distance but uses
amplifiers to boost signal
• The noise is also amplified
17
Digital Transmission
• Concerned with content
• Integrity of data endangered by noise,
attenuation etc.
• Repeaters used to extract the bit pattern and
retransmit to overcome attenuation
• Unlike analog transmission, noise is not
amplified
18
digital transmission
• The principal advantages of digital signaling
are that
it is generally cheaper than analog signaling
and is less susceptible to noise interference.
• The principal disadvantage is that
 digital signals suffer more from attenuation than
do analog signals.
19
Transmission Impairments
from signal transmitted from the sender and it
has the following effect
In analog transmission, degradation of signal quality
In digital transmission, bit errors occur
• The degradation of signal quality or bit errors
are caused by
Attenuation
Delay distortion
Noise
20
Attenuation
• Occurs when signal strength falls off with distance
• Depends on medium
 must be strong enough to be detected
 must be sufficiently higher than noise to be received without
error or otherwise there will be loss of information
• Attenuation is an increasing function of frequency
Fig: Digital signal attenuation
21
Delay Distortion
• Occurs because the velocity of propagation of a signal
through a guided medium varies with frequency
• The received signal is distorted due to varying delays
• Consider that a sequence of bits is being transmitted
Because of delay distortion, some of the signal
components of one bit position will spill over into other
bit positions
causing intersymbol interference, which is a major
limitation to maximum bit rate over a transmission
channel.
22
Noise
• Additional unwanted signals inserted somewhere
between transmission and reception is called noise.
• Four types of noise
• Thermal noise
Due to thermal agitation of electrons, function of temp
Is present in all electronic and transmission media
Also called white noise
• Intermodulation noise
Signals that are the sum or difference of original
frequencies sharing the same transmission medium
23
• Crosstalk
Noise (cont’d)
– A signal from one line is picked up by another
• Impulse noise
– Irregular pulses or spikes of short duration and
high amplitude
– Generated from variety of sources
– e.g. External electromagnetic interferences
(lightening, faults in systems)
– Not primary problem in analog transmission
24
Transmission Media
25
Overview
• Transmission medium: is a material substance
(solid, liquid, gas) which can propagate energy
waves.
• The absence of medium (vacuum) can also be
thought of as a txn medium for EM waves such
• Transmission media can be
• Guided media (wired)
• Unguided media (wireless)
26
Guided media
• Guided Transmission Media uses a "cabling"
system that guides the data signals along a
specific path.
• The data signals are bound by the "cabling"
system.
• Common guided media types
– Twisted cable
– Coaxial cable
– Optical fiber
27
Unguided Transmission Media
• Consists of a means for the data signals to travel
but nothing to guide them along a specific path.
• There are four types of unguided or wireless
media
Terrestrial Microwave
Satellite Microwave
Infrared
• Key concerns are data rate and distance
28
Twisted pair:
Guided media
• The wires in Twisted Pair cabling are twisted together in
pairs.
• Each pair would consist of a wire used for the +ve data
signal and a wire used for the -ve data signal
• To further improve noise rejection, a foil or wire braid
shield is woven around the twisted pairs.
• This "shield" can be woven around individual pairs or
around a multi-pair conductor (several pairs).
• Cables with a shield are called Shielded Twisted Pair
(STP)
• Cables without a shield are called Unshielded Twisted
Pair (UTP).
• Twisting the wires together reduces signal interference
29
Guided media
Unshielded twisted-pair (UTP):
• UTP cabling is the most common networking media
• Is terminated with RJ-45 connectors and is used for
interconnecting network hosts with intermediate
networking devices, such as switches and routers.
• In LANs, UTP cable consists of four pairs of color-coded
wires that have been twisted together and then
encased in a flexible plastic sheath which protects from
minor physical damage.
• The twisting of wires helps protect against signal
interference from other wires.
• The color codes identify the individual pairs and wires
in the pairs and aid in cable termination.
30
UTP cable
Guided media
31
Guided media
Shielded twisted pair (STP):
• It provides better noise protection than UTP cabling.
• Like UTP cable, STP uses an RJ-45 connector.
• STP cable combines the techniques of shielding to counter
EMI and RFI and wire twisting to counter crosstalk.
• Two common variations of STP:
– STP cable shields the entire bundle of wires with foil
eliminating virtually all interference
– STP cable shields the entire bundle of wires as well as the
individual wire pairs with foil eliminating all interference.
• Uses four pairs of wires
• Originally used in Token Ring network installations.
• The new 10 GB standard for Ethernet has a provision for
the use of STP cabling
32
STP cable:
Guided media
33
Guided media
Twisted pair cable categories: Cables are placed into
categories according to their ability to carry higher bandwidth rate
• Cat 3
– up to 16Mbps
– Mostly used in phone lines
– Twist length of 7.5 cm to 10 cm
• Cat 4
– Was not much popular
• Cat 5
– up to 100Mbps but can also
support 1000Mbps
– Used for data transmission
– Much tightly twisted than cat3
and cat4, Twist length 0.6 cm to
0.85 cm
• Cat 5E (Enhanced)
– Used for data transmission
– Supports 1000Mbps
• Cat 6
– Used for data transmission
– a cable standard for Gigabit
Ethernet but can also support
until 10GE
– Backward compatible
• Cat 7
– Backward compatible
– Standard for 10GE can
support beyond
34
UTP vs STP:
Guided media
Unshielded Twisted Pair (UTP) Shielded Twisted Pair (STP)
• Metal shielding reduces
• Ordinary telephone wire
interference
• Cheapest, and Easiest to
• Provides better
install
performance
• Suffers from external EM
• Harder to handle (thick,
interference
heavy)
• Commonly used for LAN
• More expensive than UTP
35
Guided media
UTP cabling:
• TIA/EIA-568 describes the commercial cabling
standards for LAN installations
• Some of the elements defined are:
– Cable types
– Cable lengths
– Connectors
– Methods of testing cable
36
Guided media
Pin connections of twisted pair cable:
37
Guided media
Straight through vs cross over cables:
38
Guided media
Coaxial cable:
• A copper conductor is used to transmit the electronic
signals.
• The copper conductor is surrounded by a layer of
flexible plastic insulation.
• The insulating material is surrounded in a woven
copper braid, or metallic foil, that acts as the second
wire in the circuit and as a shield for the inner
conductor.
• This second layer, or shield, also reduces the amount
of outside electromagnetic interference.
39
Guided media
Coaxial cable (cont’d):
• The entire cable is covered with a cable jacket to
protect it from minor physical damage.
• Coaxial cable was traditionally used in cable
television and in early Ethernet installations.
• UTP cable has essentially replaced coaxial cable in
modern Ethernet installations
• The coaxial cable design has been adapted for use in:
– Wireless installations: Coaxial cables attach antennas to
wireless devices.
– Cable Internet installations: Cable service providers are
currently converting their one-way systems to two-way
systems to provide Internet connectivity to their
customers.
40
Guided media
Coaxial cable and connectors
Coaxial cable
Coaxial cable connectors
41
Fiber optic cable:
Guided media
• An optical fiber is very thin and it is composed of two kinds of
glass and a protective outer shield. Specifically, these are the:
• Core: Consists of pure glass and is the part of the fiber where
light is carried.
• Cladding: The glass that surrounds the core and acts as a
mirror. The light pulses propagate down the core while the
cladding reflects the light pulses. This keeps the light pulses
contained in the fiber core
• Jacket: Typically a PVC jacket that protects the core and
cladding. It may also include strengthening materials.
• Although susceptible to sharp bends, the properties of the
core and cladding have been altered at the molecular level to
make it very strong.
42
Guided media
Fiber optic cable
43
Guided media
• Fiber-optic cables can be broadly classified into two
types: single mode and multi mode
• Single-mode fiber (SMF):
– Consists of a very small core and uses expensive laser
technology to send a single ray of light.
– It has a 9 microns glass core and a glass cladding of 125 microns
of diameter
– Popular in long-distance situations spanning hundreds of
kilometers
– Expensive compared to multi mode fiber
SM fiber
44
Guided media
• Multimode fiber (MMF):
– Consists of a larger core (50/62.5 microns) and uses LED
emitters to send multiple light pulses.
– The glass cladding has a diameter of 125 microns
– Specifically, light from an LED enters the multimode fiber
at different angles.
– Popular in LANs because they can be powered by low cost
LEDs.
– link lengths of up to 550 meters.
MM fiber
45
Guided media
Fiber connectors:
• An optical fiber connector terminates the end of an optical fiber.
• A variety of connectors are available. The main differences among
the them are dimensions and methods of mechanical coupling.
• The four most popular network fiber-optic connectors include:
• Straight-Tip (ST): An older connector widely used with multimode
fiber.
• Ferrule Connector (FC): used for single-mode fibers and is mainly
used in high speed fiber optic communication links
• Subscriber Connector (SC): widely adopted LAN and WAN
connector that uses a push-pull mechanism to ensure positive
insertion.
– This connector type is used with multimode and single-mode fiber.
• Lucent Connector (LC): is quickly growing in popularity due to its
smaller size.
– It is used with single-mode fiber and also supports multimode fiber.
46
Guide media
Fiber cable connectors
47
Unguided media
Wireless Transmission Frequencies:
• 2GHz to 40GHz (Microwave frequencies)
– Terrestrial microwave and Satellite communications
– Highly directional
– Point to point communications
• 30MHz to 1GHz (Radio frequencies)
– Omini-directional applications
• 3 x 1011 to 2 x 1014 Hz (Infrared range)
– useful to local point-to-point and multipoint applications
within confined areas
• For unguided media, transmission and reception are
achieved by means of an antenna.
48
Unguided media
Terrestrial Microwave:
• Communicated using Focused beam (narrow beam)
• Line of sight: Tx and Rx must see each other
• directional
• Higher frequencies give higher data rates
• Usually located at substantial heights above ground
level
• To achieve a long-distance transmission, a series of
microwave relay towers is used.
• Used in long-haul telecommunications service as
alternative to coaxial cables
49
Unguided media
Satellite Microwave:
• Satellite is relay station (a microwave relay station)
• Satellite receives on one frequency, amplifies or
repeats signal and transmits on another frequency
• Requires geo-stationary orbit
– Height of 35,784km
• Common applications of satellite microwave include:
– Long distance telephone
– Global positioning
50
Unguided media
Satellite Microwave:
51
Unguided media
• Satellite Microwave:
52
Unguided media
• Satellite Microwave: The satellite provider can divide the total
capacity into a number of channels and lease these channels to
E.g: very small
aperture terminal
(VSAT) system
VSAT network
53
Unguided media
• Omni-directional:- does not require dish-shaped
antennas, and the antennas need not be rigidly
mounted to a precise alignment.
• Radio encompasses frequencies range of 3khz to
– UHF and VHF television
• Suffers from multipath interference
– Reflections
54
Unguided media
Infrared:
• Achieved using transmitters and receivers (or
transceivers)
• Transceivers must be within the light of sight
• No frequency allocation
• Line of sight (or reflection)
• Blocked by walls (doesn’t penetrate walls)
• e.g. TV remote control
55
Data Encoding
56
Introduction
• Data Encoding: refers to the various techniques of
representing data or information on an electrical or
optical signal that would propagate through the
physical medium making up the communication link
between the two devices
• Two types of data: Analog and Digital
• Two types of Signals (transmission techniques): Analog
and Digital
57
Terms
• Unipolar
– All signal elements have same sign
• Polar
– One logic state represented by positive voltage the other by
negative voltage
Unipolar
1
0
1
0
1
1
1
0
0
Polar
58
• Data rate
Cont’d
– Rate of data transmission in bits per second
• Duration or length of a bit
– Time taken for transmitter to emit the bit
– The time taken to place the bit on the medium for
transmission
• Propagation time
– The time taken for a bit to transfer from the sender to the
59
Encoding Techniques
• Four possible combinations
– Representing Digital data with digital signal
– Representing Analog data with digital signal
– Representing Digital data with analog signal
– Representing Analog data with analog signal
60
Digital Data, Digital Signal
• Digital signal
 Discrete, discontinuous voltage pulses
 Each pulse is a signal element
 Binary data is encoded into signal elements
• Signal changes value as the data changes value
from 0 to 1 and 1 to 0
• Several line encoding schemes are possible.
Each has pros and cons
61
Digital Data, Digital Signal
• Some of the common encoding techniques are:
– Bipolar –AMI
– Pseudoternary
– Manchester
– Differential Manchester
62
Digital Data, Digital Signal
• Two different voltages for 0 and 1 bits
• Voltage constant during bit interval
• e.g. Absence of voltage for zero, constant positive voltage
for one
• More often, negative voltage for one value and positive for
the other
 1 high level signal
 0 low level signal
63
Digital Data, Digital Signal
• Constant voltage pulse for duration of bit
• Data encoded as presence or absence of signal
transition at beginning of bit time
• Transition at the beginning of bit time (low to
high or high to low) denotes a binary 1
• No transition at the beginning of the bit time
denotes binary 0
64
NRZ:
Digital Data, Digital Signal
65
Digital Data, Digital Signal
NRZ pros and cons:
• Pros
– Easy to engineer
– Make good use of bandwidth
• Cons
– Lack of synchronization capability: with a long string
of 1s or 0s for NRZ-L or a long string of 0s for NRZI,
the output is a constant voltage over a long period
of time.
• any drift between the clocks of transmitter and receiver
will result in loss of synchronization
• Not often used for signal transmission
66
Digital Data, Digital Signal
Multilevel Binary:
• Use more than two signal levels
• Two examples: bipolar-AMI (alternate mark inversion)
and pseudoternary
• Bipolar-AMI
– zero represented by no line signal
– one represented by positive or negative pulse
– The binary 1 pulses must alternate in polarity
– No loss of sync if a long string of ones (zeros are still a
problem)
– Easy error detection
– Lower bandwidth
67
Digital Data, Digital Signal
Pseudoternary:
• One represented by absence of line signal
• Zero represented by alternating positive and negative
68
Digital Data, Digital Signal
Biphase: Two of these techniques, Manchester and differential
Manchester encodings
• Manchester encoding
–
–
–
–
There is a transition in the middle of each bit period
Transition serves as clock mechanism and data
Low to high represents one and high to low represents zero
Used by IEEE 802.3
–
–
–
–
Midbit transition is used only to provide clocking
Transition at start of a bit period represents zero
No transition at start of a bit period represents one
Used by IEEE 802.5
• Differential Manchester
69
Digital Data, Digital Signal
70
Digital data, Analog signal
• The most familiar use of this transformation is for
transmitting digital data through the public telephone
network.
• Digital devices are attached to the network via a
modem which converts digital data to analog signals,
and vice versa.
• For the telephone network, modems produce signals in
the voice-frequency range.
71
Digital data, Analog signal
• There are three encoding or modulation
techniques for transforming digital data into
analog signals
– frequency shift keying (FSK),
– phase shift keying (PSK)
72
Digital data, Analog signal
– Two binary values are represented by two different
amplitudes of the carrier frequency.
– One binary digit is represented by the presence, at
constant amplitude, of the carrier, the other by the
absence of the carrier
– i.e presence and absence of carrier is used
73
Digital data, Analog signal
• Frequency Shift Keying (FSK):
– Common form of FSK is binary FSK (BFSK), in which
the two binary values are represented by two
different frequencies near the carrier frequency
– where f1 and f2 are offset from the carrier frequency
by equal but opposite amounts
74
Digital data, Analog signal
• Phase Shift Keying (PSK):
– The simplest scheme uses two phases to represent
the two binary digits (BPSK)
– a phase shift of 180° (π) is equivalent to flipping the
sine wave or multiplying it by the -1
75
a) data
Digital data, Analog signal
c) FSK
d) PSK
76
– Encoding of analog data using digital signal and
– Encoding of analog data using analog signal
77
Error detection and control
78
Introduction
• Networks must be able to transfer data from one
device to another with acceptable accuracy
• For most applications, a system must guarantee that
the data received are identical to the data transmitted.
• Any time data are transmitted from one node to the
next, they can become corrupted
• Applications require a mechanism for detecting and
correcting errors.
79
Types of errors
• Whenever bits flow from one point to another, they
are subject to unpredictable changes because of
interference which can change the shape of the signal
1. Single-Bit Error: only 1 bit of a given data unit is
changed from 1 to 0 or from 0 to 1
• Least likely type of error.
– E.g: for 1Mbps link, each bit lasts for 1μs
– For a single-bit error to occur, the noise must have a
duration of only 1 μ s, which is very rare;
80
Types of errors (cont’d)
2. Burst Error: two or more bits in the data unit have
changed from 1 to 0 or from 0 to 1.
– A burst error is more likely to occur than a single-bit error. The
duration of noise is normally longer than the duration of 1 bit
– it affects a set of bits.
– The number of bits affected depends on the data rate and
duration of noise
81
Error detection vs correction
• In error detection, we are looking only to see if
any error has occurred.
– We are not interested in the number of errors.
– A single-bit error is the same as a burst error.
• In error correction, we need to know the exact
number of bits that are corrupted and more
importantly, their location in the message.
– The number of the errors and the size of the message
are important factors.
– E.g: for correcting single bit error in 8 bit data,
consider 8 possible error locations.
82
Redundancy
• The central concept in detecting or correcting errors is
redundancy.
• To be able to detect or correct errors, we need to
send some extra bits with our data.
83
Error detection techniques
• There are different types of error detection
methods
– Parity check
– Cyclic Redundancy Check (CRC)
– Checksum (not discussed here)
84
Parity check
• A parity bit is added to every data unit so that the total number of
1s (including the parity bit) becomes even for even-parity check
or odd for odd-parity check
– E.g: for the data unit
1100, if we add 1 bit for
parity check,
• 11000 for even parity
• 11001 for odd parity
– Even number of bit
errors goes undetected
85
Example: parity check
• Suppose the sender wants to send the word world. In
ASCII the five characters are coded (with even parity) as
1110111 1101111 1110010 1101100 1100100
• The following shows the actual bits sent
• 11101110 11011110 11100100 11011000 11001001
• 11111110 11011110 11101100 11011000 11001001
• Which blocks are accepted? Which are rejected?
• 11111111 11011001 11100100 11011000 11001001
86
Parity check (cont’d)
87
Cyclic redundancy check (CRC)
• The CRC error detection method treats the packet of data to
be transmitted as a large polynomial.
• The transmitter takes the message polynomial and using
polynomial arithmetic, divides it by a generating polynomial.
• The quotient is discarded but the remainder is “attached” to
the end of the message
• The message (with the remainder) is transmitted to the
• The receiver divides the message by the same generating
polynomial and compares the transmitted remainder with the
new one
• If the remainders are not equal, then there was an error
during transmission.
88
CRC
89
Polynomials
• CRC generator(divisor) is most often
represented not as a string of 1s and 0s, but as
an algebraic polynomial
90
Example 1
• Using binary long division
• Find the remainder when
10010 is divided by 101.
divisor
101
11
10010
quotient
- 101
11
101
101
10010
101
011
000
1000
-101
• In CRC what is important is
the remainder
• Use XOR, more simpler
remainder
110
101
11
remainder
91
Example 2
• To divide the polynomial 110001
by 111
– At each stage we just need to check
whether the leading bit of the
current three bits is 0 or 1.
– If it's 0, we place a 0 in the quotient
and exclusively OR the current bits
with 000.
– If it's 1, we place a 1 in the quotient
and exclusively OR the current bits
with the divisor, which in this case is
111
92
Example 3
93
Exercise
• Find the remainder of the following
1. 100100001 for divisor of 1101
2. X6 + x3 for a divisor of x3+x+1
3. 111000110000 for a divisor of 110011
94
Error correction
• Is much more difficult than error detection.
• Two main methods
– Retransmission after detecting error
– Forward error correction (FEC)
95
Retransmission after detecting error
• One of the error detection methods is used to detect an
error and the sender is informed to retransmit when
error occurs
• Such kind of retransmission mechanisms include:
– Stop-and-Wait
– Go-Back-N
– Selective-Reject
96
Stop-and-wait
• Is based on the stop-and-wait flow control technique
• The source station transmits a single frame and then
must await an acknowledgment (ACK)
• No other data frames can be sent until the destination
station’s reply arrives at the source station.
• The source keeps a timer (Timeout) which counts from
the time a frame is sent to the time an ACK must be
• Uses alternate numbering: ACK0/ACK1
97
Stop-and-wait (cont’d)
• Two sorts of errors could occur:
1. Frame that arrives at the destination could be damaged.
– After a frame is transmitted, the source station waits for an
acknowledgment.
– If no acknowledgment is received by the time that the Timeout
timer expires, then the frame is sent again.
– This method requires that the transmitter maintains a copy of a
transmitted frame until an acknowledgment is received for that
frame.
98
Stop-and-wait (cont’d)
2. The second sort of error is a damaged or lost
acknowledgment.
–
–
–
–
The frame is received correctly by destination station, which
responds with an acknowledgment (ACK).
But the ACK is damaged or lost in transit and is not
recognizable by the source, which will therefore time out and
resend the same frame.
This duplicate frame arrives and is accepted by the receiver.
The receiver has accepted two copies of the same frame and
discards the second copy sends ACK
99
Stop-and-wait
• Disavan: inefficient
The sender keeps idle
after sending one frame
multiple frames should be
in transition while waiting
for ACK
•
•
100
Go-Back-N
• The form of error control based on sliding-window
• The number of unacknowledged frames is determined by
window size
• While no errors occur, the destination will acknowledge
• If the destination station detects an error in a frame, it
may send a negative acknowledgment (REJ = reject) for
that frame
– The destination station will discard that frame and all future
incoming frames until the frame in error is correctly received.
– The source station, when it receives a REJ, must retransmit the
frame in error plus all succeeding frames that were transmitted
in the interim
101
Go-Back-N (cont’d)
• Suppose that station A is sending frames to station B.
• After each transmission, A sets an acknowledgment
timer for the frame just transmitted.
• Suppose that B has previously successfully received
frame (i-1) and A has just transmitted frame i.
• The go-back-N technique takes into account the
following contingencies:
1. Damaged frame
2. Damaged RR
3. Damaged REJ
102
Go-Back-N (cont’d)
1. Damaged frame : If the received frame is invalid (i.e., B detects
an error), B discards the frame and takes no further action
• There are two subcases:
a. Within a reasonable period of time, A subsequently sends frame
(i+1). B Receives this frame out of order and sends a REJ i. A must
retransmit frame i and all subsequent frames.
b. A does not soon send additional frames. B receives nothing and
returns neither an RR nor a REJ. When A’s timer expires, it
transmits an RR frame that includes a bit known as the P bit,
which is set to 1. B interprets the RR frame with a P bit of 1 as a
command that must be acknowledged by sending an RR indicating
the next frame that it expects, which is frame i. When A receives
the RR, it retransmits frame i.
103
Go-Back-N (cont’d)
2. Damaged RR: There are two subcases:
a. B receives frame i and sends RR (i-1) which suffers an error in
transit. If A receives a subsequent RR to a frame and it arrives
before the timer associated with frame i expires, A proceeds
as usual.
b. If A’s timer expires, it transmits an RR command as in Case 1b.
If B fails to respond to the RR command, A will try again by
issuing a new RR command and restarting the P-bit timer.
This procedure is tried for a number of iterations.
3. Damaged REJ: If a REJ is lost, this is equivalent to Case
1b.
– i.e.: station A transmits RR command which B has to
acknowledge
104
Selective-reject
• With selective-reject, the only frames
retransmitted are those that receive a negative
acknowledgment (SREJ).
• Selective reject would appear to be more
efficient than go-back-N, because it minimizes
the amount of retransmission.
• But, the receiver must maintain a buffer large
enough to save post-SREJ frames until the frame
in error is retransmitted
• Much less used than go-back-N
105
Go-back N
vs
Select-reject
106
Forward error correction (FEC)
• Automatically corrects certain errors
• One of the central concepts in coding for error
control is the idea of the Hamming distance.
• The Hamming distance between two words (of the
same size) is the number of differences between the
corresponding bits.
• Hamming distance between two words x and y is
denoted as d(x, y)
• The Hamming distance can easily be found if we
apply the XOR operation on the two words
• And the number of 1s in the result is the hamming
distance.
107
Hamming distance
• Example:
– The Hamming distance d(10101, 11110) is 3 because
10101 11110 is 01011 (three 1s)
• When a codeword is corrupted during transmission, the
Hamming distance between the sent and received
codewords is the number of bits affected by the error.
• In other words, the Hamming distance between the received
codeword and the sent codeword is the number of bits that
are corrupted during transmission.
– For example, if the codeword 00000 is sent and 01101 is
received, 3 bits are in error and the Hamming distance
between the two is d(00000, 01101) =3.
• Read on how the hamming distance can be used for error
correction
108
• Read on how the hamming distance can be
used for error correction
109
Multiplexing
110
Introduction
• Under the simplest conditions, a medium can
carry only one signal at any moment in time.
• For multiple signals to share one medium, the
medium must somehow be divided, giving each
signal a portion of the total bandwidth.
• The mechanism by which multiple signals share a
single medium is called multiplexing
111
Multiplexing
• Two or more simultaneous transmissions on a single
circuit
• Transparent to end user.
Single medium
• Techniques for accomplishing this include
– Time Division Multiplexing (TDM)
– Frequency Division Multiplexing (FDM)
– Code Division Multiplexing (CDM)
112
Frequency Division Multiplexing (FDM)
• Assignment of non-overlapping frequency ranges to
each “user” or signal on a medium.
• Thus, all signals are transmitted at the same time, each
using different frequencies.
• A multiplexor accepts inputs and assigns frequencies to
each device.
• The multiplexor is attached to a high-speed
communications line.
• A corresponding multiplexor, or demultiplexor, is on the
end of the high-speed line and separates the
multiplexed signals
113
FDM (cont’d)
114
FDM (cont’d)
• Analog signalling is used to transmits the
signals.
television, and the AMPS cellular phone
systems use frequency division multiplexing.
• This technique is the oldest multiplexing
technique.
• Since it involves analog signalling, it is more
susceptible to noise
115
Time Division Multiplexing
• Sharing of the signal is accomplished by dividing
available transmission time on a medium among
users.
• Digital signalling is used exclusively.
• The multiplexor accepts input from attached
devices in a round-robin fashion and transmit
the data in a never ending pattern
• Devices transmit in turns
• E.g: T-1, ISDN
116
TDM (cont’d)
117
Code Division Multiplexing (CDM)
• Also known as code division multiple access
(CDMA)
• An advanced technique that allows multiple
devices to transmit on the same frequencies at
the same time using different codes
• Used for mobile communications
• Each mobile device is assigned a unique code
118
```