In: Computer Science
Using a 23 bit network prefix, what network would the IPv4 address 123.154.89.114 be forwarded to? Use dotted decimal format and do not include the mask in your answer.
123.154.88.0 Explanation: ------------- IP Address: 123.154.89.114 ---------------------------------------- Let's first convert this into binary format 123.154.89.114 Let's convert all octets to binary separately Converting 123 to binary Divide 123 successively by 2 until the quotient is 0 > 123/2 = 61, remainder is 1 > 61/2 = 30, remainder is 1 > 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 1111011 So, 123 of decimal is 1111011 in binary 123 in binary is 01111011 Converting 154 to binary Divide 154 successively by 2 until the quotient is 0 > 154/2 = 77, remainder is 0 > 77/2 = 38, remainder is 1 > 38/2 = 19, remainder is 0 > 19/2 = 9, remainder is 1 > 9/2 = 4, remainder is 1 > 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 10011010 So, 154 of decimal is 10011010 in binary 154 in binary is 10011010 Converting 89 to binary Divide 89 successively by 2 until the quotient is 0 > 89/2 = 44, remainder is 1 > 44/2 = 22, remainder is 0 > 22/2 = 11, remainder is 0 > 11/2 = 5, remainder is 1 > 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 1011001 So, 89 of decimal is 1011001 in binary 89 in binary is 01011001 Converting 114 to binary Divide 114 successively by 2 until the quotient is 0 > 114/2 = 57, remainder is 0 > 57/2 = 28, remainder is 1 > 28/2 = 14, remainder is 0 > 14/2 = 7, remainder is 0 > 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 1110010 So, 114 of decimal is 1110010 in binary 114 in binary is 01110010 ===================================================================================== || 123.154.89.114 in binary notation is 01111011.10011010.01011001.01110010 || ===================================================================================== Subnet mask is /23 For Calculating network ID, keep first 23 bits of 01111011.10011010.01011001.01110010 and set all remaining bits to 0. so, network ID in binary is 01111011.10011010.01011000.00000000 01111011.10011010.01011000.00000000: ---------------------------------------- 01111011.10011010.01011000.00000000 Let's convert all octets to decimal separately Converting 01111011 to decimal Converting 01111011 to decimal 01111011 => 0x2^7+1x2^6+1x2^5+1x2^4+1x2^3+0x2^2+1x2^1+1x2^0 => 0x128+1x64+1x32+1x16+1x8+0x4+1x2+1x1 => 0+64+32+16+8+0+2+1 => 123 01111011 in decimal is 123 Converting 10011010 to decimal Converting 10011010 to decimal 10011010 => 1x2^7+0x2^6+0x2^5+1x2^4+1x2^3+0x2^2+1x2^1+0x2^0 => 1x128+0x64+0x32+1x16+1x8+0x4+1x2+0x1 => 128+0+0+16+8+0+2+0 => 154 10011010 in decimal is 154 Converting 01011000 to decimal Converting 01011000 to decimal 01011000 => 0x2^7+1x2^6+0x2^5+1x2^4+1x2^3+0x2^2+0x2^1+0x2^0 => 0x128+1x64+0x32+1x16+1x8+0x4+0x2+0x1 => 0+64+0+16+8+0+0+0 => 88 01011000 in decimal is 88 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 ==================================================================================== || 01111011.10011010.01011000.00000000 in decimal notation is 123.154.88.0 || ==================================================================================== =========================================== || So, Network ID is 123.154.88.0 || =========================================== so, IP address 123.154.89.114 is forwarded to network 123.154.88.0