- Forgot to mention ourselves in the tincd manual page! :)
[tinc] / doc / tinc.texi
index 59aec48..1000423 100644 (file)
@@ -12,7 +12,7 @@
 
 This is the info manual for tinc, a Virtual Private Network daemon.
 
-Copyright 1998 Ivo Timmermans <itimmermans@@bigfoot.com>
+Copyright 1998,199,2000 Ivo Timmermans <itimmermans@@bigfoot.com>
 
      Permission is granted to make and distribute verbatim
      copies of this manual provided the copyright notice and
@@ -34,7 +34,7 @@ Copyright 1998 Ivo Timmermans <itimmermans@@bigfoot.com>
 
 @page
 @vskip 0pt plus 1filll
-Copyright @copyright{} 1998 Ivo Timmermans <itimmermans@@bigfoot.com>
+Copyright @copyright{} 1998,1999,2000 Ivo Timmermans <itimmermans@@bigfoot.com>
 
      Permission is granted to make and distribute verbatim
      copies of this manual provided the copyright notice and
@@ -97,11 +97,27 @@ by a few elected computers that participate. This goal is achievable in
 more than just one way.
 
 @cindex private
-For instance, a VPN can consist of a single stand-alone ethernet LAN. Or
-even two computers hooked up using a null-modem cable@footnote{Though
-discuss-able, I think it qualifies as a VPN.}. In these cases, it is
-obvious that the network is @emph{private}. But there is another type
-of VPN, the type tinc was made for.
+Private networks can consist of a single stand-alone ethernet LAN. Or
+even two computers hooked up using a null-modem cable. In these cases,
+it is
+obvious that the network is @emph{private}, noone can access it from the
+outside. But if your computers are linked to the internet, the network
+is not private anymore, unless one uses firewalls to block all private
+traffic. But then, there is no way to send private data to trusted
+computers on the other end of the internet.
+
+@cindex virtual
+This problem can be solved by using @emph{virtual} networks. Virtual
+networks can live on top of other networks, but do not interfere with
+each other. Mostly, virtual networks appear like a singe LAN, even though
+they can span the entire world. But virtual networks can't be secured
+by using firewalls, because the traffic that flows through it has to go
+through the internet, where other people can look at it.
+
+When one introduces encryption, we can form a true VPN. Other people may
+see encrypted traffic, but if they don't know how to decipher it (they
+need to know the key for that), they cannot read the information that flows
+through the VPN. This is what tinc was made for.
 
 @cindex virtual
 tinc uses normal IP datagrams to encapsulate data that goes over the VPN
@@ -383,11 +399,6 @@ Here are all valid variables, listed in alphabetical order:
 
 @c straight from the manpage
 @table @asis
