What is the diference between IP subnet mask 255.255.254.0 and 255.255.255.0?
24 Answers
IPv4 addresses use 32 bits. For example the adddress 127.0.0.1 translated to binary is 01111111 00000000 00000000 00000001.
For easy understanding instead of binary we, humans, use a decimal representation separating the 32 bits in 4 blocks of 8 bits.
Each block of 8 bits can go from 00000000to 11111111, or in decimal from 0 to 255.
The IP address is divided in two parts: network part and device part.
- The network part is common for all the devices on the same network
- The device part is unique for each device.
Who defines that division? The subnet mask.
On every IP device you have an adddress and a subnet mask. The subnet mask only marks how many bits are fixed (network part) and how many bits are variable (device part) to use for your devices.
An example:
Suppose you choose for your network the address 192.168.0.0. It is the network part.
You decide to use the netmask 255.255.255.0 (on binary each 255 is 11111111 and each 0 is 00000000). It means that you decided to use the last 8 bits of the address for your devices. 8 binary bits gives you 256 decimal, so you can have 256 addresses for the devices on your network ranging from
192.168.0.0to192.168.0.255. In real life you can't use the first and the last so you are in this case limited to 254 addresses.You change the network mask to 255.255.254.0. Now you have 9 bits for your devices (254 is 11111110). 9 binary bits translated to decimal gives you 512, so you can have 512 addresses for your devices ranging from
192.168.0.0to192.168.1.255. Just like before you can't use the first and the last so you are in this case limited to 510 addresses.
The netmask is chosen by the network administrator keeping in mind the size of the network (how many devices it will hold) and another design principles.
About private / public adddresses, IPv4 has 3 ranges that were defined for private networks, they are:
10.0.0.0 - 10.255.255.255
172.16.0.0 - 172.31.255.255
192.168.0.0 - 192.168.255.255
Anything outside those ranges is public and can't be used for a network unless it was assigned by IANA or a IANA delegate.
7From the wiki here you can see the three reserved private addresses ranges
IP address = 10.0.0.0 - 10.255.255.255, subnet mask = 255.0.0.0 (corporate)
IP address = 172.16.0.0 - 172.31.255.255, subnet mask = 255.240.0.0 (rarely seen)
IP address = 192.168.0.0 - 192.168.255.255, subnet mask = 255.255.0.0 or more common 255.255.255.0 (home use)The subnet mask is really not relevant for public/private.
1As mentioned above, subnet masks can be used for any private or public network. There's no rule or logic that indicates only certain subnet masks can be applied to certain public or private networks.
But to answer the question of what's different between 255.255.255.0 and 255.255.254.0...
255.255.255.0 allows for a total of 254 IP addresses to be used. 1 is for the subnet itself and another for the broadcast. Best example of this is the network 192.168.1.0. That is the ip of the subnet itself. 192.168.1.1-192.168.1.254 are all valid IPs That can be assigned to client devices. Finally, 192.168.1.255 would be the broadcast address.
This contrasts with the subnet mask 255.255.254.0 in that it offers 510 valid IP addresses. Still one for the subnet itself and one for the broadcast.
Another example for this:
Network: 192.168.0.0 Broadcast: 192.168.1.255 Valid IPs: 192.168.0.1 - 192.168.1.254
Keep in mind, these ip ranges are just examples. You can use other IP addresses to subnet but the idea is the same regardless.
255.255.255.0 is usually used for small private networks, yes. It assumes that there's only one router in the network and has a capacity of up to 253 or 254 clients. This is the most common setup where the router's IP address is 192.168.1.1.
255.255.254.0 is used for some two-router setups, such as modem-router or modem-router-router (where the modem is set to bridged mode). The routers could be at 192.168.1.1 and 192.168.0.1 each with their own sets of clients.