4 ms·
A TCP connection is identified by the tuple of (source IP, source port, destination IP, destination port), therefore whenever one side's IP changes (the effect
by moosingin3space 9y ago
A TCP connection is identified by the tuple of (source IP, source port, destination IP, destination port), therefore whenever one side's IP changes (the effect of roaming), the connection has to be re-established.
Mosh is built on UDP, where there are no "connections" and the wire protocol is stateless, so when the client IP changes, that endpoint simply transmits some "session cookie" information to the server, which allows it to carry on, uninterrupted.
HTTP runs over TCP, so it cannot roam like mosh does. QUIC (Google's experimental HTTP/2, TLS, and UDP integration) is interesting in part for this reason.
- Buge 9y agoMost interactive webapps such as gmail send many HTTP requests. And those requests do not have to be over the same TCP connection. So the webapp could continue to work even if you change IPs. Any requests going at the time of the change would fail, but ideally the javascript of the app would retry them.
- JdeBP 9y agoYou've glossed over the part about TCP connections. Try roaming whilst one of those HTTP transactions is in progress.
- Shish2k 9y ago> Try roaming whilst one of those HTTP transactions is in progress That specific connection silently fails, then the app silently retries, and succeeds - from the end user's perspective, they've switched IP addresses and the webapp still works fine.
- JdeBP 9y agoIncorrect. TCP does not work that way and the failure mode is nowhere near that smooth. I suggest actually trying it. No cheating and watching Keith Winstein's video on the mosh WWW site, which shows what actually happened in the case of one fairly well-known WWW app, now! (-:
- moosingin3space 9y agoOn my Android phone, the user experience is significantly degraded when that happens -- the app has to wait to re-establish a TCP and TLS connection, which is relatively slow.