Re: Interval Timers on Windows



Bernard Chan wrote:


Hi All,

I am writing a script to generate some packets for RTP stream simulation.
As you may know, RTP requires a more-or-less constant packet rate (and
hence UDP is used), and I will need to generate fixed sized packets at
regular intervals, say 20ms, so that will be around 50 packets per second.

On Linux I have tried a version using Time::HiRes ualarm(). On some of my
Linux systems ualarm() can generate a packet rate that approximates 50Hz
pretty well, and the interval variance is infinitesimal. However, I also
have some systems (mostly Fedora) which seem to exhibit increasingly long
intervals after some seconds for reasons unknown to me.

I would also like to have the script usable on Windows that my peers who
have Windows on their systems can perform some tests. There is no ualarm()
in Time::HiRes on Windows, so I tried another approach. I created a
thread-enabled version of the script. A separate thread is created which
does roughly this:

while ($continue) {
sendPacket();
select(undef, undef, undef, 20/1000);
}

However, I find that the sleep between each packet tends to be slightly
higher than 20ms, so after not many packets it is already arriving slower
than the drain rate at the receiver side.



Surely you would need to time sendPacket() and subtract it from the next
delay?


--
Brian Wakem
Email: http://homepage.ntlworld.com/b.wakem/myemail.png
.



Relevant Pages

  • Re: iptables help needed
    ... Packets are dropped because port 110 is not allowed ... I added port 110 to your script ... | the desktop this morning when i started the laptop and ran firefox. ... Here the 192.168.1.4 computer makes an ntp request to 213.251.134.188 ...
    (Fedora)
  • Re: Help with Iptables on with RH linux
    ... iptables -P OUTPUT DROP ... INPUT only when packets have a destination IP of your firewall. ... the FORWARD chain contains rules that affect packets passing through ... Yes I flushed the rules before calling the script... ...
    (RedHat)
  • RE: Test scripts for NIDS
    ... You would have to script the former tools to make them send the packets in a loop. ... Ethical Hacking at the InfoSec Institute. ... learn to write exploits and attack security infrastructure. ...
    (Pen-Test)
  • Interval Timers on Windows
    ... I am writing a script to generate some packets for RTP stream simulation. ... Linux systems ualarmcan generate a packet rate that approximates 50Hz ... I would also like to have the script usable on Windows that my peers who ...
    (comp.lang.perl.misc)
  • QOS tc problems
    ... I wrote this script for my QOS traffic. ... I only care about my VOIP service. ... Rest will fight for the bandwidth. ... Is it possibble that the packets are not marked. ...
    (comp.lang.php)