Tuesday, February 19, 2013

Some homework for next class

A given computer has the IP address 10.10.9.10/23. Please answer the following questions:
  1. What is the network address? 
  2. Provide an expression to obtain it.
  3. What is the broadcast address?
  4. Provide an expression to obtain it.
  5. Does the address 10.10.8.27 belongs to the same network? And 10.10.10.27?
  6. 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.

3 comments:

  1. People had trouble finding an expression for questions 2 & 4.

    long mask = (0x100000000L - (int) Math.pow(2,32-23));

    network = ip & mask;

    broadcast = ip | (mask 0xffffffffL);

    ReplyDelete
  2. Or ...

    long mask=(0x100000000L - (1L << (32-23)));

    too.

    We only care about the 32 least significant bits of these long numbers.

    ReplyDelete
  3. Here you can see some code to handle all that:

    http://pastie.org/6342528

    ReplyDelete