in reply to how to count route diffs in traceroute outputs

clint,
I understand your concern for wanting to have something that "just works" no matter where you install it. I assume this means you are already aware of the various traceroute and diff modules. Unfortunately, you have assumed that library dependencies are the only thing you need to be concerned about. Are all the machines running the exact same OS with the exact same version of Perl with the exact same port of traceroute and diff? Regardless of the answer, it would helpful to see a sample output.

I can show you code of how I would do it on my work machine which would likely differ a bit on how I would do it at home and neither may work for you.

Cheers - L~R

  • Comment on Re: how to count route diffs in traceroute outputs

Replies are listed 'Best First'.
Re^2: how to count route diffs in traceroute outputs
by clint (Novice) on Jun 20, 2005 at 13:28 UTC
    Hi Limbic~Region,

    many thanx for your answer. I understand what you mean. But my main problem is how to interpret the diff output, how do I count the route differences. This code should run mainly on OpenBSD and Linux. Traceroute and diff operates the same way on these OSs according to my tests.
    Many thanx in advance.

    Clint
      clint,
      As merlyn was keen to point out, more details are required. The single most important piece of my response was "it would helpful to see a sample output". That isn't just the traceroute output, but also what you want to do with it. I am more of a visual person and want to "see" what you want to accomplish while merlyn is more of an auditory person and wants you to describe the process. Either way - we need more information.

      Cheers - L~R

        Hi PerlMonks,

        many thanx for your help!
        I try to specify everything better this time.
        So I have two example files, which should be produced by my script, (to reach this state is no problem):

        File: route_1

        3 r26-lo1-ixi1.vie.as1901.net (193.154.162.15)
        4 r4-vlan-167-ixi1.vie.as1901.net.167.154.193.in-addr.arpa (193.154.167.1)
        5 msw02-01-w15-vlan-145-dbg2.vie.at.eu.net (193.154.145.19)
        6 194.96.203.74 (194.96.203.74)

        File: route_2

        3 r26-lo1-ixi1.vie.as1901.net (193.154.162.15)
        4 r4-vlan-167-ixi1.vie.as1902.net.167.154.193.in-addr.arpa (193.154.167.1)
        5 msw02-01-w15-vlan-145-dbg2.vie.at.eu.net (193.154.145.19)
        6 64.233.174.114 (64.233.174.114)
        7 194.96.203.74 (194.96.203.74)

        Diff:

        diff route_1 route_2
        2c2
        < 4 r4-vlan-167-ixi1.vie.as1901.net.167.154.193.in-addr.arpa (193.154.167.1)
        ---
        > 4 r4-vlan-167-ixi1.vie.as1902.net.167.154.193.in-addr.arpa (193.154.167.1)
        4c4,5
        < 6 194.96.203.74 (194.96.203.74)
        ---
        > 6 64.233.174.114 (64.233.174.114)
        > 7 194.96.203.74 (194.96.203.74)

        There are two differences, which I made in the route. My question is how to interpret the diff output? I mean, how to count the diffs in the route? A diff in a route is for example if a IP or hostname of a hop is changed or there is a new hop... I would like count to the diffs, but I do not know what to do with the diff output, how to parse it.

        Many thanx for any help!

        Clint
      You'll probably need to be more specific. Traceroute generally has 3 probes per hopcount. How do you want to show the differences? Between the smallest of one set to the largest of the other?

      And what if the route flaps in the middle (where you get a new host on a given line)? How do you want to see that?

      And what if the route is different from one view to the next? The hop-by-hop counts will be relatively unrelated after the first branch point.

      So, if you can explain (as in provide a specification) what you mean by "count the route differences", you might get a more concrete answer rather than all the handwaving responses so far.

      -- Randal L. Schwartz, Perl hacker
      Be sure to read my standard disclaimer if this is a reply.