Tuesday, March 22, 2011

Solaris 11: Ping Enhancement

[nuclear sub]

The TCP/IP network has become the ubiquitous protocol suite for communicating world wide between systems. The Internet Control Management Protocol (ICMP) is used to regulate the communications over the network. A common command leveraging ICMP for testing of connectivity is Ping. The Ping command is implemented with different options depending on the system platform. Solaris 11 adds a new backwards-compatibility feature to Ping.

When Solaris was first implemented, it was based upon BSD UNIX. The default behavior was to provide multiple packets sent on a regular interval. With the merger of Solaris with AT&T UNIX, the default behavior became radically different: the sending of a single packet with a response. Solaris 11 is bridging the gap between the two behaviors.

Solaris 11:
John Beck from Oracle added a feature to Ping in Solaris 11.
So in build 33 of Solaris 11 I added a check: if the variable MACHINE_THAT_GOES_PING is set in the environment to a non-null value, then ping will go into "statistics" mode as if the -s flag had been provided.
If a non-null variable "MACHINE_THAT_GOES_PING" is set in the environment, Ping will automatically enter "statistics" mode, where multiple packets are sent continuously, until an interrupt is received.

For the casual interactive user, this is a tremendous benefit.

Scripts which check for connectivity [using ping] prior engaging a higher layer network protocol command [such as ssh] may possibly be impacted by naive user community who implements this environment variable in a profile.

If a user decides to implement the "MACHINE_THAT_GOES_PING" environment variable, it might be a wise decision to check for a tty before setting the variable.

If a user wishes to leverage this feature by adding the environment to a profile, the following lines may be beneficial in suppressing the behavior in some automated scripts running in cron and at jobs.
# check for tty prior enabling automatic statistics
tty | grep "not a tty" >/dev/null || {

No comments:

Post a Comment