 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
00_CumPeeWearD12 Guest
|
|
| Back to top |
|
 |
Wiseguy Guest
|
Posted: Tue Feb 22, 2005 5:23 am Post subject: Re: Ping (ICMP) in Java over TCP? |
|
|
"00_CumPeeWearD12" <00_CumPeeWearD12 (AT) gmail (DOT) com> scribbled on the stall wall:
No...Unless the java API has been updated, you cannot access anything in the
stack at a lower level than UDP from within java.
Without looking at the code I believe it should be possible to use
differentials (maybe based on the NTP service) to determine RTT. NTP
accurately determines transmission times without resorting to ICMP. It runs
under UDP or TCP and would be possible to implement under Java. This
process is more math than computers skills though.
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
|
|
| Back to top |
|
 |
Tilman Bohn Guest
|
Posted: Tue Feb 22, 2005 6:24 am Post subject: Re: Ping (ICMP) in Java over TCP? |
|
|
In message <HaidnWfD6pqXFYffRVn-gg (AT) rogers (DOT) com>,
00_CumPeeWearD12 wrote on Mon, 21 Feb 2005 20:16:55 -0500:
Using TCP, as far as I can see.
| Quote: | I assume RRT = Ping.. right?
|
No, it's simply the round trip time. You can send data containing
timestamps back and forth over TCP and calculate it that way. Of course
the resulting value could be completely different for TCP than for UDP
or ICMP, but it's a valid ballpark estimate.
BTW, TCP has had its own internal (optional) timestamp mechanism since
1992 (RFC 1323). The meaning of the numbers in that are completely un-
defined and implementation dependent (they only need to be monotonically
increasing). However, if the original sender knows when it sent a given
segment, it knows how long it took the corresponding ACK to return to
it => RTT. I'm not aware of any way to access this low level facility
from Java though, short of using JNI to interface to pcap or such-like.
| Quote: | If so, is there any sample Java code that
implements ICMP over TCP?
|
This question doesn't make any sense. ICMP and TCP are on the same
layer of the protocol stack. If anything, ICMP can be considered to
reside on a _lower_ layer. What you probably mean is how to do echo and
echo reply type communications over TCP. Simple: Just send timestamps
back and forth, and include the most recently received timestamp from
the other side in the next reply. You probably want to at least disable
the Nagle algorithm for that (TCP_NODELAY, which can be set on any
socket within Java), but the results will still be somewhat arbitrary
for various reasons.
--
Cheers, Tilman
`Boy, life takes a long time to live...' -- Steven Wright
|
|
| Back to top |
|
 |
Tilman Bohn Guest
|
Posted: Tue Feb 22, 2005 6:31 am Post subject: Re: Ping (ICMP) in Java over TCP? |
|
|
In message <421ac1ef$1_1 (AT) 127 (DOT) 0.0.1>,
Wiseguy wrote on 21 Feb 2005 23:23:59 -0600:
[...]
| Quote: | Without looking at the code I believe it should be possible to use
differentials (maybe based on the NTP service) to determine RTT. NTP
accurately determines transmission times without resorting to ICMP.
[...] |
Actually, the problem NTP tries to solve is a much harder one: clock
synchronization. To accurately measure the complete _round trip_ time,
no synchronization is needed. All you need to do is send a timestamp and
have the other side echo it to you. When you receive it, you know how
long it took. That's all there is to it. The timestamp doesn't even have
to mean anything, as long as you remember when you sent it.
--
Cheers, Tilman
`Boy, life takes a long time to live...' -- Steven Wright
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|