• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

COPYINGH A D29-Oct-200317.6 KiB341281

Makefile.linuxH A D29-Oct-2003305 159

Makefile.rawsocketH A D03-May-2022330 159

READMEH A D29-Oct-20032.1 KiB6542

README.freebsdH A D29-Oct-20031.6 KiB4234

findmtu-linux.cH A D29-Oct-20032.5 KiB10573

findmtu-rawsocket.cH A D29-Oct-20034.4 KiB158108

findmtu.cH A D29-Oct-20034 KiB148114

findmtu.hH A D29-Oct-20031.1 KiB6648

README

1                             FindMTU v0.9
2
3Introduction
4
5FindMTU is a tool that performs IPv6 path MTU discovery. You can use it
6to debug network problems and to detect IPv6-in-IPv4 tunnels in the path
7to a destination.
8
9FindMTU only performs IPv6 path MTU discovery. It does not know about
10IPv4.
11
12
13Supported platforms
14
15FindMTU has been tested on Linux 2.2 and 2.4 and on FreeBSD 4.6. Under
16Linux, it uses Linux-specific interfaces to obtain socket error messages
17as a normal user. Under FreeBSD, it uses raw sockets and must be run as
18root. The raw sockets mode should run under other operating systems as
19well, but this has not been tested.
20
21NOTE: if you are planning to use FindMTU on FreeBSD, you must be aware
22that FreeBSD (some versions at least) stores path MTU information in
23cloned host routes that never expire, so you will see only get valid
24results the first time you run FindMTU on a particular host, and all
25subsequent invocations will return no information. To work around this,
26delete the cloned host route before running FindMTU: see the file
27README.freebsd for an example.
28
29
30Compilation
31
32To compile FindMTU, select the appropriate makefile (Makefile.linux
33under Linux, Makefile.rawsocket otherwise), rename or symlink it to
34Makefile, and type make.
35
36
37Usage
38
39To use FindMTU, just run:
40
41./findmtu <hostname>
42or
43./findmtu <IPv6 address>
44
45(Note that if you are not using Linux, you must be root.)
46
47FindMTU outputs a single line. The first number is the path MTU to the
48destination; the brackets provide details on what packets it received.
49This includes both Packet Too Big errors (an IPv6 address followed by
50the MTU) and other ICMP errors (an IPv6 address followed by a brief
51description of the error; "reached" indicates the destination was
52reached and replied with a port unreachable error).
53
54
55Credits
56
57FindMTU was written by Lorenzo Colitti <lorenzo@colitti.com>. Most of
58the Linux code was lifted from Alexey Kuznetsov's tracepath6. Thanks
59to Mark Santcroos <marks@ripe.net> for helping with the raw sockets.
60
61
62License
63
64FindMTU is distributed under the GPL. See the file COPYING for details.
65

README.freebsd

1                             FindMTU v0.9
2
3Using FindMTU on FreeBSD
4
5Some (all?) versions of FreeBSD store path MTU information by setting
6up a cloned host route for every destination the kernel sends packets
7to. This route is then used to cache path MTU information for the
8destination host. Unfortunately, at least in FreeBSD 4.6, which is the
9version we tested on, these cloned routes never expire (except after
10a reboot, presumably).
11
12This means that FindMTU will output valid results only the first time
13it is run on a particular host, and all subsequent invocations will
14return no information. The problem is componded by the fact that
15there is no interface I know of to tell the kernel not to fragment an
16IPv6 packet, so large packets will simply get fragmented by the kernel
17when FindMTU attempts to send them. So FindMTU will receive no Packet
18Too Big messages and wrongly presume that the MTU is the default value
19of 1500.
20
21Example:
22
23# ./bin/findmtu 2001:760::6
241460 (2001:798:20:200::2 1480, 2001:798:20:200::2 1460, 2001:760::6 reached)
25# ./bin/findmtu 2001:760::6
261500 (2001:760::6 reached)
27#
28
29To work around this, the cloned host route must be deleted. FindMTU
30could do this itself by opening a routing socket, but currently it
31doesn't, so you have to do it by hand. Something like this will do
32fine:
33
34	# Check there is no explicit route to the destination
35	if netstat -rn -f inet6 | grep -qv $1; then
36		# Delete host route. As it is not in the routing table,
37		# we are sure that it is a cloned route and can be deleted
38		# safely
39		route delete -inet6 $i > /dev/null 2> /dev/null
40	fi
41	./findmtu $1
42