Duplication Distribution
Enable/Disable
Control whether this impairment distribution is enabled.
Note
This command is not applicable for PE_BANDPOLICER and PE_BANDSHAPER because they have a separate ON / OFF
parameter.
Corresponding low-level API class: PED_ENABLE
flow = port.emulation.flows[1] # e.g. flow_id = 1
await flow.impairment_distribution.duplication_type_config.enable.set(action=enums.OnOff.ON)
await flow.impairment_distribution.duplication_type_config.enable.set_on()
await flow.impairment_distribution.duplication_type_config.enable.set(action=enums.OnOff.OFF)
await flow.impairment_distribution.duplication_type_config.enable.set_off()
resp = await flow.impairment_distribution.duplication_type_config.off.get()
resp.action
Off Distribution
Configure Impairments Distribution to OFF. Assigning a different distribution than OFF to an impairment will activate the impairment. To de-activate the impairment assign distribution OFF.
Corresponding low-level API class: PED_OFF
flow = port.emulation.flows[1] # e.g. flow_id = 1
await flow.impairment_distribution.duplication_type_config.off.set()
resp = await flow.impairment_distribution.duplication_type_config.off.get()
resp.action
Fixed Rate Distribution
Configuration of Fixed Rate distribution. This is predictable distribution with nearly equal distance between impairments, to match the configured probability.
Note
In case of misordering, a special limit applies, probability * (depth + 1) should be less than 1000000.
Corresponding low-level API class: PED_FIXED
flow = port.emulation.flows[1] # e.g. flow_id = 1
await flow.impairment_distribution.duplication_type_config.fixed_rate.set(probability=10_000)
resp = await flow.impairment_distribution.duplication_type_config.fixed_rate.get()
resp.probability
Random Rate Distribution
Configuration of Random Rate distribution. Packets are impaired randomly based on a per packet probability. This way the impaired fraction of packets will be equal to the configured probability over time. Random probability in ppm (i.e. 1 means 0.0001%)
Corresponding low-level API class: PED_RANDOM
flow = port.emulation.flows[1] # e.g. flow_id = 1
await flow.impairment_distribution.duplication_type_config.random_rate.set(probability=10_000)
resp = await flow.impairment_distribution.duplication_type_config.random_rate.get()
resp.probability
Bit Error Rate Distribution
Configuration of Bit Error Rate distribution.
Corresponding low-level API class: PED_BER
flow = port.emulation.flows[1] # e.g. flow_id = 1
await flow.impairment_distribution.duplication_type_config.bit_error_rate.set(coef=1, exp=1)
resp = await flow.impairment_distribution.duplication_type_config.bit_error_rate.get()
resp.coef
resp.exp
Fixed Burst Distribution
Configuration of Fixed Burst distribution.
Corresponding low-level API class: PED_FIXEDBURST
flow = port.emulation.flows[1] # e.g. flow_id = 1
await flow.impairment_distribution.duplication_type_config.fixed_burst.set(burst_size=1300)
resp = await flow.impairment_distribution.duplication_type_config.fixed_burst.get()
resp.burst_size
Random Burst Distribution
Configuration of Random Burst distribution.
Corresponding low-level API class: PED_RANDOMBURST
flow = port.emulation.flows[1] # e.g. flow_id = 1
await flow.impairment_distribution.duplication_type_config.random_burst.set(minimum=1, maximum=10, probability=10_000)
resp = await flow.impairment_distribution.duplication_type_config.random_burst.get()
resp.minimum
resp.maximum
resp.probability
Gilbert Elliott Distribution
Configuration of Gilbert-Elliot distribution.
Corresponding low-level API class: PED_GE
flow = port.emulation.flows[1] # e.g. flow_id = 1
await flow.impairment_distribution.duplication_type_config.ge.set(good_state_prob=0, good_state_trans_prob=0, bad_state_prob=0, bad_state_trans_prob=0)
resp = await flow.impairment_distribution.duplication_type_config.ge.get()
resp.good_state_prob
resp.good_state_trans_prob
resp.bad_state_prob
resp.bad_state_trans_prob
Uniform Distribution
Configuration of Uniform distribution.
Note
If minimum is less than minimum, value is set to minimum. If minimum is greater than maximum, value is set to maximum.
Corresponding low-level API class: PED_UNI
flow = port.emulation.flows[1] # e.g. flow_id = 1
await flow.impairment_distribution.duplication_type_config.uniform.set(minimum=1, maximum=1)
resp = await flow.impairment_distribution.duplication_type_config.uniform.get()
resp.minimum
resp.maximum
Gaussian Distribution
Configuration of Gaussian distribution.
Note
- In case of
_impairment_type_xindex != DELAY
: mean plus 3 times standard deviation should be less than or equal to max allowed (4194288).
mean should always be at least 3 times the standard deviation, this to ensure that the impairment distance is always positive.
- In case of
_impairment_type_xindex = DELAY
: mean plus 3 times standard deviation should be less than or equal to the maximum latency.
mean minus 3 times the standard deviation should be greater than or equal to minimum latency.
Corresponding low-level API class: PED_GAUSS
flow = port.emulation.flows[1] # e.g. flow_id = 1
await flow.impairment_distribution.duplication_type_config.gaussian.set(mean=1, std_deviation=1)
resp = await flow.impairment_distribution.duplication_type_config.gaussian.get()
resp.mean
resp.std_deviation
Poisson Distribution
Configuration of “Poisson” distribution.
Note
Standard deviation is derived from mean, i.e., standard deviation = SQRT(mean).
In case of _impairment_type_xindex != DELAY
, mean plus 3 times standard deviation should be less than or equal to max allowed (4194288).
In case of _impairment_type_xindex = DELAY
, mean plus 3 times standard deviation should be less than or equal to the maximum latency.
Corresponding low-level API class: PED_POISSON
flow = port.emulation.flows[1] # e.g. flow_id = 1
await flow.impairment_distribution.duplication_type_config.poisson.set(mean=100)
resp = await flow.impairment_distribution.duplication_type_config.poisson.get()
resp.mean
Gamma Distribution
Configuration of Gamma distribution.
Note
Mean and Standard deviation are calculated from Shape and Scale parameters and validation is performed using those. standard deviation = [SQRT(shape * scale * scale)]mean = [shape * scale].
In case of _impairment_type_xindex != DELAY
,
(1) mean plus 4 times standard deviation should be less than or equal to max allowed(4194288).
(2)shape and scale should be greater than or equal to 0.
In case of _impairment_type_xindex = DELAY
, mean plus 4 times standard deviation should be less than or equal to the maximum latency.
Corresponding low-level API class: PED_GAMMA
flow = port.emulation.flows[1] # e.g. flow_id = 1
await flow.impairment_distribution.duplication_type_config.gamma.set(shape=1, scale=1)
resp = await flow.impairment_distribution.duplication_type_config.gamma.get()
resp.shape
resp.scale
Custom Distribution
Associate a custom distribution to a flow and impairment type.
Note
Before associating a custom distribution, the below validation checks are applied.
In case of _impairment_type_xindex != DELAY
,
(1) Custom values should be less than or equal to max allowed (4194288).
(2) Custom distribution bust contain 512 values.
In case of _impairment_type_xindex = DELAY
,
(1) Custom values should be less than or equal to the maximum latency.
(2) Custom values should be greater than or equal to minimum latency.
(3) Custom distribution should contain 1024 values.
Corresponding low-level API class: PED_CUST
# Custom distribution for impairment Corruption
flow = port.emulation.flows[1] # e.g. flow_id = 1
data_x=[0, 1] * 256
await port.custom_distributions.assign(0)
await port.custom_distributions[0].comment.set(comment="Example Custom Distribution")
await port.custom_distributions[0].definition.set(linear=enums.OnOff.OFF, symmetric=enums.OnOff.OFF, entry_count=len(data_x), data_x=data_x)
await flow.impairment_distribution.duplication_type_config.custom.set(cust_id=0)
resp = await flow.impairment_distribution.duplication_type_config.custom.get()
resp.cust_id