ValentinBELYN / icmplib

Easily forge ICMP packets and make your own ping and traceroute.
GNU Lesser General Public License v3.0
267 stars 45 forks source link

Traceroute on IPv6 Network #27

Closed KiritoMiao closed 3 years ago

KiritoMiao commented 3 years ago

Hi, when I try traceroute to any IPv6 address, this lib just put the dst as the only hop. I have turnoff the firewall on this machine.

Command:

Python 3.6.8 (default, Nov 16 2020, 16:55:22) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import icmplib
>>> hops = icmplib.traceroute('2001:470:1:18::115')     
>>> print(hops) 
[<Hop 1 [2001:470:1:18::115]>]

TCPDUMP:

07:38:11.602563 IP6 (hlim 64, next-header ICMPv6 (58) payload length: 64) MY_LOCAL_IPV6 > 2001:470:1:18::115: [icmp6 sum ok] ICMP6, echo request, seq 0
07:38:11.662401 IP6 (flowlabel 0xe3c64, hlim 57, next-header ICMPv6 (58) payload length: 64) 2001:470:1:18::115 > MY_LOCAL_IPV6  [icmp6 sum ok] ICMP6, echo reply, seq 0
07:38:11.662839 IP6 (hlim 64, next-header ICMPv6 (58) payload length: 64) MY_LOCAL_IPV6  > 2001:470:1:18::115: [icmp6 sum ok] ICMP6, echo request, seq 1
07:38:11.722478 IP6 (flowlabel 0xe3c64, hlim 57, next-header ICMPv6 (58) payload length: 64) 2001:470:1:18::115 > MY_LOCAL_IPV6  [icmp6 sum ok] ICMP6, echo reply, seq 1

traceroute using linux tools

[root@us-iad03-t2-1g-1 ~]# traceroute 2001:470:1:18::115
traceroute to 2001:470:1:18::115 (2001:470:1:18::115), 30 hops max, 80 byte packets
 1  po001.c25.iad03.us.misaka.io (2a0e:6902:2000::4)  0.275 ms  0.105 ms  0.096 ms
 2  v204.cs01.iad03.us.misaka.io (2a0e:6902:2000::2)  0.289 ms v204.cs02.iad03.us.misaka.io (2a0e:6902:2000::3)  0.287 ms  0.191 ms
 3  v204.cs02.iad03.us.misaka.io (2a0e:6902:2000::3)  0.182 ms 2001:504:31::1b1b:1 (2001:504:31::1b1b:1)  4.288 ms  7.232 ms
 4  2001:504:31::1b1b:1 (2001:504:31::1b1b:1)  10.159 ms  13.229 ms  16.196 ms
 5  100ge14-1.core2.ash1.he.net (2001:470:0:4c4::1)  0.578 ms 100ge1-2.core1.ash1.he.net (2001:470:0:277::1)  22.035 ms 100ge14-1.core2.ash1.he.net (2001:470:0:4c4::1)  0.393 ms
 6  100ge1-2.core1.ash1.he.net (2001:470:0:277::1)  0.591 ms  0.832 ms 100ge7-2.core1.pao1.he.net (2001:470:0:8f::1)  59.183 ms
 7  100ge14-1.core3.fmt1.he.net (2001:470:0:30::1)  72.677 ms  72.549 ms  72.433 ms
 8  100ge14-1.core3.fmt1.he.net (2001:470:0:30::1)  72.324 ms  72.216 ms  67.062 ms
 9  2001:470:1:18::115 (2001:470:1:18::115)  59.648 ms  59.562 ms  59.686 ms
ValentinBELYN commented 3 years ago

Hi!

Thank you for taking the time to report this issue. It's a great idea to include the tcpdump capture 👍 I think I know where the problem is coming from. I need to do some tests. I will release a fix soon.

ValentinBELYN commented 3 years ago

I just released icmplib 2.0.1 which should fix your problem. Can you try again ? Thanks 😃

KiritoMiao commented 3 years ago

Hello,

