199k views
1 vote
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

User Bien
by
6.4k points

1 Answer

5 votes

Answer:

i) 172.31.1.5 => 2887713029

ii) 2887713028 => 172.31.1.4

Step-by-step 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

User Compositr
by
5.7k points