WO2006133651A1 - Communication method between communication devices and communication apparatus - Google Patents

Communication method between communication devices and communication apparatus Download PDF

Info

Publication number
WO2006133651A1
WO2006133651A1 PCT/CN2006/001364 CN2006001364W WO2006133651A1 WO 2006133651 A1 WO2006133651 A1 WO 2006133651A1 CN 2006001364 W CN2006001364 W CN 2006001364W WO 2006133651 A1 WO2006133651 A1 WO 2006133651A1
Authority
WO
WIPO (PCT)
Prior art keywords
communication device
communication
packet
data
data packet
Prior art date
Application number
PCT/CN2006/001364
Other languages
English (en)
French (fr)
Inventor
Hongyu Sun
Original Assignee
Tencent Technology (Shenzhen) Company Limited
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology (Shenzhen) Company Limited filed Critical Tencent Technology (Shenzhen) Company Limited
Priority to PL06742183T priority Critical patent/PL1892887T3/pl
Priority to EP06742183.4A priority patent/EP1892887B1/en
Priority to ES06742183.4T priority patent/ES2526546T3/es
Priority to CA2611776A priority patent/CA2611776C/en
Publication of WO2006133651A1 publication Critical patent/WO2006133651A1/zh
Priority to US11/954,931 priority patent/US7913293B2/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/02Network architectures or network communication protocols for network security for separating internal from external traffic, e.g. firewalls
    • H04L63/029Firewall traversal, e.g. tunnelling or, creating pinholes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/142Managing session states for stateless protocols; Signalling session states; State transitions; Keeping-state mechanisms

