.B "rebuild"
.br
.B "clean"
+.br
+.BR "mtu " [ \fIpath-mtu ]
.
.\"--------------------------------------------------------------------------
.SH "DESCRIPTION"
and their associated
.B .old
files.
+.TP
+.BR "mtu " [ \fIpath-mtu ]
+Write, as a decimal number on standard output, the recommended MTU for a
+TrIPE tunnel interface, given that the
+.I path-mtu
+between two peers is as specified. The default is 1500, which is very
+commonly correct, but you should check using a tool such as
+.BR tracepath (8).
+Getting the MTU too big will lead to unnecessary fragmentation of
+TrIPE's UDP datagrams; getting it too small will fail to utilize the
+underlying network effectively. If in doubt, it's therefore better to
+underestimate.
.
.\"--------------------------------------------------------------------------
.SH "SEE ALSO"
r == 'keyring' or r == 'keyring.pub' or r.startswith('peer-')):
zap(i)
+###--------------------------------------------------------------------------
+### Commands: mtu
+
+def cmd_mtu(args):
+ mtu, = (lambda mtu = '1500': (mtu,))(*args)
+ mtu = int(mtu)
+
+ blksz = C.gcciphers[conf['cipher']].blksz
+
+ index = conf['mac'].find('/')
+ if index == -1:
+ tagsz = C.gcmacs[conf['mac']].tagsz
+ else:
+ tagsz = int(conf['mac'][index + 1:])/8
+
+ mtu -= 20 # Minimum IP header
+ mtu -= 8 # UDP header
+ mtu -= 1 # TrIPE packet type octet
+ mtu -= tagsz # MAC tag
+ mtu -= 4 # Sequence number
+ mtu -= blksz # Initialization vector
+
+ print mtu
+
###--------------------------------------------------------------------------
### Main driver.
'upload': (cmd_upload, 0, 0, ''),
'update': (cmd_update, 0, 0, ''),
'clean': (cmd_clean, 0, 0, ''),
+ 'mtu': (cmd_mtu, 0, 1, '[PATH-MTU]'),
'generate': (cmd_generate, 1, 1, 'TAG'),
'rebuild': (cmd_rebuild, 0, 0, '')}