Networking – Does the ISP cache all data

cacheinternetnetworking

To clearly show my question I'm going to use pretty high numbers. A file server is connected to the internet through a 1 gbps line. The server is sending a 100 gb file to the client. The file is fragmented into packets and sent with a speed of 1 gbps to the clients ISP. The client, however, is connected to the ISP with a 1 mbps line. This would mean that the ISP would have to save/cache all the data being sent to it from the file server until it is all received by the client.

Is this how it is done, or does the server somehow send the packets with the same rate as the slowest line between the server and the client?

Best Answer

The Internet does not use only one protocol. It doesn't even use only one protocol at time: it actually uses several at once, which stack up on top of each other to do all sorts of different things. If we oversimplify things a little, you could say that it uses four.

  • Link Layer: A protocol that lets you push a signal down a wire (or radio waves, or flashes of light, or whatever) to another machine on the other end. Examples include PPP, WiFi, and Ethernet.
  • Network Layer: A protocol that lets you push a signal through a chain of machines, so that you can get data between machines that aren't directly connected. This is where IP and IPv6 live.
  • Transport Layer: A protocol that lets you make some basic sense out of that signal. Some, like TCP, establish "virtual connections" between two machines, as though there were a wire straight between them. Others, like UDP, just blast bits of data out from one machine to another. Different protocols have different strengths and weaknesses, which is part of why there are so many.
  • Application Layer: These are what we typically think of as "protocols". They're specialized for certain types of data, meant for specific purposes. Some examples include FTP, HTTP, and BitTorrent, which all transfer files.

Those file transfer protocols I mentioned are typically stacked on top of TCP (which is itself stacked on top of IP), which is where we get to your particular question. TCP tries, as best it can, to work like a wire straight between the machines would: when the server sends a packet, it can be sure the client got it, and it can be sure the client got its packets in the same order that the server sent them. Part of the way it does this is that every packet the server sends has to be acknowledged by the client: it sends a small signal back saying "OK, I got that packet you sent; I'm ready for the next one." If the server doesn't get that acknowledgment, it keeps sending packets until it does (or decides that this is never going to work and gives up).

This is the key to answering your question. The server can't send Packet 2 until it knows that Packet 1 got through, which can't happen until Packet 1 gets acknowledged, and that can't happen until Packet 1 is really finished. The servers in the middle of the chain don't have to cache any data (no more than one packet at a time, anyway) because by the time a machine even sees Packet 2, it knows that it doesn't need Packet 1 anymore.

One last point: technically, this only means that the Internet doesn't have to cache data the way you're talking about. If someone really wanted to cache all of this data, they could; there's nothing in the protocols to really stop it from happening. But the Internet doesn't need these caches in order to work.

Related Question