WO2012048576A1 - 控制p2p下载的方法、服务器及系统 - Google Patents

控制p2p下载的方法、服务器及系统 Download PDF

Info

Publication number
WO2012048576A1
WO2012048576A1 PCT/CN2011/075592 CN2011075592W WO2012048576A1 WO 2012048576 A1 WO2012048576 A1 WO 2012048576A1 CN 2011075592 W CN2011075592 W CN 2011075592W WO 2012048576 A1 WO2012048576 A1 WO 2012048576A1
Authority
WO
WIPO (PCT)
Prior art keywords
connection
connections
information
server
forwarding table
Prior art date
Application number
PCT/CN2011/075592
Other languages
English (en)
French (fr)
Inventor
许煜芝
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2012048576A1 publication Critical patent/WO2012048576A1/zh

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
    • H04L67/1074Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
    • H04L67/1078Resource delivery mechanisms
    • H04L67/1085Resource delivery mechanisms involving dynamic management of active down- or uploading connections
    • 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
    • H04L67/1087Peer-to-peer [P2P] networks using cross-functional networking aspects
    • H04L67/1091Interfacing with client-server systems or between P2P systems

Definitions

  • the present invention relates to network technologies, and in particular, to a method, a server, and a system for controlling peer-to-peer (P2P, Peer to Peer) downloading.
  • P2P peer-to-peer
  • P2P download services have been used on a large scale in actual networks.
  • a P2P download is a local user's computer that can connect directly to other users' computers for file exchange without having to connect to the server to browse and download files in the traditional way.
  • An important feature of P2P is to change the existing Internet-centric status of the Internet, but to return to the "decentralized" mode, eliminating the intermediary and returning the file download rights to the user. Therefore, P2P makes network communication easier, and file sharing and interaction are more straightforward.
  • P2P brings convenience to users and brings problems: Since P2P downloads are constantly creating connections with other users, once the number of connections is not controlled, the number of connections established will exceed the maximum number of connections allowed by the device. This affects other normal services of the network.
  • a method for controlling a P2P application protocol port number the method needs to know the port number information of the P2P protocol to limit a specific port number. Since the P2P port will constantly change, this method is not flexible enough to control the number of P2P download connections.
  • a method for controlling the feature of the P2P the method needs to parse the application layer protocol of the text, thereby determining whether the packet is a P2P message. Because the application layer needs to be parsed for the packet, the method is expensive and requires a lot of resources and costs. Summary of the invention
  • the main object of the present invention is to provide a method, a server and a system for controlling P2P download, which are intended to control P2P download and improve network performance.
  • the invention provides a method for controlling P2P downloading, comprising the following steps:
  • the server receives the packet sent by the source terminal, obtains the connection information from the packet, and adjusts and controls the P2P download connection according to the connection information, the connection forwarding table, and the connection control table, and controls the P2P download.
  • connection information includes quintuple information, where the quintuple information includes: a source IP address and a source port where the source terminal is located, a destination IP address and a destination port where the destination terminal is located, and between the source terminal and the destination terminal. Type of agreement.
  • connection forwarding table uses the quintuple information as an index to record a source IP address, a source port, and a connection usage identifier after the packet is translated; the connection control table uses the source IP address and the source port as Index, records all port connections based on the source IP address and source port.
  • the step of adjusting and controlling the number of P2P download connections according to the connection information, the connection forwarding table, and the connection control table, and the step of controlling the P2P downloading includes:
  • connection forwarding table If the quintuple information in the connection information does not exist in the connection forwarding table, if the current connection number is smaller than the number of alarm connections, or the current number of connections is not less than the number of alarm connections, and the corresponding control connection is obtained by using the timing query function. If the number of port connections in the table is less than the maximum number of port connections, a new connection is created.
  • the method further includes: if the quintuple information in the connection information exists in the connection forwarding table, updating a corresponding connection in the connection forwarding table Use the value of the identity.
  • the timing query function comprises:
  • connection forwarding table Regularly query the connection forwarding table to obtain connection information
  • connection use identifier in the connection information is a usage status
  • the value of the connection use identifier is cleared; otherwise, the corresponding connection is deleted, and the current connection number, the corresponding five-element in the connection forwarding table is updated.
  • the method further includes:
  • connection creation process If the current number of connections is less than the maximum number of connections, create a new connection and join the newly created connection to the connection forwarding table; otherwise, end the connection creation process.
  • the invention also proposes a server for controlling P2P downloading, comprising:
  • connection information obtaining module configured to receive a packet sent by the source terminal, and obtain connection information from the packet
  • the P2P download control module is configured to adjust and control the number of P2P download connections according to the connection information, the connection forwarding table, and the connection control table, and control the P2P download.
  • connection information includes quintuple information, where the quintuple information includes: a source IP address and a source port where the source terminal is located, a destination IP address and a destination port where the destination terminal is located, and between the source terminal and the destination terminal. Type of agreement.
  • the P2P download control module includes:
  • a searching unit configured to search, according to the connection information, the connection forwarding table
  • connection creation unit configured to: when the quintuple information in the connection information does not exist in the connection forwarding table, if the current connection number is less than the number of alarm connections, or the current connection number is not less than an alarm The number of connections is combined with the timed query function to obtain the number of port connections in the corresponding control connection table is less than the maximum number of port connections, and a new connection is created;
  • an update unit configured to update a corresponding quintuple information in the connection forwarding table, a value of the connection usage identifier, and update the current connection number and the corresponding port connection number in the connection control table.
  • the updating unit is further configured to: when the quintuple information in the connection information exists in the connection forwarding table, update a value of a corresponding connection usage identifier in the connection forwarding table.
  • connection creation unit includes:
  • the query subunit is configured to periodically query the connection forwarding table to obtain connection information
  • a adjusting subunit configured to: when the value of the connection use identifier in the connection information is a usage status, clear the value of the connection use identifier; otherwise, delete the corresponding connection, and update the current connection number, and the connection is transferred Corresponding quintuple information in the publication and the corresponding port connection number in the connection control table;
  • the determining subunit is configured to determine whether the current connection number is less than the number of secure connections, and if so, end the timing query function; otherwise, the query subunit queries the connection forwarding table to obtain the connection information.
  • connection creation unit is further configured to: when the current connection number is not less than the difference between the maximum connection number and the reserved connection number, and the current connection is initiated by the server, if the current connection number is less than the maximum connection total, a new connection is created, Add the newly created connection to the connection forwarding table; otherwise, end the connection creation process.
  • the present invention further provides a system for controlling P2P downloading, comprising: a server, a source terminal and a destination terminal respectively connected to the server, wherein:
  • the source terminal is configured to send a packet to the server, and establish a connection with the destination terminal by using the server.
  • the server forwards the packet to the destination terminal.
  • the server is configured to receive a packet sent by the source terminal, obtain connection information from the packet, and adjust and control the P2P download according to the connection information, the connection forwarding table, and the connection control table. Number of connections, controlling P2P downloads;
  • the destination terminal is configured to receive the packet forwarded by the server.
  • the server is a server as described above.
  • the method, the server and the system for controlling P2P downloading proposed by the invention can dynamically and arbitrarily adjust the number of port connections in the P2P downloading process and the method of controlling the total number of P2P downloading connections by aging the inactive or non-use connection as soon as possible, thereby being able to control simply and effectively
  • the P2P download connection enables the use of more connection download resources in the case of a small number of connections, and does not affect the use of other network services in the case of a large number of connections, thereby effectively solving the P2P download in the prior art.
  • the number of connections is uncontrolled, affecting network performance.
  • FIG. 1 is a schematic flow chart of an embodiment of a method for controlling P2P downloading according to the present invention
  • connection information is a schematic flow chart of an embodiment of controlling a P2P download according to the connection information, the connection forwarding, and the connection control table according to the connection information, the connection forwarding, and the connection control table according to the embodiment of the present invention
  • FIG. 3 is a schematic flowchart of querying the number of port connections in the connection table by using a timing query function in an embodiment of the method for controlling P2P downloading according to the present invention
  • connection information is a schematic flow chart of another embodiment of controlling the P2P download according to the connection information, the connection forwarding, and the connection control table according to the connection information, the connection forwarding, and the connection control table according to the embodiment of the present invention
  • FIG. 5 is a schematic structural diagram of an embodiment of a server for controlling P2P download according to the present invention.
  • FIG. 6 is a schematic structural diagram of a P2P download control module in an embodiment of a server for controlling P2P downloading according to the present invention
  • Figure ⁇ is a schematic structural diagram of a connection creation unit in an embodiment of a server for controlling P2P download according to the present invention
  • FIG. 8 is a schematic structural diagram of an embodiment of a system for controlling P2P download according to the present invention. detailed description
  • the solution of the embodiment of the present invention is to dynamically adjust the number of port connections in the P2P download process and control the total number of P2P download connections by aging the inactive or non-use connection as soon as possible, so as to effectively control the P2P download connection, so that the number of connections is small. In this case, more connection download resources can be used, and when the number of connections is large, the use of other network services is not affected, and network performance is improved.
  • an embodiment of the present invention provides a method for controlling P2P downloading, including: Step S101: A server receives a packet sent by a source terminal, and obtains connection information from a packet; The source terminal can be directly connected to the computer of another user through the P2P download mode, that is, the destination terminal in the embodiment is used for file exchange. In the P2P download process, the source terminal establishes a P2P download connection through the server and the destination terminal. The server sends the packet to the destination terminal. Similarly, the server can receive the packet sent by the destination terminal through the server.
  • the packet sent by the source terminal includes the connection information, so as to inform the server which destination terminal the source terminal wants to establish a connection with.
  • the server obtains the connection information after receiving the packet sent by the source terminal, and the connection information is specific.
  • the above five types of information are collectively referred to as quintuple information.
  • the server may be a router or the like.
  • Step S102 adjusting and controlling the number of P2P download connections according to the connection information, the connection forwarding table, and the connection control table, and controlling the P2P download.
  • connection conversion table and the connection control table are set, and the connection control information involved includes: the maximum number of connections, the current number of connections, the number of reserved connections, the number of alarm connections, and the number of port connections. , the maximum number of port connections and the number of secure connections. among them:
  • the connection forwarding table uses the quintuple information (source IP address, source port, destination IP address, destination port, and protocol type) as an index to record the source IP address after the packet is translated, the source port after the conversion, and the connection identifier.
  • the value of the connection use identifier it can be determined whether the corresponding P2P download connection is used. For example, the value of the connection use identifier can be set to 1 or 0. When the value of the connection use identifier is 1, it indicates that the connection use identifier is used. , is 0, indicating that the connection usage identifier is not in use.
  • the connection control table records the source IP address and source port as the index, and records the number of connections with the same source IP address and source port, that is, the number of port connections.
  • the current number of connections used to record the number of connections currently created by the system where the server is located.
  • the number of reserved connections is used to reserve the connection to the system where the server is located to prevent the P2P download from occupying the connection and affect the system's own services.
  • Number of alarm connections When the number of connections created in the system where the server is located reaches the number of alarm connections, it indicates that the system is close to the maximum number of connections. You need to control the number of P2P download connections.
  • the maximum number of port connections After the number of current connections exceeds the number of alarm connections, the maximum number of the same source IP and source port connections in each connection control table is limited so that P2P does not affect services.
  • the number of secure connections If the current number of connections in the system is less than the number of connections, it indicates that the system has sufficient resources to use. In this case, the P2P connection cannot be controlled.
  • connection forwarding table, the connection control table, the current connection number, and the number of port connections are dynamically generated by the system during the running process; the connection forwarding table and the connection control table are generated and stored in the server's memory; the maximum number of connections is determined by the system.
  • the number of reserved connections, the number of alarm connections, the maximum number of port connections, and the number of secure connections can be set according to the system operating environment. Generally, the number of secure connections is smaller than the number of alarm connections. The number of alarm connections is less than the maximum number of connections and the number of reserved connections. Difference.
  • the server when the server forwards the packet, the server obtains the connection information from the packet. Find the corresponding connection forwarding table according to the quintuple information in the connection information. Only when the corresponding connection forwarding table is found can the normal forwarding be performed. If the corresponding connection forwarding table is found, the source terminal and destination corresponding to the quintuple information are indicated. If the connection between the terminals has been created, you do not need to create a new connection. If you do not find the corresponding connection forwarding table, you need to create a new connection for the corresponding source terminal and destination terminal. The server will adjust and control the number of P2P download connections according to the connection information, the connection forwarding table, and the connection control table to control the P2P download.
  • step S102 includes:
  • Step S1021 Find a connection forwarding table according to the connection information.
  • Step S1022 determining whether there is quintuple information in the connection information in the connection forwarding table, and if yes, proceeding to step S1029; if not, proceeding to step S1023;
  • Step S1023 determining whether the current connection number is less than the number of alarm connections, if yes, proceeding to step S1027; if not, proceeding to step S1024;
  • Step S1024 determining whether the timing inquiry function is enabled, if yes, proceeding to step S1025; otherwise, proceeding to step S1026;
  • Step S1025 determining whether the number of port connections in the corresponding control connection table is less than the maximum number of port connections, and if yes, proceeding to step S1027, otherwise, proceeding to step S1030;
  • Step S1026 the timing query function is started, and the number of port connections in the connection table is controlled by the timed query function, and the process proceeds to step S1025.
  • Step S1027 creating a new connection
  • Step S1028 Update the corresponding quintuple information in the connection forwarding table, update the current connection number, and the corresponding port connection number in the connection control table.
  • Step S1029 Update a value of a corresponding connection use identifier in the connection forwarding table.
  • Step S1030 ending the creation of the connection process.
  • the step of controlling the number of port connections in the connection table by using the timed query function in step S1026 includes: Step S10261, periodically querying the connection forwarding table to obtain connection information.
  • Step S10262 determining whether the value of the connection use identifier in the connection information is the use status, and if yes, proceeding to step S10263; otherwise, proceeding to step S10264;
  • Step S10263 clearing the value of the connection use identifier, and proceeding to step S10265;
  • connection usage identifier is updated when the next packet is forwarded. If no packet is forwarded, the value of the connection usage identifier is always zero, indicating that the connection is not used.
  • Step S10264 deleting the corresponding connection, and updating the current connection number, the corresponding quintuple information in the connection forwarding table, and the corresponding port connection number in the connection control table;
  • Step S10265 determining whether the current connection number is less than the number of secure connections, and if yes, proceeding to step S10266; otherwise, returning to step S10261;
  • Step S10266 ending the timing query function; indicating that the system has sufficient resources at this time, and does not need to control the connection.
  • the server periodically enables the query function, which is to determine whether the connection is used by continuously querying the usage status of each connection usage identifier.
  • P2P downloads are characterized by constantly creating connections to get more resources, but not all connections are in use, some connections are no longer used, but they are not deleted immediately, resulting in a large amount of system connection resources.
  • the server searches for the corresponding connection when forwarding the message. If found, the corresponding connection is updated with the value of the identifier.
  • the connection timing is used to determine whether each connection is in use. If the connection is not in use, it will be deleted immediately to delete unused connections as soon as possible; otherwise, the current usage ID of each connection will be queried periodically.
  • the system when the current number of connections of the system is less than the number of secure connections, the system will turn off the timing query function and do not control the P2P connection.
  • step S102 of the foregoing embodiment of the present invention may further include: Step S1021: Find a connection forwarding table according to the connection information.
  • Step S1022 determining whether there is quintuple information in the connection information in the connection forwarding table, and if yes, proceeding to step S1029; if not, proceeding to step S10221;
  • Step S10221 determining whether the current connection number is less than the difference between the maximum number of connections and the number of reserved connections, and if yes, proceeding to step S1023; otherwise, proceeding to step S10222;
  • Step S10222 determining whether the current connection is initiated by the server, and if yes, proceeding to step S10223; otherwise, proceeding to step S1030;
  • Step S10223 determining whether the current connection number is less than the maximum number of connections, if yes, proceeding to step S1027; otherwise, proceeding to step S1030;
  • Step S1023 determining whether the current connection number is less than the number of alarm connections, and if yes, proceeding to the step
  • step S1027 If no, proceed to step S1024;
  • Step S1024 determining whether the timing inquiry function is enabled, if yes, proceeding to step S1025; otherwise, proceeding to step S1026;
  • Step S1025 determining whether the number of port connections in the corresponding control connection table is less than the maximum number of port connections, and if yes, proceeding to step S1027, otherwise proceeding to step S1030;
  • Step S1026 the timing query function is started, and the number of port connections in the corresponding control connection table is obtained by combining the timing query function, and the process proceeds to step S1025.
  • Step S1027 creating a new connection
  • Step S1028 Update the corresponding quintuple information in the connection forwarding table, update the current connection number, and the corresponding port connection number in the connection control table.
  • Step S1029 Update a value of a corresponding connection use identifier in the connection forwarding table.
  • Step S1030 ending the creation of the connection process. Indicates that system resources are all occupied.
  • the current connection number is less than the difference between the maximum number of connections and the number of reserved connections. If the system is connected to the system, the number of the current connection is close to or exceeds the number of alarm connections. In this case, in order to make the system run normally, only the connection initiated by the system service is allowed to be established, and it is determined whether the connection is initiated by the system server. Because the connection initiated by the system belongs to a high priority, you need to ensure that the connection initiated by the system is normal. If it is not initiated by the system server, the connection is refused. If it is initiated by the system server, the current connection number is less than the maximum number of connections. If not, the connection initiated by the system server cannot be created; if it is, a new connection can be created for the system service.
  • step S1028 it is determined whether the number of port connections in the corresponding control connection table is less than the maximum number of port connections, considering that the current number of P2P download connections is already large, and the number of alarm connections is greater than or equal to the number of alarm connections.
  • the P2P download connection is controlled to determine whether to create a new connection according to the current number of corresponding port connections.
  • the method for controlling P2P download used in this embodiment can not only control the P2P download connection simply and effectively, but also can satisfy the P2P download requirement as much as possible, and the system connection reaches a certain number.
  • the P2P download service is effectively affected by controlling the P2P download connection, deleting the non-use connection, and retaining the reserved connection to avoid affecting other network services and system-initiated services.
  • an embodiment of the present invention provides a server for controlling P2P downloading, including: a connection information obtaining module 501 and a P2P download control module 502, where:
  • the connection information obtaining module 501 is configured to receive a packet sent by the source terminal, and obtain connection information from the packet.
  • the local user's computer that is, the source terminal in the embodiment
  • the destination terminal establishes a P2P download connection, and sends the packet to the destination terminal through the server.
  • the server can receive the packet sent by the destination terminal through the server.
  • the packet sent by the source terminal includes the connection information to inform the server which destination terminal the source terminal wants to establish a connection with.
  • the connection information obtaining module 501 in the server obtains the connection from the packet after receiving the packet sent by the source terminal.
  • the information includes: a source IP address and a source port where the source terminal is located, a destination IP address and a destination port where the destination terminal is located, and a protocol type between the source terminal and the destination terminal.
  • the above five types of information are collectively referred to as five yuan. Group information.
  • the P2P download control module 502 is configured to adjust and control the number of P2P download connections according to the connection information, the connection forwarding table, and the connection control table, and control the P2P download.
  • the server when the server forwards the packet, the server obtains the connection information from the packet, searches for the corresponding connection forwarding table according to the quintuple information in the connection information, and only finds the corresponding connection forwarding table to perform normal forwarding. If the corresponding connection forwarding table is found, it indicates that the connection between the source terminal and the destination terminal corresponding to the quintuple information has been created, and no new connection needs to be created; if the corresponding connection forwarding table is not found, This indicates that a new connection needs to be created for the corresponding source terminal and destination terminal.
  • the server controls and controls the number of P2P download connections according to the connection information, the connection forwarding table, and the connection control table through the P2P download control module 502, thereby implementing P2P download control.
  • the P2P download control module 502 includes: a search unit 5021, a connection creation unit 5022, and an update unit 5023, where:
  • the searching unit 5021 is configured to search for a connection forwarding table according to the connection information.
  • the connection creation unit 5022 is configured to: when the quintuple information in the connection information does not exist in the connection forwarding table, if the current connection number is smaller than the number of alarm connections, or the current connection number is not less than the number of alarm connections, and the time synchronization query function is used to obtain the corresponding The number of port connections in the control connection table is less than the maximum number of port connections, and a new connection is created;
  • the updating unit 5023 is configured to update the corresponding quintuple information in the connection forwarding table, the value of the connection usage identifier, and update the current connection number and the corresponding port connection number in the connection control table.
  • the updating unit 5023 is further configured to: when there are five connection information in the connection forwarding table When the tuple information is updated, the value of the corresponding connection usage identifier in the connection forwarding table is updated.
  • connection creation unit 5022 includes: a query subunit 50221, an adjustment subunit 50222, and a judgment subunit 50223, where:
  • the query subunit 50221 is configured to periodically query the connection forwarding table to obtain connection information.
  • the adjusting subunit 50222 is configured to: when the value of the connection usage identifier in the connection information is a usage state, clear the value of the connection usage identifier; otherwise, delete the corresponding connection, and update the current connection number, the connection forwarding table. Corresponding quintuple information and corresponding port connection number in the connection control table;
  • the determining subunit 50223 is configured to determine whether the current connection number is less than the number of secure connections, and if yes, end the timing query function; otherwise, the query subunit queries the connection forwarding table to obtain the connection information.
  • connection creation unit 5022 is further configured to use the difference between the total number of connections and the number of reserved connections, and when the current connection is initiated by the server, if the current connection number is less than the maximum number of connections, create a new P2P download connection. , and join the newly created connection to the connection forwarding table; otherwise, end the creation of the connection process.
  • an embodiment of the present invention provides a system for controlling P2P downloading, including: a server 802, a source terminal 801 and a destination terminal 803 respectively connected to the server 802, where: the source terminal 801 is configured to the server 802. Sending a message, the server 802 establishes a connection with the destination terminal 803, when the connection is successfully established, the server 802 forwards the message to the destination terminal 803;
  • the server 802 is configured to receive the packet sent by the source terminal 801, obtain connection information from the packet, and adjust and control the P2P download connection according to the connection information, the connection forwarding table, and the connection control table, and control the P2P download;
  • the destination terminal 803 is configured to receive the packet forwarded by the server 802.
  • the server 802 in this embodiment may be the server described in the above embodiment.
  • the server 802 in this embodiment may be a router or the like.
  • a method, a server, and a system for controlling P2P downloading according to an embodiment of the present invention can dynamically adjust the number of port connections in the P2P download process and the method of controlling the total number of P2P download connections by aging an inactive or non-use connection as soon as possible, which is simple and effective. Control the P2P download connection so that it can use more connection download resources in the case of a small number of connections, and does not affect the use of other network services in the case of a large number of connections, thereby effectively solving the prior art in
  • the number of P2P download connections is not controlled, which affects the performance of the network.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明公开了一种控制对等网络P2P下载的方法,包括:服务器接收源终端发送的报文,从所述报文中获取连接信息;根据所述连接信息、连接转发表以及连接控制表调整与控制P2P下载连接数,对P2P下载进行控制。本发明公开了一种控制P2P下载的服务器,以及,使用该服务器的控制P2P下载的系统。本发明能够简单有效地控制P2P下载连接,使之在连接数量较小的情况下,能够使用更多的连接下载资源,在连接数量较多的情况下不影响其他网络业务的使用,从而有效解决了现有技术中P2P下载连接数不受控制,影响网络使用性能的问题。

