- What is the network address?
- Provide an expression to obtain it.
- What is the broadcast address?
- Provide an expression to obtain it.
- Does the address 10.10.8.27 belongs to the same network? And 10.10.10.27?
- What are the subnets obtained when you split the network from question 1 into two equal-size subnets? Please indicate the maximum number of hosts each one of them may have.
Have a look at Network Address Translation (in 4.4) and sections 4.4.3, 4.4.4 and 4.4.5. See you on Friday.
People had trouble finding an expression for questions 2 & 4.
ReplyDeletelong mask = (0x100000000L - (int) Math.pow(2,32-23));
network = ip & mask;
broadcast = ip | (mask 0xffffffffL);
Or ...
ReplyDeletelong mask=(0x100000000L - (1L << (32-23)));
too.
We only care about the 32 least significant bits of these long numbers.
Here you can see some code to handle all that:
ReplyDeletehttp://pastie.org/6342528