More popular MUX

Source: Internet
Author: User

The simple point of multiplexer protocol (MUX) is multiplexing. It virtualizes the original physical channel into several concurrent logical channels, which are the same as the physical links in the network protocol, the logical link is a bit similar. the implementation is also similar. Package the data on the Logical Channel, add the end of the packet header, and then send it to the physical channel.

 

In this example, at + cmux = 0 is the data on the physical channel, which tells the GSM
Modem (hereinafter referred to as CAT) I am about to enter the MUX mode, the cat responds OK. The host sends samb0, 1, 2, 3 in sequence, and the build number is 0 ~ The logical channel of 3. The cat responds to UA and agrees. However
Then the host can use the logical channel to send commands, such as the uih (1, "atrn"), and the CAT also responds to the uih package on the channel (address 1, the data is consistent with the response on the physical channel, that is
Okrn.

 

The principle is very simple. The problem is the number of packages, the package format...

Six packages (excluding error recovery mode) are defined in the 07-10 specification)

Set asynchronous balanced mode (sabm) command
Disconnect (disc) command
These two packages are command packages used to create and cancel the logical channel.

Unnumbered acknowledgement (UA) Response
Disconnected mode (DM) Response
These two are response packages, which are used to respond to the correct and wrong responses respectively.
Unnumbered information with header check (uih)
Unnumbered information (UI)
The two can be a command package or a status package. The difference is that the former does not generate a verification code for the data part of the package.
Let's take a look at the package format.

 

07-10 supports three modes: basic, advanced, and advance with error recovery.
The first two modes do not support Error Correction. Here we only discuss these two modes.
The basic mode package format is
Flag (1B) adderss (1B) control (1B) length (1 ~ 2b) Info (length specifies the length, variable)
FCS (1B) flag (1B)
The meanings are as follows:
Flag fixed to 0xf9
Adderss logical channel number, similar to MAC address. bit1 is E/A, bit2 is C/R, bit3 ~ 8 is the logical channel number.

 

If E/A is 1, it indicates whether the current byte is the last byte of the item. Here, it can only be 1
C/R is used to indicate whether the command sender is the channel initiator. If yes, it is 1.
For example, the logic Channel 1 established by the host. When a command package is sent to the channel, the value of adderss is 0x7, and the value of adderss returned by the cat is also 0x7.
Control
For the package type mentioned above, where bit5 is P/F, it can be roughly understood that Samb, disc package and its response, P/F is 1 (when the response is DM, this bit can be 0 or 1)
Length is the length of the info item, and bit is defined
E/A, L1, L2,..., L7, (l8,..., L15). If the length is smaller than 128, E/A is 1 and the second byte is not encoded.
The info class capacity depends on the domain package type.
The difference between the check code, uih, and UI package is here. uih does not encode the info item, but only adderss, control, and length.
The advanced mode package format is
Flag (1B) adderss (1B) control (1B) Info (indefinite length) FCS (1B) flag (1B)
The flag is fixed to 0x7e.
The difference between the two modes is that the advanced mode does not have a length, but adopts a specific format encoding to determine when the package ends.

 

The specific implementation is the sender's encoding for other items except flag. When encountering characters such as 0x7e and 0x7d, the sender inserts 0x7d before the flag, and the receiver removes the corresponding 0x7d. In this way, when encountering a separate 0x7e, the table
Indicates the end and start of the package.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.