China Mobile Communications Information Resource Station entity and Internet Short Message Gateway (ismg)
Interface Protocol (CMPP)
V1.1
China Mobile Communications Corporation
2000/11/29
--------------------------------------------------------------------------------
Description
This specification is an enterprise specification for China Mobile Communications Corporation and specifies the application layer interface protocol between the information resource station entity and Internet Short Message Gateway. This Protocol version is 1.1.
Thumbnail
Ismg Internet Short Message Gateway
Smpp Short Message Peer to Peer Short Message Point-to-Point Protocol
CMPP China Mobile Peer to Peer China Mobile Point-to-Point Protocol
TLS Transport Layer Security
SMC short message center Short Message Center
ICP Internet content provider
Network Structure
The Internet SC Business Center (ismg) records the position of the SMC across the network and requires the functional entities of the ICP to send a cmpp_submit message to the ismg, where the ismg forwards the message to a SMC. At the same time, SMC can also send short messages to ismg and ismg will send them to the corresponding ICP.
The maintenance management center manages ismg.
CMPP Function
CMPP
It is used to establish a channel between the short message center and ICP, and the provision of business and information is completed by the ICP. It can provide services for value-added mobile data services, such as email notification and voicemail.
Zhizhi and Internet short messages, mobile phone numbers, reminder notifications, and automatic Integrated Service Information Platform (VOD service, mainly including weather forecasts, stock information, and flight information ).
To
Take the email notification service as an example to describe the information process: an Internet user sends an email to the ICP email server. POP3 in ICP
Server activates the filtering process. If the user has applied for an email notification service, the filtering process will retrieve the mobile phone number registered by the user, retrieve the email title, and bind it
In the cmpp_submit message, send it to ismg. Ismg checks the "mobile phone number of the received service" field in the cmpp_submit message, and queries the mobile phone user in ismg.
The ID of the SMC and then send it to the SMC. After obtaining the confirmation message, ismg converts the message to cmpp_submit_rep and sends it back to the ICP. After SMC receives the message
The message is processed and a confirmation message is sent to the ismg,
From the above process, we can see that for the ICP, the work to be done is mainly focused on the second step, that is, to create a filter program in the email server to implement the above functions.
In terms of protocol, as long as the ICP has interfaces implemented in CMPP, it can implement functions corresponding to the control layer. For specific ICP functional entities, such as email server and web server, you still need to do some work at the application layer.
Interface
The CMPP protocol uses TCP/IP as the underlying communication bearer. For higher security requirements, you can use the TLS layer for secure transmission.
Message Process
ICP
Long connection or short connection can be used for information interaction with ismg. A persistent connection means that multiple data packets can be sent continuously on a single connection, and then the connection is closed.
If no data packet is sent during the holding period, both parties need to send a link detection packet. A short connection is a connection established when both parties have data interaction. After data transmission is complete, the connection is closed, that is, only one connection is complete.
Send a service.
Long Message
The ICP and ismg establish a TCP connection in the client-server mode for mutual information submission between the two parties. After a TCP/IP connection is established, the client initiates a connection to the application layer. If the ICP or ismg deems that a TLS connection is required, the TLS field is set in the transmitted data packet, to establish a TLS connection between the two parties.
During the data transmission process after the application layer connection is established, if the ICP or ismg needs to send encrypted information to the peer end, a TLS connection can also be established, in this case, you only need to set the tls_available (whether to use the TLS layer) attribute field in the corresponding message body, And do not send other attributes in the message body of this message.
Messages are sent concurrently, with traffic control. The window size is adjustable and is tentatively set to 10 messages. That is, more than 10 messages received by the recipient before the response are rejected.
The types of messages that an ICP sends to ismg include:
1) cmpp_connect requests connection at the application layer
2) cmpp_terminate terminate the application layer connection
3) cmpp_terminate_rep terminate the application layer connection response
4) cmpp_deliver_rep sends an SMS response
5) cmpp_submit submits text messages
6) cmpp_query query the status of sent SMS messages
7) cmpp_cancel delete text message
8) cmpp_active_test activation test
9) cmpp_active_test_rep activates the Test Response
The types of messages that ismg sends to ICP include:
1) cmpp_connect_rep requests a connection response
2) cmpp_deliver text message delivery
3) cmpp_submit_rep submits an SMS response
4) cmpp_query_rep SMS status query results
5) cmpp_cancel_rep: delete text message response
6) cmpp_active_test_rep activates the Test Response
7) cmpp_active_test activation test
8) cmpp_terminate terminate the application layer connection
9) cmpp_terminate_rep terminate the application layer connection response
Messages sent between ismg include:
1) Forward cmpp_fwd messages
2) forward to response of cmpp_fwd_rep message
3) cmpp_route route request
4) cmpp_route_rep route request response
One operation procedure
Short Message
Ismg
Communication with the ICP Service adopts the TCP/IP protocol, and both parties are client and server. Sending and receiving are performed separately. Each Service establishes a connection, and the communication adopts the reply method.
The request is completed in the same connection. Because the system uses the Client/Server mode for each other, the Operation initiates a connection request in the client drive mode, and closes the connection after completing an operation. During transmission, if
Ismg considers that it is necessary to establish a TLS connection. Then, it sets the tls field in the transmitted packets and establishes the TLS connection between the two parties.
In the connection, the ICP authentication is performed in stages.
When you exchange information with imsg for the first time, the ICP first sends an identity authentication package. After imsg authenticates the ICP, it records the IP address of the ICP and other relevant information for future data interaction.
Imsg regards the IP address of the ICP as the authentication condition, that is, it will not process information related to the unregistered ICP. When the ICP wants to disconnect the logical application layer connection, it sends a disconnect request.
The ismg clears the information related to this ICP after accepting the disconnect request. That is, the MT information sent to this ICP or ICP by Mo is not processed, but the information of Mo is saved, until the ICP retries
Ismg establishes a logical connection to the application layer, that is, identity authentication. Ismg is also allowed to initiate an ICP disconnection request.
The message is sent concurrently and throttled. The window size is adjustable and is tentatively set to 10 messages. That is, more than 10 messages received by the recipient before the response are rejected.
The types of messages that an ICP sends to ismg include:
1) cmpp_connect requests connection at the application layer
2) cmpp_terminate terminate the application layer connection
3) cmpp_terminate_rep terminate the application layer connection response
4) cmpp_deliver_rep sends an SMS response
5) cmpp_submit submits text messages
6) cmpp_query query the status of sent SMS messages
7) cmpp_cancel delete text message
The types of messages that ismg sends to ICP include:
1) cmpp_connect_rep requests a connection response
2) cmpp_deliver text message delivery
3) cmpp_submit_rep submits an SMS response
4) cmpp_query_rep SMS status query results
5) cmpp_cancel_rep: delete text message response
6) cmpp_terminate terminate the application layer connection
7) cmpp_terminate_rep terminate the application layer connection response
Messages sent between ismg include:
1) Forward cmpp_fwd messages
2) forward to response of cmpp_fwd_rep message
3) cmpp_route route request
4) cmpp_route_rep route request response
One operation procedure (Mo and MT)
Message Definition
The CMPP connection port number is defined as 7890. Byte uses the network sequence that is commonly used in the network, and the time-out interval uses the Fibonacci series. The number of resends is dynamically adjustable, preferably at least three times.
Basic Data Type:
Integer
Unsigned integer
C-octet string
Variable-length string. The string ends with a null character.
OCTET STRING
Fixed-length string. If the number of digits is insufficient, the right side is left blank.
7.1 message structure
Project
Description
Message Header
Message Header (all common message headers)
Message Body
Message Body
7.2 Message Header Format (message header)
Field name
Bytes
Type
Description
Total_length
4
Integer
Total message length (including message header and Message Body)
Command_id
4
Integer
Command or response type
Sequence_id
4
Integer
Message serial number, which is accumulated sequentially. The step size is 1, which is used cyclically.
7.3 message body format (Message Body)
1. cmpp_connect requests connection
Field name
Bytes
Attribute
Description
Source_addr
6
OCTET STRING
Icp_id
Authenticatoricp
16
OCTET STRING
ICP authentication code [1]
Reverse
8
OCTET STRING
Reserved items (not required currently)
2. cmpp_connect_rep requests a connection response
Field name
Bytes
Attribute
Description
Status
1
Integer
Status
0: Correct
1: Message structure error
2: Invalid icp_id
3: Incorrect ICP Authentication
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 the connection
The message body is empty.
4. cmpp_terminate_rep connection termination response
The message body is empty.
5. cmpp_submit sends text messages
Field name
Bytes
Attribute
Description
Msg_id
4
Integer
Information identifier
1 ~ Ffffffffh
Sequential addition. The step size is 1 and can be used cyclically.
Pk_total
1
Integer
Total number of messages with the same msg_id
Pk_number
1
Integer
Message number with the same msg_id
Msg_level
1
Integer
Information level
Service_id
10
OCTET STRING
Business type
Tls_available
1
Integer
Whether to use the TLS protocol layer
Msg_fmt
1
Integer
Information Format
0: ASCII string
3: SMS card writing
4: binary information
8: ucs2 Encoding
15: including GB Chinese Characters
Msg_src
6
OCTET STRING
Information Content source (icp_id)
Feetype
1
Integer
Fee category
Feecode
1
Integer
Fee code
Valid_time
1 Or 17
C-octet string
Validity period (when the number of bytes is 1: the retention period is not specified, and the value is set to null)
At_time
1 Or 17
C-octet string
Scheduled sending time (when the number of bytes is 1: The sending time is not specified and set to null)
Src_terminal_id
21
OCTET STRING
Source terminal ID (no value can be blank)
Destusr_tl
1
Integer
Number of users receiving messages (less than 100 users)
Dest_terminal_id
21 * destusr_tl
OCTET STRING
Mobile phone number of the receiving service
Msg_length
1
Integer
Message length (1-70 or 140)
Msg_content
Msg_length
C-octet string
Message Content
Reserve
8
OCTET STRING
Retained
6. cmpp_submit_rep sends a text message response. (If an error occurs, all msg_id messages must be resent in the ICP filing system)
Field name
Bytes
Attribute
Description
Msg_id
4
Integer
Message ID
Tls_available
1
Integer
Whether to use the TLS protocol layer
Result
1
Integer
Result
0: Correct
1: Message structure error
2: The command is incorrect.
3: The message serial number is repeated.
4: The message length is incorrect.
5: the billing code is incorrect.
6: exceeds the maximum information Length
7. Service code error
8: Traffic Control Error
9 ~ : Other errors
7. cmpp_query query the status of the sent text message (query the statistics of the date specified by the time attribute)
Field name
Bytes
Attribute
Description
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 number of queries
1: query by Business Code
Query_code
10
OCTET STRING
Query code [3] (business type)
Reserve
8
OCTET STRING
Retained
8. cmpp_query_rep SMS status query results
Field name
Bytes
Attribute
Description
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 number of queries
1: query by Business Code
Query_code
10
OCTET STRING
Query code
Mt_tlmsg
4
Total number of integer received information from the ICP
Mt_tlusr
4
Integer
Total number of ICP recipients
Mt_scs
4
Integer
Successful forwarding count
Mt_wt
4
Integer
Number of pending forwarding
Mt_fl
4
Integer
Failed forwarding count
Mo_scs
4
Integer
Number of successfully delivered to ICP
Mo_wt
4
Integer
Quantity to be delivered to ICP
Mo_fl
4
Integer
Number of failed ICP delivery
9. cmpp_deliver
Field name
Bytes
Attribute
Description
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
Business type
Msg_fmt
1
Integer
Information Format
0: ASCII string
4: binary information
8: ucs2 Encoding
Srcterminal_id
21
OCTET STRING
Source terminal ID
Msg_length
1
Integer
Message Length
Msg_content
Msg_length
C-octet string
Message Content
Reserve
8
OCTET STRING
Retained item (provide the confirmation information submitted to the mobile phone user for the ICP filing system in the future)
10. cmpp_deliver_rep sends an SMS response
Field name
Bytes
Attribute
Description
Msg_id
4
Integer
Message ID
Tls_available
1
Integer
Whether to use the TLS protocol layer
Result
1
Integer
Result
0: Correct
1: Message structure error
2: The command is incorrect.
3: The message serial number is repeated.
4: The message length is incorrect.
5: the billing code is incorrect.
6: exceeds the maximum information Length
7. Service code error
8: Traffic Control Error
9 ~ : Other errors
11. cmpp_cancel delete text message
Field name
Bytes
Attribute
Description
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
Bytes
Attribute
Description
Tls_available
1
Integer
Whether to use the TLS protocol layer
Success_id
1
Integer
Success ID (0: Successful; 1: Failed)
13. cmpp_active_test activation test
Field name
Bytes
Attribute
Description
Tls_available
1
Integer
Whether to use the TLS protocol layer
14. cmpp_active_test_rep activation test response
Field name
Bytes
Attribute
Description
Tls_available
1
Integer
Whether to use the TLS protocol layer
Success_id
1
Integer
Success ID (0 -- success)
15. cmpp_fwd text message forwarding
Field name
Bytes
Attribute
Description
Source _ id
4
OCTET STRING
Source gateway code
Dest_id
4
OCTET STRING
Destination gateway code
Nodescount
1
Integer
Number of gateways
Tls_available
1
Integer
Whether to use the TLS protocol layer
Msg_id
4
Interger
Information identifier
Pk_total
1
Integer
Total number of messages with the same msg_id
Pk_number
1
Integer
Message number with the same msg_id
Msg_level
1
Integer
Information level
Service_id
10
OCTET STRING
Business type
Msg_fmt
1
Integer
Information Format
0: ASCII string
4: binary information
8: ucs2 Encoding
15: including GB Chinese Characters
Srcterminal_id
21
OCTET STRING
Source terminal ID (no value can be blank)
Destusr_tl
1
Integer
Number of users receiving messages
Dest_terminal_id
21 * destusr_tl
C-octet string
Mobile phone number of the receiving service
Msg_src
6
OCTET STRING
Information Content Source
Feecode
2
OCTET STRING
Fee code
Valid_time
1or17
C-octet string
Validity period (when the number of bytes is 1: The sending time is not specified, and the value is set to null)
At_time
1or17
C-octet string
Scheduled sending time (when the number of bytes is 1: The sending time is not specified and set to null)
Msg_length
1
Integet
Message Length
Msg_content
Msg_length
C-octet string
Message Content
Reserve
8
M
Retained
16. Forward response of cmpp_fwd _ rep text message
Field name
Bytes
Attribute
Description
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 with the same msg_id
Tls_available
1
Integer
Whether to use the TLS protocol layer
Result
1
Integer
Result
0: Correct
1: Message structure error
2: The command is incorrect.
3: The message serial number is repeated.
4: The message length is incorrect.
5: the billing code is incorrect.
6: exceeds the maximum information Length
7. Service code error
8: Traffic Control Error
9: forward-to-forward judgment error (this ICP should not be sent to this ismg)
10 ~ : Other errors
17. cmpp_route route request
Field name
Bytes
Attribute
Description
New_gate
1
Integer
0: Common Gateway; 1: new Gateway
Request_total
2
Integer
0: request one route table; 1: Request Multiple Route table data (if the following field is blank, request all route tables)
Service_type
10
OCTET STRING
Requested business type
Service_code
4
Integer
Requested Business Code
Icp_id
6
OCTET STRING
ICP access code (This field is blank if service_type is set)
18. cmpp_route_rep route request response
Field name
Bytes
Attribute
Description
Request_number
2
Integer
Number of data entries in the returned route table. If the value of this field is greater than 1, the following five fields are repeated.
Service_type
10
OCTET STRING
Business type
Service_code_start
4
Integer
Start mark of Business Code
Service_code_end
4
Integer
End mark of Business Code
Icp_id
6
OCTET STRING
ICP access code (This field is blank if service_type is set)
Ismg_id
4
OCTET STRING
Gateway code corresponding to the preceding conditions
......
8. No.
8.1 ismg_id
Location
ID (ismg_id temporary area code ID)
Description
Beijing
(010)
Stroch
Jiangxi
(0791)
Tsinghua shenxun
Guangzhou
(020)
Tsinghua shenxun
Tianjin
(022)
Others to be determined
8.2 ICP No.
ICP name
ID (ismg_id)
Description
Sina
(TBD)
Sohu
(TBD)
TBD)
8.3 command_id
Command name
Command_id Value
Description
Cmpp_connect
Zero X 00000001
Request connection
Cmpp_connect_rep
Zero X 80000001
Request connection response
Cmpp_terminate
Zero X 00000002
Terminate connection
Cmpp_terminate_rep
Zero X 80000002
Terminate connection response
Cmpp_submit
Zero X 00000004
Submit SMS
Cmpp_submit_rep
Zero X 80000004
Submit SMS response
Cmpp_deliver
Zero X 00000005
Text message delivery
Cmpp_deliver_rep
Zero X 80000005
Send SMS response
Cmpp_query
Zero X 00000006
Query sent sms status
Cmpp_query_rep
Zero X 80000006
Send SMS status query response
Cmpp_cancel
Zero X 00000007
Delete SMS
Cmpp_cancel_rep
Zero X 80000007
Delete SMS response
Cmpp_active_test
Zero X 00000008
Activation test
Cmpp_active_test_rep
Zero X 80000008
Activate Test Response
Cmpp_fwd
Zero X 00000009
Message forwarding
Cmpp_fwd_rep
Zero X 80000009
Forward to response
Cmpp_route
Zero X 00000003
Route request
Cmpp_route_rep
Zero X 80000003
Route Request Response
8.4 feetype & feecode fee category and fee code (TBD)
I. Information level
The information level is 1-9, "9" is the highest, and "0" is the lowest
Ii. billing code
Specific Definition:
"00": free
"99": monthly subscription
"98": Cap
"01" -- "10": 0.01 yuan -- 0.10 yuan
"11" -- "50": increases at 0.05 Yuan
"51" -- "80": increases at 0.10 yuan
"81" -- "97": Reserved
[1] used for ICP identification. The value is calculated using one-way MD5 hash, which is expressed as follows:
Authenticatoricp = MD5 (source_addr + 9 zero int + connecttype + Shared Secret)
Shared Secret was agreed by China Mobile and the ICP in advance.
[2] used to identify ismg. The value is calculated using one-way MD5 hash, which is expressed as follows:
Authenticatorismg = MD5 (status + authenticatoricp + tls_available + Shared Secret)
Shared Secret was agreed by China Mobile and the ICP in advance. authenticatoricp is the value in the cmpp_request_connect message sent by the ICP to ismg.
[3] This item is invalid when query_type is 0. When query_type is 1, enter the service code service_id.
References: http://www.simpleteam.com/simpleteam/sms/cmpp1_1.htm