LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-12-2011, 01:31 PM   #1
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
Why separate ping and ping6


Anyone know why ping and ping6 were split into separate commands while many other tools that support IPv6 just do so in the same command?
 
Old 10-12-2011, 03:40 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626
I will take a very wild guess.

It was either just the way someone did it or an issue with how ping worked and they said, Oh snap, just make a new app for it since we don't want to break ping.

Might have to email the ping6 creators for the real answer. http://www.kame.net/ may know the answer.

Last edited by jefro; 10-12-2011 at 03:44 PM.
 
Old 10-12-2011, 07:12 PM   #3
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
D'oh! I found the answer at the bottom of an online man page (though not in the man page included in Ubuntu). I don't agree with it, but there it is. For one thing, I don't understand how the socket API differs for raw sockets between IPv4 and IPv6 (when it should just be raw, anything goes).

As an alternative, I think they should have renamed ping to ping4, and make a new program called ping be a front end to the others, based on either the -4 or -6 option, or when an IP address is given, the format of the IP address. This tiny front end could then invoke the others. I guess I have another project to do.

From http://fuse4bsd.creo.hu/localcgi/man-cgi.cgi?ping6+8 ...
Code:
     The ping6 utility is intentionally separate from ping(8).

     There have been many discussions on why we separate ping6 and ping(8).
     Some people argued that it would be more convenient to uniform the ping
     command for both IPv4 and IPv6.  The followings are an answer to the
     request.

     From a developer's point of view: since the underling raw sockets API is
     totally different between IPv4 and IPv6, we would end up having two types
     of code base.  There would actually be less benefit to uniform the two
     commands into a single command from the developer's standpoint.

     From an operator's point of view: unlike ordinary network applications
     like remote login tools, we are usually aware of address family when
     using network management tools.  We do not just want to know the reacha-
     bility to the host, but want to know the reachability to the host via a
     particular network protocol such as IPv6.  Thus, even if we had a unified
     ping(8) command for both IPv4 and IPv6, we would usually type a -6 or -4
     option (or something like those) to specify the particular address fam-
     ily.  This essentially means that we have two different commands.
 
Old 02-09-2017, 09:08 PM   #4
ftbseobrad
LQ Newbie
 
Registered: Jan 2017
Location: Washington
Distribution: Windows 10, Ubuntu 16.10, CentOS 7
Posts: 4

Rep: Reputation: Disabled
Cool re why ping6

I think the answer from that page is a bit of bloated puffery and officiousness. But that is just my own humble opinion.

They are incorrect in their statement in the end that they are two totally different commands?

Has no one noticed that if you type ping6 ipv6.google.com that the very first part of the returned printout whether the ping was successful or unsuccessful is "ping"?

I've tested and from linux and windows both i've pinged googles ipv6 url and ip address by both ping and ping6 and get the same results with both commands.

brad@ftbseo-Linux:~$ ping ipv6.google.com
PING ipv6.google.com(lax17s15-in-x0e.1e100.net (2607:f8b0:4007:80c::200e)) 56 data bytes
64 bytes from lax17s15-in-x0e.1e100.net (2607:f8b0:4007:80c::200e): icmp_seq=1 ttl=52 time=59.4 ms
64 bytes from lax17s15-in-x0e.1e100.net (2607:f8b0:4007:80c::200e): icmp_seq=2 ttl=52 time=53.3 ms
64 bytes from lax17s15-in-x0e.1e100.net (2607:f8b0:4007:80c::200e): icmp_seq=3 ttl=52 time=41.4 ms

brad@ftbseo-Linux:~$ ping 2600:3c01::f03c:91ff:fee7:5272 -c 1
PING 2600:3c01::f03c:91ff:fee7:5272(2600:3c01::f03c:91ff:fee7:5272) 56 data bytes
64 bytes from 2600:3c01::f03c:91ff:fee7:5272: icmp_seq=1 ttl=51 time=37.9 ms

I can't believe I'm the only person who has ever thought outside the box andtried this and gotten a positive result.

The only thing I can imagine (and I'm at least honest enough to admit I don't know why it was originally thought that ping6 was required to ping ipv6 addresses.) is there was a network protocol need to ping6 in the beginning before there was more structure in the networking world that required a ping6 but it's pretty obvious with the above printout that they are not two separate commands nor two separate protocols. It could have been a Linux issue originally too because I've always just done a straight ping for ipv6 addresses in Windows. Ipv6 has been out for 11 years now but because I've only recently been heavily involved in Linux servers did I ever hear that you were supposedly required to ping6.

