Thursday, 26 November 2020

How to make the TCP server unreachable(NO response) on the fly

                                   I would like to share one of my previous experience with TCP Client-Server testing. My use case was to test the behavior of TCP client while the server is unreachable. Before going into the details, I will briefly introduce the test setup which I used:

  • TCP Client-Server with 3-way handshake mechanism.
  • TCP Client-Server  IP version- IPv4 
  • Code to test - TCP Client 
  • Platform used - Windows 10 PC with additional ethernet adapter

                                   So now my PC has got 2 ethernet interfaces and the client will run on the Ethernet interface 1 and server will run on the Ethernet interface 4.

                                   More about the scenario, after the connection is established, client tries to send some data[PSH, ACK]to the server when the server is unreachable. The server should go to the unreachable state without sending any notification to the client. This is where the issue exists because when I tried to disconnect or disable or close the server, it will send either [RST, ACK] or [FIN, ACK]message to the client. I also tried to disable the ethernet interface where the server is running but no success. 

                                    Finally I figured out there is a simple technique to make the server unreachable without sending any notification to the client. For this go to the specific ethernet adapter where your server is running and click on the properties and uncheck the Internet Protocol Version 4(TCP/IPv4) and that's it. I hope this trick will be helpful for some one with similar test environment.


No comments:

Post a Comment