TCP/IP is classified into TCP and UDP. TCP is a connection-oriented protocol that is secure and stable, but inefficient and occupies a large amount of resources. UDP is a connectionless protocol with high efficiency, fast speed, and few resources. However, its transmission mechanism is unreliable and must rely on auxiliary algorithms for transmission control.
The communication protocol used by QQ is mainly UDP, supplemented by TCP. Because the design capacity of the QQ server is sea-level applications, a server must accommodate tens of thousands of concurrent connections at the same time, therefore, this ultra-large scale service can be guaranteed only when the server uses UDP protocol to communicate with the client.
The UDP mode is also used for message transmission between QQ clients, which is different from the TCP mode for communication between foreign ICQ clients. Because the network environment in China is very complex, and many users use the proxy server to share a line of Internet access, in these complex circumstances, the probability of establishing TCP connections between clients is small, seriously affecting the efficiency of information transmission. While UDP packets can penetrate most of the proxy servers, we chose UDP as the main communication protocol between customers when developing QQ, therefore, netizens may think that using QQ to send information is faster than ICQ and other ICQ software using TCP protocol. Of course, UDP has outstanding advantages and obvious disadvantages: the transmission of UDP packets is unreliable, and it does not have a packet retransmission mechanism like TCP, therefore, UDP-based information is easy to lose during transmission. Therefore, an auxiliary algorithm is required to re-transmit packets to ensure that information is not lost, while the load on the QQ server is very heavy, therefore, before QQ 99b 0425, we used this auxiliary mechanism to send messages between the client and the client. When messages cannot be directly transmitted between customers, they need to be transferred through the server, in earlier versions, the server did not control the transmission of information sent to the client due to heavy load, therefore, in earlier versions, information transmitted through the server may be lost.
After qq99c 0725, we independently set up several dedicated servers to use the packet retransmission mechanism to transfer messages (only messages transmitted between 99c ), ensure that messages forwarded by the server can also be sent to the other party's QQ.
Starting from qq0410, we used a 128-bit key to encrypt the information transmitted between the client and the server, greatly improving the security of QQ, from Versions later than 0725, QQ uses the same algorithm to encrypt the information transmitted from the client to the client, in this way, potential risks such as information bombs, information camouflage, and information interception can be basically eliminated.
It is particularly worth noting that our encryption mode is completely designed in open source code mode, that is to say, even if the hacker obtains all the encryption algorithms, it still cannot pose a threat to the security of other users. I believe that as the new version is launched, QQ will become more and more secure, QQ users can use our products with greater confidence.
OICQ Server System Communication Protocol
Protocol description:
The Protocol consists of the packet header (t), the sender (t), the receiver (t), the packet type (t), the packet length (L), and the packet content.
The sender and receiver are program types in the system. The OICQ server 0x01, the fax server 0x02, the web server 0x03, and the printing server 0x04, the chat server is 0x05, And the OICQ user is 0x0a.
Communication Protocol pilot from an OICQ user to an OICQ server (0x81 + 0x0a + 0x01)
Description of message content
0x01 nickname (s) + portrait (m) + User Password (s) + gender (t) + age (t) + Real Name (s) + country/region (t) + province (t) + city (s) + address (s) + Zip code (s) + Education (t) + Graduate School (s) + occupation (t) + telephone (s) + paging (s) + email (s) + hobby (s) + description (s) + identity authentication (t) new user registration, identity Verification is used to ask if a user wants to add him to a friend.
0x02 service No. (l) + password (s) + registration method (t) Old user registration, the method is divided into 0 normal, 1 stealth
0x03 service No. (l) + other service No. (l) + content (s) send information to someone
0x04 service No. (l) + group no. (l) + content (s) broadcast information, Group No. = 0 is all
0x05 service No. (l) + friend service No. (l) view friend information
0x06 service No. (l) + group name (s) add Group
0x07 service No. (l) + group no. (t) + group name (s) Modify group name
0x08 service No. (l) + group no. (T) Delete Group
0x09 service No. (l) + mobile users (t) + {friend service No. (l) + target group no. (T)} Member of the Mobile Group
0x0a service number (l) + start number (l) + return number (t) + SEARCH mark (t)
Search flag 1 = search for small 2 = SEARCH FOR LARGE
0x0b service No. (l) + SQL statement (s) Custom Search
0x0c service number (l) + friend service number (l) Add friends
0x0d service No. (l) + friend service No. (l) + Add reason (s) request to join a friend
0x0e service number (l) + friend service number (l) delete friend
0x10 service No. (l) + display mode (t) Change Display Mode 1 online 2 hidden 3 do not disturb 4 offline
0x11 service No. (l) + monitoring service No. (l) Monitoring someone's conversation
0x12 service No. (l) + nickname (s) + portrait (m) + User Password (s) + gender (t) + age (t) + Real Name (s) + country/region (t) + province (t) + city (s) + address (s) + Zip code (s) + Education (t) + Graduate School (s) + occupation (t) + telephone (s) + paging (s) + email (s) + hobby (s) + description (s) + identity authentication (t) change basic user information
0x13 service No. (l) + friend service No. (l) + file name (s) + file length (L) request to send a file
0x14 service No. (l) + friend service No. (l) + allow/deny whether to allow File Sending
0x15 service No. (l) + friend service No. (l) + file content (B) Send File
0x16 service No. (l) connection test message
0x17 service No. (l) + friend service No. (l) + sign of consent (t) respond to the other party's request to join a friend
0 = rejected
1 = agree
Communication protocol between OICQ server and OICQ
Description of message content
0x01 success/failure (t) + service number (l) New user registration result returned
0x02 success/failure (t) + number of groups (t) + {group name (s) + group number (t) + number of Friends (t) + {friend service No. (l) + portrait No. (t) + friend status (t) + friend nickname (s)] Old user registration result returned
Friend status
1 = online = 2 Hide = 3 do not disturb 4 offline
0x03 sign (t) + friend service number (l) + Information (s) + information type (t) Sign 1 = System 2 = user
Send a message. Service number = 0 indicates a system message.
1 = user XX has added you as a friend
2 = user XX requests you to pass Identity Authentication
3 = user XX agreed to your verification requirements
4 = user XX rejected your verification request
0x04 success/failure (t) + friend service number (l) + nickname (s) + portrait (m) + gender (t) + age (t) + Real Name (s) + country/region (t) + province (t) + city (s) + address (s) + Zip code (s) + Education (t) + graduation School (s) + occupation (t) + telephone (s) + paging (s) + email (s) + hobby (s) + description (s) friend information delivery
0x05 success/failure (t) + group ID (t) + group name (s) add group result 1/0
0x06 success/failure (t) + group ID (t) + group name (s) Modify group name result 1/0
0x07 success/failure (t) + group number (t) Delete Group result return 1/0
0x08 success/failure (t) result of moving group members 1/0
0x09 success/failure (t) + online count (t) + {service No. (l) + nickname (s) + portrait (m) + province (t) + city (s)} search for online staff results for delivery
0x0a success/failure (t) + find count (t) + {service No. (l) + nickname (s) + portrait (m) + province (t) + city (s)} Custom Search Result delivery (up to 50)
0x0b flag (t) + friend service number (l) Add a friend result delivery flag
0 = Database Failure
= 1 success
= 2 authentication required
= 3 the recipient is not allowed to join
= 4 authentication required and not online
0x0c friend service number (l) + nickname (s) + portrait number (m) + friend status (t) Add friends to online users
0x0e success/failure (t) + friend service number (l) Drop friend result delivery
0x10 service No. (l) + display mode (t) display mode send back = 1 online = 2 hidden = 3 do not disturb 4 offline
0x11 success/failure Change User basic information result return
0x12 friend service number (l) + file name (s) + file length (L) request to send a file
0x13 friend service number (l) + allow/deny whether to allow File Sending 1 allow 0 deny
0x14 friend service No. (l) + file content (B) Send File
0x15 friend service number (l) + current status (t) friend status delivery (system send) = 1 online = 2 hidden = 3 do not disturb 4 offline
0x16 service No. (l) connection test