]> Anycast stream relaying
Sporgasse 6 Graz 8010 AT otti@wirdorange.org http://anytun.org/
General anytun Internet-Draft Anycast tunneling / relaying The anycast tunneling (anytun) protocol defines a protocol used for communication between unicast clients and anycast servers. It can be used for tunneling information between 2 clients over the servers or in relay mode to transmit data form the client over the servers to a third party not using the protocol and vice versa.
anytun defines a Host Anycast Service as defined in rfc1546. It can be used to build high scalable and redundant tunnel services. It supports both UDP and TCP connections. Additionally to the possibility of establashing an unicast TCP connection over an anycast address as suggested in rfc1546, it supports real anycast TCP connections with state syncronisation and heuristic state forecast. It also has a relay mode, that makes it possible, that only one of the connection endpoints has to use the anytun protocol. This can be used to make connections through Firewalls or behind a NAT Router RFC3068 DTD.
This section gives an overview of possible operation modes und usage scenarios. Please note, that the protocols used in the figures are only examples and that anytun itself does not care about either transport protocols or encapsulated protocols. Routing and network address translation is not done by anytun. Each implemetation MAY choose it's own way of doing this task (e.g. using functions provided by the operating system). Anytun is used to establish and controll tunnnels, to encapsulate and encrypt data.
An example of anytun used in tunnel mode ----------- ----------- | RTP | ---------- | RTP | ----------- -> |server 1| -> ----------- | UDP | ---------- | UDP | ----------- ----------- ----- | IPv6 | ---------- | IPv6 | ----- | | -> ----------- -> |server 2| -> ----------- -> | | ----- | anytun | ---------- | anytun | ----- ##### ----------- ----------- ##### | UDP | ---------- | UDP | client 1 ----------- -> |server 3| -> ----------- client 2 | IPv4 | ---------- | IPv4 | ----------- ----------- | ... | anycast | ... |
In tunneling mode the payload of the anytun packet is transmitted from one unicast host to the anycast server. This server makes a routing descision based on the underlying protocol and transmits a new anytun package to one or more clients depending on the routing descition. The server MAY also route the packet to a directly connected network or a service running on the server, but please note, that this is only usefull for anycast host services like DNS and that the services HAVE TO be running on all servers in order to work.
An example of anytun used in open tunnel mode ----------- | RTP | ---------- ----------- -> |server 1| -> | UDP | ---------- ----------- ----------- | RTP | ----- | IPv6 | ---------- ----------- ----- | | -> ----------- -> |server 2| -> | UDP* | -> | | ----- | anytun | ---------- ----------- ----- ##### ----------- | IPv6* | ##### | UDP | ---------- ----------- client 1 ----------- -> |server 3| -> | ... | host | IPv4 | ---------- not using ----------- anytun | ... | anycast *changed source address or port
In open tunnel mode only one of two clients talking to each other over the servers MUST use the anytun protocol. When a client using the anytun protocol wants to tunnel data, it is building a connection to the anycast servers using the anytun protocol. The anycast servers relay the encapsulated packages directly to the destination without using the anytun protocol. The source address of the datagramm HAS TO be changed to the anycast address of the server. The anytun servers act like a source NAT router, therefor for the destination it saems that it is talking to the client directly.
An example of anytun used in relay mode ----------- ----- | RTP | ---------- | | -> ----------- -> |server 1| -> ----- | UDP** | ---------- ----------- ##### ----------- | RTP | | IPv6**| ---------- ----------- ----- host ----------- -> |server 2| -> | UDP* | -> | | not using | ... | ---------- ----------- ----- anytun | IPv6* | ##### ---------- ----------- ----------- -> |server 3| | ... | host ----- | anytun | ---------- not using | | -> ----------- anytun ----- | IPv4 | anycast ##### ----------- connection| ... | controller *changed source address or port **changed destination address or port
In relay mode the anycast serveres directly repaet the packetes of clients, only the source and destination addresses are changed. The anytun protocol is only used for controll messages, but not fr encapsulation.
An example of anytun used with udp transport ----------- ----------- | RTP | ---------- | RTP | ----------- -> |server 1| -> ----------- | UDP | ---------- | UDP | ----------- ----------- ----- | IPv6 | ---------- | IPv6 | ----- | | -> ----------- -> |server 2| -> ----------- -> | | ----- | anytun | ---------- | anytun | ----- ##### ----------- ----------- ##### | UDP | ---------- | UDP | client 1 ----------- -> |server 3| -> ----------- client 2 | IPv4 | ---------- | IPv4 | ----------- ----------- | ... | anycast | ... |
In anycast udp mode the data between clients and anycast serveres is carried by udp packets. Packets are routed by the serveres from one client to another. Because udp is stateless no inforamtion has to be syncronised
An example of anytun used with udp transport ----------- ----------- | RTP | ---------- | RTP | ----------- -> |server 1| -> ----------- | UDP | ---------- | UDP | ----------- ----------- ----- | IPv6 | ---------- | IPv6 | ----- | | -> ----------- -> |server 2| -> ----------- -> | | ----- | anytun | ---------- | anytun | ----- ##### ----------- ----------- ##### |lightUDP | ---------- |lightUDP | client 1 ----------- -> |server 3| -> ----------- client 2 | IPv4 | ---------- | IPv4 | ----------- ----------- | ... | anycast | ... |
The light UDP mode is neerly the same as the normal UDP mode, the only difference is, that the udp size is set to the udp header lenght and not to the length of the full packet and therefor the checksum is only calculated for the udo header itself. So there is no error correction or detection done on the payload. This can be usefull if realtime data is beeing transimittet or the tunneled protocol does error correction/detection by itself.
Most NAT routers need a tcp connection to transmit some packets once in while to stay open. In full anycast tcp mode anytun hast to predict the tcp state including the sequence number. Synconisation of the sequence number would be to much overhead, so a keep alive intervall is agreed. This interval is used to calculate the sequemce number.
The protocol field defines the payload protocol. ETHER TYPE protocol numerbers are used. http://www.iana.org/assignments/ethernet-numbers Values from 0 to 0000-05DC are not used for DIX ethernet lenght, but are reservered for special purposes. As the definition of transparent ethernet bridging is very unclear 2 special types are added for ethernet frames
HEX
0001 Raw Ethernet - both IEEE 802.3 and DIX Etherernet without preamble,SFD, PAD and FCS
0002 Raw Ethernet with FCS
further special types MAY be added in the furture.

Most important ETHER TYPEs
0800 Internet IP (IPv4)
86DD IPv6
&rfc3068; An Anycast Prefix for 6to4 Relay Routers