9030ab4c0d29889e278841eccc28ca58a2c67436
[public-tsp] / pubtsp.man
1 .TH PUBTSP 8 "December 12, 2010"
2 .\" Please adjust this date whenever revising the manpage.
3 .\"
4 .\" Some roff macros, for reference:
5 .\" .nh        disable hyphenation
6 .\" .hy        enable hyphenation
7 .\" .ad l      left justify
8 .\" .ad b      justify to both left and right margins
9 .\" .nf        disable filling
10 .\" .fi        enable filling
11 .\" .br        insert line break
12 .\" .sp <n>    insert n+1 empty lines
13 .\" for manpage-specific macros, see man(7)
14 .SH NAME
15 pubtsp \- server-side daemon for public TSP service
16 .SH SYNOPSYS
17 .B pubtsp
18 [\fB\-t\fR \fI/dev/tunX\fR] \fB\-l\fR \fIv4addr\fR \fB\-L\fR \fIv6prefix/64\fR
19 .PP
20 .B pubtsp
21 \fB\-h\fR
22 .SH DESCRIPTION
23 .PP
24 Through a \fBpubTSP\fR daemon, it is possible to make an IPv6 range of
25 addresses available to IPv4-only users.  This means that even an IPv4-only
26 network can host IPv6-only applications, as long as they can fall back on
27 a tunnel based on this profile.
28 .PP
29 TSP, or the Tunnel Setup Protocol, is documented in RFC 5722.  It defines
30 several methods for encapsulating IPv6 traffic in IPv4 packets.  It also
31 defines SASL as its generic authentication layer.
32 .PP
33 This daemon implements a specific profile for the server side of TSP.
34 The profile of RFC 5722 implemented by this daemon supports NAT traversal
35 for public use.  The purpose of this profile is to provide a fallback
36 mode to IPv6-only devices running on an IPv4-only network; the idea is
37 to make such a fallback possible without needing to configure a tunnel.
38 .PP
39 The NAT traversing aspect of this profile is needed to support the normal
40 openness of IPv6 connections.  This is achieved by packing IPv6 into UDP
41 and then into IPv4.  This is a guaranteed manner of traversing NAT,
42 provided that this daemon listens to a public IPv4 address.  The daemon
43 currently does not support any other modes of operation.
44 .PP
45 The public-use aspect of this profile means that there is no requirement for
46 clients to register.  In terms of SASL, this uses the ANONYMOUS method of
47 authentication.  However, this does not mean that the use of \fBpubTSP\fR
48 makes it possible to browse IPv6 networks anonymously; in order to
49 ensure traceability of abusive behaviour, the IPv4 address and UDP port
50 of the tunnel client are mentioned in the IPv6 address.  See ADDRESS FORMAT
51 below for details, and SECURITY CHECKS for further precautions against abuse.
52 .PP
53 The foreseen application of servers under this profile of TSP are
54 IPv6-only services that are accessed from an IPv4-only network.  The pivotal
55 point of defining IPv6-only service can be simplicity, or making IPv6
56 more efficient and/or more useful.  To avoid making IPv6 a breaking
57 requirement, clients for such an IPv6-only service could implement this
58 profile of TSP to provide a simple backward-compatible mode for IPv4-only
59 network nodes, without impairing all advantages of being IPv6-only.
60 .PP
61 This daemon is in fact a stateless translation between an IPv4 client
62 and the general IPv6 world; the interactions defined by TSP are all
63 handled as required by RFC 5722, but some are strictly speaking not
64 required for \fBpubTSP\fR.  We emphesise that their specification should still
65 be met in all clients, so as to avoid dependency on this one
66 implementation of TSP, and/or its current version.
67 .PP
68 The implementation listens to a UDP socket on TSP standard port 3653
69 on the IPv4 side, and to a
70 tunnel endpoint to capture all traffic matching an IPv6 prefix.
71 It basically tosses traffic back and forth between these interfaces,
72 but not without performing the SECURITY CHECKS desribed below
73 on what is tossed at it.
74 .SH OPTIONS
75 .TP
76 \fB\-t\fR \fI/dev/tunX\fR
77 .TP
78 \fB\-\-tundev\fR \fI/dev/tunX\fR
79 Instead of creating a tunnel for the duration that \fBpubTSP\fR runs,
80 use one that already exists and that has already been setup with
81 the proper IPv6 prefix.  This option makes it possible for
82 non-root users to run \fBpubTSP\fR.  All that is required is acccess to
83 the tunnel device by the user that runs \fBpubTSP\fR.  Optional on Linux.
84 .TP
85 \fB\-l\fR \fIv4addr\fR
86 .TP
87 \fB\-\-v4listen\fR \fIv4addr\fR
88 Bind to the given local IPv4 address and listen for incoming TSP
89 tunnel commands and packaged-IPv6 traffic.  Required.
90 .TP
91 \fB\-L\fR \fIv6prefix/64\fR
92 .TP
93 \fB\-\-v6prefix\fR \fIv6prefix/64\fR
94 Bind to the given IPv6 address range through a tunnel device, and
95 forward incoming IPv6 messages to IPv4-based UDP tunnel endpoints.
96 See ADDRESS FORMAT below for an explanation of the lower half of
97 the IPv6 addresses.  Required.
98 .IP
99 If no \fB\-t\fR option is given, a tunnel will be created for the time that
100 \fBpubTSP\fR is running, and the \fIv6prefix/64\fR is used as a router address
101 on that interface.  Routing table entries will not be setup by \fBpublicTSP\fR,
102 nor will the general ablity to forward IPv6 traffic.
103 .TP
104 \fB\-h\fR
105 .TP
106 \fB\-\-help\fR
107 Print usage information and exit.
108 .SH ADDRESS FORMAT
109 .PP
110 An IPv6 address used from \fBpubTSP\fR reveals the IPv4 address and UDP port
111 used by the tunnel endpoint.  This format is checked on sending from
112 the IPv4 tunnel to IPv6, and used to reconstruct the IPv4 tunnel access
113 information for traffic from IPv6 to the IPv4 tunnel.
114 .PP
115 The format of the IPv6 addresses managed by \fBpubTSP\fR are:
116 .PP
117 \fIv6prefix\fR + \fIv4addr\fR + \fIudp-port\fR + \fIlocalnet\fR
118 .PP
119 In this format, the \fIv6prefix\fR is configured with the \fB\-L\fR option,
120 and the \fIv4addr\fR with the \fB\-l\fR option.  The \fIudp-port\fR is noted on
121 arrival of a packet on the IPv4 tunnel side of \fBpubTSP\fR.
122 .PP
123 The \fIlocalnet\fR defaults to 0, but may be used to differentiate up to
124 65,536 different hosts accessible through the same TSP client.  As
125 the main application foreseen for \fBpubTSP\fR is to get IPv6-only tools and
126 devices working on an IPv4-only network, this is not a probable setup,
127 but it is nevertheless possible.  The current version of \fBpubTSP\fR does
128 not actually hand this over as a subnet.
129 .PP
130 The router address that \fBpubTSP\fR chooses for itself consists of the
131 \fIv6prefix\fR with zeroes appended; this falls outside the setup above,
132 because neither IPv4 addresses nor UDP port numbers are not permitted
133 te be zero-valued.
134 .PP
135 Incoming IPv6 traffic destined for a serviced address is first checked
136 as specified under SECURITY CHECKS, and then forwarded to \fIudp-port\fR at
137 \fIv4addr\fR.  In doing so, the IPv6 packet is embedded in whole inside
138 the UDP packet.  The IPv6 addresses are not altered, but only used
139 to derive IPv4 contact information.
140 .PP
141 Outgoing IPv6 traffic arriving on the IPv4 tunnel side of \fBpubTSP\fR will
142 be checked to have been sent from the right \fIv6prefix\fR and mention
143 the \fIv4addr\fR and \fIudp-port\fR matching the client's public side.  That
144 is, NAT may translate the IPv4 address and UDP port used, but these
145 parts of the IPv6 address should show how it is forwarded to \fBpubTSP\fR.
146 Note that the TSP protocol provides this necessary information at the
147 time the TSP tunnel is created.
148 .PP
149 It is recommended to keep NAT state in tact by regularly sending over
150 the UDP port to the tunnel endpoint.  At the very least, a regular
151 ping could do that.  Alternatively, a client-mode only daemon could
152 ensure that it is sending regularly during the times that an outside
153 party might wish to send to it.  This is under the assumption that no
154 explicit mapping in NAT overtakes this responsibility of an active
155 mapping between the internal and external address space.
156 .SH SECURITY CHECKS
157 .PP
158 Not everything will be passed through \fBpubTSP\fR, even if this would be
159 technically possible.  A few security checks are applied to silently
160 drop traffic that looks evil.
161 .PP
162 Packets should be long enough to at least contain the IPv6 traffic
163 and a minimal payload size.  Also, it should not exceed a predefined
164 MTU of 1280 bytes for IPv6.
165 .PP
166 IPv6 traffic uploaded through the IPv4 side should reveal the proper
167 IPv4 settings in the IPv6 source address, as specified under
168 ADDRESS FORMAT above.  This is basically the tunnel aspect of egress
169 filtering.
170 .PP
171 Tunnel commands should adhere to the format of RFC 5722 and may not
172 contain any NUL characters.
173 .SH BUGS
174 Currently, \fBpubTSP\fR does not use ICMP notifications at the IPv4
175 level to provide smart feedback to an IPv6 client.  It is undecided
176 at this point if this would add value.
177 .PP
178 To be able to fallback to this TSP profile, an IPv6-only application
179 needs to find a \fBpubTSP\fR or similar service.  A general naming
180 or numbering scheme is needed to make that straightforward.  The
181 \fBpubTSP\fR service could be setup privately and configured in
182 individual IPv6-only nodes, but it could accelerate the introduction
183 of IPv6-only nodes if this were organised by network providers.
184 .PP
185 Ideally, \fBpubTSP\fR would be near all heavily connected nodes
186 of the Internet.  There, they would improve connectivity without
187 being a detour for the traffic.  Alternatively, it would be located
188 in various uplinks.  To optimise routing, it is possible to assign
189 a fixed IPv4 address and IPv6 prefix for \fBpubTSP\fR running
190 anywhere; its stateless operation means that traffic going back and
191 forth can go through different instances of \fBpubTSP\fR without
192 posing problems.
193 .PP
194 The \fBpubTSP\fR daemon is a piece of highly efficient code,
195 and it should be able to handle very high bandwidths.  A stress
196 test has not been conducted yet.
197 .SH LICENSE
198 Released under a BSD-style license without advertisement clause.
199 .SH SEE ALSO
200 The 0cpm project is an example of an IPv6-only SIP application
201 that can use \fBpubTSP\fR and comparable TSP tunnel services to
202 demonstrate the advantages of IPv6 to end users.  It is also
203 a typical example of a transitionary need for something like
204 \fBpubTSP\fR.
205 .PP
206 http://0cpm.org/ \- the homepage of the 0cpm project.
207 .PP
208 http://devel.0cpm.org/pubtsp \- the homepage of \fBpubTSP\fR.
209 .PP
210 RFC 5722 \- the authoritative description of TSP, of which \fBpubTSP\fR is
211 implements a specific profile for public service under NAT traversal.
212 .SH AUTHOR
213 \fBpubTSP\fR was written by Rick van Rein from OpenFortress.
214 It was created to support the 0cpm project.