It still have some kinds of error that result put only the target's ipv6 in the final hop. I attached the log stuff under this response and hope they can help.

icmplib:

Successfully installed icmplib-2.0.1
root@v1:~# python3
Python 3.7.3 (default, Jul 25 2020, 13:03:44) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import icmplib
>>> icmplib.traceroute('1.1.1.1')
[<Hop 1 [173.82.238.1]>, <Hop 2 [96.45.162.9]>, <Hop 3 [206.72.211.63]>, <Hop 4 [1.1.1.1]>]
>>> icmplib.traceroute('ipv6.google.com')

[<Hop 14 [2607:f8b0:4007:80c::200e]>]
>>> 
>>> icmplib.traceroute('ipv6.google.com')
[<Hop 14 [2607:f8b0:4007:80c::200e]>]
>>> icmplib.traceroute('ipv6.google.com')
[<Hop 14 [2607:f8b0:4007:80c::200e]>]

tcpdump:

07:16:50.758436 IP6 fe80::217:dfff:feb3:a800 > fe80::216:3eff:fe65:d7ea: ICMP6, neighbor solicitation, who has fe80::216:3eff:fe65:d7ea, length 32
07:16:50.907842 IP6 fe80::217:dfff:feb3:a800 > fe80::216:3eff:fe8d:61df: ICMP6, neighbor solicitation, who has fe80::216:3eff:fe8d:61df, length 32
07:16:50.907858 IP6 fe80::217:dfff:feb3:a800 > fe80::216:3eff:fe50:f5f9: ICMP6, neighbor solicitation, who has fe80::216:3eff:fe50:f5f9, length 32
07:16:51.374694 IP6 fe80::217:dfff:feb3:a800 > 2607:f130:0:f0::a9: ICMP6, neighbor solicitation, who has 2607:f130:0:f0::a9, length 32
07:16:51.376394 IP6 fe80::217:dfff:feb3:a800 > 2607:f130:0:f0::4ce: ICMP6, neighbor solicitation, who has 2607:f130:0:f0::4ce, length 32
07:16:51.377373 IP6 fe80::217:dfff:feb3:a800 > 2607:f130:0:f0::576: ICMP6, neighbor solicitation, who has 2607:f130:0:f0::576, length 32
07:16:51.377381 IP6 fe80::217:dfff:feb3:a800 > 2607:f130:0:f0::582: ICMP6, neighbor solicitation, who has 2607:f130:0:f0::582, length 32
07:16:51.377383 IP6 fe80::217:dfff:feb3:a800 > 2607:f130:0:f0::5cd: ICMP6, neighbor solicitation, who has 2607:f130:0:f0::5cd, length 32
07:16:51.377388 IP6 fe80::217:dfff:feb3:a800 > 2607:f130:0:f0::5e8: ICMP6, neighbor solicitation, who has 2607:f130:0:f0::5e8, length 32
07:16:51.499290 IP6 fe80::217:dfff:feb3:a800 > fe80::216:3eff:fe35:7731: ICMP6, neighbor solicitation, who has fe80::216:3eff:fe35:7731, length 32
07:16:56.421713 IP6 fe80::217:dfff:feb3:a800 > fe80::216:3eff:fe64:1a5: ICMP6, neighbor advertisement, tgt is fe80::217:dfff:feb3:a800, length 24
07:17:00.430353 IP6 2607:f130:0:d7::949 > ff02::1:ff00:1: ICMP6, neighbor solicitation, who has 2607:f130:0:d7::1, length 32
07:17:03.313004 IP6 2607:f130:0:f0::14e > ff02::1:ff00:1: ICMP6, neighbor solicitation, who has 2607:f130:0:f0::1, length 32
07:17:07.279866 IP6 fe80::217:dfff:feb3:a800 > fe80::216:3eff:fea3:3eb8: ICMP6, neighbor advertisement, tgt is fe80::217:dfff:feb3:a800, length 24
07:17:10.905732 IP6 fe80::217:dfff:feb3:a800 > fe80::ca1f:66ff:feb7:f110: ICMP6, neighbor advertisement, tgt is fe80::217:dfff:feb3:a800, length 24
07:17:14.037175 IP6 fe80::217:dfff:feb3:a800 > fe80::216:3eff:fee4:5cab: ICMP6, neighbor advertisement, tgt is fe80::217:dfff:feb3:a800, length 24
07:17:14.403341 IP6 2607:f130:0:f0::5eb > lax17s15-in-x0e.1e100.net: ICMP6, echo request, seq 0, length 64
07:17:14.517948 IP6 fe80::217:dfff:feb3:a800 > fe80::216:3eff:fe51:bf12: ICMP6, neighbor solicitation, who has fe80::216:3eff:fe51:bf12, length 32
07:17:14.518534 IP6 fe80::217:dfff:feb3:a800 > fe80::216:3eff:fe15:8743: ICMP6, neighbor solicitation, who has fe80::216:3eff:fe15:8743, length 32
07:17:18.153901 IP6 fe80::217:dfff:feb3:a800 > fe80::216:3eff:fee1:fe91: ICMP6, neighbor advertisement, tgt is fe80::217:dfff:feb3:a800, length 24
07:17:18.409573 IP6 2607:f130:0:f0::5eb > lax17s15-in-x0e.1e100.net: ICMP6, echo request, seq 0, length 64
07:17:18.418379 IP6 ae-19.r01.snjsca04.us.bb.gin.ntt.net > 2607:f130:0:f0::5eb: ICMP6, time exceeded in-transit for lax17s15-in-x0e.1e100.net, length 112
07:17:19.649098 IP6 fe80::217:dfff:feb3:a800 > fe80::216:3eff:fe51:bf12: ICMP6, neighbor advertisement, tgt is fe80::217:dfff:feb3:a800, length 24
07:17:22.432397 IP6 2607:f130:0:f0::5eb > lax17s15-in-x0e.1e100.net: ICMP6, echo request, seq 0, length 64
07:17:22.451869 IP6 eqixsjc-v6.google.com > 2607:f130:0:f0::5eb: ICMP6, time exceeded in-transit for lax17s15-in-x0e.1e100.net, length 112
07:17:22.869394 IP6 2607:f130:0:f0::1 > fe80::216:3eff:fe74:e761: ICMP6, neighbor advertisement, tgt is 2607:f130:0:f0::1, length 24
07:17:23.265827 IP6 fe80::217:dfff:feb3:a800 > fe80::216:3eff:fee1:fe91: ICMP6, neighbor solicitation, who has fe80::216:3eff:fee1:fe91, length 32
07:17:23.350318 IP6 fe80::217:dfff:feb3:a800 > 2607:f130:0:f0::a: ICMP6, neighbor solicitation, who has 2607:f130:0:f0::a, length 32
07:17:23.350479 IP6 fe80::217:dfff:feb3:a800 > 2607:f130:0:f0::2e: ICMP6, neighbor solicitation, who has 2607:f130:0:f0::2e, length 32
07:17:23.351036 IP6 fe80::217:dfff:feb3:a800 > 2607:f130:0:f0::64: ICMP6, neighbor solicitation, who has 2607:f130:0:f0::64, length 32
07:17:23.351046 IP6 fe80::217:dfff:feb3:a800 > 2607:f130:0:f0::85: ICMP6, neighbor solicitation, who has 2607:f130:0:f0::85, length 32
07:17:23.351049 IP6 fe80::217:dfff:feb3:a800 > 2607:f130:0:f0::df: ICMP6, neighbor solicitation, who has 2607:f130:0:f0::df, length 32
07:17:23.351572 IP6 fe80::217:dfff:feb3:a800 > 2607:f130:0:f0::121: ICMP6, neighbor solicitation, who has 2607:f130:0:f0::121, length 32
07:17:23.351884 IP6 fe80::217:dfff:feb3:a800 > 2607:f130:0:f0::187: ICMP6, neighbor solicitation, who has 2607:f130:0:f0::187, length 32
07:17:27.425149 IP6 fe80::217:dfff:feb3:a800 > 2607:f130:0:f0::5a6: ICMP6, neighbor solicitation, who has 2607:f130:0:f0::5a6, length 32
07:17:31.566235 IP6 2607:f130:0:f0::5eb > lax17s15-in-x0e.1e100.net: ICMP6, echo request, seq 0, length 64
07:17:32.569181 IP6 fe80::217:dfff:feb3:a800 > fe80::216:3eff:fe8d:61df: ICMP6, neighbor advertisement, tgt is fe80::217:dfff:feb3:a800, length 24
07:17:35.590997 IP6 2607:f130:0:f0::5eb > lax17s15-in-x0e.1e100.net: ICMP6, echo request, seq 0, length 64
07:17:38.062443 IP6 2607:f130:0:d7::949 > ff02::1:ff00:1: ICMP6, neighbor solicitation, who has 2607:f130:0:d7::1, length 32
07:17:41.644290 IP6 2607:f130:0:f0::5eb > lax17s15-in-x0e.1e100.net: ICMP6, echo request, seq 1, length 64
07:17:46.785334 IP6 2607:f130:0:f0::5eb > lax17s15-in-x0e.1e100.net: ICMP6, echo request, seq 1, length 64
07:17:48.796652 IP6 2607:f130:0:f0::5eb > lax17s15-in-x0e.1e100.net: ICMP6, echo request, seq 0, length 64
07:17:48.806449 IP6 2001:4860:0:1::2db > 2607:f130:0:f0::5eb: ICMP6, time exceeded in-transit for lax17s15-in-x0e.1e100.net, length 112
07:17:48.812756 IP6 2607:f130:0:d7::949 > ff02::1:ff00:1: ICMP6, neighbor solicitation, who has 2607:f130:0:d7::1, length 32
07:17:48.832890 IP6 fe80::216:3eff:fe80:4a6b > 2607:f130:0:f0::1: ICMP6, neighbor solicitation, who has 2607:f130:0:f0::1, length 32
07:17:48.885459 IP6 2607:f130:0:f0::1 > fe80::216:3eff:fe80:4a6b: ICMP6, neighbor advertisement, tgt is 2607:f130:0:f0::1, length 24
07:17:49.836376 IP6 2607:f130:0:d7::949 > ff02::1:ff00:1: ICMP6, neighbor solicitation, who has 2607:f130:0:d7::1, length 32
07:17:49.856870 IP6 fe80::216:3eff:fe80:4a6b > fe80::217:dfff:feb3:a800: ICMP6, neighbor solicitation, who has fe80::217:dfff:feb3:a800, length 32
07:17:49.857429 IP6 fe80::217:dfff:feb3:a800 > fe80::216:3eff:fe51:546: ICMP6, neighbor advertisement, tgt is fe80::217:dfff:feb3:a800, length 24
07:17:49.857969 IP6 fe80::217:dfff:feb3:a800 > fe80::216:3eff:fe80:4a6b: ICMP6, neighbor advertisement, tgt is fe80::217:dfff:feb3:a800, length 24
07:17:50.201369 IP6 fe80::217:dfff:feb3:a800 > fe80::216:3eff:fe5f:3f3a: ICMP6, neighbor advertisement, tgt is fe80::217:dfff:feb3:a800, length 24
07:17:50.362781 IP6 fe80::217:dfff:feb3:a800 > fe80::a34e:cdf9:7588:6d5e: ICMP6, neighbor solicitation, who has fe80::a34e:cdf9:7588:6d5e, length 32
07:17:50.885358 IP6 fe80::217:dfff:feb3:a800 > fe80::216:3eff:fe35:7731: ICMP6, neighbor solicitation, who has fe80::216:3eff:fe35:7731, length 32
07:17:51.253359 IP6 fe80::217:dfff:feb3:a800 > fe80::216:3eff:fea3:3eb8: ICMP6, neighbor solicitation, who has fe80::216:3eff:fea3:3eb8, length 32
07:17:51.861292 IP6 2607:f130:0:f0::5eb > lax17s15-in-x0e.1e100.net: ICMP6, echo request, seq 1, length 64
07:17:51.869905 IP6 2001:4860:0:1::2db > 2607:f130:0:f0::5eb: ICMP6, time exceeded in-transit for lax17s15-in-x0e.1e100.net, length 112
07:17:53.872536 IP6 2607:f130:0:f0::5eb > lax17s15-in-x0e.1e100.net: ICMP6, echo request, seq 0, length 64
07:17:53.882274 IP6 lax17s15-in-x0e.1e100.net > 2607:f130:0:f0::5eb: ICMP6, echo reply, seq 0, length 64
07:17:53.882743 IP6 2607:f130:0:f0::5eb > lax17s15-in-x0e.1e100.net: ICMP6, echo request, seq 1, length 64
07:17:53.891398 IP6 lax17s15-in-x0e.1e100.net > 2607:f130:0:f0::5eb: ICMP6, echo reply, seq 1, length 64
07:17:54.043357 IP6 fe80::217:dfff:feb3:a800 > fe80::216:3eff:fe80:4a6b: ICMP6, neighbor solicitation, who has fe80::216:3eff:fe80:4a6b, length 32
07:17:54.043426 IP6 fe80::216:3eff:fe80:4a6b > fe80::217:dfff:feb3:a800: ICMP6, neighbor advertisement, tgt is fe80::216:3eff:fe80:4a6b, length 24
07:17:54.933382 IP6 fe80::217:dfff:feb3:a800 > fe80::216:3eff:fe51:546: ICMP6, neighbor solicitation, who has fe80::216:3eff:fe51:546, length 32
07:17:55.242047 IP6 fe80::217:dfff:feb3:a800 > fe80::216:3eff:fe5f:3f3a: ICMP6, neighbor solicitation, who has fe80::216:3eff:fe5f:3f3a, length 32
07:17:55.448323 IP6 fe80::217:dfff:feb3:a800 > 2607:f130:0:f0::3fd: ICMP6, neighbor solicitation, who has 2607:f130:0:f0::3fd, length 32
07:17:55.448337 IP6 fe80::217:dfff:feb3:a800 > 2607:f130:0:f0::47d: ICMP6, neighbor solicitation, who has 2607:f130:0:f0::47d, length 32

