WO2019100912A1 - 数据分发方法以及分发服务器 - Google Patents

数据分发方法以及分发服务器 Download PDF

Info

Publication number
WO2019100912A1
WO2019100912A1 PCT/CN2018/112595 CN2018112595W WO2019100912A1 WO 2019100912 A1 WO2019100912 A1 WO 2019100912A1 CN 2018112595 W CN2018112595 W CN 2018112595W WO 2019100912 A1 WO2019100912 A1 WO 2019100912A1
Authority
WO
WIPO (PCT)
Prior art keywords
data packet
upstream
downstream
packet
node
Prior art date
Legal status (The legal status 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 status listed.)
Ceased
Application number
PCT/CN2018/112595
Other languages
English (en)
French (fr)
Inventor
李从娟
李晋
李峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to JP2020521550A priority Critical patent/JP6994110B2/ja
Priority to KR1020207009610A priority patent/KR102324919B1/ko
Priority to EP18881561.7A priority patent/EP3672138A4/en
Publication of WO2019100912A1 publication Critical patent/WO2019100912A1/zh
Priority to US16/820,270 priority patent/US11134001B2/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/163In-band adaptation of TCP data exchange; In-band control procedures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/1607Details of the supervisory signal
    • H04L1/1628List acknowledgements, i.e. the acknowledgement message consisting of a list of identifiers, e.g. of sequence numbers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/18Automatic repetition systems, e.g. Van Duuren systems
    • H04L1/1812Hybrid protocols; Hybrid automatic repeat request [HARQ]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/18Automatic repetition systems, e.g. Van Duuren systems
    • H04L1/1829Arrangements specially adapted for the receiver end
    • H04L1/1835Buffer management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/18Automatic repetition systems, e.g. Van Duuren systems
    • H04L1/1829Arrangements specially adapted for the receiver end
    • H04L1/1848Time-out mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/44Distributed routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/19Flow control; Congestion control at layers above the network layer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/28Flow control; Congestion control in relation to timing considerations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/32Flow control; Congestion control by discarding or delaying data units, e.g. packets or frames
    • H04L47/323Discarding or blocking control packets, e.g. ACK packets
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/34Flow control; Congestion control ensuring sequence integrity, e.g. using sequence numbers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/565Conversion or adaptation of application format or content
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/63Routing a service request depending on the request content or context
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/30Definitions, standards or architectural aspects of layered protocol stacks
    • H04L69/32Architecture of open systems interconnection [OSI] 7-layer type protocol stacks, e.g. the interfaces between the data link level and the physical level
    • H04L69/321Interlayer communication protocols or service data unit [SDU] definitions; Interfaces between layers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • H04L45/036Updating the topology between route computation elements, e.g. between OpenFlow controllers

