[comp.sys.mac.hypercard] Still looking for ping...

rainwatr@ucunix.san.uc.edu (Don Rainwater) (04/11/91)

Well, I'm still looking for a way to 'ping' an internet node from
within Hypercard.  Someone mentioned the tcp hypercard tools that are
available on apple.com (I believe).  These xcmds allow you to do a great
many things using tcp (open a socket, listen on a socket, etc), but
nothing jumped out at me and said 'ping' :-).  Am I missing something
here?

Anyway, if anyone has any information, or can point me in the right
direction, I would appreciate it.  Thanks.

resnick@cogsci.uiuc.edu (Pete Resnick) (04/11/91)

rainwatr@ucunix.san.uc.edu (Don Rainwater) writes:

>Well, I'm still looking for a way to 'ping' an internet node from
>within Hypercard.  Someone mentioned the tcp hypercard tools that are
>available on apple.com (I believe).  These xcmds allow you to do a great
>many things using tcp (open a socket, listen on a socket, etc), but
>nothing jumped out at me and said 'ping' :-).  Am I missing something
>here?

MacTCP does not currently allow you access to ICMP, which is the
part of the TCP/IP protocol suite which 'ping' uses. There is some
reason to believe that a future release of MacTCP will have such
access. As soon as the new version comes out, I will write a desk
accessory to do ping myself and put it out on the net. It's a pretty
easy program.

pr
--
Pete Resnick             (...so what is a mojo, and why would one be rising?)
Graduate assistant - Philosophy Department, Gregory Hall, UIUC
System manager - Cognitive Science Group, Beckman Institute, UIUC
Internet/ARPAnet/EDUnet  : resnick@cogsci.uiuc.edu
BITNET (if no other way) : FREE0285@UIUCVMD

dorner@pequod.cso.uiuc.edu (Steve Dorner) (04/11/91)

>available on apple.com (I believe).  These xcmds allow you to do a great
>many things using tcp (open a socket, listen on a socket, etc), but
>nothing jumped out at me and said 'ping' :-).

The XCMD's are TCP only.

Which hardly matters, since MacTCP won't let you send ICMP packets anyway,
so you can't do a ping with MacTCP.  You'll have to wait for Apple to add
ICMP to MacTCP, or roll your own IP networking software, or buy InterCon's
TCP driver, which has ICMP (right?).
--
Steve Dorner, U of Illinois Computing Services Office
Internet: s-dorner@uiuc.edu  UUCP: uunet!uiucuxc!uiuc.edu!s-dorner

kraig@biostr.washington.edu (Kraig Eno) (04/12/91)

rainwatr@ucunix.san.uc.edu (Don Rainwater) writes:
> >Well, I'm still looking for a way to 'ping' an internet node from
> >within Hypercard.
>[Looking at the MacTCP toolkit], nothing jumped out at me and said 'ping'.

resnick@cogsci.uiuc.edu (Pete Resnick) responds:
>> MacTCP does not currently allow you access to ICMP, which is the
>> part of the TCP/IP protocol suite which 'ping' uses.

MacTCP lets you send and receive TCP packets on any socket number.  I 
don't know just how ping really works, but if you look at the man page, it 
says it sends a timestamp over the network which is then echoed by the 
remote host; when you receive the timestamp again, you can compute the 
round-trip travel time.

Don, this would be trivially easy to do with the "TCP XCMD example" file 
that you get with the MacTCP toolkit.  Simply open port #7 on a Unix box, 
which is the echo service, and use an idle handler to send it a stream of 
packets containing "the seconds". The unix host will bounce back whatever 
it receives.  Whenever you get packets back, compute the time it took by 
comparing the time in the packet with the current time, to get elapsed 
time in seconds.  For sub-second accuracy, you'd have to play a few more 
tricks, but this will get you started.

Anyone with Unix source want to check and see if it uses port 7?

Kraig Eno, kraig@biostr.washington.edu
"Problems generate new knowledge" - M. Usui

knutsen@pilot.njin.net (Mark Knutsen) (04/12/91)

>resnick@cogsci.uiuc.edu (Pete Resnick) responds:
>>> MacTCP does not currently allow you access to ICMP, which is the
>>> part of the TCP/IP protocol suite which 'ping' uses.

kraig@biostr.washington.edu (Kraig Eno) writes:
>MacTCP lets you send and receive TCP packets on any socket number.  I 
>don't know just how ping really works, but if you look at the man page,
> ...
>Anyone with Unix source [to ping] want to check and see if it uses port 7?

Pete Resnick is correct, the standard 'ping' uses ICMP, not TCP.
Still, the method Kraig Eno describes is a perfectly fine way to
determine if a host is alive.  After all, what good is a host if TCP
isn't running? :-)

-- 
===============================================================================
Mark Knutsen, now located in New Haven, CT.  Same old email address:
knutsen@pilot.njin.net OR knutsen@pilot.rutgers.edu OR {...}!rutgers!knutsen