Which of the following are valid IP address?
(A) 192.168.5.55
(B) 192.168.0.0
(C) 192.168.256.2
(D) 260.168.5.12
Which of the following are valid IP address?
(A) 192.168.5.55
(B) 192.168.0.0
(C) 192.168.256.2
(D) 260.168.5.12
Solution
An IPv4 address has four decimal numbers separated by dots, and each number (octet) must lie between 0 and 255, since each is stored in 8 bits.
(A) 192.168.5.55 has all four octets within 0-255, so it is valid.
(B) 192.168.0.0 also has all octets within 0-255, so it is valid as a syntactic IP address. Here it is a network address, but it is still a well-formed IP.
(C) 192.168.256.2: the third octet is 256, which is above 255, so it is invalid.
(D) 260.168.5.12: the first octet is 260, which is above 255, so it is invalid.
An octet of 0 is allowed. The common trap is thinking 0 is not allowed, or that 256 is allowed.
Related questions:
2025: 16 May Shift 1
2025: 13 May Shift 2
2025: 16 May Shift 1

