Data Transmission 3 - Errors in Data Transmission
Data Transmission 3 - Errors in Data Transmission
Errors in data
transmission
Think…..
• What is an error?
• When does an error occur during transmission of data?
• What is the need to check for errors?
Reasons
• Interference can cause data to be
corrupted or even lost.
• Problems during packet switching
• Skewing of data (this occurs during
parallel data transmission and can
cause data corruption if the bits
arrive out of synchronisation).
1 0 1 1 0 0 1 1
1 0 1 0 0 0 1 1
Methods to check for errors
• parity checking
• checksum
• echo checking
Parity Checking
• To check whether data has been changed or corrupted following
transmission from one device or medium to another device or
medium.
1 0 1 1 1 0 1 1
If even parity is used….
• The number of 1’s is set to even. The number of 1’s here is 4.
Parity is EVEN.
0 1 1 0 0 1 1 Hence the number of 1’s has
to be set to even by setting
0 in the MSB.
0 0 1 1 0 0 1 1
If odd parity is used….
• The number of 1’s is set to odd. The number of 1’s here is 5.
Parity is ODD.
0 1 1 1 0 1 1 Hence the number of 1’s has
to be set to odd by setting 0
in the MSB.
0 0 1 1 1 0 1 1
If odd parity is used….
• The number of 1’s is set to odd. The number of 1’s here is 4.
Parity is ODD.
0 1 0 1 0 1 1 Hence the number of 1’s has
to be set to odd by setting 1
in the MSB.
1 0 1 0 1 0 1 1
So how does this help with checking
errors?
• Think
• What is the parity in the sender’s byte? It’s obvious , right?
• Think
• Now check the received byte.
• Does it show a different parity?
• If yes, then data has been corrupted.
The process
1. The sending computer adds the correct parity bit to the binary data
(either an extra 1 or 0)
2. The sending computer sends the binary data, including the parity
bit
3. The receiving computer checks to make sure the overall parity of
the data received is as agreed (an even or odd number of 1 bits)
4. If the parity of the data is incorrect, the receiving computer flags an
error and requests that the data is transmitted again
• Is there enough info to figure out where data has occurred?
0 1 0 1 1 1 0 0
• Each row and column where the parity has changed should be
flagged.
Questions W19
June 2018
HW
HW
Checksum
• A checksum is a method used to check if data has been changed or
corrupted following data transmission.
• Data is sent in blocks and an additional value, the checksum, is also
sent at the end of the block of data.
STEPS
• when a block of data is about to be transmitted, the checksum is calculated
from the block of data
• the calculation is done using an agreed algorithm (this algorithm has been
agreed by sender and receiver)
• the checksum is then transmitted with the block of data
• at the receiving end, the checksum is recalculated by the computer using the
block of data (the agreed algorithm is used to find the checksum)
• the re-calculated checksum is then compared to the checksum sent with the
data block
• if the two checksums are the same, then no transmission errors have
occurred; otherwise a request is made to re-send the block of data.
Echo check
• The receiving computer sends a
copy of the data immediately back
to the sending computer for
comparison.
• The sending computer compares the
two sets of data to check if any
errors occurred during the
transmission process.
• If an error has occurred, the data
will be transmitted again.
Reliable????
Why?
• If the two sets of data are different, it isn’t known whether the error
occurred when sending the data in the first place, or if the error
occurred when sending the data back for checking.
ARQ- Automatic Repeat Request
• Uses positive and negative
acknowledgements (messages sent
to the receiver indicating that data
has/has not been received correctly)
and
• timeout (this is the time interval
allowed to elapse before an
acknowledgement is received)
ARQ- Automatic Repeat Request
• uses an ACKNOWLEDGEMENT (a
message sent by the receiver
indicating that data has been
received correctly) and
• TIMEOUT (this is the time allowed to
elapse before an acknowledgement is
received).
• If an acknowledgement isn’t sent
back to the sender before timeout
occurs, then the message is
automatically resent.
Positive acknowledgement
• if no error is detected, a positive acknowledgement is sent back to the
sending device
Negative acknowledgement
• If an error is detected, the receiving device now sends a negative
acknowledgement to the sending device and requests re-transmission
of the data
Time-out
• a time-out is used by the sending device by waiting a pre-determined
amount of time ….
No acknowledgement
• if no acknowledgement of any type has been received by the sending
device within this time limit, it automatically re-sends the data until a
positive acknowledgement is received
• or until a pre-determined number of re-transmissions has taken place
Use
• ARQ is often used by mobile phone networks to guarantee data
integrity