Skip to content

Commit

Permalink
Documentation for replay.hh
Browse files Browse the repository at this point in the history
  • Loading branch information
tbarbette authored Jul 26, 2023
1 parent ce305b1 commit b977c90
Showing 1 changed file with 71 additions and 1 deletion.
72 changes: 71 additions & 1 deletion elements/analysis/replay.hh
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,52 @@ replay an input of packets at a given speed
=d
Preload packets in RAM, then replays them a certain number of time. This is a pull elements, see ReplayUnqueue for a pull-to-push version.
Keyword arguments are:
=over 8
=item STOP
Integer. Number of loop to replay.
=item STOP_TIME
Integer. If > 0, also bound the number of replay loops using a time limit, in seconds.
=item QUICK_CLONE
Boolean. If true, the packets will be cloned using an internal DPDK reference counter, so this will avoid
the packets being duplicated by Click if they are modified and replayed more than once.
The downside is if the replay loop is too fast, the NIC might send corrupted packets.
=item BURST
Integer. Number of packets to send at once.
=item VERBOSE
Integer. Verbosity level.
=item FREEONTERMINATE
Boolean. Free packets on the last run.
=item LIMIT
Integer. Max number of packets to preload.
=item ACTIVE
Boolean. Wether this element should start in active mode. To be used with the active handler.
=item USE_SIGNAL
Boolean. If true, use an upstream empty signal to know wether the element should stop polling for packets when
preloading. Else, stops preloading packets when the pulling returns no packets. Default true.
=back
=e
FromDump(file.pcap, ) -> ReplayUnqueue(3, QUEUE 1) -> ...
=h device read-only
=a ReplayUnqueue, MultiReplayUnqueue
*/
class Replay : public ReplayBase { public:

Expand Down Expand Up @@ -117,6 +154,39 @@ class Replay : public ReplayBase { public:
struct s_output _output;
};

/*
=c
ReplayUnqueue([, I<KEYWORDS>])
=s traces
replay an input of packets at a given speed, pull to push
=d
Technically equivalent to Replay->Unqueue-> it is more efficient.
Keyword arguments are the same than @Replay, with the addition of:
=over 8
=item TIMING
Integer. If 0, replays packets as fast as possible. If >0, give an acceleration speed of the
original timing of the packet.
=item TIMING_FNT
String. A function that can be used to change the TIMING according to
the current time. The parsing uses TinyFNT and therefore follows the format.
The variable containing the time is x. E.g. "10 + min(90,10*x)" will have an
acceleration from 10 to 100% in 9 seconds. Note that if the function goes to 0, the element stops.
See the Metron (NSDI'18) paper for examples. Supports @1 and @2 for the predifined functions for that paper.
@1 is equivalent to "100 * ((sin(-pi/2 + (x/10)^2.5) * (-x/"+time+" + 1) + 1) * (("+max+" - 1) / 2) + 1)"
where TIME is STOP_TIME argument and MAX is the value of TIMING given above.
@2 is equivalent to "100 * ((-squarewave(((x + 40) * 1/50) ^ 5) * (-x / "+time+" + 1) + 1) * (("+max+" - 1) / 2) + 1)"
Ineffective if TIMING is not true. Defaults to an empty string (inactive).
*/
class ReplayUnqueue : public ReplayBase { public:
ReplayUnqueue() CLICK_COLD;
~ReplayUnqueue() CLICK_COLD;
Expand Down

0 comments on commit b977c90

Please sign in to comment.