Subnets and masks
لم يُترجم بعد؛ يُعرض باللغة الإنجليزية
Every IPv4 address has two parts: which network it is on, and which device it is on that network. The subnet mask draws the line between them. Follow host A (192.168.1.10) as it uses its mask to decide who it can reach directly, then split its home network into four smaller subnets.
5 أسئلة سريعة
اختر إجابة لتعرف السبب. تُحفَظ نتيجتك مع تقدّمك.
01What subnet mask does /24 stand for?
/24 means 24 one-bits followed by 8 zero-bits. Three octets of 11111111 are 255.255.255, and the last octet of zeros is 0.
02On 192.168.1.0/24, which address is the broadcast address?
The broadcast address has every host bit set to 1. With 8 host bits, the last octet is 11111111, which is 255.
03How many addresses can devices use in a /26 subnet?
A /26 leaves 6 host bits: 2⁶ = 64 addresses. The first is the network address and the last is the broadcast, so 62 are left for devices.
04Host 192.168.1.10/26 wants to reach 192.168.1.77. What does it do?
With 255.255.255.192 the host's own network is 192.168.1.0 but the destination's is 192.168.1.64. Different networks mean the router has to forward it.
05Where do the four /26 subnets of 192.168.1.0/24 start?
Each /26 block holds 64 addresses, so the blocks start every 64: .0, .64, .128 and .192.
المسرد
- Bit
- A binary digit: 0 or 1. An IPv4 address is 32 bits long.
- Octet
- A group of 8 bits, written as a number from 0 to 255. Dotted decimal shows four octets, like 192.168.1.10.
- Subnet mask
- 32 bits that mark which part of an address names the network (1 bits) and which part names the device (0 bits).
- Prefix length
- The number of 1 bits in the mask, written after a slash: /24 is the same as 255.255.255.0.
- Network address
- The address with every host bit set to 0. It names the subnet itself and is not given to a device.
- Broadcast address
- The address with every host bit set to 1. A message sent to it reaches every device on the subnet.
- Bitwise AND
- Combining two bit patterns so a bit is 1 only where both are 1. Address AND mask gives the network address.
- Default gateway
- The router a host sends traffic to when the destination is not on its own subnet.
الملاحظات والمصادر
- 192.168.1.0/24 is private RFC 1918 space, the kind a home router hands out; 198.51.100.20 is an RFC 5737 documentation address. Host and router numbers are illustrative.
- A bitwise AND keeps a bit only when both bits are 1. Laying the mask over an address does exactly that, so the network part survives and the host part becomes 0 (RFC 1122 §3.3.1).
- After the split the router needs one address in each subnet (for example .1, .65, .129, .193) so it can forward between them.
- The "minus 2" rule has exceptions: a /31 has no broadcast and uses both addresses on point-to-point links (RFC 3021), and old advice to skip the first and last subnet is obsolete (RFC 1878).
اختبار يتاح بعد الخطوة الأخيرة.