Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the minimum length of an IP address in string representation?

Just wondering about the minimum character count of an IPv4 / IPv6 address in string representation. What's the shortest valid IP address?

like image 802
Mark13426 Avatar asked Mar 09 '14 21:03

Mark13426


People also ask

What is the minimum value of IP address string?

1.1. 1.1 would be a valid IP address, so the answer to your question is "7".

What is the minimum size of IP address?

The minimum length of an IP header is 20 bytes, or five 32-bit increments. The maximum length of an IP header is 24 bytes, or six 32-bit increments. Therefore, the header length field should contain either 5 or 6.

What is the length of an IP address?

An IPv4 address is 32 bits. An IP Address is shown as 4 decimal numbers representing 4 bytes: d.d.d.d where d = decimal number (0 - 255).

What is IP address string?

An IP address is a string of numbers separated by periods. IP addresses are expressed as a set of four numbers — an example address might be 192.158.1.38. Each number in the set can range from 0 to 255.


2 Answers

1.1.1.1 would be a valid IP address, so the answer to your question is "7".

like image 93
John Saunders Avatar answered Oct 01 '22 03:10

John Saunders


Technically, you can omit the first three octects if the are 0, therefore shortest ipv4 address is one byte, it is "1", a shorthand for "0.0.0.1".

like image 39
Yves Dorfsman Avatar answered Oct 01 '22 02:10

Yves Dorfsman