Search This Blog

Monday, October 27, 2008

IP Addressing made simple, hopefully!

I am now going to focus on a topic that many computer users wish to know, but can't really seem to get the hang of. This of course is IP Addressing.

Basically all an IP Address is, is your computer's Social Security Number or street address number, that it uses to communicate on a network/Internet. (Of course the Internet is a network, just the biggest).

Unless your computer is not on a local network (Local Area Network(LAN)) or the Internet, your computer will not have an IP, because like I stated above, it's used in networking.

All machines must have different IPs. It's the same principle as SSNs or house numbers. Neither of these can be the same either because of identity issues (SSN) and mail would get screwed up (house number).

There are 5 different classes of IP addresses. They are A-E.

Class A - 0.x.x.x - 126.x.x.x
Class B - 128.0.x.x - 191.255.x.x
Class C - 192.0.0.x - 223.255.255.x
Class D - 224.0.0.0 - 239.255.255.255
Class E - 240.0.0.0 - 255.255.255.255

Note: 127.x.x.x is missing because it's used only for loopback, or going back to your own machine. Basically if you type in your web browser, http://127.0.0.1 you will go straight to your own machine, no matter what machine you go to.

Note: There are some IP classes that are for LAN use only and not for WAN (Wide Area Networks, which includes the most popular one, the Internet).
10.0.0.0-10.255.255.255 - Class B subnet by default

169.254.0.0 - 169.254.255.255 - Class B subnet by default - This is Zeroconf, and normally is an IP address you get in Windows if you don't set your IP either by telling it you have a DHCP server or by defining a static one.

172.16.0.0 - 172.31.255.255 - Class B by default

192.168.0.0 - 192.168.255.255 - Class C by default and the notorious in home networks

Now in networking, you normally only work with Class A-C, because D is for multicasting and E is reserved, so in other words both are not used in every day networks.

Before I define how the classes have default subnets I must explain what a network id and host id is.

Network Id - The portion of the IP address that identifies what (logical) network you are on.
Host Id - The other part of the IP address that identifies the host/device, such as a computer, printer, server, etc. Any of these devices are normally called nodes.

In most home networks, the IP address go as such, 192.168.1.x. In home networks, set by the default standard, though it can be changed, a Class C subnet is used. I will explain subnets later.

The octets of an IP address are from 0-255, though when it comes to the host section, 0 and 255 cannot be used although sometimes, in the network id, it's acceptable to use 0 and 255, like 207.255.x.x or 192.168.0.x, it's best to just stay away from 0 and 255 completely.

There are 3 different default subnets.

Class A - 255.0.0.0 - allows for 16,777,214 hosts
Class B - 255.255.0.0 - allows for 65,534 hosts
Class C - 255.255.255.0 - allows for 254 hosts

An easy way to remember what the 255s and 0s even do, is just to substitute them for network id and host id. Basically, 255 means network id and host id is 0 (zero).

So if you are using a 192.168 network, with class A, 192 is your network id, so any machine starting with 192 is all one logical network, not mattering what's in the last 3 octets, which are the host id. This enables you to 16,777,214 machines, which I think is a little much for a home network.

Then if you have a class B, only machines on that their ip start with 192.168 will be on the same network, so machines that may have 192.167 or 192.169, are on a completely different network. The last two octets are host ids. This also normally is way too much for a home network.

Then of course, a Class C, makes it that machines that start with 192.168.1 one network, but machines that may be 192.168.0 or 192.168.2 or whatever else are different networks. Only the last octet is the host id. This is usually ideal for home networks, unless for some strange reason, more then 254 nodes are needed.

My way to remember how many 255's go in each Class, is A is the first letter of the alphabet, so one 255 and the rest 0's. Of course B is the second letter, so 2 255's and the rest 0's. Then C is obvious, it's the third letter, and 3 255s and one 0s.

Now you are not forced by default subnets, meaning even though home networks, 192.168.1.x are almost always Class C, you could easily create a Class B, if for whatever reason 254 hosts machines are not enough. When it comes to IPs, more is better than not enough.

Now all of this information deals with how IP addresses work, but you don't have to literally set all of your machines and devices by hand, you can also use what's called DHCP (Dynamic Host Configuration Protocol), which is a server that will run and by default most devices/nodes are set to DHCP, so even if you don't realize it, your devices will get IP address that the DHCP believes are free. Basically your node queries the DHCP server and sets it self to whatever the DHCP server told it to.

Note: Be extremely careful in a DHCP and Static IP mixed environment. You need to configure your DHCP server, so that it can't assign host ids in the range you want to be static. A conflict of address, will create a sitation where both nodes collide and cause all kinds of networking problems.

Notice: I do not claim this is a complete study of IP addresses and subnetting, but I'm just trying to give the normal every day user a glimpse in to the world of IP addressing so that it's not as confusing as it may appear. Also, there are different subnets than just those I describe, due to "borrowing" which were not discussed in this article, because for the normal user, there is no reason to throw away the defaults.

No comments:

Post a Comment