views:

101

answers:

3

Hi,

Is it possible to hold an open TCP connection with a client, while the IP address of the client is externally changed? For example, the connection is establishes against address X, but somewhen while the connection is open, the client-side user asks for IP renew and gets another IP address. Can the connection remains alive in this case?

Thanks in advance.

+3  A: 

No, it cannot.

Even if the local side could be massaged to understand that the connection is suddenly between different addresses, the remote side will not understand and will refuse to work with it.

You'd need to re-add the old IP address to continue using the connection.


To do so:

Linux: ip addr add 172.16.10.20/22 dev bond0
Windows: do some pointy-clicky or**fill in command here**

MikeyB
Thanks. What do you mean in "You'd need to re-add the old IP address to continue using the connection."? How?
rursw1
A: 

This is possibe with tcp v6 connections, if you're using e.g. tunnelbrocker.net. Every time your IPv4 address changes, the connection between your IP4 address and the tunnelbrocker's IP4 address is dropped then re-established, however your IP6 attress is the same and all the TCP/IPv6 conections from your IP6 address to your destination IP6 addresses are still here.

Or, if you're designinng both your client & server, your could design your protocol allowing the client to reconnect in a transparent way..

Soonts
IPv6 can't be changed?
rursw1
The address can be changed manually.The IP6 address wont change if you'll just switch to another ISP and/or move to another continent: the ISPs are currently only providing IPv4 connectivity.
Soonts
A: 

What I know is, when using UDP, the connection can be remained, one of my application is to change a remote network adapter address via UDP.

For TCP, I agree with Soonts, you should design your server and client application to allow the reconnect in a transparent way.

Allopen