Hello everyone, I have a question:
There are three hosts, A1, A2 and B,
First, B connected to A1 through TCP, and state is ESTABLISHED.
Now, I move the IP address from A1 to A2, that is to say,
A1 was changed to A2, B will connect to A2 after a while if B sent ARP request,
Ok, I know B will be failed and get the error message: connection reset by peer.
But, this case is what I want.
Code:
step1: B ------> A1 ( 192.168.0.1) # ESTABLISHED
step2: B ------> A1 (none) # hanging
step3: B ------> A2 (192.168.0.1) # connection reset
-----------------------------------------------------------------------------------------
In another occasion, There are two hosts, A and B,
A has 2 IP address on eth0, IP1 and IP2, I create a TCP connection
from A(IP1) to A(IP2), and it's ESTABLISHED.
Now, I move the A(IP2) from A to B, that is to say,
B was changed to A, but A(IP1) never connect to B(IP2),
because this connection will not send ARP request,
it's always through local, so I would not get the error message,
and hanging about 12 minutes.
Code:
step1: A (192.168.0.1) -----> A (192.168.0.2) # ESTABLISHED
step2: A (192.168.0.1) -----> A (none) # hanging
step3: A (192.168.0.1) -----> A (none) # hanging
B (192.168.0.2) # no one will connect to this host
--------------------------------------------------------------------------------------
How can I know the IP address was changed immediately,
and I really want to get "connection reset by peer" in second case. :-)
Thank you in advance!