China Mobile Communication Information Resource station entity and Internet Short Message Gateway (ISMG)

Source: Internet
Author: User
Tags hash md5 md5 hash reserved

China Mobile Communication Information Resource station entity and Internet Short Message Gateway (ISMG)
Interface Protocol (CMPP)
V1.1
China Mobile Communications Group Corporation
2000/11/29

--------------------------------------------------------------------------------

Preparation instructions
This specification for China Mobile Communications Group Enterprise Specification, the information Resources station entity and the Internet Short Message Gateway Application Layer Interface protocol. Version 1.1 of this agreement.

Slightly reduced language
ISMG Internet Short Message Gateway
SMPP Short Message peer-to-peer SMS point-to-Point protocol
CMPP China Mobile peer-to-peer mobile point-to-Point protocol
TLS Transport Layer Security Transport layer safety
SMC Short Message Center SMS Centre

ICP Internet content provider Internet Contents provider

Network structure


The Internet SC Service Center, ISMG, records the position of SMC in the whole network, requests the functional entity of ICP to send Cmpp_submit message to ISMG, and forwards the message to a SMC by ISMG. At the same time, SMC can also send short message to ISMG, sent by ISMG to the corresponding ICP.
The ISMG is managed by the Maintenance Management Center.

Cmpp function
CMPP is used to establish the channel between the short Message center and the ICP, and the provision of business and information is completed by ICP. can provide services for the realization of mobile data value-added business, such as: Email notification, voicemail notification, Internet Short message, mobile desk email, reminder fee notification, automatic integrated Business information desk (information-on-demand business, mainly: Weather forecast, stock information, flight information, etc.).
The following is an example of an email notification business that tells the flow of information: an Internet user sends an e-mail to an ICP email server. ICP POP3 server activation filtering process, if the user requested an email notification business, the filtering process will be the user registered mobile phone number out, the title of the email is taken out, bound in the Cmpp_submit message, sent to ISMG. ISMG will check the "phone number to receive business" field in the Cmpp_submit message, the address of the SMC that the mobile user belongs to is queried in ISMG and sent to the SMC. After the ISMG receives the confirmation message, the message is converted to Cmpp_submit_rep and sent back to the ICP. When the message is received by SMC, the message is processed and an acknowledgement message is sent to the ISMG.
By the above process is visible, for the ICP, to do the work is mainly focused on the second step, that is, in the email server to do a filter program to achieve the above functions.
From the agreement, as long as the ICP has the interface implemented in CMPP, it can achieve the function corresponding to the control layer, as for the specific ICP functional entities, such as e-mail server, Web server, etc., still need to do some application layer work.


Interface
The CMPP protocol is hosted on TCP/IP as the underlying communication. In the case of high security requirements, the TLS layer can be used for secure transmission.



Message Flow
When the information between ICP and ISMG is interactive, it can use long connection mode or short connection mode. The so-called long connection, refers to a connection can be continuously sent multiple packets, and then disconnected, during the connection is maintained, if no packet sent, the two sides to send link detection packet. Short connection refers to the communication between the two parties have data interaction, the establishment of a connection, when the data is sent to complete, then disconnect the connection, that is, each connection only to complete the delivery of a business.

Long message
ICP and ISMG establish TCP connection in client-server way for mutual submission of information between two parties. After the TCP/IP connection is established, the client initiates a connection to the application layer, and if the ICP or ISMG believes that a TLS connection is required, the TLS field is placed in the transmitted packet to establish a TLS connection on both sides.
In the process of data transfer after the application layer connection is established, if the ICP or ISMG need to send encrypted information to the peer, you can also establish a TLS connection, you only need to set the corresponding message body in the tls_available (whether to use the TLS layer) attribute field, And no other properties in the message body of this message should be sent.
Messages are sent in a concurrent manner, flow control, the window size is adjustable, tentatively 10 messages, that is, the receiving party received more than 10 messages before the reply will be rejected.


The types of messages that ICP sends to ISMG include:

