Linux network latency
Linux network latency injects chaos to disrupt network connectivity in linux machine by adding delay to the network requests.
Use cases
- Induces Network Latency on the target Linux machines.
- Simulates latency in connectivity access by delaying the network requests of the machine.
note
- This fault can be executed on Ubuntu 16 or higher, Debian 10 or higher, CentOS 7 or higher, RHEL 7 or higher, Fedora 30 or higher, and openSUSE LEAP 15.4 or higher.
- The
linux-chaos-infrastructure
systemd service should be in an active state, and the infrastructure should be inCONNECTED
state.
Fault permissions
The fault uses the root
Linux user and root
user group.
Fault tunables
Mandatory tunables
Tunable | Description | Notes |
---|---|---|
networkInterface | The network interface to target. | For example: eth0 |
Optional tunables
Tunable | Description | Notes |
---|---|---|
destinationHosts | List of the target hostnames or keywords. For example: ["google.com","litmuschaos.io"] | If neither destinationHosts and destinationIPs is provided, all hostnames/domains will be targeted |
destinationIPs | List of the target IPs. For example: ["1.1.1.1","8.8.8.8"] | If neither destinationHosts and destinationIPs is provided, all hostnames/domains will be targeted |
latency | Amount of latency to added to connection in ms. For example: 2000 | Defaults to 2000 |
jitter | Amount of jitter to be added in ms. Jitter will define the max randomised deviation from the provided latency value. For example: 100 | Defaults to 0 |
networkInterface | The network interface to target. For example: eth0 | |
duration | Duration through which chaos is injected into the target resource (in seconds). | Defaults to 30. |
rampTime | Period to wait before and after injecting chaos (in seconds). | Defaults to 0. |
Destination hosts
The destinationHosts
input variable subjects the comma-separated names of the target hosts to chaos.
The following YAML snippet illustrates the use of this environment variable:
apiVersion: litmuchaos.io/v1alpha1
kind: LinuxFault
metadata:
name: linux-network-latency
labels:
name: network-latency
spec:
networkChaos/inputs:
destinationHosts: '["google.com"]'
networkInterface: "eth0"
Destination IPs
The destinationIPs
input variable subjects the comma-separated names of the target IPs to chaos.
The following YAML snippet illustrates the use of this environment variable:
apiVersion: litmuchaos.io/v1alpha1
kind: LinuxFault
metadata:
name: linux-network-latency
labels:
name: network-latency
spec:
networkChaos/inputs:
destinationIPs: '["1.1.1.1"]'
networkInterface: "eth0"
Latency and jitter
The latency
and jitter
input variables add delay and a small deviation to the delay, respectively, with respect to the connection.
The following YAML snippet illustrates the use of this environment variable:
apiVersion: litmuchaos.io/v1alpha1
kind: LinuxFault
metadata:
name: linux-network-latency
labels:
name: network-latency
spec:
networkChaos/inputs:
latency: "1000"
jitter: "200"
networkInterface: "eth0"