Definitions

  • the present disclosure relates to the field of network technologies, and in particular, to a data distribution method and a distribution server.
  • the content distribution network is an Overlay network constructed by using a multi-level CDN node (such as the CDN intermediate node and the CDN edge node in FIG. 1) on the basis of the traditional telecommunication network.
  • each level of CDN nodes consists of one or more distribution servers, and each distribution server can be based on Hypertext Transfer Protocol (HTTP) or Real Time Media Protocol (RTMP).
  • HTTP Hypertext Transfer Protocol
  • RTMP Real Time Media Protocol
  • a distribution service that provides data such as videos, pictures, files, and the like to a user terminal.
  • the distribution server can provide two types of distribution services, namely, a hit service and a transfer service.
  • the hit service occurs in the case where the data requested by the user terminal is stored on the distribution server, and the transfer service does not store the data requested by the user terminal on the distribution server, and the content request is transferred to the other distribution server or the source station. In the case.
  • the distribution server mainly includes two blocks of a protocol stack and an application layer.
  • the protocol stack is responsible for protocol processing related to the Internet Protocol (TCP/IP), and is divided into two modules: server (server) / client (client).
  • the server is responsible for processing the TCP connection with the user terminal (hereinafter referred to as the downstream connection), including the establishment of the downstream connection, the distribution of the data packet, the reliability control management (such as rate control), and the server at the application layer.
  • the data packet is forwarded; the client is responsible for processing the TCP connection with the upstream node (hereinafter referred to as the upstream connection), including the establishment of the upstream connection, the reception of the data packet, the reliability control management (such as whether it is out of order), and the application layer. Data packets are forwarded between clients.
  • the upstream connection the upstream node
  • the reliability control management such as whether it is out of order
  • the application layer the application layer
  • the application layer is also divided into two modules: server/client.
  • the server of the application layer is responsible for receiving the content request of the user terminal, triggering the client of the application layer to request (get) data to the upstream node, and receiving the data packet sent by the upstream node forwarded by the client of the application layer, and forwarding the data packet to the protocol stack.
  • the server further sends the received data packet to the downstream node or the user terminal.
  • the client of the application layer is responsible for receiving the trigger of the server of the application layer and initiating a content request to the upstream node.
  • the content request triggers the client of the protocol stack to establish a connection with the upstream node, and then the client of the application layer receives the client of the protocol stack and obtains the client from the upstream node.
  • the data message arrived and forwarded to the server at the application layer.
  • a data message needs to be controlled by the protocol stack (such as checking whether it is out of order), then to the application layer, and then transferred by the application layer to the protocol stack, and then through the protocol.
  • Control management of the stack (such as rate control), after which the data packet can be sent to the user terminal by the protocol stack, that is, data distribution is realized.
  • the inventors have found that the related art has at least the following problem: in the process of distributing data packets, the two processes of data distribution and control management are seriously combined, that is, data packets need to be matched. After the control and management, the distribution can be performed again, which delays the control management process and introduces a large delay for the distribution of data packets.
  • the embodiment of the present disclosure provides a data distribution method and a distribution server, which solves the problem of large data distribution delay in the related art.
  • the technical solution is as follows:
  • a data distribution method is provided, the method being applied to a distribution server, the method comprising:
  • connection mapping table provides a mapping relationship between the upstream connection information and the downstream connection information.
  • the connection mapping table includes a plurality of mapping entries, and each mapping entry has an N-tuple information of the upstream connection and a downstream connection that matches the N-tuple information of the upstream connection. N-tuple information, and an initial sequence number difference between the upstream connection and the downstream connection.
  • the distribution server includes at least an application layer, a protocol stack, and a data forwarding layer.
  • the data forwarding layer is responsible for the above data distribution process
  • the protocol stack is responsible for the above control management process, and implements separation of data forwarding and control management.
  • the protocol stack includes a first enabled interface, and the application layer invokes the first enabled interface of the protocol stack before sending the content request of the user terminal to the upstream node.
  • the first enabled interface carries an uplink and downlink connection identifier and an enable flag indicating a separate data forwarding function and a control management function; and the protocol stack separates the upstream and downstream connections after receiving the call of the application layer. Data forwarding and control management functions.
  • the data forwarding layer includes a second enabled interface, and after receiving the call of the application layer, the protocol stack invokes a second enabled interface of the data forwarding layer.
  • the second enabled interface carries the upstream connection information and the downstream connection information; the data forwarding layer establishes the connection mapping table after receiving the call of the protocol stack.
  • the sequence number of the first upstream data packet is not continuous with the sequence number of the second upstream data packet, where the first upstream data packet precedes the The second upstream data message is received.
  • the upstream packet loss occurs, causing the data packet to be lost, and the distribution server does not receive it.
  • the converting, by the first packet, the first packet of the two packets obtained by the copying includes: acquiring the first packet Querying the connection mapping table based on the N-tuple information in the first packet, and obtaining a target mapping entry that matches the N-tuple information in the first packet. Replacing the N-tuple information in the first packet with the N-tuple information of the target downstream connection included in the target mapping entry, and according to the target initial sequence number included in the target mapping entry And a difference value and a sequence number carried in the first packet, and calculating a sequence number of the downstream connection of the target.
  • the second report that is obtained based on the copy of the first upstream data packet
  • Performing control management including: performing an out-of-order check on the second packet obtained by copying the first upstream data packet, and sending an ACK (Acknowledgement) to the upstream node for the first upstream data packet , confirm the character) message.
  • ACK Acknowledgement
  • the method further includes: generating a second report based on the copy of the first upstream data packet Translating into a third downstream data message; storing the third downstream data message in a buffer and setting a timeout timer; when the timeout timer expires, sending the message to the downstream node or the user terminal The third downstream data message is described.
  • the method further includes: When the ACK message returned by the downstream node or the user terminal is received before the timeout timer expires, the third downstream data packet stored in the buffer is deleted.
  • the distribution server When the upstream node retransmits the lost data packet, the distribution server also performs the following steps of forwarding the retransmitted data packet and controlling it. which is
  • the method further includes:
  • the sequence number of the third upstream data packet is consecutive with the sequence number of the first upstream data packet, and the third upstream data packet is copied. Transmitting, according to the connection mapping table, the first packet of the two packets obtained by the copy, and transmitting the converted fourth downstream data packet to the downstream node or the user terminal, and Controlling and managing a second packet obtained based on the copy of the third upstream data packet.
  • the process of controlling the second packet based on the copy of the third upstream data packet is similar to the process of the first upstream data packet. That is, the second packet obtained by copying the third upstream data packet is out of order, and an ACK packet is sent to the upstream node; and the packet is copied based on the third upstream data packet. Converting the second packet into a downstream data packet, and storing the obtained downstream data packet in a buffer, and setting a timeout timer; when the timeout timer expires, the downstream node or the user terminal And sending the stored downstream data packet; deleting the downstream data packet stored in the buffer when receiving the ACK packet returned by the downstream node or the user terminal before the timeout timer expires Text.
  • the second report that is obtained by using the second upstream data packet copy Text control management including:
  • the method further includes: sending the fourth downstream data packet to the downstream node or the After the user terminal, the second packet obtained by copying the second upstream data packet is converted into a fifth downstream data packet; the fifth downstream data packet is stored in a buffer and a timeout timer is set. And sending, when the timeout timer expires, the fifth downstream data packet to the downstream node or the user terminal.
  • the one of the connection information in the connection mapping table corresponds to a downstream connection information
  • the method further includes:
  • the distribution server performs the following process in the case that the upstream packet loss causes downstream packet loss.
  • the method further includes: if receiving the third upstream data that is retransmitted by the upstream node Receiving the M repeated ACKs sent by the downstream node or the user terminal, and waiting for the upstream node to retransmit the third upstream data packet, where the M times of repeated ACKs are for the first After the third upstream data packet is retransmitted, the third upstream data packet is subjected to copy processing, and the copy is obtained according to the connection mapping table. The first packet of the two packets is converted, and the converted fourth downstream data packet is sent to the downstream node or the user terminal.
  • the method further includes:
  • a distribution server for performing the data distribution method of the first aspect described above.
  • the distribution server will copy each upstream data packet into two copies, one of which immediately forwards the data and Another execution control management, the embodiment of the present disclosure realizes the separation of the two processes of data distribution and control management, and does not need to perform control after the data packet is controlled and managed, thereby greatly shortening the time consuming of data packet forwarding, and Whether or not the packet loss distribution server immediately forwards the packet after receiving the packet, the data distribution delay is greatly reduced.
  • FIG. 1 is a schematic structural diagram of a CDN network provided by the background art of the present disclosure
  • FIG. 2 is a schematic diagram of an internal architecture of a distribution server provided by the background art of the present disclosure
  • FIG. 3 is a schematic diagram of a scenario of a CDN hit service according to an embodiment of the present disclosure
  • FIG. 4 is a schematic diagram of a scenario of a CDN transit service according to an embodiment of the present disclosure
  • FIG. 5 is a first application scenario diagram of a data distribution method according to an embodiment of the present disclosure.
  • FIG. 6 is a first application scenario diagram of a data distribution method according to an embodiment of the present disclosure.
  • FIG. 7 is a first application scenario diagram of a data distribution method according to an embodiment of the present disclosure.
  • FIG. 8 is a schematic diagram of an internal architecture of a distribution server according to an embodiment of the present disclosure.
  • FIG. 9 is a flowchart of a core process of a data distribution method according to an embodiment of the present disclosure.
  • FIG. 10 is a flowchart of a first data distribution method according to an embodiment of the present disclosure.
  • FIG. 11 is a flowchart of a second data distribution method according to an embodiment of the present disclosure.
  • FIG. 12 is a schematic structural diagram of a distribution server according to an embodiment of the present disclosure.
  • FIG. 13 is a flowchart of a third data distribution method according to an embodiment of the present disclosure.
  • FIG. 14 is a schematic structural diagram of a distribution server according to an embodiment of the present disclosure.
  • FIG. 3 shows a case where the CDN edge node stores data requested by the received content request. As shown in FIG. 3, the CDN edge node directly responds to the received content request and returns response data to the user terminal.
  • Transfer service As shown in Figure 4, if neither the CDN intermediate node nor the CDN edge node stores the data requested by a content request, the CDN node will continue to transfer the content request until it reaches the source station, and finally the source station.
  • the response data is provided, and is relayed by each CDN node step by step to distribute the response data to the user terminal.
  • the serial numbers in FIG. 4 indicate the order in which the requests and distributions occur.
  • a distribution server as a CDN site, as shown in FIG. 3 and FIG. 4 above.
  • the CDN intermediate node and the CDN edge node are shown, and the hit service is provided by the CDN site.
  • the above distribution server is required to provide a transit service, and the source station provides a hit service. .
  • the foregoing distribution server is also generally used to store content that can be cached, such as on-demand video, static picture, etc., thereby serving the user nearby, reducing the consumption of the transmission network bandwidth, and also improving the user terminal.
  • content that can be cached
  • on-demand video such as on-demand video, static picture, etc.
  • CDN networks consisting of CDN intermediate nodes and CDN edge nodes are usually used.
  • Provide intelligent routing that is, provide transit services, and strive to distribute at low latency, while the source station provides hit services.
  • the focus of the solution provided by the embodiments of the present disclosure is how to implement a low latency distribution service.
  • the embodiment of the present disclosure provides a distribution server with a low latency distribution function, which not only shortens the path of data distribution, reduces delay, but also separates data distribution and control management. The process reduces the delay that the control management brings to the data distribution.
  • the distribution server provided by the embodiment of the present disclosure mainly performs the following improvements:
  • TCP also known as a data forwarding layer
  • TCP thin layer forwarding process can be briefly described as:
  • the thin layer of the TCP receives the upstream data packet and immediately converts the received upstream data packet according to the established connection mapping table, for example, replacing the N-tuple information and the serial number in the data packet. ;
  • the downstream data packet obtained by the conversion is immediately sent to the downstream node or the user terminal, and zero is waiting for forwarding.
  • the protocol stack adds a socket (socket) interface, which is called by the application layer.
  • a socket socket
  • the new interface added to the protocol stack refer to the subsequent embodiments.
  • the protocol stack In order to support the separate data distribution and control management process, after receiving the application layer call, the protocol stack needs to set a Transmission Control Protocol (TCP) to receive only data packets for retransmission, instead of The data message is redistributed, that is, the protocol stack only implements control management, and the data distribution is completely handed over to the TCP thin layer processing.
  • TCP Transmission Control Protocol
  • the protocol stack needs to call the TCP thin layer enable interface to instruct the TCP thin layer to establish a connection mapping table and enable its data distribution capability. .
  • this enabling interface of the TCP thin layer please refer to the subsequent embodiments.
  • FIG. 5 shows a first application scenario of the solution provided by the embodiment of the present disclosure. That is, the user terminal initiates a request to the decision server before initiating the content request, and the decision server determines what type of distribution server the content request is to serve.
  • the source station application manufacturer can divide the domain name into two categories according to the delay requirements of each application, and the first type is a real-time domain name.
  • the words including vr/live/rtmp/dynamic are real-time domain names, and the other is a real-time domain name.
  • Classes are non-real-time domain names.
  • the network protocol (IP) address of the distribution server having the low latency distribution function is directly returned, and then the user will initiate the content to the distribution server. Request, and this distribution server will not distinguish between Internet users and will enable low latency distribution for all content requests received.
  • IP network protocol
  • FIG. 6 shows a second application scenario of the solution provided by the embodiment of the present disclosure. That is, the application client installed on the user terminal senses the demand for low latency distribution. The application client needs to extend the protocol field, and the carrying identifier indicates that the initiated content request needs low-latency distribution, and each distribution server along the path automatically identifies the protocol field in the data packet, so as to target the flow to which the data packet belongs. Enable low-latency distribution capability, and then provide low-latency forwarding for subsequent data packets for this flow.
  • FIG. 7 shows a third application scenario of the solution provided by the embodiment of the present disclosure. That is, the distribution server itself perceives the need for low latency distribution.
  • the Uniform Resource Locator (URL) of the content request carries keywords such as dynamic/vr/live/rtmp, and the distribution server automatically enables low-latency distribution capability for the corresponding stream after sensing, and then Low-latency forwarding is provided for subsequent data packets for this flow.
  • URL Uniform Resource Locator
  • FIG. 8 is a schematic diagram of an internal architecture of a distribution server with a low latency distribution function according to an embodiment of the present disclosure.
  • the distribution server includes an application layer 801, a protocol stack 802, and a data forwarding layer 803.
  • the data forwarding layer 803 (also referred to as a TCP thin layer) 803 is responsible for performing data distribution, which may be implemented by software or by hardware, and is not specifically limited in the embodiment of the present disclosure.
  • the data forwarding layer 803 includes an enabling interface 8031, which mainly performs the following functions:
  • connection mapping table gives the upstream connection information and the downstream connection information.
  • the connection mapping table gives the N-tuple information of the upstream connection, the N-tuple information of the downstream connection, and the initial sequence number of the upstream connection and the initial connection of the downstream connection.
  • the difference of the serial number is not specifically limited in the embodiment of the present disclosure.
  • the data forwarding layer 803 obtains the N-tuple information in the upstream data packet and receives the N-tuple information in the upstream data packet, and then queries the N-tuple information in the upstream data packet.
  • the established connection mapping table is used to replace the message, such as replacing the N-tuple information in the upstream data packet and modifying the serial number of the TCP connection.
  • the related check or modification of other fields may also be performed, and the embodiment of the present disclosure also does not specifically limit this.
  • the protocol stack 802 is responsible for control management. As shown in FIG. 8, the protocol stack includes an enable interface 8023 in addition to the client module 8021 and the server module 8022. The new enable interface 8023, the supply layer 801 invokes to enable the protocol stack 802 to separate data distribution and control management, eliminate the data distribution function of the protocol stack 802, and retain only the control management function.
  • the enabled interface 8023 needs to carry an upstream and downstream connection identifier and an enable flag indicating a separate data forwarding function and a control management function.
  • the upstream and downstream connection identifiers are as described above for the downstream connection descriptor, and the enable flag is mainly used to notify the protocol stack 802 that separate data distribution and control management are required.
  • the protocol stack 802 needs to eliminate the function of data distribution, that is, when receiving the data distribution call of the application layer 801, only the received data packet is encapsulated into a TCP packet, and the TCP packet is stored in a Buffer. In the area, but the TCP packet is not sent, the TCP packet is only used for subsequent control management. For the above situation, the protocol stack 802 needs to reset the timeout timer (ie, the retransmission timer).
  • the corresponding TCP packet in the Buffer is deleted and the timeout timer is updated; After receiving the three repeated ACKs of the downstream node or the user terminal or the timeout timer expires, the corresponding TCP packet is retrieved from the Buffer for retransmission according to the congestion control mechanism.
  • the application layer 801 includes a client module 8011 and a server module 8012.
  • the enable interface 8031 of the data forwarding layer 803 may also be called to cause the data forwarding layer 803 to maintain the connection mapping table and enable the data distribution function. See the subsequent examples for an introduction to this section.
  • the distribution server removes the TCP thin layer dedicated to converting and transmitting data packets, and enables the low-latency distribution capability of the TCP thin layer, and eliminates the data forwarding function of the protocol stack, and only retains its control management.
  • the function implements the control management function and data forwarding function of the separation protocol stack, which reduces the influence of the control management process on the data forwarding process, so that the TCP thin layer can immediately convert and transmit the received data message, shortening the data.
  • the path of packet forwarding greatly reduces the delay.
  • FIG. 9 shows a core process flow diagram of the solution provided by the disclosed embodiment.
  • Step 1 The downstream node or the user terminal initiates a request to the distribution server. Among them, the connection request to the server end of the protocol stack is first reached, and then the content request of the server side of the application layer is reached.
  • Step 2 After the distribution server detects that the content requested by the user is not locally stored, the client of the application layer is triggered to initiate a connection request to the upstream node.
  • Step 3 After the connection with the upstream node is established, the application layer invokes the enabling interface of the protocol stack, and the control protocol stack separates the data forwarding and control management for the upstream and downstream connections, and then the protocol stack calls the TCP thin layer.
  • the interface can be used to instruct the TCP layer to establish a connection mapping table for the upstream and downstream connections, enabling low-latency forwarding capability.
  • Step 4 The client of the application layer initiates a content request to the upstream node.
  • Step 5 The upstream data packet sent by the upstream node arrives at the distribution server normally, and the TCP thin layer searches for the connection mapping table, and performs conversion processing, for example, replacing the N-tuple and the serial number in the upstream data packet to implement the upstream data.
  • the conversion process is processed into a downstream data message, and then the TCP layer immediately sends the downstream data message to the downstream node or user terminal.
  • Step 6 The distribution server sends the upstream data packet to the protocol stack, and the protocol stack is responsible for checking whether the data packet is out of order; if the data packet is not out of order, sending a normal ACK to the upstream node, confirming receipt of the datagram. Text.
  • Step 7 The client of the protocol stack sends the upstream data packet to the client of the application layer, and then the client of the application layer forwards the packet to the application layer server, and then sends the packet to the server of the protocol stack.
  • the server of the protocol stack encapsulates the upstream data packet into a TCP packet and places it in the Buffer, but does not send it, sets a timeout timer, waits for a timeout retransmission, or receives a normal ACK returned by the downstream node or the user terminal. Delete the TCP packet.
  • Step 8 The downstream node or the user terminal normally receives the downstream data packet and replies with an ACK. After receiving the ACK, the server of the protocol stack deletes the corresponding TCP packet in the Buffer and updates the timeout timer.
  • Step 9 If the upstream node has packet loss, for example, if the upstream data packet P2/P4/P5/P6 arrives normally and P3 does not arrive, the TCP thin layer will receive the upstream data packet P2/P4/P5/. P6 is sent immediately after the conversion process.
  • Step 10 When the protocol stack receives P4/P5/P6, it finds that the packet is out of order (P3 is not received, and jumps from P2 to P4). Therefore, each time an upstream data packet is received, a repeat for P2 is sent. ACK.
  • Step 11 When the upstream node receives three times of repeated ACKs, it retransmits the upstream data packet P3, and the TCP thin layer transmits the P3 after the conversion process, and then the protocol stack detects the out-of-order elimination, so the P2 to P6 are handed over. The client to the application layer is then forwarded to the server of the protocol stack.
  • FIG. 10 is a flowchart of a data distribution method according to an embodiment of the present disclosure. Among them, this embodiment mainly provides a data distribution process that enables low latency distribution capability and no packet loss.
  • a method flow provided by an embodiment of the present disclosure includes:
  • the downstream node/user terminal performs a TCP three-way handshake with the distribution server to establish a TCP connection.
  • the TCP connection established in this step is a downstream connection.
  • the peer that establishes a connection with the downstream node/user terminal is the server of the protocol stack in the distribution server.
  • the downstream node/user terminal sends a content request to the distribution server by using the established downstream connection.
  • the content request finally arrives at the server of the application layer in the distribution server.
  • the content request can use a variety of protocols, such as HTTP and RTMP.
  • the server of the application layer checks the local cache. If the data requested by the content request is not stored locally, the client of the application layer triggers the client of the protocol stack to initiate a request for establishing a TCP connection to the upstream node.
  • the client of the application layer triggers the client of the protocol stack to initiate a request for establishing a TCP connection to the upstream node. After the TCP three-way handshake, the upstream connection is successfully established.
  • the upstream connection corresponds to the downstream connection mentioned in step 1001, and details are not described herein again.
  • the embodiment of the present disclosure further includes the step of enabling the low-latency distribution capability of the distribution server. For details, refer to the following steps 1004(a) to 1004 ( c).
  • the application layer invokes the first enabled interface of the protocol stack, indicating that the protocol stack enables low-latency distribution capability.
  • the two enabled interfaces are respectively configured as the first enabled interface and the second enabled interface, in order to distinguish the newly enabled enabled interface of the protocol stack from the subsequent enabled thin layer of the TCP thin layer. Mark it.
  • the newly added enabled interface of the protocol stack carries an upstream and downstream connection identifier and an enable flag indicating a separate data forwarding function and a control management function.
  • the upstream and downstream connection identifiers may include the upstream and downstream connection descriptors fd_client or fd_server, which are not specifically limited in this embodiment of the present disclosure.
  • the new first enable interface can be in the form of setsockoptAPI, such as: int setsockopt(int sockfd, int level, int optname, const void*optval, socklen_t optlen).
  • the optval carries the upstream and downstream connection identifiers that need to be separated from the control management and data forwarding.
  • the optname carries the enable flag indicating the separate data distribution and control management, indicating low-latency distribution, such as the value TCP_ZERODELAY. Among them, TCP_ZERODELAY refers to zero waiting for forwarding.
  • the protocol stack After receiving the call of the application layer, the protocol stack separates the data forwarding function and the control management function of the upstream and downstream connections.
  • the separation When the separation is performed, the data forwarding function and the control management function of the TCP connection corresponding to the fd_server are specifically separated, that is, after the action is performed, the data packet is received, and only the TCP packet is encapsulated, and is not sent out, waiting.
  • the timeout/ACK trigger control management process is performed; the data forwarding function and the control management function of the TCP connection corresponding to the fd_client are separated, that is, the data packet is received after the action is executed, and only the TCP packet is encapsulated and is not sent out. Waiting for timeout/ACK trigger control management processing.
  • the processing of the TCP connection corresponding to the fd_server is mainly for the data forwarded by the upstream node to the node and then to the downstream node or the user terminal, which is a classic case in the CDN distribution, so this solution only The situation is described in detail, and the processing of the TCP connection corresponding to fd_client is similar to this, and this solution is not discussed separately.
  • the protocol stack After receiving the application layer call, the protocol stack invokes the second enable interface of the TCP thin layer to instruct the TCP thin layer to establish a connection mapping table, and enables the low-latency distribution capability of the TCP thin layer.
  • the protocol stack invokes the second layer of the TCP layer. Enable the interface, instruct the TCP thin layer to establish a connection mapping table, enable the low-latency distribution capability of the TCP thin layer, and inform the TCP thin layer to receive the data packets conforming to the connection mapping condition to be converted according to the established connection mapping table. Process and then forward the obtained data message directly.
  • the second enabling interface of the TCP thin layer is shaped as follows:
  • the client_conn_info carries the upstream connection information, which may include the N-tuple information (such as the source IP/Port, the destination IP/Port) and the initial sequence number.
  • the server_conn_info carries the downstream connection information, and may include the N-tuple information (such as the source IP/Port. Destination IP/Port) and initial sequence number; for enable, true indicates that the connection mapping table is established, and false indicates that the connection mapping table is deleted.
  • connection mapping table is as shown in Table 1:
  • the upstream connection quaternion is (IPup, Portup, IPc, Portc,) and the initial serial number Sequpinit of the upstream connection
  • the downstream connection quaternion is (IPs, Ports, IPdown, Portdown). ,), and the initial serial number Seqdowninit of the downstream connection.
  • IPup and Portup represent the listening address and port of the upstream node.
  • IPc and Portc represent the address and port used by the distribution server to initiate the upstream connection.
  • IPs and Ports represent the listening address and port of the distribution server, IPdown and Portdown. If the address/port used by the downstream node to initiate the downstream connection is sent from the upstream to the downstream, the corresponding connection mapping table may be replaced by Table 1 below as Table 2:
  • mapping table item storage and the speeding up indexing may be performed by using a method such as a commonly used hash, and the embodiment of the present disclosure does not specifically limit this.
  • the protocol stack calls the newly added first enabled interface, and disable is set to false, indicating that the TCP thin layer is deleted.
  • the connection mapping table established above, for this flow closes the low latency distribution service.
  • the client of the application layer initiates a content request to the upstream node by using the established upstream connection.
  • the upstream node sends the upstream data packet to the distribution server by using the established upstream connection.
  • the distribution server first copies an upstream data packet to the TCP thin layer, and the TCP thin layer performs low delay distribution.
  • the TCP thin layer After receiving the upstream data packet sent by the upstream node, the TCP thin layer converts the upstream data packet according to the established connection mapping table to obtain a downstream data packet, and obtains a downstream data packet. Forward the converted downstream connection message immediately.
  • the N-tuple information in the upstream data packet is taken out, and the N-tuple information is used as a key to search for the established connection mapping table, and the target mapping entry matching the key is found, and then the target mapping entry is used.
  • Dst and seq_diff perform conversion processing on the upstream data packet;
  • the N-tuple information of the translated downstream data packet is (IPs, Ports, IPdown, Portdown), and the serial number is Seqdown.
  • Seqdown Sequp+seq_diff.
  • the TCP layer After obtaining the downstream data packet, the TCP layer forwards the downstream data packet. In another way, the TCP layer immediately sends the converted IP packet to the downstream node or user terminal.
  • the distribution server copies an upstream data message to the protocol stack, and is controlled and managed by the protocol stack.
  • the protocol stack determines that the data packets arrive in sequence, that is, after the protocol stack performs an out-of-order check on the data packets, it is found that the packets are out of order. Therefore, the protocol stack sends a normal ACK to the upstream node.
  • the client of the protocol stack submits the upstream data packet to the client of the application layer.
  • the client at the application layer forwards the upstream data packet to the server at the application layer.
  • the application layer server forwards the upstream data packet to the server of the protocol stack.
  • the server of the protocol stack After receiving the upstream data packet sent by the server of the application layer, the server of the protocol stack encapsulates the upstream data packet into a TCP packet by using the downstream connection information (such as the N-tuple information, the serial number, etc.), and encapsulates the packet.
  • the completed TCP packet is placed in the Buffer.
  • the TCP packet after the encapsulation is not sent, but only placed in the Buffer.
  • the server of the protocol stack sets the timeout timer, waits for the ACK of the downstream node/user terminal to trigger the deletion of the TCP packet, or waits for the timeout timer to expire. If the timeout timer expires, the retransmission of the TCP packet is triggered.
  • a thin layer of TCP has been added to the distribution server.
  • the low-latency distribution capability is implemented by the newly added TCP thin layer.
  • the protocol stack is changed, and the data distribution of the protocol stack is eliminated. The function then separates the control management functions and data distribution functions of the protocol stack.
  • the TCP thin layer can be implemented in software or hardware.
  • this embodiment is unique in the process of data distribution without packet loss:
  • step 1011 After the server of the protocol stack in step 1011 receives the data packet sent by the server of the application layer, the server does not perform the process of forwarding.
  • the existing solution After receiving the data packet, the existing solution sends the data packet to the client of the application layer layer by layer, and then forwards it to the server of the application layer, and then sends it to the server of the protocol stack.
  • the data distribution method provided by the embodiment of the present disclosure shortens the forwarding path and reduces the delay.
  • the server of the protocol stack when the application layer forwards the data packet to the server of the protocol stack, the server of the protocol stack does not necessarily transmit immediately, but needs to consider the control factors such as the transmission rate, and the solution is only because of the TCP thin layer. Responsible for data forwarding, does not perform any control processing, so it can reduce the impact of control processing on data forwarding.
  • the method provided by the embodiment of the present disclosure removes the data forwarding function of the protocol stack by adding a TCP thin layer dedicated to converting and transmitting data packets in the distribution server, and enables the low-latency distribution capability of the TCP thin layer, and only retains the data forwarding function of the protocol stack.
  • the control management function realizes the control management function and data forwarding function of the separation protocol stack, which reduces the influence of the control management process on the data forwarding process, so that the TCP thin layer can immediately convert and send the received data message.
  • the path of data packet forwarding is shortened, which greatly reduces the delay.
  • FIG. 11 is a flowchart of a data distribution method according to an embodiment of the present disclosure. Among them, this embodiment mainly provides an upstream connection control process, including a process for packet loss for the upstream connection.
  • a method flow provided by an embodiment of the present disclosure includes:
  • the data packet P1 sent by the upstream node arrives normally.
  • the distribution server copies P1 into two copies, and the TCP thin layer forwards the processing to one of the downstream nodes or the user terminal immediately after converting one of them.
  • the protocol stack controls and manages another copy of the copy. If the protocol stack checks that another data packet is not out of order, the protocol stack sends an ACK to the upstream node, confirming receipt of the data packet P1, and simultaneously The data packet is sent to the client of the application layer.
  • the data packet P3 sent by the upstream node arrives normally, and the distribution server copies P3 into two copies, and the TCP thin layer forwards the processing to one of the downstream nodes or the user terminal immediately after converting the processing.
  • the protocol stack controls and manages another copy, and the protocol stack detects another data packet out of order.
  • the protocol stack sends an ACK to the upstream node to confirm receipt of the data P1.
  • the protocol stack determines that the packet is out of order, and sends an ACK to the upstream node for the data packet P1. This is the first repeated ACK (the ACK for data message P1 has been sent in step 1102).
  • the client of the protocol stack stores the data packet P3 and does not send it to the client of the application layer.
  • the data packets P4 and P5 sent by the upstream node arrive normally, and the TCP thin layer immediately forwards the data packets P4 and P5 to the downstream node or the user terminal.
  • the second and third repeated ACKs for the data message P1 are also triggered.
  • the upstream node After receiving the three times of repeated ACKs, the upstream node retransmits the data packet P2, and the TCP layer forwards the data packet P2 to the downstream node or the user terminal immediately after the data packet P2 is converted.
  • the data packet P2 is sent to the protocol stack, and the protocol stack detects that the data packet is not out of order, sends an ACK to the upstream node, confirms receipt of the data packet P5, and delivers the data packet P2-P5 to the application layer. Client.
  • the protocol stack after receiving the retransmitted data packet P2, the protocol stack sends an ACK to the upstream node for the last received data packet (ie, data packet P5), and starts from the data packet P2.
  • the four data packets ending in the data packet P5 are delivered to the client at the application layer.
  • the client of the application layer forwards the data packet P2-P5 to the server of the application layer, and the server of the application layer forwards the data packet P2-P5 to the server of the protocol stack.
  • the data packet P2-P5 is stored in the buffer of the server of the protocol stack in the form of a TCP packet, and waits for the ACK of the downstream node or the user terminal or the timeout timer expires to trigger the deletion of the TCP packet or the retransmission of the TCP packet. .
  • the data packet P1 may be referred to as a first upstream data packet.
  • the downstream data packet forwarded by the distribution server may be referred to as a first downstream packet.
  • the data packet, cached in the Buffer of the protocol stack, may be referred to as a third downstream data packet.
  • the data packet P3 may be referred to as a second upstream data packet.
  • the downstream data packet forwarded by the distribution server may be referred to as a second downstream data packet, and the buffer of the protocol stack may be cached. It is called the fifth downstream data message.
  • the data packet P2 may be referred to as a third upstream data packet.
  • the downstream data packet forwarded by the distribution server may be referred to as a fourth downstream data packet, and the buffer of the protocol stack may be cached. It is called the sixth downstream data message.
  • the upstream nodes of the data packets P1 to P5 are sent in chronological order, and each data packet corresponds to a sequence number.
  • the sequence number of the first upstream data packet and the sequence number of the second upstream data packet are discontinuous.
  • the sequence number of the first upstream data packet and the sequence number of the third upstream data packet are consecutive.
  • the above implementation process describes how to acknowledge the received upstream data packet and how to handle the packet loss in case of packet loss in the upstream. It should be noted that the scheme converts and forwards each data packet immediately after receiving a data packet, and does not need to wait until the packet has been received and checks that the packet is not out of order, and then forwards the data packet received during the period to the data packet. The application is then sent to the downstream node or user terminal.
  • the processing flow of the packet in the embodiment shown in FIG. 11 is consistent with the embodiment shown in FIG. 10, and the difference between the two is the enabling process of the low-latency distribution capability.
  • the low latency capability enabling process steps of the embodiment shown in Figure 11 are as follows:
  • the application layer carries an upstream and downstream connection descriptor to invoke an new enabled interface of the protocol stack to obtain uplink and downlink connection information, such as at least an initial sequence number of the upstream and downstream connections.
  • the new enable interface of the protocol stack is: int getsockopt(int sockfd, int level, int optname, void*optval, socklen_t*optlen);
  • the optname carries the identification information of the upstream and downstream connection information, for example, the value is TCP_CONNECTINFO; the optval contains two structures, and the structure type is connectinfo.
  • Each callinfo carries a separate control management and data forwarding.
  • the application layer carries the upstream and downstream connection identifiers, and invokes another enabled interface added by the protocol stack to indicate that the protocol stack separates data forwarding and control management functions.
  • the newly added interface can be in the form of setsockoptAPI, such as: int setsockopt(int sockfd, int level, int optname, const void*optval, socklen_t optlen).
  • the optval carries the upstream and downstream connection identifiers that need to be separated from the control management and data forwarding.
  • the optname carries an enable flag indicating separate data distribution and control management, indicating low-latency distribution, such as the value TCP_ZERODELAY. Among them, TCP_ZERODELAY refers to zero waiting for forwarding.
  • the protocol stack After receiving the call of the application layer, the protocol stack separates the data forwarding function and the control management function of the upstream and downstream connections.
  • the separation When the separation is performed, the data forwarding function and the control management function of the TCP connection corresponding to the fd_server are specifically separated, that is, after the action is performed, the data packet is received, and only the TCP packet is encapsulated, and is not sent out, waiting.
  • the timeout/ACK trigger control management process is performed; the data forwarding function and the control management function of the TCP connection corresponding to the fd_client are separated, that is, the data packet is received after the action is executed, and only the TCP packet is encapsulated and is not sent out. Waiting for timeout/ACK trigger control management processing.
  • the application layer carries the N-tuple information and the initial sequence number of the upstream and downstream connections, invokes the enabling interface of the TCP thin layer, establishes a connection mapping table, and enables the low-latency distribution function of the TCP thin layer.
  • the enabling interface of the thin layer of TCP is shaped as follows:
  • the client_conn_info carries the upstream connection information, which may include the N-tuple information (such as the source IP/Port, the destination IP/Port) and the initial sequence number.
  • the server_conn_info carries the downstream connection information, and may include the N-tuple information (such as the source IP/Port. Destination IP/Port) and initial sequence number; for enable, true indicates that the connection mapping table is established, and false indicates that the connection mapping table is deleted.
  • connection mapping table looks like this:
  • the upstream connection quaternion is (IPup, Portup, IPc, Portc,) and the initial serial number Sequpinit of the upstream connection
  • the downstream connection quaternion is (IPs, Ports, IPdown, Portdown). ,), and the initial serial number Seqdowninit of the downstream connection.
  • IPup and Portup represent the listening address and port of the upstream node.
  • IPc and Portc represent the address and port used by the distribution server to initiate the upstream connection.
  • IPs and Ports represent the listening address and port of the distribution server, IPdown and Portdown. Indicates the address/port used by the downstream node to initiate the downstream connection. If the data is sent from upstream to downstream, the corresponding connection mapping table is as follows:
  • mapping table item storage and the speeding up indexing may be performed by using a method such as a commonly used hash, and the embodiment of the present disclosure does not specifically limit this.
  • the protocol stack only adds an enable interface, and the application layer invokes the enable interface to inform the protocol stack to enable low latency capability at a time, and the protocol stack separates its own control management and data forwarding accordingly.
  • two new enable interfaces are added to the protocol stack, and the application layer invokes one of the two enabled interfaces to obtain uplink and downlink connection information, and then calls the other of the two enabled interfaces. Instructs the protocol stack to perform the separation action, and then invokes the TCP thin layer enable interface to instruct the TCP thin layer to establish a connection mapping table and enable low latency distribution capability.
  • the method provided by the embodiment of the present disclosure is for the continuously received at least two upstream data messages, regardless of whether the sequence numbers of the messages are consecutive, the distribution server copies each upstream data message into two copies, one of which The data forwarding is performed immediately, and the control management is performed on another one.
  • the embodiment of the present disclosure realizes the separation of the two processes of data distribution and control management, and does not need to perform control after the data packet is controlled and managed, thereby greatly shortening the datagram.
  • the path forwarded by the text, and whether the packet is forwarded immediately after receiving a packet greatly reduces the data distribution delay.
  • the data forwarding function of the protocol stack is eliminated, and only its control management function is retained, and then implemented. Separating the control and management functions of the protocol stack and the data forwarding function reduces the impact of the control management process on the data forwarding process, so that the TCP layer can immediately convert and send the received data packets, shortening the path of data packet forwarding. , greatly reducing the delay.
  • FIG. 13 is a flowchart of a data distribution method according to an embodiment of the present disclosure.
  • the embodiment mainly provides a downstream control processing process, including a process of packet loss of a downstream connection caused by an upstream connection packet loss.
  • a method flow provided by an embodiment of the present disclosure includes:
  • the downstream node or the user terminal After receiving the data packet P1 in sequence, the downstream node or the user terminal sends an ACK to the distribution server.
  • This step is directed to the process of processing downstream ACKs when there is no packet loss.
  • the downstream node or the user terminal sequentially receives the data packet P1, it sends an ACK to the distribution server to confirm receipt of the data packet P1, and the distribution server sends the received ACK to the protocol stack.
  • the stack deletes the data packet P1 in the Buffer and other data packets whose sequence number is before P1, and updates the timeout timer and other control parameters, which is not specifically limited in this embodiment of the present disclosure.
  • the data packet P3-P5 sent by the upstream node arrives, and the TCP thin layer forwards the data packet to the downstream node or the user terminal immediately after converting the data packet P3-P5.
  • the downstream node or the user terminal does not receive the data packet P2.
  • the TCP layer does not receive the data packet P2. Therefore, the downstream node or the user terminal does not receive the data packet P2.
  • the downstream node or the user terminal receives the data packet in sequence, In the case of P3-P5, the sending of the three repeated ACKs for the data packet P1 to the distribution server is triggered, and only the data packet P1 is received, and the data packet P2 is notified to be lost.
  • the distribution server After receiving the three repeated ACKs, the distribution server cannot retransmit the data packet P2 in the current Buffer, so no processing is performed, and the TCP layer receives the data packet P2 retransmitted by the upstream node. Forward to the downstream node or user terminal.
  • the upstream node After receiving the three repeated ACKs, the upstream node retransmits the data packet P2 and copies the P2 into two copies. After the TCP layer converts one of the packets, the downstream data packet is forwarded to the downstream node or user. terminal.
  • the distribution server Since the distribution server sequentially receives the data packets P3-P5 after the data packet P1, it also sends 3 repeated ACKs for the data packet P1 to the upstream node, and then triggers the upstream node to retransmit the data packet P2.
  • the downstream node or the user terminal After receiving the data packet P2, the downstream node or the user terminal cancels the out-of-order, sends an ACK to the distribution server, and confirms that the data packet P5 is received. After receiving the ACK, the protocol stack deletes the stored data. The message P5 and the data packet whose sequence number is before P5, and update the timeout timer and other control parameters.
  • the first point to be explained is that, in the above step 1304, if the ACK arrival time sent by the downstream node or the user terminal is late, the distribution is arrived after the distribution server has received the data packet P2 retransmitted by the upstream node, then the distribution is performed.
  • the server can trigger the retransmission of the data packet P2 again. Since the TCP layer has forwarded the data packet P2 once, the downstream node or the user terminal receives two data packets P2, and the downstream node or the user terminal receives the data packet. Two data packets are automatically discarded when they are P2, which has no effect on the service.
  • the node may not receive the duplicate ACK of the downstream node or the user terminal before receiving the data packet retransmitted by the upstream node. To achieve retransmission, it is necessary to wait for the upstream node to retransmit the data packet and forward it directly by the TCP layer.
  • the third point that needs to be explained is that the above describes the situation that the upstream packet loss causes packet loss.
  • the server of the protocol stack can be retransmitted.
  • the downstream packet loss is serious, such as the link quality is too poor, the packet loss rate is high, or the processing performance of the downstream node is too poor, resulting in packet loss within the node, indicating that the performance of the downstream link or downstream node cannot meet the current transmitted data volume.
  • the request may trigger the downstream node to re-initiate the request, request content with a small amount of data (for example, switching from HD video to standard definition video), or trigger the distribution server to establish a new connection mapping table, which is slow according to the newly established connection mapping table.
  • the node provides the service.
  • connection mapping table described in the foregoing embodiment is only one upstream connection corresponding to one downstream connection, but in an actual application scenario, especially in a live scenario, multiple downstream nodes may be initiated. Multiple connections to the local node (the distribution server) request the same content. In this case, the node only needs to initiate an upstream connection. In this case, an upstream connection is mapped to multiple downstream connections.
  • the process is :
  • connection mapping table is triggered, and the connection mapping table is as follows:
  • connection mapping table is as follows:
  • the TCP thin layer After receiving the data packet sent by the upstream node, the TCP thin layer queries the connection mapping table established above. If the queried target mapping entry contains N dst options, the TCP thin layer converts the received data. Processing N times, each conversion process is similar to the embodiment corresponding to Figure 10, but each conversion is based on a different dst option and the seq_diff option, and is sent once per conversion.
  • the thin layer of TCP can better support scenarios such as live broadcast. Considering that there may be an unsynchronization problem of live broadcast participation, some Internet users may join a little later. At this time, the application layer can filter the cached data and send it to the Internet users who join later, and then join the Internet users and join the Internet first.
  • the downstream connection information added to the Internet user is added to the connection mapping table, and then the TCP thin layer uniformly performs data forwarding according to the manner described above to realize synchronization data; or, in the thin layer of TCP or In the protocol stack, a public Buffer is set for the live object, and the Buffer is used to cache the cached data of the live object.
  • the TCP thin layer or the protocol stack can be used to filter the cached data and send it to the Internet user after the join.
  • the TCP thin layer uniformly performs data forwarding according to the manner described above to realize synchronous data.
  • the live broadcast scenario is used as an example.
  • the protocol stack After the protocol stack encapsulates the received upstream data packet into a TCP packet and caches it in the Buffer, the subsequent process is performed. Even if an ACK message returned by a downstream node or an Internet user is received, the cached data in the Buffer is not deleted in order to facilitate live viewing by Internet users who join later.
  • the method provided by the embodiment of the present disclosure is for the continuously received at least two upstream data messages, regardless of whether the sequence numbers of the messages are consecutive, the distribution server copies each upstream data message into two copies, one of which The data forwarding is performed immediately, and the control management is performed on another one.
  • the embodiment of the present disclosure realizes the separation of the two processes of data distribution and control management, and does not need to perform control after the data packet is controlled and managed, thereby greatly shortening the datagram.
  • the path forwarded by the text, and whether the packet is forwarded immediately after receiving a packet greatly reduces the data distribution delay.
  • the data forwarding function of the protocol stack is eliminated, and only its control management function is retained, and then implemented. Separating the control and management functions of the protocol stack and the data forwarding function reduces the impact of the control management process on the data forwarding process, so that the TCP layer can immediately convert and send the received data packets, shortening the path of data packet forwarding. , greatly reducing the delay.
  • FIG. 14 is a schematic structural diagram of a distribution server according to an embodiment of the present disclosure.
  • the server includes: a first receiving module 1401, a data forwarding module 1402, and a control management module 1403.
  • the data forwarding module 1402 is configured to implement the data forwarding function of the TCP thin layer in the foregoing
  • the control management module 1403 is configured to implement the control management function of the protocol stack.
  • the first receiving module 1401 may correspond to the data sent by the upstream node in FIG. The Buffer of the message.
  • the first receiving module 1401 is configured to continuously receive the first upstream data packet and the second upstream data packet sent by the upstream node, and perform copy processing on the first upstream data packet and the second upstream Data packets are copied;
  • the data forwarding module 1402 is configured to perform conversion processing on the first packet of the two packets obtained by copying the first upstream data packet according to the established connection mapping table, and convert the first downstream The data packet is sent to the downstream node or the user terminal;
  • the control management module 1403 is configured to perform control management on the second packet obtained by copying the first upstream data packet
  • the data forwarding module 1402 is further configured to perform conversion processing on the first packet of the two packets obtained by copying the second upstream data packet according to the connection mapping table, and convert the obtained second downstream Sending a data packet to the downstream node or the user terminal;
  • the control management module 1403 is further configured to perform control management on the second packet obtained by copying the second upstream data packet;
  • connection mapping table provides a mapping relationship between the upstream connection information and the downstream connection information.
  • the distribution server provided by the embodiment of the present disclosure, for the continuous reception of at least two upstream data messages, regardless of whether the serial numbers of the messages are consecutive, the distribution server copies each upstream data message into two copies, one of which The data forwarding is performed immediately, and the control management is performed on another one.
  • the embodiment of the present disclosure realizes the separation of the two processes of data distribution and control management, and does not need to perform control after the data packet is controlled and managed, thereby greatly shortening the data.
  • the path of the packet is forwarded, and the packet is forwarded immediately after receiving a packet, which greatly reduces the data distribution delay.
  • the sequence number of the first upstream data packet is not continuous with the sequence number of the second upstream data packet, and the first upstream data packet is received before the second upstream data packet.
  • connection mapping table includes a plurality of mapping entries, each of which provides N-tuple information of the upstream connection and a downstream connection that matches the N-tuple information of the upstream connection.
  • N-tuple information the initial sequence number difference between the upstream connection and the downstream connection;
  • the data forwarding module 1402 is further configured to obtain N-tuple information in the first packet, and query the connection mapping table based on the N-tuple information in the first packet to obtain a connection Resetting the target mapping entry of the N-tuple information in the first packet; replacing the N-element in the first packet with the N-tuple information of the downstream connection of the target included in the target mapping entry
  • the group information is used, and the serial number of the target downstream connection is calculated according to the target initial sequence number difference value included in the target mapping entry and the sequence number carried in the first packet.
  • control management module 1403 is further configured to perform an out-of-order check on the second packet obtained by copying the first upstream data packet, and send the The acknowledgement character ACK message of the first upstream data message.
  • control management module 1403 is further configured to convert the second packet obtained by copying the first upstream data packet into a third downstream data packet;
  • the data packet is stored in the buffer and a timeout timer is set; when the timeout timer expires, the third downstream data packet is sent to the downstream node or the user terminal.
  • an upstream connection information in the connection mapping table is associated with a downstream connection information
  • the control management module 1403 is further configured to receive the downstream node or before the timeout timer expires. And deleting, by the user terminal, the third downstream data packet stored in the buffer.
  • the first receiving module 1401 is further configured to receive a third upstream data packet that is retransmitted by the upstream node, and perform copy processing on the third upstream data packet, where The sequence number of the three upstream data packets is consecutive to the sequence number of the first upstream data packet;
  • the data forwarding module 1402 is further configured to: convert, according to the connection mapping table, the first packet of the two packets obtained by the copy, and send the converted fourth downstream data packet to the The downstream node or the user terminal controls and manages the second packet obtained based on the copy of the third upstream data packet.
  • control management module 1403 is further configured to perform an out-of-order check on the second packet obtained by copying the second upstream data packet, and send the The ACK packet of the first upstream data packet.
  • control management module 1403 is further configured to: after the data forwarding module 1402 sends the fourth downstream data packet to the downstream node or the user terminal, based on the second upstream data.
  • the second packet obtained by the copy of the packet is converted into the fifth downstream data packet; the fifth downstream data packet is stored in the buffer and a timeout timer is set; when the timeout timer expires, the The downstream node or the user terminal sends the fifth downstream data packet.
  • an upstream connection information in the connection mapping table is associated with a downstream connection information
  • the control management module 1403 is further configured to receive the downstream node or before the timeout timer expires. And deleting, by the user terminal, the fifth downstream data packet stored in the buffer.
  • control management module 1403 is further configured to: before the first receiving module 1401 receives the third upstream data packet that is retransmitted by the upstream node, the second receiving module receives Waiting for the upstream node to retransmit the third upstream data packet, the M-times repeated ACK is for the first upstream data packet, and the M-th repeat ACK sent by the downstream node or the user terminal of;
  • the data forwarding module 1402 is further configured to: after receiving the retransmitted third upstream data packet, perform two reports obtained by copying the third upstream data packet according to the connection mapping table.
  • the first packet in the text performs a conversion process, and the step of transmitting the converted fourth downstream data packet to the downstream node or the user terminal.
  • control management module 1403 is further configured to: after the first receiving module 1401 receives the third upstream data packet that is retransmitted by the upstream node, the second receiving module receives Transmitting, to the downstream node or the sixth downstream data packet that is matched with the third upstream data packet, that is sent to the downstream node or the user terminal User terminal.
  • a person skilled in the art may understand that all or part of the steps of implementing the above embodiments may be completed by hardware, or may be instructed by a program to execute related hardware, and the program may be stored in a computer readable storage medium.
  • the storage medium mentioned may be a read only memory, a magnetic disk or an optical disk or the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Communication Control (AREA)
  • Computer And Data Communications (AREA)