traceroute:

root@v1:~# traceroute ipv6.google.com
traceroute to ipv6.google.com (2607:f8b0:4007:80c::200e), 30 hops max, 80 byte packets
 1  2607:f130:0:f0::1 (2607:f130:0:f0::1)  1.088 ms  0.890 ms  0.804 ms
 2  2607:f130:0:76::11 (2607:f130:0:76::11)  5.246 ms  5.236 ms  5.007 ms
 3  ae-41.a00.lsanca07.us.bb.gin.ntt.net (2001:418:0:5000::674)  4.899 ms  4.839 ms  4.740 ms
 4  * * ae-9.r25.lsanca07.us.bb.gin.ntt.net (2001:418:0:2000::296)  4.645 ms
 5  ae-3.r24.snjsca04.us.bb.gin.ntt.net (2001:418:0:2000::111)  15.621 ms  15.547 ms  15.472 ms
 6  ae-19.r01.snjsca04.us.bb.gin.ntt.net (2001:418:0:2000::7e)  15.385 ms  8.629 ms  8.278 ms
 7  * eqixsjc-v6.google.com (2001:504:0:1:0:1:5169:1)  11.210 ms  11.116 ms
 8  2001:4860:0:1005::f (2001:4860:0:1005::f)  11.085 ms 2001:4860:0:1007::e (2001:4860:0:1007::e)  17.309 ms 2001:4860:0:1006::f (2001:4860:0:1006::f)  10.941 ms
 9  2001:4860::c:4002:292d (2001:4860::c:4002:292d)  10.981 ms  10.960 ms  10.843 ms