Description

控制 P2P下载的方法、 服务器及系统 技术领域
本发明涉及网络技术, 尤其涉及一种控制对等网络( P2P, Peer to Peer ) 下载的方法、 服务器及系统。 背景技术
随着网络技术的发展, IP网络已成为人们日常生活中必不可少的工具, P2P下载业务在实际网络中已大规模使用。 P2P下载即是本地用户的计算机 可以直接连接到其他用户的计算机进行文件交换, 而不需釆用传统方式连 接到服务器去浏览并下载文件。 P2P的一个重要特点是改变了互联网现有的 以大网站为中心的状态, 而是重返 "非中心化" 模式, 省去了中间商, 将 文件下载权交还给用户。 因此, P2P使得网络沟通变得更容易, 文件共享与 交互更直接。
但是, P2P给用户带来方便的同时, 也带来了问题: 由于 P2P下载是 不断地去与其它用户创建连接, 一旦连接数不受控制, 建立的连接数会超 过设备最大允许的连接数, 从而影响网络其他正常业务。
目前针对上述问题, 主要有以下几种解决方法:
1、针对 P2P应用协议端口号进行控制的方法, 该方法需要知道 P2P协 议的端口号信息, 以对特定的端口号进行限制。 由于 P2P端口会不断变化, 所以这种方法控制不够灵活, 也不能很好地控制 P2P下载的连接数。
2、 针对 P2P的 ^艮文特征进行控制的方法, 该方法需要对 文的应用层 协议进行解析, 由此判断该报文是否为 P2P报文。 由于需要对报文进行应 用层的解析, 因此该方法开销较大, 需要耗费大量的资源和成本。 发明内容
本发明的主要目的在于提供一种控制 P2P下载的方法、服务器及系统, 旨在实现对 P2P下载进行控制, 提高网络使用性能。
本发明提出一种控制 P2P下载的方法, 包括以下步骤:
服务器接收源终端发送的报文, 从所述报文中获取连接信息; 根据所述连接信息、 连接转发表以及连接控制表调整与控制 P2P下载 连接数, 对 P2P下载进行控制。
优选地, 所述连接信息包括五元组信息, 该五元组信息包括: 源终端 所在的源 IP地址及源端口, 目的终端所在的目的 IP地址及目的端口, 以及 源终端与目的终端之间的协议类型。
优选地, 所述连接转发表以所述五元组信息为索引, 记录报文转换后 的源 IP地址、 源端口以及连接使用标识; 所述连接控制表以所述源 IP地址 及源端口为索引, 记录所有基于该源 IP地址及源端口的端口连接数。
优选地, 所述根据连接信息、 连接转发表以及连接控制表调整与控制 P2P下载连接数, 对 P2P下载进行控制的步骤包括:
根据所述连接信息查找所述连接转发表;
若所述连接转发表中不存在所述连接信息中的五元组信息, 则 若当前连接数小于告警连接数, 或者当前连接数不小于告警连接数且 结合定时查询功能获取到对应的控制连接表中端口连接数小于最大端口连 接数, 则创建新的连接;
更新所述连接转发表中对应的五元组信息、 连接使用标识的值; 以及 更新当前连接数、 连接控制表中对应的端口连接数。
优选地, 所述根据连接信息查找所述连接转发表的步骤之后还包括: 若所述连接转发表中存在所述连接信息中的五元组信息, 则更新所述 连接转发表中对应的连接使用标识的值。 优选地, 所述定时查询功能包括:
定时查询连接转发表获取连接信息;
若所述连接信息中连接使用标识的值为使用状态, 则将所述连接使用 标识的值清零; 否则, 删除对应的连接, 并更新当前连接数、 所述连接转 发表中对应的五元组信息以及所述连接控制表中对应的端口连接数;
判断当前连接数是否小于安全连接数, 若是, 则结束定时查询功能; 否则, 返回查询连接转发表获取连接信息步骤。
优选地, 所述若连接转发表中不存在所述连接信息中的五元组信息的 步骤之后还包括:
若当前连接数不小于最大连接总数与预留连接数之差, 且当前连接由 服务器发起, 则
若当前连接数小于最大连接总数, 则创建新的连接, 并将新创建的连 接加入到连接转发表中; 否则, 结束创建连接流程。
本发明还提出一种控制 P2P下载的服务器, 包括:
连接信息获取模块, 用于接收源终端发送的报文, 从所述报文中获取 连接信息;
P2P下载控制模块,用于根据所述连接信息、连接转发表以及连接控制 表调整与控制 P2P下载连接数, 对 P2P下载进行控制。
优选地, 所述连接信息包括五元组信息, 该五元组信息包括: 源终端 所在的源 IP地址及源端口, 目的终端所在的目的 IP地址及目的端口, 以及 源终端与目的终端之间的协议类型。
优选地, 所述 P2P下载控制模块包括:
查找单元, 用于根据所述连接信息查找所述连接转发表;
连接创建单元, 用于当所述连接转发表中不存在所述连接信息中的五 元组信息时, 若当前连接数小于告警连接数, 或者当前连接数不小于告警 连接数且结合定时查询功能获取到对应的控制连接表中端口连接数小于最 大端口连接数, 则创建新的连接;
更新单元, 用于更新所述连接转发表中对应的五元组信息、 连接使用 标识的值; 以及更新当前连接数、 连接控制表中对应的端口连接数。
优选地, 所述更新单元还用于当所述连接转发表中存在所述连接信息 中的五元组信息时, 更新所述连接转发表中对应的连接使用标识的值。
优选地, 所述连接创建单元包括:
查询子单元, 用于定时查询连接转发表获取连接信息;
调整子单元, 用于当所述连接信息中连接使用标识的值为使用状态时, 将所述连接使用标识的值清零; 否则, 删除对应的连接, 并更新当前连接 数、 所述连接转发表中对应的五元组信息以及所述连接控制表中对应的端 口连接数;
判断子单元, 用于判断当前连接数是否小于安全连接数, 若是, 则结 束定时查询功能; 否则, 由查询子单元查询连接转发表获取连接信息。
优选地, 所述连接创建单元还用于当前连接数不小于最大连接总数与 预留连接数之差, 且当前连接由服务器发起时, 若当前连接数小于最大连 接总数, 则创建新的连接, 并将新创建的连接加入到连接转发表中; 否则, 结束创建连接流程。
本发明还提出一种控制 P2P下载的系统, 包括: 服务器、 分别与所述 服务器连接的源终端和目的终端, 其中:
所述源终端, 用于向所述服务器发送报文, 通过所述服务器建立与目 的终端之间的连接, 当连接建立成功时, 由服务器将所述报文转发至目的 终端;
所述服务器, 用于接收源终端发送的报文, 从所述报文中获取连接信 息; 根据所述连接信息、 连接转发表以及连接控制表调整与控制 P2P下载 连接数, 对 P2P下载进行控制;
所述目的终端, 用于接收所述服务器转发的所述报文。
优选地, 所述服务器为如上所述的服务器。
本发明提出的一种控制 P2P下载的方法、 服务器及系统, 通过尽快老 化非活动即非使用连接, 动态调整 P2P下载过程中的端口连接数以及控制 P2P下载连接总数的方法, 能够简单有效地控制 P2P下载连接, 使之在连 接数量较小的情况下, 能够使用更多的连接下载资源, 在连接数量较多的 情况下不影响其他网络业务的使用, 从而有效解决了现有技术中 P2P下载 连接数不受控制, 影响网络使用性能的问题。 附图说明
图 1是本发明控制 P2P下载的方法一实施例流程示意图;
图 2是本发明控制 P2P下载的方法一实施例中根据连接信息、 连接转 发表以及连接控制表调整与控制 P2P下载连接数, 对 P2P下载进行控制的 一种实施方式流程示意图;
图 3是本发明控制 P2P下载的方法一实施例中通过定时查询功能查询 控制连接表中端口连接数的流程示意图;
图 4是本发明控制 P2P下载的方法一实施例中根据连接信息、 连接转 发表以及连接控制表调整与控制 P2P下载连接数, 对 P2P下载进行控制的 另一种实施方式流程示意图;
图 5是本发明控制 P2P下载的服务器一实施例结构示意图;
图 6是本发明控制 P2P下载的服务器一实施例中 P2P下载控制模块的 结构示意图;
图 Ί是本发明控制 P2P下载的服务器一实施例中连接创建单元的结构 示意图;
图 8是本发明控制 P2P下载的系统一实施例结构示意图。 具体实施方式
本发明实施例解决方案主要是通过尽快老化非活动即非使用连接, 动 态调整 P2P下载过程中的端口连接数以及控制 P2P下载连接总数, 以有效 地控制 P2P下载连接, 使之在连接数量较小的情况下, 能够使用更多的连 接下载资源, 在连接数量较多的情况下不影响其他网络业务的使用, 提高 网络使用性能。
如图 1所示, 本发明一实施例提出一种控制 P2P下载的方法, 包括: 步骤 S101 , 服务器接收源终端发送的报文, 从报文中获取连接信息; 本地用户的计算机即本实施例中所称源终端通过 P2P下载方式, 可以 直接连接到其他用户的计算机即本实施例中所称目的终端进行文件交换, 在 P2P下载过程中, 源终端通过服务器与目的终端建立 P2P下载连接, 通 过服务器将报文发送给目的终端, 同理, 还可以通过服务器接收目的终端 发送的报文。
源终端发送的报文中包含有连接信息, 以告知服务器该源终端欲与哪 个目的终端建立连接, 服务器接收到源终端发送的报文后, 从报文中获取 该连接信息, 该连接信息具体包括: 源终端所在的源 IP地址及源端口, 目 的终端所在的目的 IP地址及目的端口, 以及源终端与目的终端之间的协议 类型, 上述五种信息总称为五元组信息。
本实施例中服务器可以是路由器等。
步骤 S102,根据连接信息、连接转发表以及连接控制表调整与控制 P2P 下载连接数, 对 P2P下载进行控制。
本实施例中服务器在对 P2P下载进行控制时, 设置有连接转换表、 连 接控制表, 涉及的连接控制信息包括: 最大连接总数、 当前连接数、 预留 连接数、 告警连接数、 端口连接数, 最大端口连接数以及安全连接数。 其 中: 连接转发表以五元组信息(源 IP地址、 源端口、 目的 IP地址、 目的端 口以及协议类型)为索引, 记录报文转换后的源 IP地址、 转换后的源端口 以及连接使用标识等信息,其中根据连接使用标识的值可以判断对应的 P2P 下载连接是否被使用, 比如, 可以设置连接使用标识的值为 1或 0, 当连接 使用标识的值为 1时, 表明连接使用标识为使用状态, 为 0, 表明连接使用 标识为未使用状态。
连接控制表以源 IP地址、 源端口为索引,记录所有源 IP地址和源端口 相同的连接的个数即端口连接数。
最大连接总数, 用于记录服务器所在系统支持的最大连接数。
当前连接数, 用于记录服务器所在系统当前创建的连接数。
预留连接数, 用于预留给服务器所在系统发起服务的连接, 防止 P2P 下载占用满连接影响系统自身业务。
告警连接数, 当服务器所在系统中创建的连接数到达该告警连接数后, 表明系统已经接近最大连接总数, 需要对 P2P下载连接数进行控制。
最大端口连接数, 在系统当前连接数超过告警连接数后, 为了使 P2P 不影响业务, 限制每个连接控制表中相同源 IP和源端口连接的最大数。
安全连接数, 系统当前连接数小于该连接数时, 表明此时系统有足够 的资源使用, 此时可以不对 P2P连接进行控制。
上述信息中, 连接转发表、 连接控制表、 当前连接数以及端口连接数 由系统在运行过程中动态生成; 连接转发表与连接控制表生成后存储在服 务器的内存中; 最大连接总数由系统决定; 预留连接数、 告警连接数、 最 大端口连接数和安全连接数可以根据系统运行环境进行设置, 一般来说, 安全连接数小于告警连接数, 告警连接数小于最大连接总数与预留连接数 之差。
在本实施例中, 服务器在进行报文转发时, 从报文中获取到连接信息, 根据连接信息中的五元组信息查找对应的连接转发表, 只有找到对应的连 接转发表才能进行正常转发, 如果查找到对应的连接转发表, 说明与该五 元组信息对应的源终端和目的终端之间的连接已经创建过, 则不需要创建 新的连接; 若查不找到对应的连接转发表, 则表明需要为对应的源终端和 目的终端创建新的连接。 服务器将根据连接信息、 连接转发表以及连接控 制表调整与控制 P2P下载连接数, 实现对 P2P下载进行控制。
如图 2所示, 步骤 S102包括:
步骤 S1021 , 根据连接信息查找连接转发表;
步骤 S1022,判断连接转发表中是否存在连接信息中的五元组信息, 若 是, 则进入步骤 S1029; 若否, 则进入步骤 S1023;
步骤 S1023 , 判断当前连接数是否小于告警连接数, 若是, 则进入步骤 S1027; 若否, 则进入步骤 S1024;
步骤 S1024, 判断是否启用定时查询功能, 若是, 则进入步骤 S1025; 否则, 进入步骤 S1026;
步骤 S1025 ,判断对应的控制连接表中端口连接数是否小于最大端口连 接数, 若是, 则进入步骤 S1027 , 否则, 进入步骤 S1030;
步骤 S1026, 启动定时查询功能,通过定时查询功能查询控制连接表中 端口连接数, 并进入步骤 S1025;
步骤 S1027 , 创建新的连接;
步骤 S1028 , 更新连接转发表中对应的五元组信息以及更新当前连接 数、 连接控制表中对应的端口连接数;
步骤 S1029 , 更新连接转发表中对应的连接使用标识的值;
步骤 S1030, 结束创建连接流程。
如图 3所示, 在本实施例中, 步骤 S1026中通过定时查询功能查询控 制连接表中端口连接数的步骤包括: 步骤 S10261 , 定时查询连接转发表获取连接信息;
步骤 S10262, 判断连接信息中连接使用标识的值是否为使用状态, 若 是, 则进入步骤 S10263; 否则进入步骤 S10264;
步骤 S10263 , 将连接使用标识的值清零, 并进入步骤 S10265;
在下次报文转发时会更新该连接使用标识, 如果没有报文转发, 则该 连接使用标识的值一直为零, 表明该连接未使用。
步骤 S10264, 删除对应的连接, 并更新当前连接数、 连接转发表中对 应的五元组信息以及连接控制表中对应的端口连接数;
步骤 S10265 , 判断当前连接数是否小于安全连接数, 若是, 则进入步 骤 S10266; 否则返回步骤 S10261 ;
步骤 S10266, 结束定时查询功能; 表明系统此时资源充足, 不需要对 连接进行控制。
在本实施例中, 服务器会定时启用查询功能, 该功能是通过不断查询 每条连接使用标识的使用状态来判断该连接是否被使用。 P2P下载的特点是 不断去创建连接以获取更多的资源, 但是并不是所有的连接都在使用, 有 些连接已经不再使用, 但是却没有被立即删除, 导致占用了大量的系统连 接资源。 服务器在转发报文时会查找对应的连接, 若找到, 则将对应的连 接使用标识的值进行更新, 该定时查询功能启用后, 将会通过连接使用标 识定时去判断每一条连接是否在使用, 如果该连接没有在使用, 则会被立 即删除, 以尽快删除未使用的连接; 否则将定时去查询当前每条连接的使 用标识。
在系统允许且不影响 P2P下载业务的情况下, 当系统当前连接数小于 安全连接数时, 系统将会关闭定时查询功能并且对于 P2P连接不进行控制。
如图 4所示, 作为另一种实施方式, 本发明上述实施例步骤 S102进一 步可以包括: 步骤 S1021 , 根据连接信息查找连接转发表;
步骤 S1022,判断连接转发表中是否存在连接信息中的五元组信息, 若 是, 则进入步骤 S1029; 若否, 则进入步骤 S10221 ;
步骤 S10221 , 判断当前连接数是否小于最大连接总数与预留连接数之 差, 若是, 则进入步骤 S1023; 否则, 进入步骤 S10222;
步骤 S10222 , 判断当前连接是否由服务器发起, 若是, 则进入步骤 S 10223; 否则进入步骤 S1030;
步骤 S10223 , 判断当前连接数是否小于最大连接总数, 若是, 则进入 步骤 S1027; 否则进入步骤 S1030;
步骤 S1023 , 判断当前连接数是否小于告警连接数, 若是, 则进入步骤
S1027; 若否, 则进入步骤 S1024;
步骤 S1024, 判断是否启用定时查询功能, 若是, 则进入步骤 S1025; 否则进入步骤 S1026;
步骤 S1025 ,判断对应的控制连接表中端口连接数是否小于最大端口连 接数, 若是, 则进入步骤 S1027 , 否则进入步骤 S1030;
步骤 S1026, 启动定时查询功能, 结合定时查询功能获取到对应的控制 连接表中端口连接数, 并进入步骤 S1025;
步骤 S1027 , 创建新的连接;
步骤 S1028 , 更新连接转发表中对应的五元组信息以及更新当前连接 数、 连接控制表中对应的端口连接数;
步骤 S1029 , 更新连接转发表中对应的连接使用标识的值;
表明该条连接正在使用, 防止删除正在使用的连接。
步骤 S1030, 结束创建连接流程。 表明系统资源已经全部被占用。 在本实施方式中, 当判断出当前连接为新的连接时, 在创建该新的连 接前, 需要判断当前连接数是否小于最大连接总数与预留连接数之差, 若 不小于, 则表明系统连接资源已经很少, 当前连接数已接近或超过告警连 接数, 此时, 为了使系统运行正常, 只允许创建系统服务发起的连接, 判 断该连接是否由系统服务器发起, 因为系统发起的连接属于高优先级, 需 要首先保证系统发起的连接正常, 若不是由系统服务器发起, 则拒绝创建 该连接; 若是由系统服务器发起, 则还要考虑当前连接数是否小于最大连 接总数, 若否, 则系统服务器发起的连接也不能创建; 若是, 则可以为系 统服务创建新的连接。
上述步骤 S1028 中, 判断对应的控制连接表中端口连接数是否小于最 大端口连接数, 是考虑到当前 P2P下载连接数已经很大, 其大于或等于告 警连接数, 为了保证系统正常, 需要对当前 P2P下载连接进行控制, 根据 当前对应的端口连接数的大小决定是否创建新的连接。
与现有技术相比较, 本实施例釆用的控制 P2P下载的方法, 不仅能够 简单有效地控制 P2P下载连接, 而且能够在系统允许的情况下, 尽量满足 P2P下载要求, 在系统连接达到一定数量的情况下, 通过控制 P2P下载的 连接、 删除非使用的连接和保留预留连接, 避免影响其他网络业务和系统 发起的业务, 从而有效地解决了 P2P下载业务带来的影响。
如图 5所示, 本发明一实施例提出一种控制 P2P下载的服务器, 包括: 连接信息获取模块 501以及 P2P下载控制模块 502, 其中:
连接信息获取模块 501 , 用于接收源终端发送的报文,从报文中获取连 接信息;
本地用户的计算机即本实施例中所称源终端通过 P2P下载方式, 可以 直接连接到其他用户的计算机即本实施例中所称目的终端进行文件交换, 在 P2P下载过程中, 源终端通过服务器与目的终端建立 P2P下载连接, 通 过服务器将报文发送给目的终端, 同理, 还可以通过服务器接收目的终端 发送的报文。 源终端发送的报文中包含有连接信息, 以告知服务器该源终端欲与哪 个目的终端建立连接, 服务器中连接信息获取模块 501接收到源终端发送 的报文后, 从报文中获取该连接信息, 该连接信息具体包括: 源终端所在 的源 IP地址及源端口, 目的终端所在的目的 IP地址及目的端口, 以及源终 端与目的终端之间的协议类型, 上述五种信息总称为五元组信息。
P2P下载控制模块 502, 用于根据连接信息、 连接转发表以及连接控制 表调整与控制 P2P下载连接数, 对 P2P下载进行控制。
在本实施例中, 服务器在进行报文转发时, 从报文中获取到连接信息, 根据连接信息中的五元组信息查找对应的连接转发表, 只有找到对应的连 接转发表才能进行正常转发, 如果查找到对应的连接转发表, 说明与该五 元组信息对应的源终端和目的终端之间的连接已经创建过, 则不需要创建 新的连接; 若查不找到对应的连接转发表, 则表明需要为对应的源终端和 目的终端创建新的连接。服务器通过 P2P下载控制模块 502根据连接信息、 连接转发表以及连接控制表调整与控制 P2P下载连接数, 实现对 P2P下载 进行控制。
如图 6所示, P2P下载控制模块 502包括: 查找单元 5021、 连接创建 单元 5022以及更新单元 5023 , 其中:
查找单元 5021 , 用于根据连接信息查找连接转发表;
连接创建单元 5022, 用于当连接转发表中不存在连接信息中的五元组 信息时, 若当前连接数小于告警连接数, 或者当前连接数不小于告警连接 数且结合定时查询功能获取到对应的控制连接表中端口连接数小于最大端 口连接数, 则创建新的连接;
更新单元 5023 , 用于更新连接转发表中对应的五元组信息、 连接使用 标识的值; 以及更新当前连接数、 连接控制表中对应的端口连接数。
进一步的, 更新单元 5023还用于当连接转发表中存在连接信息中的五 元组信息时, 更新连接转发表中对应的连接使用标识的值。
如图 7所示, 连接创建单元 5022包括: 查询子单元 50221、 调整子单 元 50222以及判断子单元 50223 , 其中:
查询子单元 50221 , 用于定时查询连接转发表获取连接信息;
调整子单元 50222, 用于当连接信息中连接使用标识的值为使用状态 时, 将所述连接使用标识的值清零; 否则, 删除对应的连接, 并更新当前 连接数、 所述连接转发表中对应的五元组信息以及所述连接控制表中对应 的端口连接数;
判断子单元 50223 , 用于判断当前连接数是否小于安全连接数, 若是, 则结束定时查询功能; 否则, 由查询子单元查询连接转发表获取连接信息。
进一步地, 连接创建单元 5022还用于当前连接数不小于最大连接总数 与预留连接数之差, 且当前连接由服务器发起时, 若当前连接数小于最大 连接总数, 则创建新的 P2P下载连接, 并将新创建的连接加入到连接转发 表中; 否则, 结束创建连接流程。
如图 8所示, 本发明一实施例提出一种控制 P2P下载的系统, 包括: 服务器 802、 分别与服务器 802连接的源终端 801和目的终端 803 , 其中: 源终端 801 , 用于向服务器 802发送报文, 通过服务器 802建立与目的 终端 803之间的连接, 当连接建立成功时, 由服务器 802将报文转发至目 的终端 803;
服务器 802, 用于接收源终端 801发送的报文,从所述报文中获取连接 信息; 根据连接信息、 连接转发表以及连接控制表调整与控制 P2P下载连 接数, 对 P2P下载进行控制;
目的终端 803 , 用于接收服务器 802转发的报文。
本实施例中服务器 802可以为上述实施例中所述的服务器。
本实施例中服务器 802可以是路由器等。 本发明实施例提出的一种控制 P2P下载的方法、 服务器及系统, 通过 尽快老化非活动即非使用连接, 动态调整 P2P下载过程中的端口连接数以 及控制 P2P下载连接总数的方法, 能够简单有效地控制 P2P下载连接, 使 之在连接数量较小的情况下, 能够使用更多的连接下载资源, 在连接数量 较多的情况下不影响其他网络业务的使用, 从而有效地解决了现有技术中
P2P下载连接数不受控制, 影响网络使用性能的问题。
以上所述仅为本发明的优选实施例, 并非因此限制本发明的专利范围, 凡是利用本发明说明书及附图内容所作的等效结构或流程变换, 或直接或 间接运用在其它相关的技术领域, 均同理包括在本发明的专利保护范围内。