Abstract

本公开提供了一种数据分发方法以及分发服务器,属于网络技术领域。方法包括:连续接收上游节点发送的第一上游数据报文和第二上游数据报文;对第一上游数据报文进行拷贝处理,根据已建立的连接映射表,对拷贝得到的两份报文中的第一份报文进行转换处理,将转换得到的第一下游数据报文发送给下游节点或用户终端,并对基于第一上游数据报文拷贝得到的第二份报文进行控制管理;对第二上游数据报文进行拷贝处理,根据连接映射表,对拷贝得到的两份报文中的第一份报文进行转换处理,将转换得到的第二下游数据报文发送给下游节点或用户终端,并对基于第二上游数据报文拷贝得到的第二份报文进行控制管理。本公开降低了数据分发时延,实现了低时延分发。

Description

数据分发方法以及分发服务器
本申请要求于2017年11月24日提交的申请号为201711189288.1、发明名称为“数据分发方法以及分发服务器”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本公开涉及网络技术领域,特别涉及一种数据分发方法以及分发服务器。
背景技术
分发服务器,常用于内容分发网络(Content Delivery Network,CDN)中。其中,内容分发网络是在传统的电信网络基础之上,使用多级CDN节点(如图1中的CDN中间节点以及CDN边缘节点)构建的一个Overlay网络。依据内容分发网络的规模不同,每一级CDN节点由一个或多个分发服务器组成,而各个分发服务器可基于超文本传输协议(HyperText Transfer Protocol,HTTP)或实时媒体协议(Real Time Media Protocol,RTMP)向用户终端提供诸如视频、图片、文件等数据的分发业务。在内容分发网络中,依据分发服务器上是否存储了用户终端请求的数据,分发服务器可提供两种分发服务,即命中服务和中转服务。其中,命中服务发生在分发服务器上存储有用户终端请求的数据的情形下,而中转服务发生在分发服务器上未存储用户终端请求的数据,还需向其他分发服务器或源站进行内容请求中转的情形下。
其中,图2示出了一种提供中转服务的分发服务器的内部架构示意图,该分发服务器主要包括协议栈和应用层两大块。如图2所示,协议栈负责因特网互联协议(Transmission Control Protocol/Internet Protocol,TCP/IP)相关的协议处理,分为server(服务端)/client(客户端)两个模块。其中,server负责处理与用户终端间的TCP连接(以下简称为下游连接),包括下游连接的建立、数据报文的分发、可靠性控制管理(比如速率控制)、与应用层的server之间的数据报文转交;client负责处理与上游节点间的TCP连接(以下简称为上游连接),包括上游连接的建立、数据报文的接收、可靠性控制管理(比如是否乱序)、与应用层的client之间数据报文转交。
另外,应用层也分为server/client两个模块。其中,应用层的server负责接收用户终端的内容请求,触发应用层的client向上游节点请求(get)数据,接收应用层的client转交过来的上游节点发送的数据报文,并转交给协议栈的server,进而将接收到的数据报文发送给下游节点或用户终端。应用层的client负责接收应用层的server的触发,发起到上游节点的内容请求,此内容请求会触发协议栈的client与上游节点建立连接,之后应用层的client接收协议栈的client从上游节点获取到的数据报文,并转交给应用层的server。
简言之,在正常的数据报文处理流程中,一个数据报文需历经协议栈的控制管理(比如检查是否乱序),再到应用层,再由应用层转交到协议栈,再历经协议栈的控制管理(比如速率控制),之后才能由协议栈将数据报文发送给用户终端,即实现数据分发。
在实现本公开的过程中,发明人发现相关技术至少存在以下问题:在数据报文的分发过程中,数据分发与控制管理这两个过程严重的糅合在了一起,即需要在对数据报文进行控制管理后才能再进行分发,这使得控制管理过程延后了针对数据报文的分发,引入了较大时延。
发明内容
本公开实施例提供了一种数据分发方法以及分发服务器,解决了相关技术中数据分发时延较大的问题。所述技术方案如下:
第一方面,提供了一种数据分发方法,所述方法应用于分发服务器,所述方法包括:
连续接收上游节点发送的第一上游数据报文和第二上游数据报文;
对所述第一上游数据报文进行拷贝处理,根据已建立的连接映射表,对拷贝得到的两份报文中的第一份报文进行转换处理,将转换得到的第一下游数据报文发送给下游节点或用户终端,并对基于所述第一上游数据报文拷贝得到的第二份报文进行控制管理;
对所述第二上游数据报文进行拷贝处理,根据所述连接映射表,对拷贝得到的两份报文中的第一份报文进行转换处理,将转换得到的第二下游数据报文发送给所述下游节点或所述用户终端,并对基于所述第二上游数据报文拷贝得到的第二份报文进行控制管理;
其中,所述连接映射表给出了上游连接信息与下游连接信息之间的映射关系。详细来说,所述连接映射表中包括多个映射表项,而每一个映射表项中给出了上游连接的N元组信息、与所述上游连接的N元组信息匹配的下游连接的N元组信息,以及所述上游连接与所述下游连接的初始序列号差值。
此外,所述分发服务器至少包括应用层、协议栈以及数据转发层。其中,所述数据转发层负责上述的数据分发流程,而所述协议栈负责上述的控制管理流程,实现数据转发与控制管理的分离。具体地,所述协议栈包括第一使能接口,所述应用层在向所述上游节点发送用户终端的内容请求之前,会调用所述协议栈的第一使能接口。其中,所述第一使能接口携带上下游连接标识以及指示分离数据转发功能与控制管理功能的使能标志;而所述协议栈在接收到所述应用层的调用后,分离上下游连接的数据转发功能与控制管理功能。
另外,所述数据转发层包括第二使能接口,所述协议栈在接收到所述应用层的调用后,调用所述数据转发层的第二使能接口。其中,所述第二使能接口携带所述上游连接信息与所述下游连接信息;所述数据转发层在接收到所述协议栈的调用后,建立所述连接映射表。
在第一方面的第一种可能的实现方式中,所述第一上游数据报文的序号与所述第二上游数据报文的序号不连续,所述第一上游数据报文先于所述第二上游数据报文接收到。
即,出现了上游丢包,造成了数据报文丢失,导致本分发服务器没有接收到。
结合第一方面,在第一方面的第二种可能的实现方式中,所述对拷贝得到的两份报文中的第一份报文进行转换处理,包括:获取所述第一份报文中的N元组信息;基于所述第一份报文中的N元组信息,查询所述连接映射表,得到与所述第一份报文中的N元组信息匹配的目标映射表项;以所述目标映射表项中包括的目标下游连接的N元组信息,替换所述第一份报文中的N元组信息,并根据所述目标映射表项中包括的目标初始序列号差值以及所述第一份报文中携带的序列号,计算所述目标下游连接的序列号。
结合第一方面或第一方面的第一种可能的实现方式,在第一方面的第三种可能的实现 方式中,所述对基于所述第一上游数据报文拷贝得到的第二份报文进行控制管理,包括:对基于所述第一上游数据报文拷贝得到的第二份报文进行乱序检查,并向所述上游节点发送针对所述第一上游数据报文的ACK(Acknowledgement,确认字符)报文。
结合第一方面的第三种可能的实现方式,在第一方面的第四种可能的实现方式中,所述方法还包括:将基于所述第一上游数据报文拷贝得到的第二份报文转换成第三下游数据报文;将所述第三下游数据报文存储在缓冲区中并设置超时定时器;当所述超时定时器超时,向所述下游节点或所述用户终端发送所述第三下游数据报文。
结合第一方面的第四种可能的实现方式,在第一方面的第五种可能的实现方式中,所述连接映射表中一个上游连接信息与一个下游连接信息对应,所述方法还包括:当在所述超时定时器超时之前接收到所述下游节点或所述用户终端返回的ACK报文时,删除所述缓冲区中存储的所述第三下游数据报文。
当上游节点重传丢失的数据报文,则本分发服务器还会执行下述转发重传的数据报文并对其进行控制管理的步骤。即
结合第一方面或第一方面的第一种可能的实现方式,在第一方面的第六种可能的实现方式中,所述方法还包括:
接收所述上游节点重传的第三上游数据报文,所述第三上游数据报文的序号与所述第一上游数据报文的序号连续;对所述第三上游数据报文进行拷贝处理,根据所述连接映射表,对拷贝得到的两份报文中的第一份报文进行转换处理,将转换得到的第四下游数据报文发送给所述下游节点或所述用户终端,并对基于所述第三上游数据报文拷贝得到的第二份报文进行控制管理。
其中,在对基于所述第三上游数据报文拷贝得到的第二份报文进行控制管理时,过程与对第一上游数据报文的过程类似。即,对基于所述第三上游数据报文拷贝得到的第二份报文进行乱序检查,并向所述上游节点发送ACK报文;且将基于所述第三上游数据报文拷贝得到的第二份报文转换成下游数据报文,并将得到的下游数据报文存储在缓冲区中,同时设置超时定时器;当所述超时定时器超时,向所述下游节点或所述用户终端发送存储的这一下游数据报文;当在所述超时定时器超时之前接收到所述下游节点或所述用户终端返回的ACK报文时,删除所述缓冲区中存储的这一下游数据报文。
结合第一方面或第一方面的第一种可能的实现方式,在第一方面的第七种可能的实现方式中,所述对基于所述第二上游数据报文拷贝得到的第二份报文进行控制管理,包括:
对基于所述第二上游数据报文拷贝得到的第二份报文进行乱序检查,并向所述上游节点发送针对所述第一上游数据报文的ACK报文。
结合第一方面的第七种可能的实现方式,在第一方面的第八种可能的实现方式中,所述方法还包括:在将第四下游数据报文发送给所述下游节点或所述用户终端后,将基于所述第二上游数据报文拷贝得到的第二份报文转换成第五下游数据报文;将所述第五下游数据报文存储在缓冲区中并设置超时定时器;当所述超时定时器超时,向所述下游节点或所述用户终端发送所述第五下游数据报文。
结合第一方面的第八种可能的实现方式,在第一方面的第九种可能的实现方式中,所述连接映射表中一个上游连接信息与一个下游连接信息对应,所述方法还包括:
当在所述超时定时器超时之前接收到所述下游节点或所述用户终端返回的ACK报文 时,删除所述缓冲区中存储的所述第五下游数据报文。
针对上游丢包导致下游丢包的情况,本分发服务器还会执行下述过程,即
结合第一方面的第六种可能的实现方式,在第一方面的第十种可能的实现方式中,所述方法还包括:若在接收到所述上游节点重传的所述第三上游数据报文之前,接收到所述下游节点或所述用户终端发送的M次重复ACK,则等待所述上游节点重传所述第三上游数据报文,所述M次重复ACK是针对所述第一上游数据报文的;在接收到重传的所述第三上游数据报文后,执行所述对所述第三上游数据报文进行拷贝处理,根据所述连接映射表,对拷贝得到的两份报文中的第一份报文进行转换处理,将转换得到的第四下游数据报文发送给所述下游节点或所述用户终端的步骤。
结合第一方面的第六种可能的实现方式,在第一方面的第十一种可能的实现方式中,所述方法还包括:
若在接收到所述上游节点重传的所述第三上游数据报文之后,接收到所述下游节点或所述用户终端发送的M次重复ACK,则将缓冲区中存储的与所述第三上游数据报文匹配的第六下游数据报文发送给所述下游节点或所述用户终端。
第二方面,提供了一种分发服务器,所述服务器用于执行上述第一方面所述的数据分发方法。
本公开实施例提供的技术方案带来的有益效果是:
针对连续接收到的两个上游数据报文,无论这两个报文的序号是否连续,本分发服务器均会将每一个上游数据报文拷贝为两份,其中一份立即进行数据转发,并对另一份执行控制管理,本公开实施例实现了数据分发与控制管理这两个过程分离,无需在对数据报文进行控制管理后再进行分发,大大缩短了数据报文转发的耗时,而且无论是否发生丢包分发服务器在接收到报文后均立即进行转发,大大降低了数据分发时延。
附图说明
图1是本公开背景技术提供的一种CDN网络的结构示意图;
图2是本公开背景技术提供的一种分发服务器的内部架构示意图;
图3是本公开实施例提供的一种CDN命中服务的场景示意图;
图4是本公开实施例提供的一种CDN中转服务的场景示意图;
图5是本公开实施例提供的数据分发方法的第一应用场景图;
图6是本公开实施例提供的数据分发方法的第一应用场景图;
图7是本公开实施例提供的数据分发方法的第一应用场景图;
图8是本公开实施例提供的一种分发服务器的内部架构示意图;
图9是本公开实施例提供的一种数据分发方法的核心处理流程图;
图10是本公开实施例提供的第一种数据分发方法的流程图;
图11是本公开实施例提供的第二种数据分发方法的流程图;
图12是本公开实施例提供的一种分发服务器的结构示意图;
图13是本公开实施例提供的第三种数据分发方法的流程图;
图14是本公开实施例提供的一种分发服务器的结构示意图。
具体实施方式
为使本公开的目的、技术方案和优点更加清楚,下面将结合附图对本公开实施方式作进一步地详细描述。
在对本公开实施例进行详细地解释说明之前,先对本公开实施例可能涉及到的一些名词术语进行解释说明。
命中服务:如图3所示,如果某个分发服务器已经存储有某个内容请求所请求的数据,那么这个分发服务器将直接响应这一内容请求,而不再向上一级CDN节点转发这一内容请求。其中,图3示出了CDN边缘节点存储有接收到的内容请求所请求的数据的情形。如图3所示,该CDN边缘节点直接响应接收到的这一内容请求,向用户终端返回响应数据。
中转服务:如图4所示,如果CDN中间节点以及CDN边缘节点均没有存储某个内容请求所请求的数据,那么上述CDN节点会将这一内容请求一直中转直至到达源站,最终由源站提供响应数据,并由各个CDN节点逐级进行中转,实现将响应数据分发给用户终端。其中,图4中的各个序号表示请求与分发的先后发生顺序。
需要说明的是,针对一般静态内容,如各个视频网站提供的视频、图片等,由于均会长时间保持不变,因此可以缓存在作为CDN站点的分发服务器中,如上述图3和图4中所示的CDN中间节点以及CDN边缘节点,由CDN站点提供命中服务。而针对视频直播(如赛事、热点事件直播等)、动态内容(比如需要源站实时生成网页等)、静态内容的首次分发,则均需上述分发服务器提供中转服务,而由源站提供命中服务。
在另一个实施例中,通常还会利用上述分发服务器来就近存储可以缓存的内容,如点播视频、静态图片等,从而就近为用户服务,降低对传输网络带宽的消耗,同时也提高用户终端的体验。再需要强调的一点是,针对虚拟现实(Virtual Reality,VR)视频、视频直播、动态内容等这些对实时性要求高的内容来说,通常利用由CDN中间节点以及CDN边缘节点组成的CDN网络来提供智能路由,即提供中转服务,力求低时延分发,而由源站提供命中服务。而本公开实施例提供的方案的关注焦点便在于如何实现低时延分发服务。
其中,本公开实施例为了实现低时延分发服务,提供了一种具有低时延分发功能的分发服务器,不但可以缩短数据分发的路径,降低时延,而且还可通过分离数据分发与控制管理过程,降低控制管理给数据分发带来的时延,简要来说,本公开实施例提供的分发服务器主要进行了下述改进:
(1)、新增TCP薄层(又称之为数据转发层),专门执行处理流程中的数据分发操作,且零等待转发。其中,TCP薄层转发过程可简述为:
a、TCP薄层每收到一个上游数据报文,立即依据已建立的连接映射表,来对接收到的上游数据报文进行转换处理,比如替换数据报文中的N元组信息及序列号;
b、转换处理结束之后,立即将转换得到的下游数据报文发送给下游节点或用户终端,零等待转发。
需要说明的是,在以上过程中均不作控制管理,比如是否有报文乱序现象发生,是否允许发送报文等,据此来避免因控制管理过程导致的延后数据分发。
(2)、为分离数据分发与控制管理,协议栈新增socket(套接字)接口,这一接口由应用层调用。其中,关于协议栈新增的这一接口的详细解释说明,请参见后续实施例。
(3)、为支持分离数据分发与控制管理过程,协议栈在接收到应用层的调用后,需设 置传输控制协议连接(Transmission Control Protocol,TCP)仅接收数据报文供重传使用,而不再分发数据报文,即协议栈仅实现控制管理,而数据分发完全交给TCP薄层处理。
(3)、为支持TCP薄层进行数据分发,协议栈在接收到应用层的调用后,需调用TCP薄层的使能接口,来指示TCP薄层建立连接映射表,使能其数据分发能力。其中,关于TCP薄层的这一使能接口的详细解释说明,同样请参见后续实施例。
接下来,在对本公开实施例提供的方案进行详细地解释说明之前,先对本公开实施例的系统架构或应用场景进行一下介绍。
图5给出了本公开实施例提供的方案的第一种应用场景。即,用户终端在发起内容请求之前,先发起到决策服务器的请求,由决策服务器决定该内容请求由什么类型的分发服务器来服务。例如源站应用厂家可按各个应用对时延的要求,将其域名划分成两类,一类是实时性域名,例如包含vr/live/rtmp/dynamic等字样的便为实时性域名,另一类是非实时性域名。一旦检测到用户终端发起的内容请求的域名是实时性域名,则直接返回具有低时延分发功能的分发服务器的网络协议(Internet Protocol,IP)地址,之后用户将发起到这一分发服务器的内容请求,而这一分发服务器将不区分互联网用户,将为接收到的所有内容请求使能低时延分发。其中,这一分发服务器再寻找上游分发节点时,依然可由决策服务器进行决定,而所有沿途的具有低时延分发功能的分发服务器默认为接收到所有内容请求开启低时延分发功能。
图6给出了本公开实施例提供的方案的第二种应用场景。即,由用户终端上安装的应用客户端来感知低时延分发的需求。其中,应用客户端需扩展协议字段,携带标识位表明发起的内容请求需要低时延分发,而沿路的各个分发服务器自动识别数据报文中的该协议字段,从而针对该数据报文所属的流使能低时延分发能力,继而为此流后续的数据报文提供低时延转发。
图7给出了本公开实施例提供的方案的第三种应用场景。即,由分发服务器自身来感知低时延分发的需求。例如,内容请求的统一资源定位符(Uniform Resource Locator,url)中携带dynamic/vr/live/rtmp等关键字,而分发服务器在感知到后自动为相应的流使能低时延分发能力,继而为此流后续的数据报文提供低时延转发。
图8是本公开实施例提供的一种具有低时延分发功能的分发服务器的内部架构示意图。参见图8,该分发服务器包括应用层801、协议栈802以及数据转发层803。
其中,数据转发层(又可称之为TCP薄层)803负责进行数据分发,其既可以通过软件实现,也可以通过硬件实现,本公开实施例对此不进行具体限定。数据转发层803包括一个使能接口8031,主要完成以下功能:
(1)通过使能接口8031,接受上层的协议栈802(或者应用层801)的调用,来维护一个连接映射表(比如新增/删除等)。其中,连接映射表给出了上游连接信息以及下游连接信息,比如连接映射表给出了上游连接的N元组信息、下游连接的N元组信息以及上游连接的初始序列号与下游连接的初始序列号的差值,本公开实施例对此不进行具体限定。
(2)数据转发层803每接收到上游节点发送的一个上游数据报文,便会获取该上游数据报文中的N元组信息,并基于该上游数据报文中的N元组信息,查询已建立的连接映射表来进行报文替换,比如替换上游数据报文中的N元组信息,以及修改TCP连接的序列号。除此之外,在进行转换处理时,还可以进行相关校验或修改其他字段,本公开实施例对此 同样不进行具体限定。
此外,协议栈802负责进行控制管理。如图8所示,协议栈除了包括client模块8021以及server模块8022之外,还包括一个使能接口8023。其中,新增的使能接口8023,供应用层801进行调用,以使能协议栈802分离数据分发和控制管理,剔除协议栈802的数据分发功能,仅保留控制管理功能。
在本公开实施例中,使能接口8023需携带上下游连接标识以及指示分离数据转发功能与控制管理功能的使能标志。其中,上下游连接标识如上下游连接描述符,使能标志主要用于告知协议栈802需分离数据分发和控制管理。
此外,协议栈802需剔除数据分发的功能,即在接收到应用层801的数据分发调用时,仅将接收到的数据报文封装成TCP报文,并将该TCP报文存储在Buffer(缓冲区)中,但并不发送该TCP报文,该TCP报文仅供后续进行控制管理使用。针对上述情况,协议栈802还需重新设置超时定时器(即重传定时器),如果接收到下游节点或用户终端的正常ACK,则删除Buffer中对应的TCP报文并更新超时定时器;当接收到下游节点或用户终端的三次重复ACK或者超时定时器超时,则依据拥塞控制机制,从Buffer中取出对应的TCP报文进行重传。
其中,应用层801包括client模块8011以及server模块8012。在另一个实施例中,可能还需调用数据转发层803的使能接口8031,促使数据转发层803维护连接映射表和使能数据分发功能。关于这部分的介绍请参见后续实施例。
本公开实施例提供的分发服务器,通过增加专门负责转换并发送数据报文的TCP薄层,并使能TCP薄层的低时延分发能力,剔除协议栈的数据转发功能,仅保留其控制管理功能,继而实现了分离协议栈的控制管理功能与数据转发功能,减少了控制管理过程对数据转发过程的影响,使得TCP薄层可对接收到的数据报文立即进行转换并发送,缩短了数据报文转发的路径,大大降低了时延。
下面结合上述图8所述的具有低时延分发功能的分发服务器的结构图,来对本公开实施例完成低时延分发的核心处理流程进行简单地总结归纳。即,图9示出了公开实施例提供的方案的核心处理流程图。
步骤1、下游节点或用户终端发起到本分发服务器的请求。其中,先是到达协议栈的server端的连接请求,再是达到应用层的server端的内容请求。
步骤2、本分发服务器检测到本地没有存储用户请求的内容之后,触发应用层的client端发起到上游节点的连接请求。
步骤3、在与上游节点的连接建立完成后,应用层调用协议栈的使能接口,控制协议栈针对上下游连接进行数据转发与控制管理的分离,继而由协议栈通过调用TCP薄层的使能接口,来指示TCP薄层针对上下游连接建立连接映射表,使能低时延转发能力。
步骤4、应用层的client发起到上游节点的内容请求。
步骤5、上游节点发送的上游数据报文正常到达本分发服务器,TCP薄层查找连接映射表,进行转换处理,比如替换上游数据报文中的N元组及序列号等信息,实现将上游数据转换处理成下游数据报文,然后TCP薄层立即将下游数据报文发送给下游节点或用户终端。
步骤6、本分发服务器将上游数据报文上送至协议栈,协议栈负责检查数据报文是否乱序;如果数据报文无乱序,则向上游节点发送正常ACK,确认收到该数据报文。
步骤7、协议栈的client将该上游数据报文上送到应用层的client,继而由应用层的client将其转交给应用层server,之后再发送给协议栈的server。此时,协议栈的server将该上游数据报文封装成TCP报文放置在Buffer中,但不发送,设置超时定时器,等待超时重传或者在接收到下游节点或用户终端返回的正常ACK后来删除该TCP报文。
步骤8、下游节点或用户终端正常接收到下游数据报文并回复ACK,协议栈的server在接收到ACK后,删除Buffer中对应的TCP报文并更新超时定时器。
步骤9、若上游节点有丢包现象出现,例如上游数据报文P2/P4/P5/P6正常到达,P3未到达,那么TCP薄层在将接收到的上游数据报文P2/P4/P5/P6进行转换处理后立即发送。
步骤10、协议栈在收到P4/P5/P6时,发现报文乱序(P3未收到,从P2跳到P4),因此每接收到一个上游数据报文,便发送一次针对P2的重复ACK。
步骤11、上游节点在接收到三次重复ACK时,重传上游数据报文P3,TCP薄层再将P3进行转换处理后立即发送,此时协议栈检测到乱序消除,所以将P2至P6转交至应用层的client,继而再转交到协议栈的server。
此外,针对下游丢包的情况请参见后续实施例。
图10是本公开实施例提供的一种数据分发方法的流程图。其中,这一实施例主要给出了使能低时延分发能力以及无丢包的数据分发过程。参见图10,本公开实施例提供的方法流程包括:
1001、下游节点/用户终端与分发服务器进行TCP三次握手,建立TCP连接。
其中,此步骤建立的TCP连接为下游连接。与下游节点/用户终端建立连接的对端,为分发服务器中协议栈的server。
1002、下游节点/用户终端使用已建立好的下游连接向分发服务器发送内容请求。
其中,该内容请求最终到达分发服务器中应用层的server。
此外,该内容请求可使用多种协议,比如HTTP和RTMP。在接收到该内容请求后,应用层的server检查本地缓存,如果本地未存储该内容请求所请求的数据,则应用层的server触发协议栈的client向上游节点发起建立TCP连接的请求。
1003、应用层的client触发协议栈的client向上游节点发起建立TCP连接的请求,经过TCP三次握手后,上游连接建立成功。其中,上游连接与步骤1001中提及的下游连接对应,此处不再赘述。
需要说明的是,在应用层的client向上游发起内容请求之前,本公开实施例还包括先使能本分发服务器的低时延分发能力的步骤,具体参见下述步骤1004(a)至1004(c)。
1004(a)、应用层调用协议栈的第一使能接口,指示协议栈使能低时延分发能力。
其中,为了将协议栈新增的使能接口与后续出现的TCP薄层的使能接口进行区分,本公开实施例将上述两个使能接口分别以第一使能接口以及第二使能接口进行标识。
在本公开实施例中,协议栈新增的使能接口携带上下游连接标识以及指示分离数据转发功能与控制管理功能的使能标志。其中,上下游连接标识可包括上下游连接描述符fd_client或fd_server,本公开实施例对此不进行具体限定。新增的第一使能接口可以使用setsockoptAPI形式,形如:int setsockopt(int sockfd,int level,int optname,const void*optval,socklen_t optlen)。
其中,optval中携带需要分离控制管理与数据转发的上下游连接标识,optname携带指 示分离数据分发与控制管理的使能标志,表示低时延分发,如可取值TCP_ZERODELAY。其中,TCP_ZERODELAY指代零等待转发。
1004(b)、协议栈在接收到应用层的调用后,分离上下游连接的数据转发功能与控制管理功能。
其中,在进行分离时,具体分离fd_server对应的TCP连接的数据转发功能与控制管理功能,即在此动作执行完之后再接收到数据报文,仅做TCP报文封装,不再发送出去,等待超时/ACK触发控制管理处理;分离fd_client对应的TCP连接的数据转发功能与控制管理功能,即同样在此动作执行完之后再接收到数据报文,仅做TCP报文封装,不再发送出去,等待超时/ACK触发控制管理处理。
需要说明的是,fd_server对应的TCP连接的处理,主要是针对由上游节点转发给本节点继而要交给下游节点或用户终端的数据,这是CDN分发中的经典情况,因此本方案仅对此情况进行详细说明,而fd_client对应的TCP连接的处理与此相似,本方案不再另行论述。1004(c)、协议栈在接收到应用层的调用后,调用TCP薄层的第二使能接口,指示TCP薄层建立连接映射表,使能TCP薄层的低时延分发能力。
在本公开实施例中,协议栈仅做分离操作还不够,还需使能TCP薄层的低时延分发能力,因此协议栈在接收到应用层的调用后,再调用TCP薄层的第二使能接口,指示TCP薄层建立连接映射表,使能TCP薄层的低时延分发能力,告知TCP薄层此后收到的符合连接映射条件的数据报文均按照建立的连接映射表进行转换处理,然后直接转发得到的数据报文。
其中,TCP薄层的第二使能接口,形如以下:
int settcpmap(const void*client_conn_info,void*server_conn_info,bool enable);
其中,client_conn_info携带上游连接信息,可包括N元组信息(比如源IP/Port,目的IP/Port)及初始序列号;server_conn_info携带下游连接信息,可包括N元组信息(比如源IP/Port,目的IP/Port)及初始序列号;针对enable来说,true表明是建立连接映射表,false表明是删除连接映射表。
需要说明的是,TCP薄层需要建立两条连接映射表,其中一条表达由上游向下游发送数据,另一条表达由下游向上游发送数据,二者实现方法相同。在本公开实施例中仅以由上游向下游发送数据为例进行说明。针对该种情景,连接映射表形如下述表1:
表1
Src dst seq_diff
上游连接N元组 下游连接N元组 上下游连接的初始序号差值
假设N元组信息为四元组信息,上游连接四元组为(IPup,Portup,IPc,Portc,)以及上游连接的初始序列号Sequpinit,下游连接四元组为(IPs,Ports,IPdown,Portdown,),以及下游连接的初始序列号Seqdowninit。
其中,IPup和Portup表示上游节点的侦听地址和端口,IPc和Portc表示本分发服务器在发起上游连接时使用的地址和端口,IPs和Ports表示本分发服务器的侦听地址和端口,IPdown和Portdown表示下游节点在发起下游连接时使用的地址/端口,则由上游向下游发送数据的情况下,对应的连接映射表为可由上述表1替换为下述表2:
表2
Src dst seq_diff
IPup,Portup,IPc,Portc IPs,Ports,IPdown,Portdown Seqdowninit-Sequpinit
其中,在上述表1和表2中,Src作为索引端,即TCP薄层在接收到上游数据报文时,取出其N元组信息与连接映射表中的Src进行一一比对。当出现相同的Src时,则使用该映射表项的dst及seq_diff做映射转换,即进行转换处理。需要说明的是,此处还可使用常用的hash等方法进行映射表项存储以及加快索引,本公开实施例对此不进行具体限定。
在另一个实施例中,当上游节点、下游节点/用户终端中的任一端连接关闭或发生异常时,协议栈调用新增的第一使能接口,将enable置为false,指示TCP薄层删除上述建立的连接映射表,为此流关闭低时延分发服务。
1005、应用层的client使用已建立好的上游连接发起到上游节点的内容请求。
1006、上游节点使用已建立好的上游连接发送上游数据报文给本分发服务器,本分发服务器首先拷贝一份上游数据报文给TCP薄层,由TCP薄层进行低时延分发。
换一种表达方式,TCP薄层在接收到上游节点发送的上游数据报文后,TCP薄层根据已建立的连接映射表,对该上游数据报文进行转换处理,得到下游数据报文,并将转换后的下游连接报文立即转发出去。
其中,TCP薄层在进行转换处理时,具体过程如下:
首先取出上游数据报文中的N元组信息,使用该N元组信息作为key,查找已建立好的连接映射表,找出与key匹配的目标映射表项,之后使用目标映射表项中的dst和seq_diff对该上游数据报文做转换处理;
假设上述N元组信息为(IPup,Portup,IPc,Portc),且查找到的目标映射表项为
Src dst seq_diff
IPup,Portup,IPc,Portc IPs,Ports,IPdown,Portdown Seqdowninit-Sequpinit
则转换后的下游数据报文的N元组信息为(IPs,Ports,IPdown,Portdown),序列号为Seqdown。其中,Seqdown=Sequp+seq_diff。
在得到下游数据报文后,TCP薄层转发下游数据报文。换一种表达方式,TCP薄层将转换得到的IP报文立即发送给下游节点或用户终端。
1007、本分发服务器再拷贝一份上游数据报文给协议栈,由协议栈进行控制管理。
需要说明的是,在这一实施例中仅考虑无丢包的数据报文按序到达的情况。由于针对该种情况协议栈判断数据报文顺序到达,即协议栈在对数据报文进行乱序检查后,发现未出现报文乱序的情况,因此协议栈发送正常ACK给上游节点。
1008、在数据报文按序到达后,协议栈的client上交上游数据报文给应用层的client。
1009、应用层的client转交上游数据报文给应用层的server。
1010、应用层的server转交上游数据报文给协议栈的server。
1011、协议栈的server接收到应用层的server发送的上游数据报文后,使用下游连接信息(比如N元组信息、序列号等)将该上游数据报文封装成TCP报文,并将封装完毕后的TCP报文放置Buffer中。
其中,其中封装完毕后的TCP报文并不进行发送,而是仅放置在Buffer中。协议栈的server会设置超时定时器,等待下游节点/用户终端的ACK触发对TCP报文的删除处理,或 者等待超时定时器超时,如果超时定时器超时则触发重传TCP报文处理。
由以上列举的实施过程可知,本实施例阐述的方案的创新点在于以下:
在分发服务器中新增了TCP薄层,低时延分发能力由新增加的TCP薄层实现,而为支持TCP薄层的低时延分发功能,改动了协议栈,剔除了协议栈的数据分发功能,继而分离了协议栈的控制管理功能与数据分发功能。其中TCP薄层既可软件实现,也可硬件实现。
基于此,在无丢包的数据分发过程中,这一实施例独特之处在于:
(1)、步骤1004(a)至步骤1004(a)中示出的低时延分发能力的使能过程;
(2)、步骤1006中在接收到数据报文后,TCP薄层立即进行转换以及分发的过程;
(3)、步骤1011中的协议栈的server收到应用层的server发送的数据报文后,仅做封装不进行转发的过程。
而现有方案在接收到数据报文后,由于会将数据报文逐层上送至应用层的client,再转交应用层的server,再交由协议栈的server发送出去。相较于现有方案,本公开实施例提供的数据分发方法缩短了转发路径,降低了时延。此外,现有方案中当应用层将数据报文转交给协议栈的server后,协议栈的server并不一定立即进行发送,而是需要考虑发送速率等控制因素,而本方案因为TCP薄层仅负责数据转发,并不进行任何控制处理,所以可以降低控制处理对数据转发的影响。
本公开实施例提供的方法,通过在分发服务器中增加专门负责转换并发送数据报文的TCP薄层,并使能TCP薄层的低时延分发能力,剔除协议栈的数据转发功能,仅保留其控制管理功能,继而实现了分离协议栈的控制管理功能与数据转发功能,减少了控制管理过程对数据转发过程的影响,使得TCP薄层可对接收到的数据报文立即进行转换并发送,缩短了数据报文转发的路径,大大降低了时延。
图11是本公开实施例提供的一种数据分发方法的流程图。其中,这一实施例主要给出了上游连接控制处理过程,包括针对上游连接丢包的处理过程。参见图11,本公开实施例提供的方法流程包括:
1101、上游节点发送的数据报文P1正常到达,本分发服务器将P1拷贝为两份,TCP薄层在对其中一份进行转换处理后立即转发给下游节点或用户终端。
1102、协议栈对拷贝得到的另一份进行控制管理,若协议栈检查另一份数据报文无乱序,则协议栈向上游节点发送ACK,确认收到数据报文P1,同时将另一份数据报文上送至应用层的client。
1103、上游节点发送的数据报文P2丢失。
1104、上游节点发送的数据报文P3正常到达,本分发服务器将P3拷贝为两份,TCP薄层在对其中一份进行转换处理后立即转发给下游节点或用户终端。
1105、协议栈对拷贝得到的另一份进行控制管理,协议栈检测到另一份数据报文乱序,协议栈给上游节点发送ACK,确认收到数据P1。
需要说明的是,由于未接收到数据报文P2,而是接收到了数据报文P3,因此协议栈确定报文乱序,向上游节点还是发送针对数据报文P1的ACK。此为第一次重复ACK(针对数据报文P1的ACK在步骤1102中已经发送过)。
需要说明的是,由于数据报文P2丢失,因此协议栈的client存储数据报文P3,并不上送给应用层的client。
1106、上游节点发送的数据报文P4和P5正常到达,TCP薄层在对数据报文P4和P5进行转换处理后立即转发给下游节点或用户终端。
由于在数据报文P3之后还收到了数据报文P4和P5,因此还会触发针对数据报文P1的第二次和第三次重复ACK。
1107、上游节点在接收到三次重复ACK后,重传数据报文P2,TCP薄层在对数据报文P2进行转换处理后立即转发给下游节点或用户终端。
1108、数据报文P2上送至协议栈,协议栈检测到数据报文无乱序,向上游节点发送ACK,确认收到数据报文P5,同时将数据报文P2-P5上交给应用层的client。
换一种表达方式,协议栈在接收重传的数据报文P2后,向上游节点发送针对最后一个接收到的数据报文(即数据报文P5)的ACK,并将自数据报文P2开始至数据报文P5结束的4个数据报文上交至应用层的client。
1109、应用层的client将数据报文P2-P5转交给应用层的server,应用层的server将数据报文P2-P5转交至协议栈的server。
其中,上述数据报文P2-P5以TCP报文形式存储在协议栈的server的Buffer处,等待下游节点或用户终端ACK、或者超时定时器超时,以触发删除TCP报文或重传TCP报文。
需要说明的是,在执行上述数据转发时,上述数据报文P1可称之为第一上游数据报文,针对数据报文P1,本分发服务器转发的下游数据报文可称之为第一下游数据报文,协议栈的Buffer中缓存的可称之为第三下游数据报文。上述数据报文P3可称之为第二上游数据报文,针对数据报文P3,本分发服务器转发的下游数据报文可称之为第二下游数据报文,协议栈的Buffer中缓存的可称之为第五下游数据报文。上述数据报文P2可称之为第三上游数据报文,针对数据报文P2,本分发服务器转发的下游数据报文可称之为第四下游数据报文,协议栈的Buffer中缓存的可称之为第六下游数据报文。
另外,数据报文P1至P5上游节点是按照时间先后顺序进行发送的,且每一个数据报文对应一个序号。其中,上述第一上游数据报文的序号与第二上游数据报文的序号是不连续的。但是上述第一上游数据报文的序号与第三上游数据报文的序号是连续的。
综上所述,以上实施过程描述的是,如何确认接收到的上游数据报文,并在遇上游丢包情况时如何处理丢包。需要说明的是,本方案在是每接收到一个数据报文后立即转换并转发,而无需等到已收到丢包并检查报文无乱序后,再将期间接收到的数据报文转交至应用,进而发送给下游节点或用户终端。
在另一个实施例中,图11所示的实施例对报文的处理流程与图10所示的实施例一致,二者之间的差别在于低时延分发能力的使能过程。结合图12,图11所示的实施例的低时延能力使能过程步骤如下:
(a)、应用层携带上下游连接描述符调用协议栈新增的一个使能接口,获取上下游连接信息,比如至少包括上下游连接的初始序列号。
其中,协议栈新增的这个使能接口形如:int getsockopt(int sockfd,int level,int optname,void*optval,socklen_t*optlen);
其中,optname携带要获取上下游连接信息的标识信息,如可取值为TCP_CONNECTINFO;optval中包含两个结构体,结构体类型为connectinfo,调用时每个connectinfo中分别携带需要分离控制管理与数据转发的上下游连接标识,如上下游连接 描述符fd_client、fd_server。其中,connectinfo如下:
Figure PCTCN2018112595-appb-000001
需要说明的是,协议栈返回时,在seqinit中填上socketfd指定的连接的初始序列号,在ipports中填上该连接的N元组,但N元组不是必须的,因为应用层不调用接口也可以知道N元组信息。
(b)、应用层携带上下游连接标识,调用协议栈新增的另一个使能接口,指示协议栈分离数据转发和控制管理功能。
其中,新增的这个使能接口可以使用setsockoptAPI形式,形如:int setsockopt(int sockfd,int level,int optname,const void*optval,socklen_t optlen)。
其中,optval中携带需要分离控制管理与数据转发的上下游连接标识,optname携带指示分离数据分发与控制管理的使能标志,表示低时延分发,如可取值TCP_ZERODELAY。其中,TCP_ZERODELAY指代零等待转发。
(c)、协议栈在接收到应用层的调用后,分离上下游连接的数据转发功能与控制管理功能。
其中,在进行分离时,具体分离fd_server对应的TCP连接的数据转发功能与控制管理功能,即在此动作执行完之后再接收到数据报文,仅做TCP报文封装,不再发送出去,等待超时/ACK触发控制管理处理;分离fd_client对应的TCP连接的数据转发功能与控制管理功能,即同样在此动作执行完之后再接收到数据报文,仅做TCP报文封装,不再发送出去,等待超时/ACK触发控制管理处理。
(d)、应用层携带上下游连接的N元组信息及初始序列号,调用TCP薄层的使能接口,建立连接映射表,使能TCP薄层的低时延分发功能。
其中,TCP薄层的使能接口,形如以下:
int settcpmap(const void*client_conn_info,void*server_conn_info,bool enable);
其中,client_conn_info携带上游连接信息,可包括N元组信息(比如源IP/Port,目的IP/Port)及初始序列号;server_conn_info携带下游连接信息,可包括N元组信息(比如源IP/Port,目的IP/Port)及初始序列号;针对enable来说,true表明是建立连接映射表,false表明是删除连接映射表。
需要说明的是,TCP薄层需要建立两条连接映射表,其中一条表达由上游向下游发送数据,另一条表达由下游向上游发送数据,二者实现方法相同。在本公开实施例中仅以由上游向下游发送数据为例进行说明。针对该种情景,连接映射表形如下所示:
Src dst seq_diff
上游连接N元组 下游连接N元组 上下游连接的初始序号差值
假设N元组信息为四元组信息,上游连接四元组为(IPup,Portup,IPc,Portc,)以及上游连接的初始序列号Sequpinit,下游连接四元组为(IPs,Ports,IPdown,Portdown,),以及下游连接的初始序列号Seqdowninit。
其中,IPup和Portup表示上游节点的侦听地址和端口,IPc和Portc表示本分发服务器在发起上游连接时使用的地址和端口,IPs和Ports表示本分发服务器的侦听地址和端口,IPdown和Portdown表示下游节点在发起下游连接时使用的地址/端口,则由上游向下游发送数据的情况下,对应的连接映射表为如下所示:
Src dst seq_diff
IPup,Portup,IPc,Portc IPs,Ports,IPdown,Portdown Seqdowninit-Sequpinit
其中,在上述两个表格中,Src作为索引端,即TCP薄层在接收到上游数据报文时,取出其N元组信息与连接映射表中的Src进行一一比对。当出现相同的Src时,则使用该映射表项的dst及seq_diff做映射转换,即进行转换处理。需要说明的是,此处还可使用常用的hash等方法进行映射表项存储以及加快索引,本公开实施例对此不进行具体限定。
需要说明的是,图11对应的实施例与图10对应的实施例的差异之处在于:
在图10对应的实施例中,协议栈仅增加一个使能接口,由应用层调用该使能接口一次告知协议栈使能低时延能力,协议栈据此分离自身的控制管理与数据转发给你,同时调用TCP薄层的使能接口来指示TCP薄层建立连接映射表和使能低时延分发能力。
在图11对应的实施例中,协议栈新增加了两个使能接口,应用层调用两个使能接口中的一个来获取上下游连接信息,再调用两个使能接口中的另一个来指示协议栈执行分离动作,之后再调用TCP薄层的使能接口来指示TCP薄层建立连接映射表和使能低时延分发能力
本公开实施例提供的方法,针对连续接收到的至少两个上游数据报文,无论这些报文的序号是否连续,本分发服务器均会将每一个上游数据报文拷贝为两份,其中一份立即进行数据转发,并对另一份执行控制管理,本公开实施例实现了数据分发与控制管理这两个过程分离,无需在对数据报文进行控制管理后再进行分发,大大缩短了数据报文转发的路径,而且无论是否发生丢包在接收到一个报文后均立即对该报文进行转发,大大降低了数据分发时延。通过在分发服务器中增加专门负责转换并发送数据报文的TCP薄层,并使能TCP薄层的低时延分发能力,剔除协议栈的数据转发功能,仅保留其控制管理功能,继而实现了分离协议栈的控制管理功能与数据转发功能,减少了控制管理过程对数据转发过程的影响,使得TCP薄层可对接收到的数据报文立即进行转换并发送,缩短了数据报文转发的路径,大大降低了时延。
图13是本公开实施例提供的一种数据分发方法的流程图。其中,这一实施例主要给出了下游控制处理过程,包含由上游连接丢包导致的下游连接丢包的处理过程。参见图13,本公开实施例提供的方法流程包括:
1301、下游节点或用户终端在顺序收到数据报文P1后,向本分发服务器发送ACK。
本步骤针对无丢包时处理下游ACK的过程。当下游节点或用户终端顺序收到数据报文P1后,发送ACK给本分发服务器,以确认收到数据报文P1,而本分发服务器会将接收到的这一ACK上送给协议栈,协议栈删除Buffer中的数据报文P1以及序号在P1之前的其他数据报文,并更新超时定时器及其他控制参数,本公开实施例对此不进行具体限定。
1302、上游节点发送的数据报文P2丢失。
1303、上游节点发送的数据报文P3-P5到达,TCP薄层在对数据报文P3-P5进行转换 处理后立即转发给下游节点或用户终端。
1304、下游节点或用户终端未接收到数据报文P2。
针对本步骤,因为发生了上游丢包,TCP薄层并没有接收到数据报文P2,因此下游节点或用户终端也没有接收到数据报文P2,当下游节点或用户终端依次接收到数据报文P3-P5时,会触发发送针对数据报文P1的3次重复ACK给本分发服务器,仅确认接收到数据报文P1,告知数据报文P2丢失。
而本分发服务器在接收到三次重复ACK后,因为当前Buffer中尚未存储数据报文P2,所以无法实现重传,因此不做任何处理,等待TCP薄层收到上游节点重传的数据报文P2转发给下游节点或用户终端。
1305、上游节点在接收到三次重复ACK后,重传数据报文P2,将P2拷贝为两份,TCP薄层在对其中一份进行转换处理得到下游数据报文后立即转发给下游节点或用户终端。
由于本分发服务器在数据报文P1之后顺序接收到数据报文P3-P5,因此也会发送针对数据报文P1的3次重复ACK给上游节点,继而触发上游节点重传数据报文P2。
1306、下游节点或用户终端接收到数据报文P2后,消除乱序,发送ACK给本分发服务器,确认接收到数据报文P5,本节分发服务器在接收到ACK后,协议栈删除存储的数据报文P5及序号在P5之前的数据报文,并更新超时定时器及其他控制参数。
需要说明的第一点是,针对上述步骤1304,如果下游节点或用户终端发送的ACK到达时间晚,是在本分发服务器已经接收到上游节点重传的数据报文P2后才到达,那么本分发服务器可以再次触发重传数据报文P2,由于TCP薄层已转发过一次数据报文P2,所以下游节点或用户终端会接收到2份数据报文P2,而下游节点或用户终端在接收到第2份数据报文P2时会自动丢弃,对业务并没有影响。
需要说明的第二点是,在上游丢包导致下游丢包时,本节点在接收到上游节点重传的数据报文之前,若接收到下游节点或用户终端的重复ACK,则本节点可能无法实现重传,需等待上游节点重传数据报文到达,并由TCP薄层直接转发。
需要说明的第三点是,以上介绍了上游丢包导致下游丢包的情况,针对下游连接出现丢包的情况,可由协议栈的server负责重传,此处不再给出具体流程图进行描述。另外,如果下游丢包严重,比如链路质量太差导致丢包率高,或者下游节点的处理性能太差导致节点内丢包,那么说明下游链路或下游节点的性能无法满足当前传输数据量的要求,可触发下游节点重新发起请求,请求数据量少的内容(例如从高清视频切换到标清视频),或者触发本分发服务器建立一条新的连接映射表,依据新建立的连接映射表为慢节点提供服务。
在另一个实施例中,上述实施例中描述的连接映射表仅是一条上游连接对应一条下游连接的情况,但是在实际的应用场景中,尤其是直播场景中,可能会有多个下游节点发起多条连接到本节点(本分发服务器)请求同一个内容,此时本节点仅需发起一条上游连接即可,此时便会出现一条上游连接映射到多条下游连接的情况,其处理过程为:
本节点收到第一次请求时,依据图10对应的实施例中的处理,触发建立连接映射表,连接映射表如下:
Src dst seq_diff
IPup,Portup,IPc,Portc IPs,Ports,IPdown1,Portdown1 Seqdowninit1-Sequpinit
本节点收到第N(N>1)次请求时,不再触发上游请求,但依然依据图10对应的实施 例中的处理,触发建立连接映射表,此时连接映射表如下:
Figure PCTCN2018112595-appb-000002
这样TCP薄层在接收到上游节点发送的数据报文后,会查询上述建立的连接映射表,如果查询到的目标映射表项中包含N个dst选项,则TCP薄层将接收到的数据转换处理N次,每一次转换过程与图10对应的实施例相似,但每一次转换依据一个不同的dst选项以及seq_diff选项,且每转换完一次发送一次。
由于增加了TCP薄层中一条上游连接映射到多条下游连接的处理过程,因此使得TCP薄层可以更好地支持直播等场景。考虑可能存在直播加入的不同步问题,有的互联网用户可能会稍微加入的晚一点,此时可由应用层筛选已缓存数据发送给后加入的互联网用户,当后加入的互联网用户与先加入的互联网用户同步后,再将后加入互联网用户的下游连接信息加入到上述连接映射表,再由TCP薄层统一按照前文所述的方式进行数据转发,实现同步数据;或者,还可以在TCP薄层或协议栈中针对直播对象设置公共Buffer,该Buffer用于缓存该直播对象的已缓存数据,当有互联网用户后加入时,可由TCP薄层或协议栈筛选已缓存数据发送给后加入的互联网用户,同样当后加入的互联网用户与先加入的互联网用户同步后,再由TCP薄层统一按照前文所述的方式进行数据转发,实现同步数据。
需要说明的是,针对一条上游连接映射到多条下游连接的情况,以直播场景为例,协议栈在将接收到的上游数据报文封装为TCP报文并缓存在Buffer中后,后续过程中即便接收到下游节点或互联网用户返回的ACK报文,为了便于以后加入的互联网用户进行直播观看,也不会对Buffer中的已缓存数据进行删除。
本公开实施例提供的方法,针对连续接收到的至少两个上游数据报文,无论这些报文的序号是否连续,本分发服务器均会将每一个上游数据报文拷贝为两份,其中一份立即进行数据转发,并对另一份执行控制管理,本公开实施例实现了数据分发与控制管理这两个过程分离,无需在对数据报文进行控制管理后再进行分发,大大缩短了数据报文转发的路径,而且无论是否发生丢包在接收到一个报文后均立即对该报文进行转发,大大降低了数据分发时延。
通过在分发服务器中增加专门负责转换并发送数据报文的TCP薄层,并使能TCP薄层的低时延分发能力,剔除协议栈的数据转发功能,仅保留其控制管理功能,继而实现了分离协议栈的控制管理功能与数据转发功能,减少了控制管理过程对数据转发过程的影响,使得TCP薄层可对接收到的数据报文立即进行转换并发送,缩短了数据报文转发的路径,大大降低了时延。
图14是本公开实施例提供的一种分发服务器的结构示意图。参见图14,该服务器包括:第一接收模块1401、数据转发模块1402以及控制管理模块1403。其中,数据转发模块1402用于实现前文中TCP薄层的数据转发功能,控制管理模块1403用于实现协议栈的控制管理功能,第一接收模块1401可对应于图8中接收上游节点发送的数据报文的Buffer。
其中,第一接收模块1401,用于连续接收上游节点发送的第一上游数据报文和第二上游数据报文,并对所述第一上游数据报文进行拷贝处理以及对所述第二上游数据报文进行 拷贝处理;
数据转发模块1402,用于根据已建立的连接映射表,对基于所述第一上游数据报文拷贝得到的两份报文中的第一份报文进行转换处理,将转换得到的第一下游数据报文发送给下游节点或用户终端;
控制管理模块1403,用于对基于所述第一上游数据报文拷贝得到的第二份报文进行控制管理;
数据转发模块1402,还用于根据所述连接映射表,对基于所述第二上游数据报文拷贝得到的两份报文中的第一份报文进行转换处理,将转换得到的第二下游数据报文发送给所述下游节点或所述用户终端;
控制管理模块1403,还用于对基于所述第二上游数据报文拷贝得到的第二份报文进行控制管理;
其中,所述连接映射表给出了上游连接信息与下游连接信息之间的映射关系。
本公开实施例提供的分发服务器,针对连续接收到的至少两个上游数据报文,无论这些报文的序号是否连续,本分发服务器均会将每一个上游数据报文拷贝为两份,其中一份立即进行数据转发,并对另一份执行控制管理,本公开实施例实现了数据分发与控制管理这两个过程分离,无需在对数据报文进行控制管理后再进行分发,大大缩短了数据报文转发的路径,而且无论是否发生丢包在接收到一个报文后均立即对该报文进行转发,大大降低了数据分发时延。
在另一个实施例中,所述第一上游数据报文的序号与所述第二上游数据报文的序号不连续,所述第一上游数据报文先于所述第二上游数据报文接收到。
在另一个实施例中,所述连接映射表包括多个映射表项,每一个映射表项中给出了上游连接的N元组信息、与所述上游连接的N元组信息匹配的下游连接的N元组信息,所述上游连接与所述下游连接的初始序列号差值;
所述数据转发模块1402,还用于获取所述第一份报文中的N元组信息;基于所述第一份报文中的N元组信息,查询所述连接映射表,得到与所述第一份报文中的N元组信息匹配的目标映射表项;以所述目标映射表项中包括的目标下游连接的N元组信息,替换所述第一份报文中的N元组信息,并根据所述目标映射表项中包括的目标初始序列号差值以及所述第一份报文中携带的序列号,计算所述目标下游连接的序列号。
在另一个实施例中,所述控制管理模块1403,还用于对基于所述第一上游数据报文拷贝得到的第二份报文进行乱序检查,并向所述上游节点发送针对所述第一上游数据报文的确认字符ACK报文。
在另一个实施例中,所述控制管理模块1403,还用于将基于所述第一上游数据报文拷贝得到的第二份报文转换成第三下游数据报文;将所述第三下游数据报文存储在缓冲区中并设置超时定时器;当所述超时定时器超时,向所述下游节点或所述用户终端发送所述第三下游数据报文。
在另一个实施例中,所述连接映射表中一个上游连接信息与一个下游连接信息对应,所述控制管理模块1403,还用于当在所述超时定时器超时之前接收到所述下游节点或所述用户终端返回的ACK报文时,删除所述缓冲区中存储的所述第三下游数据报文。
在另一个实施例中,所述第一接收模块1401,还用于接收所述上游节点重传的第三上 游数据报文,并对所述第三上游数据报文进行拷贝处理,所述第三上游数据报文的序号与所述第一上游数据报文的序号连续;
所述数据转发模块1402,还用于根据所述连接映射表,对拷贝得到的两份报文中的第一份报文进行转换处理,将转换得到的第四下游数据报文发送给所述下游节点或所述用户终端,并对基于所述第三上游数据报文拷贝得到的第二份报文进行控制管理。
在另一个实施例中,所述控制管理模块1403,还用于对基于所述第二上游数据报文拷贝得到的第二份报文进行乱序检查,并向所述上游节点发送针对所述第一上游数据报文的ACK报文。
在另一个实施例中,所述控制管理模块1403,还用于在数据转发模块1402将第四下游数据报文发送给所述下游节点或所述用户终端后,将基于所述第二上游数据报文拷贝得到的第二份报文转换成第五下游数据报文;将所述第五下游数据报文存储在缓冲区中并设置超时定时器;当所述超时定时器超时,向所述下游节点或所述用户终端发送所述第五下游数据报文。
在另一个实施例中,所述连接映射表中一个上游连接信息与一个下游连接信息对应,所述控制管理模块1403,还用于当在所述超时定时器超时之前接收到所述下游节点或所述用户终端返回的ACK报文时,删除所述缓冲区中存储的所述第五下游数据报文。
在另一个实施例中,所述控制管理模块1403,还用于若在所述第一接收模块1401接收到所述上游节点重传的所述第三上游数据报文之前,第二接收模块接收到所述下游节点或所述用户终端发送的M次重复ACK,则等待所述上游节点重传所述第三上游数据报文,所述M次重复ACK是针对所述第一上游数据报文的;
所述数据转发模块1402,还用于在接收到重传的所述第三上游数据报文后,执行根据所述连接映射表,对基于所述第三上游数据报文拷贝得到的两份报文中的第一份报文进行转换处理,将转换得到的第四下游数据报文发送给所述下游节点或所述用户终端的步骤。
在另一个实施例中,所述控制管理模块1403,还用于若在所述第一接收模块1401接收到所述上游节点重传的所述第三上游数据报文之后,第二接收模块接收到所述下游节点或所述用户终端发送的M次重复ACK,则将缓冲区中存储的与所述第三上游数据报文匹配的第六下游数据报文发送给所述下游节点或所述用户终端。
上述任一种可选方式可与本公开实施例相结合构成本公开的可选实施例。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
以上所述仅为本公开的可选实施例,并不用以限制本公开,凡在本公开的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本公开的保护范围之内。

