6

I remember when I connected to the internet via the phone line and a 56kbps modem, changing ISPs was as simple as changing the phone number dialled by the modem.

I remember that my IP address would change every 1 minute, without a break in connection. But I also remember downloading large files over HTTP, sometimes downloads would take hours to complete.

In a situation like this, how does the TCP connection remain open, while the IP address changes frequently?

Also, as a side question... I live in the UK, so it's all fibre optic and static IP's now, I'd be interested to know if other places in the world still rely on technology like this.

  • 2
    Did your IP actually change every minute while using dial-up? The address assignment should have been determined when the call came up and PPP (or whatever protocol) connected with the ISP and was assigned an address. The IP should only change if the session dropped somehow. – cpt_fink Oct 20 '14 at 4:00
  • @cpt_fink Good point, perhaps I don't remember properly, it was a long time ago. – Drahcir Oct 20 '14 at 10:48
  • 1
    PPP IPCP happens only once per session, so unless your PPP connection was resetting once per minute, your address was not changing. Your carrier's NAT setup may make it look that way from any outside observer. – Ricky Beam Oct 20 '14 at 18:56
7

The TCP connection cannot stay open with a changing IP, because a connection is defined by source IP+Port and destination IP+Port. If one of these changes, then you don't have the same connection anymore.

If you need to maintain a connection when the IP to your ISP changes, then you should not use this IP as outgoing, but instead built a tunnel to some VPN server outside. The VPN will give you a constant IP, even if the IP you got from the ISP changes. Another option would be to write your application so that it notices changes of IP and reconnects and resumes traffic.

3

TCP is a connection oriented protocol that uses stream socket. It is bound by IP address and port number at both the endpoints. In connection oriented protocol, a logical channel is established between the peers before exchanging data. So, if the IP address is changing, it has to tear down the existing connection and re-establish the connection which obviously is disruptive.

It is possible that IP address can change during every restart provided the subscriber is configured for such a plan of either static IP address or Dynamic IP address.

However, IP address change is not preferred while the connection is ON as it will be disruptive considering the fact that the higher level protocols like TCP will be shutdown. Such scenarios may happen when the mobile moves between different PDNs. To overcome this, 3GPP based networks use either GTP or Mobile IP.

GTP(GPRS Tunneling Protocol) ensures that the data is tunneled such that the same IP address is retained.

Mobile IP allows location independent routing of data with the use of CoA (Care of Address) which utilizes the PGW as home agent(HA) and the SGW as the foreign agent(FA). Here, a mobile specific CoA is provided to the HA by FA, so that packets can be forwarded to the correct destination of mobile location.

2

Can not be done with vanilla TCP right now.

But: Something called "Multipath TCP" is being developed with the explicit aim of "Decoupling TCP from IP".

1

It was already clarified by Steffen Ullrich what happens to the TCP connection. I'd like to answer your side question as well.

Because of the IPv4 address exhaustion many ISPs around the world still rely on IP leases. A change every minute isn't realistic, but a change every 24 h is what usually happens. The reason is simply because they don't have enough addresses to give each client its dedicated IP. This situation will change with IPv6 which has enough addresses in the foreseeable future.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.