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.
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.
/28
(32-4) aka mask 255.255.255.240
only. It results in 11111111 11111111 11111111 11110000