-2

For 115.64.4.0/22 why only b and d are correct I know it means the network has assigned the first 22 bits are assigned for host.. Can somoene explain me why only those 2 are part of it. Please help me.

a. 115.64.8.32 b 115.64.6.255 c 115.64.8.31 d 115.64.5.128

  • the '4' in the original address connects to a 4 bit position in '6' and '5' binary representation, but an '8' in binary sets the 8 bit, but not the 4 bit. This may apply to your context, though you do not provide that context here. – Bill Jul 12 '21 at 06:44

1 Answers1

1

In the slash notation for IPs, the number after thes slash denotes the length of the subnet bitmask in bits. Therefore, "/22" is analogous to a subnet mask of 255.255.252.0, or put differently, the IPs in your subnet may vary only in the last 10 bits. The first 22 bits are fixed.

This leaves all 8 bits of the last number and also the two least significant bits of the number before. Thus, 115.64.4.0/22 covers the following range of IPs:

115.64.{4...7}.{0...255}
  • Thank you, it's still not clear for me why if .4. has +2 bits the range will be {4..7} can you please explain this part ? @user16424371 is because 8 will already need 3 bits ? –  Jul 11 '21 at 09:19
  • You can understand this best if you look at the IP in binary representation. The IP you specified written in binary reads – user16424371 Jul 11 '21 at 09:30
  • 01110011.01000000.00000100.00000000 -ip 11111111.11111111.11111100.00000000 -mask –  Jul 11 '21 at 09:34
  • Sorry, I accidentally sent my comment too early. What I meant to write: You can understand this best if you look at the IP in binary representation. 4 in binary reads 00000100 (all 8 bits written out). The bitmask for the third number is 11111100, so as I said in my answer, the last two bits are variable. This means that the following numbers are part of the subnet: 00000100 (4 in decimal), 00000101 (5 in decimal), 00000110 (6 on decimal) and 00000111 (7 in decimal). 8 on the other hand is not part of the subnet because that would be 00001000 which differs in bits 5 and 6. – user16424371 Jul 11 '21 at 09:36