Claims

权利要求书
1、 一种控制对等网络 P2P下载的方法, 其特征在于, 所述方法包括: 服务器接收源终端发送的报文, 从所述报文中获取连接信息; 根据所述连接信息、 连接转发表以及连接控制表调整与控制 P2P下载 连接数, 对 P2P下载进行控制。
2、 根据权利要求 1所述的方法, 其特征在于, 所述连接信息包括五元 组信息, 该五元组信息包括: 源终端所在的源 IP地址及源端口, 目的终端 所在的目的 IP地址及目的端口, 以及源终端与目的终端之间的协议类型。
3、 根据权利要求 2所述的方法, 其特征在于, 所述连接转发表以所述 五元组信息为索引, 记录报文转换后的源 IP地址、 源端口以及连接使用标 识; 所述连接控制表以所述源 IP地址及源端口为索引, 记录所有基于该源 IP地址及源端口的端口连接数。
4、 根据权利要求 3所述的方法, 其特征在于, 所述根据连接信息、 连 接转发表以及连接控制表调整与控制 P2P下载连接数, 对 P2P下载进行控 制, 为:
根据所述连接信息查找所述连接转发表;
所述连接转发表中不存在所述连接信息中的五元组信息时, 并在当前 连接数小于告警连接数, 或者当前连接数不小于告警连接数且结合定时查 询功能获取到对应的控制连接表中端口连接数小于最大端口连接数时, 创 建新的连接;
更新所述连接转发表中对应的五元组信息、 连接使用标识的值; 以及 更新当前连接数、 连接控制表中对应的端口连接数。
5、 根据权利要求 4所述的方法, 其特征在于, 所述根据连接信息查找 所述连接转发表的步骤之后还包括:
所述连接转发表中存在所述连接信息中的五元组信息时, 更新所述连 接转发表中对应的连接使用标识的值。
6、 根据权利要求 4或 5所述的方法, 其特征在于, 所述定时查询功能 包括:
定时查询连接转发表获取连接信息;
所述连接信息中连接使用标识的值为使用状态时, 将所述连接使用标 识的值清零; 所述连接信息中连接使用标识的值为未使用状态时, 删除对 应的连接, 并更新当前连接数、 所述连接转发表中对应的五元组信息以及 所述连接控制表中对应的端口连接数;
当前连接数小于安全连接数时, 结束定时查询功能; 当前连接数大于 等于安全连接数时, 继续查询连接转发表获取连接信息。
7、 根据权利要求 6所述的方法, 其特征在于, 所述连接转发表中不存 在所述连接信息中的五元组信息之后还包括:
当前连接数不小于最大连接总数与预留连接数之差, 且当前连接由服 务器发起时, 若当前连接数小于最大连接总数, 则创建新的连接, 并将新 创建的连接加入到连接转发表中; 否则, 结束创建连接流程。
8、 一种控制 P2P下载的服务器, 其特征在于, 包括:
连接信息获取模块, 用于接收源终端发送的报文, 从所述报文中获取 连接信息;
P2P下载控制模块,用于根据所述连接信息、连接转发表以及连接控制 表调整与控制 P2P下载连接数, 对 P2P下载进行控制。
9、 根据权利要求 8所述的服务器, 其特征在于, 所述连接信息包括五 元组信息, 该五元组信息包括: 源终端所在的源 IP地址及源端口, 目的终 端所在的目的 IP地址及目的端口,以及源终端与目的终端之间的协议类型。
10、 根据权利要求 9所述的服务器, 其特征在于, 所述 P2P下载控制 模块包括: 查找单元, 用于根据所述连接信息查找所述连接转发表; 连接创建单元, 用于当所述连接转发表中不存在所述连接信息中的五 元组信息时, 并在当前连接数小于告警连接数, 或者当前连接数不小于告 警连接数且结合定时查询功能获取到对应的控制连接表中端口连接数小于 最大端口连接数时, 创建新的连接;
更新单元, 用于更新所述连接转发表中对应的五元组信息、 连接使用 标识的值; 以及更新当前连接数、 连接控制表中对应的端口连接数。
11、 根据权利要求 10所述的服务器, 其特征在于, 所述更新单元还用 于当所述连接转发表中存在所述连接信息中的五元组信息时, 更新所述连 接转发表中对应的连接使用标识的值。
12、 根据权利要求 10所述的服务器, 其特征在于, 所述连接创建单元 包括:
查询子单元, 用于定时查询连接转发表获取连接信息;
调整子单元, 用于当所述连接信息中连接使用标识的值为使用状态时, 将所述连接使用标识的值清零; 否则, 删除对应的连接, 并更新当前连接 数、 所述连接转发表中对应的五元组信息以及所述连接控制表中对应的端 口连接数;
判断子单元, 用于判断当前连接数是否小于安全连接数, 若是, 则结 束定时查询功能; 否则, 由查询子单元查询连接转发表获取连接信息。
13、 根据权利要求 10、 11或 12所述的服务器, 其特征在于, 所述连 接创建单元还用于当前连接数不小于最大连接总数与预留连接数之差, 且 当前连接由服务器发起时, 若当前连接数小于最大连接总数, 则创建新的 连接, 并将新创建的连接加入到连接转发表中; 否则, 结束创建连接流程。
14、 一种控制 P2P下载的系统, 其特征在于, 包括: 服务器、 分别与 所述服务器连接的源终端和目的终端, 其中: 所述源终端, 用于向所述服务器发送报文, 通过所述服务器建立与目 的终端之间的连接, 当连接建立成功时, 由服务器将所述报文转发至目的 终端;
所述服务器, 用于接收源终端发送的报文, 从所述报文中获取连接信 息; 根据所述连接信息、 连接转发表以及连接控制表调整与控制 P2P下载 连接数, 对 P2P下载进行控制;
所述目的终端, 用于接收所述服务器转发的所述报文。
15、 根据权利要求 14所述的系统, 其特征在于, 所述服务器为权利要 求 8至 13中任一项所述的服务器。
PCT/CN2011/075592 2010-10-12 2011-06-10 控制p2p下载的方法、服务器及系统 WO2012048576A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201010506118.3A CN102447724B (zh) 2010-10-12 2010-10-12 控制p2p下载的方法、服务器及系统
CN201010506118.3 2010-10-12

