Go Traceroute library

Related tags

Network traceroute
Overview

Traceroute in Go

A traceroute library written in Go.

Must be run as sudo on OS X (and others)?

CLI App

go build cmd/gotraceroute
sudo ./gotraceroute example.com

Library

See the code in cmd/gotraceroute.go for an example of how to use the library from within your application.

The traceroute.Traceroute() function accepts a domain name and an options struct and returns a TracerouteResult struct that holds an array of TracerouteHop structs.

Resources

Useful resources:

Notes

Issues
  • question for you...

    question for you...

    In my company we have to do a lot of end to end testing to make sure that the packets can get from point A to point B -- and many times there is a firewall blocking. I wrote a tool to check the connectivity in Go that will ping the endpoint on a given port, and respond back if the port is open, closed or if it times out. Usually if it times out I'll consider it to be blocked by a firewall. Then we have to traceroute to find out where the packet gets blocked. I am not sure if there is a way to tell from a packet what device that packet timed out on. It would be nice for my tool to return that the packet was blocked, and on what device that packet was blocked by.

    Thanks!!

    Richard M.

    opened by rmasci 1
  • Implement first hop option

    Implement first hop option

    traceroute should offer the possibilty to set the first hop that should be used. This is done by setting the ttl to a given value before starting the loop.

    opened by skyfmmf 1
  • multiple users on one machine , or any icmp requests to host creates false positives

    multiple users on one machine , or any icmp requests to host creates false positives

    Repro: run ping to any host,

    [email protected]:~$ ping bn6-0100-0002-01sw
    PING bn6-0100-0002-01sw.aznet.gbl (25.184.112.234) 56(84) bytes of data.
    64 bytes from BN6-0100-0002-01SW.aznet.gbl (25.184.112.234): icmp_seq=1 ttl=48 time=62.2 ms
    64 bytes from BN6-0100-0002-01SW.aznet.gbl (25.184.112.234): icmp_seq=2 ttl=48 time=62.2 ms
    64 bytes from BN6-0100-0002-01SW.aznet.gbl (25.184.112.234): icmp_seq=3 ttl=48 time=62.2 ms
    64 bytes from BN6-0100-0002-01SW.aznet.gbl (25.184.112.234): icmp_seq=4 ttl=48 time=62.2 ms
    
    

    while ping is going run traceroute to any other host you will see entries of icmp requests from the ping to the initial host.

    traceroute to ibr02.mwh01 (25.184.240.242), 65 hops max, 52 byte packets
    1   MWH03-0101-0304-04T0-lo.aznet.gbl. (25.101.225.21)  550.236µs
    2   MWH03-0101-0304-15T1-lo.aznet.gbl. (25.101.224.224)  562.237µs
    3   MWH03-0101-0100-01T2-lo.aznet.gbl. (25.101.224.0)  551.736µs
    4   MWH01-0100-0200-08RHW-lo.aznet.gbl. (10.244.23.41)  498.233µs
    5   MWH01-0100-0100-02RA-lo.aznet.gbl. (10.244.23.1)  464.931µs
    6   25.75.128.68 (25.75.128.68)  770.45µs
    7   be-142-0.ibr03.mwh01.ntwk.msn.net. (104.44.21.163)  1.565803ms
    8   ae141-0.icr01.mwh01.ntwk.msn.net. (104.44.21.156)  6.031596ms
    9   MWH01-0100-0100-02MA.aznet.gbl. (25.75.131.15)  773.851µs
    10  MWH01-0100-0103-01M1.aznet.gbl. (25.75.131.7)  1.212879ms
    11  25.184.240.207 (25.184.240.207)  1.016467ms
    12  BN6-0100-0002-01SW.aznet.gbl. (25.184.112.234)  308.874275ms
    13  25.184.240.207 (25.184.240.207)  1.021867ms
    14  25.184.240.207 (25.184.240.207)  1.163577ms
    15  BN6-0100-0002-01SW.aznet.gbl. (25.184.112.234)  35.935159ms
    

    This is due to just blindly looking at icmp requests in the receive socket.

    opened by dbillor 1
  • Can't use on windows

    Can't use on windows

    $ go get github.com/aeden/traceroute/cmd
    # github.com/aeden/traceroute
    ..\..\..\github.com\aeden\traceroute\traceroute.go:185: undefined: syscall.IPPROTO_ICMP
    ..\..\..\github.com\aeden\traceroute\traceroute.go:198: undefined: syscall.SO_RCVTIMEO
    
    opened by NobbZ 2
