Tuesday, November 24, 2015

Week 12: Day 033 - TCP/IP Basics #4


Hello to anyone reading, this is my next entry on TCP/IP basics. If I can get this entry in before next week, then I will! I'm going to start picking up the pace on this again. Anyways, let's get right into it.

First, let's start out with learning about Class IDs. So the Internet is the most complex TCP/IP interwork there is, by far. When you have so many computers that an accurate estimate can't even be found then things get really difficult! This is why the biggest challenged faced in terms of the internet, is that two devices can not have the same IP. Because of this, an organization called the "Internet Assigned Numbers Authority" (IANA) was founded. Their job is to track IPs, and distribute public IPs to those who need it. They now also have control over a few RIRs (Regional Internet Registries) that hadn out IP addresses to the large corporate ISPs, like the ones we all know, "Comcast" and "Verizon". And it's these ISPs that hand out the IPs to customers. In essence they're like a middle man in this. Now the IANA doesn't just pass these out willy-nilly, there are different chunks of IP addresses called "class licenses". Here in Arlington, we have a class license of Class B, which is big for a county our size (hint: it's one of the richest counties in the United States) but good to have I suppose.

Here's a chart on Class Licenses:










Now a Class A license will have a network ID between 1 and 126, and hosts on the network can only have the first octet in common. This gives a huge amount of potential hosts, over 16 million!!! The chart is self explanatory with the subnet masks, so I will skip over that. Then the Class B license uses the first two octets to define the network ID. With this you cna have 65,534 possible hosts. Finally the Class C license has the first three numbers in common, with only 254 possible addresses. The other ones are not as important. Anyways, IP class licenses worked well for a while, but then the amount of IPs started diminishing. As you can tell by us having Class C, the IANA were a bit generous when handing out IP class licenses. In today's world, there is a new method of generating blocks of IPs, this is called "Classless Inter-Domain Routing" (CIDR). Before I continue there's a kind of shorthand that people use for subnet masks.
A /(number of ones in the subnet mask) is the method, for example:

11111111111111111111111100000000 = /24 (24 ones)
1111111111111111000000000000000000 = (16 ones)
111111110000000000000000000000000000 = /8 (8 ones)


What the heck is CIDR? Let's find out. This is a concept which is based on subnetting. Quick throwback, subnetting is when a single class of IP addresses are chopped up into smalled groups. Basically these two things are the same thing. However, the perpetrators are different. Subnetting is done by an organization, while CIDR is done by an ISP like Comcast. They've been around a while, and are critical to all TCP/IP.

Let's look into subnetting a little more to understand CIDR. So what is the purpose of subnetting? Well it's an efficient way of using IP addresses in comparison to class licenses. With it, you may control bandwidth, network seperation, etc. Now how do you subnet? Let's visit our old friend the subnet mask. You take existing subnets and extend the subnet mask. How so? You add more 1s. Let's bring in a hypothetical. Say that you were in an office building, and there were 50 computers for your workers, but 10 for administration. You don't want the employees to get into the administration machines, what do you do? Let's add something into the mix, you have wireless Internet, and want to separate the wireless clients to their very own subnets. First, you look at the subnet mask, move it towards the right until you have the number of subnets necessary. Next, forget the dots! Why is this? Well many techs fall victim to the dots, which is basically not converting to binary. They do this cause they're more used to class licenses. This in mind, the trick is to stop thinking about the network IDs and subnet masks in their decimal format and start thinking of them as binary numbers. Now let's start subnetting the network of our hypothetical.

When you're on the /24 subnet, add a zero so it becomes /25 subnet:
11111111111111111111111110000000

Now, on a /24 network, how many hosts can there be? In dotted decimal, this is how you would put it.

192.168.4.1 to 192.168.4.254 = 254 hosts

However, you gotta do it with binary instead. In a /24 network, there are eight zeros that could be the host ID:

00000001 to 11111110 = 254

My textbook claims this is a simple piece of math: 2x - 2, where x represents the number of zeroes in the subnet mask.

2^8 - 2 = 254

Remember this formula, and it will be easier to find the # of hosts in a subnet. If you have a /16 subnet mask, what is the maximum host count?

1. A subnet mask has 32 digits, so if you had a /16 subnet, taht means 16 zeroes would be left after the 16 ones.
2. 2^16 - 2 = 65,534

To complicate things a bit, what if you have a /26 subnet mask on your network?
1. Since a subnet mask has 32 digits as established, a /26 subnet means there are 6 zeros after 26 ones.
2. 2^6 - 2 = 62

This is precisely how you determine the number of hosts on any subnet mask. Next time, I will make a subnet! This week is cut super short because of Thanksgiving break, so I'll be off the rest of the week after today. I'm still going to try to make a new entry, and finish off this chapter, once and for all! Thanks for reading, and goodbye.

No comments:

Post a Comment