Definitions

  • the present invention relates to the field of computer and communication technologies, and in particular, to a method and a communication device for implementing communication between communication devices. Background of the invention
  • P2P can adopt the communication control protocol (TCP, Transfer Control Protocol) or the User Datagram Protocol (UDP).
  • TCP Transmission Control Protocol
  • UDP User Datagram Protocol
  • servers in the Internet are set up by a multi-Internet data center (IDC) to guide users to access servers that are faster to connect with themselves, and to communicate in a client-server-client (CSC) mode.
  • IDC multi-Internet data center
  • CSC client-server-client
  • the application of the above UDP method to implement P2P communication, especially the online game as long as the network speed between the user and the server is relatively fast, the smoothness of the application can be guaranteed.
  • the data passed between users needs to be forwarded through the server, the data volume and load of the server are very Large, eventually, may result in slower user information interaction. Summary of the invention
  • the present invention provides a method of implementing communication between communication devices to reduce the load of the server and to improve the interaction speed of the user information.
  • the present invention also provides a communication device by which communication between communication devices can reduce the load on the server while improving the speed of interaction of user information.
  • the method for implementing communication between communication devices according to the present invention includes:
  • the first communication device or the second communication device initiates a command to establish a P2P connection with the other party; and directly establishes a P2P channel between the first and second communication devices according to the command to establish a P2P connection and transmits the data packet through the P2P channel.
  • the communication device of the present invention includes:
  • the first interface is configured to receive the first data packet sent by the application program on the communication device to which the user belongs, or send the data packet on the network side to the application program on the communication device to which the user belongs; the codec module sends the message to the first interface. Data on the network side is encoded, or data sent to the first interface is decoded;
  • a second interface configured to send the encoded data to the network and send the data received from the network to the codec module
  • a first communication module configured to control communication information and communication mode of the communication device to which the user belongs and the server in the network;
  • the second communication module is configured to control communication information and communication manners of other communication devices connected through the peer P2P. It can be seen that the present invention establishes a P2P channel directly between the communication devices by the service forwarding communication device to establish a P2P channel request, and the server does not need to forward the data, thereby reducing the load on the server and improving the load. The speed of interaction of user information.
  • FIG. 1 is a flow chart of a method for directly establishing a P2P channel and communicating between communication devices according to a preferred embodiment of the present invention
  • FIG. 2 is a flowchart of a method for a communication device to determine a network condition of a network according to a preferred embodiment of the present invention
  • FIG. 3 is a schematic diagram of the internal structure of a communication device according to a preferred embodiment of the present invention. Mode for carrying out the invention
  • a preferred embodiment of the present invention provides a communication method between communication devices in a network.
  • the first communication device in the network first sends a request message for establishing a P2P connection to the second communication device by using the server, and then, by the communication device of the first communication device and the second communication device, initiates establishing a P2P with the other party.
  • the command of the channel finally establishes a P2P channel between the first communication device and the second communication device by the resource control device in the network to implement UDP mode communication between the first communication device and the second communication device.
  • the data that the two communication devices send to each other will no longer be forwarded by the server, thereby reducing the load on the server. And can speed up the response of interactive information.
  • the communication device in the network may be on the public network, it may also be behind the private network firewall. Since the communication device in the private network first needs to be established on the gateway of the public network and the private network. The mapping between the private network address and the public network address can receive the data packets sent from the public network. Therefore, the communication device in the private network must pass the server whether it requests to establish a P2P channel or is requested to establish a P2P channel. A P2P tunnel request is established to the peer to establish a mapping between the private network address and the public network address on the public network and the private network gateway. Thereafter, the P2P channel can be established with other communication devices.
  • a process of establishing a P2P channel between a first communication device and a second communication device and transmitting data through the channel is as follows:
  • Step 1 The first communication device sends a request message for establishing a P2P channel with the second communication device to the server.
  • the address information of the request message that is, its own private network IP address and port number, should be carried in the request message.
  • the first communication device needs to first know whether it is a communication device of a public network or a communication device of a private network. Since the communication device is connected to the server in the communication system, the server can obtain the address information such as the IP address and the port of each communication device. Therefore, the communication device can know whether it is in the public network or private by sending a data packet to the server.
  • the network the process is shown in Figure 2, including:
  • Step 10 The communication device establishes a connection with the server
  • Step 11 The communication device sends, to the server, a UDP data packet for learning the network condition of the communication device;
  • the UDP data packet sent by the communication device to the server must pass through the gateway of the public network and the private network, and the gateway will forward the UDP data packet when The IP address and port number of the private network carried are replaced with the public IP address and port number of the gateway, and then forwarded to the server.
  • Step 12 After receiving the UDP packet of the communication device, the server extracts the source IP address and port number in the data packet, that is, the IP address and port of the communication device seen by the server. And sending a data packet carrying the IP address and port number to the communication device;
  • the IP address and port number of the communication device seen by the server will be the private network IP address and port number of the communication device itself, and for the private For the UDP packet of the network communication device, the IP address and port number of the communication device seen by the server will be the public network IP address and port number of the gateway connecting the communication device to the public network.
  • Step 13 The communication device extracts the IP address and port number from the data packet sent by the server, and compares it with the IP address and port number of the communication device. If the IP address and the port number are the same, it is determined that the communication device is in the public. If the IP address and port number are different, you can confirm that the communication device is in the private network.
  • the communication device can know whether it is a communication device of the public network or a communication device of the private network.
  • Step 2 The server sends the request message to the second communication device and returns a response message to the first communication device.
  • Step 3 After the second communication device receives the request message, if the communication device is in the private network, step 4 is performed. Otherwise, according to the address of the first communication device in the request message, the first communication device is initiated. Create a P2P channel command.
  • the second communication device may also determine whether it is in the public network or in the private network by using the methods in steps 10 to 13 shown in FIG. 2 .
  • Step 4 The second communication device sends a request message for establishing a P2P channel with the first communication device to the server.
  • the second communication device should also carry its own address information, that is, its own private network IP address and port number in the request message.
  • Step 5 The server sends the request message to the first communication device, and returns a response message to the second communication device.
  • Step 6 The first communications device initiates a P2P channel command to the second communications device according to the address of the second communications device in the received request message.
  • the first communication device Since the first communication device sends the request message to the server in step 1, the first communication device has established a mapping relationship between the private network address and the public network address on the gateway. Therefore, in this step, The first communication device in the first communication device may directly initiate a command to establish a P2P connection.
  • the second communication device may send the first communication to the first communication according to the address of the first communication device in the request message received by the second communication device.
  • the device initiates the establishment of a P2P channel command.
  • Step 7 The resource control device in the network establishes a direct P2P channel between the first communication device and the second communication device, and the first communication device and the second communication device transmit the UDP data packet through the channel.
  • step 7 if both the first communication device and the second communication device are on the same private network, the channel can be established within the private network.
  • the test packet may be immediately sent to the other party to determine whether a P2P channel has been established.
  • the receiver returns a response after receiving a test packet.
  • the sender sends a confirmation message that the P2P channel has been established, and then starts transmitting data.
  • the party that receives the data packet extracts the sequence number from the packet header information, and compares it with the sequence number of the data packet received before and after, to compare Determine if there is a packet loss and determine which packets have not been received, and If it is determined that there is a packet loss, the requesting party resends the data packet.
  • the communication device that receives the data may also need to send data to the other party, in order to save network bandwidth, reduce the probability of network congestion, and improve communication quality
  • the message that requires the other party to resend the data packet and the information identifying the packet may pass.
  • the packet is carried to the other party.
  • one byte is used to identify 8 data after the data packet with the smallest sequence number in the unreceived data packet.
  • the status of the packet another byte is used to identify the status of the 8 packets before the packet with the largest sequence number. This is because, if no packet is received, the network may be congested. The number of consecutive packets after the packet with the smallest sequence number in the lost packet is likely to be lost. Generally, the data is closely related. Therefore, the data is also closely related.
  • a byte is also used to indicate the reception status of the next 8 data packets to determine which data packets need to be retransmitted.
  • the above method is especially suitable for online games.
  • the network speed is high and the data reaches the destination as quickly as possible. Therefore, the UDP data packet is directly transmitted between the game terminals through the P2P channel and combined with the retransmission mechanism. It ensures the reliability of message delivery, can greatly improve the smoothness of the game and the speed of information exchange, and overcomes the shortcomings of the prior art to forward data through the server.
  • Still another preferred embodiment of the present invention also provides a communication device that is configured in a communication device on a network.
  • the communication device includes: a first interface, a second interface, a codec module, a first communication module, and a second communication module, where:
  • the first interface is also called an application layer interface, and is configured to receive a data packet sent by the application on the communication device to which the application belongs to the network side, or to transmit the data packet sent by the network side to an application on the communication device of the communication device.
  • the codec module is configured to encode data sent to the network side through the first interface, and may further encrypt data to be sent; or decode data sent by the network side to the first interface, and further if The received data has been encrypted, and the module will also perform corresponding decryption processing on the data.
  • the second interface is also called a socket interface, and is used for sending the encoded data to the network side; or sending data received from the network side to the codec module.
  • the first communication module is connected between the first interface and the codec module, and is configured to control communication information and communication mode of the communication device to which the user belongs and the P2P server in the network.
  • the P2P server has a fixed IP address on the public network, and its function is to provide services for establishing P2P channels between communication devices.
  • the first communication module can obtain address information of each communication device connected to the P2P server by interacting with the P2P server.
  • a second communication module is connected between the first interface and the codec module, and is configured to control communication information and communication manners of other communication devices connected by the communication device to which the communication device belongs by using the P2P mode, and obtain the communication device from the first communication module. Address information.
  • the second communication module may be multiple, wherein each second communication module is used to control communication between itself and one other communication device.
  • the data transmission process is as follows: The application first transmits data to its own communication The first interface of the device;
  • the data sent by the program includes the ID information of the communication terminal, and after receiving the data, the first interface sends the data to the designated second communication module according to the ID information of the communication terminal included therein; the second communication module Obtaining a destination address and related information of the data to be sent by itself and the first communication module; then calling the codec module to encode the data, and possibly including an encryption process; and finally transmitting the encoded data to the network side through the second interface .
  • the data receiving process thereof is as follows: the communication device obtains data through the second interface; and then sends the received data to the codec module to decode the data, during A decryption process may also be included; the decoded data is then transmitted to the application on the communication device to which it belongs via the designated second mode communication module and the first interface.
  • the communication devices are randomly distributed on the network and do not know each other's information, the P2P connection cannot be established directly. However, through the above communication device, the communication devices can first know each other's information through the server, and then the P2P connection can be directly established. .

