In classful addressing, the IP address 123.23.156.4 belongs to which class…
2012
In classful addressing, the IP address 123.23.156.4 belongs to which class format?
Answer: A. Class A — ConceptIn classful IPv4 addressing, the class of an address is fixed entirely by the leading bits of its very first octet. No mask, no subnetting and no later…
- A.
Class A
- B.
Class B
- C.
Class C
- D.
Class D
Attempted by 183 students.
Show answer & explanation
Correct answer: A
Concept
In classful IPv4 addressing, the class of an address is fixed entirely by the leading bits of its very first octet. No mask, no subnetting and no later octet takes part in that decision.
A leading 0 marks Class A, a leading 10 marks Class B, a leading 110 marks Class C, a leading 1110 marks Class D and a leading 1111 marks Class E. Reading those bit patterns back as decimal gives the first-octet ranges that identify each class on sight.
Class | Leading bits | First-octet range | Default mask |
|---|---|---|---|
A | 0 | 0 – 127 | 255.0.0.0 |
B | 10 | 128 – 191 | 255.255.0.0 |
C | 110 | 192 – 223 | 255.255.255.0 |
D | 1110 | 224 – 239 | none (multicast) |
E | 1111 | 240 – 255 | none (experimental) |
Application
Isolate the first octet of 123.23.156.4, which is 123. The remaining octets 23, 156 and 4 play no part in choosing the class.
Expand that octet as a sum of powers of two: 123 = 64 + 32 + 16 + 8 + 2 + 1, so its eight-bit pattern is
123 = 011110112
Read the leading bit of that eight-bit pattern: it is 0, which is the Class A bit pattern.
Confirm the same conclusion in decimal: 123 lies inside the first-octet range 0 to 127, which is the Class A range.
Cross-check
A first octet of 128 to 191 would be needed for the leading 10 pattern, and 123 is below 128.
A first octet of 192 to 223 would be needed for the leading 110 pattern, and 123 is far below 192.
A first octet of 224 to 239 would be needed for the leading 1110 multicast pattern, and 123 is far below 224.
The value 123 is also not 127, so the address does not fall in the 127.0.0.0/8 loopback block that is reserved inside the Class A range.
Hence 123.23.156.4 is a Class A address: under the default mask 255.0.0.0 its network id is 123 and its host id is 23.156.4.