Claims (24)

  1. 一种数据分发方法,所述方法应用于分发服务器,其特征在于,所述方法包括:
    连续接收上游节点发送的第一上游数据报文和第二上游数据报文;
    对所述第一上游数据报文进行拷贝处理,根据已建立的连接映射表,对拷贝得到的两份报文中的第一份报文进行转换处理,将转换得到的第一下游数据报文发送给下游节点或用户终端,并对基于所述第一上游数据报文拷贝得到的第二份报文进行控制管理;
    对所述第二上游数据报文进行拷贝处理,根据所述连接映射表,对拷贝得到的两份报文中的第一份报文进行转换处理,将转换得到的第二下游数据报文发送给所述下游节点或所述用户终端,并对基于所述第二上游数据报文拷贝得到的第二份报文进行控制管理;
    其中,所述连接映射表给出了上游连接信息与下游连接信息之间的映射关系。
  2. 根据权利要求1所述的方法,其特征在于,所述第一上游数据报文的序号与所述第二上游数据报文的序号不连续,所述第一上游数据报文先于所述第二上游数据报文接收到。
  3. 根据权利要求1所述的方法,其特征在于,所述连接映射表包括多个映射表项,每一个映射表项中给出了上游连接的N元组信息、与所述上游连接的N元组信息匹配的下游连接的N元组信息,所述上游连接与所述下游连接的初始序列号差值;
    所述对拷贝得到的两份报文中的第一份报文进行转换处理,包括:
    获取所述第一份报文中的N元组信息;
    基于所述第一份报文中的N元组信息,查询所述连接映射表,得到与所述第一份报文中的N元组信息匹配的目标映射表项;
    以所述目标映射表项中包括的目标下游连接的N元组信息,替换所述第一份报文中的N元组信息,并根据所述目标映射表项中包括的目标初始序列号差值以及所述第一份报文中携带的序列号,计算所述目标下游连接的序列号。
  4. 根据权利要求1或2所述的方法,其特征在于,所述对基于所述第一上游数据报文拷贝得到的第二份报文进行控制管理,包括:
    对基于所述第一上游数据报文拷贝得到的第二份报文进行乱序检查,并向所述上游节点发送针对所述第一上游数据报文的确认字符ACK报文。
  5. 根据权利要求4所述的方法,其特征在于,所述方法还包括:
    将基于所述第一上游数据报文拷贝得到的第二份报文转换成第三下游数据报文;
    将所述第三下游数据报文存储在缓冲区中并设置超时定时器;
    当所述超时定时器超时,向所述下游节点或所述用户终端发送所述第三下游数据报文。
  6. 根据权利要求5所述的方法,其特征在于,所述连接映射表中一个上游连接信息与一个下游连接信息对应,所述方法还包括:
    当在所述超时定时器超时之前接收到所述下游节点或所述用户终端返回的ACK报文时, 删除所述缓冲区中存储的所述第三下游数据报文。
  7. 根据权利要求1或2所述的方法,其特征在于,所述方法还包括:
    接收所述上游节点重传的第三上游数据报文,所述第三上游数据报文的序号与所述第一上游数据报文的序号连续;
    对所述第三上游数据报文进行拷贝处理,根据所述连接映射表,对拷贝得到的两份报文中的第一份报文进行转换处理,将转换得到的第四下游数据报文发送给所述下游节点或所述用户终端,并对基于所述第三上游数据报文拷贝得到的第二份报文进行控制管理。
  8. 根据权利要求2所述的方法,其特征在于,所述对基于所述第二上游数据报文拷贝得到的第二份报文进行控制管理,包括:
    对基于所述第二上游数据报文拷贝得到的第二份报文进行乱序检查,并向所述上游节点发送针对所述第一上游数据报文的ACK报文。
  9. 根据权利要求8所述的方法,其特征在于,所述方法还包括:
    在将第四下游数据报文发送给所述下游节点或所述用户终端后,将基于所述第二上游数据报文拷贝得到的第二份报文转换成第五下游数据报文;
    将所述第五下游数据报文存储在缓冲区中并设置超时定时器;
    当所述超时定时器超时,向所述下游节点或所述用户终端发送所述第五下游数据报文。
  10. 根据权利要求9所述的方法,其特征在于,所述连接映射表中一个上游连接信息与一个下游连接信息对应,所述方法还包括:
    当在所述超时定时器超时之前接收到所述下游节点或所述用户终端返回的ACK报文时,删除所述缓冲区中存储的所述第五下游数据报文。
  11. 根据权利要求7所述的方法,其特征在于,所述方法还包括:
    若在接收到所述上游节点重传的所述第三上游数据报文之前,接收到所述下游节点或所述用户终端发送的M次重复ACK,则等待所述上游节点重传所述第三上游数据报文,所述M次重复ACK是针对所述第一上游数据报文的;
    在接收到重传的所述第三上游数据报文后,执行所述对所述第三上游数据报文进行拷贝处理,根据所述连接映射表,对拷贝得到的两份报文中的第一份报文进行转换处理,将转换得到的第四下游数据报文发送给所述下游节点或所述用户终端的步骤。
  12. 根据权利要求7所述的方法,其特征在于,所述方法还包括:
    若在接收到所述上游节点重传的所述第三上游数据报文之后,接收到所述下游节点或所述用户终端发送的M次重复ACK,则将缓冲区中存储的与所述第三上游数据报文匹配的第六下游数据报文发送给所述下游节点或所述用户终端。
  13. 一种分发服务器,其特征在于,所述服务器包括:
    第一接收模块,用于连续接收上游节点发送的第一上游数据报文和第二上游数据报文,并对所述第一上游数据报文进行拷贝处理以及对所述第二上游数据报文进行拷贝处理;
    数据转发模块,用于根据已建立的连接映射表,对基于所述第一上游数据报文拷贝得到的两份报文中的第一份报文进行转换处理,将转换得到的第一下游数据报文发送给下游节点或用户终端;
    控制管理模块,用于对基于所述第一上游数据报文拷贝得到的第二份报文进行控制管理;
    所述数据转发模块,还用于根据所述连接映射表,对基于所述第二上游数据报文拷贝得到的两份报文中的第一份报文进行转换处理,将转换得到的第二下游数据报文发送给所述下游节点或所述用户终端;
    所述控制管理模块,还用于对基于所述第二上游数据报文拷贝得到的第二份报文进行控制管理;
    其中,所述连接映射表给出了上游连接信息与下游连接信息之间的映射关系。
  14. 根据权利要求13所述的服务器,其特征在于,所述第一上游数据报文的序号与所述第二上游数据报文的序号不连续,所述第一上游数据报文先于所述第二上游数据报文接收到。
  15. 根据权利要求13所述的服务器,其特征在于,所述连接映射表包括多个映射表项,每一个映射表项中给出了上游连接的N元组信息、与所述上游连接的N元组信息匹配的下游连接的N元组信息,所述上游连接与所述下游连接的初始序列号差值;
    所述数据转发模块,还用于获取所述第一份报文中的N元组信息;基于所述第一份报文中的N元组信息,查询所述连接映射表,得到与所述第一份报文中的N元组信息匹配的目标映射表项;以所述目标映射表项中包括的目标下游连接的N元组信息,替换所述第一份报文中的N元组信息,并根据所述目标映射表项中包括的目标初始序列号差值以及所述第一份报文中携带的序列号,计算所述目标下游连接的序列号。
  16. 根据权利要求13或14所述的服务器,其特征在于,所述控制管理模块,还用于对基于所述第一上游数据报文拷贝得到的第二份报文进行乱序检查,并向所述上游节点发送针对所述第一上游数据报文的确认字符ACK报文。
  17. 根据权利要求16所述的服务器,其特征在于,所述控制管理模块,还用于将基于所述第一上游数据报文拷贝得到的第二份报文转换成第三下游数据报文;将所述第三下游数据报文存储在缓冲区中并设置超时定时器;当所述超时定时器超时,向所述下游节点或所述用户终端发送所述第三下游数据报文。
  18. 根据权利要求17所述的服务器,其特征在于,所述连接映射表中一个上游连接信息与一个下游连接信息对应,
    所述控制管理模块,还用于当在所述超时定时器超时之前接收到所述下游节点或所述用户终端返回的ACK报文时,删除所述缓冲区中存储的所述第三下游数据报文。
  19. 根据权利要求13或14所述的服务器,其特征在于,所述第一接收模块,还用于接收所述上游节点重传的第三上游数据报文,并对所述第三上游数据报文进行拷贝处理,所述第三上游数据报文的序号与所述第一上游数据报文的序号连续;
    所述数据转发模块,还用于根据所述连接映射表,对拷贝得到的两份报文中的第一份报文进行转换处理,将转换得到的第四下游数据报文发送给所述下游节点或所述用户终端,并对基于所述第三上游数据报文拷贝得到的第二份报文进行控制管理。
  20. 根据权利要求14所述的服务器,其特征在于,所述控制管理模块,还用于对基于所述第二上游数据报文拷贝得到的第二份报文进行乱序检查,并向所述上游节点发送针对所述第一上游数据报文的ACK报文。
  21. 根据权利要求20所述的服务器,其特征在于,所述控制管理模块,还用于在所述数据转发模块将第四下游数据报文发送给所述下游节点或所述用户终端后,将基于所述第二上游数据报文拷贝得到的第二份报文转换成第五下游数据报文;将所述第五下游数据报文存储在缓冲区中并设置超时定时器;当所述超时定时器超时,向所述下游节点或所述用户终端发送所述第五下游数据报文。
  22. 根据权利要求21所述的服务器,其特征在于,所述连接映射表中一个上游连接信息与一个下游连接信息对应,
    所述控制管理模块,还用于当在所述超时定时器超时之前接收到所述下游节点或所述用户终端返回的ACK报文时,删除所述缓冲区中存储的所述第五下游数据报文。
  23. 根据权利要求19所述的服务器,其特征在于,所述控制管理模块,还用于若在所述第一接收模块接收到所述上游节点重传的所述第三上游数据报文之前,第二接收模块接收到所述下游节点或所述用户终端发送的M次重复ACK,则等待所述上游节点重传所述第三上游数据报文,所述M次重复ACK是针对所述第一上游数据报文的;
    所述数据转发模块,还用于在接收到重传的所述第三上游数据报文后,执行根据所述连接映射表,对基于所述第三上游数据报文拷贝得到的两份报文中的第一份报文进行转换处理,将转换得到的第四下游数据报文发送给所述下游节点或所述用户终端的步骤。
  24. 根据权利要求19所述的服务器,其特征在于,所述控制管理模块,还用于若在所述第一接收模块接收到所述上游节点重传的所述第三上游数据报文之后,第二接收模块接收到所述下游节点或所述用户终端发送的M次重复ACK,则将缓冲区中存储的与所述第三上游数据报文匹配的第六下游数据报文发送给所述下游节点或所述用户终端。