I accidentally forgot one day and just did a regular ping command and got a result so I've never looked back.
 
Old 02-09-2017, 09:26 PM   #5
ftbseobrad
LQ Newbie
 
Registered: Jan 2017
Location: Washington
Distribution: Windows 10, Ubuntu 16.10, CentOS 7
Posts: 4

Rep: Reputation: Disabled
"From an operator's point of view: unlike ordinary network applications
like remote login tools, we are usually aware of address family when
using network management tools. We do not just want to know the reacha-
bility to the host, but want to know the reachability to the host via a
particular network protocol such as IPv6. Thus, even if we had a unified
ping(8) command for both IPv4 and IPv6, we would usually type a -6 or -4
option (or something like those) to specify the particular address fam-
ily. This essentially means that we have two different commands."

OK I don't know if I want to shake my head or laugh...
Seriously? This person takes themselves way to seriously.
"Thusly"?
"We do not just want to know the reacha-
bility to the host, but want to know the reachability to the host via a
particular network protocol such as IPv6. Thus, even if we had a unified
ping(8) command for both IPv4 and IPv6, we would usually type a -6 or -4
option (or something like those) to specify the particular address family. This essentially means that we have two different commands."

Seriously? You don't think there is an obvious difference between a 4 digit octet of base10 numbers separated by periods and base16 hexadecimals seperated by :?

Ok I'm going to just walk away and shut up before I get censored or banned by a moderator or admin.
 
Old 02-11-2017, 10:15 PM   #6
jayjwa
Member
 
Registered: Jul 2003
Location: NY
Distribution: Slackware, Termux
Posts: 774

Rep: Reputation: 243Reputation: 243Reputation: 243
We should name *which* ping we're talking about. My ping won't do ipv6 addresses:

Code:
ping --version
ping (GNU inetutils) 1.9.4
...

ping ipv6.google.com
ping: unknown host
Exit 1

ping6 ipv6.google.com
PING ipv6.l.google.com (2607:f8b0:4009:80d::200e): 56 data bytes
64 bytes from ord36s02-in-x0e.1e100.net: icmp_seq=0 ttl=55 time=26.706 ms
64 bytes from ord36s02-in-x0e.1e100.net: icmp_seq=1 ttl=55 time=27.174 ms
...
The seperate ping6 will. I think it was because ping ipv4 was around way earlier. Then they added another utility rather than rebuild the old. Notice nmap's "nping" can do both, via a switch, from the same binary.
 
Old 01-12-2018, 09:55 PM   #7
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by jayjwa View Post
The seperate ping6 will. I think it was because ping ipv4 was around way earlier. Then they added another utility rather than rebuild the old. Notice nmap's "nping" can do both, via a switch, from the same binary.
i'm using Ubuntu 16.04.3 LTS and it still has separate ping commands which each cannot do the other. i frontended both to detect the family of a given address and run the appropriate command. i usually ping addresses rather than hostnames, so it is generally adequate for me. still, i'd rather have a command that can ping either way. thinking about hostnames, lots of them will, if not now, have both IPv4 and IPv6. so how will we ping for availability? often, apps try all the addresses they get from DNS. shouldn't ping do the same? this could get messy. a command that more quietly and more smartly evaluates availability might be a good tool. an answer might be: "DNS CNAME 1 A 1 AAAA 2 ICMP ip4 0 /10 ip6 0 /10 TCP ip4 0 /5 ip6 5 /5" ... where it tries to ping (may be blocked) and connect all combinations. it should do a thorough DNS trace, too, including report slow DNS responses.

anyone have a package suggestion for Ubuntu 16.04.3 LTS for a dual-family ping command?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help in ping6 ssenthilkumar Linux - Networking 0 07-14-2009 02:03 AM
Need help in ping6 ssenthilkumar Linux - Networking 0 07-10-2009 04:28 AM
cannot ping6 kpachopoulos Linux - Networking 0 05-04-2006 10:31 AM
Ping6 problem Hofe68 Linux - Networking 0 09-09-2004 04:41 AM
RH8 with ping6 and traceroute6 Babba Linux - Networking 1 12-02-2002 08:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration