I'll try to clarify what I interpret as your source of confusion:
An IPv4 address is a single 32 bit integer but it's not normally formatted that way when we write out an address.
As I'm sure you are aware, the norm is to write the address as [first eight bits in decimal].[next eight bits in decimal].[next eight bits in decimal].[last eight bits in decimal]
but it's important to realize that it's really just a different way of formatting that single, potentially very big, number.
When you specify a CIDR netmask (/n
) that says how many bits out of the 32 bit address form the network identifier, the remaining bits forming the host identifier.
In your example, 192.168.176.0/23
, the first 23 bits are the network prefix, leaving 9 bits for the host identifier, which means that the host identifier straddles the last octet boundary. The host identifier will affect the last two segments of the a.b.c.d
-formatted address.
To illustrate this, I'll include sipcalc
output showing both the addresses as raw bits (really more relevant to understanding the math) as well as a.b.c.d
-formatted addresses.
$ sipcalc -b 192.168.176.0/23
-[ipv4 : 192.168.176.0/23] - 0
[CIDR bitmaps]
Host address - 11000000.10101000.10110000.00000000
Network address - 11000000.10101000.10110000.00000000
Network mask - 11111111.11111111.11111110.00000000
Broadcast address - 11000000.10101000.10110001.11111111
Cisco wildcard - 00000000.00000000.00000001.11111111
Network range - 11000000.10101000.10110000.00000000 -
11000000.10101000.10110001.11111111
Usable range - 11000000.10101000.10110000.00000001 -
11000000.10101000.10110001.11111110
-
$
$ sipcalc 192.168.176.0/23
-[ipv4 : 192.168.176.0/23] - 0
[CIDR]
Host address - 192.168.176.0
Host address (decimal) - 3232280576
Host address (hex) - C0A8B000
Network address - 192.168.176.0
Network mask - 255.255.254.0
Network mask (bits) - 23
Network mask (hex) - FFFFFE00
Broadcast address - 192.168.177.255
Cisco wildcard - 0.0.1.255
Addresses in network - 512
Network range - 192.168.176.0 - 192.168.177.255
Usable range - 192.168.176.1 - 192.168.177.254
-
$