I'm wondering if we can have floating point(3.3 9.9 2.2 6.3) or Hexadecimal(6A.65.D5.77) representation for Ipv4 address that is also 32 bit long to compensate for IPv4 address shortage. Same question also arises in my mind regarding negative number representation. Please explain the logic behind using only Decimal notation.
1 Answer
An IPv4 address is a 32-bit number. You can represent it in the common dotted-octet notation, as unsigned decimal integer, in hex, octal, or any other way you like.
dotted-octet: 1.2.3.4
decimal uint: 16,909,060
hex: 0x 0102 0304
octal: 0o 100 401 404
Whichever notation you use, there are 232 = 4,294,967,296 different IPv4 addresses. Even a 32-bit float can't have more than that number of states (even a few less, I'm afraid).
Breaking compatibility, you could extend the 32-bit field to e.g. 128 bits to enable 2128 = 340,282,366,920,938,463,463,374,607,431,768,211,456 different addresses - that is exactly what IPv6 does.