Asycn (asynchronous) a frame synchronization channel

Asynchronous transmission channel, one by one byte (character) transmission, the receiving side receives data per byte. A character storage unit is a byte.

Question: asynchronous transmission frame, how can the receiving end of discrimination header and trailer out of the frame?

Measures: The character filled end to end and bound method .

Principle: special delimiting character F end to end of the frame body may occur between the 1 to n of each frame F, but the interior of each of the special character frame does not appear, so that the receiver easy to achieve frame synchronization. As shown below:

Thus, the above problem into: an intermediate frame if the special character F appears to confirm how the receiving terminal is a data frame delimiter character F or frame.

Processing the frame body contains the character F .

An idea: Replace : When the character F appears, is replaced with another special character (e.g., X).

In this manner the following disadvantages: After replacing X is F, if X appears within a frame, the receiving side determines how X is a frame or a data frame delimiter body, does not solve the problem.

Thinking two: double-byte replacement.

Provided: Total define four special characters: F, X, Y, Z. Which, F: frame delimiting character. X: the escape character, the character immediately marked for special explanation. XY: interpreted as F. XZ interpreted as X.

Principle: According to the above premise replacement of the original frame body F, X, Y, after the replacement, the body frame F does not appear, the recipient can be assured synchronization frame F do. When the recipient receives, met the XY combining character, the conversion is F, meets the XZ combination, will be converted to X. This realizes frame synchronization asynchronous transmission channel (transparent transmission).

 

Published 20 original articles · won praise 2 · Views 1593

Guess you like

Origin blog.csdn.net/weixin_42132733/article/details/105038210