Concept of IP Spoofing and It's implementation in JMeter

Concept of IP Spoofing:

what is IP Spoofing? 

In computer networking, IP address spoofing or IP spoofing is the creation of Internet Protocol (IP) packets with a false source IP address, for the purpose of hiding the identity of the sender or impersonating another computing system.


Image Source : Google;

What is the use of IP Spoofing in Performance Testing?

Routing stickiness (Persistence) - Many load balancers use IP stickiness when distributing incoming load across applications servers. So, if you generate the load from the same IP, you could load only one application server instead of distributing the load to all application servers (This is also called Persistence: When we use Application layer information to stick a client to a single server). Using IP spoofing, you avoid this stickiness and make sure your load is distributed across all application servers.

IP Blocking - Some web applications detect a mass of HTTP requests coming from the same IP and block them to defend themselves. When you use IP spoofing you avoid being detected as a harmful source.

Realistic load test - When it comes to load testing of web applications well behaved test should represent real user experience as close as possible. Also, You might need to simulate requests originating from the different IP addresses if your application assumes that each user uses unique IP address 

IP Spoofing in JMeter:

1.Set up IP configuration in Windows

  1. Give command "ncpa.cpl" in Win+R
  2. It will take you to "Control Panel\All Control Panel Items\Network Connections“
  3. Select your network and right click then select properties
  4. Select IPv4 and click properties again
  5. Now uncheck obtain Proxy manually radio button (This is called disabling DHCP)
  6. Now you can be able to add IP address along with subnet mask one by one.

If you want to add multiples IP address over a range follow below procedure.
Give the command in command prompt:

FOR /L %A IN (40,1,50) DO netsh interface ipv4 add address "Local Area Connection" 10.20.30.%A 155.155.152.0

where 40 = initial number of IP
          1 = increment
  50 = ending number of IP
  Local Area Connection = your network
  155.155.152.0 = subnet mask
  
NOTE: You will have to only change the IP numbers, subnet mask remains same.
            You need to have admin privilege in order to do these all changes

2. Setup IP configuration in JMeter

  1. Put all the IP addresses which you have added in your network in a CSV dataset Config.
  2. Just substitute the variable in "server name/IP field" which is under HTTP Request of JMeter.

No comments:

Post a Comment