开发者

HDLC Frames - Octets/modulo 8 doubts

I am trying to implement the HDLC frame format type 3 and I have some doubts as regards Octets/Modulo 8 encoding of frames.

  1. Firstly, Is the HDLC frame transmitted entirely in Octets?
  2. What do they mean by a frame is 'n'开发者_JAVA百科 Octet in length? Please give an example.
  3. I believe that Octet and Modulo is the same, so assuming that we have a frame X of one byte, what then do they mean by the encoding of X shall be modulo 8.

I am getting a little confused with all this, so i need more clarifications. Example and illustration will be of great help.

Thanks in Advance.


Thanks @clifford and @masoud. Your answer was really helpful. But I have to read this Octet String: What is it? (though it sounds funny because it explained in a simple way), and I came back to read your comments, then I understood all you explained. All the same, wish me a happy coding.


In HDLC every field length must be modulo 8 for example:

A frame of HDLC is like below: [FLAG(8bits)|ADDRESS(8bits)|CONTROL(8/16bits)|INFORMATION(n*8bits)|FCS(8bits)|FLAG(8bits)]

each field is modulo 8, even length of INFORMATION must be modulo 8.

It means if you want to send a data with length of 1 bit, you must consume a byte(8 bits).

If you are looking for some HDLC frame sample, look at this link: Click me! and read this: Click me


Firstly, Is the HDLC frame transmitted entirely in Octets?

That simply means that the data length is a multiple of 8 bits. Yes it is.

What do they mean by a frame is 'n' Octet in length?

Who is "they"? Cite your reference material. An octet is simply a group of eight bits. It is a less ambiguous term that byte (which can rarely be used refer to a machine word of length other than eight bits). The term octet is widely used in telecommunications, and is also used in languages other than English to mean "byte" (when a byte is eight bits).

I believe that Octet and Modulo

Not at all, modulo is a mathematical term, used here perhaps inaccurately to mean exactly divisible by (or an exact multiple of) eight.

[...] what then do they mean by the encoding of X shall be modulo 8.[?]

Again who are "they"? If we can see where you are reading this in context, you may get a better explanation.

Edit: I have not gone to the length of referencing ISO 3309 which is the standard defining HDLC frame structure, but the term "Modulo 8" in at least the Wikipedia article is used only in the context of frame sequence numbers, where it simply means that a sequence number increments from 0 to 7, then restarts at 0 (i.e. it is the frame number modulo 8 - or the remainder of frame_num/8 or simple frame_num % 8 in C code. I wonder whether you are confusing terms - again a citation or extract would help.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