1) Cmpp_connect request application tier connection
2) cmpp_terminate terminating the application-level connection
3) Cmpp_terminate_rep Terminate application-level connection response
4) Cmpp_deliver_rep Issued SMS response
5) Cmpp_submit Submit SMS
6) cmpp_query Send SMS status query
7) cmpp_cancel Delete SMS
8) Cmpp_active_test Activation test
9) Cmpp_active_test_rep Activation test Answer

The types of messages that ISMG send to the ICP include:

1) Cmpp_connect_rep Request Connection Answer
2) Cmpp_deliver SMS issued
3) Cmpp_submit_rep Submit SMS Reply
4) Cmpp_query_rep SMS status Query results
5) cmpp_cancel_rep Delete SMS reply
6) Cmpp_active_test_rep Activation test Answer
7) Cmpp_active_test Activation test
8) Cmpp_terminate terminating the application-level connection
9) Cmpp_terminate_rep Terminate application-level connection response

The types of messages sent between ISMG include:

1) CMPP_FWD message before turning
2) Cmpp_fwd_rep message pre-turn reply
3) Cmpp_route Routing request
4) Cmpp_route_rep Routing Request response

One operation process



Short Message
The communication between ISMG and ICP adopts TCP/IP protocol, both client and server side. Sending and receiving are performed separately, each business establishes a connection, the communication is answered, and the answer is completed in the same connection as the request. Because the system uses mutual client/server mode, the operation initiates a connection request in a client-driven manner and closes the connection once the operation is completed. During transmission, if the ICP or ISMG believes that a TLS connection is required, the TLS field is placed in the transmitted packet and the TLS connection between the two parties is established.
The authentication of the ICP in the connection uses the phased authentication method, when the ICP first exchanges the information with the IMSG, the ICP first sends the identity authentication package, imsg the identity authentication to the ICP, records the IP address of the ICP and other relevant information, in the future data interaction, Imsg the IP address of the ICP as an authentication condition, that is, the information about the non-registered ICP is not processed. When the ICP wants to disconnect this logical application-tier connection, it sends the Disconnect Request packet, ISMG accepts the disconnect request, clears the information related to this ICP, that is, the MT information for MO to this ICP or ICP is not processed, but saves the MO information until the ICP ISMG establishes a logical application-level connection, which is identity authentication. Also allows ISMG to initiate a connection request to disconnect the ICP.
Messages are sent in a concurrent manner, and flow control, the window size is adjustable, tentatively 10 messages, that is, the receiver before the reply received more than 10 messages will be rejected.


The types of messages that ICP sends to ISMG include:

1) Cmpp_connect request application tier connection
2) cmpp_terminate terminating the application-level connection
3) Cmpp_terminate_rep Terminate application-level connection response
4) Cmpp_deliver_rep Issued SMS response
5) Cmpp_submit Submit SMS
6) cmpp_query Send SMS status query
7) cmpp_cancel Delete SMS

The types of messages that ISMG send to the ICP include:

1) Cmpp_connect_rep Request Connection Answer
2) Cmpp_deliver SMS issued
3) Cmpp_submit_rep Submit SMS Reply
4) Cmpp_query_rep SMS status Query results
5) cmpp_cancel_rep Delete SMS reply
6) Cmpp_terminate terminating the application-level connection
7) Cmpp_terminate_rep Terminate application-level connection response

The types of messages sent between ISMG include:

1) CMPP_FWD message before turning
2) Cmpp_fwd_rep message pre-turn reply
3) Cmpp_route Routing request
4) Cmpp_route_rep Routing Request response

One operation process (MO and MT)


Message definition
The CMPP connection port number is defined as 7890. Bytes used in the network general network sequence, time-lapse long interval using Fibonacci sequence, the number of re-send dynamic adjustable, preferably not less than 3 times.

Basic data type:

Integer
unsigned integer

C-octet String
Variable-length string, with a null character representing the end of the string

Octet String
Fixed length string, when the number of bits is insufficient, right fill empty


7.1 Message Structure

Project
Description

Message Header
Message header (all messages public header)

Message Body
Message body




7.2 Message Header Format (msg header)

