Go to main content

Troubleshooting Network Administration Issues in Oracle® Solaris 11.4

Exit Print View

Updated: November 2020
 
 

Simulating Network Operating Conditions Within a Test Environment

The Network Conditions Simulator (NCS) is a STREAMS module/driver (ncs(4D)) that you can use to simulate network operating conditions within a test environment.

    For example, you can simulate the following conditions by using NCS:

  • Propagation delay

  • Bandwidth

  • Drop rate

  • Packet reordering

  • Corruption

How the NCS Works

NCS works in between the IP and datalink layer of the Oracle Solaris network protocol stack by capturing packets from the IP layer, then manipulating those packets to simulate networking conditions that you have configured for a specified network interface by using the ncsconfig command. See Performing NCS Simulations for more information.

You can simultaneously activate the NCS module on multiple network interfaces. However, note that if two interfaces have NCS activated, and target address A is on the target list, then all of the packets that are sent to the target address A are impacted, regardless of which interface is used. The target list is then shared amongst all of the interfaces. This aspect of the feature can be useful for testing the Stream Control Transmission Protocol (SCTP).


Note -  The NCS module only operates on output, so the feature can be viewed similarly to how a router functions on the outgoing path. The return path remains unchanged.

Support for NCS in the Oracle Solaris zones environment includes global zones and kernel zones.

Performing NCS Simulations

The following examples show some of the ways in which you might use the ncsconfig command to configure the NCS module on a given network interface and display configuration information about systems that are using NCS.

Note that you must first install the NCS software package and then activate the module on each network interface for which you want to perform simulations. Also, to use the ncsconfig command, you must be assigned the Network Management rights profile.


Tip  -  To avoid a potential performance issue, deactivate the NCS module on the given network interface whenever you are not performing simulations. See Example 3, Deactivating the NCS Module for a Network Interface.

The nscconfig command supports several additional options and arguments for configuring NCS parameters beyond what is described in this document. See the ncsconfig(8) man page.

Example 1  Determining Whether a Network Interface Is Using the NCS Module

The following example shows how to use the ncsconfig command to determine whether a network interface (net0) is using NCS. The –Q option specifies the interface. You can specify multiple interfaces as a comma-separated list or by using multiple –Q options. The –t option specifies the address family (inet6).

# ncsconfig -Q net0 -t inet6
ncs module is active in net0
Example 2  Activating the NCS Module for a Network Interface

The following example shows how to activate the NCS module for a given network interface (net1).

# ncsconfig -A net1
# ncsconfig -Q net1
ncs module is active in net1

where –A interface indicates to activate the specified interface (net1). You can specify multiple interfaces as a comma-separated list or by using multiple –A options.

Example 3  Deactivating the NCS Module for a Network Interface

The following example shows how to deactivate the NCS module for a given network interface (net0).

# ncsconfig -D net0 -t inet6
# ncsconfig -Q net0
ncs module is not active in net0

where –D interface indicates to deactivate the specified interface (net0).

To specify multiple network interfaces, use a comma-separated list with the –D option as follows:

# ncsconfig -D net0,net1 -t inet6

Or, you can specify multiple –D options on the command line as follows:

# ncsconfig -D net0 -D net1 -t inet6
Example 4  Displaying the NCS Configuration for a System

The following example shows how to display the NCS configuration for a system by specifying an IP address (203.0.113.3).

# ncsconfig -h 203.0.113.3
[ 203.0.113.3 ](203.0.113.3)
Total bytes processed: 0, total packets processed: 0

You can also use the –h option to specify a host name. When you specify a host name rather than an IP address, both the host name and the IP address of the system are included in the output of the command, as shown in the following example:

# ncsconfig -h systemA -t inet
[ systemA.example.com ](203.0.113.3)
Total bytes processed: 0, total packets processed: 0

If you do not include the –t option when specifying a host name, NCS uses IPv4, which is the default:

# ncsconfig -h systemA
[ systemA.example.com ] (203.0.113.3)
Total bytes processed: 0, total packets processed: 0

Note that you cannot specify multiple hosts as part of a single command when using the –h option.

Example 5  Displaying a List of Systems That Are Using the NCS Module

The following example shows how to display all of the targets (hosts) that are currently using the NCS module.

# ncsconfig
ncs target list:     203.0.113.3

The output of this example indicates that there is one host with the IP address 203.0.113.3 that is currently using the NCS module.