Description

一种在通信设备间实现通信的方法及通信装置
技术领域
本发明涉及计算机及通信技术领域, 尤其涉及一种在通信设备间实 现通信的方法及通信装置。 发明背景
随着互联网技术的发展, 基于互联网的应用也越来越多, 如基于互 联网的网络游戏、 即时通信等等, 而且这些应用对传输速度的要求也越 来越高。 由于目前互联网是以浏览器 /服务器 (Browser/Server )或客户 端 /服务器 ( C/S )结构的应用模式为主, 这样的应用模式必须在网络内 设置一个服务器, 而信息是通过网络内的服务器传递的, 因此, 现阶段 互联网应用对服务器处理速度的要求也越来越高。 在这种情况下, 如果 网速较慢, 则会影响该类应用的流畅性和效果, 因此这类应用在实现时 通常采用称为对等连接或对等网络连接的 P2P ( Peer to Peer )技术。
P2P可以采用传输控制协议(TCP, Transfer Control Protocol )或用 户数据报协议(UDP, User Datagram Protocol ) 两种通信方式。 通常, 对于要求数据包要尽可能的快速达到目的地的应用来说, 例如高对抗性 的键盘类网络游戏, 这类应用一般需要采取 UDP的方式实现 P2P通信。
在实际的应用中, 在互联网中的服务器采取多互联网数据中心 ( IDC )方式架设, 引导用户接入与自己连接速度较快的服务器, 采取 客户端-服务器-客户端 (CSC )模式通信。 通常情况下, 采取上述 UDP 方式实现 P2P通信的应用, 特别是网络游戏, 只要用户与服务器之间的 网络速比较快, 应用的流畅性就可以得到保障。 但是, 由于在用户之间 传递的数据都需要通过服务器转发, 使得服务器的数据量和负载非常 大, 最终可能导致用户信息交互速度变慢。 发明内容
本发明提供一种在通信设备间实现通信的方法, 以降低服务器的负 荷, 并可以提高用户信息的交互速度。
除此之外, 本发明还提供了一种通信装置, 通过该通信装置进行通 信设备间的通信可以降低服务器的负荷, 同时提高用户信息的交互速 度。
本发明所述在通信设备间实现通信的方法, 包括:
第一通信设备通过服务器向第二通信设备发送建立对等 P2P连接的 请求消息;
第一通信设备或第二通信设备发起与对方建立 P2P连接的命令; 根据所述建立 P2P连接的命令在第一和第二通信设备间直接建立 P2P通道并通过该 P2P通道传送数据包。
本发明所述通信设备, 包括:
第一接口, 用于接收自身所属通信设备上应用程序发送的第一数据 包, 或将网络侧的数据包发送给自身所属通信设备上的应用程序; 编解码模块, 对通过第一接口发向网络侧的数据进行编码, 或对发 向第一接口的数据进行解码;
第二接口, 用于将编码后的数据发送到网络和将从网络接收的数据 发送到编解码模块;
第一通信模块, 用于控制自身所属通信设备与网络中的服务器的通 信信息和通信方式;
第二通信模块, 用于控制通过对等 P2P连接的其他通信设备的通信 信息和通信方式。 由此可以看出, 本发明通过服务转发通信设备之间的建立 P2P通道 请求后, 直接在通信设备之间建立 P2P通道进行通信, 不再需要服务器 转发数据, 从而降低了服务器的负荷, 可提高用户信息的交互速度。 附图简要说明
图 1为本发明优选实施例所述的通信设备间直接建立 P2P通道并进 行通信的方法流程图;
图 2为本发明优选实施例所述的通信设备判断自身网络情况的方法 流程图;
图 3为本发明优选实施例所述的通信装置内部结构示意图。 实施本发明的方式
下面结合附图及具体实施例对本发明作进一步详细描述。
为了解决现有技术中的问题, 本发明的一个优选实施例给出了一种 网络中通信设备之间的通信方法。 在该方法中, 网絡中的第一通信设备 首先通过服务器向第二通信设备发送建立 P2P连接的请求消息, 然后, 由第一通信设备和第二通信设备中的一个通信设备发起与对方建立 P2P 通道的命令, 最后由网络中的资源控制设备直接在所述第一通信设备和 第二通信设备之间建立 P2P通道, 以实现第一通信设备和第二通信设备 之间 UDP方式通信。 这样一来, 在所述第一通信设备和第二通信设备 之间的 P2P通道建立后, 这两个通信设备之间相互发往对方的数据将不 再由服务器转发, 从而减少服务器的负荷, 并可以加快交互信息的响应 速度。
由于网络中的通信设备可能处于公网, 也可能处于私网防火墙后 面。 而由于处于私网内的通信设备首先需要在公网与私网的网关上建立 私网地址与公网地址的映射关系 , 才能接收到从公网发送来的数据包, 因此, 处于私网内的通信设备不管是主动请求建立 P2P通道还是被请求 建立 P2P通道, 都必须通过服务器向对方发起建立 P2P通道请求, 以在 公网与私网的网关上建立私网地址与公网地址的映射关系, 此后, 才能 与其它通信设备建立 P2P通道。
参见图 1 , 本发明优选实施例所述第一通信设备与第二通信设备之 间建立 P2P通道并经该通道传送数据的过程如下:
步骤 1 : 第一通信设备向服务器发送与第二通信设备建立 P2P通道 的请求消息。
在该步骤中, 若所述第一通信设备处于私网内 , 则应当在该请求消 息中携带自身的地址信息, 即自身私网 IP地址和端口号。
因此, 为了实现上述步骤, 所述第一通信设备需要首先获知自身是 公网的通信设备还是私网的通信设备。 由于在通信设备连接到通信系统 中的服务器后, 服务器即可获知各通信设备的 IP地址和端口等地址信 息, 因此, 通信设备可以通过向服务器发送数据包来获知自己是处于公 网还是处于私网, 其过程请参见图 2, 包括:
步骤 10: 通信设备与服务器建立连接;
步骤 11 :通信设备向服务器发送用于获知本通信设备的网络情况的 UDP数据包;
如果所述通信设备处于私网通信设备, 则所述通信设备发送到所述 服务器的 UDP数据包必将会经过公网与私网的网关, 所述网关在转发 该 UDP数据包地时候会将其中携带的私网 IP地址和端口号替换为该网 关的公网 IP地址和端口号, 然后再转发到所述服务器上。
步驟 12: 服务器接收到通信设备的 UDP数据包后, 提取该数据包 中的源 IP地址和端口号, 即服务器所看到的通信设备的 IP地址和端口 号, 并向通信设备发送携带所述 IP地址和端口号的数据包;
在该步驟中, 对于来自公网通信设备的 UDP数据包来讲, 服务器 所看到的通信设备的 IP地址和端口号将为该通信设备自身的私网 IP地 址和端口号, 而对于来自私网通信设备的 UDP数据包来讲, 服务器所 看到的通信设备的 IP地址和端口号将为将该通信设备连接至公网的网 关的公网 IP地址和端口号。
步骤 13: 通信设备从服务器发送来的数据包中提取所述 IP地址和 端口号, 并与通信设备的 IP地址和端口号进行比较, 如果 IP地址和端 口号相同, 则确定本通信设备处于公网, 若 IP地址和端口号不相同, 则 可确定本通信设备处于私网内。
通过上述方法, 通信设备即可获知自身是公网的通信设备还是私网 的通信设备了。
步骤 2: 服务器将所述请求消息发送到第二通信设备, 并向所述第 一通信设备返回响应消息。
步骤 3: 所述第二通信设备接收到请求消息后, 若本通信设备处于 私网, 则执行步骤 4, 否则, 根据请求消息中的第一通信设备的地址, 向所述第一通信设备发起建立 P2P通道命令。
在该步骤中, 所述第二通信设备也可以通过图 2所示的步骤 10〜13 的方法判断自身是处于公网还是处于私网。
步骤 4: 所述第二通信设备向服务器发送与所述第一通信设备建立 P2P通道的请求消息。
在该步骤中 , 所述第二通信设备还应当在所述请求消息中携带自身 的地址信息, 即自身私网 IP地址和端口号。
步骤 5: 服务器将所述请求消息发送到所述第一通信设备, 并向所 述第二通信设备返回响应消息。 步驟 6: 所述第一通信设备根据所接收请求消息中的第二通信设备 的地址, 向所述第二通信设备发起建立 P2P通道命令。
由于在步據 1 中所述第一通信设备通过发送请求消息到所述服务 器, 所述笫一通信设备已在网关上建立了自身私网地址与公网地址的映 射关系, 因此, 在本步骤中所述第一通信设备可以直接发起建立 P2P连 接的命令。
作为上述步骤 6的替代方案, 还可以在所述第二通信设备发送请求 消息之后, 由所述第二通信设备根据自身所接收请求消息中的第一通信 设备的地址, 向所述第一通信设备发起建立 P2P通道命令。
步骤 7: 网络中的资源控制设备在第一通信设备与第二通信设备之 间建立直接的 P2P通道, 第一通信设备和第二通信设备通过该通道传输 UDP数据包。
在步骤 7中, 如果第一通信设备和第二通信设备都在同一个私有网 络, 则可以在该私有网络内建立所述通道。
在上述建立 P2P连接过程中,所述第一、第二通信设备发起建立 P2P 连接的命令之后, 可以立即开始向对方发送测试数据包, 以确定是否已 建立 P2P通道。 接收方在收到一个测试包后返回一个响应, 发送方收到 该响应后再发送一个 P2P通道已建立的确认消息, 此后开始传送数据。
由于 UDP 方式是面向非连接的, 因此, 在网络中不能保证数据包 的传送顺序, 而且在网络繁忙时会出现大量丢包的情况, 因而导致应用 的流畅性和效果得不到保证。 为了在数据传输过程中保证 UDP数据包 接收的可靠性, 在本发明的另一个优选实施例引入重发机制。 即在第一 通信设备与第二通信设备通过 P2P通道传送 UDP数据包时, 收到数据 包的一方从包头信息中提取序列号, 将其与前后收到的数据包的序列号 进行比较, 以判断是否存在丟包和确定有哪些数据包没有收到, 并且在 判断有丢包的情况下请求对方重发这些数据包。
由于接收数据的通信设备也可能需要向对方发送数据, 因此, 为了 节约网络带宽, 降低网络拥塞的概率, 并提高通信质量, 可以将需要对 方重发数据包的消息和标识这些包的信息可以通过数据包携带给对方。
在通过发送的数据包携带丟包信息时, 通过在数据包的包头中增加 两个字节, 其中一个字节用于标识未收到的数据包中序列号最小的数据 包之后的 8个数据包的状态, 另一个字节用于标识序列号最大的数据包 之前的 8个数据包的状态。 这是因为, 没有收到数据包表明网络可能发 生拥塞, 丢失的数据包中序列号最小的数据包之后的连续多个数据包丟 失的可能性比较大, 一般情况下这些数据也密切关联, 因此, 这里也用 一个字节表示其后 8个数据包的接收状态,以确定哪些数据包需要重传; 同样, 丟失数据包中序列号最大的数据之前连续多个数据丟失的可能比 较大, 一般情况下这些数据也密切关联。 该序列号最大的数据包代表最 近的消息, 序列号最小的数据包因等待时间长, 所以这些数据包的重发 优先级较高。 这样, 用于一个字节表示 8个数据包的状态以确定哪些需 要重传, 能够避免传送数据的序列号, 使数据包头尽可能小而包含的信 息量尽可能大。 当然, 也可根据需要在包头中增加更多字节, 如四个, 其处理方式同理。
上述方法尤其适用于网络游戏, 对于高对抗性的键盘类游戏要求网 速高和数据尽可能快速到达目的地, 因此, 通过 P2P通道在游戏终端之 间直接传送 UDP数据包并结合重传机制, 保证了消息传递的可靠性, 可大幅度地的提高游戏的流畅性和信息交互速度, 克服了现有技术通过 服务器转发数据而存在的不足。
除上述通信设备之间的通信方法之外, 本发明的又一个优选实施例 还给出了一种通信装置, 该通信装置被配置于网络上的通信设备中。 如 图 1所示, 所述通信装置包括: 第一接口、 第二接口、 编解码模块、 第 一通信模块和第二通信模块, 其中:
第一接口又称为应用层接口, 用于接收自身所属通信设备上应用程 序向网络侧发送的数据包, 或者将网络侧发送来的数据包传送给自身所 属通信设备上的应用程序。
编解码模块用于对通过第一接口发往网络侧的数据进行编码, 还可 对进一步对待发送的数据进行加密处理; 或者对网络侧发往第一接口的 的数据进行解码, 更进一步, 如果所接收的数据已经过加密处理, 该模 块还将对数据进行对应的解密处理。
第二接口又称为套接字 (Socket )接口, 用于将编码后的数据发送 到网络侧; 或者将从网络侧接收的数据发送到编解码模块。
第一通信模块连接在所述第一接口和编解码模块之间, 用于控制自 身所属通信设备与网络中的 P2P服务器的通信信息和通信方式。
通常情况下, 当某一通信设备需要与另一通信设备进行通信时, 必 须先登录网络中的 P2P服务器。 P2P服务器是具有公网固定 IP地址, 其 作用是为各通信设备之间建立 P2P通道提供服务。 第一通信模块通过与 P2P服务器交互即可获得连接到 P2P服务器的各通信设备的地址信息。
第二通信模块连接在所述第一接口和编解码模块之间, 用于控制自 身所属通信设备通过 P2P方式连接的其他通信设备的通信信息和通信方 式, 以及从第一通信模块得到通信设备的地址信息。
需要说明的是, 在上述通信装置中所述第二通信模块可以为多个, 其中每个第二通信模块用于控制自身与一个其他通信设备的通信。
在包含有多个具有上述通信装置的通信设备的通信系统中, 当一个 通信设备的应用程序要向网络其他通信设备发送数据时, 其数据发送过 程如下: 该应用程序先将数据发送到自身通信装置的第一接口; 由于应 用程序所发送的数据中包含通信终端的 ID信息, 第一接口在收到数据 后, 根据其中所包含的通信终端的 ID信息将数据发给指定的第二通信 模块; 所述第二通信模块通过自身及第一通信模块获得待发送数据的目 的地址及相关信息; 然后调用编解码模块对数据进行编码处理, 期间可 能还包括加密处理; 最后通过第二接口将已编码的数据发送到网络侧。
当某个通信设备中的通信装置从网络接收数据时, 其数据接收过程 如下: 所述通信装置通过第二接口获得数据; 然后将所接收的数据发送 到编解码模块对数据进行解码处理, 期间还可包括解密处理; 然后将解 码后的数据通过指定的第二模通信模块和第一接口发送给自身所属通 信设备上的应用程序。
虽然各通信设备随机分布在网上, 互相不知道彼此的信息, 无法直 接建立 P2P连接, 然而, 通过上述通信装置, 通信设备之间可以首先通 过服务器获知彼此的信息, 然后就可以直接建立 P2P连接了。
显然, 本领域的技术人员可以对本发明进行各种改动和变型而不脱 离本发明的精神和范围。 这样, 倘若对本发明的这些修改和变型属于本 发明权利要求及其等同技术的范围之内, 则本发明也意图包含这些改动 和变型在内。

