8.2.4.6.6.1. Duplication Distribution
8.2.4.6.6.1.1. 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
8.2.4.6.6.1.2. 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
8.2.4.6.6.1.3. 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
8.2.4.6.6.1.4. 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
8.2.4.6.6.1.5. 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
8.2.4.6.6.1.6. 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
8.2.4.6.6.1.7. 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
8.2.4.6.6.1.8. 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
8.2.4.6.6.1.9. 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
8.2.4.6.6.1.10. 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
8.2.4.6.6.1.11. 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
8.2.4.6.6.1.12. 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
8.2.4.6.6.1.13. 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