Charles-simulating weak network environment

When doing weak network testing, it is often necessary to simulate various network environments. Charles happens to provide the function of network limitation. We can find it under the path of "Proxy-> Throttle Settings", as shown in the following figure.

"Throttle Settings" provides a master switch, check "Enable Throttling" to enable the network restriction function. Below it, you can add the hosts that we want to restrict the network, and check "Only for selected hosts", to limit the network of the hosts only.

Charles provides a lot of preset network conditions, you can find them in "Throttle preset", including 56kbps-100Mbps, 3G, 4G, etc. These preset network conditions actually affect the following parameters-Bandwidth, Utilisation, Round-trip latency, MTU. In addition, there are Reliability, Stability, Unstable quality range for us to limit the network more flexibly.

After configuring the network parameters, in order to facilitate our repeated use in the future, click the "Export" button to export the parameters to an xml file, and import the file again to restore the configured parameters immediately.

The following table explains the network parameters:

parameter Explanation
Bandwidth

Bandwidth defines the maximum amount of data that can be transmitted over a period of time. It is specified in units of thousands of bits per second. You can specify different bandwidth limits for upload and download links.

use

Utilization is the percentage of the total bandwidth that can be used at one time. It only serves as a scale factor for available bandwidth. For most current network environments, the usage rate is always 100%.

Round-trip latency

Round-trip delay, which measures the latency (in milliseconds) of the first round-trip communication between the client and the remote server. Each request is only applied once from the client to the server.

MAN

MTU is the maximum transmission unit, which is the maximum size of TCP packets in any transmission . Specifying the MTU will not change the available bandwidth, but Charles will allocate bandwidth in MTU-sized blocks, resulting in packet fragmentation in each transmission.

Reliability

Reliability is an indicator of the possibility of a complete connection failure. This is useful for simulating unreliable network conditions. Reliability is specified as the probability of successfully transmitting a 10KiB message, so a value of 50% means that half of all 10KiB transmissions will succeed. Larger messages or smaller messages may fail more or less, so the success rate of 20KiB transmission is only 25%, and the success rate of 5KiB transmission is about 70%.

Stability

Stability is a measure of the likelihood that a connection is "unstable" and therefore reduces quality. This is very useful for simulating networks with poor periodic connection quality, such as mobile networks. If the connection is unstable, the quality of the connection will randomly fall within the unstable quality range.

Unstable quality range

Unstable quality range, used with Stability.

Guess you like

Origin www.cnblogs.com/zhuosanxun/p/12694267.html