Publications (1)

Publication Number Publication Date
WO2012048576A1 true WO2012048576A1 (zh) 2012-04-19

Family

ID=45937867

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/075592 WO2012048576A1 (zh) 2010-10-12 2011-06-10 控制p2p下载的方法、服务器及系统

Country Status (2)

Country Link
CN (1) CN102447724B (zh)
WO (1) WO2012048576A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104125111B (zh) * 2014-07-22 2018-02-27 深圳市共进电子股份有限公司 数据传输的控制方法和装置
CN104917810B (zh) * 2015-04-14 2019-07-26 天脉聚源(北京)教育科技有限公司 一种基于全局变量的用户设备的连接方法及连接装置
CN115334136B (zh) * 2022-07-05 2024-02-02 北京天融信网络安全技术有限公司 一种连接老化控制方法、系统、设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005065177A (ja) * 2003-08-20 2005-03-10 Nippon Telegr & Teleph Corp <Ntt> P2p通信システムにおける接続リンク数制御方法、情報処理装置、およびリンク数制御プログラム
CN101577671A (zh) * 2008-05-07 2009-11-11 北京启明星辰信息技术股份有限公司 一种对等联网业务自动流量控制方法及系统
CN101645803A (zh) * 2008-08-05 2010-02-10 中兴通讯股份有限公司 点对点业务的识别方法和互联网业务识别系统
CN101720136A (zh) * 2009-11-27 2010-06-02 成都市华为赛门铁克科技有限公司 客户端邻居节点数目控制方法和装置、缓存系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005065177A (ja) * 2003-08-20 2005-03-10 Nippon Telegr & Teleph Corp <Ntt> P2p通信システムにおける接続リンク数制御方法、情報処理装置、およびリンク数制御プログラム
CN101577671A (zh) * 2008-05-07 2009-11-11 北京启明星辰信息技术股份有限公司 一种对等联网业务自动流量控制方法及系统
CN101645803A (zh) * 2008-08-05 2010-02-10 中兴通讯股份有限公司 点对点业务的识别方法和互联网业务识别系统
CN101720136A (zh) * 2009-11-27 2010-06-02 成都市华为赛门铁克科技有限公司 客户端邻居节点数目控制方法和装置、缓存系统

