Anda di halaman 1dari 28

Mata Kuliah Jaringan Komputer dan Komunikasi

Data Link Layer :


Error Management
Oleh I Putu Arya Dharmaadi, S.T., M.T.
Dosen Jurusan Teknologi Informasi
Universitas Udayana
Selasa, 03
http://aryadharmaadi.com 0
April 2018
INTRODUCTION

• Some channels, like optical fiber in telecommunications


networks, have tiny error rates so that transmission errors
are a rare occurrence
• But other channels, especially wireless links and aging
local loops, have error rates that are orders of magnitude
larger.
http://aryadharmaadi.com Selasa, 03 April 2018 1
ERROR CONTROL

• In order to make sure all frames are eventually delivered


to the network layer at the destination and in the proper
order
• The usual way to ensure reliable delivery is to provide the
sender with some feedback about what is happening at
the other end of the line
http://aryadharmaadi.com Selasa, 03 April 2018 2
DEALING WITH ERRORS
• Network designers have developed two basic strategies for dealing
with errors.
1. Include enough redundant information to enable the receiver
to deduce what the transmitted data must have been
2. include only enough redundancy to allow the receiver to
deduce that an error has occurred (but not which error) and
have it request a retransmission
http://aryadharmaadi.com Selasa, 03 April 2018 3
DIFFERENT CASE,
DIFFERENT HANDLING
• On channels that are highly reliable, such as fiber, it is
cheaper to use an error-detecting code and just retransmit
the occasional block found to be faulty.
• On channels such as wireless links that make many errors,
it is better to add redundancy to each block so that the
receiver is able to figure out what the originally
transmitted block was.
http://aryadharmaadi.com Selasa, 03 April 2018 4
ERROR-CORRECTING METHOD
• All of these codes add redundancy to the information that is sent.
• A frame consists of m data (i.e., message) bits and r redundant (i.e.
check) bits.
• Let the total length of a block be n (i.e., n = m + r) è codeword
• The code rate, or simply rate, is the fraction of the codeword
that carries information that is not redundant, or m/n
http://aryadharmaadi.com Selasa, 03 April 2018 5
VARIOUS CODE RATES

• The rates might be 1/2 for a noisy channel, in which case


half of the received information is redundant
• Or close to 1 for a high-quality channel, with only a small
number of check bits added to a large message.

http://aryadharmaadi.com Selasa, 03 April 2018 6


ERROR-CORRECTING CODES

• Hamming codes.
• Binary convolutional codes.
• Reed-Solomon codes.
• Low-Density Parity Check codes.
http://aryadharmaadi.com Selasa, 03 April 2018 7
HAMMING CODES

• The bits of the codeword are numbered consecutively,


starting with bit 1 at the left end, bit 2 to its immediate
right, and so on.
• The bits that are powers of 2 (1, 2, 4, 8, 16, etc.) are check
bits.
• The rest (3, 5, 6, 7, 9, etc.) are filled up with the m data bits
http://aryadharmaadi.com Selasa, 03 April 2018 8
HAMMING CODES (2)

• For example, the 8-bit data 11000100 will be sent.


• This will result:

1 2 3 4 5 6 7 8 9 10 11 12
P1 P2 1 P4 1 0 0 P8 0 1 0 0

http://aryadharmaadi.com Selasa, 03 April 2018 9


HAMMING CODES (3)
• The scheme for which bits each check bit checks:
Bit Position 1 2 4 8 16
1
2
3 x x
4
5 x x
6 x x
7 x x x
http://aryadharmaadi.com Selasa, 03 April 2018 10
HAMMING CODES (4)
• The scheme for which bits each check bit checks:
Bit Position 1 2 4 8 16
8
9 x x
10 x x
11 x x x
12 x x
13 x x x
14 x x x
http://aryadharmaadi.com Selasa, 03 April 2018 11
HAMMING CODES (5)

Each parity bit is calculated as follows:


• P1 = sum of bits (3,5,7,9,11) = 1⊕1⊕0⊕0⊕0=0
• P2 = sum of bits (3,6,7,10,11) = 1⊕0⊕0⊕1⊕0=0
• P4 = sum of bits (5,6,7,12) = 1⊕0⊕0⊕0=1
• P8 = sum of bits (9,10,11,12) = 0⊕1⊕0⊕0=1
http://aryadharmaadi.com Selasa, 03 April 2018 12
HAMMING CODES (6)

