tutorial – Netmaks and IP numbers

systemslave asked 2 years ago

Tutorial – Netmasks and IP numbers

This is a tutorial for non-tech nerds. I will take huge liberties and tell little white lies so that those without technical backgrounds can understand concepts. If you have a strong technical background may object to simplifications like ‘your computer chips will stop working if the magic smoke escapes – keep the magic smoke inside’.

Every network has a range of numbers (more than one). It takes at least four numbers just to let two machines talk. The lowest number in the range is the network address. That means it specifies the network in general and not any device in specific. The highest number in the range is called the broadcast address. It is used when you want every device on the network to hear what you say. Each device must have its own unique IP address within the range to exchange information. So if you have two computers plus a network address and a broadcast address that makes four numbers total.

The netmask describes how many addresses are in a range. It is not obvious how the netmask works when you look at regular decimal numbers like 224. Keep in mind that your computer does not think in decimal. It thinks in binary like this 11100000b. The little b at the end tells you that it is a binary representation and not the number eleven million one hundred thousand. In fact 11100000b is what 224 looks like to the computer (in binary). Wow! It looks like a pattern with all the 1s on one side and all the 0s on the other. Netmasks always have all the 1s on one side and all the 0s on the other.

Example 1: Netmask is 255.255.255.0 11111111b.11111111b.11111111b.00000000b

Example 2: Netmask is 255.255.224.0 11111111b.11111111b.11100000b.00000000b

Example 3: Netmask is 255.255.255.248 11111111b.11111111b.11111111b.11111000b

Try it for yourself. Type your netmask (if you know it) into a calculator and click binary to change it to binary format.

All of those 1s control how much of your IP address is used to route data to and from your network. The 0s control how much of your IP address is used to get data to devices on your network. The more 0s the more devices you can have.

So now let’s shift gears. You see what is going on with netmasks. Let’s see how they work in conjunction with IP addresses to control data flow. Pretend that your IP address is 192.168.1.50 and your netmask is 255.255.255.0. Let’s see what that looks like to the computer:

Netmask: 11111111.11111111.11111111.00000000
Address : 11000000.10101000.00000001.00110010

The computer separates them like this:

Netmask: 11111111.11111111.11111111________00000000
Address : 11000000.10101000.00000001________00110010

See how the netmask gets used? Now this part will be used to find networks outside of our subnet:

Netmask: 11111111.11111111.11111111
Address : 11000000.10101000.00000001

And this part will be used to find devices (like your computer) inside of our subnet:

Netmask: 00000000
Address : 00110010

The range of numbers that we can fit under this part of the mask is called the subnet. It contains all of the computers you can talk to without a router.

Well that is enough for today. If you find this useful let me know and I may try to explain more. I hope it helps.

-systemslave-

1 Answers
wimiadmin Staff answered 2 years ago

awesome....thanks!

Know the answer? Login or sign up for an account to answer this question.
Sign Up