Subnet Mask vs Wild Card Mask
Subnet Mask vs Wild Card Mask
1. Subnet Mask
A subnet mask is a key element in IP networking used to determine which part of an IP address belongs to the network and which part identifies a host within that network. It works by "masking" the network portion of the IP address.
- Like an IP address, a subnet mask consists of 32 bits for IPv4 and is usually represented in dotted decimal format (e.g., 255.255.255.0).
- Subnet masks help divide large networks into smaller subnetworks, enhancing routing efficiency.
- A subnet mask is composed of contiguous 1s followed by contiguous 0s.
- The 1s represent the network portion of the address, while the 0s represent the host portion.
- For an IPv4 address 192.168.10.100, with a subnet mask of 255.255.255.0
In binary:
- Identify their own network segment.
- Determine whether another device is within the same network or needs routing.
- Class A: 255.0.0.0 or /8
- Class B: 255.255.0.0 or /16
- Class C: 255.255.255.0 or /24
2. Wildcard Mask
- Wildcard masks are the inverse of subnet masks.
- While a subnet mask indicates the fixed network part (1s) and host part (0s), a wildcard mask does the opposite — it identifies bits to ignore rather than match.
- Wildcard masks use 0s to indicate that bits must match and 1s to indicate bits can vary.
- For example, if the subnet mask is 255.255.255.0, its wildcard mask is 0.0.0.255.
In binary:
Where we are using wild card mask
- Access Control: Wildcard masks specify ranges of IP addresses in access lists for network filtering.
- Routing Protocols: Define networks for dynamic routing configurations.
- Subnet mask /24 (255.255.255.0) → Wildcard mask (0.0.0.255)
- Subnet mask /16 (255.255.0.0) → Wildcard mask (0.0.255.255)