In: Computer Science
Find the network address, the direct broadcast address, and the number of addresses in a block; if one of the addresses in this block is 175.120.240.17/19
Network address is 175.120.224.0 broadcast address is 175.120.255.255 number of addresses in a block is 2^(32-19) = 2^13 = 8192 Explanation: ------------- IP Address: 175.120.240.17 ---------------------------------------- Let's first convert this into binary format 175.120.240.17 Let's convert all octets to binary separately Converting 175 to binary Divide 175 successively by 2 until the quotient is 0 > 175/2 = 87, remainder is 1 > 87/2 = 43, remainder is 1 > 43/2 = 21, remainder is 1 > 21/2 = 10, remainder is 1 > 10/2 = 5, remainder is 0 > 5/2 = 2, remainder is 1 > 2/2 = 1, remainder is 0 > 1/2 = 0, remainder is 1 Read remainders from the bottom to top as 10101111 So, 175 of decimal is 10101111 in binary 175 in binary is 10101111 Converting 120 to binary Divide 120 successively by 2 until the quotient is 0 > 120/2 = 60, remainder is 0 > 60/2 = 30, remainder is 0 > 30/2 = 15, remainder is 0 > 15/2 = 7, remainder is 1 > 7/2 = 3, remainder is 1 > 3/2 = 1, remainder is 1 > 1/2 = 0, remainder is 1 Read remainders from the bottom to top as 1111000 So, 120 of decimal is 1111000 in binary 120 in binary is 01111000 Converting 240 to binary Divide 240 successively by 2 until the quotient is 0 > 240/2 = 120, remainder is 0 > 120/2 = 60, remainder is 0 > 60/2 = 30, remainder is 0 > 30/2 = 15, remainder is 0 > 15/2 = 7, remainder is 1 > 7/2 = 3, remainder is 1 > 3/2 = 1, remainder is 1 > 1/2 = 0, remainder is 1 Read remainders from the bottom to top as 11110000 So, 240 of decimal is 11110000 in binary 240 in binary is 11110000 Converting 17 to binary Divide 17 successively by 2 until the quotient is 0 > 17/2 = 8, remainder is 1 > 8/2 = 4, remainder is 0 > 4/2 = 2, remainder is 0 > 2/2 = 1, remainder is 0 > 1/2 = 0, remainder is 1 Read remainders from the bottom to top as 10001 So, 17 of decimal is 10001 in binary 17 in binary is 00010001 ===================================================================================== || 175.120.240.17 in binary notation is 10101111.01111000.11110000.00010001 || ===================================================================================== Subnet mask is /19 For Calculating network ID, keep first 19 bits of 10101111.01111000.11110000.00010001 and set all remaining bits to 0. so, network ID in binary is 10101111.01111000.11100000.00000000 10101111.01111000.11100000.00000000: ---------------------------------------- 10101111.01111000.11100000.00000000 Let's convert all octets to decimal separately Converting 10101111 to decimal Converting 10101111 to decimal 10101111 => 1x2^7+0x2^6+1x2^5+0x2^4+1x2^3+1x2^2+1x2^1+1x2^0 => 1x128+0x64+1x32+0x16+1x8+1x4+1x2+1x1 => 128+0+32+0+8+4+2+1 => 175 10101111 in decimal is 175 Converting 01111000 to decimal Converting 01111000 to decimal 01111000 => 0x2^7+1x2^6+1x2^5+1x2^4+1x2^3+0x2^2+0x2^1+0x2^0 => 0x128+1x64+1x32+1x16+1x8+0x4+0x2+0x1 => 0+64+32+16+8+0+0+0 => 120 01111000 in decimal is 120 Converting 11100000 to decimal Converting 11100000 to decimal 11100000 => 1x2^7+1x2^6+1x2^5+0x2^4+0x2^3+0x2^2+0x2^1+0x2^0 => 1x128+1x64+1x32+0x16+0x8+0x4+0x2+0x1 => 128+64+32+0+0+0+0+0 => 224 11100000 in decimal is 224 Converting 00000000 to decimal Converting 00000000 to decimal 00000000 => 0x2^7+0x2^6+0x2^5+0x2^4+0x2^3+0x2^2+0x2^1+0x2^0 => 0x128+0x64+0x32+0x16+0x8+0x4+0x2+0x1 => 0+0+0+0+0+0+0+0 => 0 00000000 in decimal is 0 ===================================================================================== || 10101111.01111000.11100000.00000000 in decimal notation is 175.120.224.0 || ===================================================================================== ============================================ || So, Network ID is 175.120.224.0 || ============================================ For Calculating broadcast ID, keep first 19 bits of 10101111.01111000.11110000.00010001 and set all remaining bits to 1. so, broadcast ID in binary is 10101111.01111000.11111111.11111111 10101111.01111000.11111111.11111111: ---------------------------------------- 10101111.01111000.11111111.11111111 Let's convert all octets to decimal separately Converting 10101111 to decimal Converting 10101111 to decimal 10101111 => 1x2^7+0x2^6+1x2^5+0x2^4+1x2^3+1x2^2+1x2^1+1x2^0 => 1x128+0x64+1x32+0x16+1x8+1x4+1x2+1x1 => 128+0+32+0+8+4+2+1 => 175 10101111 in decimal is 175 Converting 01111000 to decimal Converting 01111000 to decimal 01111000 => 0x2^7+1x2^6+1x2^5+1x2^4+1x2^3+0x2^2+0x2^1+0x2^0 => 0x128+1x64+1x32+1x16+1x8+0x4+0x2+0x1 => 0+64+32+16+8+0+0+0 => 120 01111000 in decimal is 120 Converting 11111111 to decimal Converting 11111111 to decimal 11111111 => 1x2^7+1x2^6+1x2^5+1x2^4+1x2^3+1x2^2+1x2^1+1x2^0 => 1x128+1x64+1x32+1x16+1x8+1x4+1x2+1x1 => 128+64+32+16+8+4+2+1 => 255 11111111 in decimal is 255 Converting 11111111 to decimal Converting 11111111 to decimal 11111111 => 1x2^7+1x2^6+1x2^5+1x2^4+1x2^3+1x2^2+1x2^1+1x2^0 => 1x128+1x64+1x32+1x16+1x8+1x4+1x2+1x1 => 128+64+32+16+8+4+2+1 => 255 11111111 in decimal is 255 ======================================================================================= || 10101111.01111000.11111111.11111111 in decimal notation is 175.120.255.255 || ======================================================================================= ================================================ || So, broadcast ID is 175.120.255.255 || ================================================