| Technical Note - Standard Impairments |
|
This technical note describes Maxwell's "Standard Impairments". Standard Impairments are those network impairments that are built into the core of Maxwell without the need of any plugin code. As a packet flows through Maxwell it passes through the impairment stages in the following sequence:
Every packet, including those created by duplication, passes through all of those impairment stages. Burst (Coupled) BehaviorMost of Maxwell's Standard Impairments can be configured to create bursts, i.e. a sequence of impairments that endures for a period of time. Maxwell uses the term "Coupled" rather than "burst" to clarify the fact that the impairment of a subsequent packet may be coupled to the impairment that was imposed on a prior packet. Most of Maxwell's standard impairments can be configured to operate in a coupled/burst mode. The burst behavior for each impairment is separate and independent of the burst behavior for any other impairment. And the burst behavior for a particular impairment is independent across flows. In other words, the packet drop burst calculations in Flow X are independent from the packet drop burst calculations in Flow Y. And burst activity for packet delay is independent for burst activity for packet jitter. The user may enable or disable impairment coupling (bursting) on individual impairments. If coupling is disabled then each packet is an independent event and the treatment of each packet is independent of the fate of its predecessor packets. Maxwell remembers what it did to the previous packet that passed through the impairment engines. Thus, for example, Maxwell remembers whether the previous packet to pass through a flow was subjected to a delay impairment and, if so, how much delay was imposed onto that packet. Maxwell also remembers the arrival time of that prior packet. If enabled for a particular impairment Maxwell's coupled/burst processing begins by asking whether the prior packet in the flow was subjected to the particular impairment. In other words, Maxwell's coupled/burst processing only begins when the preceding packet in the flow has been impaired. Thus, for example, a packet drop burst only begins when a packet is dropped by the non-burst drop mechanism. The same holds true for the other impairments - the coupled/burst behavior begins only when a packet receives an impairment though the operation of the normal, non-burst mechanisms. If enabled, the decision whether to perform coupled/burst processing operates as follows:
if not (prior_packet_exists() and prior_packet_impaired()): As can be seen from the foregoing code snippet in order for coupled/burst processing to occur the preceding packet must have been impaired and the current packet must arrive within a user specified time window after that preceding packet. If the preceding code decides to perform coupled/burst processing then that burst processing proceeds. Like non-burst impairments, coupled/burst impairments are controlled by a probability - The user sets a probability giving the statistical chance that a given packet will be subjected to the impairment. Maxwell uses a random number function to chose whether any given packet will receive the impairment or not. The user sets a coupled/burst probability that is independent of the probability for the underlying impairment. If a packet is to be processed normally, the basic probability is used, if it is to be processed using the coupled/burst mechanism, then the coupling probability is used. Maxwell allows the user to modify the basic coupling procedure by indicating that the coupling probability should be reduced from full effect to no effect over the period of the coupling interval. This is called "slew". If, for example, slew is in effect, then if the current packet arrives directly after the preceding packet, i.e. if the inter-packet gap is zero, then the coupling priority is used without diminishment. If the packet arrives half way through the coupling interval then the coupling probability is cut in half. The coupling probability diminishes to zero at the end of the coupling interval. The impairment that is applied to a packet as the result of coupling/bursting is the same impairment as was applied to the preceding packet. Since duplicate packets are created and have no arrival time, there is no coupling interval (or slewing) for the packet duplication impairment. The net effect of this coupling/burst processing is to create a chain of probabilities - a Markov chain - that creates a burst impairment for as long as the sequence of packet arrivals falls within the coupling interval and the roll of the probability dice yields decisions to impose the impairment. In a typical scenario, the user sets a low base probability for a particular impairment, often only a few percent (or lower). However, it is usual to set a high coupling probability - 70% or even 90% are not unusual. Even at 90% a burst is likely only to last an average of 5 packets. A coupling probability of 100% would make an impairment that, once started, would endure as long as packets keep arriving within the coupling interval. (The duplication impairment has a ceiling of 90% because in the case of duplication, all duplicates arrive, by definition, within the coupling interval.)
Parameter AutomationMaxwell's Graphical User Interface (GUI) can automate the changing of impairment parameters over a period of time ranging from a tenth of a second to more than a week. The user can shape this automation to emulate impairments that change over time. For example, the user could automate the delay impairment so that the delay increases over several minutes and then sharply falls back to a low value. This would be useful for testing a TCP stack's ability to detect and handle increasing congestion and increasing RTT (Round Trip Time) and to recover when conditions go back to normal. The topic of parameter automation is covered in a separate note, Automation of Impairment Settings. Probabilities are not deterministicMaxwell's standard impairments are stochastic. One can not tell in advance whether a given packet will be impaired or not. But over a large number of packets the percentage of packets impaired will tend to approximate the impairment probability that the user has selected. If two identical streams of packets are sent through Maxwell it will be unlikely that every packet in the replay will be impaired in exactly the same way as the same packet in the first stream. But if the streams contain enough packets the statistical results will be similar.
Packet DropPacket drop does exactly what its name implies - it makes a packet disappear. A dropped packet does not go through the subsequent impairments. The screen shot on the right shows Maxwell imposing a drop that increases from zero over a period of several seconds, holds steady for a while, and then descends back to zero. (Note: This kind of automation of drop over several seconds is a low frequency kind of change to impairments. It should be distinguished from the higher frequency kind of rapid change in delay that is performed by Maxwell's jitter impairment. These two methods of changing delay do overlap in part, but in general the automation system is for changes that occur over time scales of seconds to days while the jitter variation is usually for changes that occur on timescales of less than a second.)
Packet DuplicationMaxwell's packet duplication creates an exact duplicate of a packet. The duplicate packet is initially scheduled to be transmitted one millisecond after the packet from which it was created; however the actual times of transmission of the principal packet and the duplicate may be affected by their passage through the subsequent stages of impairment processing. The duplicate packet is sent back to the head of the impairment sequence. In other words, the duplicate packet will face the full sequence of drop, duplication, delay/jitter, and rate limitation impairments. Delay, Jitter, and Jitter based Packet Reordering
Maxwell does packet delay in two parts:
These two parts are added together. Thus if a packet receives 100 milliseconds of fixed delay and a variable/jitter delay of 80 milliseconds, the packet will be delayed by 180 milliseconds. (The actual amount may be longer if the user has not allowed packet reordering, in which case a packet must wait for its predecessors to be sent even if its scheduled transmission time expires before theirs.) (Remember, delay and jitter are applied only to those packets that are selected by the stochastic (probability) base and coupled/burst mechanisms.) Maxwell delays packets by computing the time when they should be transmitted from the outbound interface. This scheduled transmission time may be affected by subsequent impairments (most particularly rate limitation and a user provided plugin.) The order in which packets are transmitted is based on the scheduled transmission time. However, unless packet reordering is permitted by the user, each packet must wait for its predecessors to be transmitted even if its own scheduled transmission time is earlier. For both fixed and variable delay (jitter) the burst/coupled behavior is to send the coupled packets with the same delay (whether fixed or variable) as the predecessor packet. Jitter in more detailJitter is variable delay. That simple idea is complicated by the question of how that variation should occur. When we say "variable delay" we mean that the delay on each separate packet may be different from any of its predecessors or successors. Thus the question of how to shape the variation is one of the statistical "curve" that describes, over a large number of packets, how many packets are expected to receive each possible delay value. Maxwell builds jitter using three basic statistical building blocks. (For more information on these, and other, statistical distributions, see Probability distribution.
Complex distributions of jitter variation are constructed using a piecewise function in which the above elements are combined.
Piecewise FunctionsA piecewise function is a way to assemble several of the basic distributions. A piecewise function could be used, for instance, to create a jitter pattern in which an average of 15% of the packets are delayed according to a bell curve with a mean of 100ms and a std deviation of 20ms, 20% of the packets get hit with a delay of 250ms, and 30% are delayed uniformly between 300ms and 400ms, the rest going through without jitter. This allows the user to create patterns that resemble the real-world internet; a world in which there are multiple causes of perceived impairments. A user creates a piecewise function by selecting the various pieces to be included: perhaps a couple of Gaussian curves, perhaps a few uniform distributions, and maybe a constant value or two. The the user creates relative weights (or "width") for these pieces. When a packet arrives Maxwell generates a random number, a kind of toss of the dice, to chose which of the pieces should be used for that packet. The chance that any piece will be used is relative to its weight/width. A piece that has twice the weight/width of another piece has twice the chance of being selected. Then the packet is jittered according to the selected piece. ReorderingMaxwell does packet reordering as a side effect of the introduction of variable packet delay (jitter.) User written plug-in code can also do packet reordering (or even packet modification and generation.) When a packet is jittered it is very possible that, if it is given a small amount of delay, that it might want to be transmitted before one or more previous packets that are still awaiting transmission because they have been given a large amount of delay. Maxwell has a per-flow option that allows subsequent low-delay packets to pass those waiting long-delay packets. This is reordering. Note that this reordering is done in the context of each flow. If the user does not allow jitter in the flow to cause reordering then a packet that would otherwise go out sooner is constrained to wait until its predecessors in the flow have reached their transmission time and have been sent.
Rate LimitationMaxwell's rate limitation system is rather more intricate than the typical token bucket queue. Maxwell gives the user the means to control many of the parameters that affect rate limitation. This topic is covered in detail in a separate note: Rate Limitation. Plug-In ImpairmentsPlug in based impairments are an extension to, but not part of, Maxwell's "Standard Impairments". The effects of a plug-in depend on which particular plug in (if any) is loaded. A plug-in is the last stop that a packet makes as it flows through Maxwell's impairment system; in other words, the standard impairments are all performed before a packet reaches the plug-in. |