• Final result of the 8-bit data and 4 parity bits:


1 2 3 4 5 6 7 8 9 10 11 12
0 0 1 1 1 0 0 1 0 1 0 0

• This 12-bit data will be sent to receiver

http://aryadharmaadi.com Selasa, 03 April 2018 13


HAMMING CODES (7)

• When the 12-bit codeword arrives, the receiver redoes the


check bit computations including the values of the
received check bits.
• For example, the receiver gets the codeword that contain
1 bit error in bit position 5 as below.
1 2 3 4 5 6 7 8 9 10 11 12
0
http://aryadharmaadi.com
0 1 1 0 0 0 1 0 1 0
Selasa, 03 April 2018
0 14
HAMMING CODES (8)

• So, the receiver re-calculates the parity bits.


Parity Parity Error
Calculation Status
Bit Bit Value Result
P1 1⊕0⊕0⊕0⊕0 = 1 0 FALSE 1
P2 1⊕0⊕0⊕1⊕0 = 0 0 TRUE 0
P4 0⊕0⊕0⊕0 = 0 1 FALSE 1
P8
http://aryadharmaadi.com 0⊕1⊕0⊕0=1 1 TRUE 0
Selasa, 03 April 2018 15
HAMMING CODES (8)
• The set of check results forms the error syndrome that is used
to pinpoint and correct the error.
• In the example, we get the check error results, that are 0101
• This gives a syndrome of 0101 or 5, so we conclude that bit
position 5 is error.
• Flipping the incorrect bit and discarding the check bits gives the
correct message
http://aryadharmaadi.com Selasa, 03 April 2018 16
ERROR-DETECTING CODES
• Over fiber or high-quality copper, the error rate is much
lower
• So error detection and retransmission is usually more
efficient there for dealing with the occasional error

http://aryadharmaadi.com Selasa, 03 April 2018 17


THE METHODS

1. Parity.
2. Checksums.
3. Cyclic Redundancy Checks (CRCs).

http://aryadharmaadi.com Selasa, 03 April 2018 18


PARITY BIT

• The number of 1 bits in the codeword is even (or odd)


• For example, when 1011010 is sent in even parity, a bit is
added to the end to make it 10110100

http://aryadharmaadi.com Selasa, 03 April 2018 19


INTERLEAVING

• This method provides better protection against burst errors


• Each block to be sent is regarded as a rectangular matrix n
bits wide and k bits high
• We can compute the parity bits over the data in a different
order than the order in which the data bits are transmitted

http://aryadharmaadi.com Selasa, 03 April 2018 20


INTERLEAVING EXAMPLE

http://aryadharmaadi.com Selasa, 03 April 2018 21


CHECKSUMS

• Checksum means a group of check bits associated with a


message, regardless of how are calculated
• The checksum is usually placed at the end of the
message, as the complement of the sum function

http://aryadharmaadi.com Selasa, 03 April 2018 22


CHECKSUMS (2)

• Generally, this method operates on words rather than on


bits, as in parity, errors that leave the parity unchanged
can still alter the sum and be detected
• Example: 5 data of 4-bit word is sent:
7, 11, 12, 0, 6 è 7, 11, 12, 0, 6, 36

http://aryadharmaadi.com Selasa, 03 April 2018 23


CYCLIC REDUNDANCY CHECK

• CRC or Polynomial Codes are based upon treating bit


strings as representations of polynomials with
coefficients of 0 and 1 only
• For example:
110001 è 1x5 +1x4 +0x3 +0x2 +0x1 +1x0

http://aryadharmaadi.com Selasa, 03 April 2018 24


http://aryadharmaadi.com Selasa, 03 April 2018 25
WHAT’S NEXT?
• Network Layer: Intro and Routing

http://aryadharmaadi.com Selasa, 03 April 2018 26


REFERENCES

• Tanenbaum, Wetherall. 2011. Computer Networks 5th


Edition. Prentice Hall

http://aryadharmaadi.com Selasa, 03 April 2018 27

Anda mungkin juga menyukai