Also Published As

Publication number Publication date
CN102447724B (zh) 2014-12-31
CN102447724A (zh) 2012-05-09

Similar Documents

Publication Publication Date Title
JP6047229B2 (ja) 情報中心ネットワークにおける名前ベースの近隣探索及びマルチホップサービス探索
US10681127B2 (en) File upload method and system
JP5882353B2 (ja) ファイルシステムセッションにおけるマルチコネクションのための方法及びシステム
US20030079144A1 (en) Service control network, server, network device, service information distribution method, and service information distribution program
WO2008141538A1 (fr) Procédé, dispositif et système servant à distribuer des données de fichier
WO2010078814A1 (zh) 即时通信文件多源传输系统及方法
WO2010069198A1 (zh) 分布式网络构造方法和系统以及任务处理方法
WO2018076765A1 (zh) 云计算系统的内容分发方法及装置、计算节点及系统
WO2010105505A1 (zh) 网络上请求资源的位置信息的方法、用户节点和服务器
WO2023005747A1 (zh) 数据传输方法、装置及分布式存储系统
WO2011069387A1 (zh) 一种网络节点及其数据查询方法和索引更新方法
WO2009127132A1 (zh) 报文分发方法、设备及系统
JP2011525313A (ja) マルチキャスト・グループ管理のための方法及び装置
WO2019100831A1 (zh) 传输层协议适配的方法、网元设备及系统
WO2017031947A1 (zh) 向网络中发送和从网络中获取目标数据的方法和装置
WO2021098425A1 (zh) 配置业务的服务质量策略方法、装置和计算设备
WO2009000214A1 (fr) Procédé et dispositif pour configurer des données de configuration du réseau d&#39;accès utilisateur
WO2011041970A1 (zh) 一种支持数据报文主动推送能力的实现方法及系统
WO2008128449A1 (fr) Procédé, système et dispositif d&#39;accès permettant la mise en oeuvre d&#39;une intercommunication à deux couches de service spécial
WO2013004134A1 (zh) 一种p2p网络路由方法、节点及系统
Jung et al. IDNet: beyond all‐IP network
WO2007045144A1 (fr) Procedes pour l&#39;identification de messages d&#39;application entre homologues et de realisation d&#39;operations et leurs dispositifs correspondants
WO2010096989A1 (zh) 一种用于发现p2p流量优化服务的方法、装置和系统
WO2012048576A1 (zh) 控制p2p下载的方法、服务器及系统
WO2009006779A1 (fr) Procédé et système pour déterminer un nœud d&#39;index de domicile et un nœud de service de domicile d&#39;un utilisateur

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11831973

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11831973

Country of ref document: EP

Kind code of ref document: A1