Home > LoadRunner > IP Spoofing with LoadRunner

IP Spoofing with LoadRunner

April 23rd, 2009

As described here ip spoofing is a technique for hiding real identity of the attacker on the net. It is mainly used for hacking but it can be helpful for performance tests as well.

Let’s say we have some fancy network infrastructure that cache some of our requests in the performance test. Because of that our results may be incorrect. To omit this issue we can change the IP address of each (e.g. HTTP) request that reaches the server and simulate load from multiple users not only on the application level but on the network level as well. In that case cache won’t affect performance tests. Fortunately folks from Mercury/HP implemented special function for IP spoofing in LoadRunner API.

  1. lr_enable_ip_spoofing();
  2. lr_disable_ip_spoofing();

To use it, first put your code between these to functions calls.
Second (before connecting to load generator!!!) enable IP Spoofer option in LR Controller (Scenario > Enable IP Spoofer).

Let the hacking begin :)

Tip:
There is an option in Controller (in Expert mode) to choose between multiple IP addresses per process or per thread (Tools > Options).

  1. April 24th, 2009 at 16:06 | #1

    If you’re trying to simulate different network links, why not just use the Shunra feature that’s available on LR 9.5?

  2. Waldemar
    April 24th, 2009 at 18:21 | #2

    Maybe because I’m using LR 9.1 :)

  3. Waldemar
    April 24th, 2009 at 18:28 | #3

    Shunra in LR 9.5 is not free for commercial use, right? I have to buy a license. Am I correct?

  4. April 27th, 2009 at 21:10 | #4

    That is correct. Although it is built-in to LR 9.5 it is licensed and activated separately.

  5. Dheena
    August 5th, 2009 at 16:07 | #5

    Hi,
    I am using LR 9.5. Could some one let me know how to automate LRA creation using analysis API.
    Some sample codes would be appreciated.

    Thanks in advance!
    Dheena.

  6. raster1
    September 5th, 2009 at 10:53 | #6

    OK, so the server receives the request from a spoofed address – but how will the response come back to the original load generator machine since its IP is different?

  7. Waldemar
    September 6th, 2009 at 08:27 | #7

    raster1: if it’s a synchronous call, I believe everything should be maintained by network layer so you shouldn’t worry about that. It should just work. In case of asynchronous call you would have such problem.

  1. No trackbacks yet.