Written by coh at home
[DC]Data Link-Layer 본문
1. data link layer하면 떠올라야 하는 것들이 있다.
앞서 기술했던 것을 다시 말해보면
전송의 기본단위는 frame. 목적은 node to node delivery. 주소는 physical layer. 실제 주소의 예는 MAC주소.
기능은 framing, error control. flow control. (media) access control. 실제 프로토콜의 예는 X.25, 802.11, 802.03, HDLC, ARP, RARP등등
Data link layer는 두 개의 sublayer를 갖는다.
(1)Data link control sublayer
(2)Media Access control sublayer
그래서 앞으로 데이터링크 레이어 = DLC + MAC라고 알면 된다.
MAC주소에는 uni, multi, broad 3가지 type이 있는데
2번째 bit의 수가 홀수면 unicast. even이면 multicast. 모든 bit이 1이면 broadcast이다.
packet이 전달될 때 end노드의 IP주소를 갖고 있게 된다. 이때 node to node delivery를 하려면 다음 노드의 MAC주소를 알아야한다.
이때 다음 노드의 IP 주소를 MAC주소로 바꿔주는 ARP (Address Resolution Protocol)이 나오게 된다.
(역으로 MAC주소를 IP주소로 mapping해주는 것은 RARP이다.)
2. Error control
사실 이번 글은 이것때문에 쓴 것이나 다름없다.
그렇기에 간단하게만 짚고 넘어가려 한다.
data link layer의 기능에는 error control이 있었다.
error를 detection하고 correction하게 되는데
이를 위해 concept of redundancy에 대해 말해볼 것이다.
redundant bits에 대한 개념을 배우면 Hamming distance에 대해 가볍게 짚고 넘어가고
CRC, checksum에 대해 간단히 말하고 넘어가려한다. 근데 다 안할 수도 있다.
우선 Error라는 것은 physical layer에서 전송되는 bit stream중 single bit error 또는 burst error가 발생한 것을 말한다.
이런 에러를 고치기 위해서 redundancy bit이 필요하게 된다. 이때 에러를 detection만 할 것인지, correction까지 할 것인지에 따라 필요한 bit수가 달라진다.
자 우리가 원래 보낼 메시지를 k bits의 block으로 나눈 것을 datawords라 하자.
여기서 에러를 detection하기 위해 r bits의 redundant bits를 추가하고
완성된 k + r bits를 codewords라 하자.
이때 Hamming distance의 개념이 등장하게 된다.
codewords의 bit간 XOR operation을 했을 때, 즉, 대응되는 bits에서 다른 bit의 수.
To gaurantee the detection if up to s bit errors in all cases, the minimum Hamming distance in a block code must be dmin = s + 1.
s bits 에러를 검출하기 위해서 가장 작은 Hamming distance의 수는 s+1이어야 한다는 말.
Even parity check는 bit수를 even으로 맞춰서 redundancy bit를 추가하는 방법이다. ODD는 이와 반대이다.
CRC는 이진 나눗셈을 통하여 나머지를 redundancy bit으로 추가하여 전송단에서 나누어떨어지는지 검사하는 방법이다.
나누어 떨어지지 않는다면 bit가 corrupted된 것.
유선 LAN, 무선 LAN은 CRC-32로 error detection을 하고 있다.
check sum은 보낼 메시지를 k bit block으로 자른 datawords를 모두 더한 10진 수 값을 다시 k bit으로 잘 가공하여 k bits의 redundant bit를 추가하는 방법이다.
마지막으로 t bits errors를 correct하기 위해선 dmin = 2t + 1이 되어야 한다.
'CS > DataCommunication' 카테고리의 다른 글
[DC]Media Access Control (0) | 2023.07.22 |
---|---|
[DC]Data link Protocol : Stop and Wait protocol (0) | 2023.07.21 |
[DC]Transmission media & switch (0) | 2023.07.17 |
[DC]Physical Layer (0) | 2023.07.17 |
[DC]OSI layer (0) | 2023.07.14 |