Study/정보통신공학

[Week 9-1] High Level Data Link Control (HDLC)

ansui 2023. 4. 28. 09:56

Chap 7. Data Link Control Protocols

 


< Internet Protocol Stack >
> application
> transport
> network
> link: data transfer between neighboring network elements
- Ethernet, WiFi, ppp

> physical



< Data link Protocols >

 

 
: Directly connected, wire-like
: Losses & errors, but no out-of-sequence frames
: Applications - Direct Links; LANs; Connections across WANs
 
> Data Links Services
- Framing
- Error control
- Flow control
- Multiplexing
- Link Maintenance
- Security: Authentication & Encryption
 
> Examples - PPP, HDLC, Ethernet LAN, IEEE 802.11 (Wi Fi) LAN
 
 
< High Level Data Link Control (HDLC) >
: Layer 2 - data link control protocol
 
: 가장 중요한 data link control protocol
- data link control protocols의 기본
 
> Station types
Primary - controls operation of link (command)
Secondary - under control of primary station (받아서 response)
Combined - issues commands and responses (섞여있는 것: Primary이면서 Secondary)
 
> Link configurations 
Unbalanced - 1 primary, multiple secondary 
Balanced - 2 combined stations
 
*Flag - 프레임의 시작, 끝을 알림
*FCS - error detection
*Octet - 8n의 가장 마지막 비트일 때 1을 넣음
 
01111110                                                                                         01111110

HDLC Frame Structure


 
< Mode >
*Mode는 connection establishment(연결 set up)를 하는 동안 선택
 
> Normal Response Mode(NRM)
: polling multidrop lines 사용
- unbalanced configuration 사용
- Primary initiates transfer
- Primary 하나가 명령을 내리고 여러개의 Secondary가 응답
- Primary가 전송하고 있는 지 계속해서 polling 해야 함
 

NRM

 
> Asynchronous Balanced Mode(ABM)
: full-duplex point-to-point links (1-1) 사용
- balanced configuration 사용
- Either station initiates transmission (양쪽 모두 실행 가능)
- polling overhead x (polling x)
- 가장 많이 사용
- Set up ABM: SABM
 

ABM

 
> Asynchronous Response Mode (ARM) - NRM에서 파생
- unbalanced configuration 사용
- Primary의 허락 없이 Secondary가 전송 가능
- 거의 사용 x
 


< Bit Stuffing >
→ 1이 5개가 되면 0을 삽입 (6개가 되지 않도록!)
➝ Flag와 겹치기 때문에 중간에 오는 bit를 수정
➝ 마지막에 1이 6개 오면 끝난것을 인식
Original Pattern 11111/11111/11011111/1011111/10

After bit-stuffing 111110/111110/110111110/10111110/10
 


< Field >

- Flag (0 1 1 1 1 1 1 0)
- Address Field
- Control Field
- Information Field
- FCS(Frame Check Sequence) Field
 
 
< Address Field >
- Identifies secondary station that transmitted or will receive frame (통신하려는 주소)
- 8 bits long & multiple
- May be extended to multiples of 7 bits
- Last octet의 Leftmost bit: 1
- Last octat이 아닌 Leftmost bit: 0

- Address 11111111 allows a primary to broadcast a frame for reception by all secondaries
(특정 하나의 rx지정 x, 모든 주변의 link에 연결, 1-1 x)
 


< Control field >
> Information frames (I-frames) 
- 첫번째 bit = 0
- user에게 전송될 데이터를 옮긴다
- 실제 데이터가 실려있음 (데이터가 있는 경우. ACK만 있으면 x)

- Flow and error control data are piggybacked on an information frame (ARQ 이용)
 
> Supervisory frames (S-frames)
- 첫번째 bit = 1, 두번째 bit = 0
- piggybacking 이 사용되지 않을 때 ARQ mechanism 제공
- recieve(RR...)

> Unnumbered frames (U-frames)
- 첫번째 bit = 1, 두번째 bit = 1
- 추가적인 link control functions 제공
 

HDLC Frame Structure

 
 
< Control Field >
- Use of poll/final (P/F) bit depends on context
- command frames: : 종속 station으로부터 응답을 요청(poll)하기 위해 P bit = 1로 설정
- response frames: 요청의 결과로 전송된 응답 프레임을 나타내기 위해 F bit = 1로 설정
- 기본적으로 S-frames, I-frames는 3 bit sequence numbers를 사용 (0 ~ 2^3 - 1)
- 확장된 control field는 7-bit sequence numbers를 사용 (0 ~ 2^7 - 1)
→ U-frames은 항상 8-bit control field를 가진다
 


< Information and Frame Check Sequence (FCS) Fields >

 

Information Field  Frame Check Sequence Field (FCS)
 - Present only in I-frames, U-frames

 - Must contain an integral number of octets
 (8bit의 배수)


 - Variable length
 - flags를 제외한 나머지 프레임들에서의 Error detecting code 

 - The normal code is the 16 bit CRC-CCITT

 - Optional 32-bit FCS, using CRC-32

 


< HDLC Operation 3 phases >

 

Initialization - set up Data Transfer - 전송 Disconnect - 종료
: Establish
 
 - 한쪽에서 다른쪽에 초기화 요청 신호 보냄


 - NRM, ABM, ARM 중에 선택해 set up

 - 3- or 7- bit sequence numbers가 사용

 - I-frame의 N(S)와 N(R) fields는

 flow control, error control을 지원하는
 sequence numbers이다

 - HDLC 모듈이 순차적으로 번호 부여

 - 반대편 사용자의 데이터 traffic이 없는
 경우 Receive Ready(RR)를 사


 - 결함이 있거나 사용자의 요청이 있을 경우
 disconnect 할 수 있다


 - sends disconnect frame(DISC)

 - UA보냄

 - I-frame 손실 가능

 

HDLC Commands and Response table

 


< Example >

 

(a)
SABM - Setup ABM
UA - Unnumbered Acknowledgment
DISC - Disconnected
 
(b)
I, 0, 0 = I, 보내는 프레임, 받았으면 +1
 
(c) (e)
RNR, 4 = 3까진 받았고 다음은 보내지마
RR, 0, P = 받을 준비 됐어? Polling
RNR, 4, F = 3까진 받았고 다음은 보내지마 Final
RR, 4, F = 4 받을 준비 완료 Final
 
(d)
REJ, 4 = 4를 못받았어 4부터 다시 보내
→ Go-Back-N
 
 
 
 
 


교재는 Data and Computer Communications를 참고하였고, 자료는 이화여자대학교 이형준 교수님의 정보통신공학 강의에서 가져온 것입니다.