02 October 2009

welcome to the latest century

Here's how your web browser works.

HEY! HEY! Don't skip this unless you know this stuff already. It might demystify your monthly overage charges from your ISP, or help you yell in a more informed way at your roommates. It'll get back to this stuff in a few paragraphs, so hang in there.

When you type in a URL or click a link, your computer creates a little message (surely no more than a few kilobytes in the most extreme case). Your computer sends this message to your router (either through an Ethernet cable or across the wireless as a signal in the electromagnetic spectrum), which sends it to your modem (across the Ethernet cable) to your internet service provider (ISP) (across the DSL/phone/cable/satellite/etc.). All this time, the message's content hasn't really changed from that URL. Your ISP then sends this message to a name server, which is what knows how to map your URL to an IP address. When someone buys a domain name, they're in effect paying for these servers to include a mapping from their domain to the IP address of their webserver. Accordingly, the name server sends a new message containing the IP address for the original URL to your ISP which forwards it on back to your computer and finally your web browser.

Now the process starts over, this time using the HTTP protocol. Your web browser makes a new message (probably a GET request) and sends it to your router, modem, and then ISP. This time, the ISP sends it across the Internet backbone to the web server (identified by the IP address that the name server returned), which sends a HTTP response back to your web browser. Your web browser finally has the HTML (it's probably HTML but it can be other stuff) it needs to show you a web page. Other media in the web page, like images, are requested in a similar way before they can be shown as part of the page. Video, like YouTube for instance, are "streamed", which means that your computer is receiving later parts of the video (i.e. buffering) as it is showing you the parts it has already received.

(Wondering what HTTP messages look like?)

For all these things, the overall process is the same: your browser sends a message to a name server (via your router, modem, ISP) in order to translate a URL to an IP address, and then it starts communicating to that server (via your router, modem, ISP) to get the requested content (web page, image, video, etc.).

iTunes does a similar process (via your router, modem, ISP) when you search/preview/buy a song. Any program that uses the Internet basically does this same thing (via your router, modem, ISP).

Here's what makes this post relevant to your life. When your ISP gives you a bandwidth limit for the month, they actually give you two, one for upload (messages from your computer to your ISP) and one for download (messages from your ISP to your computer). When you click a link, there's at least two uploads and two downloads. Your browser uploads a request to translate a URL, your browser downloads the IP address, your browser uploads an HTTP request, and finally your browser downloads some HTML. Every time you upload something, your ISP counts how many bytes there was. If, in the billing cycle, that count exceeds your bandwidth limit, then you've broke the rules. (I think for upload bandwidth limits, they just really slowdown your upload rate.) But people don't usually approach the upload limit. Your ISP also counts the bytes it sends to you: how much you've downloaded. Overages here you're usually charged for.

So now you know that everything you do on the Internet contributes to your ISP's upload and download counts, regardless of how you're interacting with it. Unless, you're at a coffee shop, for instance. Then it's the coffee shop's account with the ISP that your Internet communications are associated with. This is why coffee shops usually have slower Internet. Otherwise, they'd hit their download limit very quickly because everyone would download their big files (movies, natch) there.

† – Technically, managing my units here, it's your bandwidth limit times one month, since a bandwidth is an amount of data (like 2 gigabytes) per an amount of time (like one month).

1 comment:

Tyler Harnett said...

This was helpful.
You are a geek.
Tyler was an abuser of our internet.
He was a nerd.