Convert the given IP address in dotted decimal notationto its equivalent 10 digit decimal number and given decimal numberto its equivalent dotted decimal notation. i) 172.31.1.5 ii) 2887713028

Respuesta :

Answer:

i) 172.31.1.5 => 2887713029

ii) 2887713028 => 172.31.1.4

Explanation:

i) We convert the IP address 172.31.1.5 to its 10 digit decimal notation as follows:-

256^{3} * ip1 + 256^{2} * ip2 + 256^{1} * ip3 + ip4

= 16777216*172 + 65536*31 + 256*1 + 5

= 2887713029

ii) Decimal numbers can be converted into ip addresses by the reverse process , that is successive division by 256 and finding the remainder at each stage. Hence,

2887713028

= 256^{3} * 172 + 256^{2} * 31 + 256^{1} * 1 + 4

So the corresponding ip address is 172.31.1.4