HDLC Framing

Quote: http://www.erg.abdn.ac.uk/users/gorry/eg3567/dl-pages/hdlc-framing.html


HDLC Framing

The High Level Link Control (HDLC) protocol defined by the International Standards Organisation (ISO) provides a transparent transmission service at the data link layer of the OSI reference model . Many protocol suites use an HDLC (or HDLC-based) link layer, including X.25, the IP point-to-point protocol (PPP) and SNA.


The users of the HDLC service provides PDUs which are encapsulated to form data link layer frames. These frames are separated by HDLC "flags" and are modified by "zero bit insertion" to guarantee transparency. These terms are defined below:

Flags

HDLC is a data link protocol which uses a unique bit sequence to delimit the start and end of each PDU transported by the data link layer service. In HDLC, frames are delimited by a sequence of bits known as a "flag". The flag sequence is a unique 8-bit sequence of the form 0111 1110. The way in which this is performed is described in the text and diagrams which follow.


The flags before and after an HDLC frame indicate the start and end of the frame

Transparency

The flag sequence must never occur within the content of a frame otherwise it could be confused with an intentionally sent flag. A technique known as 0-bit insertion is used to prevent random data synthesising a flag. The technique is said to make HDLC transparent, since any stream of bits may be present between the open and closing flag of a frame. The transparency is achieved by encoding the data by inserting a 0-bit after any sequence of 5 consecutive 1's within the payload, as shown:


Insertion of a "zero-bit" into the content of a frame to ensure transparency

Hunt Mode

Normally a HDLC receiver starts in the idle state, waiting for the start of a frame. This is called "Hunt" mode, since the receiver is said to be hunting for a non-flag sequence. This may be achieved through a shift register and combinational logic as shown (a Finite State Machine (FSM) is usually used to implement this):


Detection of a start of frame

Abort & Idle Patterns

Valid frames are terminated by a closing flag. If the link layer protocol needs to transmit a higher priority frame before the current frame has been fully sent, it may "Abort" the frame. An "aborted" frame is terminated by an "abort sequence": 0111 1111 instead of the normal "flag sequence". Abort sequences may also be caused by bit errors which occur while the frame is travelling from the transmitter to the receiver. (For instance a flag may suffer a 1-bit inversion of the least significant bit, resulting in a bit sequence identical to an "abort").


A frame which is terminated by an abort is received by the receiver in the normal way, but marked as being "aborted". The frame is then discarded without further processing.


This is shown below:

An HDLC frame terminated by an "abort" is discarded by the HDLC receiver


An abort sequence is often followed by a series of 1's. The sequence of all 1's may be used to fill the gaps between frames (or alternatively a continuous series of flags may be transmitted). The all 1's sequence is known as the "idle" sequence, since the line becomes idle (N.B. represented at the physical layer by 0 Volts). This is useful for applications requiring half duplex operation (also known as Two Way Alternate (TWA) operation).


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值