Claims

权利要求书
1、 一种在通信设备间实现通信的方法, 其特征在于, 包括: 第一通信设备通过服务器向第二通信设备发送建立对等 P2P连接的 请求消息;
第一通信设备或第二通信设备发起与对方建立 P2P连接的命令; 根据所述建立 P2P 连接的命令在第一和第二通信设备间直接建立 P2P通道并通过该 P2P通道传送数据包。
2、根据权利要求 1所述的方法, 其特征在于, 若所述第一通信设备 处于私网, 则在所述建立 P2P连接的请求消息中进一步携带自身私网地 址信息。
3、根据权利要求 1所述的方法, 其特征在于, 所述第一通信设备或 第二通信设备发起与对方建立 P2P连接的命令包括:
若所述第一通信设备在发送所述请求消息后, 收到来自第二通信设 备的建立 P2P连接的请求消息,则主动发起与第二通信设备建立 P2P连 接的命令。
4、根据权利要求 1所述的方法, 其特征在于, 所述第一通信设备或 第二通信设备发起与对方建立 P2P连接的命令包括:
所述第二通信设备在接收到来自第一通信设备的请求消息后, 判断 自身是否处于私网, 如果处于私网, 则通过服务器向第一通信设备发送 建立 P2P连接的请求消息; 如果不处于私网, 则主动发起与第一通信设 备建立 P2P通道的命令。
5、根据权利要求 4所述的方法, 其特征在于, 若所述第二通信设备 处于私网, 则在所述建立 P2P连接的请求消息中进一步携带自身私网地 址信息。
6、 根据权利要求 2、 4或 5所述的方法, 其特征在于, 通信设备判 断自身是否处于私网的方法包括:
所述通信设备向服务器发送报文;
服务器从该报文中提取通信设备的地址信息并将其返回给对应的通 信设备;
所述通信设备判断所接收的地址信息是否与自身的地址信息一致, 如果不一致, 则判定自身处于私网。
7、根据权利要求 1所述的方法, 其特征在于, 若所述第一通信设备 和第二通信设备处于同一私网内,则直接在该私网内建立所述 P2P通道。
8、 根据权利要求 1所述的方法, 其特征在于, 在建立 P2P通道后, 所述 P2P通道的两端通信设备分别向对方通信设备发送测试数据包, 以 确定是否已成功建立 P2P通道。
9、根据权利要求 1或 8所述的方法, 其特征在于, 所述的数据包为 用户数据报协议 UDP数据包。
10、 根据权利要求 1所述的方法, 其特征在于, 在所述第一通信设 备和第二通信设备通过该 P2P通道传送数据包的过程中, 数据包的接收 方从数据包中提取数据包序号并与收到的数据包序号比较以确定是否 出现丟包, 并在出现丢包时请求数据包的发送方重发。
11、根据权利要求 10所述的方法, 其特征在于, 请求数据包的发送 方重发的方法为: 所述数据包的接收方在向所述数据包的发送方发送的 数据包中携带重发消息和需要重发的数据包信息。
12、根据权利要求 11所述的方法, 其特征在于, 所述携带重发消息 和需要重发的数据包信息为: 通过在数据包的包头中增加一个以上字 节, 用于标识丢失的数据包中序列号最小的数据包之后一个以上数据包 的状态和丟失的数据包中序列号最大的数据包之前一个以上数据包的 状态, 接收该数据的通信设备根据所述状态确定需要重发的数据包。
13、 一种通信装置, 该通信装置被配置于网络上的通信设备中, 其 特征在于, 包括:
第一接口, 用于接收自身所属通信设备上应用程序发送的第一数据 包, 或将网络侧的数据包发送给自身所属通信设备上的应用程序; 编解码模块, 对通过第一接口发向网络侧的数据进行编码, 或对发 向第一接口的数据进行解码;
第二接口, 用于将编码后的数据发送到网络和将从网络接收的数据 发送到编解码模块;
连接在所述第一接口和编解码模块之间的第一通信模块, 用于控制 自身所属通信设备与网络中的服务器的通信信息和通信方式;
连接在所述第一接口和编解码模块之间的第二通信模块, 用于控制 通过对等 P2P连接的其他通信设备的通信信息和通信方式。
14、根据权利要求 13所述的方法, 其特征在于, 所述第二通信模块 为多个。
15、根据权利要求 13所述的方法, 其特征在于, 所述编解码模块进 一步用于对编号后的数据进行加密操作, 或对来自笫二接口的数据进行 解码之前, 进行解密操作。
PCT/CN2006/001364 2005-06-17 2006-06-16 Communication method between communication devices and communication apparatus WO2006133651A1 (en)