10  2001:4860::c:4000:de40 (2001:4860::c:4000:de40)  10.848 ms 2001:4860::c:4000:de3d (2001:4860::c:4000:de3d)  21.511 ms *
11  2001:4860::9:4000:de3e (2001:4860::9:4000:de3e)  10.728 ms * 2001:4860::9:4000:de3f (2001:4860::9:4000:de3f)  10.745 ms
12  2001:4860:0:1::2db (2001:4860:0:1::2db)  10.648 ms 2001:4860:0:1110::1 (2001:4860:0:1110::1)  8.530 ms  8.530 ms
13  2001:4860:0:1::2db (2001:4860:0:1::2db)  9.498 ms  8.435 ms lax17s15-in-x0e.1e100.net (2607:f8b0:4007:80c::200e)  8.169 ms

tcpdump:

07:18:31.518765 IP6 fe80::217:dfff:feb3:a800 > fe80::216:3eff:fed0:532c: ICMP6, neighbor solicitation, who has fe80::216:3eff:fed0:532c, length 32
07:18:31.914754 IP6 fe80::217:dfff:feb3:a800 > fe80::216:3eff:fe64:1a5: ICMP6, neighbor solicitation, who has fe80::216:3eff:fe64:1a5, length 32
07:18:31.914786 IP6 fe80::217:dfff:feb3:a800 > fe80::216:3eff:fe74:e761: ICMP6, neighbor solicitation, who has fe80::216:3eff:fe74:e761, length 32
07:18:32.116455 IP6 2607:f130:0:f0::1 > 2607:f130:0:f0::5eb: ICMP6, time exceeded in-transit for lax17s15-in-x0e.1e100.net, length 88
07:18:32.116507 IP6 2607:f130:0:f0::1 > 2607:f130:0:f0::5eb: ICMP6, time exceeded in-transit for lax17s15-in-x0e.1e100.net, length 88
07:18:32.116520 IP6 2607:f130:0:f0::1 > 2607:f130:0:f0::5eb: ICMP6, time exceeded in-transit for lax17s15-in-x0e.1e100.net, length 88
07:18:32.120358 IP6 ae-41.a00.lsanca07.us.bb.gin.ntt.net > 2607:f130:0:f0::5eb: ICMP6, time exceeded in-transit for lax17s15-in-x0e.1e100.net, length 88
07:18:32.120435 IP6 ae-41.a00.lsanca07.us.bb.gin.ntt.net > 2607:f130:0:f0::5eb: ICMP6, time exceeded in-transit for lax17s15-in-x0e.1e100.net, length 88
07:18:32.120440 IP6 ae-9.r25.lsanca07.us.bb.gin.ntt.net > 2607:f130:0:f0::5eb: ICMP6, time exceeded in-transit for lax17s15-in-x0e.1e100.net, length 88
07:18:32.120443 IP6 ae-41.a00.lsanca07.us.bb.gin.ntt.net > 2607:f130:0:f0::5eb: ICMP6, time exceeded in-transit for lax17s15-in-x0e.1e100.net, length 88
07:18:40.353611 IP6 2001:4860:0:1006::f > 2607:f130:0:f0::5eb: ICMP6, time exceeded in-transit for lax17s15-in-x0e.1e100.net, length 88
07:18:40.353981 IP6 2001:4860:0:1007::f > 2607:f130:0:f0::5eb: ICMP6, time exceeded in-transit for lax17s15-in-x0e.1e100.net, length 88
07:18:40.354109 IP6 2001:4860::9:4000:de3f > 2607:f130:0:f0::5eb: ICMP6, time exceeded in-transit for lax17s15-in-x0e.1e100.net, length 88
07:18:40.354286 IP6 2001:4860::c:4000:de41 > 2607:f130:0:f0::5eb: ICMP6, time exceeded in-transit for lax17s15-in-x0e.1e100.net, length 152
07:18:40.354756 IP6 2001:4860::c:4002:292d > 2607:f130:0:f0::5eb: ICMP6, time exceeded in-transit for lax17s15-in-x0e.1e100.net, length 152
07:18:40.355022 IP6 eqixsjc-v6.google.com > 2607:f130:0:f0::5eb: ICMP6, time exceeded in-transit for lax17s15-in-x0e.1e100.net, length 88
07:18:40.355047 IP6 2001:4860::9:4000:de3f > 2607:f130:0:f0::5eb: ICMP6, time exceeded in-transit for lax17s15-in-x0e.1e100.net, length 88
07:18:40.364603 IP6 2001:4860:0:1::2db > 2607:f130:0:f0::5eb: ICMP6, time exceeded in-transit for lax17s15-in-x0e.1e100.net, length 88
07:18:40.392520 IP6 lax17s15-in-x0e.1e100.net > 2607:f130:0:f0::5eb: ICMP6, destination unreachable, unreachable port, lax17s15-in-x0e.1e100.net udp port 33474, length 88
07:18:40.392590 IP6 lax17s15-in-x0e.1e100.net > 2607:f130:0:f0::5eb: ICMP6, destination unreachable, unreachable port, lax17s15-in-x0e.1e100.net udp port 33475, length 88
07:18:40.395654 IP6 lax17s15-in-x0e.1e100.net > 2607:f130:0:f0::5eb: ICMP6, destination unreachable, unreachable port, lax17s15-in-x0e.1e100.net udp port 33476, length 88
07:18:41.718662 IP6 fe80::304b:ddd0:e99e:7fea > ff02::1:ffb3:a800: ICMP6, neighbor solicitation, who has fe80::217:dfff:feb3:a800, length 32
07:18:42.509860 IP6 fe80::217:dfff:feb3:a800 > fe80::216:3eff:fea3:3eb8: ICMP6, neighbor advertisement, tgt is fe80::217:dfff:feb3:a800, length 24
07:18:43.697669 IP6 fe80::217:dfff:feb3:a800 > fe80::216:3eff:fee1:fe91: ICMP6, neighbor advertisement, tgt is fe80::217:dfff:feb3:a800, length 24
07:18:45.336231 IP6 2607:f130:0:d7::dbd > ff02::1:ff00:1: ICMP6, neighbor solicitation, who has 2607:f130:0:d7::1, length 32
07:18:46.345728 IP6 2607:f130:0:d7::dbd > ff02::1:ff00:1: ICMP6, neighbor solicitation, who has 2607:f130:0:d7::1, length 32
07:18:47.369684 IP6 2607:f130:0:d7::dbd > ff02::1:ff00:1: ICMP6, neighbor solicitation, who has 2607:f130:0:d7::1, length 32
ValentinBELYN commented 3 years ago

