1

Is this subnet mask is valid or not???

binary value of this 255.224.252.0 is

11111111.11100000.11111100.00000000 255.224.252.0

is it a legal subnet mask.

9

It is not valid. A subnet mask needs to be continuously 1-filled from the left. This is the reason why you can use the alternative notation with /x, where x describes the number of 1-bits (the size of the network prefix).

It basically specifies which bits from the left identify a network and which bits (the 0s on the right) need to be ignored as they differ for each node on that subnet.

Implementations could use a mask with embedded 0 bits for doing boolean operations (and-masking), but it does not make much sense in a world where routes for networks and subnets are based on prefixes for all other machines and routers.

The Wikipedia article on Classless Inter Domain Routing (CIDR) lists the history, justification and reference RFCs.

2
  • If so ,what about 255.255.156.0 11111111. 11111111. 11111111. 10011100 it ends correctly but 156 doesn't give 1s in a row such as 11110000
    – Wara
    May 9 '17 at 6:41
  • Same problem. A valid Prefix for 4 bit wide net is /28 (32-4) aka mask 255.255.255.240 only. It results in 11111111 11111111 11111111 11110000
    – eckes
    May 9 '17 at 6:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.