Subnetting problem

Unanswered Question
Aug 11th, 2009
User Badges:

I don't know where exactly to start from. So instead, i will jump right on to the question.


Say you are being provided with 2 IP addresses, PC 1's IP address and PC 2's IP address, which are 17.4.4.2 and 14.2.3.2 respectively. You are required to find the subnet mask of these 2 PC's in such a way that both the PC's are in the same network.

Now my question to you is " is their any way (a decimal way) in which we can find a new subnet mask or prefix length for them. If this is all we are provided with"


PS: I know that there is a binary way in which you can find the prefix length or S.B mask, i want to know if there is any other way to find it.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
chinkevi_2 Tue, 08/11/2009 - 15:59
User Badges:

if they are live pc with those ip configured, and if they support icmp mask reply, you can do icmp ping mask request. but this icmp type is not supported or turned off by pc, and pretty much only available in unix/linux system.

otherwise, your best bet is to ask whoever provided the ip to check and give you the mask.

vishalprashar Tue, 08/11/2009 - 16:56
User Badges:

I am sorry but my question is a total hypothetical one.. I just wanted to know is there a way in which we can find out the prefix mask theoretically.. Please let me know in case you are ware of any method apart from the binary one..

Leo Laohoo Tue, 08/11/2009 - 17:08
User Badges:
  • Super Gold, 25000 points or more
  • Hall of Fame,

    The Hall of Fame designation is a lifetime achievement award based on significant overall achievements in the community. 

  • Cisco Designated VIP,

    2017 LAN, Wireless

Nope.

JORGE RODRIGUEZ Tue, 08/11/2009 - 21:42
User Badges:
  • Green, 3000 points or more

As others stated you cannot tell a mask by simply looking at the ip address alone , at least if you were give a /9 or a /18 etc.. you can then know the prefix.. if this was a theory question to trick you I would probably place these ips in the class A network which falls under 1-to-126 therefore a /8 bit mask.



Regards

iyde Wed, 08/12/2009 - 12:06
User Badges:
  • Silver, 250 points or more

Well, if the requirement is to decide what subnet mask to put on the IP addresses to make them both to be in the same subnet, then the only way is a kind of "binay decimal". By this I mean that certain numbers are relatively easily remembered as matching certain masks.

You have IP addresses 17.x.x.x and 14.x.x.x and from that we can figure out how the most specific mask is.

As one person mentioned, if you use a /8 you would cover all 1.x.x.x to 127.x.x.x.

If you the go for a /9, you'd cover 1.x.x.x to 63.x.x.x; a /10 will give 1.x.x.x to 31.x.x.x etc.

From that we end up with the fact that a /11 would give 1.x.x.x to 15.x.x.x or 16.x.x.x to 31.x.x.x - which will put your two IP adresses in different subnets.

So in short, you'd have to use a /10 mask in order to put them in the same subnet.

HTH

Jon Marshall Wed, 08/12/2009 - 13:00
User Badges:
  • Super Blue, 32500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

Ingolf


"As one person mentioned, if you use a /8 you would cover all 1.x.x.x to 127.x.x.x."


Not sure i follow this. If you use a /8 then you can only use one class A network so


14.2.3.2/8 and 17.4.4.2/8 are in different networks not the same. To get them in the same network you need to use less than 8 bits not more or have i misunderstood ie.


you can't use 252, 248 or 240 because this means that


14.2.3.2 falls in a different subnet than 17.4.4.2 ie,


252 means subnets go up in 4 so


0.0.0.0/6

4.0.0.0/6

8.0.0.0/6

12.0.0.0/6 -> 14.2.3.2 falls here

16.0.0.0/6 -> 17.4.4.2 falls here


248 -


0.0.0.0/5

8.0.0.0/5 -> 14.2.3.2

16.0.0.0/5 -> 17.4.4.2


240


0.0.0.0/4 -> 14.2.3.2

16.0.0.0/4 -> 17.4.4.2


224


0.0.0.0/3 -> 14.2.3.2 + 17.4.4.2

32.0.0.0/3


so all we can say for sure is that the mask would have to be either


224.0.0.0

192.0.0.0

128.0.0.0


all of the above 3 subnet masks would allow 14.2.3.2 and 17.4.4.2 to be in the same subnet but none others as far as i can see.


Have i got this wrong ?


Jon

vishalprashar Wed, 08/12/2009 - 18:56
User Badges:

In fact John you are the only person who has got it right till yet.. I wanted to know is there any way, or is there any hard and fast rule that can be applied to this kind of problem.

I really need to know if there is any way, using the decimal numbers, in which these kind of problems can be solved.


Vishal

Jon Marshall Thu, 08/13/2009 - 04:48
User Badges:
  • Super Blue, 32500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

Vishal


As the others have said there is no way from just having 2 ip addresses to say what the subnet mask would be.


All i did was rule out what it couldn't be but with those 2 addresses there are still 3 possible masks ie.


224.0.0.0

192.0.0.0

128.0.0.0


and it's not possible to say which one it is.


Jon

fjcardenas-1 Thu, 08/13/2009 - 05:27
User Badges:

May be this can help:

If you see you have an ip starting in 14.X.X.X and another starting in 17.X.X.X, and you want them in the same subnet you have to figure out a range of addresses in which this addresses can fall.

Range starting in 0 to 7 - Doesn't contain the addresses.

Range starting in 0 to 15 - Contains only address starting in 14 but not the 17.

Range starting in 0 to 31 - Contains both addresses (14 and 17). So, from 0 to 31 you have 32 numbers. Subtract that number from 256 and you get 224. So 224 would be the exact mask you would need that contains addresses 14 and 17. But as John said.... masks 198 and 128 also can contain the 2 addresses.

Actions

This Discussion