[comp.protocols.tcp-ip] IP Options and ICMP Messages

cpw%sneezy@LANL.GOV (C. Philip Wood) (03/19/88)

For those of you with 4.3BSD implimentations, as in Berkeley UNIX on a
VAX, or SunOS 4.0 on a SUN, and those of you who think you have a 4.3
implimentation on your operating system, this, bud, is for you:

Product: Tools to exercise the Internet
Access: Anonymous FTP
Source Host: lambda.lanl.gov
Source Directory: /pub/inet
Source Files:

	total 175
	-r--r--r--  1 cpw           786 Mar 18 14:38 Copyright
	-r--r--r--  1 cpw          1381 Mar 18 14:38 EXAMPLES
	-r--r--r--  1 cpw          6883 Mar 18 14:38 Makefile
	-r--r--r--  1 cpw          2156 Mar 18 14:38 README
	-r--r--r--  1 cpw           958 Mar 18 14:38 chargen.sh
	-r--r--r--  1 cpw          4753 Mar 18 14:38 chargend.c
	-r--r--r--  1 cpw           922 Mar 18 14:38 daytime.sh
	-r--r--r--  1 cpw           952 Mar 18 14:38 discard.sh
	-r--r--r--  1 cpw          3420 Mar 18 14:38 discardd.c
	-r--r--r--  1 cpw          4152 Mar 18 14:38 echod.c
	-r--r--r--  1 cpw           924 Mar 18 14:38 ecko.sh
	-r--r--r--  1 cpw           954 Mar 18 14:38 finger.sh
	-r--r--r--  1 cpw          1177 Mar 18 14:38 getclientname.c
	-r--r--r--  1 cpw           966 Mar 18 14:38 hostname.sh
	-r--r--r--  1 cpw          3979 Mar 18 14:38 hostnamed.c
	-r--r--r--  1 cpw          2073 Mar 18 14:38 icmp.sh
	-r--r--r--  1 cpw          2659 Mar 18 14:38 inaddr.c
	-r--r--r--  1 cpw          3890 Mar 18 14:38 inet.8
	-r--r--r--  1 cpw         10460 Mar 18 14:38 inet.c
	-r--r--r--  1 cpw         88960 Mar 18 14:41 inet.shar
	-r--r--r--  1 cpw          1757 Mar 18 14:38 lsrr.sh
	-r--r--r--  1 cpw           954 Mar 18 14:38 nicname.sh
	-r--r--r--  1 cpw         15075 Mar 18 14:53 ping.c
	-r--r--r--  1 cpw           947 Mar 18 14:38 quote.sh
	-r--r--r--  1 cpw           969 Mar 18 14:38 rdate.sh
	-r--r--r--  1 cpw          2047 Mar 18 14:38 settod.c
	-r--r--r--  1 cpw          1442 Mar 18 14:38 so.sh
	-r--r--r--  1 cpw          1758 Mar 18 14:38 ssrr.sh
	-r--r--r--  1 cpw          1493 Mar 18 14:38 xdr.c

Producer: Cornett Philip Wood
Affiliation: Los Alamos National Laboratory

cpw%sneezy@LANL.GOV (C. Philip Wood) (03/24/88)

To all those who picked up the network exercising stuff from
lambda.lanl.gov.

I gave you a bum [ls]srr.sh.  Due to my lack of understanding how
BSD4.3 handles the loose/strict source route option on output, the lsrr
and ssrr scripts are in error.  It is not intuitive that BSD UNIX will
strip off the first address in the option to use as a destination,
ignoring the destination requested via an open system call.  I have another
script 'sr' which takes the above into account.  For example:

	sr loose 192.5.16.33 26.3.0.103 26.0.0.90

ships an icmp echo packet to the lanl gateway via gateways 192.5.16.33 and
26.3.0.103.  What the heck, here's the script (BTW, the ping is a modified
Muuse ping):
#! /bin/sh
# 
#  Los Alamos National Laboratory 
# 
#  Copyright, 1988.  The Regents of the University of California. This software
#  was produced under a U.S. Government contract (W-7405-ENG-36) by Los Alamos
#  National Laboratory, which is operated by the	University of
#  California for the U.S. Department of Energy.  The U.S. Government is
#  licensed to use, reproduce, and distribute this software.  Permission is
#  granted to the public to copy and use this software without charge, provided
#  that this Notice and any statement of authorship are reproduced on all
#  copies.  Neither the Government nor the University makes any warranty,
#  express or implied, or assumes any liability or responsibility for the use
#  of this software. 
#
#  ICMP ECHO with IP Loose/Strict Source and Record Route
#
#	"@(#)sr.sh	1.1 (LANL) 3/23/88"
#
Usage="
Usage: sr {loose,strict} destination(1), destination(2) ... destination(n)
"
NOP=1
SRPOINTER="4"
PING=/usr/local/etc/ping
TYPE=-v
list=""
if [ $# -lt 3 ] ; then
	echo "$Usage"
	exit 1
fi
if [ $1 = loose ]; then
	SR=131
elif [ $1 = strict ]; then
	SR=137
else
	echo "$Usage"
	exit 1
fi
shift
SRLEN=`expr 3 + \(  $# \* 4 \)`
GW1=$1 # it dont matter what host you "open a connection to"
for i
do
list="$list -o d$i"
done

$PING  $TYPE \
	-o d${NOP} \
	-o d${SR} \
	-o d${SRLEN}.${SRPOINTER} \
	$list \
	$GW1 12 1