Lainbo

Lainbo's Blog

If you’re nothing without the suit, then you shouldn't have it.
github
email
follow

Is your optimized line server for small and large packets?

When choosing a server, some vendors claim how good their lines are, stable during peak hours, and provide an excellent 24-hour latency test chart. But is this really reliable?
image

What is "Small and Large Packets"?#

"Small and Large Packets" refers to some VPS providers using different network routing strategies based on packet size:

  • Small packets: Usually take optimized routes, which is often advertised by the provider.
  • Large packets: May take non-optimized routes, leading to performance degradation, but at a lower cost for the provider.

To explain in simpler terms:
MTU can be thought of as the size of a truck; your data packet is like a package. A larger truck can carry bigger packages, while a smaller truck can still transport larger packages by breaking them down into smaller ones, just less efficiently.

However, some vendors will have you send small packages on the highway while large packages take the dirt road. When you ping test the route, it’s all small packages, making you think it’s on the highway. Only when you actually start using it do you realize it’s on the dirt road.

A Routing Diagram of a "Dirt Road" Hong Kong Server#

Clearly, it could connect directly from Guangzhou to Hong Kong, but it instead takes a detour through the United States.
image

A Routing Diagram of a "Highway" Hong Kong Server#

Directly connects from Guangzhou to Hong Kong without any detours.
image

Why Ping Tests Can Be Deceptive#

Providers that use small and large packets may allow you to connect directly on the optimized route when you transmit small data packets (pinging the server), but once you start actual usage (which usually involves large packets), they switch you to the dirt road. If the provider is unscrupulous, you may not get a true representation of the actual experience when you ping.

How to Detect Small and Large Packets#

We can use NTrace-core to check if there are small and large packet routing issues with the VPS. Here are the specific steps:

  1. Installation:

    curl nxtrace.org/nt | bash
    
  2. Run the test command:

    nexttrace --tcp --psize 12 202.96.209.133:80 && nexttrace --tcp --psize 1452 202.96.209.133:80
    

    This command will send two tests to the IP address located at Shanghai Telecom:

    • The first sends a small packet of 12KB
    • The second sends a large packet of 1452KB
  3. Compare the two output results to observe if the routes are the same. If the routes are different, there is likely a small and large packet issue.

Notes#

  1. The reason for using 1452KB for the packet size is that overly large packets may exceed the size of Ethernet frames. You can check the MTU of the network card; using excessively large packets is meaningless as they will be fragmented. A packet size of 1452 bytes is a suitable choice after considering various network protocol overheads.
    1452 bytes = 1518-18-8-20-20
    That is: Ethernet frame size - frame header and trailer - possible dial-up information - IP information - TCP protocol header
    
  2. All the test route images in this article are generated by NTrace-core, which is the same tool mentioned earlier for testing small and large packets.
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.