Network virtualization update(FR)

Perfecto Command

mobile:vnetwork:update

Purpose

Updates the network virtualization for the device with the specified conditions. For any condition that is not specified, the system will continue to use the existing value.

For network conditions testing, the device used is connected to the Web via Perfecto WiFi. Setup is completed by Perfecto.

Use the Network virtualizationstart and update commands to activate and update the network conditions. Without this activation, there is no effect on the device communication to the web.

Selecting latency effects both in and out traffic. For example, selecting latency of 100 results in the actual latency being 200 (100 each way).

For typical network emulation values, see Network conditions for network virtualization.

The following table lists emulation values of problematic networks.

Problematic Level Packet loss (%) Corruption (%) Duplication (%) Reorder
Steady Network  1 0 0 2
Noisy Network  2 2 0 5
Unstable Network 3 3 2 10
Very Unstable Network 5 5 5 20

Parameters

Name Type Possible Values Description
latency Integer  0-8000ms Latency applied on packets in the Network.
packetLoss Integer 0-100%

Network packet loss..

A reasonable packet loss value should not exceed 5%.

bandwidth.in Integer Limitation on the allowed download network bandwidth into the device.
Effective values are in the range of 3-100,000 Kbps, or unlimited.
bandwidth.out Integer Limitation on the allowed upload network bandwidth from the device.
Effective values are in the range of 3-100,000 Kbps, or unlimited.
packetCorruption Integer 0-100%

Network packet corruption.
A reasonable packet corruption value should not exceed 5%.

packetReordering Integer 0-100%

The percentage of network packets sent immediately without any delay.
Used alongside the Latency parameter. Moreover, the packets that are sent immediately will arrive earlier than the packets that were delayed by the defined latency value, essentially creating a packet reordering.
A reasonable packet reordering value should not exceed 10%.

packetDuplication Integer  0-100%

Network packets duplicated..
A reasonable packet duplication value should not exceed 3%.

delayJitter Integer  0-8000ms 

Random latency variation; the actual latency between latency +- jitter. Used alongside the Latency parameter.
For example, if the latency is defined to be 100 ms and the jitter is 10 ms, this causes the added delay to be 100ms - 10ms.

correlation Integer  0-100% 

Network packet value correlation, affecting the Latency, Corruption, Reordering and Duplication.
For Latency, Corruption, Reordering and Duplication, the current packet n value will be correlated by this % to previous packet n-1 value. In other words, the current packet value is correlated to the previous packet value.
For example, if the correlation is defined to be 25%, the packet loss is 5%, and the previous packet was lost, then the updated packet loss value (for the current packet) would be 75% * 5% + 25%, which equals 28.75%. However, if the previous packet was not lost, then the packet loss value would be 75% * 5%, which equals 3.75%.

blockedDestinations String Network packet block, to specific destinations, defined by domain name, IP address, and IP range destinations in IP Prefix (Slash) notation.
Examples:
Domain name: www.google.com
IP address: 192.168.2.0
IP range destination: 192.168.2.0/24
To remove a network packet block, prefix the value with a '-'. For example, -www.google.com.
blockedPorts String Network packet block, to specific ports.
For example, to block http, define port number 80.
To remove a network packet block, prefix the value with a '-'. For example, -80.
profile String 2g_gprs_good |
2g_gprs_average |
2g_gprs_poor |
2g_edge_good |
2g_edge_average |
2g_edge_poor |
3g_umts_good |
3g_umts_average |
3g_umts_poor |
3.5g_hspa_good |
3.5g_hspa_average |
3.5g_hspa_poor |
3.5g_hspa_plus_good |
3.5g_hspa_plus_average |
3.5g_hspa_plus_poor |
4g_lte_good |
4g_lte_average |
4g_lte_poor |
4g_lte_advanced_good |
4g_lte_advanced_average | 4g_lte_advanced_poor |
bandwidth_good
Suggested network virtualization profiles.
See the Suggested Profiles table, in the description section above, for the defined emulation values.
Note: Specifying additional network virtualization parameters will override their values in the suggested profile.

Return Value

None

Exceptions

None

Examples

Copy

Java sample

Map<String, Object> pars = new HashMap<>();
driver.executeScript("mobile:vnetwork:update", pars)
Copy

C# sample

Dictionary<String, Object> pars = new Dictionary<String, Object>();
pars.Add("profile", "3.5g_hspa_plus_good");
driver.ExecuteScript("mobile:vnetwork:update", pars);