Chapter One
Data Communication Basics
Mulugeta G.
1
2
Contents
Data Communications
Data Communication Components
Data Representation Techniques
Digital Data Transmission Formats
Transmission Impairments
Modes of Data transmission
Multiplexing
Signal Encoding Techniques
Data Transmission Error Detection and Correction
Data Communications
•Data communications
– is the exchange of data between two devices via some form of
transmission medium such as a wire cable.
– For data communications to occur, the communicating devices must be
part of a communication system made up of a combination of hardware
(physical equipment) and software (programs).
• The effectiveness of a data communications system depends on four
fundamental characteristics:
– Delivery
– Accuracy
– Timeliness and
– Jitter
3
Data Communications
1. Delivery
– The system must deliver data to the correct destination.
– Data must be received by the intended device or user and only by that device or user.
2. Accuracy
– The system must deliver the data accurately.
– Data that have been altered in transmission and left uncorrected are unusable.
3. Timeliness
– The system must deliver data in a timely manner.
– Data delivered late are useless.
– In the case of video and audio, timely delivery means delivering data as they are
produced, in the same order that they are produced, and without significant delay.
– This kind of delivery is called real-time transmission.
4. Jitter
– Jitter refers to the variation in the packet arrival time.
– It is the uneven delay in the delivery of audio or video packets.
– For example, let us assume that video packets are sent every 30 ms. If some of the
packets arrive with 30-ms delay and others with 40-ms delay, an uneven quality in the
4
video is the result.
Data Communication Components
• There are five components in data communication system.
– Message
– Sender
– Receiver
– Medium and
– protocol
5
Data Communication Components
1. Message: the information (data) to be communicated
(text, numbers, pictures, sound, video - or combinations)
2. Sender: the device that sends the message
computer, video camera, …
3. Receiver: the device that receives the message.
computer, workstation, television …
4. Medium: the physical path by which a message travels from
sender to receiver.
twisted pair cable, coaxial cable, fiber optic cable and radio
waves
5. Protocol: a set of rules that govern data communications.
Without a protocol, two devices may be connected but not
communicating, Just as a person speaking French cannot be
understood by a person who speaks only Japanese. 6
Data Representation Techniques
• Information today comes in different forms such as text, numbers, images, audio, and video.
• Text
– Text is represented as a bit pattern, a sequence of bits (0s or 1s).
– Different sets of bit patterns have been designed to represent text symbols.
– Each set is called a code, and the process of representing symbols is called coding.
– Unicode and ASCII code
• Numbers
– Numbers are also represented by bit patterns.
– However, a code such as ASCII is not used to represent numbers; the number is directly
converted to a binary number to simplify mathematical operations.
• Images: also represented by bit patterns.
– an image is composed of a matrix of pixels (picture elements), where each pixel is a small dot.
– The size of the pixel depends on the resolution.
– For example, an image can be divided into 1000 pixels or 10,000 pixels. In the second case,
there is a better representation of the image (better resolution), but more memory is needed
to store the image.
7
Data Representation Techniques
• Audio
– refers to the recording or broadcasting of sound or music.
– It is continuous, not discrete.
– Even when we use a microphone to change voice or music to an electric
signal, we create a continuous signal.
• Video
– refers to the recording or broadcasting of a picture or movie.
– Video can either be produced as a continuous entity (e.g., by a TV
camera), or it can be a combination of images, each a discrete entity,
arranged to convey the idea of motion.
8
Transmission Impairment
• Signals travel through transmission media, which are not
perfect.
• The imperfection causes signal impairment. This means that
the signal at the beginning of the medium is not the same as
the signal at the end of the medium.
• What is sent is not what is received.
• Three causes of impairment are attenuation, distortion, and
noise.
9
Transmission Impairment
• Attenuation
– means a loss of energy
– When a signal travels through a medium, it loses some of
its energy in overcoming the resistance of the medium.
– That is why a wire carrying electric signals gets warm, if
not hot, after a while.
– To compensate for this loss, amplifiers are used to
amplify the signal.
10
Transmission Impairment
• Attenuation
– To show that a signal has lost or gained strength,
engineers use the unit of the decibel.
– The decibel (dB) measures the relative strengths of two
signals or one signal at two different points.
– Note that the decibel is Negative if a signal is attenuated
and Positive if a signal is amplified.
– Variables P1 and P2 are the powers of a signal at points 1
and 2, respectively.
11
Transmission Impairment
• Attenuation
Example 1: Suppose a signal travels through a transmission medium
and its power is reduced to one-half.
– This means that P2 =1/2( P1). In this case, the attenuation (loss of
power) can be calculated as
» A loss of 3 dB (-3 dB) is equivalent to losing one-half the power.
Example 2: A signal travels through an amplifier, and its power is
increased 10 times.
– This means that P2 =10P1. In this case, the amplification (gain of
power) can be calculated as
12
Transmission Impairment
• Attenuation
Example 3: A signal travels from point 1 to point 4. The signal is
attenuated by the time it reaches point 2. Between points 2 and 3, the signal
is amplified. Again, between points 3 and 4, the signal is attenuated.
Therefore, find the resultant decibel value?
Solution:
– dD=-3+7-3=+1 (The signal has gained in power) 13
Transmission Impairment
• Distortion
– means the signal changes its form or shape.
– Distortion can occur in a composite signal made of different
frequencies.
– Each signal component has its own propagation speed through a
medium and, therefore, its own delay in arriving at the final
destination.
– Differences in delay may create a difference in phase if the delay
is not exactly the same as the period duration.
14
Transmission Impairment
• Noise:
– For any data transmission event, the received signal will consist of the transmitted
signal, modified by the various distortions imposed by the transmission system,
plus additional unwanted signals that are inserted somewhere between
transmission and reception.
– Undesired signals are referred to as noise.
– Types of Noise:
• Thermal Noise
• Induced Noise
• Crosstalk and
• Impulse Noise may corrupt the signal.
– Thermal noise is the random motion of electrons in a wire, which
creates an extra signal not originally sent by the transmitter.
– Induced noise comes from sources such as motors and appliances. These
devices act as a sending antenna, and the transmission medium acts as
the receiving antenna. 15
Transmission Impairment
• Noise
– Crosstalk is the effect of one wire on the other. One wire acts as a
sending antenna and the other as the receiving antenna.
– Impulse noise is a spike (a signal with high Energy in a very short
time) That comes from power lines, lightning, and so on.
16
Transmission Impairment
• Noise
– Example 1:
17
Transmission Modes
• Data transmission modes can be characterized in the following three types based
on the direction of exchange of information:
• Simplex
– The communication is unidirectional (send data in one direction)
– Only one of the two devices on a link can transmit; the other can only
receive
– Eg. Keyboards
• Half-duplex
– Each station can both transmit and receive, but not at the same time.
– When one device is sending, the other can only receive, and vice versa
– Eg. Walkie-talkies
• Full-duplex (duplex)
– both stations can transmit and receive simultaneously
– Eg telephone
18
Transmission Modes
• According to the number of bits sent across a link can be accomplished
in either parallel or serial mode.
• In parallel mode
– multiple bits are sent with each clock tick.
• In serial mode
– 1 bit is sent with each clock tick.
– There are three subclasses : asynchronous, synchronous, and isochronous
19
Transmission Modes
• In parallel Transmission
– Binary data, consisting of 1s and 0s, may be organized into groups of n bits
each.
– Computers produce and consume data in groups of bits much as we conceive
of and use spoken language in the form of words rather than letters.
– By grouping, we can send data n bits at a time instead of 1.
– The mechanism is simple one: Use n wires to send n bits at one time.
– That way each bit has its own wire, and all n bits of one group can be
transmitted with each clock tick from one device to another
Advantage:
speed
Disadvantage:
cost
Can’t travel long distances
Example: Printer connection
20
Transmission Modes
• In Serial Transmission
– In serial transmission one bit follows another, so we need only one communication Channel rather than n to transmit data
between two communicating devices
– Advantage:
• Reduces the cost of transmission
• Travels long distances
• Example: telephone wires
• Serial transmission occurs in one of three ways:
– Asynchronous
– Synchronous and
– Isochronous
21
Transmission Modes
• Asynchronous transmission
– Asynchronous transmission is so named because the timing of a
signal is unimportant.
– Patterns are based on grouping the bit stream into bytes.
– Each group, usually 8 bits, is sent along the link as a unit.
– In asynchronous transmission, we send 1 start bit (0) at the
beginning and 1 or more stop bits (1s) at the end of each byte.
– There may be a gap between bytes.
– Asynchronous here means “asynchronous at the byte level,” but
the bits are still synchronized; their durations are the same
22
Transmission Modes
• Asynchronous transmission
– Example: the connection of a keyboard to a computer is
asynchronous transmission. A user types only one character at a
time, types extremely slowly in data processing terms, and leaves
unpredictable gaps of time between characters.
23
Transmission Modes
• Synchronous transmission
– The bit stream is combined into longer “frames,” which may
contain multiple bytes.
– We send bits one after another without start or stop bits or
gaps. It is the responsibility of the receiver to group the bits.
– Synchronous transmission is faster than asynchronous
transmission.
24
Transmission Modes
• Isochronous transmission
– In real-time audio and video, in which uneven delays between frames
are not acceptable, synchronous transmission fails.
– Example: TV images are broadcast at the rate of 30 images per second;
they must be viewed at the same rate.
– If each image is sent by using one or more frames, there should be no
delays between frames.
– For this type of application, synchronization between characters is not
enough; the entire stream of bits must be synchronized.
– The isochronous transmission guarantees that the data arrive at a
fixed rate. 25
Multiplexing
• Allows multiple signals to be transmitted simultaneously across a
single data link
• In a multiplexed system, n lines share the bandwidth of one link.
• In the figure, link refers to the physical path.
• Channel refers to the portion of a link that carries a transmission
between a given pair of lines.
• One link can have many (n) channels.
26
Multiplexing
• For each type of multiplexing:
– Multiplexer (mux) )
• is a device that combines several signals into a single signal.
• to accept data from more than one source, and transmit it
over the shared channel.
– Demultiplexer (demux)
• separates the combined signals and regenerates them in original
form
• accepts data from the shared channel, and sends it on to its
correct destination. 27
Multiplexing
• Multiplexing/Demultiplexing: Used when many sources communicate
with many destinations through one communication line.
28
Multiplexing
• There are three basic multiplexing techniques:
– Frequency-division multiplexing
– Wavelength-division multiplexing and
– Time-division multiplexing.
• The first two are techniques designed for analog signals, the third, for
digital signals
29
Multiplexing
• Frequency-Division Multiplexing
– is an analog multiplexing technique that combines analog signals
– can be applied when the bandwidth of a link (in hertz) is greater than
the combined bandwidths of the signals to be transmitted.
– In FDM, signals generated by each sending device modulate different
carrier frequencies.
– These modulated signals are then combined into a single composite
signal that can be transported by the link.
30
Multiplexing
• Wavelength-Division Multiplexing
– is an analog multiplexing technique to combine optical signals.
– is designed to use the high-data-rate capability of fiber-optic cable.
– WDM is conceptually the same as FDM, except that the multiplexing
and demultiplexing involve optical signals transmitted through fiber-
optic channels.
– The idea is the same: We are combining different signals of different
frequencies. The difference is that the frequencies are very high.
31
Multiplexing
• Wavelength-Division Multiplexing
– The combining and splitting of light sources are easily handled by
a prism.
– Recall from basic physics that a prism bends a beam of light
based on the angle of incidence and the frequency.
32
Multiplexing
• Time-Division Multiplexing
– TDM is a digital multiplexing technique for combining several
low-rate channels into one high-rate one.
– is a digital process that allows several connections to share the
high bandwidth of a link.
– Instead of sharing a portion of the bandwidth as in FDM, time
is shared.
– Sectioned by time rather than by frequency
33
Multiplexing
• Time-Division Multiplexing
– Divides time into slices called time slots.
– With TDM, each computer takes its turn at transmitting and receiving
data; the order in which the multiplexer serves the computers is fixed.
– Depending upon the multiplexer type, the device accepts only one bit,
byte, or packet of data from each input line; puts it into a specifically
allocated time slot on the high-speed transmission line; and then moves
on to the next terminal in the sequence.
– The process of accepting data from many computers in succession is
called interleaving.
– TDM can be used with both digital and analogue transmission.
34
Signal Encoding Techniques
• Reading Assignment
– Digital data, digital signal
– Analog data, digital signal
– Digital data, analog signal
– Analog data, analog signal
35
Data Transmission Error Detection and Correction
• In digital transmission systems, an error occurs when a bit is
altered between transmission and reception
• That is, a binary 1 is transmitted and a binary 0 is received, or a
binary 0 is transmitted and a binary 1 is received.
• Two types of errors can occur:
– Single-bit errors and
– Burst errors
36
Data Transmission Error Detection and Correction
Single bit error
is an isolated error condition that alters one bit but does not affect nearby
bits.
only one bit in a given data unit (byte, character, packet, ...) has changed
from 1 to 0 or from 0 to 1.
Burst error
2 or more bits in the data unit have changed from 1 to 0 or from 0 to 1.
much harder to correct than isolated errors.
What shall be done to have a good communication?
• Eliminate causes---Impossible!
• Solution : Detect and Correct 37
Data Transmission Error Detection and Correction
Error Detection
Two Methods
• Parity bit/ parity check
• Cyclic Redundancy Check (CRC)
38
Data Transmission Error Detection and Correction
Parity bit/ parity check
A parity-check code can detect an odd number of errors.
The simplest error-detection scheme is to append a parity bit to
the end of a block of data.
A redundant bit, called a parity bit, is added to every data unit so
that the total number of 1s in the unit (including the parity bit)
becomes even (or odd for odd-parity);
This method can detect all single-bit errors; it can detect burst
errors only if the total number of errors in each data unit is odd
Even number of bit errors goes undetected 39
Data Transmission Error Detection and Correction
Cyclic Redundancy Check (CRC)
One of the most common and most powerful, error-detecting
codes
Based on binary division
The CRC is appended to the end of a data unit so that the
resulting data unit becomes exactly divisible by a second,
predetermined binary number.
• append a string of n 0s into the data unit ( n = divisor bits # –1)
• divide result by the divisor using binary division
40
Data Transmission Error Detection and Correction
Cyclic Redundancy Check (CRC)
• remainder of division becomes the CRC
• replace the appended 0s with CRC
• Send data (original + CRC)
• Receiver divides the whole data by divisor
‾ If there is a remainder ERROR Rule of Xor
‾ Otherwise NO ERROR 1 + 1= 0
0+0=0
1+0=1
0+1=1
41
Data Transmission Error Detection and Correction
Cyclic Redundancy Check (CRC)
Where, M(x)=Message
G(x)=Polynomial
And T(x) consists M(x)+ G(x)=the transmitted data 42
Data Transmission Error Detection and Correction
Cyclic Redundancy Check (CRC)
• Lets consider message M1: 100100
• Lets consider polynomial p1: 1101 known on both sides
• To generate the CRC:
• STEP 1: Add p1 length-1 zeros to M1
p1 length-1=4-1=3
• STEP 2: Add three zeros to M1
M1=100100 000
• STEP 3: Now Divide M1 with p1 to get CRC IN REMAINDER
• STEP 4: CRC is 001 43
Data Transmission Error Detection and Correction
Cyclic Redundancy Check (CRC)
• STEP 5: Add 001 to M1
• STEP 6: M1=100100 001 is sent message
• STEP 7: Message Received is M1+CRC = 100100 001
• STEP 8: to check the message at the receiver end
• STEP 9: Divide 100100 001 by p1
44
Data Transmission Error Detection and Correction
Cyclic Redundancy Check (CRC)
45
Data Transmission Error Detection and Correction
Cyclic Redundancy Check (CRC)
46
Data Transmission Error Detection and Correction
Cyclic Redundancy Check (CRC): Exercises
1.
– Message: 1001
– Polynomial: 1011
– Answer: CRC=110
2.
– Message: 101110
– Polynomial: 1010
– Answer: CRC=110
3.
– Message: 11100101
– Polynomial: 11011
– Answer: CRC=0100 47
Error Control/Correction
• Detection and correction of errors
– Lost frames: A frame fails to arrive at the other side
– Damaged frames: A recognizable frame does arrive, but some of the
bits are in error (have been altered during transmission).
• Automatic repeat request(ARQ)
– is an error-control method for data transmission that uses acknowledgements
(messages sent by the receiver indicating that it has correctly received a data
frame or packet) and
– timeouts (specified periods of time allowed to elapse before an acknowledgment
is to be received) to achieve reliable data transmission over an unreliable
service. 48
Automatic Repeat Request (ARQ)
Is to turn unreliable data link into a reliable one
Packets are numbered
Positive acknowledgment (ACK) for successfully received packets
Retransmission can be made if:
• Time expires (lost or corrupted)
• Received in error (NAK)
Three versions of ARQ :
Stop-and-wait ARQ,
Go-Back-N ARQ and
Selective Repeat ARQ 49
Stop-and-wait ARQ (SWA)
Based on the stop-and-wait flow-control technique
The source station transmits a single frame and then must await
an acknowledgment (ACK).
Next packet is sent after previous packet acknowledgment
Retransmission if time expires
Numbered only to identify corresponding data packet and ACK
Reasons for retransmission
• Damaged packets
• Lost packets
• Lost acknowledgment
50
Normal operation
51
Lost frame 52
Lost ack. 53
Delayed ack
Advantage of stop-and-wait ARQ : its simplicity.
Disadvantage : is an inefficient mechanism for High Data Frames
54
Go-Back-N ARQ
The sending process continues to send a number of frames specified by a
window size without receiving an acknowledgment packet from the receiver.
The receiver keeps track of the sequence number of the next frame it expects
to receive, and sends that number with every acknowledgment it sends.
If a frame from the sender does not reach the receiver or if it is damaged, the
receiver will stop acknowledging received frames.
Continuous packet transmission like SRA (Selective Repeat ARQ )
Unlike SRA (Selective Repeat ARQ ) Out of order packets are discarded
Time out packet and packets following are retransmitted
Unlike SRA no buffering
Like SWA (Stop-and-wait ARQ, ) no re-sequencing overhead
55
Go-Back-4: 4 frames are outstanding; so go back 4
fr fr fr fr fr fr f f fr fr f f f f time
0 1 2 3 4 5 r r 4 5 r r r r
A 6 3 6 7 8 9
B
A A A Out-of-sequence frames
A A A A A A
C C C C C C C C C
K K K K K K K K K
1 2 3 error 4 5 6 7 8 9
ACKing next frame expected
56
Selective Repeat ARQ (SRA)
Continuously transmission packets
Packets are assigned sequence number
Arrival of packets can be in any order
Packets are buffered before delivery
Increases data transfer rate compared to SWA(Stop-and-wait ARQ,)
Retransmission for
• Damaged packets
• Lost packets
• Lost acknowledgments
57
fr fr fr fr fr fr f f fr fr f f f f time
0 1 2 3 4 5 r r 7 8 r r r r
A 2
6 9 1 1 1
0 1 2
B A A N A A A A A A A A A
C C A C C C C C C C C C
K K K K K K K K K K K K
1 2 2 2 2 2 7 8 9 1 1 1
error 0 1 2
58
Hamming Code
•• Is a technique developed by R. W. Hamming for error correction.
• Easy to implement
• 7 bit hamming code is used commonly
Rules
• Data Bits=4
• Parity Bits=3, , where n=0,1,2,…n
D7 D6 D5 P4 D3 P2 P1
7 6 5 4 3 2 1
59
Hamming Code
D7 D6 D5 P4 D3 P2 P1
7 6 5 4 3 2 1
• P1= check 1 bit, skip 1 bit, check 1 bit, skip 1 bit
= 1,3,5,7,9 P1=D3 D5 D7
• P2 =check 2 bit, skip 2 bit, check 2 bit, skip 2 bit
= 2,3,6,7,10,11,14 P2=D3 D6 D7
• P4 = check 4 bit, skip 4 bit, check 4 bit, skip 4 bit
= 4,5,6,7,12,13,14 P4= D5 D6 D7
60
Hamming Code
• Example:
D7 D6 D5 P4 D3 P2 P1
1 1 0 1
• P1=D3 D5 D7
1 0 1 this is even parity, P1=0
• P2=D3 D6 D7
1 1 1 this is Odd parity, P2=1
• P4= D5 D6 D7
0 1 1 this is even parity, P4=0
• Know the sender sends the message as
D7 D6 D5 P4 D3 P2 P1
61
1 1 0 0 1 1 0
Hamming Code
• Detecting Errors
– Consider the 7-bit hamming code
D7 D6 D5 P4 D3 P2 P1
– At the receiver end, P1, P2 and P4 are checked for Even
Parity.
i.e, P1= 0, P2= 0, P4= 0 No error
• Correcting Errors
– We check parity of (P1 D3 D5 D7)
– If its Odd Error Exists P1=1
– If its Even No Errors P1=0
– Finding for P2 and P4 in the same operations
– After we have found the error word, we find its decimal value
– Then we invert the incorrect bit to obtain the correct word.
62
Hamming Code
• Example: A 7 bit hamming code is received as 1011011. assume its even
parity and state whether the received code is correct or wrong. If wrong
locate the bit in error.
D7 D6 D5 P4 D3 P2 P1
1 0 1 1 0 1 1
• Detect Errors
– Step 1: Analyze bits (P1 D3 D5 D7)
1 0 1 1 odd parity error exist
P1=1
– Step 2: Analyze bits (P2 D3 D6 D7)
1 0 0 1 Even parity No error P2=0
– Step 3: Analyze bits (P4 D5 D6 D7)
1 1 0 1 odd parity error exist
P4=1 63
Hamming Code
• Therefore, P1 and P4 are not equal to zero, so the received code is
wrong.
• Correcting Errors
– Error word E= P4 P2 P1
1 0 1
– The decimal value of (101) is 5, which shows that the 5th bit is
in error.
– So, we have to write the correct code by simply inverting the
5th bit
– Therefore, the correct word is
D7 D6 D5 P4 D3 P2 P1
1 0 0 1 0 1 1
64
Thank You
?
65