Owner
Anthony Eden
Founder of DNSimple, vendor of duct tape, purveyor of UDP packets.
Anthony Eden
Traceroute in Go

ztrace Traceroute in Go Motivation Most network engineers need fast traceroute result and correlate it with service provider information and Geo locat

Mie~~~ 63 Jul 31, 2022
Simple traceroute ports in Go

go-traceroute simple traceroute ports in Go. Installation $ go install github.co

Tomochika Hara 2 Dec 27, 2021
A library for the MIGP (Might I Get Pwned) protocolA library for the MIGP (Might I Get Pwned) protocol

MIGP library This contains a library for the MIGP (Might I Get Pwned) protocol. MIGP can be used to build privacy-preserving compromised credential ch

Cloudflare 21 Dec 16, 2021
A library to simplify writing applications using TCP sockets to stream protobuff messages

BuffStreams Streaming Protocol Buffers messages over TCP in Golang What is BuffStreams? BuffStreams is a set of abstraction over TCPConns for streamin

Sean Kelly 249 Aug 1, 2022
DNS library in Go

Alternative (more granular) approach to a DNS library Less is more. Complete and usable DNS library. All Resource Records are supported, including the

Miek Gieben 6.4k Jul 31, 2022
🚀Gev is a lightweight, fast non-blocking TCP network library based on Reactor mode. Support custom protocols to quickly and easily build high-performance servers.

gev 中文 | English gev is a lightweight, fast non-blocking TCP network library based on Reactor mode. Support custom protocols to quickly and easily bui

徐旭 1.4k Jul 29, 2022
Gmqtt is a flexible, high-performance MQTT broker library that fully implements the MQTT protocol V3.1.1 and V5 in golang

中文文档 Gmqtt News: MQTT V5 is now supported. But due to those new features in v5, there area lots of breaking changes. If you have any migration problem

null 709 Aug 5, 2022
golibwireshark - Package use libwireshark library to decode pcap file and analyse dissection data.

golibwireshark Package golibwireshark use libwireshark library to decode pcap file and analyse dissection data. This package can only be used in OS li

Xiaoguang Wang 24 Jul 7, 2022
An SNMP library written in GoLang.

gosnmp GoSNMP is an SNMP client library fully written in Go. It provides Get, GetNext, GetBulk, Walk, BulkWalk, Set and Traps. It supports IPv4 and IP

Go SNMP 870 Jul 27, 2022
A library for working with IP addresses and networks in Go

IPLib I really enjoy Python's ipaddress library and Ruby's ipaddr, I think you can write a lot of neat software if some of the little problems around

Chad Robinson 86 Jul 19, 2022
A Crypto-Secure, Production-Grade Reliable-UDP Library for golang with FEC

Introduction kcp-go is a Production-Grade Reliable-UDP library for golang. This library intents to provide a smooth, resilient, ordered, error-checked

xtaci 3.4k Aug 1, 2022
Simple mDNS client/server library in Golang

mdns Simple mDNS client/server library in Golang. mDNS or Multicast DNS can be used to discover services on the local network without the use of an au

HashiCorp 894 Jul 30, 2022
Pure-Go library for cross-platform local peer discovery using UDP multicast :woman: :repeat: :woman:

peerdiscovery Pure-go library for cross-platform thread-safe local peer discovery using UDP multicast. I needed to use peer discovery for croc and eve

Zack 552 Aug 4, 2022
Go Library to Execute Commands Over SSH at Scale

vSSH Go library to handle tens of thousands SSH connections and execute the command(s) with higher-level API for building network device / server auto

Yahoo 856 Aug 8, 2022
A simple TUN/TAP library written in native Go.

water water is a native Go library for TUN/TAP interfaces. water is designed to be simple and efficient. It wraps almost only syscalls and uses only G

Song Gao 1.5k Jul 27, 2022
Command-line tool and library for Windows remote command execution in Go

WinRM for Go Note: if you're looking for the winrm command-line tool, this has been splitted from this project and is available at winrm-cli This is a

Brice Figureau 369 Jul 19, 2022
Go library for writing standalone Map/Reduce jobs or for use with Hadoop's streaming protocol

dmrgo is a Go library for writing map/reduce jobs. It can be used with Hadoop's streaming protocol, but also includes a standalone map/reduce impleme

Damian Gryski 105 Nov 26, 2021
Glue - Robust Go and Javascript Socket Library (Alternative to Socket.io)

Glue - Robust Go and Javascript Socket Library Glue is a real-time bidirectional socket library. It is a clean, robust and efficient alternative to so

DesertBit 402 May 25, 2022