A subnet mask is a logical subdivision of an IP network. It is a practice of dividing a network into two or more networks. Devices that belong to a certain subnet are addressed with an identical most-significant bit-group in their IP addresses. Subnetting is the logical division of an IP address into two fields, the network number and the host identifier. For instance, 18.104.22.168/26 is the prefix of the Internet Protocol version 4 network starting at the given address, having 26 bits allocated for the network prefix, and the remaining 6 bits reserved for host addressing.
The pros of subnetting an existing network vary with each deployment scenario. In a large organization, it is necessary to allocate address space efficiently. Subnetting enhances the routing efficiency. It have advantages in network management when subnetworks are administratively controlled by different entities in a larger organization. Subnets can be arranged logically in a hierarchical architecture dividing an organization’s network address space into a tree-like routing structure.
A wildcard mask on the other hand is a mask of bits that indicates which parts of an IP address are available for examination. It helps to indicate the size of a network or subnet for some routing protocols, such as OSPF. It also indicates what IP addresses should be permitted or denied in access control lists (ACLs). Simply, a wildcard mask is an inverted subnet mask. Thus a subnet mask of 255.255.255.0 inverts into a wildcard mask of 0.0.0.255.
The wildcard mask employs a matching principle . In the wildcard mask, 0 means that the equivalent bit must match, 1 means that the equivalent bit does not matter. For example, a wildcard mask of 0.0.0.254 pplied to IP address 10.10.10.2 will match even-numbered IP addresses 10.10.10.0, 10.10.10.2, 10.10.10.4, 10.10.10.6 etc. Similarly, the mask applied to 10.10.10.1 will match odd-numbered IP addresses 10.10.10.1, 10.10.10.3, 10.10.10.5 etc. A combination of network and wildcard mask of 22.214.171.124 0.0.0.0 would match an interface configured exactly with 126.96.36.199 only, and nothing else. Matching a range of networks, the network and wildcard mask combination of 188.8.131.52 0.0.255.255 would match any interface in the range of 184.108.40.206 to 220.127.116.11. It is simpler and safer to stick to using wildcard masks of 0.0.0.0 and identify each OSPF interface individually. In situations where subnet masks does not apply, the wildcard masks are used. For instance, it two affected hosts fall in different subnets, using a wildcard mask will group them together.
The list of Wildcard Mask includes the followings : 255.255.255.255/32 0.0.0.0, 255.255.255.254/31 0.0.0.1, 255.255.255.252/30 0.0.0.3, 255.255.255.248/29 0.0.0.7, 255.255.255.240/28 0.0.0.15, 255.255.255.224/27 0.0.0.31, 255.255.255.192/26 0.0.0.63, 255.255.255.128/25 0.0.0.127, 255.255.255.0/24 0.0.0.255, 255.255.254.0/23 0.0.1.255, 255.255.252.0/22 0.0.3.255, 255.255.248.0/21 0.0.7.255, 255.255.240.0/20 0.0.15.255, 255.255.224.0/19 0.0.31.255, 255.255.192.0/18 0.0.63.255, 255.255.128.0/17 0.0.127.255, 255.255.0.0/16 0.0.255.255, 255.254.0.0/15 0.1.255.255, 255.252.0.0/14 0.3.255.255, 255.248.0.0/13 0.7.255.255, 255.240.0.0/12 0.15.255.255, 255.224.0.0/11 0.31.255.255, 255.192.0.0/10 0.63.255.255, 255.128.0.0/9 0.127.255.255, 255.0.0.0/8 0.255.255.255, 254.0.0.0/7 18.104.22.168, 252.0.0.0/6 22.214.171.124, 248.0.0.0/5 126.96.36.199, 240.0.0.0/4 188.8.131.52, 184.108.40.206/3 220.127.116.11, 192.0.0.0/2 18.104.22.168, 22.214.171.124/1 127.255.255.255, and 0.0.0.0/0 255.255.255.255.
Some major differences between subnet mask and wild card mask includes the followings:
- Subnet mask is a 32 bits value which differentiate a network into a host portion & network portion of an IP address where network portion is designate by the 1’s & host portion by 0’s. Wild card mask importantly defines which IP addresses are allowed & which are blocked where 0’s defines the accurate match, the non zero value defines any value on the corresponding octete.
- Subnet mask is the value which determine from which class the ip address is realted. Wild card mask defines which IP addresses are allowed & which are blocked and used in extended access list and ospf also.
3.Subnet-mask is used to match contigous bits, means in subnet mask there is no 1 after 0. Its always from high (1’s) to low (0’s). For example, 255.255.0.0 (11111111.11111111.00000000.00000000) . In this example, there’s a continous 1’s and continous 0’s. It cannot be like 255.0.255.0 (11111111.00000000.11111111.00000000). Subnet mask is classified on class A,B,C,D,E . For Class A subnet mask is 255.255.255.0, for Class B it is 255.255.0.0 , and class C it is 255.0.0.0 and wildcard mask is just opposite to Subnet mask and it is defined as 0.0.0.255, 0.0.255.255 and 0.255.255.255.
- Wildcard Mask is used to indicate to the IOS software whether to check or ignore corresponding IP address bits when comparing the address bits in an access list entry or OSPF/EIGRP network command. For example, for /30 : 255.255.255.252 subnet mask 0 . 0 . 0 . 3 is a wildcard mask and for /24 : 255.255.255.0 subnet mask 0 . 0 . 0 . 255 is a wildcard mask.
Click here for CCNA Certification