Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Jan 2014 15:49:53 +0100
From:      Mark Martinec <Mark.Martinec+freebsd@ijs.si>
To:        freebsd-net@freebsd.org
Subject:   Re: Merge ping+ping6 and traceroue+traceroute6 to single =?UTF-8?Q?utilities=3F?=
Message-ID:  <29dbfd1a0f58628972811daff470b832@mailbox.ijs.si>
In-Reply-To: <b88809c89c486cac9139bc8dfbd5cddf.authenticated@ultimatedns.net>
References:  <1063008459.20140111160525@serebryakov.spb.ru> <20140111164047.GA97150@edge.bac.lab> <20140111.180057.78714603.sthaug@nethelp.no> <b88809c89c486cac9139bc8dfbd5cddf.authenticated@ultimatedns.net>

next in thread | previous in thread | raw e-mail | index | archive | help
2014-01-12 10:15, Chris H wrote:
>> I use unified ping and traceroute on JunOS daily. It's a blessing not
>> to have to specify the address family.
> 
> Disagree. In the current, on FreeBSD, in either case, it's less 
> keystrokes.
> How is ping -6 || ping -4 better?  What's the point?

Less keystrokes? As has been already said, specifying a -4 or -6 is 
hardly
ever needed. If the target is an IPv4 or IPv6 address there is no need
to explicitly specify a protocol family, it is already implied in the
address family. Same if a localhost lives in only one address family.
Nor is it necessary to specify the PF if one is only interested in
basic reachability of a target and does not care to pick any particular
PF, interface, source IP address, target IP address, routing table, etc.

The only case when one would need to explicitly specify a protocol 
family
is when a target is a DNS name (not an IP address) AND the local side
is dual stacked with both address families configured.

This situation is *no different* from the current situation where a 
target
is a DNS name resolving to multiple IP addresses (like in case of some
multihomed hosts or internet services which rely on DNS for load 
balancing):
if basic service availability is to be checked and one is not picky 
about
interface, IP address, route etc chosen, just specifying a DNS name 
suffices,
otherwise one has to manually specify the target IP address *even now*.

How often do you need to use -4 or -6 options in utilities like
ssh, telnet, rsync, curl, wget, ... ?  Hardly ever, most of the time
it just works and does what is needed. At times when it doesn't, there
is probably a need to fix the broken network anyway. Imagine the hurdles
if there were separate utilities ssh6, telnet6, etc - one would need to
check the local and remote address and choose a suitable utility 
variant.

> How will modifying all the some thousands of scripts everyone currently
> uses based on the current commands, make it better?

It is easy to see how it makes it friendlier for scripts and monitoring 
tools.
Scripting languages like shell and IPv6-challenged PHP which has no 
access
to getaddrinfo(3) and friends currently need to go to great lengths if
they want to ping some target. They need to resolve the target name to
IP addresses, check to see to which address families these addresses
belong, check local host for availability of each protocol family,
and based on this pick either ping or ping6 command. Most of such 
scripts
currently just do not care of fall short of doing it properly, which
makes them break on IPv6-only hosts, or leave their functionality 
severely
limited.

Now we are in 2014, major sites have already switched to dual stack 
support,
some services are only offered over IPv6 (mostly internal currently),
some hosts are IPv6-only (and use http proxy or NAT64 to connect to 
legacy
services). It is illusionary to expect the masses of ad-hoc scripts
to be adapted. Giving them a modern powerful tool would make things much
easier for script writers to do it right, and make sysadmins life 
easier.

   Mark




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?29dbfd1a0f58628972811daff470b832>