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