Field name
Number of bytes
Type
Describe

Total_length
4
Integer
Total message length (with message header and message body)

command_id
4
Integer
command or response type

sequence_id
4
Integer
Message serial number, sequential summation, step 1, loop use


7.3 Message Formatting (msg Body)

1. Cmpp_connect Request Connection

Field name
Number of bytes
Property
Describe

Source_addr
6
Octet String
icp_id

Authenticatoricp
16
Octet String
ICP authentication code [1]

Reverse
8
Octet String
Reserved items (temporarily unused)


2. Cmpp_connect_rep Request Connection Answer

Field name
Number of bytes
Property
Describe

Status
1
Integer
State

0: Correct

1: Message Structure error

2: Illegal icp_id

3:ICP Authentication Error

4~: Other errors

Authenticatorismg
16
Octet String
ISMG authentication code [2]

Tls_available
1
Integer
Whether to use the TLS protocol layer


3. Cmpp_terminate Terminate Connection

The message body is empty.

4. Cmpp_terminate_rep Terminating Connection response

The message body is empty.

5.cmpp_submit Send SMS

Field name
Number of bytes
Property
Describe

msg_id
4
Integer
Information identification
1~ffffffffh

The sequence is cumulative, the step is 1, and the loop is used.

Pk_total
1
Integer
Total number of messages with the same msg_id

Pk_number
1
Integer
Message number of the same msg_id

Msg_level
1
Integer
Information level

service_id
10
Octet String
Type of Business

Tls_available
1
Integer
Whether to use the TLS protocol layer

Msg_fmt
1
Integer
Information Format

0:ascii string
3: SMS Write Card operation
4: Binary Information
8:UCS2 encoding
15: Chinese Characters with GB

Msg_src
6
Octet String
Source of information content (ICP_ID)
Feetype
1
Integer
Tariff category
Feecode
1
Integer
Tariff Code