-@item AllowConnect = (yes|no)
-If set to yes, anyone may try to connect to you. If you set this to no,
-no incoming connections will be accepted. This does not affect the
-outgoing connections.
-
 @item ConnectPort = port
 Connect to the upstream host (given with the ConnectTo directive) on
 port port. port may be given in decimal (default), octal (when preceded
@@ -440,6 +451,10 @@ The ethertap device to use. Note that you can only use one device per
 daemon. The info pages of the tinc package contain more information
 about configuring an ethertap device for Linux.
 
+@item VpnMask = mask
+The mask that defines the scope of the entire VPN. This option is not used
+by the tinc daemon itself, but can be used by startup scripts to configure
+the ethertap devices correctly.
 @end table
 
 
@@ -486,6 +501,7 @@ and in /etc/tinc/tinc.conf:
 @example
 TapDevice = /dev/tap0
 MyVirtualIP = 10.1.54.1/16
+VpnMask = 255.0.0.0
 @end example
 
 @subsubheading For B
@@ -502,7 +518,7 @@ and in /etc/tinc/tinc.conf:
 TapDevice = /dev/tap0
 MyVirtualIP = 10.2.1.12/16
 ConnectTo = 1.2.3.4
-AllowConnect = no
+VpnMask = 255.0.0.0
 @end example
 
 Note here that the internal address (on eth0) doesn't have to be the
@@ -523,6 +539,7 @@ and in /etc/tinc/A/tinc.conf:
 MyVirtualIP = 10.3.69.254/16
 ConnectTo = 1.2.3.4
 ListenPort = 2000
+VpnMask = 255.0.0.0
 @end example
 
 C already has another daemon that runs on port 655, so they have to
@@ -543,7 +560,7 @@ and in /etc/tinc/tinc.conf:
 MyVirtualIP = 10.4.3.32/16
 ConnectTo = 3.4.5.6
 ConnectPort = 2000
-AllowConnect = no
+VpnMask=255.0.0.0
 @end example
 
 D will be connecting to C, which has a tincd running for this network on
@@ -691,7 +708,6 @@ Output version information and exit.
 @menu
 * The Connection::              
 * Security::                    
-* The Protocol::                
 @end menu
 
 @node    The Connection, Security, Technical information, Technical information
@@ -746,7 +762,7 @@ and it writes the decrypted information to its own ethertap device.
 @node    The Meta-connection,  , Protocol Preview, The Connection
 @subsection The meta-connection
 
-Having only a UDP connection available is not enough. Though suitable
+Having only an UDP connection available is not enough. Though suitable
 for transmitting data, we want to be able to reliably send other
 information, such as routing and encryption information to somebody.
 
@@ -766,9 +782,16 @@ have two connections, we also have two protocols. The protocol used for
 the UDP data is the ``data-protocol,'' the other one is the
 ``meta-protocol.''
 
+The reason we don't use TCP for both protocols is that UDP is much
+better for encapsulation, even while it is less reliable. The real
+problem is that when TCP would be used to encapsulate a TCP stream
+that's on the private network, for every packet sent there would be
+three ACK's sent instead of just one. Furthermore, if there would be
+a timeout, both TCP streams would sense the timeout, and both would
+start resending packets.
 
 @c ==================================================================
-@node    Security, The Protocol, The Connection, Technical information
+@node    Security,  , The Connection, Technical information
 @section About tinc's encryption and other security-related issues.
 
 @cindex tinc
@@ -862,266 +885,6 @@ Now we have securely hidden our data. But a malicious cracker may still
 bother you by randomly altering the encrypted data he intercepts.
 
 
-@c ==================================================================
-@node    The Protocol,  , Security, Technical information
-@section Detailed protocol specifications
-
-
-
-@menu
-* Data protocol::               
-* Meta protocol::               
-@end menu
-
-@c ==================================================================
-@node    Data protocol, Meta protocol, The Protocol, The Protocol
-@subsection The data protocol
-
-The data that is sent through the UDP connection is formatted as follows:
-
-@example
-
-  bytes  |  Contents
-----------------------
-   0-1   |  The length of this packet, including all leading fields
-   2-5   |  The destination IP address
-  6-...  |  The encrypted data
-
-@end example
-
-The method that was used to encrypt the data should be made known via
-the meta-protocol, during early identification stages.
-
-
-@c ==================================================================
-@node    Meta protocol,  , Data protocol, The Protocol
-@subsection The Meta protocol
-
-This protocol consists of separate packets of information, that are
-generally formatted thusly:
-
-@example
-
-  bytes  |  Contents
-----------------------
-    0    |  The request ID
-  1-...  |  (Optional: arguments)
-
-@end example
-
-What follows is a listing of possible request IDs.
-
-@table @samp
-@item ACK
-Acknowledge. This generally means that the authentication has been
-accepted by the remote computer. Takes no arguments.
-
-@example
-
-  bytes  |  Contents
-----------------------
-    0    |  `1'
-
-@end example
-
-@item AUTH_S_INIT
-@itemx AUTH_C_INIT
-Obsolete. Use @samp{BASIC_INFO}.
-
-@item AUTH_S_SPP
-@itemx AUTH_C_SPP
-Obsolete. Use @samp{PASSPHRASE}.
-
-@item AUTH_S_SKEY
-@itemx AUTH_C_SKEY
-Obsolete. Use @samp{PUBLIC_KEY}, @samp{REQ_KEY} and @samp{ANS_KEY}.
-
-@item AUTH_S_SACK
-@itemx AUTH_C_RACK
-Obsolete. Use @samp{ACK}.
-
-@item TERMREQ
-A request to terminate this connection, for whatever reason.
-
-@example
-
-  bytes  |  Contents
-----------------------
-    0    |  `30'
-   1-4   |  The VPN IP address of the host that has exited
-
-@end example
-
-
-@item PINGTIMEOUT
-Terminate connection, but the reason must be a ping timeout.
-
-@example
-
-  bytes  |  Contents
-----------------------
-    0    |  `31'
-   1-4   |  The VPN IP address of the host that has exited
-
-@end example
-
-
-@item PING
-Send probe to the other end, if he hasn't returned a @samp{PONG} within
-10 seconds, the connection is considered to be dead and will be
-terminated, we should try to notify the other by sending a
-@samp{PINGTIMEOUT} packet.
-
-@example
-
-  bytes  |  Contents
-----------------------
-    0    |  `40'
-
-@end example
-
-
-@item PONG
-See explanation for @samp{PING}
-
-@example
-
-  bytes  |  Contents
-----------------------
-    0    |  `41'
-
-@end example
-
-
-@item ADD_HOST
-Send an @samp{ADD_HOST} packet if you want to propagate all your current
-connections to a new computer on a network. If we get this request, we
-must forward it to everyone that hasn't got it yet.
-
-@example
-
-  bytes  |  Contents
-----------------------
-    0    |  `60'
-   1-4   |  The real IP address of the new host
-   5-8   |  The VPN IP address of the new host
-   9-12  |  The VPN netmask
-  13-14  |  The port number that the new host listens on
-
-@end example
-
-
-@item BASIC_INFO
-This packet will contain all necessary basic information about
-ourselves, such as the port we listen on and our desired VPN IP address.
-
-@example
-
-  bytes  |  Contents
-----------------------
-    0    |  `61'
-    1    |  The protocol version.
-         |  This chapter describes version 4.
-   2-3   |  The port number that the new host listens on
-   4-7   |  The VPN IP address of the new host
-   8-11  |  The VPN netmask
-
-@end example
-
-
-@item PASSPHRASE
-Send an encrypted passphrase. Should be encrypted with our
-@strong{public} key, and it must reach us before a @samp{PUBLIC_KEY}
-request.
-
-@example
-
-  bytes  |  Contents
-----------------------
-    0    |  `62'
-   1-2   |  The length of the encrypted passphrase
-  3-...  |  The encrypted passphrase
-
-@end example
-
-
-@item PUBLIC_KEY
-This is only used during authentication of a new connection, later on we
-may use @samp{REQ_KEY} and @samp{ANS_KEY}.
-
-@example
-
-  bytes  |  Contents
-----------------------
-    0    |  `63'
-   1-2   |  The length of the key
-  3-...  |  The public key, given in base-36
-
-@end example
-
-
-@item HOLD
-@itemx RESUME
-Unused.
-
-@item CALCULATE
-@itemx CALC_RES
-@itemx ALMOST_KEY
-Never been in use.
-
-@item REQ_KEY
-Request a public key from someone and return it to the sender of this
-request using a @samp{ANS_KEY} packet. If we get such request, we must
-forward it to the connection that leads to the destination.
-
-@example
-
-  bytes  |  Contents
-----------------------
-    0    |  `160'
-   1-4   |  The source VPN IP address
-   5-8   |  The destination VPN IP address
-   9-14  |  `0'
-
-@end example
-
-
-@item ANS_KEY
-Answer to a @samp{REQ_KEY} request, forward it to the destination if it
-is not meant for us.
-
-@example
-
-  bytes  |  Contents
-----------------------
-    0    |  `161'
-   1-4   |  The source VPN IP address
-   5-8   |  The destination VPN IP address
-   9-12  |  The expiration date/time in seconds
-  13-14  |  The key length
-  15-... |  The public key in base-36
-
-@end example
-
-
-@item KEY_CHANGED
-The source computer wants to tell that it has regenerated its private
-and public keys, so anything going there must be encrypted with a new
-shared key.
-
-@example
-
-  bytes  |  Contents
-----------------------
-    0    |  `162'
-   1-4   |  The source VPN IP address
-
-@end example
-
-
-@end table
-
-
 @c ==================================================================
 @node    About us, Concept Index, Technical information, Top
 @chapter About us