The present invention relates to a packet communication method and a packet communication device.
In cloud computing commonly known as cloud, a user uses a computer resource in an external data center, which is away from user's location. Data is also stored in the data center, and therefore data is frequently exchanged between user's location and the data center.
A data center is located around the world and is not necessarily always located in the same country. For example, a utility fee of an overseas data center is sometimes more inexpensive, and therefore the overseas data center is actively used.
Data might be transferred at low speed when an overseas data center is used. In communication with overseas, a round trip time (RTT) which is a time from transmitting a packet to receiving a response is long. In this case, there is a problem that a communication speed slows down in a general communication method.
With respect to this problem, in PTL 1, a high speed communication is realized by controlling a transmission data amount regardless of an RTT. In this method, the transmission data amount is controlled by monitoring a change in a packet loss rate. Also, in this method, information on such as a negative acknowledgement (NACK) transmitted and received between a transmitting device and a receiving device corresponding to this method is used for measuring the packet loss rate.
Also, a quality measurement packet is used as a method for measuring a packet loss rate in PTL 2. First, a receiving probe adds a packet reception counter to a quality measurement packet received from a transmission probe and returns the quality measurement packet to a transmission prove. Then, the transmission probe extracts a number of reception packets from the received quality measurement packet. A packet loss rate (packet discard rate) is calculated by calculating a difference between a packet transmission counter and a packet reception counter and a difference between the reception packet counter extracted and a packet return counter, after all quality measurement packets are received.
In PTL 1, a high speed communication is realized by controlling a transmission data amount by monitoring a change in a packet loss rate. However, communication terminals on a transmission side and a reception side need to respond to a communication method described in PTL 1, such as using a NACK for confirming data reception. However, not all communication terminals are corresponding to this communication method. Therefore, for example, a terminal using a general communication method as described in NPL 1 and NPL 2 is used in a communication. Therefore, it is necessary to measure a packet loss rate by using information obtained by a general communication method to control a transmission data amount based on a change in the packet loss rate in a communication with a terminal not corresponding to the communication method described in PTL 1.
Also, in the packet loss rate measurement method described in PTL 2, it is necessary to embed special information in a packet, and therefore both of a transmission terminal and a reception terminal need to correspond to the method. On the other hand, in the case where a communication partner is a general system, such information is not embedded, and therefore it is hard to measure an accurate loss rate.
An object of the present invention is to measure a packet loss rate by using information included in a general communication protocol.
To achieve the above object, a communication device connected to a network is provided from one aspect of the present invention. The communication device includes: a transmission unit configured to transmit a packet to other communication device via the network; a reception unit configured to receive, from the other communication device via the network, an acknowledgement (ACK) packet including information on a selective acknowledgement (SACK) and information on an ACK with respect to a packet transmitted from the transmission unit; a packet counting unit configured to count a number of transmission packets, which is a number of packets transmitted from the transmission unit; and a loss rate measurement unit configured to measure a loss rate of a packet transmitted from the transmission unit in a predetermined period based on the number of transmission packets and information on the ACK and the SACK.
Preferably, the packet counting unit counts a number of retransmission request packets, which is a number of packets requested to be retransmitted in packets transmitted from the transmission unit, based on information on the ACK and the SACK, and the loss rate measurement unit measures the loss rate based on the number of transmission packets and the number of retransmission request packets.
Also, the packet counting unit counts a number of ACK packets, which is a number of ACK packets received by the reception unit, and a number of duplicate packets in ACK packets received by the reception unit, which is a number of the ACK packets in which information on the SACK corresponds to information on the SACK of an ACK packet received just before the ACK packet, and the loss rate measurement unit measures the loss rate based on the number of transmission packets, the number of ACK packets, and the number of duplicate packets.
Further preferably, the loss rate measurement unit changes a method for measuring a loss rate depending on a level of a loss rate.
According to other aspect of the present invention, a packet loss rate measuring method for measuring a loss rate of a packet transmitted from a communication device to a network is provided. The packet loss rate measuring method includes: measuring a number of transmission packets, which is a number of packets transmitted from the communication device to the network; and measuring a loss rate of a packet transmitted from the communication device to the network in a predetermined period based on the number of transmission packets and information on the SACK and an ACK included in an ACK packet received by the communication device via the network.
Further preferably, the packet loss rate measuring method includes: measuring a number of retransmission request packets, which is a number of packets requested to be retransmitted in packets transmitted to the network, based on information on the ACK and the SACK, and measuring a loss rate based on the number of transmission packets and the number of retransmission request packets.
Also, the packet loss rate measuring method includes: measuring a number of ACK packets, which is a number of ACK packets received by the communication device, and a number of duplicate packets in ACK packets received by the communication device, which is a number of ACK packets in which information on the SACK corresponds to information on the SACK of an ACK packet received just before the ACK packet; and measuring the loss rate based on the number of transmission packets, the number of ACK packets, and the number of duplicate packets.
Further preferably, a method for measuring a loss rate is changed depending on a level of a loss rate.
According to the present invention, an accurate packet loss rate can be measured even if a general communication protocol is used.
Also, a number of transmission packets is counted by a snd counter 20 in the packet counting unit. The packet counting unit 15 analyzes information on a received ACK and a SACK associated with the ACK, and an rts counter 21 counts a number of packets requested to be retransmitted (a number of discarded packets).
Based on the value, the loss rate calculation unit 16 calculates a loss rate as loss_ratio=rts/snd by using a number of transmission packets snd and a number of retransmission request packets rts. This calculation is performed at arbitrary intervals. After calculation, the snd counter 20 and the rts counter 21 are set to 0. A calculation result of the loss rate is transmitted to the transmission control unit 17 and a transmission data amount is adjusted.
As another calculation method, since a number of ACK packets ack indicates a number of accurately received packets, a loss rate can be set as a value subtracting a rate of accurately received packets from 1 and calculated as loss_ratio=1−ack/snd. However, according to RFC 1122 (NPL 1), ACK packets can be transmitted while being thinned out. Therefore, this calculation method does not always accurately calculate in the case where ACK packets are transmitted while being thinned out.
The transmission terminal 1 transmits a packet with a sequence number “700” (102) and a packet with a sequence number “800” (103) before the ACK is returned, and these packets are also accurately received by the reception terminal 2. Herein, the reception terminal 2 uses a delayed ACK specified in RFC 1122, and an ACK is transmitted while being thinned out. Therefore, the reception terminal 2 does not transmit an ACK even if it receives the packet with a sequence number “700”. The reception terminal 2 transmits an ACK number “900” (110) when it receives a packet with a sequence number “800”, Regarding packets with sequence numbers “900” (104) and “1000” (105), the reception terminal 2 also transmits an ACK number “1000” (111).
It is assumed that a following packet with a sequence number “1100” (106) is discarded in a network. This packet is not received by the reception terminal 2. Furthermore, a subsequent packet with a sequence number “1200” (107) is accurately received, and packets held by the reception terminal 2 have omissions. In such a case, according to RFC 2018 (NPL 1), the reception terminal 2 transmits a SACK which is a selective acknowledgement. The SACK is information associated with an ACK and indicates a starting edge and a terminal edge of discontinuous packets in the packets held by the reception terminal 2. Herein, in addition to an ACK number “1100”, a SACK block “1200-1300” is notified to the transmission terminal 1 (112).
Then, when the reception terminal 2 receives a packet with a sequence number “1300” (108), an ACK number “1100” and a SACK block “1200-1400” are notified to the transmission terminal 1 (113). The transmission terminal 1 can know a packet discarded in a network by this SACK and retransmits only the packet.
If a subsequent packet is accurately received after a SACK is generated, SACK right edges of the SACK block increase. On the other hand, when a subsequent packet is discarded, another SACK block is newly notified in addition to the SACK block. This is called a new SACK block. Conversely, in the case where the new SACK block is notified, it means a loss occurs. Specifically, when the new SACK block is notified, a difference from a value of a SACK left edge to a value closest to either an ACK which has been notified or a SACK right edge a SACK block is a segment number of discarded packets. A number of discarded packets is a value dividing the number of segments by a packet size.
Although the embodiment illustrates an example that the original TCP function 3 is incorporated into the transmission terminal 1, in the case where the original TCP function 3 cannot be mounted to the transmission terminal 1, a proxy device 5 including the original TCP function 3 in a local area network (LAN) 46, which is the same as a LAN of the transmission terminal 1, can be installed and used as illustrated in
In the embodiment and following embodiments, only the case where the original TCP function 3 is incorporated into the transmission terminal 1 is described to simplify a description. However, similar effects can be obtained in the case where a proxy device is used by using the same elements as used in each embodiment in the original TCP function 3.
A second embodiment is assumed that a packet loss rate is high, and a large amount of SACK blocks generates. In this case, if further packet loss occurs during reception of a new packet by the reception terminal 2, a new SACK block is generated. However, in general mounting, a storage area of a SACK block is limited in capacity, and the capacity reaches a limit at a certain quantity. Two operation patterns can be considered as such a case. One is that the reception terminal 2 does not return an ACK, and another is that all SACK blocks are not changed although an ACK with a SACK is returned.
Also, in the case where the number of SACK blocks falls below a certain number by retransmitting a part of packets when the number of SACK blocks reaches a limit, new packets which have been sent are discarded since the number of SACK blocks reaches a limit. However, new packets which have been sent afterward are received since a new SACK block can be made, and a new SACK block is generated. At this time, a value calculated as an rts becomes considerably large in a method according to the first embodiment. In the case where a calculation is performed at a certain interval, a loss generated in a previous section is calculated as an rts in this interval, and therefore an rts might exceed a snd. Therefore, an accurate loss rate cannot be measured.
The transmission terminal 1 transmits a packet with a sequence number “700” in the time between (122). This packet is discarded in a network. Also, the transmission terminal 1 transmits a packet with a sequence number “800” (123), and the packet reaches the reception terminal 2. Although a new SACK block is supposed to be generated, a storage area of a SACK block has a limit in capacity, and therefore the reception terminal 2 cannot hold a new SACK block, and notifies the transmission terminal 1 of an ACK number “100” and SACK numbers “600-700, 400-500, . . . ” with the previous ACK packet (129). Equivalent ACK and SACK are returned with respect to a packet with a sequence number “900” (124) (130). After that, packets by a sequence number “2900” are supposed to be sent and wholly discarded in the reception terminal 2.
Then, the transmission terminal 1 retransmits a packet with a sequence number “500” (125). In this manner, the SACK blocks of “400-500” and “600-700” are connected each other and become the new SACK block “400-700”, and this is notified (131). A number of SACK blocks held by the reception terminal 2 is reduced, and therefore a new packet can be received.
At this point, the transmission terminal 1 transmits a new packet “3000” (126). The reception terminal 2 receives the new packet, and new SACK block “3000-3100” are notified (132). A packet with a sequence number “3100” (127) is also correctively received, and a SACK number “3000-3200” is returned (133).
Herein, as illustrated in
In the second embodiment, a configuration illustrated in a functional block diagram in
A loss rate calculation unit 16 calculates a loss rate based on a result of the value. The loss rate is calculated as a value subtracting a rate of accurately received packets from 1. However, packets discarded in a reception terminal are not received due to a limit of a storage capacity, and therefore the packets are excluded from a number of accurately received packets. Therefore, a loss rate is calculated as loss_ratio=1−(ack−sack.dup)/snd. This calculation formula responds to both of a case that an ACK is not returned and a case that all SACK blocks does not change although an ACK with SACK is returned.
In the second embodiment, it has been described that the method according to the first embodiment has not been suitable when a loss rate has been high. On the other hand, the method according to the second embodiment is not suitable when a loss rate is low. This is because, although ACK packets can be thinned and transmitted according to the RFC 1122, a loss rate is calculated by using a number of ACK packets in the method described in the second embodiment, and the loss rate cannot be accurately calculated if the ACK packets are thinned out.
Therefore, it is effective to switch these formulas to accurately measure a loss rate during either a low loss rate or a high loss rate. A relation among a number of transmission packets snd and a number of ACK packets ack, and a number of retransmission request packets rts is supposed to be snd=ack+rts. Therefore, for example, the formula is switched based on this relation.
As a method for accurately measuring a loss rate in a unified method in comparison with the first to the third embodiments, there is a method to count a number of segments newly confirmed reception by an ACK or a SACK.
A loss rate calculation unit 16 calculates a loss rate as loss_ratio=1−ack.real/snd.
In this method, a loss rate can be accurately measured by a unified method in comparison with the first to third embodiments. Therefore, this method is effective when a transmission terminal 1 has a sufficient computing performance.
A method for controlling a transmission band by using a loss rate calculated in any of the first to fourth embodiments is described in a fifth embodiment. Also, the method according to the embodiment can be applied in the case where an original TCP function 3 is incorporated in a transmission terminal 1 and in the case where a proxy device 5 is used.
Therefore, the transmission control unit 17 includes a token bucket 329 and a timer 330, and also a storage unit 332 for storing values necessary for calculating a token and a token updating unit 331 for calculating a token. The storage unit includes a loss_ratio storage unit 333, an old_loss_ratio storage unit 334, a reference time storage unit 335, a token storage unit 336, an old_token storage unit 337, a tmp_token storage unit 338, and an old_ack_seg storage unit 339. The loss_ratio storage unit 333 holds a loss rate calculated by the loss rate calculation unit 16. The old_loss_ratio storage unit 334 stores a loss_ratio rate before a token is updated. The reference time storage unit 335 stores a reference time of a next token updating time. The token storage unit 336 stores a current token value. The old_token storage unit 337 stores a token value before a token is updated. The tmp_token storage unit 338 temporarily stores a token value when the value is transferred to an old_token. The old_ack_seg storage unit 339 stores an ACK number before a token is updated.
Next, the transmission control unit 17 checks whether a top of sequence number of ACK unconfirmed data is changed (343). In the case that the number has been changed, the transmission control unit 17 checks whether unsent data is stored in a buffer (344), and a token is set to an ACK reception amount if unsent data is stored.
If a sequence number has advanced in 343, the transmission control unit 17 checks whether K times of old_loss_ratio is larger than a loss_ratio with respect to a predetermined constant K which is equal to or greater than 1 (348). If it has been larger, a token is reduced so as to be lower than an old_token based on an rts. For example, token←old_token-rts (349). In 348, if K times of old_loss_ratio is smaller than a loss_ratio, a token is increased by an arbitrary amount (350).
After 345, 349, and 350, a loss_ratio is substituted for an old_loss_ratio, a tmp_token is substituted for an old_token, and a current ACK number is substituted for an old_ack_seg (346), and a reference time is updated (347) and a token bucket 329 is updated (348).
Number | Date | Country | Kind |
---|---|---|---|
2013-023999 | Feb 2013 | JP | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2013/078895 | 10/25/2013 | WO | 00 |