Priority Applications (5)

Application Number Priority Date Filing Date Title
PL06742183T PL1892887T3 (pl) 2005-06-17 2006-06-16 Sposób komunikacji między urządzeniami komunikacyjnymi oraz przyrząd komunikacyjny
EP06742183.4A EP1892887B1 (en) 2005-06-17 2006-06-16 Communication method between communication devices and communication apparatus
ES06742183.4T ES2526546T3 (es) 2005-06-17 2006-06-16 Método de comunicación entre dispositivos de comunicación y aparato de comunicación
CA2611776A CA2611776C (en) 2005-06-17 2006-06-16 Method and communication unit for communicating between communication apparatuses
US11/954,931 US7913293B2 (en) 2005-06-17 2007-12-12 Method and communication unit for communicating between communication apparatuses

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200510076855.3 2005-06-17
CN2005100768553A CN1881916B (zh) 2005-06-17 2005-06-17 一种在通信设备间实现通信的方法及装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US11/954,931 Continuation US7913293B2 (en) 2005-06-17 2007-12-12 Method and communication unit for communicating between communication apparatuses

Publications (1)

Publication Number Publication Date
WO2006133651A1 true WO2006133651A1 (en) 2006-12-21

Family

ID=37519902

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2006/001364 WO2006133651A1 (en) 2005-06-17 2006-06-16 Communication method between communication devices and communication apparatus

