CN104022961A - Data transmission method, apparatus and system - Google Patents
Data transmission method, apparatus and system Download PDFInfo
- Publication number
- CN104022961A CN104022961A CN201410234515.8A CN201410234515A CN104022961A CN 104022961 A CN104022961 A CN 104022961A CN 201410234515 A CN201410234515 A CN 201410234515A CN 104022961 A CN104022961 A CN 104022961A
- Authority
- CN
- China
- Prior art keywords
- quota
- data
- request
- switch
- data transmission
- 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.)
- Pending
Links
- 230000005540 biological transmission Effects 0.000 title claims abstract description 353
- 238000000034 method Methods 0.000 title claims abstract description 149
- 230000004044 response Effects 0.000 claims abstract description 186
- 230000001960 triggered effect Effects 0.000 claims description 29
- 238000004891 communication Methods 0.000 abstract description 52
- 230000003139 buffering effect Effects 0.000 abstract 1
- 238000005516 engineering process Methods 0.000 abstract 1
- 238000010586 diagram Methods 0.000 description 35
- 230000003993 interaction Effects 0.000 description 17
- 230000008569 process Effects 0.000 description 6
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000005538 encapsulation Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 230000008901 benefit Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
- Communication Control (AREA)
Abstract
The invention relates to the field of communications, and provides a data transmission method, apparatus and system, for solving the problem of incapability of ensuring data loss-free transmission by use of a conventional technology. The method comprises: a source data end sending a quota request, wherein the quota request is used for requesting a road switch and an object data end to distribute a quota to data, which needs to be sent to the object data end, of a source data end, the quota is used for buffering data, and the road switch comprises all switches needing to be passed from the source data end to the object data end; the source data end receiving a quota response corresponding to the quota request, wherein the quota response is used for representing whether the road switch and the object data end distribute the quota to the data; and if the quota response represents that the road switch and the object data end distribute the quota to the data, the source data end sending the data.
Description
Technical Field
The present invention relates to the field of communications, and in particular, to a data transmission method, apparatus, and system.
Background
Data center Ethernet, also known as CEE (Converged Enhanced Ethernet). Currently, in the CEE, data transmission is mainly realized by an 802.1Qbb PFC (priority flow Control standard) protocol and an 802.1Qau QCN (quantum connectivity Notification end-to-end Congestion management standard) protocol.
In the prior art, the PFC defines a priority flow control, specifically, 8 virtual channels are divided on one physical link, and each virtual channel is respectively assigned with a priority, so that the virtual channels with different priorities can be used to transmit different data. When the network is congested, the receiving end may transmit an open frame/close frame on a virtual channel having a specific priority to continue/suppress transmission of data on the virtual channel having the specific priority, thereby guaranteeing transmission of data of a high priority. The QCN defines a congestion notification mechanism, and specifically, when congestion occurs in a network, a congestion source may notify a transmission source of a source data end to reduce a transmission rate, so as to attempt to solve network congestion and further attempt to achieve lossless data transmission.
However, if data is transmitted through the PFC, when the network is congested, since all data transmitted by the source data end where the transmitted data passes through the congestion point is inhibited from being transmitted, a part of data buffered by the source data end may overflow, and thus lossless transmission of data cannot be guaranteed; if data is transmitted through the QCN, a delay exists between a source data end and a congested point, so that a part of data buffered by the congested point may overflow, and lossless transmission of the data cannot be guaranteed.
Disclosure of Invention
The embodiment of the invention provides a data transmission method, a device and a system, which solve the problem that the prior art can not ensure lossless data transmission.
In order to achieve the above purpose, the embodiment of the invention adopts the following technical scheme:
in a first aspect, the present invention provides a data transmission method, including:
a source data end sends a quota request, wherein the quota request is used for requesting a switch along the way and a target data end to allocate a quota for data needing to be sent to the target data end by the source data end, the quota is used for caching the data, and the switch along the way comprises all switches needing to pass from the source data end to the target data end;
the source data end receives a quota response corresponding to the quota request, wherein the quota response is used for representing whether the marginal switch and the target data end distribute the quota for the data or not;
and if the quota response represents that the switch along the way and the target data end distribute the quota for the data, the source data end sends the data.
In a first possible implementation manner of the first aspect, the method further includes:
and if the quota response represents that one switch in the switches along the way or the target data end does not distribute the quota for the data, the source data end resends the quota request.
With reference to the first aspect or the first possible implementation manner of the first aspect, in a second possible implementation manner, the quota response is a quota grant or a quota denial, where,
the quota grant is used for characterizing the switch along the way and the target data end to allocate the quota for the data, and the quota refusal is used for characterizing one switch in the switch along the way or the target data end not to allocate the quota for the data.
With reference to the first possible implementation manner of the first aspect, in a third possible implementation manner, the data is a packet queue composed of a plurality of ethernet packets, the quota request includes an application quota amount,
wherein, the resending the quota request by the source data side includes:
the source data terminal subtracts the quota applying amount required by a first Ethernet message from the quota applying amount in the quota request to obtain a first quota applying amount, wherein the first Ethernet message is a message positioned at the tail of the message queue;
and the source data end resends the quota request, wherein the quota request comprises the first quota application amount.
With reference to the third possible implementation manner of the first aspect, in a fourth possible implementation manner, if the quota application amount in the quota request is an amount of quota application required by a second ethernet packet, and the second ethernet packet is a packet located at the head of the packet queue, the retransmitting, by the source data end, the quota request includes:
and within a time after the source data end receives the quota refusal every time, the source data end resends the quota request.
With reference to the first possible implementation manner of the first aspect, in a fifth possible implementation manner, the data includes a plurality of ethernet packets, the quota request includes an application quota amount,
wherein, the resending the quota request by the source data side includes:
and the source data end resends the quota request, wherein the quota request comprises the quota applying amount required by the Ethernet messages.
In a sixth possible implementation manner of the first aspect, the method further includes:
and within a first preset time after the source data end sends the quota request, if the source data end does not receive the quota response, the source data end resends the quota request after the first preset time.
With reference to the first aspect or any one implementation manner of the first possible implementation manner to the sixth possible implementation manner of the first aspect, in a seventh possible implementation manner, the sending, by the source data end, the data includes:
and the source data end sends the data within a second preset time after receiving the quota response.
With reference to the first aspect or any implementation manner of the second possible implementation manner to the seventh possible implementation manner of the first aspect, in an eighth possible implementation manner, before the source data side sends the quota request, the method further includes:
the source data end receives a trigger quota request, and the trigger quota request is used for triggering the source data end to send the quota request;
wherein, the source data side sends a quota request, including:
and the source data terminal sends the quota request according to the trigger quota request.
With reference to the eighth possible implementation manner of the first aspect, in a ninth possible implementation manner,
the triggered quota request includes an idle quota amount and a valid time of the triggered quota request.
With reference to any one implementation manner of the third possible implementation manner to the ninth possible implementation manner of the first aspect, in a tenth possible implementation manner,
the quota request also includes the valid time of the application quota amount, and is used for requesting the switch along the way and the target data terminal to reserve the application quota amount for the valid time of the application quota amount.
In an eleventh possible implementation manner of the first aspect, when the data cached in the source data end occupies the cache of the source data end more than a first preset threshold, the quota request is an emergency quota request,
the source data terminal sends a quota request; the receiving, by the source data end, a quota response corresponding to the quota request includes:
the source data terminal sends the emergency quota request;
the source data end receives the quota response corresponding to the emergency quota request.
In a second aspect, the present invention further provides a data transmission method, including:
the method comprises the steps that a first switch receives a quota request, the quota request is used for requesting a route switch and a target data end to be data distribution quotas of a source data end to be sent to the target data end, the quotas are used for caching the data, the route switch comprises all switches needing to pass from the source data end to the target data end, and the first switch is one of the route switches;
if the first switch has an idle quota, the first switch:
allocating the quota for the data according to the quota request, and forwarding the quota request;
receiving a quota response corresponding to the quota request, and forwarding the quota response, wherein the quota response is used for representing whether the marginal switch and the target data end distribute the quota for the data;
and receiving the data and forwarding the data, wherein the data is sent by the source data end when the quota response represents that the switch along the way and the target data end distribute the quota for the data.
In a first possible implementation manner of the second aspect, the method further includes:
if the first switch does not have an idle quota, the first switch replies a first quota rejection corresponding to the quota request and discards the quota request, wherein the first quota rejection is used for representing that the first switch does not allocate the quota for the data.
With reference to the foregoing second aspect or the first possible implementation manner of the second aspect, in a second possible implementation manner,
the quota response is a quota grant or a quota deny, wherein,
the quota grant is used for characterizing the switch along the way and the target data end to allocate the quota for the data, and the quota refusal is used for characterizing one switch in the switch along the way or the target data end not to allocate the quota for the data.
With reference to the second aspect or any implementation manner of the first possible implementation manner to the second possible implementation manner of the second aspect, in a third possible implementation manner, after the first switch allocates the quota to the data according to the quota request, the method further includes:
after a first preset time, the first switch checks whether the data is cached in the quota;
and if the data is not cached in the quota, the first switch recovers the quota.
With reference to the second aspect or any implementation manner of the first possible implementation manner to the third possible implementation manner of the second aspect, in a fourth possible implementation manner, after the first switch forwards the data, the method further includes:
the first switch reclaims the quota.
With reference to any implementation manner of the second possible implementation manner to any implementation manner of the fourth possible implementation manner of the second aspect, in a fifth possible implementation manner, if the quota response is the quota refusal, the method further includes:
the first switch reclaims the quota.
With reference to the second aspect or any implementation manner of the second possible implementation manner to the fifth possible implementation manner of the second aspect, in a sixth possible implementation manner, before the first switch receives the quota request, the method further includes:
the first switch receives a trigger quota request, wherein the trigger quota request is used for triggering the source data terminal to send the quota request, and the trigger quota request comprises an idle quota amount and the effective time of the trigger quota request;
the first switch forwards the triggered quota request.
With reference to the second aspect or any one implementation manner of the first possible implementation manner to the sixth possible implementation manner of the second aspect, in a seventh possible implementation manner,
the quota request comprises an application quota amount and effective time of the application quota amount, and is used for requesting the valid time of the application quota amount to be reserved by the switch along the way and the target data terminal.
In an eighth possible implementation manner of the second aspect, the receiving, by the first switch, a quota request includes:
the first switch receives an emergency quota request, and the emergency quota request is sent by the source data terminal when the data cached in the source data terminal occupies a cache of the source data terminal and is greater than a first preset threshold value.
With reference to the eighth possible implementation manner of the second aspect, in a ninth possible implementation manner, the method further includes:
if the first switch has no idle quota, the first switch:
recording the emergency quota request, and forwarding the emergency quota request;
receiving the quota response corresponding to the emergency quota request;
when an idle quota appears in the first switch, allocating the quota for the data according to the emergency quota request;
when the quota response characterizes the switch along the way and the target data terminal to allocate the quota for the data, forwarding the quota response, receiving the data, and forwarding the data, or,
and when the quota response represents that the target data end does not distribute the quota for the data, forwarding the quota response and recovering the quota.
With reference to the ninth possible implementation manner of the second aspect, in a tenth possible implementation manner, the method further includes:
when the quota response represents that all switches required to pass between the first switch and the target data end allocate the quota for the data, and the first switch does not allocate the quota for the data, the first switch,
setting a quota allocation identifier according to the quota response, and discarding the quota response, where the quota allocation identifier is used to identify all switches and the target data end that need to pass between the first switch and the target data end to allocate the quota for the data,
after waiting for an idle quota to appear in the first switch, allocating the quota for the data according to the emergency quota request,
generating a quota grant and sending the quota grant, the quota grant being used to characterize the first switch, all switches that need to pass between the first switch and the target data end, and the target data end to allocate the quota for the data,
receiving the data and forwarding the data; or,
when the quota response represents that the target data end does not allocate the quota for the data and the first switch does not allocate the quota for the data, the first switch forwards the quota response and discards the emergency quota request.
In a third aspect, the present invention further provides a data transmission method, including:
a target data end receives a quota request, wherein the quota request is used for requesting a switch along the way and the target data end to distribute quota for data which needs to be sent to the target data end by a source data end, the quota is used for caching the data, and the switch along the way comprises all switches which need to pass from the source data end to the target data end;
if the target data end has an idle quota, the target data end allocates the quota for the data according to the quota request, replies a quota grant corresponding to the quota request, and receives the data, wherein the quota grant is used for representing that the switch along the way and the target data end allocate the quota for the data.
In a first possible implementation manner of the third aspect, the method further includes:
if the target data end has no idle quota, replying quota refusal by the target data end, wherein the quota refusal is used for representing that the target data end does not distribute the quota for the data.
With reference to the third aspect or the first possible implementation manner of the third aspect, in a second possible implementation manner, after the target data end allocates the quota to the data according to the quota request, the method further includes:
after a first preset time, the target data terminal checks whether the data is cached in the quota;
and if the data is not cached in the quota, the target data end recovers the quota.
With reference to the third aspect or any implementation manner of the first possible implementation manner to the second possible implementation manner of the third aspect, in a third possible implementation manner, after the target data end receives the data, the method further includes:
the target data terminal saves the data to a local memory;
and the target data end recovers the quota.
With reference to the third aspect or any implementation manner of the second possible implementation manner to the third possible implementation manner of the third aspect, in a fourth possible implementation manner, before the target data end receives the quota request, the method further includes:
and the target data end sends a trigger quota request, and the trigger quota request is used for triggering the source data end to send the quota request.
With reference to the fourth possible implementation manner of the third aspect, in a fifth possible implementation manner,
the triggered quota request includes an idle quota amount and a valid time of the triggered quota request.
With reference to the third aspect or any one implementation manner of the first possible implementation manner to the fifth possible implementation manner of the third aspect, in a sixth possible implementation manner,
the quota request comprises an application quota amount and effective time of the application quota amount, and is used for requesting the valid time of the application quota amount to be reserved by the switch along the way and the target data terminal.
With reference to the third aspect or any implementation manner of the first possible implementation manner to the third possible implementation manner of the third aspect, in a seventh possible implementation manner, the receiving, by the target data end, a quota request includes:
and the target data end receives an emergency quota request, and the emergency quota request is sent by the source data end when the data cached in the source data end occupies the cache of the source data end and is greater than a first preset threshold value.
In a fourth aspect, the present invention provides a data transmission apparatus, including:
a sending unit, configured to send a quota request, where the quota request is used to request a switch along a route and a target data end to allocate a quota for data that needs to be sent to the target data end by the data transmission device, where the quota is used to cache the data, and the switch along the route includes all switches that need to pass from the data transmission device to the target data end;
a receiving unit, configured to receive a quota response corresponding to the quota request sent by the sending unit, where the quota response is used to characterize whether the switch and the target data end along the route allocate the quota for the data;
the sending unit is further configured to send the data if the quota response received by the receiving unit represents that the quota is allocated to the data by the switch along the way and the target data end.
In a first possible implementation form of the fourth aspect,
the sending unit is further configured to resend the quota request if the quota response received by the receiving unit indicates that one switch in the switches along the way or the target data end does not allocate the quota for the data.
With reference to the foregoing fourth aspect or the first possible implementation manner of the fourth aspect, in a second possible implementation manner,
the quota response received by the receiving unit is a quota grant or a quota denial, wherein,
the quota grant is used for characterizing the switch along the way and the target data end to allocate the quota for the data, and the quota refusal is used for characterizing one switch in the switch along the way or the target data end not to allocate the quota for the data.
With reference to the first possible implementation manner of the fourth aspect, in a third possible implementation manner, the data transmission apparatus further includes a processing unit, the data is a packet queue composed of a plurality of ethernet packets, a quota request sent by the sending unit includes a quota application amount,
the processing unit is configured to subtract an applied quota amount required by a first ethernet packet from an applied quota amount in the quota request to obtain a first applied quota amount, where the first ethernet packet is a packet located at the tail of the packet queue;
the sending unit is specifically configured to resend the quota request, where the quota request includes the first application quota amount.
With reference to the third possible implementation manner of the fourth aspect, in a fourth possible implementation manner,
the sending unit is specifically configured to, if the quota applying amount in the quota request is the quota applying amount required by the second ethernet packet, and the second ethernet packet is a packet located at the head of the packet queue, resend the quota request within a time after the receiving unit receives the quota refusal each time.
With reference to the first possible implementation manner of the fourth aspect, in a fifth possible implementation manner, the data includes a plurality of ethernet packets, the quota request sent by the sending unit includes an amount of quota application,
the sending unit is specifically configured to resend the quota request, where the quota request includes an amount of quota application required by the multiple ethernet packets.
In a sixth possible implementation form of the fourth aspect,
the sending unit is further configured to, within a first preset time after the quota request is sent, if the receiving unit does not receive the quota response, resend the quota request after the first preset time.
With reference to the fourth aspect or any one implementation manner of the first possible implementation manner to the sixth possible implementation manner of the fourth aspect, in a seventh possible implementation manner,
the sending unit is specifically configured to send the data within a second preset time after the receiving unit receives the quota response.
With reference to the fourth aspect or any one implementation manner of the second possible implementation manner to the seventh possible implementation manner of the fourth aspect, in an eighth possible implementation manner,
the receiving unit is further configured to receive a trigger quota request before the sending unit sends a quota request, where the trigger quota request is used to trigger the data transmission apparatus to send the quota request;
the sending unit is specifically configured to send the quota request according to the triggered quota request received by the receiving unit.
With reference to the eighth possible implementation manner of the fourth aspect, in a ninth possible implementation manner,
the triggered quota request received by the receiving unit includes an idle quota amount and an effective time of the triggered quota request.
With reference to any one implementation manner of the third possible implementation manner to the ninth possible implementation manner of the fourth aspect, in a tenth possible implementation manner,
the quota request sent by the sending unit further includes valid time of the application quota amount, and is used for requesting the switch along the way and the target data terminal to reserve the application quota amount for the valid time of the application quota amount.
In an eleventh possible implementation form of the fourth aspect,
the sending unit is specifically configured to send an emergency quota request when the data cached in the data transmission device occupies the cache of the data transmission device and is greater than a first preset threshold;
the receiving unit is specifically configured to receive the quota response corresponding to the emergency quota request sent by the sending unit.
In a fifth aspect, the present invention further provides a data transmission apparatus, including:
a receiving unit, configured to receive a quota request, receive a quota response corresponding to the quota request, and receive data that needs to be sent by a source data end to a target data end, where the quota request is used to request a data transmission device and the target data end to allocate a quota for the data, the quota is used to cache the data, the data transmission device includes all data transmission devices that need to pass through from the source data end to the target data end, the data transmission device is one of the data transmission devices, the quota response is used to characterize whether the data transmission device and the target data end allocate the quota for the data, and the data is when the quota response characterizes that the data transmission device and the target data end allocate the quota for the data, the source data end sends the data;
an allocating unit, configured to allocate, if there is an idle quota in the data transmission apparatus, the quota to the data according to the quota request received by the receiving unit;
and the sending unit is used for forwarding the quota request, forwarding the quota response and forwarding the data.
In a first possible implementation manner of the fifth aspect, the data transmission apparatus further includes a discarding unit,
the sending unit is further configured to reply a first quota refusal corresponding to the quota request received by the receiving unit if no idle quota exists in the data transmission device, where the first quota refusal is used to characterize that the data transmission device does not allocate the quota for the data;
the discarding unit is configured to discard the quota request received by the receiving unit.
With reference to the foregoing fifth aspect or the first possible implementation manner of the fifth aspect, in a second possible implementation manner,
the quota response received by the receiving unit is a quota grant or a quota denial, wherein,
the quota grant is used for characterizing the data transmission device and the target data end to allocate the quota for the data, and the quota refusal is used for characterizing one data transmission device in the data transmission device or the target data end does not allocate the quota for the data.
With reference to the fifth aspect or any implementation manner of the first possible implementation manner to the second possible implementation manner of the fifth aspect, in a third possible implementation manner, the data transmission apparatus further includes a processing unit,
the processing unit is configured to check whether the data is cached in the quota after a first preset time after the allocating unit allocates the quota to the data according to the quota request, and recover the quota if the data is not cached in the quota.
With reference to the third possible implementation manner of the fifth aspect, in a fourth possible implementation manner,
the processing unit is further configured to recover the quota after the sending unit forwards the data.
With reference to the third possible implementation manner or the fourth possible implementation manner of the fifth aspect, in a fifth possible implementation manner,
the processing unit is further configured to recover the quota if the quota response received by the receiving unit is the quota refusal.
With reference to the fifth aspect or any implementation manner of the second possible implementation manner to the fifth possible implementation manner of the fifth aspect, in a sixth possible implementation manner,
the receiving unit is further configured to receive a trigger quota request before receiving a quota request, where the trigger quota request is used to trigger the source data terminal to send the quota request, and the trigger quota request includes an idle quota amount and an effective time of the trigger quota request;
the sending unit is further configured to forward the trigger quota request received by the receiving unit.
With reference to the fifth aspect or any one implementation manner of the first possible implementation manner to the sixth possible implementation manner of the fifth aspect, in a seventh possible implementation manner,
the quota request received by the receiving unit includes an application quota amount and valid time of the application quota amount, and is used for requesting the data transmission device and the target data terminal to reserve the application quota amount for the valid time of the application quota amount.
In an eighth possible implementation form of the fifth aspect,
the receiving unit is specifically configured to receive an emergency quota request, where the emergency quota request is sent by the source data end when data cached in the source data end occupies a cache of the source data end and is greater than a first preset threshold.
With reference to the eighth possible implementation manner of the fifth aspect, in a ninth possible implementation manner, the data transmission apparatus further includes a processing unit,
the processing unit is configured to record the emergency quota request received by the receiving unit if there is no free quota in the data transmission apparatus, and recover the quota when the quota response received by the receiving unit, corresponding to the emergency quota request, indicates that the target data end does not allocate the quota for the data;
the sending unit is further configured to forward the emergency quota request received by the receiving unit, and forward the quota response and forward the data when the quota response received by the receiving unit represents that the quota is allocated to the data by the data transmission device and the target data terminal along the way;
the receiving unit is further configured to receive the quota response and receive the data;
the allocating unit is further configured to allocate the quota to the data according to the emergency quota request received by the receiving unit when an idle quota occurs in the data transmission apparatus.
With reference to the ninth possible implementation manner of the fifth aspect, in a tenth possible implementation manner, the data transmission apparatus further includes a discarding unit,
the processing unit is further configured to, when the quota response received by the receiving unit indicates that all data transmission devices and the target data end that need to pass between the data transmission device and the target data end allocate the quota for the data, and the data transmission device does not allocate the quota for the data, set a quota allocation identifier according to the quota response, and generate a quota grant, where the quota allocation identifier is used to identify all switches and the target data end that need to pass between the data transmission device and the target data end to allocate the quota for the data, and the quota grant is used to indicate that all data transmission devices and the target data end that need to pass between the data transmission device and the target data end allocate the quota for the data, and the target data end allocates the quota for the data,
the discarding unit is configured to discard the quota response received by the receiving unit,
the allocating unit is further configured to allocate the quota to the data according to the emergency quota request received by the receiving unit after waiting for an idle quota appearing in the data transmission apparatus,
the receiving unit is further configured to receive the data,
the sending unit is further configured to send the quota grant and forward the data received by the receiving unit; or,
the sending unit is further configured to forward the quota response when the quota response indicates that the target data end does not allocate the quota for the data, and the data transmission apparatus does not allocate the quota for the data,
the discarding unit is configured to discard the emergency quota request received by the receiving unit.
In a sixth aspect, the present invention further provides a data transmission apparatus, including:
the system comprises a receiving unit, a quota requesting unit and a data transmission unit, wherein the receiving unit is used for receiving a quota request and receiving data which is required to be sent to the data transmission unit by a source data end, the quota request is used for requesting a switch along the route and the data transmission unit to distribute quota for the data, the quota is used for caching the data, and the switch along the route comprises all switches which are required to pass from the source data end to the data transmission unit;
an allocating unit, configured to allocate, if there is an idle quota in the data transmission apparatus, the quota to the data according to the quota request received by the receiving unit;
a sending unit, configured to reply a quota grant corresponding to the quota request received by the receiving unit, where the quota grant is used to characterize the along-the-road switch and the data transmission device to allocate the quota for the data.
In a first possible implementation form of the sixth aspect,
the sending unit is further configured to reply a quota rejection if there is no idle quota in the data transmission apparatus, where the quota rejection is used to characterize that the data transmission apparatus does not allocate the quota for the data.
With reference to the sixth aspect or the first possible implementation manner of the sixth aspect, in a second possible implementation manner, the data transmission apparatus further includes a processing unit,
the processing unit is configured to check whether the data is cached in the quota after a first preset time after the allocating unit allocates the quota to the data according to the quota request, and recover the quota if the data is not cached in the quota.
With reference to the second possible implementation manner of the sixth aspect, in a third possible implementation manner,
the processing unit is further configured to, after the receiving unit receives the data, store the data in a local memory, and recover the quota.
With reference to the sixth aspect or any implementation manner of the second possible implementation manner to the third possible implementation manner of the sixth aspect, in a fourth possible implementation manner,
the sending unit is further configured to send a trigger quota request before the receiving unit receives a quota request, where the trigger quota request is used to trigger the source data end to send the quota request.
With reference to the fourth possible implementation manner of the sixth aspect, in a fifth possible implementation manner,
the trigger quota request sent by the sending unit includes an idle quota amount and an effective time of the trigger quota request.
With reference to the sixth aspect or any one implementation manner of the first possible implementation manner to the fifth possible implementation manner of the sixth aspect, in a sixth possible implementation manner,
the quota request received by the receiving unit includes an application quota amount and valid time of the application quota amount, and is used for requesting the switch along the way and the data transmission device to reserve the application quota amount for the valid time of the application quota amount.
With reference to the sixth aspect or any one implementation manner of the first possible implementation manner to the third possible implementation manner of the sixth aspect, in a seventh possible implementation manner,
the receiving unit is specifically configured to receive an emergency quota request, where the emergency quota request is sent by the source data end when data cached in the source data end occupies a cache of the source data end and is greater than a first preset threshold.
In a seventh aspect, the present invention provides a data transmission system, including:
a data transmission device according to the above fourth aspect, at least one data transmission device according to the above fifth aspect, and a data transmission device according to the above sixth aspect,
the data transmission device of the fourth aspect is a source data end, the data transmission device of the fifth aspect is a switch, the data transmission device of the sixth aspect is a destination data end, and data is transmitted between the source data end and the destination data end through the switch.
The invention provides a data transmission method, a device and a system, wherein a quota request is sent through a source data end, the quota request is used for requesting a route switch and a target data end to allocate a quota for data which needs to be sent to the target data end by the source data end, the quota is used for caching the data, the route switch comprises all switches which need to pass from the source data end to the target data end, the source data end receives a quota response corresponding to the quota request, the quota response is used for representing whether the route switch and the target data end allocate a quota for the data, and if the quota response represents that the route switch and the target data end allocate a quota for the data, the source data end sends the data. According to the scheme, before the source data end transmits the data to the target data end, the source data end can apply quotas for the data to the switch along the way and the target data end, and the source data end starts to transmit the data after the quotas are distributed to the switch along the way and the target data end, so that compared with a method of managing after congestion is carried out when the data is transmitted in the prior art, the data transmission method provided by the embodiment of the invention solves the problem of network congestion and ensures lossless transmission of the data.
Drawings
Fig. 1 is a first flowchart of a data transmission method according to an embodiment of the present invention;
fig. 2 is a second flowchart of a data transmission method according to an embodiment of the present invention;
fig. 3 is a flowchart of a data transmission method according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a source data end sending a quota request according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a target data side replying to a quota grant according to an embodiment of the present invention;
fig. 6 is a schematic diagram illustrating a source data end transmitting data to a target data end according to an embodiment of the present invention;
fig. 7 is a first interaction diagram of a data transmission method according to an embodiment of the present invention;
fig. 8 is an interaction diagram ii of a data transmission method according to an embodiment of the present invention;
fig. 9 is a third interaction diagram of a data transmission method according to an embodiment of the present invention;
fig. 10 is an interaction diagram of a data transmission method according to a fourth embodiment of the present invention;
fig. 11 is an interaction diagram five of a data transmission method according to an embodiment of the present invention;
fig. 12 is a sixth interaction diagram of a data transmission method according to an embodiment of the present invention;
fig. 13 is a schematic diagram illustrating that a target data end sends a trigger quota request according to an embodiment of the present invention;
fig. 14 is an interaction diagram seven of a data transmission method according to an embodiment of the present invention;
fig. 15 is an interaction diagram eight of a data transmission method according to an embodiment of the present invention;
fig. 16 is a schematic diagram illustrating a source data end sending an emergency quota request according to an embodiment of the present invention;
fig. 17 is an interaction diagram nine of a data transmission method according to an embodiment of the present invention;
fig. 18 is an interaction diagram ten of a data transmission method according to an embodiment of the present invention;
fig. 19 is an eleventh interaction diagram of a data transmission method according to an embodiment of the present invention;
fig. 20 is an interaction diagram twelve of a data transmission method according to an embodiment of the present invention;
fig. 21 is an interaction diagram thirteen of a data transmission method according to an embodiment of the present invention;
fig. 22 is a fourteenth interaction diagram of a data transmission method according to an embodiment of the present invention;
fig. 23 is an interaction diagram fifteen of a data transmission method according to an embodiment of the present invention;
fig. 24 is a sixteenth interaction diagram of a data transmission method according to an embodiment of the present invention;
fig. 25 is an interaction diagram seventeenth of a data transmission method according to an embodiment of the present invention;
fig. 26 is a first schematic structural diagram of a data transmission device 1 according to an embodiment of the present invention;
fig. 27 is a second schematic structural diagram of a data transmission device 1 according to an embodiment of the present invention;
fig. 28 is a first schematic structural diagram of a data transmission device 2 according to an embodiment of the present invention;
fig. 29 is a schematic structural diagram of a data transmission device 2 according to an embodiment of the present invention;
fig. 30 is a schematic structural diagram three of a data transmission device 2 according to an embodiment of the present invention;
fig. 31 is a fourth schematic structural diagram of a data transmission device 2 according to an embodiment of the present invention;
fig. 32 is a schematic structural diagram five of a data transmission device 2 according to an embodiment of the present invention;
fig. 33 is a first schematic structural diagram of a data transmission apparatus 3 according to an embodiment of the present invention;
fig. 34 is a schematic structural diagram of a data transmission device 3 according to an embodiment of the present invention;
fig. 35 is a schematic structural diagram of a source data end according to an embodiment of the present invention;
fig. 36 is a schematic structural diagram of a switch according to an embodiment of the present invention;
FIG. 37 is a block diagram of a target data end according to an embodiment of the present invention;
fig. 38 is a block diagram of a data transmission system according to an embodiment of the present invention.
Detailed Description
A data transmission method, an apparatus and a system provided in the embodiments of the present invention are clearly and completely described below with reference to the accompanying drawings.
Example one
An embodiment of the present invention provides a data transmission method, which relates to a source data end side, and as shown in fig. 1, the method may include:
s101, a source data end sends a quota request, the quota request is used for requesting a switch and a target data end along the way to distribute quota for data needing to be sent to the target data end by the source data end, the quota is used for caching the data needing to be sent to the target data end by the source data end, and the switch along the way comprises all switches needing to pass from the source data end to the target data end.
Before a source data end needs to transmit data to a target data end, the source data end can apply quota for the data to a transit switch and the target data end in advance, wherein the transit switch can comprise all switches which need to pass from the source data end to the target data end.
Specifically, the source data end may send a quota request to the next-stage switch located at the source data end, and if there is an idle quota in the next-stage switch, the next-stage switch may allocate a quota for the data that the source data end needs to send to the target data end according to the quota request, and forward the quota request to the target data end, and after sequentially allocating a quota by other switches along the way, the target data end may, after receiving the quota request, allocate a quota for the data if the target data end has an idle quota. The quota allocated to the data by the switch and the target data terminal along the way can be used for caching the data.
Further, the data that the source data end needs to send to the target data end may be a message queue formed by a plurality of ethernet messages. Specifically, each ethernet packet includes two parts, namely a header part and a payload part, where the header part may include address information of a source data end, a port number of a switch to be passed through, address information of a target data end, and the like; the payload portion may include the data to be transmitted. The address information of the source data end may include an IP (Internet Protocol, Protocol for interconnection between networks) address of the source data end, a Media Access Control (MAC) address of the source data end, and the like; accordingly, the address information of the target data end may include an IP address of the target data end, a MAC address of the target data end, and the like.
S102, the source data end receives quota response corresponding to the quota request, and the quota response is used for representing whether the switch and the target data end along the way distribute quota for the data.
After the target data end receives the quota request, the target data end can reply a quota response corresponding to the quota request to the switch on the way, the switch on the previous stage located at the target data end forwards the quota response, and the quota response is forwarded by other switches on the way in sequence until the quota response is forwarded to the source data end, namely the source data end receives the quota response. The quota response can be used for representing whether the switch along the way and the target data end are data allocation quotas which need to be sent to the target data end by the source data end, so that the source data end can determine whether to send the data which need to be sent to the target data end by the source data end through the quota response.
It should be noted that the quota response may be a quota grant or a quota deny. The quota permission is used for representing that the switch and the target data end along the way are data distribution quotas which need to be sent to the target data end by the source data end. Quota denial can be used to characterize that one switch or the target data end in switches along the way does not allocate a quota for data that the source data end needs to send to the target data end.
It can be understood that, after the target data end receives the quota request, if there is an idle quota in the target data end, the target data end may allocate a quota for the data that the source data end needs to send to the target data end according to the quota request, and reply a quota grant corresponding to the quota request; on the contrary, if there is no free quota in the target data end, the target data end can directly reply the quota rejection corresponding to the quota request.
S103, if the quota response represents that the switch and the target data end along the way distribute quota for the data, the source data end sends the data which is needed to be sent to the target data end by the source data end.
After the source data end receives the quota response, if the source data end knows that the quota response represents that the switch along the route and the target data end are both data which the source data end needs to send to the target data end and are allocated with quota, the source data end can directly send the data.
An embodiment of the present invention provides a data transmission method, which relates to an exchange side, and as shown in fig. 2, the method may include:
s201, a first switch receives a quota request, the quota request is used for requesting that a switch and a target data end along the way distribute quota for data which needs to be sent to the target data end by a source data end, the quota is used for caching the data, the switch along the way comprises all switches which need to pass from the source data end to the target data end, and the first switch is one switch in the switch along the way.
Before a source data end needs to transmit data to a target data end, the source data end can apply quota for the data to a transit switch and the target data end in advance, wherein the transit switch can comprise all switches which need to pass from the source data end to the target data end.
Specifically, a source data end sends a quota request, and the quota request is sequentially forwarded through switches at different levels behind the source data end in a switch along the way until the quota request is forwarded to a first switch, that is, the first switch receives the quota request, wherein the quota request can be used for requesting the switch along the way and a target data end to allocate a quota for data which needs to be sent to the target data end by the source data end, the quota can be used for caching data which needs to be sent to the target data end by the source data end, and the first switch is one switch in the switch along the way.
And S202, if the first switch has an idle quota, the first switch allocates a quota for the data according to the quota request and forwards the quota request.
After the first switch receives the quota request, if there is an idle quota in the first switch, the first switch may allocate a quota for data that needs to be sent to the target data end by the source data end according to the quota request, and continue to forward the quota request to the switches along the way, the switches at the next stage of the first switch are located, and forward the quota request after allocating quotas by other switches along the way between the switches at the next stage and the target data end in sequence, until the quota request is forwarded to the target data end.
And S203, the first switch receives a quota response corresponding to the quota request and forwards the quota response, wherein the quota response is used for representing whether the switch and the target data end along the way distribute quota for the data.
After the target data end receives the quota request, the target data end can reply a quota response corresponding to the quota request to the switch on the way, the switch on the upper stage at the target data end forwards the quota response, and sequentially forwards the quota response to all switches between the switch on the upper stage and the first switch until the quota response is forwarded to the first switch, namely the switch on the first stage receives the quota response and forwards the quota response to the switch on the way, the switch on the upper stage at the first switch sequentially forwards the quota response to other switches on the way between the switch on the upper stage and the source data end until the quota response is forwarded to the source data end. The quota response can be used for representing whether the switch along the way and the target data end are data allocation quotas which need to be sent to the target data end by the source data end.
And S204, when the quota response represents that the switch along the way and the target data end allocate quota for the data, the first switch receives the data and forwards the data.
After the first switch forwards the quota response, when the source data end receives the quota response and knows that the quota response represents that the switch along the way and the target data end allocate quotas for the source data end, the source data end can directly send data which are required to be sent to the target data end by the source data end, and forwards the data sequentially through the switch along the way until the data are forwarded to the first switch, that is, the first switch receives the data and continues to forward the data until the data are forwarded to the target data end, so that the source data end completes the transmission of the data.
An embodiment of the present invention provides a data transmission method, which relates to a target data end side, and as shown in fig. 3, the method may include:
s301, the target data end receives a quota request.
Before a source data end needs to transmit data to a target data end, the source data end can apply quota for the data to a transit switch and the target data end in advance, wherein the transit switch can comprise all switches which need to pass from the source data end to the target data end.
Specifically, the source data end sends a quota request, and forwards the quota request after allocating quotas through the switches along the way in sequence until the quota request is forwarded to the target data end. The quota request can be used for requesting the switch along the way and the target data end to allocate a quota for data which needs to be sent to the target data end by the source data end, and the quota can be used for caching the data which needs to be sent to the target data end by the source data end.
S302, if the target data end has an idle quota, the target data end allocates a quota for the data which needs to be sent to the target data end by the source data end according to the quota request, and replies a quota permission corresponding to the quota request.
After the target data end receives the quota request, if the target data end has an idle quota, the target data end can allocate a quota for the data which needs to be sent to the target data end by the source data end according to the received quota request, and reply a quota permission corresponding to the quota request.
Specifically, the target data end may reply the quota grant corresponding to the quota request to the switch along the way, and the switch at the upper stage located at the target data end forwards the quota grant, and then forwards the quota grant through the switches along the way until the quota grant is forwarded to the source data end. Therefore, the source data end can know that the quota is distributed to the data which needs to be transmitted to the target data end by the source data end through the switch along the way and the target data end according to the quota permission, and the source data end can directly send the data.
And S303, receiving the data by the target data terminal.
After a source data end sends data which needs to be sent to a target data end, the data are sequentially forwarded through a switch along the way until the data are forwarded to the target data end, and therefore the source data end completes the data transmission.
For example, assuming that a data center ethernet network includes a source data side, a switch, and a target data side, where there may be one or more switches, the embodiment of the present invention will now further describe a data transmission method provided by the embodiment of the present invention by taking a switch a as an example. Specifically, as shown in fig. 4, before the source data end needs to transmit data to the target data end, the source data end may send a quota request to the switch a, and if there is an idle quota in the switch a, the switch a may allocate a quota for the data that the source data end needs to send to the target data end, and forward the quota request to the target data end, as shown in fig. 5, if there is an idle quota in the target data end, the target data end may allocate a quota for the data that the source data end needs to send to the target data end, and reply a quota grant to the switch, and the switch forwards the quota grant to the source data end, so that the source data end may know, according to the quota grant, that a quota is allocated to the data that the source data end and the target data end both need to send to the target data end, and as shown in fig. 6, the source data end may start to transmit the data. Specifically, the source data end may send the data to the switch a, and the switch a forwards the data to the target data end, that is, the source data end completes transmission of the data.
The embodiment of the invention provides a data transmission method, which includes the steps of sending a quota request through a source data end, wherein the quota request is used for requesting a route switch and a target data end to allocate a quota for data which needs to be sent to the target data end by the source data end, the quota is used for caching the data, the route switch comprises all switches which need to pass through from the source data end to the target data end, the source data end receives a quota response corresponding to the quota request, the quota response is used for representing whether the route switch and the target data end allocate a quota for the data, and if the quota response represents that the route switch and the target data end allocate a quota for the data, the source data end sends the data. According to the scheme, before the source data end transmits the data to the target data end, the source data end can apply quotas for the data to the switch along the way and the target data end, and the source data end starts to transmit the data after the quotas are distributed to the switch along the way and the target data end, so that compared with a method of managing after congestion when the data is transmitted in the prior art, the data transmission method provided by the embodiment of the invention solves the problem of network congestion and ensures lossless transmission of the data.
Example two
The embodiment of the invention provides a data transmission method, which can be realized by sequentially forwarding all switches which need to pass through from a source data end to a target data end along a switch in a data center Ethernet when data is transmitted between the source data end and the target data end. The number of the switches along the way can be one or more, and in order to clearly describe the data transmission method provided by the embodiment of the present invention, the embodiment takes only one switch along the way as an example, and exemplarily illustrates the data transmission method.
An embodiment of the present invention provides a data transmission method, as shown in fig. 7, where the method may include:
s401, a source data end sends a quota request to a switch, the quota request is used for requesting the switch and a target data end to allocate a quota for data which needs to be sent to the target data end by the source data end, and the quota is used for caching data which needs to be sent to the target data end by the source data end.
Before the source data end needs to transmit data to the target data end, the source data end can send a quota request to the switch. The quota request is used for requesting the switch and the target data terminal to allocate a quota for data which needs to be sent to the target data terminal by the source data terminal, and the quota is used for caching the data.
Optionally, the source data end may carry the quota request in a header of an ethernet packet for transmission. Specifically, the source data end may carry the quota request in a header of an existing ethernet packet for transmission, for example, as shown in table 1, the quota request is carried in a header of an existing ethernet packet, this manner may be implemented by extending an encapsulation format of the existing ethernet packet and redefining a new type value, where the type value may be used to indicate that a field carried in the header is a quota request and a data field is data. Alternatively, an ethernet packet may be newly defined for the quota request, and the quota request may be transmitted by being carried in a header of the ethernet packet, for example, as shown in table 2, an ethernet packet may be defined for the quota request, and the quota request may be carried in a header of the ethernet packet, which may be implemented by extending an encapsulation format of an existing ethernet packet and newly defining a new type value, where the type value may be used to indicate a field carried in the header as the quota request.
TABLE 1
TABLE 2
Specifically, the quota request may include: applying for quota amount and effective time of applying for quota amount, wherein the applying for quota amount is a buffer amount required by data which is required to be sent to a target data end from a source data end to a switch and the target data end for a source data end to be transmitted; the effective time of applying for quota is the time of requesting the switch by the source data terminal and reserving the buffer amount for the data to be transmitted by the target data terminal.
Further, the data that the source data end needs to send to the target data end may be a message queue formed by a plurality of ethernet messages. Specifically, reference may be made to the description of embodiment S101 described above.
S402, if the switch has an idle quota, the switch can allocate a quota for the data according to the quota request and forward the quota request to the target data end.
After the switch receives the quota request sent by the source data end, if an idle quota is available in the switch, the switch can allocate a quota for the data which needs to be sent to the target data end by the source data end according to the quota request, and forward the quota request to the target data end.
Specifically, the switch may allocate a quota for the data that needs to be sent to the target data end by the source data end according to the quota application amount in the quota request, and reserve the effective time of the quota application amount for the quota allocated by the switch for the data according to the effective time of the quota application amount in the quota request. For example, if the quota amount is applied for 200,000 bytes and the effective time of the quota amount is 1 second, the switch allocates a quota of 200,000 bytes to the data and reserves a quota of 200,000 bytes allocated to the data for 1 second.
S403, if there is an idle quota in the target data end, the target data end may allocate a quota for the data according to the quota request, and reply a quota grant corresponding to the quota request to the switch.
After the target data end receives the quota request forwarded by the switch, if an idle quota is available in the target data end, the target data end can allocate a quota for the data according to the quota request and reply a quota grant corresponding to the quota request to the switch, wherein the quota grant is used for representing that the switch and the target data end allocate a quota for the data.
S404, the switch forwards the quota grant to the source data terminal.
After the switch receives the quota grant corresponding to the quota request and replied by the target data end, the switch can forward the quota grant to the source data end.
And S405, the source data end sends the data to the switch.
After the source data end receives the quota grant forwarded by the switch, the source data end can know that the switch and the target data end are both data to be sent to the target data end by the source data end and quota is allocated to the data, so that the source data end can directly send the data to the switch.
S406, the exchanger forwards the data to the target data terminal.
After the switch receives the data sent by the source data end, the switch can forward the data to the target data end, that is, the source data end completes the transmission of the data.
It should be noted that, after the switch receives the data sent by the source data end, the switch may cache the data in the quota allocated to the data by the switch, and the switch may forward the data to the target data end, and the target data end caches the data in the quota allocated to the data by the target data end, and transmits the data to the local memory.
Further, in the data transmission method provided in the embodiment of the present invention, the number of the switches along the way may be multiple, where the method executed by each switch in the multiple switches is the same as the method executed by the switch described in this embodiment, and details are not described here, that is, the embodiment of the present invention only uses the number of the switches along the way as an exemplary description of the data transmission method provided in the embodiment of the present invention, and the specific number of the switches along the way may be determined according to an actual situation of the network, which is not limited by the present invention.
Further, as shown in fig. 8, after S401, the data transmission method provided in the embodiment of the present invention may further include:
and S407, if the switch has no idle quota, the switch replies a quota refusal corresponding to the quota request to the source data end, and discards the quota request.
After the switch receives the quota request sent by the source data end, if no idle quota exists in the switch, the switch can reply a quota refusal corresponding to the quota request to the source data end, and discard the quota request. The quota refusal can be used for representing that the switch does not allocate a quota for the source data end.
Further, after the source data end receives the quota refusal sent by the switch, the source data end can know that the switch does not allocate a quota for the data, which needs to be sent to the target data end, by the source data end according to the quota refusal, so that the source data end can determine that the data cannot be sent to the target data end.
Further, as shown in fig. 9, after S402, the data transmission method provided in the embodiment of the present invention may further include:
and S408, if the target data end has no idle quota, the target data end replies a quota refusal corresponding to the quota request to the switch.
After the target data end receives the quota request forwarded by the switch, if no idle quota exists in the target data end, the target data end can reply a quota refusal corresponding to the quota request to the switch, wherein the quota refusal can be used for representing that the target data end does not allocate a quota for the source data end.
The target data end can reject the quota to be carried in the header of the Ethernet message for transmission. Specifically, the transmission mode of the quota denial is similar to the transmission mode of the quota request, and reference may be made to the description of the transmission mode of the quota request in S401.
And S409, the switch refuses to forward the quota to the source data terminal.
After the switch receives the quota denial replied by the target data end, the switch may forward the quota denial to the source data end.
Further, as shown in fig. 10, after the above S407, or as shown in fig. 11, after the above S408-S409, the data transmission method provided in the embodiment of the present invention may further include:
and S410, after the source data end receives the quota refusal corresponding to the quota request, the source data end resends the quota request.
The switch replies a quota refusal to the source data end or the switch forwards a quota refusal replied by the target data end to the source data end, namely after the source data end receives the quota refusal, the source data end can know that the switch or the target data end is not a data allocation quota which needs to be sent to the target data end by the source data end according to the quota refusal, so that the source data end can resend the quota request to reapply the quota for the switch and the target data end.
In a possible implementation manner, the data that the source data end needs to send to the target data end is a packet queue composed of a plurality of ethernet packets, where the resending of the quota request by the source data end may specifically include:
the source data side subtracts the quota application amount required by the first Ethernet message from the quota application amount in the quota request to obtain a first quota application amount, and sends the first quota application amount carried in the quota request, namely the quota request retransmitted by the source data side includes the first quota application amount, wherein the first Ethernet message is a message located at the tail of the message queue.
Further, after the source data end receives quota refusal each time, the source data end can subtract the quota applying amount required by the message at the tail of the message queue from the quota applying amount in the last quota request, and carry the rest quota amount in the quota request to resend, so as to apply quota for the data to the switch and the target data end again until the rest quota amount is the quota amount required by the message at the head of the message queue, namely the second ethernet message.
Further, in the data transmission method, when the applied quota amount in the quota request sent by the source data end is the applied quota amount required by the second ethernet packet, that is, the minimum applied quota amount, if the source data end receives a quota rejection corresponding to the quota request sent by the source data end, the source data end still needs to resend the quota request, and specifically, the source data end can resend the quota request within a preset time after the source data end receives the quota rejection each time.
It can be understood that, when the ethernet load is high, the quota request of the source data end may be rejected by the switch or the target data end, that is, the source data end may receive the quota rejection, and in this case, the source data end may gradually reduce the amount of the application quota carried in the quota request sent each time; correspondingly, when the ethernet load is low, the quota request of the source data end is allowed by the switch or the target data end, that is, the source data end receives the quota grant, and in this case, the source data end can gradually increase the amount of the application quota carried in the quota request sent each time.
In another possible implementation manner, the resending of the quota request by the source data end specifically may include:
and the source data end carries the quota applying amount required by the Ethernet messages in the quota request and retransmits the quota request.
For example, in this embodiment of the present invention, the preset Time may be a preset fixed Time, such as at least one RTT (Round Trip Time); the quota request may also be a preset unfixed time, for example, on the basis of a certain fixed time, the unfixed time is indicated by a certain expression, for example, the source data end may increase to wait for one RTT and then resend the quota request after the source data end fails to apply for each application.
The resending of the quota request by the source data end within a preset time after the source data end receives the quota refusal each time can be any one of the following two conditions:
(1) if the quota application amount in the quota request sent by the source data end is the quota application amount required by the second ethernet packet, the source data end can send the quota request again after waiting for the fixed time each time the source data end fails to apply, that is, each time a quota refusal is received. Wherein, the fixed time may be at least one RTT.
For example, when the quota application amount in the quota request sent by the source data end is the quota application amount required by the second ethernet packet, if the source data end receives the quota refusal for the first time, the source data end needs to wait for at least one RTT and then resend the quota request; if the source data end receives the quota refusal for the second time, the source data end still needs to wait for at least one RTT and then resend the quota request.
(2) If the quota application amount in the quota request sent by the source data end is the quota application amount required by the second ethernet message, the source data end can resend the quota request after waiting for the unfixed time each time the source data end fails to apply, that is, each time a quota refusal is received. For example, the source data end may increase to wait for one RTT and then send the quota request each time the source data end fails to apply for the quota. The certain fixed time may be at least one RTT, and the certain expression may be an integer multiple of the at least one RTT.
For example, when the quota application amount in the quota request sent by the source data end is the quota application amount required by the second ethernet packet, if the source data end receives the quota refusal for the first time, the source data end needs to wait for at least one RTT and then resend the quota request; if the source data end receives the quota refusal for the second time, the source data end needs to wait for at least two RTTs and then resend the quota request.
It should be noted that the setting of the one fixed time and the certain fixed time as the at least one RTT is only an exemplary illustration, that is, both the one fixed time and the certain fixed time may be set as the at least one RTT, or may be set as other different times according to actual needs, and the present invention is not limited thereto.
Optionally, if the source data end does not receive a quota response corresponding to the quota request within a first preset time after the source data end sends the quota request, the source data end may resend the quota request after the first preset time. The first preset time may be at least two RTTs.
Further, the first preset time may preferably be set to at least two RTTs. Of course, the first preset time may also be set to any other time that meets the requirement, and the present invention is not limited.
Optionally, the source data end may send, within a second preset time after the source data end receives the quota grant, data that the source data end needs to send to the target data end. Wherein the second preset time may be at least one RTT.
Further, the second preset time may preferably be set to at least one RTT. Of course, the second preset time may also be set to any other time that meets the requirement, and the present invention is not limited.
Further, as shown in fig. 12, before the step S401, the data transmission method provided in the embodiment of the present invention may further include:
s411, the target data end sends a trigger quota request to the switch.
When the target data end has an idle quota, the target data end may send a trigger quota request to the switch, where the trigger quota request may be used to trigger the source data end to send a quota request.
Specifically, the trigger quota request may include: an amount of free quota and a valid time for the triggered quota request. The idle quota amount is a cache amount which is not occupied by data in the target data terminal; the valid time of the triggered quota request is used to indicate how long the quota request can be sent after the source data end receives the triggered quota request.
Further, the quota request sent by the source data end after receiving the trigger quota request may be an "urgent quota reservation request" used to request the switch and the target data end to allocate and reserve a quota for the data that needs to be sent by the source data end to the target data end. Of course, if there is no free quota in the switch, the switch may reply a quota refusal corresponding to the "urgent reservation quota request" to the source data end, and discard the "urgent reservation quota request".
Further, the effective time of the trigger quota request may be at least one RTT, or may be any other time that meets the actual requirement, which may be specifically set according to the actual requirement, and the present invention is not limited.
It should be noted that the target data end may carry the triggered quota request in a header of the ethernet packet for transmission. Specifically, a transmission manner of the trigger quota request is similar to that of the quota request, and reference may be made to the description of the transmission manner of the quota request in S401.
S412, the switch forwards the trigger quota request to the source data end.
After the switch receives the trigger quota request sent by the target data end, the switch can forward the trigger quota request to the source data end. And triggering the source data end to send a quota request, namely triggering the source data end to apply quota to the data which needs to be transmitted to the target data end by the switch and the target data end as the source data end, so that the switch and the target data end reserve quota for the data.
For example, assuming that a data center ethernet network includes a source data side, a switch, and a destination data side, where there may be one or more switches, a data transmission method provided by an embodiment of the present invention will be further described by taking a switch B as an example. Specifically, as shown in fig. 13, when there is an idle quota in the target data end, the target data end may send a trigger quota request to the switch B, and after the switch B receives the trigger quota request, the switch B may forward the trigger quota request to the source data end to trigger the source data end to send the quota request.
When the quota request sent by the source data end is an emergency quota request, an embodiment of the present invention further provides a data transmission method, as shown in fig. 14, where the method may include:
s501, when the data cached in the source data end occupies the cache of the source data end and is larger than a first preset threshold value, the source data end sends an emergency quota request to a switch.
When the data cached in the source data occupies the cache of the source data end and is larger than the first preset threshold value of the cache amount of the source data end, the source data end sends an emergency quota request to the switch.
Specifically, the emergency quota request includes: an emergency application quota amount and an effective time for the emergency application quota amount. Specifically, the amount of the emergency application quota and the effective time of the amount of the emergency application quota may be described with reference to the description of the amount of the application quota and the effective time of the amount of the application quota in S401 above.
Optionally, when data that the source data end needs to send to the target data end is high-priority data, the source data end may also send the emergency quota request, where the high-priority data may be data with the highest priority among all data cached in the source data end.
S502, if the switch has an idle quota, the switch allocates a quota for the data which needs to be sent to the target data end by the source data end according to the received emergency quota request, and forwards the emergency quota request to the target data end.
After the switch receives the emergency quota request sent by the source data end, if an idle quota exists in the switch, the switch allocates a quota for the data which needs to be sent to the target data end by the source data end according to the received emergency quota request, and forwards the emergency quota request to the target data end.
Specifically, the method for the switch to allocate the quota for the data according to the emergency quota request may refer to the description that the switch allocates the quota for the data according to the quota request in S402.
S503, if there is an idle quota in the target data end, the target data end may allocate a quota for the data according to the emergency quota request, and reply a quota grant corresponding to the emergency quota request to the switch.
After the target data end receives the emergency quota request forwarded by the switch, if the target data end has an idle quota, the target data end can allocate a quota for the data, which needs to be sent to the target data end by the source data end, according to the emergency quota request, and reply a quota grant corresponding to the emergency quota request to the switch, wherein the quota grant is used for representing that the target data end allocates a quota for the data.
S504, the switch forwards the quota grant to the source data end.
After the switch receives the quota grant replied by the target data end, the switch allocates a quota for the data which needs to be sent to the target data end by the source data end, so that the switch can forward the quota grant to the source data end.
And S505, the source data end sends the data to the switch.
After the source data end receives the quota grant forwarded by the switch, the source data end can know that the switch and the target data end are both data to be sent to the target data end by the source data end and quota is allocated to the data, so that the source data end can directly send the data to the switch.
S506, the exchanger forwards the data to the target data terminal.
After the switch receives the data sent by the source data end, the switch can forward the data to the target data end, that is, the source data end completes the transmission of the data.
It should be noted that, after the switch receives the data sent by the source data end, the switch may cache the data in the quota allocated to the data by the switch, and the switch may forward the data to the target data end, and the target data end caches the data in the quota allocated to the data by the target data end, and transmits the data to the local memory.
Further, as shown in fig. 15, after S501, the data transmission method provided in the embodiment of the present invention may further include:
and S507, if the exchanger has no idle quota, the exchanger records the emergency quota request and forwards the emergency quota request to a target data end.
After the switch receives the emergency quota request, if the switch has no idle quota, the switch records the received emergency quota request in the switch and forwards the emergency quota request to the target data end.
For example, assuming that a data center ethernet network includes a source data side, a switch, and a destination data side, where there may be one or more switches, a data transmission method provided by an embodiment of the present invention will be further described by taking a switch C as an example. Specifically, as shown in fig. 16, after the source data side sends the emergency quota request to the switch C, if there is no idle quota in the switch C, the switch C may record the received emergency quota request in the switch C, and forward the emergency quota request to the target data side.
Further, as shown in fig. 17, after S502, the data transmission method provided in the embodiment of the present invention may further include:
and S508, if the target data end has no free quota, the target data end replies a quota refusal corresponding to the emergency quota request to the switch.
After the target data end receives the emergency quota request forwarded by the switch, if no idle quota exists in the target data end, the target data end can reply a quota refusal corresponding to the quota request to the switch, wherein the quota refusal can be used for representing that the target data end does not allocate a quota for the source data end.
The target data end can reject the quota to be carried in the header of the Ethernet message for transmission. Specifically, the transmission mode of the quota denial is similar to the transmission mode of the quota request, and reference may be made to the description of the transmission mode of the quota request in S401.
S509, the switch rejects the quota to forward to the source data end.
After the switch receives the refusal of the quota replied by the target data terminal, when the switch still has no idle quota, the switch refuses to forward the quota to the source data terminal, and discards the emergency quota request.
It should be noted that, in the data transmission method provided in the embodiment of the present invention, after the target data end receives the emergency quota request, when there is no free quota in the target data end, the target data end may wait for a certain time. If the idle quota appeared in the target data end can meet the quota required by the data within the certain time, the target data end allocates a quota for the data; if after the certain time, the target data end still has no free quota that satisfies the quota required by the data, the target data end may execute S508, that is, reply the quota refusal to the switch, and then the switch refuses to forward the quota refusal to the source data end, so that the source data end cannot send the data.
Optionally, when the source data end sends the quota request or the emergency quota request, if the switch allocates a quota for the data, the switch receives a quota rejection sent by the target data end, and the switch may recycle the quota allocated for the data.
Further, as shown in fig. 18, after S507, the data transmission method provided in the embodiment of the present invention may further include:
and S510, when the switch has an idle quota, the switch allocates a quota for the data according to the emergency quota request.
When the switch receives the emergency quota request sent by the source data end and no idle quota exists in the switch, the switch can record the emergency quota request and forward the emergency quota request to the target data end. After the switch forwards the emergency quota request to the target data end, when an idle quota appears in the switch, the switch may allocate a quota for the data that the source data end needs to send to the target data end according to the emergency quota request. Wherein the free quota present in the switch may satisfy the quota required by the data.
It should be noted that, after S507, when there is an idle quota in the target data end, the present invention does not limit the execution sequence of S510 and S503, that is, the present invention may execute S503 first and then execute S510; or executing S510 first and then executing S503; s503 and S510 may also be performed simultaneously, and the present invention is not limited.
Further, as shown in fig. 19, after S507, when there is no free quota in the target data end, the present invention may execute S510 first, and then execute S508; s508 and S510 may also be performed simultaneously, and the invention is not limited.
Further, as shown in fig. 20, after S503 and before S505, the data transmission method provided in the embodiment of the present invention may further include:
s511, the switch sets a quota allocation identifier according to the quota grant, and discards the quota grant, where the quota allocation identifier may be used to identify that the target data end allocates a quota for the data.
After the target data end replies the quota grant to the switch, the switch may set a quota allocation identifier according to the quota grant, and discard the quota grant, where the quota allocation identifier may be used to identify that the target data end allocates a quota for the data.
Specifically, if there are multiple switches along the way, the quota allocation identifier may be used to identify that all switches and target data ends that need to pass between the switch that receives the quota grant and the target data end allocate a quota for the data.
And S512, after the exchanger waits for the idle quota to appear in the exchanger, allocating a quota for the data according to the emergency quota request.
After the target data end replies the quota grant to the switch, after the switch waits for an idle quota to appear in the switch, the switch can allocate a quota for the data which needs to be sent to the target data end by the source data end according to the emergency quota request.
S513, the switch generates a quota grant and sends the quota grant to the source data end.
After the switch allocates a quota for the data, the switch may generate a quota grant and send the quota grant to the source data side. Therefore, after the source data end receives the quota permission sent by the switch, it can be known that the switch and the target data end both distribute quotas to the data which needs to be sent to the target end by the source data end, and then the source data end can send the data.
It should be noted that, as shown in fig. 20, after S503, if the switch has not allocated a quota for the data, the switch needs to execute S511-S513, and does not need to execute S504; accordingly, as shown in fig. 18, if the switch has already allocated a quota for the data after S503, the switch need not execute S511-S513, but only execute S504.
Further, as shown in fig. 21, if S508 is executed after S510, that is, when an idle quota occurs in the switch, the switch allocates a quota for the data according to the emergency quota request, and then the target data end replies that a quota corresponding to the emergency quota request is rejected to the switch, the data transmission method provided in the embodiment of the present invention may further include:
and S514, the switch recovers the quota distributed for the data.
When an idle quota appears in the switch, the switch allocates a quota for the data according to the emergency quota request, and then the target data end replies a quota refusal corresponding to the emergency quota request to the switch, and after the switch receives the quota refusal, the switch recovers the quota allocated for the data.
As shown in fig. 22, in S502, that is, if there is an idle quota in the switch, the switch allocates a quota for the data that needs to be sent by the source data end to the target data end according to the received emergency quota request, and after forwarding the emergency quota request to the target data end, S508 is executed, that is, if there is no idle quota in the target data end, the target data end replies a quota corresponding to the emergency quota request and rejects to the switch, and after executing S508, the switch may execute S514, that is, the switch recovers the quota allocated for the data.
Further, the present invention does not limit the execution sequence of S509 and S514, that is, the present invention may execute S509 first and then execute S514; s514 may be executed first, and then S509 is executed, or S509 and S514 may be executed simultaneously.
Further, as shown in fig. 23, when the source data end sends a quota request, after the switch allocates a quota for the data, the data transmission method provided in the embodiment of the present invention may further include S515; after the target data end allocates a quota for the data, the data transmission method provided in the embodiment of the present invention may further include S516, specifically:
s515, after the first preset time, the switch checks whether the data is cached in the quota allocated to the data, and if the data is not cached in the quota, the switch recovers the quota.
After the switch allocates a quota for data, which needs to be sent to a target data end, by a source data end, the switch waits for a first preset time, and then the switch can check whether the data is cached in the quota allocated for the data, and if the switch checks that the data is not cached in the quota allocated for the data, the switch recovers the quota.
S516, after the first preset time, the target data end checks whether the data is cached in the quota allocated to the data, and if the data is not cached in the quota, the target data end recovers the quota.
After the target data end distributes quota for data which needs to be sent to the target data end by the source data end, after the target data end waits for a first preset time, the target data end can check whether the data is cached in the quota distributed for the data, and if the target data end checks that the data is not cached in the quota distributed for the data, the target data end recovers the quota.
It can be understood that, as shown in fig. 24, when the source data side sends an emergency quota request, after the switch allocates a quota for the data, the data transmission method provided in the embodiment of the present invention may further include S515; after the target data end allocates a quota for the data, the data transmission method provided in the embodiment of the present invention may further include S516.
Further, as shown in fig. 25, after the switch forwards the data to the target data end, the data transmission method provided in the embodiment of the present invention may further include S517; after the target data end receives the data, the data transmission method provided by the embodiment of the present invention may further include S518 to S519, specifically:
s517, the switch recovers the quota distributed for the data.
After the switch forwards the data to the target data end, the switch may reclaim its quota allocated for the data.
S518, the target data end stores the data to the local memory.
After the target data end receives the data forwarded by the switch, the target data end can store the data to the local memory.
And S519, the target data end recovers the quota distributed for the data.
After the target data end stores the data in the local memory, the target data end can recycle the quota allocated to the data.
In the prior art, during data transmission, a switch in a data center ethernet network handles congestion by adding a cache, and the data center ethernet network does not lose packets by limiting the network scale and excessively providing network resources. When the network is congested, a congestion notification mechanism QCN is used to notify the source data end to reduce the data transmission rate, and attempt to solve the network congestion.
Data center ethernet is a best effort network model, and therefore network congestion or packet loss may occur when data is transmitted in the data center ethernet. The embodiment of the invention provides a data transmission method, namely, a source data end applies quota for data to a switch along the way and a target data end before transmitting the data to the target data end, and the source data end starts to transmit the data only after the switch along the way and the target data end both distribute quota for the data. Therefore, the data transmission method provided by the embodiment of the invention confirms the smoothness of the data transmission path before data transmission, and avoids the occurrence of network congestion. Therefore, the problems of buffer flow waste, bandwidth utilization insufficiency and congestion packet loss caused by the network congestion problem in the prior art are solved, the buffer in a switch on the way is saved, the network bandwidth is fully utilized, the timeliness and the stability of the distributed service are ensured, the data transmission method provided by the embodiment of the invention does not need to provide excessive network resources, is not limited by the network scale and has the cost advantage.
The embodiment of the invention provides a data transmission method, which includes the steps of sending a quota request through a source data end, wherein the quota request is used for requesting a route switch and a target data end to allocate a quota for data which needs to be sent to the target data end by the source data end, the quota is used for caching the data, the route switch comprises all switches which need to pass through from the source data end to the target data end, the source data end receives a quota response corresponding to the quota request, the quota response is used for representing whether the route switch and the target data end allocate a quota for the data, and if the quota response represents that the route switch and the target data end allocate a quota for the data, the source data end sends the data. According to the scheme, before the source data end transmits the data to the target data end, the source data end can apply quotas for the data to the switch along the way and the target data end, and the source data end starts to transmit the data after the quotas are distributed to the switch along the way and the target data end, so that compared with a method of managing after congestion when the data is transmitted in the prior art, the data transmission method provided by the embodiment of the invention solves the problem of network congestion and ensures lossless transmission of the data.
EXAMPLE III
As shown in fig. 26, an embodiment of the present invention provides a data transmission device 1, where the data transmission device 1 may include:
a sending unit 10, configured to send a quota request, where the quota request is used to request a switch along a route and a target data end to allocate a quota for data that needs to be sent to the target data end by the data transmission device 1, where the quota is used to cache the data, and the switch along the route includes all switches that need to pass from the data transmission device 1 to the target data end; a receiving unit 11, configured to receive a quota response corresponding to the quota request sent by the sending unit 10, where the quota response is used to characterize whether the switch along the way and the target data end allocate the quota for the data; the sending unit 10 is further configured to send the data if the quota response received by the receiving unit 11 indicates that the quota is allocated to the data by the switch along the way and the target data end.
Further, the sending unit 10 is further configured to resend the quota request if the quota response received by the receiving unit 11 indicates that one of the switches along the route or the target data end does not allocate the quota for the data.
Optionally, the quota response received by the receiving unit 11 is a quota grant or a quota denial, wherein,
the quota grant is used for characterizing the switch along the way and the target data end to allocate the quota for the data, and the quota refusal is used for characterizing one switch in the switch along the way or the target data end not to allocate the quota for the data.
Optionally, the sending unit 10 is specifically configured to carry the quota request in a header of an ethernet packet for transmission.
Further, as shown in fig. 27, the data transmission apparatus 1 may further include a processing unit 12, where the data is a packet queue composed of a plurality of ethernet packets, the quota request sent by the sending unit 10 includes a quota application amount,
the processing unit 12 is configured to subtract an applied quota amount required by a first ethernet packet from an applied quota amount in the quota request to obtain a first applied quota amount, where the first ethernet packet is a packet located at the tail of the packet queue; and the sending unit 10 is specifically configured to resend the quota request, where the quota request includes the first application quota amount.
Optionally, the sending unit 10 is specifically configured to, if the quota applying amount in the quota request is an quota applying amount required by a second ethernet packet, and the second ethernet packet is a packet located at the head of the packet queue, resend the quota request within a time after the receiving unit 11 receives the quota refusal each time.
Optionally, the data includes a plurality of ethernet packets, the quota request sent by the sending unit 10 includes an amount of quota application,
the sending unit 10 is specifically configured to resend the quota request, where the quota request includes an amount of quota application required by the multiple ethernet packets.
Optionally, the sending unit 10 is further configured to, within a first preset time after the quota request is sent, if the receiving unit 11 does not receive the quota response, resend the quota request after the first preset time.
Optionally, the sending unit 10 is specifically configured to send the data within a second preset time after the receiving unit 11 receives the quota response.
Optionally, the receiving unit 11 is further configured to receive a trigger quota request before the sending unit 10 sends a quota request, where the trigger quota request is used to trigger the data transmission apparatus to send the quota request;
the sending unit 10 is specifically configured to send the quota request according to the triggered quota request received by the receiving unit 11.
Further, the triggered quota request received by the receiving unit 11 includes an idle quota amount and a valid time of the triggered quota request.
Optionally, the quota request sent by the sending unit 10 further includes an effective time of the application quota amount, and is used to request the switch and the target data end along the route to reserve the application quota amount for the effective time of the application quota amount.
Optionally, the sending unit 10 is specifically configured to send an emergency quota request when the data cached in the data transmission apparatus occupies the cache of the data transmission apparatus and is greater than a first preset threshold; and the receiving unit 11 is specifically configured to receive the quota response corresponding to the emergency quota request sent by the sending unit 10.
The data transmission apparatus 1 provided in the embodiment of the present invention may be a device that performs communication through an exchange, such as a terminal device of a mobile phone, a computer, or the like.
The embodiment of the invention provides a data transmission device, wherein before the data transmission device transmits data to a target data end, the data transmission device can apply quotas for the data to a switch along the way and the target data end, and when the switch along the way and the target data end both distribute quotas for the data, the data transmission device starts to transmit the data.
As shown in fig. 28, an embodiment of the present invention provides a data transmission apparatus 2, where the data transmission apparatus 2 may include:
a receiving unit 20, configured to receive a quota request, receive a quota response corresponding to the quota request, and receive data that needs to be sent by a source data end to a target data end, where the quota request is used to request that a data transmission device and the target data end allocate a quota for the data, the quota is used to cache the data, the data transmission device includes all data transmission devices that need to pass through from the source data end to the target data end, the data transmission device 2 is one of the data transmission devices, the quota response is used to characterize whether the data transmission device and the target data end allocate the quota for the data, and the data is when the quota response characterizes that the data transmission device and the target data end allocate the quota for the data, the source data end sends the data; an allocating unit 21, configured to allocate, if there is an idle quota in the data transmission apparatus 2, the quota to the data according to the quota request received by the receiving unit 20; the sending unit 22 is configured to forward the quota request, forward the quota response, and forward the data.
Further, as shown in fig. 29, the data transmission apparatus 2 may further include a discarding unit 23,
the sending unit 22 is further configured to reply a first quota rejection corresponding to the quota request received by the receiving unit 20 if there is no idle quota in the data transmission apparatus 2, where the first quota rejection is used to characterize that the data transmission apparatus 2 does not allocate the quota for the data; the discarding unit 23 is configured to discard the quota request received by the receiving unit 20.
Optionally, the quota response received by the receiving unit 20 is a quota grant or a quota denial, wherein,
the quota grant is used for characterizing the data transmission device and the target data end to allocate the quota for the data, and the quota refusal is used for characterizing one data transmission device in the data transmission device or the target data end does not allocate the quota for the data.
Optionally, the sending unit 22 is specifically configured to reject the first quota for transmission by being carried in a header of an ethernet packet.
Optionally, as shown in fig. 30, the data transmission device 2 may further include a processing unit 24,
the processing unit 24 is configured to check whether the data is cached in the quota after a first preset time after the allocating unit 21 allocates the quota to the data according to the quota request, and if the data is not cached in the quota, recover the quota.
Further, the processing unit 24 is further configured to reclaim the quota after the sending unit 22 forwards the data.
Optionally, the processing unit 24 is further configured to recover the quota if the quota response received by the receiving unit 22 is the quota refusal.
Optionally, the receiving unit 20 is further configured to receive a trigger quota request before receiving a quota request, where the trigger quota request is used to trigger the source data end to send the quota request, and the trigger quota request includes an idle quota amount and an effective time of the trigger quota request; the sending unit 22 is further configured to forward the triggered quota request received by the receiving unit 20.
Optionally, the quota request received by the receiving unit 20 includes an application quota amount and valid time of the application quota amount, and is used to request the data transmission device and the target data terminal to reserve the application quota amount for the valid time of the application quota amount.
Optionally, the receiving unit 20 is specifically configured to receive an emergency quota request, where the emergency quota request is sent by the source data end when the cache of the source data end occupied by the data cached in the source data end is greater than a first preset threshold.
Optionally, as shown in fig. 31, the data transmission device 2 may further include a processing unit 24,
the processing unit 24 is configured to record the emergency quota request received by the receiving unit 20 if there is no free quota in the data transmission apparatus 2, and recover the quota when the quota response received by the receiving unit 20, corresponding to the emergency quota request, indicates that the target data end does not allocate the quota for the data; the sending unit 22 is further configured to forward the emergency quota request received by the receiving unit 20, and forward the quota response and forward the data when the quota response received by the receiving unit 20 characterizes that the quota is allocated to the data by the data transmission apparatus along the way and the target data end; the receiving unit 20 is further configured to receive the quota response, and receive the data; the allocating unit 21 is further configured to, when an idle quota occurs in the data transmission apparatus, allocate the quota to the data according to the emergency quota request received by the receiving unit 20.
Further, as shown in fig. 32, the data transmission apparatus 2 may further include a discarding unit 23,
the processing unit 24 is further configured to, when the quota response received by the receiving unit 20 indicates that all data transmission apparatuses that need to pass between the data transmission apparatus 2 and the target data peer allocate the quota for the data, and the data transmission apparatus 2 does not allocate the quota for the data, set a quota allocation identifier according to the quota response, and generate a quota grant, where the quota allocation identifier is used to identify all switches that need to pass between the data transmission apparatus 2 and the target data peer to allocate the quota for the data, the quota grant is used to indicate that all data transmission apparatuses that need to pass between the data transmission apparatus 2 and the target data peer to allocate the quota for the data, the discarding unit 23 is configured to discard the quota response received by the receiving unit 20, the allocating unit 21 is further configured to, after waiting for an idle quota to occur in the data transmission apparatus 2, allocate the quota to the data according to the emergency quota request received by the receiving unit 20, the receiving unit 20 is further configured to receive the data, and the sending unit 22 is further configured to send the quota grant and forward the data received by the receiving unit 20; or, the sending unit 22 is further configured to forward the quota response when the quota response indicates that the target data end does not allocate the quota for the data, and the data transmission apparatus 2 does not allocate the quota for the data, and the discarding unit 23 is configured to discard the emergency quota request received by the receiving unit 20.
The data transmission device 2 provided by the embodiment of the invention can be equipment such as a switch.
The embodiment of the invention provides a data transmission device, and the data transmission device provided by the embodiment of the invention solves the problem of network congestion and ensures lossless transmission of data compared with a method of firstly carrying out congestion and then carrying out management in the prior art because a source data end can apply quota for data to a data transmission device along the way and a target data end before the source data end transmits the data to the data transmission device along the way and the target data end, and the source data end starts to transmit the data after the data transmission device along the way and the target data end both distribute the quota for the data.
As shown in fig. 33, an embodiment of the present invention provides a data transmission apparatus 3, where the data transmission apparatus 3 may include:
a receiving unit 30, configured to receive a quota request, and receive data that needs to be sent to the data transmission apparatus 3 by a source data end, where the quota request is used to request a switch along the route and the data transmission apparatus 3 to allocate a quota for the data, where the quota is used to cache the data, and the switch along the route includes all switches that need to pass through from the source data end to the data transmission apparatus 3; an allocating unit 31, configured to allocate, if there is an idle quota in the data transmission apparatus 3, the quota to the data according to the quota request received by the receiving unit 30; a sending unit 32, configured to reply to a quota grant corresponding to the quota request received by the receiving unit 30, where the quota grant is used to characterize the along-road switch and the data transmission apparatus 3 to allocate the quota for the data.
Optionally, the sending unit 32 is further configured to reply a quota rejection if there is no idle quota in the data transmission apparatus 3, where the quota rejection is used to characterize that the data transmission apparatus 3 does not allocate the quota for the data.
Further, the sending unit 32 is specifically configured to carry the quota grant/quota denial in a header of an ethernet packet for transmission.
Further, as shown in fig. 34, the data transmission device 3 may further include a processing unit 33,
the processing unit 33 is configured to, after the allocating unit 31 allocates the quota to the data according to the quota request, check whether the data is cached in the quota after a first preset time, and if the data is not cached in the quota, recover the quota.
Further, the processing unit 33 is further configured to, after the receiving unit 30 receives the data, store the data in a local memory, and recover the quota.
Optionally, the sending unit 32 is further configured to send a trigger quota request before the receiving unit 30 receives a quota request, where the trigger quota request is used to trigger the source data end to send the quota request.
Further, the triggered quota request sent by the sending unit 32 includes an idle quota amount and a valid time of the triggered quota request.
Optionally, the quota request received by the receiving unit 30 includes an application quota amount and valid time of the application quota amount, and is used to request the transit switch and the data transmission apparatus to reserve the application quota amount for the valid time of the application quota amount.
Optionally, the receiving unit 30 is specifically configured to receive an emergency quota request, where the emergency quota request is sent by the source data end when the cache of the source data end occupied by the data cached in the source data end is greater than a first preset threshold.
The data transmission device 3 provided by the embodiment of the present invention may be a device that performs communication through an exchange, such as a terminal device of a mobile phone, a computer, or the like.
The embodiment of the invention provides a data transmission device, wherein before a source data end transmits data to the data transmission device, the source data end can apply for quota for the data to a switch along the way and the data transmission device, and when the switch along the way and the data transmission device both allocate quota for the data, the source data end starts to transmit the data, so that compared with the method of firstly 'congestion' and then 'management' in the prior art, the data transmission device provided by the embodiment of the invention solves the problem of network congestion and ensures the lossless transmission of the data.
Example four
As shown in fig. 35, an embodiment of the present invention provides a source data side, which may be a device that communicates through a switch, and may include a processor 13, a memory 14, a system bus 15, and a communication interface 16. The processor 13, the memory 14 and the communication interface 16 are connected by a system bus 15 and communicate with each other.
The processor 13 may be a single-core or multi-core central processing unit, or may be a specific integrated circuit, or may be one or more integrated circuits configured to implement embodiments of the present invention.
The memory 14 may be a high-speed RAM memory, or may be a non-volatile memory (non-volatile memory), such as at least one disk memory.
The memory 14 is used for storing the execution instruction of the source data terminal. Specifically, the execution instruction of the source data end may include a program code.
The communication interface 16 is an interface circuit for one system to communicate with another system.
When the source data end is running, the processor 13 may execute the method flow described in any one of fig. 1 or fig. 4 to fig. 25, which specifically includes:
the processor 13 is configured to send a quota request from the communication interface 16 through the system bus 15, where the quota request is used to request that a switch along the way and a target data end allocate a quota for data that needs to be sent from the source data end to the target data end, the quota is used to cache the data, the switch along the way includes all switches that need to pass through from the source data end to the target data end, and the processor 13 receives a quota response corresponding to the quota request from the communication interface 16 through the system bus 15, where the quota response is used to characterize whether the switch along the way and the target data end allocate the quota for the data, and if the quota response received by the processor 13 characterizes that the switch along the way and the target data end allocate the quota for the data, the processor 13 passes through the system bus 15, transmitting the data from the communication interface 16; the memory 14 is configured to store a program code of the data, a program code of the quota request, a program code of the quota response, and a software program that controls the processor 13 to complete the above processes, so that the processor 13 completes the above processes by executing the software program and calling the above program codes.
Optionally, the processor 13 is further configured to, if the received quota response indicates that one of the switches along the path or the target data end does not allocate the quota for the data, resend the quota request from the communication interface 16 through the system bus 15.
Optionally, the quota response received by the processor 13 is a quota grant or a quota denial, wherein,
the quota grant is used for characterizing the switch along the way and the target data end to allocate the quota for the data, and the quota refusal is used for characterizing one switch in the switch along the way or the target data end not to allocate the quota for the data.
Optionally, the processor 13 is specifically configured to carry the quota request in a header of an ethernet packet for transmission.
Optionally, the data is a packet queue composed of a plurality of ethernet packets, the quota request includes an amount of quota application, where the processor 13 is further configured to subtract the amount of quota application required by a first ethernet packet from the amount of quota application in the quota request to obtain a first amount of quota application, where the first ethernet packet is a packet located at the tail of the packet queue; and resends the quota request from the communication interface 16 through the system bus 15, where the quota request includes the first requested quota amount.
Optionally, the processor 13 is specifically configured to, if the quota applying amount in the quota request is an quota applying amount required by a second ethernet packet, and the second ethernet packet is a packet located at the head of the packet queue, re-send the quota request from the communication interface 16 through the system bus 15 in a time after the quota refusal is received each time.
Optionally, the data includes a plurality of ethernet packets, the quota request includes a quota application amount,
the processor 13 is specifically configured to resend the quota request from the communication interface 16 through the system bus 15, where the quota request includes an amount of quota application required by the multiple ethernet packets.
Optionally, the processor 13 is further configured to, within a first preset time after the quota request is sent, if the processor 13 does not receive the quota response, resend the quota request from the communication interface 16 through the system bus 15 after the first preset time.
Optionally, the processor 13 is specifically configured to send the data from the communication interface 16 through the system bus 15 within a second preset time after receiving the quota response.
Optionally, the processor 13 is further configured to receive a trigger quota request from the communication interface 16 through the system bus 15 before sending the quota request, and send the quota request from the communication interface 16 through the system bus 15 according to the trigger quota request, where the trigger quota request is used to trigger the source data end to send the quota request.
Optionally, the triggered quota request received by the processor 13 includes an idle quota amount and a valid time of the triggered quota request.
Optionally, the quota request sent by the processor 13 further includes an effective time of the application quota amount, and is used to request the switch and the target data end along the route to reserve the application quota amount for the effective time of the application quota amount.
Optionally, the processor 13 is specifically configured to send an emergency quota request from the communication interface 16 through the system bus 15 when the data cached in the memory 14 occupies the cache of the memory 14 and is greater than a first preset threshold, and receive the quota response corresponding to the emergency quota request from the communication interface 16 through the system bus 15.
The source data terminal provided by the embodiment of the invention can be equipment for communication through a switch, such as terminal equipment of a mobile phone, a computer and the like.
The embodiment of the invention provides a source data end, because the source data end can apply quota for data to a switch on the way and a data transmission device before the source data end transmits the data to the data transmission device, and the source data end starts to transmit the data after the switch on the way and the data transmission device both distribute quota for the data, compared with the method of firstly 'congestion' and then 'management' in the prior art, the source data end provided by the embodiment of the invention solves the problem of network congestion and ensures the lossless transmission of the data.
As shown in fig. 36, an embodiment of the present invention provides a switch that may include a processor 25, a memory 26, a system bus 27, and a communication interface 28. The processor 25, the memory 26 and the communication interface 28 are connected by a system bus 27 and communicate with each other.
The description of the processor 25 is the same as that of the processor 13 in the above embodiment.
The description of memory 26 is the same as that of memory 14 in the above embodiment.
The description of the communication interface 28 is the same as that of the communication interface 16 in the above embodiment.
When the switch is running, the processor 25 may execute the method flow described in any one of fig. 2 or fig. 4 to fig. 25, specifically including:
the processor 25 is configured to receive a quota request from the communication interface 28 through the system bus 27, receive a quota response corresponding to the quota request, and receive data that needs to be sent by a source data end to a target data end, where the quota request is used to request that a along-road switch and the target data end allocate quotas for the data, the quotas are used to cache the data, the along-road switch includes all switches that need to pass through from the source data end to the target data end, the switch is one of the along-road switches, the quota response is used to characterize whether the along-road switch and the target data end allocate the quotas for the data, and the data is sent by the source data end when the quota response characterizes that the along-road switch and the target data end allocate the quotas for the data, and the processor 25 is configured to allocate, according to the processor 25 and through the system bus 27, the quota for the data by the quota request received from the communication interface 28, and the processor 25 is configured to forward the quota request, forward the quota response, and forward the data by the communication interface 28 through the system bus 27. The memory 26 may be configured to store a program code of the quota request, a program code of the quota response, a program code of the data, and a software program that controls the processor 25 to complete the above processes, so that the processor 25 completes the above processes by executing the software program and calling the above program codes.
Optionally, the processor 25 is further configured to pass through the system bus 27 if there is no free quota in the switch. Replying, from the communication interface 28, a first quota denial corresponding to the quota request received by the processor 25, the first quota denial being used to characterize that the switch does not allocate the quota for the data; the processor 25 is further configured to discard the quota request.
Optionally, the processor 25, receiving the quota response through the system bus 27 and the communication interface 28, is a quota grant or a quota denial, wherein,
the quota grant is used for characterizing the switch along the way and the target data end to allocate the quota for the data, and the quota refusal is used for characterizing one switch in the switch along the way or the target data end not to allocate the quota for the data.
Optionally, the processor 25 is specifically configured to carry the first quota refusal in a header of an ethernet packet for transmission.
Optionally, the processor 25 is configured to, after allocating the quota for the data according to the quota request, check whether the data is cached in the quota after a first preset time, and if the data is not cached in the quota, recover the quota.
Optionally, the processor 25 is further configured to reclaim the quota after forwarding the data.
Optionally, the processor 25 is further configured to recover the quota if the quota response received by the processor 25 from the communication interface 28 through the system bus 27 is the quota refusal.
Optionally, the processor 25 is further configured to receive a trigger quota request before receiving a quota request, where the trigger quota request is used to trigger the source data end to send the quota request, and the trigger quota request includes an idle quota amount and an effective time of the trigger quota request; the processor 25 is further configured to forward the triggered quota request.
Optionally, the processor 25 receives the quota request including an application quota amount and valid time of the application quota amount, and is configured to request the transit exchange and the target data terminal to reserve the application quota amount for the valid time of the application quota amount.
Optionally, the processor 25 is specifically configured to receive an emergency quota request through the system bus 27 and the communication interface 28, where the emergency quota request is sent by the source data end when the cache of the source data end occupied by the data cached in the source data end is greater than a first preset threshold.
Optionally, the processor 25 is configured to record the emergency quota request if there is no idle quota in the switch, and when the quota response received by the processor 25 corresponds to the emergency quota request and indicates that the target data end does not allocate the quota for the data, the processor 25 recovers the quota; the processor 25 is further configured to forward the received emergency quota request from the communication interface 28 through the system bus 27, and forward the quota response and forward the data when the received quota response characterizes the switch along the way and the target data end to allocate the quota for the data; the processor 25 is further configured to receive the quota response through the system bus 27 and the communication interface 28, and receive the data; the processor 25 is further configured to allocate the quota to the data according to the received emergency quota request when an idle quota occurs in the switch.
Optionally, the processor 25 is further configured to, when the quota response received by the processor 25 from the communication interface 28 through the system bus 27 characterizes that all switches that need to pass between the switch and the target data end allocate the quota for the data, and the switch does not allocate the quota for the data, set a quota allocation identifier according to the quota response, and generate a quota grant, where the quota allocation identifier is used to identify all switches that need to pass between the switch and the target data end and allocate the quota for the data, and the quota grant is used to characterize that the switch, all switches that need to pass between the switch and the target data end allocate the quota for the data, the processor 25 is configured to discard the quota response, the processor 25 is further configured to, after waiting for an idle quota to appear in the switch, allocate the quota to the data according to the emergency quota request received by the processor 25 from the communication interface 28 through the system bus 27, the processor 25 is further configured to receive the data through the system bus 27 and the communication interface 28, and the processor 25 is further configured to send the quota grant through the system bus 27 and the communication interface 28 and forward the data; or, the processor 25 is further configured to forward the quota response when the quota response indicates that the target data end does not allocate the quota for the data, and the switch does not allocate the quota for the data, and the processor 25 is configured to discard the received emergency quota request.
The embodiment of the invention provides a switch, because a source data end can apply quota for data to a switch along the way and a data transmission device before the source data end transmits the data to the data transmission device, and the source data end starts to transmit the data after the switch along the way and the data transmission device both allocate the quota for the data, compared with a method of firstly 'congestion' and then 'management' in the prior art, the switch provided by the embodiment of the invention solves the problem of network congestion and ensures lossless transmission of the data.
As shown in fig. 37, the embodiment of the present invention provides a target data end, which may be a device that performs communication through a switch, and may include a processor 34, a memory 35, a system bus 36, and a communication interface 37. The processor 34, the memory 35 and the communication interface 37 are connected by a system bus 36 to complete communication with each other.
The description of the processor 34 is the same as that of the processor 13 in the above embodiment.
The description of the memory 35 is the same as that of the memory 14 in the above embodiment.
The description of the communication interface 37 is the same as that of the communication interface 16 in the above embodiment.
When the target data end is running, the processor 34 may execute the method flow described in any one of fig. 3 to 7, fig. 9, or any one of fig. 11 to 25, which specifically includes:
the processor 34, for receiving quota requests from a communication interface 37 via a system bus 36, and receiving data that a source data end needs to send to the switch, the quota request being used to request the switch along the way and the target data end to allocate a quota for the data, the quota is used to cache the data, the switches along the way include all switches that need to be passed through from the source data end to the target data end, and the processor 34, for allocating, if there is an idle quota in the target data end, the quota for the data according to the received quota request, and the processor 34, for replying, via system bus 36, from communication interface 37 to a quota grant corresponding to the quota request received by the processor 34, the quota grant is used to characterize the switch along the way and the target data end to allocate the quota for the data. The memory 35 is configured to store a program code of the quota request, a program code of the quota grant, a program code of the data, and a software program that controls the processor 34 to complete the above steps, so that the processor 34 completes the above steps by executing the software program and calling the above program codes.
Optionally, the processor 34 is further configured to reply a quota rejection from the communication interface 37 through the system bus 36 if there is no idle quota in the target data end, where the quota rejection is used to characterize that the target data end does not allocate the quota for the data.
Optionally, the processor 34 is specifically configured to carry the quota grant/quota denial in a header of an ethernet packet for transmission.
Optionally, the processor 34 is configured to, after allocating the quota for the data according to the quota request, check whether the data is cached in the quota after a first preset time, and if the data is not cached in the quota, recover the quota.
Optionally, the processor 34 is further configured to, after receiving the data, save the data to the memory 35, and reclaim the quota.
Optionally, the processor 34 is further configured to send a trigger quota request from a communication interface 37 through a system bus 36 before receiving the quota request, where the trigger quota request is used to trigger the source data end to send the quota request.
Optionally, the triggered quota request sent by the processor 34 includes an idle quota amount and a valid time of the triggered quota request.
Optionally, the processor 34 receives the quota request including an application quota amount and valid time of the application quota amount, and is configured to request the transit exchange and the target data terminal to reserve the application quota amount for the valid time of the application quota amount.
Optionally, the processor 34 is specifically configured to receive, through the system bus 36, an emergency quota request from a communication interface 37, where the emergency quota request is sent by the source data end when the cache of the source data end occupied by the data cached in the source data end is greater than a first preset threshold.
The target data end provided by the embodiment of the invention can be equipment for communication through a switch, such as terminal equipment of a mobile phone, a computer and the like.
The embodiment of the invention provides a target data end, because the source data end can apply quota for data to a switch along the way and the data transmission device before the source data end transmits the data to the data transmission device, and the source data end starts to transmit the data after the switch along the way and the data transmission device both allocate the quota for the data, compared with a method of firstly 'congestion' and then 'management' in the prior art, the target data end provided by the embodiment of the invention solves the problem of network congestion and ensures the lossless transmission of the data.
EXAMPLE five
As shown in fig. 38, an embodiment of the present invention provides a data transmission system, which may include a source data side, at least one switch, and a destination data side.
In the data transmission system provided in the embodiment of the present invention, the number of the switches may be one or more, where a method performed by each switch in the plurality of switches is the same as the method performed by the switch described in this embodiment, and therefore, in order to clearly describe the data transmission system provided in the embodiment of the present invention, in this embodiment, only one switch in the data transmission system is taken as an example to exemplarily describe the data transmission system, and the specific number of the switches may be determined according to actual situations, which is not limited by the present invention.
In the data transmission system provided in the embodiment of the present invention, a source data end sends a quota request to a switch, where the quota request is used to request the switch and a target data end to allocate a quota for data that the source data end needs to send to the target data end, the quota is used to cache the data, if there is an idle quota in the switch, the switch allocates a quota for the data and forwards the quota request to the target data end, after the target data end receives the quota request, if there is an idle quota in the target data end, the target data end allocates a quota for the data, and replies a quota grant corresponding to the quota request to the switch, after the switch receives the quota grant, the switch forwards the quota grant to the source data end, and the quota grant characterizes that the switch and the target data end have allocated a quota for the data, so that after the source data end receives the quota grant, the source data end can directly send the data to the switch, and the switch forwards the data to the target data end, so that the data transmission is completed.
It should be noted that the data transmission system provided in the embodiment of the present invention may also be applied to a scenario where multiple source data ends and multiple target data ends are provided, and a specific method for transmitting data between a source data end and a target data end is similar to the method for transmitting data between a source data end and a target data end described in the foregoing embodiment, and is not described here again.
The embodiment of the invention provides a data transmission system, a quota request is sent to a switch through a source data end, the quota request is used for requesting the switch and a target data end to allocate a quota for data which needs to be sent to the target data end by the source data end, the quota is used for caching the data, if the switch has an idle quota, the switch allocates a quota for the data and forwards the quota request to the target data end, after the target data end receives the quota request, if the target data end has an idle quota, the target data end allocates a quota for the data and replies a quota grant corresponding to the quota request to the switch, after the switch receives the quota grant, the switch forwards the quota grant to the source data end, the quota grant represents that the switch and the target data end allocate a quota for the data, therefore, after the source data end receives the quota grant, the source data end can directly send the data to the switch, and the switch forwards the data to the target data end. According to the scheme, before the source data end transmits the data to the target data end, the source data end can apply quotas for the data to the switch along the way and the target data end, and the source data end starts to transmit the data after the quotas are distributed to the switch along the way and the target data end, so that compared with a method of managing after congestion when the data is transmitted in the prior art, the data transmission system provided by the embodiment of the invention solves the problem of network congestion and ensures lossless transmission of the data.
It will be clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to perform all or part of the above described functions. For the specific working processes of the system, the apparatus and the unit described above, reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described here again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (47)
1. A method of data transmission, comprising:
a source data end sends a quota request, wherein the quota request is used for requesting a switch along the way and a target data end to allocate a quota for data needing to be sent to the target data end by the source data end, the quota is used for caching the data, and the switch along the way comprises all switches needing to pass from the source data end to the target data end;
the source data end receives a quota response corresponding to the quota request, wherein the quota response is used for representing whether the marginal switch and the target data end distribute the quota for the data or not;
and if the quota response represents that the switch along the way and the target data end distribute the quota for the data, the source data end sends the data.
2. The data transmission method of claim 1, further comprising:
and if the quota response represents that one switch in the switches along the way or the target data end does not distribute the quota for the data, the source data end resends the quota request.
3. The data transmission method according to claim 1 or 2,
the quota response is a quota grant or a quota deny, wherein,
the quota grant is used for characterizing the switch along the way and the target data end to allocate the quota for the data, and the quota refusal is used for characterizing one switch in the switch along the way or the target data end not to allocate the quota for the data.
4. The data transmission method according to claim 2, wherein the data is a packet queue composed of a plurality of Ethernet packets, the quota request includes a quota application amount,
wherein, the resending the quota request by the source data side includes:
the source data terminal subtracts the quota applying amount required by a first Ethernet message from the quota applying amount in the quota request to obtain a first quota applying amount, wherein the first Ethernet message is a message positioned at the tail of the message queue;
and the source data end resends the quota request, wherein the quota request comprises the first quota application amount.
5. The data transmission method according to claim 4, wherein if the quota applying amount in the quota request is a quota applying amount required by a second ethernet packet, and the second ethernet packet is a packet located at a head of the packet queue, the source data side resends the quota request, including:
and within a time after the source data end receives the quota refusal every time, the source data end resends the quota request.
6. The data transmission method according to claim 2, wherein the data comprises a plurality of Ethernet packets, the quota request comprises an application quota amount,
wherein, the resending the quota request by the source data side includes:
and the source data end resends the quota request, wherein the quota request comprises the quota applying amount required by the Ethernet messages.
7. The data transmission method of claim 1, further comprising:
and within a first preset time after the source data end sends the quota request, if the source data end does not receive the quota response, the source data end resends the quota request after the first preset time.
8. The data transmission method according to any one of claims 1 to 7, wherein the source data side then transmits the data, including:
and the source data end sends the data within a second preset time after receiving the quota response.
9. The data transmission method according to any one of claims 1 or 3 to 8, wherein before the source data side sends a quota request, the method further comprises:
the source data end receives a trigger quota request, and the trigger quota request is used for triggering the source data end to send the quota request;
wherein, the source data side sends a quota request, including:
and the source data terminal sends the quota request according to the trigger quota request.
10. The data transmission method according to claim 9,
the triggered quota request includes an idle quota amount and a valid time of the triggered quota request.
11. The data transmission method according to any one of claims 4 to 10,
the quota request also includes the valid time of the application quota amount, and is used for requesting the switch along the way and the target data terminal to reserve the application quota amount for the valid time of the application quota amount.
12. The data transmission method according to claim 1, wherein when the data cached in the source data end occupies the cache of the source data end more than a first preset threshold, the quota request is an emergency quota request,
the source data terminal sends a quota request; the receiving, by the source data end, a quota response corresponding to the quota request includes:
the source data terminal sends the emergency quota request;
the source data end receives the quota response corresponding to the emergency quota request.
13. A method of data transmission, comprising:
the method comprises the steps that a first switch receives a quota request, the quota request is used for requesting a route switch and a target data end to be data distribution quotas of a source data end to be sent to the target data end, the quotas are used for caching the data, the route switch comprises all switches needing to pass from the source data end to the target data end, and the first switch is one of the route switches;
if the first switch has an idle quota, the first switch:
allocating the quota for the data according to the quota request, and forwarding the quota request;
receiving a quota response corresponding to the quota request, and forwarding the quota response, wherein the quota response is used for representing whether the marginal switch and the target data end distribute the quota for the data;
and receiving the data and forwarding the data, wherein the data is sent by the source data end when the quota response represents that the switch along the way and the target data end distribute the quota for the data.
14. The data transmission method of claim 13, wherein the method further comprises:
if the first switch does not have an idle quota, the first switch replies a first quota rejection corresponding to the quota request and discards the quota request, wherein the first quota rejection is used for representing that the first switch does not allocate the quota for the data.
15. The data transmission method according to claim 13 or 14,
the quota response is a quota grant or a quota deny, wherein,
the quota grant is used for characterizing the switch along the way and the target data end to allocate the quota for the data, and the quota refusal is used for characterizing one switch in the switch along the way or the target data end not to allocate the quota for the data.
16. The data transmission method according to any one of claims 13 to 15, wherein after the first switch allocates the quota for the data according to the quota request, the method further comprises:
after a first preset time, the first switch checks whether the data is cached in the quota;
and if the data is not cached in the quota, the first switch recovers the quota.
17. The data transmission method according to any one of claims 13 to 16, wherein after the first switch forwards the data, the method further comprises:
the first switch reclaims the quota.
18. The data transmission method according to any one of claims 15 to 17, wherein if the quota response is the quota denial, the method further comprises:
the first switch reclaims the quota.
19. The data transmission method according to any one of claims 13 or 15-18, wherein before the first switch receives the quota request, the method further comprises:
the first switch receives a trigger quota request, wherein the trigger quota request is used for triggering the source data terminal to send the quota request, and the trigger quota request comprises an idle quota amount and the effective time of the trigger quota request;
the first switch forwards the triggered quota request.
20. The data transmission method according to any one of claims 13 to 19,
the quota request comprises an application quota amount and effective time of the application quota amount, and is used for requesting the valid time of the application quota amount to be reserved by the switch along the way and the target data terminal.
21. The data transmission method of claim 13, wherein the first switch receiving a quota request comprises:
the first switch receives an emergency quota request, and the emergency quota request is sent by the source data terminal when the data cached in the source data terminal occupies a cache of the source data terminal and is greater than a first preset threshold value.
22. The data transmission method of claim 21, wherein the method further comprises:
if the first switch has no idle quota, the first switch:
recording the emergency quota request, and forwarding the emergency quota request;
receiving the quota response corresponding to the emergency quota request;
when an idle quota appears in the first switch, allocating the quota for the data according to the emergency quota request;
when the quota response characterizes the switch along the way and the target data terminal to allocate the quota for the data, forwarding the quota response, receiving the data, and forwarding the data, or,
and when the quota response represents that the target data end does not distribute the quota for the data, forwarding the quota response and recovering the quota.
23. The data transmission method of claim 22, wherein the method further comprises:
when the quota response represents that all switches required to pass between the first switch and the target data end allocate the quota for the data, and the first switch does not allocate the quota for the data, the first switch:
setting a quota allocation identifier according to the quota response, and discarding the quota response, where the quota allocation identifier is used to identify all switches and the target data end that need to pass between the first switch and the target data end to allocate the quota for the data,
after waiting for an idle quota to appear in the first switch, allocating the quota for the data according to the emergency quota request,
generating a quota grant and sending the quota grant, the quota grant being used to characterize the first switch, all switches that need to pass between the first switch and the target data end, and the target data end to allocate the quota for the data,
receiving the data and forwarding the data; or,
when the quota response represents that the target data end does not allocate the quota for the data and the first switch does not allocate the quota for the data, the first switch forwards the quota response and discards the emergency quota request.
24. A data transmission apparatus, comprising:
a sending unit, configured to send a quota request, where the quota request is used to request a switch along a route and a target data end to allocate a quota for data that needs to be sent to the target data end by the data transmission device, where the quota is used to cache the data, and the switch along the route includes all switches that need to pass from the data transmission device to the target data end;
a receiving unit, configured to receive a quota response corresponding to the quota request sent by the sending unit, where the quota response is used to characterize whether the switch and the target data end along the route allocate the quota for the data;
the sending unit is further configured to send the data if the quota response received by the receiving unit represents that the quota is allocated to the data by the switch along the way and the target data end.
25. The data transmission apparatus of claim 24,
the sending unit is further configured to resend the quota request if the quota response received by the receiving unit indicates that one switch in the switches along the way or the target data end does not allocate the quota for the data.
26. The data transmission apparatus according to claim 24 or 25,
the quota response received by the receiving unit is a quota grant or a quota denial, wherein,
the quota grant is used for characterizing the switch along the way and the target data end to allocate the quota for the data, and the quota refusal is used for characterizing one switch in the switch along the way or the target data end not to allocate the quota for the data.
27. The data transmission apparatus according to claim 25, wherein the data transmission apparatus further comprises a processing unit, the data is a packet queue composed of a plurality of ethernet packets, the quota request sent by the sending unit includes a quota application amount,
the processing unit is configured to subtract an applied quota amount required by a first ethernet packet from an applied quota amount in the quota request to obtain a first applied quota amount, where the first ethernet packet is a packet located at the tail of the packet queue;
the sending unit is specifically configured to resend the quota request, where the quota request includes the first application quota amount.
28. The data transmission apparatus of claim 27,
the sending unit is specifically configured to, if the quota applying amount in the quota request is the quota applying amount required by the second ethernet packet, and the second ethernet packet is a packet located at the head of the packet queue, resend the quota request within a time after the receiving unit receives the quota refusal each time.
29. The data transmission apparatus according to claim 25, wherein the data includes a plurality of Ethernet messages, the quota request sent by the sending unit includes an amount of quota application,
the sending unit is specifically configured to resend the quota request, where the quota request includes an amount of quota application required by the multiple ethernet packets.
30. The data transmission apparatus of claim 24,
the sending unit is further configured to, within a first preset time after the quota request is sent, if the receiving unit does not receive the quota response, resend the quota request after the first preset time.
31. The data transmission apparatus according to any one of claims 24 to 30,
the sending unit is specifically configured to send the data within a second preset time after the receiving unit receives the quota response.
32. The data transmission apparatus of any one of claims 24 or 26-31,
the receiving unit is further configured to receive a trigger quota request before the sending unit sends a quota request, where the trigger quota request is used to trigger the data transmission apparatus to send the quota request;
the sending unit is specifically configured to send the quota request according to the triggered quota request received by the receiving unit.
33. The data transmission apparatus of claim 32,
the triggered quota request received by the receiving unit includes an idle quota amount and an effective time of the triggered quota request.
34. The data transmission apparatus according to any one of claims 27 to 33,
the quota request sent by the sending unit further includes valid time of the application quota amount, and is used for requesting the switch along the way and the target data terminal to reserve the application quota amount for the valid time of the application quota amount.
35. The data transmission apparatus of claim 24,
the sending unit is specifically configured to send an emergency quota request when the data cached in the data transmission device occupies the cache of the data transmission device and is greater than a first preset threshold;
the receiving unit is specifically configured to receive the quota response corresponding to the emergency quota request sent by the sending unit.
36. A data transmission apparatus, comprising:
a receiving unit, configured to receive a quota request, receive a quota response corresponding to the quota request, and receive data that needs to be sent by a source data end to a target data end, where the quota request is used to request a data transmission device and the target data end to allocate a quota for the data, the quota is used to cache the data, the data transmission device includes all data transmission devices that need to pass through from the source data end to the target data end, the data transmission device is one of the data transmission devices, the quota response is used to characterize whether the data transmission device and the target data end allocate the quota for the data, and the data is when the quota response characterizes that the data transmission device and the target data end allocate the quota for the data, the source data end sends the data;
an allocating unit, configured to allocate, if there is an idle quota in the data transmission apparatus, the quota to the data according to the quota request received by the receiving unit;
and the sending unit is used for forwarding the quota request, forwarding the quota response and forwarding the data.
37. The data transmission apparatus according to claim 36, wherein the data transmission apparatus further comprises a discarding unit,
the sending unit is further configured to reply a first quota refusal corresponding to the quota request received by the receiving unit if no idle quota exists in the data transmission device, where the first quota refusal is used to characterize that the data transmission device does not allocate the quota for the data;
the discarding unit is configured to discard the quota request received by the receiving unit.
38. The data transmission apparatus according to claim 36 or 37,
the quota response received by the receiving unit is a quota grant or a quota denial, wherein,
the quota grant is used for characterizing the data transmission device and the target data end to allocate the quota for the data, and the quota refusal is used for characterizing one data transmission device in the data transmission device or the target data end does not allocate the quota for the data.
39. The data transmission apparatus according to any one of claims 36 to 38, wherein the data transmission apparatus further comprises a processing unit,
the processing unit is configured to check whether the data is cached in the quota after a first preset time after the allocating unit allocates the quota to the data according to the quota request, and recover the quota if the data is not cached in the quota.
40. The data transmission apparatus of claim 39,
the processing unit is further configured to recover the quota after the sending unit forwards the data.
41. The data transmission apparatus according to claim 39 or 40,
the processing unit is further configured to recover the quota if the quota response received by the receiving unit is the quota refusal.
42. The data transmission apparatus of any one of claims 36 or 38-41,
the receiving unit is further configured to receive a trigger quota request before receiving a quota request, where the trigger quota request is used to trigger the source data terminal to send the quota request, and the trigger quota request includes an idle quota amount and an effective time of the trigger quota request;
the sending unit is further configured to forward the trigger quota request received by the receiving unit.
43. The data transmission apparatus according to any one of claims 36 to 42,
the quota request received by the receiving unit includes an application quota amount and valid time of the application quota amount, and is used for requesting the data transmission device and the target data terminal to reserve the application quota amount for the valid time of the application quota amount.
44. The data transmission apparatus of claim 36,
the receiving unit is specifically configured to receive an emergency quota request, where the emergency quota request is sent by the source data end when data cached in the source data end occupies a cache of the source data end and is greater than a first preset threshold.
45. The data transmission apparatus of claim 44, wherein the data transmission apparatus further comprises a processing unit,
the processing unit is configured to record the emergency quota request received by the receiving unit if there is no free quota in the data transmission apparatus, and recover the quota when the quota response received by the receiving unit, corresponding to the emergency quota request, indicates that the target data end does not allocate the quota for the data;
the sending unit is further configured to forward the emergency quota request received by the receiving unit, and forward the quota response and forward the data when the quota response received by the receiving unit represents that the quota is allocated to the data by the data transmission device and the target data terminal along the way;
the receiving unit is further configured to receive the quota response and receive the data;
the allocating unit is further configured to allocate the quota to the data according to the emergency quota request received by the receiving unit when an idle quota occurs in the data transmission apparatus.
46. The data transmission apparatus according to claim 45, wherein the data transmission apparatus further comprises a discarding unit,
the processing unit is further configured to, when the quota response received by the receiving unit indicates that all data transmission devices and the target data peer that need to pass between the data transmission device and the target data peer allocate the quota for the data, and the data transmission device does not allocate the quota for the data, set a quota allocation identifier according to the quota response, and generate a quota grant, where the quota allocation identifier is used to identify all switches and the target data peer that need to pass between the data transmission device and the target data peer to allocate the quota for the data, and the quota grant is used to indicate that the data transmission device, all data transmission devices and the target data peer that need to pass between the data transmission device and the target data peer allocate the quota for the data,
the discarding unit is configured to discard the quota response received by the receiving unit,
the allocating unit is further configured to allocate the quota to the data according to the emergency quota request received by the receiving unit after waiting for an idle quota appearing in the data transmission apparatus,
the receiving unit is further configured to receive the data,
the sending unit is further configured to send the quota grant and forward the data received by the receiving unit; or,
the sending unit is further configured to forward the quota response when the quota response indicates that the target data end does not allocate the quota for the data, and the data transmission apparatus does not allocate the quota for the data,
the discarding unit is configured to discard the emergency quota request received by the receiving unit.
47. A data transmission system, comprising:
data transmission apparatus according to any one of claims 24 to 35, at least one data transmission apparatus according to any one of claims 36 to 46, and a target data terminal,
the data transmission apparatus according to any one of claims 24 to 35 is a source data terminal, the at least one data transmission apparatus according to any one of claims 36 to 46 is a switch, and data is transmitted between the source data terminal and the destination data terminal through the switch.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410234515.8A CN104022961A (en) | 2014-05-29 | 2014-05-29 | Data transmission method, apparatus and system |
PCT/CN2014/091382 WO2015180426A1 (en) | 2014-05-29 | 2014-11-18 | Data transmission method, device, and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410234515.8A CN104022961A (en) | 2014-05-29 | 2014-05-29 | Data transmission method, apparatus and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN104022961A true CN104022961A (en) | 2014-09-03 |
Family
ID=51439535
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410234515.8A Pending CN104022961A (en) | 2014-05-29 | 2014-05-29 | Data transmission method, apparatus and system |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN104022961A (en) |
WO (1) | WO2015180426A1 (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104917694A (en) * | 2015-06-15 | 2015-09-16 | 上海斐讯数据通信技术有限公司 | Flow control method based on priority |
WO2015180426A1 (en) * | 2014-05-29 | 2015-12-03 | 华为技术有限公司 | Data transmission method, device, and system |
CN113852589A (en) * | 2020-06-28 | 2021-12-28 | 华为技术有限公司 | Method, apparatus and medium for data transmission and data reception |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112597075B (en) * | 2020-12-28 | 2023-02-17 | 成都海光集成电路设计有限公司 | Cache allocation method for router, network on chip and electronic equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050240681A1 (en) * | 2004-04-27 | 2005-10-27 | Hitachi, Ltd. | Communication device, storage system and a communication method |
KR20090047426A (en) * | 2009-04-16 | 2009-05-12 | 정영삼 | The methodology of transmmting live data that uses p2p relays and server's resource concurrently |
CN102377662A (en) * | 2010-08-25 | 2012-03-14 | 北京中星微电子有限公司 | Routing cache negotiation method and system facing to bandwidth adaptation in video monitoring |
JP2012100165A (en) * | 2010-11-04 | 2012-05-24 | Tokyo Broadcasting System Television Inc | Data transmission system and multi-point data distribution system |
CN103840910A (en) * | 2012-11-22 | 2014-06-04 | 深圳市腾讯计算机系统有限公司 | Data transmission control method and apparatus |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
DE50014591D1 (en) * | 2000-11-27 | 2007-10-04 | Siemens Ag | Bandwidth reservation in data networks |
US9813529B2 (en) * | 2011-04-28 | 2017-11-07 | Microsoft Technology Licensing, Llc | Effective circuits in packet-switched networks |
CN102447736B (en) * | 2011-11-17 | 2013-12-18 | 华中科技大学 | Management and control method for user quota in multi-network storage system |
CN104022961A (en) * | 2014-05-29 | 2014-09-03 | 华为技术有限公司 | Data transmission method, apparatus and system |
-
2014
- 2014-05-29 CN CN201410234515.8A patent/CN104022961A/en active Pending
- 2014-11-18 WO PCT/CN2014/091382 patent/WO2015180426A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050240681A1 (en) * | 2004-04-27 | 2005-10-27 | Hitachi, Ltd. | Communication device, storage system and a communication method |
KR20090047426A (en) * | 2009-04-16 | 2009-05-12 | 정영삼 | The methodology of transmmting live data that uses p2p relays and server's resource concurrently |
CN102377662A (en) * | 2010-08-25 | 2012-03-14 | 北京中星微电子有限公司 | Routing cache negotiation method and system facing to bandwidth adaptation in video monitoring |
JP2012100165A (en) * | 2010-11-04 | 2012-05-24 | Tokyo Broadcasting System Television Inc | Data transmission system and multi-point data distribution system |
CN103840910A (en) * | 2012-11-22 | 2014-06-04 | 深圳市腾讯计算机系统有限公司 | Data transmission control method and apparatus |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2015180426A1 (en) * | 2014-05-29 | 2015-12-03 | 华为技术有限公司 | Data transmission method, device, and system |
CN104917694A (en) * | 2015-06-15 | 2015-09-16 | 上海斐讯数据通信技术有限公司 | Flow control method based on priority |
CN113852589A (en) * | 2020-06-28 | 2021-12-28 | 华为技术有限公司 | Method, apparatus and medium for data transmission and data reception |
CN113852589B (en) * | 2020-06-28 | 2023-10-24 | 华为技术有限公司 | Method, apparatus and medium for data transmission and data reception |
Also Published As
Publication number | Publication date |
---|---|
WO2015180426A1 (en) | 2015-12-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10779195B2 (en) | Information transmission method and apparatus | |
US8553708B2 (en) | Bandwith allocation method and routing device | |
US11997529B2 (en) | Wireless communication method and apparatus | |
US8730813B2 (en) | Apparatus for performing packet-shaping on a packet flow | |
CN109314673B (en) | Customer service transmission method and device | |
CN112448885A (en) | Method and device for transmitting service message | |
WO2019105317A1 (en) | Method for sending service packet, network device, and system | |
JP7487316B2 (en) | Service level configuration method and apparatus | |
US10911364B2 (en) | Packet processing method and router | |
CN104022961A (en) | Data transmission method, apparatus and system | |
CN112838992B (en) | Message scheduling method and network equipment | |
EP4068709A1 (en) | Network slice message transmission method, electronic device and storage medium | |
US20200153726A1 (en) | Method and apparatus for dynamic track allocation in a network | |
JP4536047B2 (en) | Admission control apparatus and method | |
CN106664610B (en) | Network controller, system and resource allocation method | |
CN114070776B (en) | Improved time-sensitive network data transmission method, device and equipment | |
JP6211257B2 (en) | Communications system | |
JPH1132083A (en) | Exchanging network and exchanging device | |
CN114363434A (en) | Video frame sending method and network equipment | |
KR100938003B1 (en) | Method of routing information management in Multi-protocol Label Switching router and apparatus therefor | |
JP4977677B2 (en) | Edge node and bandwidth control method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20140903 |
|
RJ01 | Rejection of invention patent application after publication |