dslreports logo
site
 
    All Forums Hot Topics Gallery
spc

spacer




how-to block ads


Search Topic:
uniqs
1037
share rss forum feed

JimTrail

join:2009-11-21
Knoxville, TN

1 recommendation

How many characters, colons does an IPv6 address have total?

Hello DSL Reports forum!

Question 1-a): How many digits/letters and colons or characters does an IPv6 string have?

Question 1-b): What is the maximum amount of characters that IPv6b address can have?

I am building a web site that will have member accounts. The web site needs to store the members' IP addresses.

I realize that currently most IP addresses are still in the IPv4 format. That format can have as many as twelve digits and three periods (000.000.000.000) for a total of fifteen characters.

However, I want the MySQL database column that is to store the IP addresses to be big enough to accommodate the newer IPv6 addresses.

I found an article that gives an example IPv6 address. The example have a total of thirty-nine (39) characters.

Example IPv6 address.
FE80:CD00:0000:0CDE:1257:0000:211E:729C

I would appreciate any information.

Thanks.


quesix

join:2005-12-19
Cary, IL

1 recommendation

It varies depending on if application doing reporting uses rfc1924

»tools.ietf.org/html/rfc1924

maximum size in text would be 8 sets or words of 4 hexadecimal (0-9a-f) digits separated by 7 colons 8x4=32+7=39, but it should be displayed/accepted in shortened rfc1924 form, which can be much shorter like 2605:67c::2 instead of 2605:067c:0000:0000:0000:0000:0000:0002...the short version is reported by many programs like Apache web servers.



NetDog
Premium,VIP
join:2002-03-04
Parker, CO
kudos:77
Reviews:
·Comcast

1 recommendation

reply to JimTrail

I would take a look at this: INET6_ATON(expr)

»dev.mysql.com/doc/refman/5.6/en/···et6-aton
--
Comcaster.. Network Engineer with NETO


JimTrail

join:2009-11-21
Knoxville, TN
reply to JimTrail

quesix, NetDog;

Thank you for responding to my question. I appreciate the information.

Thanks again.



leibold
Premium,MVM
join:2002-07-09
Sunnyvale, CA
kudos:10
Reviews:
·SONIC.NET

1 recommendation

For a single IPv6 address the longest string will be 39 as you found out. However you may need to store address ranges instead of single addresses (depending on your exact needs), especially if your members are using IPv6 privacy extensions.
Adding a slash and decimal prefix length (up to 3 digits long) which is the common way to note IPv6 address blocks would bring you to a theoretical maximum of 43 characters.
--
Got some spare cpu cycles ? Join Team Helix or Team Starfire!