Mtr

ASN lookup patch for MTR

Bug #701514 reported by rew
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mtr
Fix Released
Undecided
Unassigned

Bug Description

Found this on the internet, could you please include it in a next release of
MTR?

http://www.roderick.triple-it.nl/blog/2010/12/29/mtr-with-aslookup/

With kind regards,
Michiel Klaver

Revision history for this message
Oliver Haake (oliver-haake) wrote :

That would be a nice feature. Anybody got that patch working?

I got some errors on the first try:

/usr/src/mtr-0.80-asnpatch# make
make all-recursive
make[1]: Betrete Verzeichnis '/usr/src/mtr-0.80-asnpatch'
Making all in img
make[2]: Betrete Verzeichnis '/usr/src/mtr-0.80-asnpatch/img'
make[2]: Für das Ziel »all« ist nichts zu tun.
make[2]: Verlasse Verzeichnis '/usr/src/mtr-0.80-asnpatch/img'
make[2]: Betrete Verzeichnis '/usr/src/mtr-0.80-asnpatch'
if gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -g -O2 -Wall -Wno-pointer-sign -MT mtr.o -MD -MP -MF ".deps/mtr.Tpo" -c -o mtr.o mtr.c; \
 then mv -f ".deps/mtr.Tpo" ".deps/mtr.Po"; else rm -f ".deps/mtr.Tpo"; exit 1; fi
In file included from mtr.c:37:
asn.h:19:18: error: glib.h: Datei oder Verzeichnis nicht gefunden
In file included from mtr.c:37:
asn.h:25: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
make[2]: *** [mtr.o] Fehler 1
make[2]: Verlasse Verzeichnis '/usr/src/mtr-0.80-asnpatch'
make[1]: *** [all-recursive] Fehler 1
make[1]: Verlasse Verzeichnis '/usr/src/mtr-0.80-asnpatch'
make: *** [all] Fehler 2

After an "apt-get install libglib2.0-dev" it compiled without problems, but the feature does not work.

Revision history for this message
Oliver Haake (oliver-haake) wrote :

Actually, this patch works in the normal mode but not in the report-mode. I didn't realize that ncurses-dev was missing on my machine and mtr could only work in report-mode.

IPv6 seems also to be broken:

 Host Loss% Snt Last Avg Best Wrst StDev
 2. [AS2686] 2001:4d08:8972:8000::8 0.0% 51 4.5 9.1 3.7 82.6 16.3
 3. [AS2686] 2001:4d08:8972:8000:: 0.0% 51 4.0 5.3 3.9 42.6 5.8
 4. [AS2686] te3-1.c101.f.de.plusline.net 0.0% 50 5.8 8.9 4.6 156.2 21.3
 5. [AS4760] te6-1.c13.f.de.plusline.net 0.0% 50 6.8 18.6 4.8 173.3 35.4
 6. [AS4760] redirector.heise.de 0.0% 50 5.1 5.2 4.4 7.6 0.7

AS2686 and AS4760 are completely wrong.

The website of the author seems to be down.
Ronny has slightly modified the patch to be able to patch it against 0.82 and posted it on his blog ( http://blog.boesger.de/2012/07/10/asn-mtr-0-82-patch/ )
I've also attached the patch.

rew (r-e-wolff)
Changed in mtr:
status: New → Fix Committed
rew (r-e-wolff)
Changed in mtr:
status: Fix Committed → Fix Released
Revision history for this message
yvs (lrou2014) wrote :

> Actually, this patch works in the normal mode but not in the report-mode.

> IPv6 seems also to be broken

Hi,
I had modified the asn-lookup code against git:9bc6dc50 (current) to be able to work in report mode and add ipv6 support.

mtr -6tw -y0 -c50 2a02:2e0:3fe:100::8
HOST: htpc Loss% Snt Last Avg Best Wrst StDev
  1. AS1103 2002:1f2b:8229:c:9586:95f1:d6dc:14c5 0.0% 50 0.9 0.9 0.6 1.8 0.0
  2. AS9002 GW-NetAssist.retn.net 14.0% 50 51.7 58.1 51.0 140.4 18.8
  3. AS??? msk-ix.ge1.q9.netassist.ua 0.0% 50 98.9 104.4 84.0 192.9 23.8
  4. AS6695 te3-1.c101.f.de.plusline.net 2.0% 50 31.2 38.6 31.2 100.5 15.6
  5. AS12306 te6-1.c13.f.de.plusline.net 0.0% 50 31.7 83.3 31.3 319.8 75.4
  6. AS12306 redirector.heise.de 2.0% 50 46.8 37.1 30.7 138.3 17.7

mtr -6twn -y1 -c50 2a02:2e0:3fe:100::8
HOST: htpc Loss% Snt Last Avg Best Wrst StDev
  1. 2002::/16 2002:1f2b:8229:c:9586:95f1:d6dc:14c5 0.0% 50 0.8 0.9 0.6 1.7 0.0
  2. 2a02:2d8::/32 2a02:2d8:0:2801:232a::1 10.0% 50 51.5 57.9 50.8 109.1 15.7
  3. ??? 2001:7f8:20:102::246:155 2.0% 50 96.3 99.4 77.2 177.2 18.1
  4. 2001:7f8::/48 2001:7f8::3012:0:1 0.0% 50 31.7 46.3 31.1 214.1 40.2
  5. 2a02:2e0::/32 2a02:2e0:1::1e 0.0% 50 109.1 53.7 31.1 178.9 35.6
  6. 2a02:2e0::/32 2a02:2e0:3fe:100::8 0.0% 50 32.6 38.9 30.7 122.2 20.1

mtr -6tw -y2 -c50 2a02:2e0:3fe:100::8
HOST: htpc Loss% Snt Last Avg Best Wrst StDev
  1. US 2002:1f2b:8229:c:9586:95f1:d6dc:14c5 0.0% 50 1.0 1.0 0.6 1.8 0.0
  2. GB GW-NetAssist.retn.net 6.0% 50 53.8 55.6 51.0 107.9 12.5
  3. ??? msk-ix.ge1.q9.netassist.ua 2.0% 50 92.1 97.2 84.5 179.4 13.9
  4. DE te3-1.c101.f.de.plusline.net 2.0% 50 31.9 50.9 31.2 247.9 39.2
  5. DE te6-1.c13.f.de.plusline.net 0.0% 50 109.7 55.7 30.9 212.2 45.2
  6. DE redirector.heise.de 0.0% 50 30.7 36.9 30.7 108.1 14.1

Note:
Please read "SPECIAL NOTICE" section http://www.team-cymru.org/Services/ip-to-asn.html

Revision history for this message
yvs (lrou2014) wrote :

patch #2: fixed memory leak and typo, added debug code, code cleanup

Revision history for this message
yvs (lrou2014) wrote :
Download full text (3.6 KiB)

I had updated the asn/ipinfo code against git:03f3da5c (current):

1) now `y' and `z' keys work when MTR is started without `y' or `z' option
  (for example: run mtr in std mode, press `y' key ...)

