dslreports logo
site
 
    All Forums Hot Topics Gallery
spc

spacer




how-to block ads


Search Topic:
uniqs
8111
share rss forum feed


Pashune
Caps stifle innovation
Premium
join:2006-04-14
Gautier, MS
Reviews:
·Vonage
·CableOne

"192.168.1.128/25" what does this mean?

I feel like a complete moron not knowing what these "/32" or "/27" numerics some people use next to IP addresses and I can't find any specific information explaining to me what it means.

From what I can understand so far, it describes a range of IP addresses, but how can you tell what the range is? This looks like a faster and more convenient way of doing it rather than using a long explanation (ex.: 192.168.1.1-192.168.1.24), but I don't get it. My math isn't the greatest if it helps any with this question.
--
TV: It's like the Internet only you can visit only 30-100 different sites, ever, and there's no adblock. -dwai


shdesigns
Powered By Infinite Improbabilty Drive
Premium
join:2000-12-01
Stone Mountain, GA
Reviews:
·EarthLink
·Comcast
·Atlantic Nexus
192.168.1.128/25 is 192.168.1.128-192.168.1.255

Look at CIDR notation on this page: »en.wikipedia.org/wiki/Subnetwork

Most are class A-C network masks:
/24 255.255.255.0 Class C
/16 255.255.0.0 Classs B
/8 255.0.0.0 Class A

Works nice if it is divisible by 8. The /nn is easier to use when it is not /8, /16 or /24.
--
Scott Henion

Embedded Systems Consultant,
SHDesigns home - DIY Welder


cdru
Go Colts
Premium,MVM
join:2003-05-14
Fort Wayne, IN
kudos:7

3 recommendations

reply to Pashune
/25 indicates that the subnet mask has 25 1's in it. In "binary", it would appear as 11111111.11111111.11111111.10000000 or in decimal notation, 255.255.255.128.

/24 is probably the most common subnet you'll see since that's what most consumer routers and home networks use by default, and in that case it's 11111111.11111111.11111111.00000000 or 255.255.255.0.

To get the number of addresses within the particular subnet, the formula is 2^(32-x) where x is the subnet. So for a /25, you would have 2^(32-25) = 2^7 = 128. You lose one for the network address and one for the broadcast so you typically have 2 less than the formula indicates usable addresses for hosts (there are exceptions to this...but it's more then you probably need to know).

To get the range of addresses for a particular subnet, you take the IP address and bitwise AND between the IP address to the subnet. If you aren't familar with the AND operation, it's one of the basic arithmetic operations for binary numbers. If both bits are 1, then the result is 1, otherwise the result is 0. So taking a fictitious address of 192.168.1.200/25, in binary that would appear as:

11000000.10101000.00000001.11001000 (192.168.1.200 Ip address)
11111111.11111111.11111111.10000000 (/25 or 255.255.255.128 subnet mask)
---------------------------------------AND
11000000.10101000.00000001.10000000

11000000.10101000.00000001.10000000 is the same as 192.168.1.128 so we have our network address or the lowest IP address in the block of 128.

To get the upper end of the addresses which is also the broadcast address, take the network address that we found above along with the inverted subnet mask and XOR them. XOR is another bitwise operator where if either bit is 1 but not both, then the result is 1, otherwise 0. That would look like:
11000000.10101000.00000001.10000000 (192.168.1.128 network address)
00000000.00000000.00000000.01111111 (/25 subnet mask inverted)
---------------------------------------XOR
11000000.10101000.00000001.11111111

11000000.10101000.00000001.11111111 in decimal notation is 192.168.1.255.

So we for our example of 192.168.1.200/25 we know the network address (lowest IP) is 192.168.1.128, the broadcast address is 192.168.1.255, and we have the 126 usable IP addresses between 192.168.1.128-192.168.1.255.


clarknova

join:2010-02-23
Grande Prairie, AB
kudos:7
Reviews:
·TekSavvy DSL

1 edit
said by cdru:

You lose one for the network address and one for the broadcast so you typically have 2 less than the formula indicates usable addresses for hosts (there are exceptions to this...but it's more then you probably need to know).

Please elaborate on the exceptions. I'm not looking for a college course; a link to wikipedia or google search terms would be helpful though.
--
db


NormanS
I gave her time to steal my mind away
Premium,MVM
join:2001-02-14
San Jose, CA
kudos:12
Reviews:
·SONIC.NET
·Pacific Bell - SBC
reply to Pashune
For math challenged folks, like me, there is:

»grox.net/utils/whatmask/

Plug in what you know, and it will tell you what you don't know. Play with it a bit and you will start to get a feel for how the numbers read.
--
Norman
~Oh Lord, why have you come
~To Konnyu, with the Lion and the Drum


cdru
Go Colts
Premium,MVM
join:2003-05-14
Fort Wayne, IN
kudos:7
reply to clarknova
said by clarknova:

said by cdru:

You lose one for the network address and one for the broadcast so you typically have 2 less than the formula indicates usable addresses for hosts (there are exceptions to this...but it's more then you probably need to know).

Please elaborate on the exceptions.

Two that immediately come to mind are /31 and /32 subnets.

A /31 only leaves a single bit for the hosts, or two addresses. If we subtract 2 addresses for the network and broadcast address, that doesn't leave us any usable IPs as we traditionally define it. However with a /31 it would be presumed to just be a peer to peer connection, where there is only a sender and a receiver. By definition if I'm sending a message I'm also broadcasting it to all other nodes (of which there is just one) so unique IP addresses for each host isn't required.

A /32 can sometimes be used on a router for instance on loopback adapters or internal routing.


clarknova

join:2010-02-23
Grande Prairie, AB
kudos:7
Thanks for the clarification. I was hoping you were going to tell me how to use all the addresses in larger subnets, like a /30 or better. The info on /31 is interesting though, I never considered it to be a usable mask.
--
db


tubbynet
reminds me of the danse russe
Premium,MVM
join:2008-01-16
Chandler, AZ
kudos:1
said by clarknova:

Thanks for the clarification. I was hoping you were going to tell me how to use all the addresses in larger subnets, like a /30 or better. The info on /31 is interesting though, I never considered it to be a usable mask.

with address depletion is rapidly becoming a very popular mask and is supported on most major sw/router platforms from cisco, juniper, force10, brocade, alca-lu, etc.

q.
--
"...if I in my north room dance naked, grotesquely before my mirror waving my shirt round my head and singing softly to myself..."

sinuhe

join:2010-11-08
Atlanta, GA
reply to cdru
cdru, what a great post explaining this question, thank you


Kilroy
Premium,MVM
join:2002-11-21
Saint Paul, MN
reply to cdru
said by cdru:

/25 indicates that the subnet mask has 25 1's in it. In "binary", it would appear as 11111111.11111111.11111111.10000000 or in decimal notation, 255.255.255.128.

This is the best explanation of this that I have seen, thank you.
--
When will the people realize that with DRM they aren't purchasing anything?

cramer
Premium
join:2007-04-10
Raleigh, NC
kudos:9
reply to clarknova
said by clarknova:

Please elaborate on the exceptions

Non-Broadcast Multi-Access ("NBMA") links. There is no network or broadcast; it's just a bunch of hosts. (eg. Frame-Relay) [see also: Split Horizon] (and this only applies to IPv4. v6 has a whole other world of mess.)

And the number following the slash is called a "prefix-length".