What is ashunt?
///////////////

ashunt is an Autonomous System (AS) trace route utility. The idea behind
ashunt was that unlike traceroute or tcptraceroute it should not only
display hops, but also their AS numbers they belong to as well as physical
locations and other useful information.

Have a short look at an example output of ashunt. We're doing an AS trace
route to baidu.com (note: hop 1 till 6 have been removed):

# ashunt -i eth0 -N -E -S -H baidu.com
ashunt 0.5.6
AS path IPv4 TCP trace from *.*.*.* to 220.181.111.86:80 (baidu.com) with
len 40 Bytes, 30 max hops
Using flags SYN:1,ACK:0,ECN:1,FIN:0,PSH:0,RST:0,URG:0
<--hop 1-6 removed-->
 7: swiIX2-10GE-3-1.switch.ch (130.59.36.250) in AS559 (CH, Switzerland,
    N/A, 47.000000, 8.000000), 130.59.0.0/16 ripencc (1993-09-22),
    SWITCH SWITCH, Swiss Education and Research Network
 8: * * * i79tix-025-ten9-1.bb.ip-plus.net (193.5.122.18) in ASNA (CH,
    Switzerland, N/A, 47.000000, 8.000000), NA ripencc (1997-05-26), NA
 9: i79zhb-025-ten0-9-0-4.bb.ip-plus.net (138.187.129.81) in AS3303 (EU,
    Switzerland, N/A, 47.000000, 8.000000), 138.187.128.0/18 ripencc
    (1990-05-18), SWISSCOM Swisscom (Switzerland) Ltd
10: * * * i00lon-015-ten4-2.bb.ip-plus.net (138.187.129.194) in AS3303
    (EU, Switzerland, N/A, 47.000000, 8.000000), 138.187.128.0/18 ripencc
    (1990-05-18), SWISSCOM Swisscom (Switzerland) Ltd
11: 195.66.225.54 (195.66.225.54) in AS10310 (GB, United Kingdom, N/A,
    54.000000, -2.000000), 195.66.224.0/23 ripencc (1997-12-01),
    YAHOO-1 - Yahoo!
12: 202.97.52.101 (202.97.52.101) in AS4134 (CN, China, N/A, 35.000000,
    105.000000), 202.97.32.0/19 apnic (1998-08-17), CHINANET-BACKBONE
    No.31,Jin-rong Street
13: 202.97.60.6 (202.97.60.6) in AS4134 (CN, China, N/A, 35.000000,
    105.000000), 202.97.32.0/19 apnic (1998-08-17), CHINANET-BACKBONE
    No.31,Jin-rong Street
14: 202.97.53.221 (202.97.53.221) in AS4134 (CN, China, N/A, 35.000000,
    105.000000), 202.97.32.0/19 apnic (1998-08-17), CHINANET-BACKBONE
    No.31,Jin-rong Street
15: 202.97.53.33 (202.97.53.33) in AS4134 (CN, China, N/A, 35.000000,
    105.000000), 202.97.32.0/19 apnic (1998-08-17), CHINANET-BACKBONE
    No.31,Jin-rong Street
16: 220.181.0.42 (220.181.0.42) in AS23724 (CN, China, Beijing, 39.928902,
    116.388298), 220.181.0.0/19 apnic (2002-10-30), CHINANET-IDC-BJ-AP IDC,
    China Telecommunications Corporation
17: 220.181.0.66 (220.181.0.66) in AS23724 (CN, China, Beijing, 39.928902,
    116.388298), 220.181.0.0/19 apnic (2002-10-30), CHINANET-IDC-BJ-AP IDC,
    China Telecommunications Corporation
18: 220.181.17.146 (220.181.17.146) in AS23724 (CN, China, Beijing,
    39.928902, 116.388298), 220.181.0.0/19 apnic (2002-10-30),
    CHINANET-IDC-BJ-AP IDC, China Telecommunications Corporation
19: * * * * * ^C
#

In our case, on default, ashunt tries to perform a TCP SYN connection
establishment with a TTL number that corresponds to the wanted hop. If ashunt
does not receive a ICMP type 11 reply ('time to live exceeded in transit',
RFC792) after 3 tries (default), then it falls back to an ICMP echo request
with a specified TTL value for this hop. This behaviour can, for instance,
be observed in hop 8 and 10.

ashunt prints out the following information in this example:
 - Reverse DNS name of hop
 - IP address of hop
 - AS number
 - Country code of hop
 - Country name of hop
 - City name of hop
 - Approximate latitude and longitude values of hop
 - Network prefix of AS
 - Registry name of AS
 - AS registered since
 - Name of AS

Note that ashunt does not stop automatically if the last hop has been reached
since there is no generic possibility to determine this with an arbitrarily
assembled TCP packet that does not necessarily have the SYN flag set.

With ashunt, you can also specify a bunch of other information that shall be
encoded into the probe packet. Next to IP and TCP fields, you can also tell
ashunt to encode an ASCII string into the packets payload. This can be done
with the command line option --payload <string>. Thus, if you enable
--show-packet which prints out the returned packet, you can possibly determine
if the AS/ISP tries to censor certain packet probes with 'critical' words in it.