PCT/CN2018/112595 2017-11-24 2018-10-30 数据分发方法以及分发服务器 Ceased WO2019100912A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP2020521550A JP6994110B2 (ja) 2017-11-24 2018-10-30 データ配信方法及び配信サーバ
KR1020207009610A KR102324919B1 (ko) 2017-11-24 2018-10-30 데이터 분배 방법 및 분배 서버
EP18881561.7A EP3672138A4 (en) 2017-11-24 2018-10-30 DATA DISTRIBUTION PROCESS AND DISTRIBUTION SERVER
US16/820,270 US11134001B2 (en) 2017-11-24 2020-03-16 Data distribution method and distribution server

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711189288.1A CN109842567B (zh) 2017-11-24 2017-11-24 数据分发方法以及分发服务器
CN201711189288.1 2017-11-24

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/820,270 Continuation US11134001B2 (en) 2017-11-24 2020-03-16 Data distribution method and distribution server

Publications (1)

Publication Number Publication Date
WO2019100912A1 true WO2019100912A1 (zh) 2019-05-31

Family

ID=66631806

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/112595 Ceased WO2019100912A1 (zh) 2017-11-24 2018-10-30 数据分发方法以及分发服务器

Country Status (6)

Country Link
US (1) US11134001B2 (zh)
EP (1) EP3672138A4 (zh)
JP (1) JP6994110B2 (zh)
KR (1) KR102324919B1 (zh)
CN (1) CN109842567B (zh)
WO (1) WO2019100912A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113726827A (zh) * 2020-05-25 2021-11-30 北京同邦卓益科技有限公司 基于分布式集群的数据包处理方法和装置
CN114339268A (zh) * 2020-10-10 2022-04-12 腾讯科技(深圳)有限公司 一种直播数据处理方法、装置和计算机可读存储介质

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111614968B (zh) * 2020-05-11 2021-12-17 厦门潭宏信息科技有限公司 一种直播方法、设备及存储介质
CN114007087B (zh) * 2020-07-28 2023-04-11 华为技术有限公司 一种媒体流切换方法及装置
CN114297288B (zh) * 2020-09-22 2026-02-06 华为云计算技术有限公司 一种次级内容分发网络cdn、数据提供方法和存储介质
CN113472784A (zh) * 2021-06-30 2021-10-01 奥特酷智能科技(南京)有限公司 一种基于数据分发服务的分离式dds协议栈架构
CN113849526B (zh) * 2021-08-24 2025-09-09 天翼数字生活科技有限公司 一种基于两级缓存的跨网络数据同步及异常处理方法

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101132269A (zh) * 2007-07-26 2008-02-27 中兴通讯股份有限公司 数据同步方法及使用该方法的iptv内容分发网络系统
CN103119958A (zh) * 2010-07-20 2013-05-22 夏普株式会社 内容分发装置、内容重放装置、内容分发系统、内容分发装置的控制方法、控制程序以及记录介质
US8782285B1 (en) * 2013-12-06 2014-07-15 Limelight Networks, Inc. Lazy transcoding and re-transcoding of media objects in an online video platform

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7110404B1 (en) * 2001-09-04 2006-09-19 Cisco Technology, Inc. System and method for sending a packet to multiple destinations using a pipeline network processor
US7512084B2 (en) 2001-11-28 2009-03-31 Nokia Corporation Event driven filter monitoring for IP multicast services
CN100553229C (zh) * 2007-01-24 2009-10-21 中国科学院计算机网络信息中心 一种半覆盖自组织的动态组播路由方法
JP2009055418A (ja) * 2007-08-28 2009-03-12 Nec Corp 通信システム、中継装置、端末、及び中継処理方法並びにそのプログラム
CN101291295B (zh) * 2008-06-10 2010-11-24 北京科技大学 一种基于间断连通自组织网络延时有限的概率路由方法
EP2537294B1 (en) * 2010-02-16 2020-04-08 Huawei Technologies Co. Ltd. Rate-varying multicast transmission for clock distribution in packet networks
WO2012132283A1 (ja) * 2011-03-28 2012-10-04 日本電気株式会社 通信装置およびその通信制御方法
US8913887B2 (en) * 2012-05-30 2014-12-16 Broadcom Corporation Passive optical fiber plant analysis
JP6236933B2 (ja) * 2013-07-02 2017-11-29 富士通株式会社 中継装置
WO2015048999A1 (en) * 2013-10-03 2015-04-09 Teclo Networks Ag Method and proxy node for source to destination packet transfer
JP6062388B2 (ja) * 2014-03-31 2017-01-18 株式会社日立製作所 通信システム、通信制御方法および制御装置
CN103997500A (zh) * 2014-06-04 2014-08-20 西北工业大学 一种轻量级实时tcp/ip协议栈的实现方法
US9397939B2 (en) * 2014-06-24 2016-07-19 International Business Machines Corporation Hybrid approach for performance enhancing proxies
US10135956B2 (en) * 2014-11-20 2018-11-20 Akamai Technologies, Inc. Hardware-based packet forwarding for the transport layer

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101132269A (zh) * 2007-07-26 2008-02-27 中兴通讯股份有限公司 数据同步方法及使用该方法的iptv内容分发网络系统
CN103119958A (zh) * 2010-07-20 2013-05-22 夏普株式会社 内容分发装置、内容重放装置、内容分发系统、内容分发装置的控制方法、控制程序以及记录介质
US8782285B1 (en) * 2013-12-06 2014-07-15 Limelight Networks, Inc. Lazy transcoding and re-transcoding of media objects in an online video platform

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3672138A4

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113726827A (zh) * 2020-05-25 2021-11-30 北京同邦卓益科技有限公司 基于分布式集群的数据包处理方法和装置
CN114339268A (zh) * 2020-10-10 2022-04-12 腾讯科技(深圳)有限公司 一种直播数据处理方法、装置和计算机可读存储介质
CN114339268B (zh) * 2020-10-10 2023-08-29 腾讯科技(深圳)有限公司 一种直播数据处理方法、装置和计算机可读存储介质

