Code Monkey home page Code Monkey logo

Comments (3)

tbarbette avatar tbarbette commented on August 24, 2024

ReplayUnqueue can only act on the original timing of the packets. It was built to use with a real packet trace, read using FromPcap.

The easiest solution is to create a trace that has the timing you want, and then you set TIMING 100 in the ReplayUnqueue. Timing is an acceleration percentage exprimed in percent.

FastUDPSouce does not create timestamps so it cannot be used with ReplayUnqueue.

If you're not looking for very high speeds, you might use RatedUnqueue() or BandwidthRatedUnqueue instead of ReplayUnqueue ?

Another alternative is to set a fake timestamp in FastUDPSouce :

  • Create a class variable Timestamp _ts;
  • Initialize _ts to whatever (_ts = Timestamp::now();) in initiliaze() or configure()
  • After all p = packet->clone() you add p->set_timestamp_anno(ts); _ts = _ts + Timestamp::make_msec(1);
  • you 'll have 1000 packets per seconds.
  • Better, use a new FAKE_RATE argument to compute the amount of PPS per seconds. And even better, submit a PR :)

Note:
MultiReplay is to replay packets to multiple ports at the same time (like a TX side and an RX side towards a router, and replay two pcaps with the correct timings). In general it is accepted in system research to replay a mix at once.

from fastclick.

tbarbette avatar tbarbette commented on August 24, 2024

Another way to go would be to modify ReplayUnqueue to use some kind of fake rate instead of the packet timestamp, around

while ((diff = (p->timestamp_anno() - _timing_packet).nsecval()) - (rdiff = (((int64_t)(now - _timing_real).nsecval() * (int64_t)_timing) / 100)) > min_timing_ns) {

from fastclick.

Emikoer avatar Emikoer commented on August 24, 2024

Thanks for your answer! I tried to use BandwidthRatedUnqueue and it succeed.

from fastclick.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.