• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 316
  • Last Modified:

Understanding IP Addressing

I'm teaching myself all about TCP/IP and have a question. If I have the IP address on a network of 6.200.200.200 with the subnet mask 255.0.0.0 and second IP address of 6.200.200.201 with a subnet mask 255.0.0.0, obvisiously I can ping 6.200.200.200 from 6.200.200.201.

Okay, this is what I want to know, if I change 6.200.200.200 to subnet mask 255.255.0.0 why can I still ping it from 6.200.200.201? Isn't it now on a different Network ID?

Lastly, if I change 6.200.200.200 to subnet mask 255.255.255.0 why can I then NOT ping it from 6.200.200.201?

Bare in mind, this is a simple network with only a switch between the PC's (IP addresses), no routers etc.
0
DownsIT
Asked:
DownsIT
1 Solution
 
Chris DentPowerShell DeveloperCommented:

> Okay, this is what I want to know, if I change 6.200.200.200 to subnet mask
> 255.255.0.0 why can I still ping it from 6.200.200.201? Isn't it now on a different Network ID?

No, you're only masking 16 bits, the first two octets. That makes your network range run from:

6.200.0.0 to 6.200.255.255

Both IPs are within that range.

> Lastly, if I change 6.200.200.200 to subnet mask 255.255.255.0 why can I then
> NOT ping it from 6.200.200.201?

Something is going wrong there then. Both addresses are still on the same range. You're only changing the final octet, with everything else the same and a 255.255.255.0 mask they remain in the range:

6.200.200.0 to 6.200.200.255

Chris
0
 
Jim_CoyneCommented:
Chris is correct, but read this for a deeper understanding:

http://www.cisco.com/warp/public/701/3.html
0
 
NickGT20Commented:
You may have issues with your router trying to route that 6.x.x.x address on the internet.  If you are using a Linksys or D-link or some home office router that by default can only use NAT or PAT it will likely try to route that address out on to the internet.  If you are just plugging two computers in to a switch or together via a cross-over cable your original experiment should have worked.
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
NickGT20Commented:
Why not alter your experiment by using some RFC1918 Addresses like.  192.168.x.x 10.x.x.x 172.16.x.x that way no matter what kind of network equipment you are using you could still experiment with the masking and it will work as intended.
0
 
DownsITAuthor Commented:
Thank you Chris-Dent, I think I understand I little better now. Is this a correct statement:

All IP addresses are in the same Network ID (Class A, 6.0.0.0), the only change is the subnet they belong to which is depicted by the subnet mark. However, because there is no routing happening, all IP addresses are fooled into thinking they are on the same subnet because the 2nd and 3rd octet are the same.

I believe the 255.255.255.0 didn't work because I have an exterior router on the network, thank NickGT20, your comments made me think about that.
0
 
Chris DentPowerShell DeveloperCommented:

You need to take a step back from that a little.

Forget about the Router, you're only looking as traffic within a Subnet. There is no routing there, everything is directly connected. They're not fooled into being on the same network, they *are* on the same network.

This subject gets quite involved, which makes it difficult to explain in short blocks.

When you're looking at the Subnet Masks you're assigning you're speaking of Classless Subnets. In that case Class A has no place, it's irrelevant to the network in use. So don't worry about the fact that the network you've picked, 6.0.0.0 is within the Class A Classful block doesn't have any bearing on routing and Network Address assignment.

To see the effect of a Subnet Mask it helps to go back to Binary (well hopefully it'll be clearer). If we take a nice simple IP Address like 6.0.0.0.1 we write that in Binary like this:

00000110.00000000.00000000.00000001

Our Subnet Mask of 255.0.0.0 is written like this:

11111111.00000000.00000000.00000000

As the name suggests the Subnet Mask is hiding some of the bits setting up for a smaller range than just 0.0.0.0 to 255.255.255.255. This is just a practical way to split up the range, after all, we all want to share that so we need to ensure we can split it up into manageable blocks.

If we apply that mask to the IP Address you've got you end up with:

xxxxxxxx.00000000.00000000.00000001

Where xxxxxxxx are all the bits we've Masked and so unavailable to the Network Range we've chosen. A little more binary, that makes the first IP Address in our range look like this:

xxxxxxxx.00000000.00000000.00000000

And the last like this:

xxxxxxxx.11111111.11111111.11111111

Putting that back into Decimal we have x.0.0.0 and x.255.255.255 respectively. As long as the first number, represented by x, is the same in each case then the addresses are part of the same network.

Quickly applying the same principle to the smaller ranges you picked, you have a mask like this:

11111111.11111111.00000000.00000000

Hopefully you'll see that it means you've only got the last two Octets (known as such because each of the four is made up of 8 Bits) available to your network range. Meaning the first two octets must be the same in each case for the IP Addresses to be in the same range.

The same applies for your last range, except all of the first three must match for them to share a network range.

Of course, it's not quite a clear-cut as that. You can have subnet masks other than the three mentioned above.

I have a page on IP Maths on my website here:

http://www.highorbit.co.uk/networking/ipv4subnetting.asp

Which looks at a few more of the details of converting from and to the Binary forms, and why we'd want to do that anyway.

Chris
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Tackle projects and never again get stuck behind a technical roadblock.
Join Now