Always-on, reliable, fast internet access has become a requirement for most households. But while we benefit from the immense power of internet-connected entertainment, few of us know how that data gets sent to us.
Two big internet outages - both the result of a content delivery network (CDN) going down - have focused minds on how online content is delivered. Fastly, one of the leading CDNs, went down in June, knocking out big sites including Amazon, the Guardian and Reddit. Just a few weeks later, Akamai, another big CDN, also went down, this time knocking sites including British Airways, HSBC and Airbnb offline.
The infrastructure of the internet, a digital-first marvel, is altogether more analogue, with vast underwater cables, data centres and signal boosters enabling everything we download, stream and open online to arrive on our devices. These cables are the arteries of the internet - almost all the internet's traffic travels through them at one point on its journey from where websites are hosted to where they're delivered: your computer.
These cables, which have increased massively in capacity from around 300 terabits per second (Tbps) in 2015 to nearly 1,500Tbps in 2019, criss-cross the planet. Dozens connect the UK to Europe, the US and Canada alone, run by large internet infrastructure firms.
'They're long and they're expensive', says Christian Kaufmann, head of technology at Akamai, a content delivery network (CDN) provider that hosts data servers to help you stream games, songs and videos. If something goes wrong with them, it can cost millions of dollars to fix them.
The cables are tiny - at around one inch in diameter, the equivalent to a garden hose - but pack a huge punch. An outer layer of plastic protects copper tubing, which encloses steel wires that wrap around a range of optical fibres - thin tubes of glass through which light passes, carrying data.
Once the signal carrying the data reaches shore, it still travels through cables - fibre ones, similar in structure to those subsea cables. But you can't just lay internet fibre anywhere - and in the UK, space is tight. Internet infrastructure tends to piggyback on pre-existing infrastructure for gas, electricity or road and rail - fibre cables will be dug and laid parallel to gas pipes, or alongside train tracks.
The signal's journey across land and into your home
But it's not simply a case of laying a 250-mile long cable alongside the A1 between Newcastle and London to connect the two cities for internet access. The signal inside the internet fibre connection is carried by light - and light signals can wane over long distances.
Between Newcastle and London, you'd likely find at least five stops - one every 50 miles or so - where the fibre connection enters a small shipping container or building, the signal is taken and boosted, and sent back on its journey. Without being boosted, bits of the data would go missing as the signal wanes in power and more things go wrong.
Walk through a town or city and you'll see manholes, either to sewers or fibre ducts, which run alongside key pipelines. They carry that same signal all the way around the country.
From there, the signal can be broken out into different methods: you might have fibre to the home, in which case your fibre optic cable continues almost unbroken to your property. If you have so-called 'fibre to the cabinet', the glass cable becomes a copper one at the nearest telephone cabinet on your street and is then carried to your home from there.
Processing a request to visit a particular website is a relatively easy leap. But if you wanted to download a rare mp3 from Apple's iTunes server that no one else had accessed for a while - meaning there isn't a handy local copy nearby - then your request might have to travel quite a while.
If you're in Newcastle and there isn't a local copy on a nearby Akamai server, then Akamai hunts out a version. If you're lucky, there will be one in the UK that it will access. If not, then your request is traversing the Atlantic over one of the many submarine cables to the United States.
The complication comes in how files like mp3s are handled. They're not sent in a single, simple package: they're chunked up and sent in pieces from data servers, which are giant racks of hard drives held in cooled locations to keep them running most efficiently.
All this happens in matters of milliseconds, although the distance it has to travel does impact the length of time taken. From a home computer in Newcastle's suburbs to the central data centre it would probably take two to five milliseconds. To London, it will be another 20 milliseconds or so. Crossing the ocean is between 70 and 80 milliseconds, and then from New York to San Francisco is about the same time again.
That isn't always the most efficient way to deliver data - and the people behind the internet's infrastructure know it. Which is why they have instigated new systems in the past 20 years to enable the better transfer of data.
One of them is Multiprotocol Label Switching (MPLS). Rather than letting an individual packet of data determine its own way around the globe, MPLS requires that it's sent a certain way - so you know you have more reliability.
One of the challenges, says Kaufmann, of keeping internet infrastructure up to date is that it requires building on top of what's already there, rather than ripping up the infrastructure and starting again. We wouldn't countenance turning the internet off for days, weeks or months to upgrade it from scratch.
People choose to navigate the internet in different ways. Some privacy-conscious users use the Tor browser to hide their tracks online, which adds complexity and any number of different stops on the journey of any given data packet. Others use virtual private networks (VPNs) to pretend they're browsing the internet from other countries.
Fibre broadband is faster than 'normal' broadband, but often pricier. If you can, get fibre to the premises (which uses fibre optic cables through the entire route) rather than fibre to the cabinet (which hops on to a copper wire for the last leg of the journey).
Irrespective of your connection, if you want fast, reliable internet, it's better to connect your computer to the router using a wire, rather than relying on a wireless signal. Routers often use the 2.4GHz signal, which is shared by other appliances, including fridges and microwaves - so when you reheat your coffee you could slow down your internet.
If you do stay wireless, try and put your internet router on a table rather than the floor, as the signals are beamed out from all angles of the device - and putting it on the floor means that some disappear.
In an average home, you'd be surprised at the number of devices that are always connected to wi-fi. If you've got wireless headphones, for instance, the signals being sent between it and your computer are eating into your internet bandwidth, slowing down speeds. Turn off what you don't need so what you do need can operate at its best.
If you're still not seeing the best results, try getting wi-fi boosters. These act in the same way as the repeater boxes that are placed every 50 miles for the arterial fibre connections across the globe.