Country Status (7)

Country Link
US (1) US7913293B2 (zh)
EP (1) EP1892887B1 (zh)
CN (1) CN1881916B (zh)
CA (1) CA2611776C (zh)
ES (1) ES2526546T3 (zh)
PL (1) PL1892887T3 (zh)
WO (1) WO2006133651A1 (zh)

Families Citing this family (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101207579B (zh) * 2007-08-15 2010-08-18 杨汉民 实现网络短信服务的服务器及其客户机间通讯方法
US8650301B2 (en) 2008-10-02 2014-02-11 Ray-V Technologies, Ltd. Adaptive data rate streaming in a peer-to-peer network delivering video content
CN101483764B (zh) * 2009-01-19 2013-12-11 北京中星微电子有限公司 网络视频监控系统中监控双方媒体流发送方法
CN103716850B (zh) * 2012-09-29 2018-10-26 中兴通讯股份有限公司 通信路径的切换方法、系统及装置
CN104038512A (zh) * 2013-03-04 2014-09-10 华为技术有限公司 数据传输方法和装置
CN104065692B (zh) * 2013-04-02 2015-08-12 腾讯科技(深圳)有限公司 网页游戏交互的方法、设备和系统
US9550119B2 (en) 2013-04-02 2017-01-24 Tencent Technology (Shenzhen) Company Limited Method, apparatus, and system for webgame interaction
CN103368827B (zh) * 2013-07-01 2016-04-06 中国农业大学 基于vc++的局域网即时通讯系统和方法
CN103746974B (zh) * 2013-12-27 2017-04-12 柳州职业技术学院 一种基于即时通信软件的安全通信系统及其方法
US9971624B2 (en) 2015-05-17 2018-05-15 Nicira, Inc. Logical processing for containers
CN106465443B (zh) * 2015-05-18 2020-01-17 华为技术有限公司 D2d通信中的ip地址分配方法及用户设备
CN106341738B (zh) * 2015-07-08 2021-02-02 杭州海康威视数字技术股份有限公司 流媒体网络传输的带宽计算方法、服务器端和系统
US10078526B2 (en) * 2015-11-01 2018-09-18 Nicira, Inc. Securing a managed forwarding element that operates within a data compute node
CN105471983B (zh) * 2015-11-19 2019-05-28 广州云智易物联网有限公司 一种建立物联通讯的方法及系统
US10063469B2 (en) 2015-12-16 2018-08-28 Nicira, Inc. Forwarding element implementation for containers
CN107196843B (zh) * 2016-03-15 2021-05-18 百度在线网络技术(北京)有限公司 一种即时通信的方法和装置
CN105847275A (zh) * 2016-04-29 2016-08-10 掌赢信息科技(上海)有限公司 一种数据传输通道建立方法、系统和服务器
CN110740087B (zh) * 2019-09-18 2021-01-08 视联动力信息技术股份有限公司 报文传输方法、终端、网关设备、电子设备及存储介质
CN111614546A (zh) * 2020-04-30 2020-09-01 南京南瑞信息通信科技有限公司 用于oa系统的实时信息交互方法、装置及存储介质
CN112202885A (zh) * 2020-09-30 2021-01-08 富盛科技股份有限公司 一种支持高效补包的电影数字拷贝卫星分发系统及方法
CN113625795A (zh) * 2021-10-12 2021-11-09 南京诺丹工程技术有限公司 环境压力监控平台与方法

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1527623A (zh) * 2003-03-07 2004-09-08 �ʼҷ����ֵ��ӹɷ����޹�˾ 无线通信网络中点到点对等通信无线链接建立和保持的方法与装置
CN1527621A (zh) * 2003-03-07 2004-09-08 皇家飞利浦电子股份有限公司 无线通信网络中建立点到点对等通信的方法和装置
CN1549613A (zh) * 2003-05-19 2004-11-24 皇家飞利浦电子股份有限公司 在无线通信系统的p2p通信模式与传统通信模式之间软切换的方法和装置

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6094676A (en) * 1997-05-30 2000-07-25 Hilgraeve Incorporated Method and apparatus for peer-to-peer communication
KR20010035779A (ko) * 1999-10-02 2001-05-07 윤종용 사용자 데이터그램 통신 규약 상에서 패킷 로스를 보상하는 방법

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1527623A (zh) * 2003-03-07 2004-09-08 �ʼҷ����ֵ��ӹɷ����޹�˾ 无线通信网络中点到点对等通信无线链接建立和保持的方法与装置
CN1527621A (zh) * 2003-03-07 2004-09-08 皇家飞利浦电子股份有限公司 无线通信网络中建立点到点对等通信的方法和装置
CN1549613A (zh) * 2003-05-19 2004-11-24 皇家飞利浦电子股份有限公司 在无线通信系统的p2p通信模式与传统通信模式之间软切换的方法和装置

Also Published As

Publication number Publication date
US20080175383A1 (en) 2008-07-24
CA2611776A1 (en) 2006-12-21
CN1881916A (zh) 2006-12-20
ES2526546T3 (es) 2015-01-13
CA2611776C (en) 2013-03-19
CN1881916B (zh) 2012-07-04
EP1892887A4 (en) 2013-02-06
EP1892887A1 (en) 2008-02-27
PL1892887T3 (pl) 2015-05-29
EP1892887B1 (en) 2014-12-10
US7913293B2 (en) 2011-03-22

Similar Documents

Publication Publication Date Title
WO2006133651A1 (en) Communication method between communication devices and communication apparatus
US9590821B2 (en) Communication system for transmitting data under a tunnel protocol between at least two data computers via a wide area network and a method for running such a communication system
JP4164365B2 (ja) デュアル・プロキシ装置を設けることによる無線インタフェースを介するtcp性能の改良技術
US7478160B2 (en) Method and apparatus for transparent negotiations
US7734791B2 (en) Asynchronous hypertext messaging
KR101150110B1 (ko) 인스턴트 메시징을 위한 트랜스포트 시스템
US7502860B1 (en) Method and apparatus for client-side flow control in a transport protocol
US20030217149A1 (en) Method and apparatus for tunneling TCP/IP over HTTP and HTTPS
US20060029000A1 (en) Connection establishment in a proxy server environment
WO2006034635A1 (fr) Procede permettant d'etablir une connexion p2p
US6879593B1 (en) Connections of nodes on different networks
WO1998047166A2 (en) Data communication protocol
WO2003083692A1 (en) System and method for traversing firewalls with protocol communications
EP1393497A2 (en) Dual mode service platform within network communication system
CN111865940B (zh) 一种传输优化的方法及装置
WO2011015020A1 (zh) 文件传输方法、系统及客户端
CN105227276B (zh) 一种基于udt的对等网络数据传输方法
WO2009011968A1 (en) Endpoint discriminator in network transport protocol startup packets
CN113794752B (zh) 一种基于quic优化mqtt的方法
US11272001B1 (en) Port prediction for peer-to-peer communications
JP5150413B2 (ja) 複数コネクションを用いたデータ通信方法
CN113794715A (zh) 一种虚拟点对点网络数据发送、接收、应答方法及其系统
JP3648211B2 (ja) パケット中継プログラム、パケット中継装置および記録媒体
JP2005011267A (ja) リアルタイムデータ通信システム、リアルタイムデータ通信装置およびリアルタイムデータ通信方法
JP4498017B2 (ja) 無線接続装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application
WWE Wipo information: entry into national phase

Ref document number: 2611776

Country of ref document: CA

Ref document number: 2006742183

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 5749/CHENP/2007

Country of ref document: IN

NENP Non-entry into the national phase

Ref country code: DE

WWW Wipo information: withdrawn in national office

Ref document number: DE

WWP Wipo information: published in national office

Ref document number: 2006742183

Country of ref document: EP