As Ron said, this is a pretty simple thing to test - you should give it a try if you haven't already.
In BSD systems traceroute will use a range of high, unregistered UDP port numbers as well as TTL. The device originating the probes will send 3 probes, they will look like this:
NOTE: The port numbers won't necessarily be exact in your tests.
- Probe 1: TTL = 1 UDP Port = 33434
- Probe 2: TTL = 1 UDP Port = 33435
- Probe 3: TTL = 1 UDP Port = 33436
In the condition that the we're NOT tracerouting to the next-hop, you will see the following message from the next device:
Time to Live Exceeded
This is what we would expect, to see as traceroute progresses, the next device's probes would look like this:
- Probe 1: TTL = 2 UDP Port = 33437
- Probe 2: TTL = 2 UDP Port = 33438
- Probe 3: TTL = 2 UDP Port = 33439
Now let's say that second set of probes will reach our intended destination. The response we will get is (and this is a portion directly from tcpdump):
udp port 33437 unreachable
Now what does this mean? It means we've reached our destination, because only our destination can say "No this port is not available" (as we would expect from the higher unregistered UDP port range).
My question is - what if we trace route to next-hop router: - Should the router respond with port unreachable message?
The cool thing about traceroute is that, it has no idea if you're trying to hit something 20 hops away, or just 1 hop away - it needs to be able to adapt to any of those situations.
So it will behave no differently than it would at the last hop in a 20 hop traceroute.
If you traceroute your next hop, your probes would look the same:
- Probe 1: TTL = 1 UDP Port = 33434
- Probe 2: TTL = 1 UDP Port = 33435
- Probe 3: TTL = 1 UDP Port = 33436
But the different here is, a TTL of 1 is enough to get to your next hop. So you would see the "udp port XXXXX unreachable" message right away, implying that the traceroute has completed. Instead of seeing the "Time to Live Exceeded" messages.
I hope this helps clear things up, if you have any other questions related to this - leave a comment and I'll be happy to update my answer.
The reason for that result on a trace is that, some ISP, does load balance in his Autonomus System, thats it: same destination across diferent ways.
This is the reason that you looks, in the same hop, ex: 4, 5 and 6, that one packet goes hrough every one of the links that can reach the destination.
Best Answer
I's not exactly the answer at your question, but that a simple (but limited) way to do (in certain case) what you want. I'm coping-post the option -R of ping man page:
So you can see also the return path of the ECHO_REQUEST, that is not the exit interface (that you are asking about) unless the outgoing path is the same of the come back path. Only in this case, the returning path is the IP address of the outgoing interface you are asking for.
That's an real example on my internet provider net, maybe not so clear, but I don't have just now some router to link each other :)