Go to main content

man pages section 8: System Administration Commands

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

ncsconfig (8)

Name

ncsconfig - configure network conditions simulator parameters

Synopsis

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 ]

Description

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.

Options

The following options are supported:

no option

Prints all targets.

–A interface

Activates ncs module on specified interface. Multiple interfaces can be supplied as a comma-separated list or by using multiple –A options.

–D interface

Deactivates ncs module on specified interface. Multiple interfaces can be supplied as a comma separated list or by using multiple –D options.

–Q interface

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.

–q

Reports interfaces that have ncs active.

–t type

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.

–h host

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.

–z

Turns off ncs module for the target host specified through the –h option. If no host is specified, then all targets are turned off.

–d drop_rate

Sets the drop rate in %. The packets to be dropped are randomly selected.

–i drop_interval

Sets the interval between packet drops (in number of packets). drop_interval cannot be zero.

–n drop_length

Sets how many packets to drop for each drop.

–o drop_gap

If drop length is bigger than one, this option sets how many packets to wait between every dropped packet within one drop.

–l delay

Sets the delay between each packet in ms. The minimum delay allowed is 10 ms.

–b bandwidth

Simulates link bandwidth in kbps. The result bandwidth = min {requested bandwidth by ncsconfig, actual bandwidth available on interface}.

–r reorder_threshold

Sets reordering threshold (in number of packets).

–R reorder_interval

Sets interval between reordering (in number of packets).

–c corrupt_rate

Sets packet corruption rate in %.

–C corrupt_bytes

Sets number of bytes to corrupt per packet. Note that –c and –C must be set together.


Note -  The options –d and –i are mutually exclusive.

Examples

Example 1 Listing Modules

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 inet6
Example 2 Activating ncs Module

The following example activates ncs on IP interfaces net0 and net1.

example# ncsconfig -A net0,net1
Example 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 inet6
Example 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 theta
Example 5 Turning Off Simulation for One Target

The following example turns off the simulator for the target theta.

example# ncsconfig -z -h theta
Example 6 Turning Off All Targets

The following example turns off simulator for all targets.

example# ncsconfig -z
Example 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.d
Example 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 theta
Example 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 theta
Example 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 theta
Example 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 theta
Example 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:c56e
Example 13 Showing All Targets

The following example prints out all the targets.

example# ncsconfig
Example 14 Showing Configuration

The following example prints out the configuration for theta.

example# ncsconfig -h theta
Example 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

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
pkg:/diagnostic/ncs
Interface Stability
Uncommitted

LIMITATIONS

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

See Also

ncs(4D)