MW Quiz 5 (Spring 2010) Suppose a network uses the subnet mask 255.255.254.0. To what subnet would an IP datagram with destination address 128.122.43.193 be forwarded to? The first two bytes of the subnet link address will be the same as the destination address (anding a number will all ones leaves the number unchanged). The fourth byte will be zero (anding a value with all zeroes results in all zeroes). The third byte of the mask in binary: 11111110 The third byte of the destination in binary: 00101011 Anding them together: 00101010 Complete answer in decimal: 128.122.(2+8+32).0 = 128.122.42.0 Could you have answered this without working out the binary? Sure. 254 is all ones except the bottom (right-most) bit. So, the low bit of the destination turns from 1 to 0, making the odd number even, and thus in-effect subtracting 1 from 43. MW Quiz 5 Other Version Suppose a network uses the subnet mask 255.255.255.128. To what subnet would an IP datagram with destination address 128.122.43.193 be forwarded to? The first three bytes will be anded with ones, and so unchanged, making the answer 128.122.43.x. What's x? 128 is 10000000 and 193 is bigger than 128 (meaning it has its high bit set to one), so the result is 128.122.43.128. TR Quiz 5 Suppose a network uses the subnet mask 255.255.240.0. To what subnet would an IP datagram with destination address 128.122.43.193 be forwarded to? A quick glance tells us the answer will look like 128.122.y.0. What's y? In binary, 240 = 255 - 15 = 11111111-1111 = 11110000. This has to be anded with 43, and 43 = 32 + 8 + 2 + 1, or, in binary, 00101011 (as above). Anding the third byte of the destination with the third byte of the mask: 11110000 00101011 -------- 00100000 = 32 decimal. So the answer is 128.122.32.0. TR Quiz 5 Other Version Suppose a network uses the subnet mask 255.255.240.0. To what subnet would an IP datagram with destination address 128.122.93.143 be forwarded to? The answer will look like 128.122.z.0. What's z? As above, 240 decimal is 11110000 binary. 93 decimal = 64 + 16 + 8 + 4 + 1 = 01011101 binary. Anding the third bytes of the mask and destination gives us: 11110000 01011101 -------- 01010000 = 80 decimal = z. So the answer is 128.122.80.0.