2) `y/ipinfo' option can accept multiple values

  syntax: -y/--ipinfo no[,no...]

  example:
mtr -4tw -f10 -c1 -y3,1 www.u-tokyo.ac.jp
Start: Mon Apr 29 11:20:28 2013
HOST: sat Loss% Snt Last Avg Best Wrst StDev
 10. ripencc 195.34.32.0/19 sd-cr01-te2-1.nyc.stream-internet.net 0.0% 1 227.8 227.8 227.8 227.8 0.0
 11. arin 198.32.160.0/24 NYIIX.IIJ.Net 0.0% 1 177.2 177.2 177.2 177.2 0.0
 12. arin 206.132.160.0/20 sjc002bb01.IIJ.Net 0.0% 1 228.4 228.4 228.4 228.4 0.0
 13. arin 206.132.160.0/20 sjc002bf02.IIJ.Net 0.0% 1 225.7 225.7 225.7 225.7 0.0
 14. arin 216.98.96.0/19 tky008bf01.IIJ.Net 0.0% 1 328.2 328.2 328.2 328.2 0.0
 15. apnic 58.138.0.0/17 tky001ip58.IIJ.Net 0.0% 1 338.2 338.2 338.2 338.2 0.0
 16. apnic 210.138.0.0/16 210.138.107.30 0.0% 1 344.6 344.6 344.6 344.6 0.0
 17. ??? ??? ??? 100.0 1 0.0 0.0 0.0 0.0 0.0
 18. apnic 157.17.0.0/16 tkgrt1b-wrt1s.bb.sakura.ad.jp 0.0% 1 329.9 329.9 329.9 329.9 0.0
 19. apnic 157.17.0.0/16 tkgrt4c-grt1b.bb.sakura.ad.jp 0.0% 1 333.7 333.7 333.7 333.7 0.0
 20. apnic 59.106.0.0/17 59.106.9.254 0.0% 1 334.9 334.9 334.9 334.9 0.0
 21. apnic 59.106.128.0/18 IP-59-106-161-2.adm.u-tokyo.ac.jp 0.0% 1 338.6 338.6 338.6 338.6 0.0
 22. apnic 59.106.128.0/18 59.106.161.26 0.0% 1 337.9 337.9 337.9 337.9 0.0

3) origin selector

  default - cymru.com (both IPv4 and IPv6): ASN [ASN ...] | Route | CC | Registry | Allocated
  -1 - routeviews.org (IPv4 only): ASN
  -2 - spameatingmonkey.net (IPv4 only): Route | "AS"ASN | Organization | Allocated | CC

  syntax: -y/--ipinfo [-orig,]no[,no...]

  example:
mtr -4tw -y'-2,4,1,2' google.com
Start: Mon Apr 29 11:13:14 2013
HOST: sat Loss% Snt Last Avg Best Wrst StDev
  1. UA AS20833 Atlantis Telecom gi0-1-16.r3.mixnet.ua 0.0% 10 0.5 0.5 0.2 0.7 0.0
  2. ??? ??? ??? icg-40G-gw.ix.net.ua 0.0% 10 1.2 1.4 0.9 1.8 0.0
  3. ??? ??? ??? topnet-ix-2.giganet.ua 0.0% 10 0.8 1.2 0.8 1.8 0.0
  4. UA AS21011 "TOP NET" PJSC te2-0-0.LR01.KBP.L9.topnet.ua 0.0% 10 1.4 2.2 1.1 4.1 0.8
  5. UA AS21011 "TOP NET" PJSC 88.81.240.182 0.0% 10 50.6 51.8 50.5 55.4 1.3
  6. US AS15169 Google Inc. 209.85.242.220 0.0% 10 50.7 55.0 50.6 83.5 10.2
  7. US AS15169 Google Inc. 72.14.239.60 0.0% 10 124.9 135.7 124.9 149.6 ...

Read more...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.