Data Link Layer - Logical Link Control
2023-12-08
During the transmission of bit sequences on the physical layer errors may occur
They are typically caused by…
Typical BER values
POTS | \(2*10^{-4}\) |
Radio link: | \(10^{-3}\) – \(10^{-4}\) |
Ethernet: | \(10^{-9}\) – \(10^{-10}\) |
Fiber: | \(10^{-10}\) – \(10^{-12}\) |
Burst errors are more common than single bit errors
The LLC sublayer ensures that errors are detected and handled
How can we detect errors?
Checksum
The checksum is calculated by a pre-defined algorithm for a block of data. They are typically used for the verification of the data integrity.
How many bits do we require for the checksum?
Each message (\(\rightarrow\) codeword) of \(n\) bits contains \(m\) bits of payload and \(r\) bits of checksum (with \(n = m + r\) and \(r > 0\))
Typically all \(2^m\) data messages are allowed, but not all \(2^n\) codewords are valid
The minimum distance between two valid codewords is called the Hamming distance
In order to detect \(d\) errors, the distance needs to be \(d + 1\)
In order to correct \(d\) errors, the distance needs to be \(2d + 1\)
Well-suited for short blocks of data, e.g., 7-bit US-ASCII characters
For each 7-bit section, an additional parity bit is calculated and attached to balance out the number of 1 bits in the byte
If the protocol defines even parity, the parity bit is used to obtain an even number of 1 bits in every byte
If odd parity is desired, the parity bit is used to obtain an odd number of 1 bits in every byte
\(\Longrightarrow\) one-dimensional parity-check code
What is the Hamming Distance here?
For all byte exists an additional parity byte
\(\Longrightarrow\) two-dimensional parity-check code
All 1-bit, 2-bit and 3-bit errors and most of the 4-bit errors can be detected via two-dimensional parity-check codes
Source: Computernetzwerke, Larry L. Peterson, Bruce S. Davie, dpunkt (2008)
10011010
corresponds to this polynomial:\(\begin{array}[l]{rcl} M(x) & = & 1*x^{7} + 0*x^{6} + 0*x^{5} + 1*x^{4} + 1*x^{3} + 0*x^{2} + 1*x^{1} + 0*x^{0} \\ & = & x^{7} + x^{4} + x^{3} + x^{1} \\ \end{array}\)
Reminder
A polynomial is an expression which consists of variables and coefficients and non-negative integer exponents
The degree of the generator polynomial is equal to the number of bits minus one
CRC-5
Polynomial: \(x^{5} + x^{2} + x^{0}\)
Representation: 0x05
Application: USB
CRC-8
Polynomial: \(x^{8} + x^{7} + x^{5} + x^{2} + x^{1} + x^{0}\)
Representation: 0xA7
Application: Bluetooth
CRC-16-IBM
Polynomial: \(x^{16} + x^{15} + x^{2} + x^{0}\)
Representation: 0x8005
Application: Bisync, Modbus
CRC-16-CCITT
Polynomial: \(x^{16} + x^{12} + x^5 + x^0\)
Representation: 0x1021
Application: HDLC
Generator polynomial:
Frame (payload):
\(x^5 + x^2 + x^0\) \(\Rightarrow\) 100101
21 \(\Rightarrow\) 10101
0
bits are appendedFrame (payload):
Frame with appended 0 bits:
10101
10101 00000
1
Reminder: \(XOR\) operation
1 XOR 1 = 0
1 XOR 0 = 1
0 XOR 1 = 1
0 XOR 0 = 0
The sender calculates the checksum
1010100000
100101||||
------vv||
111100||
100101||
------v|
110010|
100101|
------v
101110
100101
------
1011 = Remainder
Padding
01011
will be appended to the frame1010101011
Generator polynomial: | 100101 |
Frame (payload): | 10101 |
Frame with appended 0 bits: | 1010100000 |
Remainder: | 1011 |
Transferred frame (code polynomial): | 1010101011 |
Transferred frame (code polynomial): | 1010101011 |
Generator polynomial: | 100101 |
The receiver of the frame is able to verify, if the frame did arrive error-free
By dividing (only via XOR
) by the generator polynomial, transmissions with errors are detected
1
If the remainder of the division is 0, then the transmission was error-free
Verification (at the receiver)
1010101011
100101||||
------vv||
111110||
100101||
------v|
110111|
100101|
------|
100101
100101
------
0
Transferred frame (code polynomial): | 1 1 10101011 |
Generator polynomial: | 100101 |
Correct Transmission: | 1010101011 |
XOR
not 0
Verification (at the receiver)
1110101011
100101||||
------v|||
111110|||
100101|||
------v||
110110||
100101||
------v|
100111|
100101|
------v
101
Most important characteristic
A polynomial code with \(r\) check bits will detect all burst errors of length \(\leq r\)
Remember
In order to correct \(d\) errors a code needs a Hamming distance of \(2d + 1\)
Simplified ARP message flow
ARP uses broadcast messages:
In NDP routers and nodes can send proactively advertisements or be inquired via router and neighbor solicitations.
ARP uses multicast messages:
ff02::1:ff00:0000/104
Simplified NDP message flow
The Neighbor cache can be displayed via arp -n
or ip neighbour
# arp -n
Address HWtype HWaddress Flags Mask Iface
192.168.178.1 ether 9c:c7:a6:b9:32:aa C wlan0
192.168.178.24 ether d4:85:64:3b:9f:65 C wlan0
192.168.178.41 ether ec:1f:72:70:08:25 C wlan0
192.168.178.25 ether cc:3a:61:d3:b3:bc C wlan0
You should now be able to answer the following questions:
Which requirements need to be fulfilled to allow for error detection and correction?
What is a CRC checksum and how does it work?
For which purpose do we need ARP and NDP and how do they work?
Computer Networks - Data Link Layer - Logical Link Control - WS 23/24