We needed a tool which could measure the number of hops to reach a remote host. We wanted to call this script from a grid job, so we had the following constraints:
  • The tool must use TCP (because UDP is often blocked by firewalls)
  • The tool must work when run by an unpriviledged user
  • The tool should be written in an OS-independent language
  • The tool should be reasonably fast

The resulting python script is composed of two files, in order to make it faster (because this way the second file which contains most of the code is compiled into bytecode at the first call, and the following calls are faster). They are available here and here.

In order to use this tool, download these files, rename them to "counthops.py" and "counthops_lib.py" (the .txt was appended for security reason), make "counthops.py" executable, and run it by:

./counthops.py < remote_host > < remote_port >
where < remote_port > should be a TCP port known to be open and accessible on the < remote_host >.

For example:

./counthops.py www.google.fr 80
or
./counthops.py ce-ipv6-testbed.paris.urec.cnrs.fr 2811

-- EtienneDUBLE - 14 May 2009

Topic attachments
I Attachment History Action Size Date Who Comment
Texttxt counthops.py.txt r1 manage 0.2 K 2009-05-14 - 14:08 EtienneDUBLE Counthops.py script
Texttxt counthops_lib.py.txt r1 manage 1.9 K 2009-05-15 - 10:15 EtienneDUBLE counthops_lib.py script
Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r2 - 2009-05-15 - EtienneDUBLE
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    EGEE All webs login

This site is powered by the TWiki collaboration platform Powered by Perl This site is powered by the TWiki collaboration platformCopyright &© by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Ask a support question or Send feedback