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.

1 comment:

  1. This overview of IP spoofing is insightful, especially regarding its applications in performance testing. IP spoofing allows for the creation of packets with false source addresses, which can be beneficial for load balancing and avoiding detection in web applications. By distributing requests across multiple IPs, testers can ensure that their load tests more accurately simulate real user behavior, enhancing the reliability of the results.

    The practical tips for configuring IP settings and using tools like JMeter to implement IP spoofing are particularly helpful for those looking to optimize their performance testing strategies. Thank you for sharing this valuable information—it’s a great resource for testers!

    ReplyDelete