This topic provides the reasons why the traffic amount that is found by using the monitoring and usage analytics feature or the usage statistics feature provided by Alibaba Cloud CDN or Dynamic Route for CDN (DCDN) is different from the traffic amount that is logged.
Symptoms
Why is the traffic amount found by using the monitoring and usage analytics feature or the usage statistics feature in the Alibaba Cloud CDN or DCDN console or by calling API operations different from the traffic amount that is logged? In most cases, the traffic amount that is logged is less than the traffic amount that is found by using the monitoring and usage analytics feature or the usage statistics feature.
Causes
- Insertion of TCP and IP packet headers
HTTP requests are transmitted based on the TCP or IP protocol. The maximum transmission unit (MTU) over the Internet is 1,500 bytes. The TCP or IP headers occupy 40 bytes in the MTU. The TCP or IP headers are inserted by the OS based on the TCP or IP protocol. Therefore, the traffic that is consumed when the TCP or IP headers are inserted is not collected at the application layer and is not logged. The ratio of the traffic amount that is consumed when the TCP or IP headers are inserted to the total traffic amount that is logged is greater than 2, 74% (40/(1,500-40)). In most cases, the ratio is approximately 3%.
- Retransmission of TCP packets
In most cases, about 3% to 10% of packets that are transmitted over the Internet are lost due to physical network conditions. If TCP packets are lost when they are transmitted over the Internet, the OS retransmits the required number of TCP packets based on the TCP protocol. However, the traffic that is consumed when the OS retransmits TCP packets cannot be collected at the application layer. The ratio of the traffic amount that is consumed when the OS retransmits TCP packets to the total traffic amount that is logged varies based on the load on the Internet. In most cases, the ratio is less in the morning because the load on the Internet is not heavy. However, the ratio is approximately 3% to 7% in the evening when the load on the Internet significantly increases.
Therefore, the actual traffic amount is the sum of the traffic amount that is recorded by the response size field in logs and 7% to 15% of the additional traffic. Bills are generated based on the actual traffic amount. Alibaba Cloud CDN or DCDN includes only 10% of the additional traffic to the actual traffic amount. Therefore, you are charged for the actual traffic amount that is 1.1 times of the traffic amount recorded by the response size field in logs.