Tuesday, February 1, 2011

LoadRunner and Performance Center IP Spoofing

LoadRunner and Performance Center IP Spoofing
When performance test scenario runs, virtual users on each host machine (Load Generator) uses the host’s IP address. You can define multiple IP addresses on a host machine to emulate a real- life situation where users sit on different machines. This is especially needed when the hardware configuration under test balances load across a "farm" of several (web or database) servers. "IP spoofing" enables each host machine to "spoof" the server into thinking it is using many different IP addresses.


IP Spoofing configuration:
Performance Center or LoadRunner includes an IP Wizard program that you run on each host machine to create multiple IP addresses. You add new IP addresses to a machine once and use the addresses for all scenarios.

1. Invoke the IP Wizard from the LoadRunner program group.


2. If you have an existing file with IP address settings, select Load previous settings from file and choose the file.
3. If you are defining new settings, select Create new settings.
4. Click Next to proceed to the next step. If you have more than one network card, choose the card to use for IP addresses and click Next.


The optional Web server IP address step enables the IP Wizard to check the server's routing table to see if it requires updating after the new IP addresses are added to the load generator.
5. To check the server's routing table directly after adding the addresses, enter the server IP address. See Updating the Routing Table for more information.
6. Click Next to see a list of the machine's IP address (es). Click Add to define the range of addresses.


IP addresses include two components, a netid and hostid. The submask determines where the netid portion of the address stops and where the hostid begins.
7. Select a class that represents the correct submask for the machine's IP addresses.
8. Specify the number of addresses to create. Select Verify that new IP addresses are not already in use to instruct the IP Wizard to check the new addresses. The IP Wizard will only add the addresses not in use.
Click OK to proceed.
9. After the IP Wizard creates the new addresses, the summary dialog box lists all of the IP addresses.


10. Click Finish to exit the IP Wizard. The IP Wizard Summary dialog box is displayed.


11. Note the address of the .bat file, and see Updating the Routing Table for information about using the batch file to update the routing table, if necessary.
12. After you update the routing table, check Reboot now to update routing tables to initialize the Windows device drivers with the new addresses.
13. Click OK.

Updating the Routing Table
When the client machine has new IP addresses, the server needs the addresses in its routing table, so that it can recognize the route back to the client. If the server and client share the same netmask, IP class, and network, the server's routing table does not require modification.

Note: If there is a router between the client and server machines, the server needs to recognize the path through the router. Make sure to add the following to the server routing table: route from the Web server to the router, and routes from the router to all of the IP addresses on the load generator machine.
1. Edit the batch file that appears in the IP Wizard Summary page. An example .bat file is shown below.


2. For each occurrence of [CLIENT_IP], insert your IP address instead.
3. Run the batch file on the server machine.


Enabling IP Spoofing in LoadRunner & Performance Center
Enabling Multiple IP Addressing from the LoadRunner Controller
Once you define multiple IP addresses, you set an option to tell the Controller to use this feature.
1. In the Controller Design view, select Scenario > Enable IP Spoofer.
Note: You must select this option before connecting to a load generator.
2. Use the General Options of the Controller Expert Mode to specify how the Controller should implement this feature.
Enabling IP Spoofing from Performance Center
After you define multiple IP addresses, you can enable IP spoofing for a load test.
Note: You must enable IP spoofing before running a load test.
To enable IP spoofing from the User site:
1. On the Performance Center left menu, select Load Tests > Manage. The Load Tests page opens, displaying all the load tests in the current project.
2. Click the load test for which you want to enable IP spoofing.
3. On the Load Test configuration page that opens, click the General tab.
4. Under Advanced, select Enable IP Spoofer.


5. Click Save to save your settings.