How the Internet Works 5: Bits and Binary

Theres a lot more to how the internet works, but for a few posts I want to talk about a few side topics which sort of underly everything about computers and the internet. The topic for this post is binary and bits.

So the first question is, what is binary? Binary is a base 2 number system. That might sound confusing at first, so I’ll try and compare it to a few examples you may be familiar with.

Take the number 2537. Two-thousand, five hundred, and thirty-seven. What that really means is two “thousands,” five “hundreds,” three “tens,” and seven “ones.” Our normal number system is in base-10, or decimal. What that really means is that each place stands for a power of ten. So “ones” is 10^0, “tens” is 10^1, etc.

When we talk about base-2, instead of our places standing for powers of 10, they stand for powers of two. So instead of “ones,” “tens,” and “hundreds,” we have “ones,” “twos,” and “fours.” “ones” is 2^0, “twos” is 2^1, “fours” is 2^2. (The notation X^Y means X to the power Y, so 2^3 is 2*2*2.)

If you look at the base-2 number 1011, what we have is a 1 in the “eights” place, a one in the “twos” place and a one in the “ones” place. Adding that up we get 8+2+1 = 11. The thing about binary is you only have ones or zeros, which is very easy for a computer to represent–it’s kind of like on and off.

One binary digit, a “one” or a “zero” is called a bit. Basically computers store everything in bits. All information is somehow represented in bits. It’s kinda crazy, but that’s what it is. So now you know.

How the Internet Works 4: IP Addresses

My last few posts have been about names on the internet. I talked about domain names and urls, and today I’m going to talk about IP addresses..

IP Addresses continue the very interesting series of names that we find on the internet. For us, they are sort of the end of the line when it comes to the internet and names. Our friend sends us a link, a URL of another webpage. That URL is the full human readable location of that thing on the internet. Part of that url is the domain name, which refers to a computer or a bunch of computers somewhere. But unfortunately, computers don’t really read English, and when you say “Go to thekeesh.com,” it really doesn’t know where to go.

There are a few steps in between that we will talk about later, but basically what happens is that you say “thekeesh.com” and it says: “173.230.152.171″

So that’s my real address on the internet. It’s an IP address, or an Internet Protocol Address.

I was going to make my own image like I’ve been doing in the past, but just found Wikipedia’s and it is pretty good.

So here’s an IP address broken down. It’s four numbers between 0 and 255 (8 bits, but we’ll get to that later). To be honest, it doesn’t really matter here what the numbers mean. Basically you can think of the IP Address as being the address of a domain name on the internet that computers understand.

The Big Issue

Basically, the internet has gotten really big recently, and we are running out of these numbers. Read more about it here. So people redesigned IP adresses to give us way more addresses. They are 128 bit (we will talk about that more later), but that means that there are “2^128 (approximately 340 undecillion or 3.4×1038) addresses,” according to Wikipedia. That is a huge number. We are much less worried about running out with IPv6.

So the moral of the story: An IP Address is the number assigned to a computer that is connected to the internet. Everything connected to the internet gets one, phones and printers too!

How the Internet Works 3: URLs

What is a URL? It’s just the start of a whole bunch of jargon-y acronyms that you’ll find here on the internet. The quick explanation is that a url is just a full name for something on the internet. Last post I talked about domain names, and domain names are just a part of the URL.

URL stands for Uniform Resource Locator, but it just means a specific thing on the internet. This may refer to a specific page on my blog, or a specific image you found off Google. Some people who get mad about technical things say that we should really call it URI (Uniform Resource Identifier), but the difference isn’t a big deal here, and most people call things URLs.

Here is an example URL: http://thekeesh.com/?s=domain+names

This has most of the parts of a URL that we care about.

The part that says “http://” or “https://” is the scheme or the protocol. That is just telling us something about the way everything is sent. We’ll talk more about that later. The part that says “thekeesh.com” or www.facebook.com is called the domain, like we talked about before. The part after the domain name but before the question mark is called the “path,” as you can see in the Facebook url, the path is “/jkeesh.” The part starting with the question mark is called the query string and gives a little more information to the URL. I will talk more about query strings in a later post.

That is what a URL is. You may still be confused on the parts of a URL, but we will go into more depth on those later. Whenever you send a “link” to someone, you really send them the URL. It’s just a specific thing on the internet, and the URL is the full name that refers to it.

How the Internet Works 2: Domain Names

A domain name is one of the most basic pieces of the internet. Basically, it is the way that you refer to a site on the internet, it is its address, or simply its name. Here are some domain names you may have heard of:

www.google.com
www.facebook.com
www.thekeesh.com

These are all domain names. But so is

mail.google.com

and as you can see from this short list, it’s slightly different. It has a different part at the start, which we call a “subdomain,” or something more specific.

On the far right we have the “top level domains,” (or TLDs), like com, edu, gov, and org. (Don’t look now but there is a new xxx TLD.) Then we get more specific with “google,” and even more specific with “www” or “mail.” These names are just ways to identify sites on the internet.

http://www.google.com

There’s also one more funny part in this one, which is “http,” which is the protocol. This is not technically part of the domain name, but we’ll talk more about this in a later post.

The main point here is to understand that there are such things called “domain names,” and they are how you identify websites on the internet. There are different parts and they get more specific going right to left.