hi,
Ive been working on this problem where 'An organization is granted the block 16.0.0.0/8, the admin wants to create 500 fixed length subnets'
I'm having trouble with 'D' where i have to find the last address in subnet 500. Could someone explain how i could do this?
i am required to do the following questions: (i've already done till C)

a) Find the Subnet Mask = subnet mask is /17 since 9 bits are required for 512 subnet (8 + 9)
b) No. of addresses = 2^32-17 = 2^15 = 32768
c) Find the 1st and the last addresses in subnet 1 = 1st Address 16.0.0.0, last address 16.0.127.255 (i did these using ANDing and ORing)
d) find the first and the last addresses in subnet 500

ps. the answers for D are: 1st : 16.249.128.0, last: 16.249.255.255 (i just need to know how to get there)

thanks

Dani AI

Generated

Nice intuition from on the 128-step. Here is a faster way to jump straight to any fixed-length subnet, which also shows why it works.

With /17 subnets inside 16.0.0.0/8, there are 9 subnet bits: 8 bits land in the 2nd octet and 1 bit is the MSB of the 3rd octet. Number the subnets starting at 1. For subnet n, set i = n - 1 and then:

  • 2nd octet = i // 2
  • 3rd octet = (i % 2) * 128
  • 4th octet for the first address = 0
  • 3rd octet for the last address = 3rd octet start + 127
  • 4th octet for the last address = 255

In short, each pair of subnets shares the same 2nd octet; odd/even picks 0 or 128 in the 3rd. For n = 500, i = 499, so 2nd octet = 249 and the 3rd-octet MSB = 1 (i is odd), giving a 3rd-octet start of 128. Plug those into 16.[second].[third].x and you get the network and broadcast that match what posted. If you need the last usable host, drop the final .255 to .254.

If you prefer bits, write i in 9-bit binary. For n = 500, i = 499 = 111110011(2). The upper 8 bits (11111001) are the 2nd octet (249). The last bit (1) is the MSB of the 3rd octet, meaning add 128 there. Same result, zero counting by hand.

Well, if the first subnet starts at 16.0.0.0, and it ends at 16.0.127.255, then it means the second subnet starts at 16.0.128.0. Then you get the pattern: for every subnet, add 128 to the third octet. You can add manually until the 500th subnet, or come up with a formula for that.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.