Valid_time
1 or 17
C-octet String
Lifetime validity (in bytes 1 o'clock: No lifetime specified, NULL)

At_time
1 or 17
C-octet String
Timed Send time (bytes 1 o'clock: No send time specified, NULL)

src_terminal_id
21st
Octet String
SOURCE endpoint ID (no nullable)

Destusr_tl
1
Integer
Number of users receiving messages (less than 100 users)

dest_terminal_id
21*destusr_tl
Octet String
Mobile phone number for receiving business

Msg_length
1
Integer
Message Length (1-70 or 140)

Msg_content
Msg_length
C-octet String
Message content

Reserve
8
Octet String
Keep


6.cmpp_submit_rep Send SMS Response (Error required ICP all resend msg_id information)

Field name
Number of bytes
Property
Describe

msg_id
4
Integer
Message ID

Tls_available
1
Integer
Whether to use the TLS protocol layer

Result
1
Integer
Results
0: Correct
1: Message Structure error
2: command-word Error
3: Message ordinal repeat
4: Message Length Error
5: The Tariff code is wrong
6: Maximum information length exceeded
7: Business code Error
8: Flow control error
9~: Other errors




7.cmpp_query Send SMS Status query (statistics for the date specified by the time property)

Field name
Number of bytes
Property
Describe

Tls_available
1
Integer
Whether to use the TLS protocol layer

Time
8
Octet String
Time (accurate to day)

Query_type
1
Integer
Query category
0: Total Query
1: Query by business code

Query_code
10
Octet String
Query code [3] (Business type)

Reserve
8
Octet String
Keep


8.cmpp_query_rep SMS Status Query results

Field name
Number of bytes
Property
Describe

Tls_available
1
Integer
Whether to use the TLS protocol layer

Time
8
Octet String
Time (accurate to day)

Query_type
1
Integer
Query category
0: Total Query
1: Query by business code
Query_code
10
Octet String
Query code

Mt_tlmsg
4
Integer receives total information from ICP

Mt_tlusr
4
Integer
Total number of users received from ICP

Mt_scs
4
Integer
Number of successful forwards

Mt_wt
4
Integer
Quantity to Forward

Mt_fl
4
Integer
Number of forwarding failures

Mo_scs
4
Integer
Number of successful deliveries to ICP

Mo_wt
4
Integer
Number of pending deliveries to ICP

Mo_fl
4
Integer
Number of failed deliveries to ICP


9. Cmpp_deliver

Field name
Number of bytes
Property
Describe

msg_id
4
Integer
Message ID

Msg_level
1
Integer
Information level

Tls_available
1
Integer
Whether to use the TLS protocol layer

service_id
10
Octet String
Type of Business

Msg_fmt
1
Integer
Information Format
0:ascii string
4: Binary Information
8:UCS2 encoding

srcterminal_id
21st
Octet String
SOURCE Terminal identification

Msg_length
1
Integer
Message length

Msg_content
Msg_length
C-octet String
Message content

Reserve
8
Octet String
Reserved items (later, the ICP provides confirmation information that has been submitted to the mobile user)




10.cmpp_deliver_rep Issued SMS Response

Field name
Number of bytes
Property
Describe

msg_id
4
Integer
Message ID

Tls_available
1
Integer
Whether to use the TLS protocol layer

Result
1
Integer
Results
0: Correct
1: Message Structure error
2: command-word Error
3: Message ordinal repeat
4: Message Length Error
5: The Tariff code is wrong
6: Maximum information length exceeded
7: Business code Error
8: Flow control error
9~: Other errors


11.cmpp_cancel Delete SMS

Field name
Number of bytes
Property
Describe

msg_id
4
Integer
Message ID

Tls_available
1
Integer
Whether to use the TLS protocol layer


12.CMPP_CANCEL_REP Delete SMS Response

Field name
Number of bytes
Property
Describe

Tls_available
1
Integer
Whether to use the TLS protocol layer

success_id
1
Integer
Successful identification (0: Success; 1: Failure)


13.cmpp_active_test activation test

Field name
Number of bytes
Property
Describe

Tls_available
1
Integer
Whether to use the TLS protocol layer


14.cmpp_active_test_rep Activating a test response

Field name
Number of bytes
Property
Describe

Tls_available
1
Integer
Whether to use the TLS protocol layer

success_id
1
Integer
Successful identification (0--success)


CMPP_FWD SMS Before You go

Field name
Number of bytes
Property
Describe

Source_ Id
4
Octet String
Code for the source gateway

dest_id
4
Octet String
Destination Gateway Code

Nodescount
1
Integer
Number of Gateways passed

Tls_available
1
Integer
Whether to use the TLS protocol layer

msg_id
4
Interger
Information identification
Pk_total
1
Integer
Total number of messages with the same msg_id

Pk_number
1
Integer
Message number of the same msg_id

Msg_level
1
Integer
Information level

service_id
10
Octet String
Type of Business

Msg_fmt
1
Integer
Information Format
0:ascii string
4: Binary Information
8:UCS2 encoding
15: Chinese Characters with GB

srcterminal_id
21st
Octet String
SOURCE endpoint ID (no nullable)

Destusr_tl
1
Integer
Number of users receiving messages

dest_terminal_id
21*destusr_tl
C-octet String
Mobile phone number for receiving business

Msg_src
6
Octet String
Source of information content
Feecode
2
Octet String
Tariff Code

Valid_time
1or17
C-octet String
Validity period (bytes 1 o'clock: No send time specified, NULL)

At_time
1or17
C-octet String
Timed Send time (bytes 1 o'clock: No send time specified, NULL)

Msg_length
1
Integet
Message length

Msg_content
Msg_length
C-octet String
Message content

Reserve
8
M
Keep


CMPP_FWD _rep SMS Forward response

Field name
Number of bytes
Property
Describe

msg_id
4
Integer
Message ID

Pk_total
1
Integer
Total number of messages with the same msg_id

Pk_number
1
Integer
Message number of the same msg_id

Tls_available
1
Integer
Whether to use the TLS protocol layer

Result
1
Integer
Results
0: Correct
1: Message Structure error
2: command-word Error
3: Message ordinal repeat
4: Message Length Error
5: The Tariff code is wrong
6: Maximum information length exceeded
7: Business code Error
8: Flow control error
9: Forward to determine the wrong (this ICP should not be sent to the ISMG)
10~: Other errors


. Cmpp_route Routing Requests

Field name
Number of bytes
Property
Describe

New_gate
1
Integer
0: General Gateway; 1: New Add-on gateway

Request_total
2
Integer
0: Request one; 1: Request Multiple routing table data (if the following field is empty, request routing table All)

Service_type
10
Octet String
Type of business requested

Service_code
4
Integer
The requested business code

icp_id
6
Octet String
Access code for ICP (if the Service_type field is placed, this word blank)


Cmpp_route_rep Routing Request reply

Field name
Number of bytes
Property
Describe

Request_number
2
Integer
The number of route table data bars returned, if this field value is greater than 1, the following 5 fields appear repeatedly

Service_type
10
Octet string
Type of Business

Service_code_start
4
Integer
Business code Start flag

Service_code_end
4
Integer
Business code End Flag

icp_id
6
Octet String
Access code for ICP (if the Service_type field is placed, this word blank)

ismg_id
4
Octet String
Gateway code that corresponds to the above criteria

......





8. Number

8.1 ismg_id

Place
Number (ismg_id take up area code identification)
Description

Beijing
(010)
Sturge

Jiangxi
(0791)
Tsinghua Deep News

Guangzhou
(020)
Tsinghua Deep News

Tianjin
(022)


Other pending




















8.2 ICP number

ICP Name
Number (ISMG_ID)
Description

Sina
Pending


Sohu
Pending


Pending




8.3 command_id

Command Word Name
command_id value
Description

Cmpp_connect
0x00000001
Request Connection

Cmpp_connect_rep
0x80000001
Request Connection Answer

Cmpp_terminate
0x00000002
Terminating a connection

Cmpp_terminate_rep
0x80000002
Terminating a connection reply

Cmpp_submit
0x00000004
Submit SMS

Cmpp_submit_rep
0x80000004
Submit SMS Response

Cmpp_deliver
0x00000005
SMS Issued

Cmpp_deliver_rep
0x80000005
SMS Response

Cmpp_query
0x00000006
Send SMS Status Query

Cmpp_query_rep
0x80000006
Send SMS Status Query reply

Cmpp_cancel
0x00000007
Delete SMS

Cmpp_cancel_rep
0x80000007
Delete SMS Reply

Cmpp_active_test
0x00000008
Activating the test

Cmpp_active_test_rep
0x80000008
Activating a Test answer

Cmpp_fwd
0x00000009
Before the message goes

Cmpp_fwd_rep
0x80000009
Message pre-turn reply

Cmpp_route
0x00000003
Routing requests

Cmpp_route_rep
0x80000003
Route request reply


8.4 Feetype & Feecode Tariff category and Tariff Code (TBD)

I. Level of information

Information level from 1--9, "9" highest, "0" lowest

Second, tariff code

specifically defined as:
"00": Free
"99": Monthly
"98": Capping
"01"--"10": 0.01 yuan--0.10 yuan
"11"--"50": increments of 0.05 yuan
"51"--"80": increments of 0.10 yuan
"81"--"97": Reserved

[1] For the identification of ICP. The value is calculated by a one-way MD5 hash, which is indicated as follows:

AUTHENTICATORICP =md5 (source_addr+9 zero int+connecttype+shared secret)
GKFX Secret is agreed by China Mobile and ICP in advance.

[2] for the identification of ISMG. The value is calculated by a one-way MD5 hash, which is indicated as follows:

AUTHENTICATORISMG =md5 (status+authenticatoricp+ tls_available+shared secret)
Shared Secret is previously agreed by China Mobile and ICP, AUTHENTICATORICP is the value in the previous message cmpp_request_connect for the ICP sent to ISMG.

[3] When Query_type is 0 o'clock, this entry is invalid; When Query_type is 1 o'clock, this entry fills in the business code service_id.
Reference: http://www.simpleteam.com/simpleteam/sms/cmpp1_1.htm

Related Article

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.