Also Published As

Publication number Publication date
US11134001B2 (en) 2021-09-28
CN109842567B (zh) 2020-12-25
US20200220800A1 (en) 2020-07-09
JP6994110B2 (ja) 2022-01-14
KR20200051696A (ko) 2020-05-13
EP3672138A4 (en) 2020-12-02
EP3672138A1 (en) 2020-06-24
CN109842567A (zh) 2019-06-04
JP2020537454A (ja) 2020-12-17
KR102324919B1 (ko) 2021-11-10

Similar Documents

Publication Publication Date Title
WO2019100912A1 (zh) 数据分发方法以及分发服务器
EP2719133B1 (en) A generalized dual-mode data forwarding plane for information-centric network
US9094464B1 (en) Connection digest for accelerating web traffic
CN106878310B (zh) 命名数据网络下一种实时流数据分发的方法
US20150215661A1 (en) System And Method For Distributing Live Broadcast Content
JP2020537454A5 (zh)
CN105359457A (zh) 用于在icn上的大规模会议的多层推送混合服务控制架构
WO2013029569A1 (en) A Generalized Dual-Mode Data Forwarding Plane for Information-Centric Network
CN108418789B (zh) 一种基于WebRTC的通信系统及其通信方法、信令服务器
CN107135266B (zh) Http代理框架安全数据传输方法
CN106717015A (zh) 提供冗余数据流量控制特性计算器网络及相关方法
KR101600060B1 (ko) 다중캐스트 네트워크에서 sctp를 위한 프로토콜 부스터
WO2015027429A1 (zh) 聚合传输的方法、装置和系统以及网络服务器和用户设备
WO2017219813A1 (zh) 一种流量处理方法及透明缓存系统
CN103747083A (zh) 一种基于ccn的内容推送方法
WO2019218474A1 (zh) 一种视频通话服务的响应方法及系统
CN115150364A (zh) 支持多通信协议并发通信的业务请求处理系统和方法
CN105531967A (zh) 一种报文传输方法、设备及通信系统
WO2022100546A1 (zh) 数据传输方法和通信装置
CN102439946B (zh) 数据传输方法和设备
CN105897853A (zh) 一种对等网络连接方法及装置
CN107231567B (zh) 一种报文传输方法、装置及系统
JP2023033600A (ja) コンテンツ配信システム、ユニキャストマルチキャスト変換装置、コンテンツ配信方法及びコンテンツ配信プログラム
WO2012171315A1 (zh) 一种无线网络控制器分组域内容缓存系统及其实现方法
JP2010504688A (ja) ネットワーク・プロトコルスタックのハンドオフおよび最適化を実装するための方法およびモジュール

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: 18881561

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2018881561

Country of ref document: EP

Effective date: 20200317

ENP Entry into the national phase

Ref document number: 20207009610

Country of ref document: KR

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 2020521550

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE