News for hackers. Stuff that matters.
Re:Engineering for Slow Internet by danpalmer on Friday May 31, 2024 @12:40AM (#40531562)
Having a lot of experience commuting on underground public transport (intermittent, congested), and living/working in Australia (remote), I can safely say that most services are terrible for people without "ideal" network conditions.

On the London Underground it's particularly noticeable that most apps are terrible at handling network that comes and goes every ~2 minutes (between stops), and which takes ~15s to connect to each AP as a train with 500 people on it all try to connect at the same time.

In Australia you're just 200ms from everything most of the time. That might not seem like much, but it really highlights which apps trip up on the N+1 request problem.

The only app that I am always impressed with is WhatsApp. It's always the first app to start working after a reconnect, the last to get any traffic through before a disconnect, and even with the latency, calls feel pretty fast.

Re:Engineering for Slow Internet by kylehotchkiss on Friday May 31, 2024 @02:55AM (#40532185)
WhatsApp has a massive audience in developing countries where it's normal for people to have slower internet and much slower devices. That perspective being so embedded in their development goals certainly has given WhatsApp good reason to be the leading messaging platform in many countries around the world
Re:Engineering for Slow Internet by nicbou on Friday May 31, 2024 @04:13AM (#40532562)
It works remarkably well when your phone runs out of data and you get capped at 8 kbps. Even voice calls work smoothly.
Re:Engineering for Slow Internet by qingcharles on Friday May 31, 2024 @01:44PM (#40538114)
LOL 8kbps. Damn. That takes me back. I built the first version of one of the world's largest music streaming sites on a 9.6kbps connection.

I was working from home (we had no offices yet) and my cable Internet got cut off. My only back up was a serial cable to a 2G Nokia 9000i. I had to re-encode a chunk of the music catalog at 8kbps so I could test it from home before I pushed the code to production.

Psychoacoustic compression is a miracle.

Re:Engineering for Slow Internet by greenish_shores on Friday May 31, 2024 @03:30PM (#40539306)
Nokia 9000i, so you had to work on CSD (which is usually billed per-minute, like dial-up), not even GPRS. How much did that cost you? :P

BTW, an interesting thing is that some/most carriers allow you to use CSD/HSCSD over 3G these days, and you can establish data CSD connection between two phone numbers, yielding essentially a dedicated L2 pipe which isn't routed over internet. Can have much lower latency and jitter if that's what you need. Some specialized telemetry is still using that, however as 3G is slowly getting phased out, it will probably have to change.

Re:Engineering for Slow Internet by qingcharles on Friday May 31, 2024 @03:55PM (#40539528)
God, the cost was probably horrid, but I was connecting in, setting tasks running and logging out. This was late 1999 in the UK, so per-minute prices were high. Also, these were Windows servers, so I had to sluggishly RDP into them, no nice low-bandwidth terminals.
Re:Engineering for Slow Internet by Scoundreller on Friday May 31, 2024 @09:35AM (#40534947)
Even wealthy countries will have dead zones (Toronto subway until recently, and like 90% of the landmass), and at least in Canada, “running out of data” and just having none left (or it being extremely expensive) was relatively common until about the last year or two when things got competitive (finally!).

Still have an entire territory where everything is satellite fed (Nunavut), including its capital.

Re:Engineering for Slow Internet by greenish_shores on Friday May 31, 2024 @03:29PM (#40539297)
Wow. I didn't knew that Nunavut is entirely satellite fed. That's very interesting to know, thanks. Do you have some more info, though? What kind of satellite - geostationary, LEO? Also which constellation has the most share of traffic from Nunavut?
Re:Engineering for Slow Internet by Scoundreller on Friday May 31, 2024 @09:35PM (#40542115)
Unsure if other telcos have their own setups, but:

> Northwestel, one of biggest internet service providers in the North, said it provides broadband service for all Nunavut communities using Telesat's Telestar 19 VANTAGE high-throughput satellite. After the satellite was deployed in July 2018, Northwestel said it would significantly improve broadband connectivity in the territory, increasing speeds to 15 megabits per second.

https://www.ctvnews.ca/sci-tech/efforts-underway-to-improve-...

Interestingly, the same satellite (but different transponders) probably supplies internet to a good chunk of transatlantic voyages between US/Can and Europe: https://www.telesat.com/wp-content/uploads/2022/11/Telstar-1...

Re:Engineering for Slow Internet by chipdart on Friday May 31, 2024 @01:43AM (#40531863)
> In Australia you're just 200ms from everything most of the time. (...)

> The only app that I am always impressed with is WhatsApp. It's always the first app to start working after a reconnect, the last to get any traffic through before a disconnect, and even with the latency, calls feel pretty fast.

The 200ms is telling.

I bet that WhatsApp is one of the rare services you use which actually deployed servers to Australia. To me, 200ms is a telltale sign of intercontinental traffic.

Most global companies deploy only to at most three regions:

* the US (us-east, us-central, us-east+us-east)

* Europe (west-europe),

* and somewhat rarely far-east (meither us-west or Japan)

This means that places such as south Africa, south America, and of course Australia typically have to pull data from one of these regions, which means latencies of at least 200ms due to physics.

Australia is particularly hit because, even with dedicated deployments in their theoretical catchment area, often these servers are actualy located in an entirely separate continent (west-us or Japan) and thus users do experience the performance impact of having packets cross half a globe.

Re:Engineering for Slow Internet by toast0 on Friday May 31, 2024 @02:18AM (#40532038)
> I bet that WhatsApp is one of the rare services you use which actually deployed servers to Australia. To me, 200ms is a telltale sign of intercontinental traffic.

So, I used to work at WhatsApp. And we got this kind of praise when we only had servers in Reston, Virginia (not at aws us-east1, but in the same neighborhood). Nowadays, Facebook is most likely terminating connections in Australia, but messaging most likely goes through another continent. Calling within Australia should stay local though (either p2p or through a nearby relay).

There's lots of things WhatsApp does to improve experience on low quality networks that other services don't (even when we worked in the same buildings and told them they should consider things!)

In no particular order:

0) offline first, phone is the source of truth, although there's multi-device now. You don't need to be online to read messages you have, or to write messages to be sent whenever you're online. Email used to work like this for everyone; and it was no big deal to grab mail once in a while, read it and reply, and then send in a batch. Online messaging is great, if you can, but for things like being on a commuter train where connectivity ebbs and flows, it's nice to pick up messages when you can.

a) hardcode fallback ips for when DNS doesn't work (not if)

b) setup "0rtt" fast resume, so you can start getting messages on the second round trip. This is part of noise pipes or whatever they're called, and tls 1.3

c) do reasonable-ish things to work with MTU. In the old days, FreeBSD reflected the client MSS back to it, which helps when there's a tunnel like PPPoE and it only modifies outgoing syns and not incoming syn+ack. Linux never did that, and afaik, FreeBSD took it out. Behind Facebook infrastructure, they just hardcode the mss for i think 1480 MTU (you can/should check with tcpdump). I did some limited testing, and really the best results come from monitoring for /24's with bad behavior (it's pretty easy, if you look for it --- never got any large packets and packet gaps are a multiple of MSS - space for tcp timestamps) and then sending back client - 20 to those; you could also just always send back client - 20. I think Android finally started doing pMTUD blackhole detection stuff a couple years back, Apple has been doing it really well for longer. Path MTU Discovery is still an issue, and anything you can do to make it happier is good.

d) connect in the background to exchange messages when possible. Don't post notifications unless the message content is on the device. Don't be one of those apps that can only load messsages from the network when the app is in the foreground, because the user might not have connectivity then

e) prioritize messages over telemetry. Don't measure everything, only measure things when you know what you'll do with the numbers. Everybody hates telemetry, but it can be super useful as a developer. But if you've got giant telemetry packs to upload, that's bad by itself, and if you do them before you get messages in and out, you're failing the user.

f) pay attention to how big things are on the wire. Not everything needs to get shrunk as much as possible, but login needs to be very tight, and message sending should be too. IMHO, http and json and xml are too bulky for those, but are ok for multimedia because the payload is big so framing doesn't matter as much, and they're ok for low volume services because they're low volume.

Re:Engineering for Slow Internet by erinaceousjones on Friday May 31, 2024 @03:58AM (#40532502)
WhatsApp is (or was) using XMPP for the chat part too, right?

When I was IT person on a research ship, WhatsApp was a nice easy one to get working with our "50+ people sharing two 256kbps uplinks" internet. Big part of that was being able to QoS prioritise the XMPP traffic which WhatsApp was a big part of.

Not having to come up with filters for HTTPS for IP ranges belonging to general-use CDNs that managed to hit the right blocks used by that app, was a definite boon. That, and the fact XMPP was nice and lightweight.

As far as I know google cloud messaging (GCN? GCM? firebase? Play notifications? Notifications by Google? Google Play Android Notifications Service?) also did/does use XMPP, so we often had the bizarre and infuriating very fast notifications _where sometimes the content was in the notification_ but when you clicked on it, other apps would fail to load it due to the congestion and latency and hardcoded timeouts TFA mentions.. argh.

But WhatsApp pretty much always worked, as long as the ship had an active WAN connection.... And that kept us all happy, because we could reach our families.

Re:Engineering for Slow Internet by toast0 on Friday May 31, 2024 @10:26AM (#40535622)
> WhatsApp is (or was) using XMPP for the chat part too, right?

It's not exactly XMPP, it started with XMPP, but XML is big, so it's tokenized (some details are published in the European Market Access documentation), and there's no need for interop with standard XMPP clients, so login sequence is I think way different.

But it runs on port 5222? by default (with fallbacks to port 443 and 80).

I think GCM or whatever it's called today is plain XMPP (including, optionally, on the server to server side), and runs on ports 5228-5230. Not sure what protocol apple push is, but they use port 5223 which is affiliated with xmpp over tls.

So I think using a non 443 port was helpful for your QoS? But being avaialable on port 443 is helpful for getting through blanket firewall rules. AOL used to run AIM on all the ports, which is even better at getting through firewalls.

Re:Engineering for Slow Internet by djtango on Saturday June 01, 2024 @02:54AM (#40543500)
Yes - a thousand yeses.

I once got asked "what was a life changing company/product" and my answer was WhatsApp - to slightly bemused looks.

WhatsApp connected the world for free. Obviously they weren't the first to try but when my (very globally distributed family) picked up WhatsApp in '09/'10 we knew we were onto something different. Being able to stay in touch with my brother half way across the world in realtime was very special. Nothing else at the time really competed. SMS was expensive and had latency. Email felt clunky and oddly formal - email clients don't feel "chatty". MSN was crap on mobile and you both had to be online. Ditto for Skype. For calls we even used to do this odd VOIP bridge where you would each call an endpoint for cheap international phone calls.

Meanwhile in 2012, I was able to install WhatsApp on my mum's old Nokia Symbian feature phone, use WhatsApp on a pay-as-you-go sim plan in Singapore communicating over WAP. The data consumption was so low I basically survived 2 months on maybe 1-2 top ups. Compare that with the other day where I turned on roaming on my phone (so I could connect to Singtel to BUY a roaming package) and my phone passively fetched ~50+ MB in seconds and I was hit with 400SGD of data charges (I was able to get them refunded)

I am very grateful to all the work and thought WhatsApp put into building an affordable global resilient communication network and I hope every one of the people involved got the payout they deserve.

Re:Engineering for Slow Internet by immibis on Saturday June 01, 2024 @05:24AM (#40544178)
> Email felt clunky and oddly formal - email clients don't feel "chatty".

Now (in 2024) have you tried Delta Chat?

Re:Engineering for Slow Internet by djtango on Saturday June 01, 2024 @05:58AM (#40544330)
No I haven't - it looks interesting thanks for sharing.

I did once think whether a client could abstract over IMAP to build to build a WhatsApp-like UI/UX so clearly other people have thought the same.

Although I will confess I'm no longer really looking for a new chat experience...

How is the latency is for Delta Chat?

Re:Engineering for Slow Internet by cheema33 on Friday May 31, 2024 @03:13AM (#40532272)
> I used to work at WhatsApp..

Do you know why there is a 4 device limit? I run into this limit quite a bit, because I have a lot more devices.

And... Why is there is WhatsApp for most commonly used devices, but iPads?

Re:Engineering for Slow Internet by swiftcoder on Friday May 31, 2024 @04:26AM (#40532647)
> Why is there is WhatsApp for most commonly used devices, but iPads?

I was frustrated by this a while back, so I asked the PMs. Basically when investing engineering effort WhatsApp prioritises the overall number of users connected, and supporting iPads doesn't really move that metric, because (a) the vast majority of iPad owners also own a smartphone, and (b) iPads are pretty rare outside of wealthy western cities.

Re:Engineering for Slow Internet by toast0 on Friday May 31, 2024 @11:15AM (#40536253)
I've been gone too long for accurate answers, but I can guess.

For iPad, I think it's like the sibling notes; expected use is very low, so it didm't justify the engineering cost while I was there. But I see some signs it might happen eventually [1]; WhatsApp for Android Tablets wasn't a thing when I was there either, but it is now.

For the four device limit, there's a few things going on IMHO. Synchronization is hard and the more devices are playing, the harder it is. Independent devices makes it easier in some ways because the user devices don't have to be online together to communicate (like when whatsapp web was essentially a remote control for your phone), but it does mean that all of your communications partner's devices have to work harder and the servers have to work harder, too.

Four deviced covers your phone, a desktop at home and work, and a laptop; but really most of the users only have a phone. Allowing more devices makes it more likely that you'll lose track of one or not use it for long enough that it's lost sync, etc.

WhatsApp has usually focused on product features that benefit the most users, and more than 4 devices isn't going to benefit many people, and 4 is plenty for internal use (phone, prod build, dev build, home computer). I'm sure they've got metrics of how many devices are used, and if there's a lot of 4 device users and enough requests, it's a #define somewhere.

[1] https://www.macworld.com/article/668638/how-to-get-whatsapp-...

Re:Engineering for Slow Internet by izacus on Friday May 31, 2024 @05:38AM (#40533046)
Yeah, it's very very noticeable that WhatsApp is architected in a way that makes experience great for all kind of poor connectivity scenarios that most other software just... isn't.
Re:Engineering for Slow Internet by luuurker on Saturday June 01, 2024 @03:50PM (#40548547)
Part of the problem seems to be the cost of peering in Australia:

https://blog.cloudflare.com/bandwidth-costs-around-the-world

Re:Engineering for Slow Internet by 2143 on Sunday June 02, 2024 @04:16AM (#40552401)
I kinda chuckled that you left out most of Asia.

Most global companies (at least the US-based ones) have deployed in India, where I'm at right now. I suppose a billion people online is too big of a market to ignore (or not; I really don't know). Or there are services that I'm completely unaware of that's not in India.

Internet's pretty fast as well. Much faster than a certain conspicuous European country you'd expect to have fast internet ;)

Re:Engineering for Slow Internet by camel-cdr on Friday May 31, 2024 @02:43AM (#40532125)
It's not only the services them self. I have a very slow mobile connection, and one thing that bothered me immensly is downloading images in the browser: How is it, than when I go to a .jpg url to view an image in the browser it takes way longer and sometimes times out, than hopping over to termux and running wget. I had this problem with both firefox and chrome based browsers. Note that even the wget download usually takes 10-30 seconds on my mobile connection.
Re:Engineering for Slow Internet by chris_pie on Friday May 31, 2024 @08:05AM (#40534012)
I have the same issue with nearly every static asset.
Re:Engineering for Slow Internet by bombcar on Friday May 31, 2024 @10:18AM (#40535515)
Browsers usually try to multiplex things, sometimes even the same image if the server supports "get specific byte range" or whatever.

There may be a setting to turn a browser back into a dumb wget visual displayer.

Re:Engineering for Slow Internet by armchair_expert on Friday May 31, 2024 @02:10PM (#40538468)
You can try going into proxy settings and setting to "none" instead of autodetect. Also, the dns server used by the browser could be different (and slower).
Re:Engineering for Slow Internet by giantrobot on Friday May 31, 2024 @04:50PM (#40540091)
Too many services today do stupid image transcoding today. While the URL says jpg it will decide that because your browser supports WebP that what you really must have wanted was a WebP. It'll then either transcode or just send you WebP data for the image or send you a redirect. This is rarely what you actually want.

With wget it sends you the source you actually requested and doesn't try to get clever (stupid). Google likes WebP so that means everyone needs to join the WebP cargo cult even if it means transcoding a lossy format to another lossy format.

Re:Engineering for Slow Internet by pimeys on Friday May 31, 2024 @01:28AM (#40531796)
I guess in London you get wifi only on stops, it's the same in Berlin. In Helsinki the wifi connection is available inside the trains, and in the stations. So you never get a connection loss when moving. I never understood the decision in Berlin to do this, why not just provide internet inside the train...

And yeah, most of the internet works very badly when you drop the network all the time...

Re:Engineering for Slow Internet by pintxo on Friday May 31, 2024 @01:34AM (#40531824)
Berlin did not have mobile connections inside the tunnels until very recently (this year, I believe). This included the trains not being connected to any outside network. Thus wifi on the subway was useless to implement.
Re:Engineering for Slow Internet by amaccuish on Friday May 31, 2024 @03:39AM (#40532411)
They did if you were on o2, that's why I'm still with Aldi Talk (they use the o2 network); they've had LTE through the entire network for a while now. The new thing is 5G for everyone.
Re:Engineering for Slow Internet by rkachowski on Friday May 31, 2024 @03:47AM (#40532455)
Despite Berlin's general lack of parity with modern technology, I've never actually had a problem with internet access across the ubahn network in the past decade. I noticed that certain carriers used to have very different availability when travelling and so switched to a better one, but I was always surprised at being able to handle mobile data whilst underground.
Re:Engineering for Slow Internet by nicbou on Friday May 31, 2024 @04:14AM (#40532573)
Really? I don't even get consistent internet on the Ringbahn. There are lots of holes in the coverage in Berlin.

Which provider are you with? Vodafone is still dead in large parts of the U-Bahn, but I know that one of them works much better.

Re:Engineering for Slow Internet by avh02 on Friday May 31, 2024 @04:50AM (#40532768)
used to have spotty coverage underground with vodafone, when i switched to telekom, internet suddenly magically worked underground on the routes i used.

I believe someone published a map of the data coverage of different providers on the berlin ubahn, but probably outdated now

Re:Engineering for Slow Internet by rkachowski on Friday May 31, 2024 @06:44AM (#40533390)
Yeah, admittedly this year I've also started experiencing holes on the ringbahn (strangely and consistently around frankfurter allee), but the ubahn has been fine.

I'm with sim.de which I believe is essentially an O2 reseller (apn references o2)

Re:Engineering for Slow Internet by immibis on Saturday June 01, 2024 @05:26AM (#40544185)
Gesundbrunnen too.
Re:Engineering for Slow Internet by brabel on Friday May 31, 2024 @06:56AM (#40533463)
Wow! I was in Berlin last week and kept losing connection... like all the time. I use 3 with a Swedish plan. In Sweden, it literally never drops, not on trains, not on metro, not on faraway mountains... it works everywhere.
Re:Engineering for Slow Internet by saagarjha on Friday May 31, 2024 @02:07AM (#40531977)
I was in Berlin earlier this month and the cellular connections underground were quite good now. So maybe this is less of a problem?
Re:Engineering for Slow Internet by nicbou on Friday May 31, 2024 @04:14AM (#40532576)
It's provider-specific
Re:Engineering for Slow Internet by alanpearce on Friday May 31, 2024 @10:56AM (#40536016)
Not any more? https://unternehmen.bvg.de/pressemitteilung/grossprojekt-erf...

Summary: since 2024-05-06, users of all networks also get LTE in the U-Bahn thanks to a project between BVG and Teléfonica (not surprising that Teléfonica deployed the infra because they had the best U-Bahn LTE coverage beforehand)

Re:Engineering for Slow Internet by Liskni_si on Friday May 31, 2024 @10:04AM (#40535326)
Yes, right now it's mostly just wifi at stations only. However, they're deploying 4G/5G coverage in the tunnels and expect 80% coverage by the end of 2024 [1].

So… you can expect apps developed by engineers in London to get much worse on slow internet in 2025. :-)

[1]: https://tfl.gov.uk/campaign/station-wifi

Re:Engineering for Slow Internet by bombcar on Friday May 31, 2024 @10:20AM (#40535538)
WiFi at a stop is as easy as putting up a few wireless routers, it's a bit more complex than at home but the same general idea.

Wifi inside the trains involves much more work, and to get them to ALSO be seamless across the entire setup - even harder. Easily 10x or 100x the cost.

It's sad, because the Internet shouldn't be that bad when the network drops all the time; it should just be slower as it waits to send good data.

Re:Engineering for Slow Internet by Anotheroneagain on Friday May 31, 2024 @11:35AM (#40536501)
I think they just put a wire in the tunnel.
Re:Engineering for Slow Internet by greenish_shores on Friday May 31, 2024 @03:34PM (#40539341)
Yes, that's the best way which is often used. A "leaky cable" aka "leaky feeder", to be particular.
Re:Engineering for Slow Internet by throwaway211 on Friday May 31, 2024 @09:53AM (#40535191)
The London Underground not having any connectivity for decades after other metro systems showed only that high connectivity during a commute isn't necessary.
Re:Engineering for Slow Internet by HPsquared on Friday May 31, 2024 @10:29AM (#40535665)
London fails to provide a lot of essentials.
Re:Engineering for Slow Internet by throwaway211 on Friday May 31, 2024 @06:24PM (#40540962)
Of which the need for status updates and short video isn't one.