Community discussions

MikroTik App
 
User avatar
mutluit
Forum Veteran
Forum Veteran
Topic Author
Posts: 821
Joined: Wed Mar 25, 2020 4:04 am

How is that possible at all: traceroute reports 2 hops with same IP

Wed Oct 25, 2023 12:01 am

How is that possible at all: traceroute reports 2 hops with same IP. Take a look at the last 2 hops :
# traceroute 192.229.221.95
traceroute to 192.229.221.95 (192.229.221.95), 30 hops max, 60 byte packets
...
 6  145.254.3.136 (145.254.3.136)  23.072 ms  13.877 ms  15.266 ms
 7  145.254.2.189 (145.254.2.189)  19.986 ms  20.246 ms  20.157 ms
 8  ae-91.border1.amm.edgecastcdn.net (152.195.104.192)  23.866 ms  20.880 ms  22.367 ms
 9  152.195.104.147 (152.195.104.147)  25.204 ms  27.241 ms  28.688 ms
10  192.229.221.95 (192.229.221.95)  23.566 ms  21.794 ms  25.849 ms
11  192.229.221.95 (192.229.221.95)  29.123 ms  33.950 ms  35.834 ms
 
User avatar
bpwl
Forum Guru
Forum Guru
Posts: 2999
Joined: Mon Apr 08, 2019 1:16 am

Re: How is that possible at all: traceroute reports 2 hops with same IP

Wed Oct 25, 2023 1:31 am

Think of how traceroute works. Next attempt will be with a TTL which is one higher. It could/will be the same answer again.
The local traceroute should have seen it was already there with TTL=10.
The path for TTL=11 could be one longer than the previous one (routes vary over time, as next hops can differ)
The 11 steps in the printed list are not from one travelling packet, but from 11 separate packets, each sent with increasing TTL.
 
User avatar
mutluit
Forum Veteran
Forum Veteran
Topic Author
Posts: 821
Joined: Wed Mar 25, 2020 4:04 am

Re: How is that possible at all: traceroute reports 2 hops with same IP

Wed Oct 25, 2023 2:29 am

Think of how traceroute works. Next attempt will be with a TTL which is one higher. It could/will be the same answer again.
The local traceroute should have seen it was already there with TTL=10.
The path for TTL=11 could be one longer than the previous one (routes vary over time, as next hops can differ)
The 11 steps in the printed list are not from one travelling packet, but from 11 separate packets, each sent with increasing TTL.
But the question was: why do the last 2 hops have the same IP ? How is that possible?
Ie. it much looks like that 2 machines have the same IP... Somehow illogical...
 
User avatar
bpwl
Forum Guru
Forum Guru
Posts: 2999
Joined: Mon Apr 08, 2019 1:16 am

Re: How is that possible at all: traceroute reports 2 hops with same IP

Wed Oct 25, 2023 1:40 pm

It probably is the same machine that answered.
The 10th line needed 10 hops before the TTL was reduced to zero (and that router reported the end of travel because TTL was used up)
The 11th line (Traceroute with TTL=11) ended after 11 hops of the packet. That path was 1 hop longer. IP routes can be dynamic depending on the routing protocol used, a broken link is replaced with another slower or longer path. Be it OSPF or BGP or any other routing protocol finding the best path. There could also be some load balancing involved, with different paths for the 10th and the 11th line.

Interesting is also the reported IP address with traceroute. Experiment with an alternate IP on on a router (eg IP of other interface with other subnet), but receive the IP from the interface that sent the answer to you.

MTR could generate a more stable (repeated) answer, as the Traceroute double IP can be caused by a one time missed answer.
The RouterOS Tools/traceroute in WinBox acts like MTR, with repeated checks

https://www.clouddirect.net/knowledge-b ... d-pathping

And I see CDN in one of the lines. Content Delivery Networks do have multiple hosts with the same IP address to optimize response time.
https://serverfault.com/questions/92825 ... le-servers
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11770
Joined: Thu Mar 03, 2016 10:23 pm

Re: How is that possible at all: traceroute reports 2 hops with same IP

Wed Oct 25, 2023 3:07 pm

If packet, used by traceroute (linux traceroute usually uses UDP packet, targeting a random high port, some traceroute tools use ICMP packets), is DST-NATed, then the same final address will be shown twice:
  1. when TTL expires at the moment when packet hits NAT-performing device and that device replies with ICMP time exceeded (using own WAN IP address as it should)
  2. whn TTL expires at the moment when packet hits internal server and that device either replies in any way (either ICMP port forbidden or even with reply packet) and NAT-performing device reverse-NATs the reply (that packet is "related" to allowed connection).

If one uses tcptraceroute (which uses TCP SYN packets), then such "double" final IP address is shown quite often.
But not always: when DST NAT is in force, if router uses another IP address as own address but uses specific IP address for NATing a particular service, then penultimate hop will display router's "native" IP address and ultimate will show the IP address used for particular service. In such case it's hard (next to imposible) to tell if NAT is actually done or not.
 
User avatar
bpwl
Forum Guru
Forum Guru
Posts: 2999
Joined: Mon Apr 08, 2019 1:16 am

Re: How is that possible at all: traceroute reports 2 hops with same IP

Wed Oct 25, 2023 3:28 pm

Aha, thanks @MKX.

From my house , with ROS Tools/traceroute towards 192.229.221.95, ... with protocol ICMP set shows single response (12), protocol UDP set shows the double response (12-13)

Who is online

Users browsing this forum: Bing [Bot] and 27 guests