Strange... I have looked at the tcpdumps overall and they look correct. Do you have a firewall activated on your computer?

Can you run the following Python script and give me the result?

from icmplib import PID, ICMPv6Socket, ICMPRequest, ICMPLibError

sock = ICMPv6Socket()

for i in range(1, 15):
    request = ICMPRequest(
        destination='2607:f8b0:4007:80c::200e',
        id=PID,
        sequence=i,
        ttl=i)

    try:
        print(f'[{i}] Request: {str(request.__dict__)}')
        sock.send(request)
        reply = sock.receive(request)
        print(f'[{i}] Reply: {str(reply.__dict__)}')

    except ICMPLibError as err:
        print(err)

sock.close()

Finally, can you provide me with the pcap file created by tcpdump when you run the script? Thanks!

KiritoMiao commented 3 years ago

Hello, I have tested on some machines and the pcap/log is attached in the zip file

Data.zip

ValentinBELYN commented 3 years ago

Hi @KiritoMiao 👋 Happy New Year!

Sorry for the delay. I'm quite busy now. I have analyzed your files and it looks like the socket is failing to get the ICMPv6 error messages used for the traceroute function. However, in your tcpdump captures, we can see these messages. I don't know yet if this is a kernel limitation or not.

I need some time to do my research and testing.

ValentinBELYN commented 3 years ago

Good news! I have found the cause of the problem and I will release a fix this weekend.

This is a problem related to the IPv6 header which is badly handled when the message is not an ICMP Echo Reply.

ValentinBELYN commented 3 years ago

I just released icmplib 2.0.2 which should definitely fix your problem. Can you test?