Forum Discussion

Paul_Dawson_103's avatar
Paul_Dawson_103
Icon for Nimbostratus rankNimbostratus
Feb 15, 2006

Simulating Latency

Hello,

 

 

We are looking to simulate latency on the network to test an application in a WAN environment.

 

 

Would it be plausible looking to iRules to investigate if this is possible?

 

 

Any pointers/tipes would be appreciated.

 

  • I was thinking for loops. I tested this in the lab, on my BigIP this equates to about 58 milliseconds of delay:

    
    when CLIENT_ACCEPTED {
      set y1 [clock clicks -milliseconds]
      for { set x 0 } { $x < 100000 } { incr x } {do nothing}
      set y2 [clock clicks -milliseconds]
      set time1 [expr $y2 - $y1] 
      log "For loop time is $time1 milliseconds"
    }
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    Note that, while this is possible via iRules, it is not recommended and is not the intended use of the language.

     

     

    This kind of rule can, as you might imagine, introduce serious latency in connections to your BIG-IP, and should only be used in a testing environment.

     

     

    -Colin
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    Yes, you could...but like I said, I don't recommend putting it in place at all on a production system.

     

     

    -Colin
  • patrick_jenny_7's avatar
    patrick_jenny_7
    Historic F5 Account
    You may wish to consider using DummyNet http://info.iet.unipi.it/~luigi/ip_dummynet/ to simulate a WAN link outside of the BIG-IP.
  • forgive me if I am wrong, but triggering this on CLIENT_ACCEPTED just means that the initial connection is waylaid. latency is evident on every packet not just the 4th...

     

     

  • if you do it on HTTP protocol you may use the same code in when HTTP_REQUEST and/or HTTP_RESPONSE
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    This would simulate latency per session, not per packet, you're correct.

     

     

    Colin