ncsconfig - configure network conditions simulator parameters
ncsconfig
ncsconfig -z [-h host [-t type]]
ncsconfig {-A | -D | -Q} interface[,...] [-t type]
ncsconfig -q [-t type]
ncsconfig -h host [-t type] [ -c corrupt_rate [-C corrupt_bytes]] [ -d drop_rate | -i drop_interval [-n drop_length] [-o drop_gap]] [-l delay ] [ -b bandwidth ] [ -r reorder_threshold -R reorder_interval ]
ncsconfig command is used to configure the ncs(4D) module. NCS module must have been installed on the system and activated on the interface before simulation can be started. See EXAMPLES for details. Use of ncsconfig requires euid of 0 or Network Management RBAC profile.
The following options are supported:
Prints all targets.
Activates ncs module on specified interface. Multiple interfaces can be supplied as a comma-separated list or by using multiple –A options.
Deactivates ncs module on specified interface. Multiple interfaces can be supplied as a comma separated list or by using multiple –D options.
Reports if ncs is active/inactive on the interface or not. Multiple interfaces can be supplied as a comma-separated list or by using multiple –Q options.
Reports interfaces that have ncs active.
Address family type for –h, –A, –D and –Q. If several interface names have been specified, type will be applied to all of them. It currently supports inet and inet6. The default is inet.
Name of the target host to hit. If no other option is specified, prints current configuration for the target. If hostname is supplied, –t option should be supplied to choose IPv4 or IPv6 address. Default is to use IPv4 address. Multiple hosts cannot be specified as part of a single command.
Turns off ncs module for the target host specified through the –h option. If no host is specified, then all targets are turned off.
Sets the drop rate in %. The packets to be dropped are randomly selected.
Sets the interval between packet drops (in number of packets). drop_interval cannot be zero.
Sets how many packets to drop for each drop.
If drop length is bigger than one, this option sets how many packets to wait between every dropped packet within one drop.
Sets the delay between each packet in ms. The minimum delay allowed is 10 ms.
Simulates link bandwidth in kbps. The result bandwidth = min {requested bandwidth by ncsconfig, actual bandwidth available on interface}.
Sets reordering threshold (in number of packets).
Sets interval between reordering (in number of packets).
Sets packet corruption rate in %.
Sets number of bytes to corrupt per packet. Note that –c and –C must be set together.
The following example prints if ncs is enabled or disabled on interfaces net0 and net1. Both address families are inet6.
example# ncsconfig -Q net0 -Q net1 -t inet6Example 2 Activating ncs Module
The following example activates ncs on IP interfaces net0 and net1.
example# ncsconfig -A net0,net1Example 3 Deactivating ncs module
The following example deactivates ncs on IP interfaces net0 and net1. Both address families are inet6.
example# ncsconfig -D net0,net1 -t inet6Example 4 Setting 50ms Propagation Delay
The following example simulates a 50ms propagation delay between the host and the target theta.
example# ncsconfig -l 50 -h thetaExample 5 Turning Off Simulation for One Target
The following example turns off the simulator for the target theta.
example# ncsconfig -z -h thetaExample 6 Turning Off All Targets
The following example turns off simulator for all targets.
example# ncsconfig -zExample 7 Setting Drop Rate, Bandwidth and Delay
The following example simulates a network environment of 10% drop when communicating with IP address a.b.c.d and bandwidth is set to 14.4kbps.
example# ncsconfig -b 14.4 -d 10 -l 20 -h a.b.c.dExample 8 Setting Packet Drops
The following example simulates an environment where 2 packets are dropped for every 10 packets sent.
example# ncsconfig -i 10 -n 2 -h thetaExample 9 Setting Drop Gap
The following example configures ncs(4D) to drop 3 packets for every 15 packets sent. 3 packets are dropped by dropping 1 packet for every two packets sent.
example# ncsconfig -i 15 -n 3 -o 2 -h thetaExample 10 Setting Corruption
The following example corrupts 10% of packets going to host theta such that there are 3 bytes in each packet which are corrupted.
example# ncsconfig -c 10 -C 3 -h thetaExample 11 Reordering Packets
The following example reorders every 5th packet going to theta such that the reordered packet is sent at least 3 packets after it should have been sent.
example# ncsconfig -r 3 -R 5 -h thetaExample 12 Delaying for IPV6 Address
The following example simulates a delay of 50ms to host fe80::a00:20ff:fec4:c56e.
example# ncsconfig -l 50 -h fe80::a00:20ff:fec4:c56eExample 13 Showing All Targets
The following example prints out all the targets.
example# ncsconfigExample 14 Showing Configuration
The following example prints out the configuration for theta.
example# ncsconfig -h thetaExample 15 Reporting the Interfaces With ncs Active
The following example reports interfaces with ncs module available on them. Address family is inet.
example# ncsconfig -q -t inet
See attributes(7) for descriptions of the following attributes:
|
When a new set of parameters is specified for a host, the old set is erased. So if you run:
example# ncsconfig -l 50 -h R
and then run:
example# ncsconfig -d 50 -h R
There will be no propagation delay with the new setup and all the statistics will be reset.
If you first specify a 50ms delay, and then after some time, you change it to 20ms, you may not get the exact result immediately. ncs needs to finish processing the remaining packets with 50ms delay and then find the 20ms delayed packets, and then flush them off. After that, all new packets will have a 20ms delay.
The –l option, which adds the delay on packets, has a minimum value of 10 ms. The implementation of ncs module is is based on the timer which has a granularity of 10 ms.
The current implementation of ncs only operates on the output side. Under normal circumstances, this asymmetry should not be a problem as long as the parameters are configured properly to reflect network conditions on both paths. For example, if outgoing and incoming paths both introduce a 10ms delay, configuring a 20ms delay would be sufficient. Alternatively ncs can be configured on both hosts with 10ms.
Byte[s] to be corrupted are chosen randomly from the payload, including byte[s] from the protocol header. Same byte[s] may be chosen multiple times.