Skip to contentSkip to conversation

RfD: printing of port numbers on v6 addresses

Openvpn-devel Gert Doering 4 participants 5 messages Dec 18, 2018 – Dec 26, 2018

lore
Share & tools
lore
#0 lore raw

Hi,

somewhen before 2.4 we lost "printing of port numbers on v6 addresses"
- we used to dumbly print v6addr:port, leading to

2001:db8::123:1194

which is less than clear on "is this a v6 address plus port 1194" or "just a longer v6 address". Now we just print 2001:db8::123 in things like the log line prefix, with no port indication.

"The Internet" says there are two widely used conventions:

- One is "the URI format as per rfc3986", which would make this

     [2001:db8::123]:1194

which is "IPv6 literal addresses are always enclosed in square brackets", and if the port is printed, it's tacked on with ":port".

- the other one is "what tcpdump and others do", tacking the port onto the v6 address with ".", so this would become:

     2001:db8::123.1194

also unambiguous (even in the v4-compatible 2001:db8::1.2.3.4.1194 form), though possibly confusing. This is what RFC5952 has to offer (plus "2001:db8::1 port 80" and "2001:db8::1p80" and "#80") - see
https://tools.ietf.org/html/rfc5952#section-6

I find most of these forms ugly, but I want to "repair" this issue - not the least because our management interface has "kill client by IP+Port", which is currently broken because we do not print the port number at all... (it might still be broken due to the way it works internally, but that's a new can of worms).

See also https://community.openvpn.net/openvpn/ticket/664 for more background.

Opinions?

gert

Signature · 6 lines
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             [email protected]...
#1 lore raw

Hi,

Quoted 37 lines · Gert Doering

Hi,

somewhen before 2.4 we lost "printing of port numbers on v6 addresses"
- we used to dumbly print v6addr:port, leading to

2001:db8::123:1194

which is less than clear on "is this a v6 address plus port 1194" or "just a longer v6 address". Now we just print 2001:db8::123 in things like the log line prefix, with no port indication.

"The Internet" says there are two widely used conventions:

- One is "the URI format as per rfc3986", which would make this

     [2001:db8::123]:1194

which is "IPv6 literal addresses are always enclosed in square brackets", and if the port is printed, it's tacked on with ":port".

- the other one is "what tcpdump and others do", tacking the port onto the v6 address with ".", so this would become:

     2001:db8::123.1194

also unambiguous (even in the v4-compatible 2001:db8::1.2.3.4.1194 form), though possibly confusing. This is what RFC5952 has to offer (plus "2001:db8::1 port 80" and "2001:db8::1p80" and "#80") - see
https://tools.ietf.org/html/rfc5952#section-6

I find most of these forms ugly, but I want to "repair" this issue - not the least because our management interface has "kill client by IP+Port", which is currently broken because we do not print the port number at all... (it might still be broken due to the way it works internally, but that's a new can of worms).

Quoted 5 lines

See also https://community.openvpn.net/openvpn/ticket/664 for more background.

Opinions?

I personally prefer the rfc3986 notation because it is more widespread and, therefore, easier to understand/recognize.

The tcpdump notation has the advantage of working with both v4 and v6, but it's not really standard, so less ideal imho.

After all somebody has already agreed on a notation, so there is no need to re-invent the wheel on our side.

Regards,

Signature · 1 line
Antonio Quartulli
#2 lore raw
Quoted 2 lines · Antonio Quartulli

I personally prefer the rfc3986 notation because it is more widespread and, therefore, easier to understand/recognize.

+1

-Steffan

#3 lore raw

Hi,

Quoted 5 lines · Steffan Karger
Quoted 2 lines · Antonio Quartulli

I personally prefer the rfc3986 notation because it is more widespread and, therefore, easier to understand/recognize.

+1

It's about the most ugly way possible, so "best IETF style"... :-)

How shall we print a single IPv6 address without a port? Always using

[2001:db8::1]

is not exactly making the log lines shorter... and having the code decide whether or not to include [] around the v6 address depending on whether or not to print a port isn't improving readability either.

I find "2001:db8::1#80" to be actually fairly nice, as it doesn't add extra characters, is clear enough with and without port number, and is permitted by RFC5952 as well... (RFC3986 is mostly concerned about URIs, which have their own ":" already for the protocol part).

But if you all want brackets, so shall it be. Always, or "just when there are port numbers to be added"?

gert

Signature · 6 lines
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             [email protected]...
#4 lore raw
In reply to Antonio Quartulli
Quoted 3 lines · Antonio Quartulli

I personally prefer the rfc3986 notation because it is more widespread and, therefore, easier to understand/recognize.

+1

Signature · 4 lines
kind regards,

David Sommerseth
OpenVPN Inc