Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
2  
What you describe does not happen. The client makes a direct connection to the file server and downloads at 1 mbps. –  Ramhound Feb 6 at 19:55
    
@Ramhound How does this work? Do you have any external articles on it? How can the server know that it should output packets at 1 mbps? What happens if it doesn't limit to that speed? –  Friend of Kim Feb 6 at 19:57
    
Explaining how a web server works is outside the scope of your question. You asked if what you described is how it works, its not, the client's ISP never caches the file. What do you mean by "What happens if it doesn't limit to that speed?" what is it exactly? –  Ramhound Feb 6 at 19:59
1  
See en.wikipedia.org/wiki/… –  jjlin Feb 6 at 20:06
4  
No, the sender has to wait for the receiver to read data before it can send more data. There is a little buffering, but no caching (which is saving for later re-use). The sender will probably not even read most of the 100 GB from disk at any greater rate than the receiver consumes it. –  mgkrebbs Feb 6 at 20:36

2 Answers 2

up vote 10 down vote accepted

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.

share|improve this answer
3  
One thing - TCP supports (and almost every connection makes use of) a windowing feature that allows the server to send a number of packets without requiring a response. The client can acknowledge multiple packets at once. This can greatly speed things up on a slow or long-distance link. –  uSlackr Feb 6 at 20:45
    
Your answer combined with @uSlackr comment is the perfect answer to this question. Thank you both! –  Friend of Kim Feb 6 at 21:55
    
The exception would be an ISP side transparent caching proxy where it would download the data as fast as the ISP can receive it but the ISP's proxy would send it to the client slower. –  Locutus Feb 7 at 6:30
    
Does all the nodes on the internet have to support the protocol used? So all nodes has to support TCP and UDP for instance? –  Friend of Kim Feb 7 at 8:14
1  
@FriendOfKim: They have to support the same Network-layer protocol (IP, in the Internet's case), so that they can push signals through the chain of machines to get it where it needs to go. But that's the only one they all have to support. That's why they stack up protocols in this way: you can have all different kinds of links underneath IP, and all kinds of transports and applications above IP, and as long as everyone knows IP, the signal gets through. –  The Spooniest Feb 7 at 13:30

Most servers (Web, FTP, what have you) use bandwidth throttling to avoid having one computer hog all the available bandwidth. Each connection may be limited to a certain speed, so that multiple clients can connect and not be affected by slow downs. At least, too much. Remember, your connection is limited by the slowest link on your chain.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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