IPv6 Operations J.R. Massar Internet-Draft Unfix/SixXS Expires: July 12, 2004 January 12, 2004 SixXS Heartbeat Protocol draft-massar-v6ops-heartbeat-00 Status of this Memo This document is an Internet-Draft and is in full conformance with all provisions of Section 10 of RFC2026. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." The list of current Internet-Drafts can be accessed at http:// www.ietf.org/ietf/1id-abstracts.txt. The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html. This Internet-Draft will expire on July 12, 2004. Copyright Notice Copyright (C) The Internet Society (2004). All Rights Reserved. Abstract This document proposes a heartbeat protocol for signalling availability of hosts with a specific emphasis on providing a signalling protocol for allowing dynamic non-24/7 endnodes to use tunnel's of the various IPv6 Tunnel Brokers. Massar Expires July 12, 2004 [Page 1] Internet-Draft SixXS Heartbeat Protocol January 2004 Table of Contents 1. Requirements notation . . . . . . . . . . . . . . . . . . . . 3 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 3. SixXS Heartbeat Protocol . . . . . . . . . . . . . . . . . . . 4 3.1 Heartbeat Command . . . . . . . . . . . . . . . . . . . . . . 5 3.2 Disable Command . . . . . . . . . . . . . . . . . . . . . . . 6 4. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 6 5. Security Considerations . . . . . . . . . . . . . . . . . . . 7 6. Scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . 7 6.1 Host heartbeat . . . . . . . . . . . . . . . . . . . . . . . . 7 6.2 IPv6 in IPv4 tunnel heartbeat . . . . . . . . . . . . . . . . 8 References . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Author's Address . . . . . . . . . . . . . . . . . . . . . . . 10 Intellectual Property and Copyright Statements . . . . . . . . 11 Massar Expires July 12, 2004 [Page 2] Internet-Draft SixXS Heartbeat Protocol January 2004 1. Requirements notation The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119]. 2. Introduction When operating a IPv6 Tunnel Broker [RFC3053] with one or multiple Tunnel Servers [RFC3053] or any other form of tunneling across the Internet one doesn't want to send packets out to unsuspecting endpoints. Unsuspecting endpoints are hosts which don't expect traffic from the Tunnel Server. This is a common scenario when a non-static but configured endpoint is used. The user enables the tunnel to the current endpoint, uses it and then disconnects from the Internet or gets another IP, due to dhcp policies or various other reasons. Though the endpoint of the tunnel changes but there currently is no way of automatically changing that endpoint or notifying the Tunnel Server that it has changed. Current solutions include using a script to update the endpoint on the Tunnel Broker's website and various other non-standardized methods. Then another host get to use the IP which terminates the tunnel and suddenly it receives our tunneled packets. This could be seen as a security risk as the new user of the IP could sniff the packets and look at them or could even setup the tunnel and take over connections which where active on that tunnel impersonating the former host using the tunnel. Many hosts employ so called firewall or logging facilities that will start complaining about packets being sent from the Tunnel Server which they perceive as malicious. The user of this firewall will in turn start complaining about abuse and hack attempts which takes up time from the staff running the Tunnel Broker and not even mentioning all the entities that will be notified by these type of messages. This protocol resolves this problem by specifying a oneway heartbeat protocol. As long as the tunnel endpoint is able to send an authenticated heartbeat packet the tunnel is kept configured on the side of the Tunnel Server allowing two-way traffic to be sent. This heartbeat protocol also allows for automatic tunnel reconfiguration so that in the event of an IP change at the client side the tunnel will be reconfigured allowing continued service without a (notable) interruption. If the Tunnel Server doesn't receive a heartbeat for a certain amount of time it can deem the endpoint as down and deconfigure the tunnel. Taking these two into consideration will stop the sending of tunneled packets and will thus avoid the complaints which could have been brought up before. Massar Expires July 12, 2004 [Page 3] Internet-Draft SixXS Heartbeat Protocol January 2004 This protocol covers all tunneling protocols which use at least one set of inner and one set of outer addresses. Note that some of these protocols already have a heartbeat mechanism in the protocol. In those cases it is of course advisable to use that mechanism. 3. SixXS Heartbeat Protocol The heartbeat packet is a UDP [RFC0768] packet to IANA assigned port 3740 of the server to which the signalling is to take place. Schematically this will look like the following diagram. +--------+ +--------+ | Client | <--- Internet ---> | Server | +--------+ +--------+ The heartbeat packet consists out of one single line separated by spaces and ending in a NULL. The first part is the command thus allowing extension of this protocol if wanted in the future. Extensions are allowed to put additional commands on seperate lines, currently those extensions are not defined but these could be used for transmitting other informations like load of the client which could be useful in failover scenario's. The basic heartbeat packet looks like the following in ABNF [RFC2234]. The IPv6address and IPv4address ABNF are defined in "APPENDIX B: ABNF Description of Text Representations" of the "IP Version 6 Addressing Architecture" [RFC3513]. packet = command SP epochtime SP md5-signature NULL command = *%x41-5A [*(SP option)] option = *VCHAR epochtime = *DIGIT md5-signature = 32(HEXDIG) NULL = %x00 epochtime is the time in seconds since "00:00:00 1970-01-01 UTC" which corresponds to the output of to unix "date +%s" command. Both the client and the server are advised to be synchronized using NTP [RFC2030] to make sure that the system clocks of the hosts don't differ to much even after travelling the intermediate networks between the client and the server. The packet must be constructed first with the signature containing Massar Expires July 12, 2004 [Page 4] Internet-Draft SixXS Heartbeat Protocol January 2004 the password for the tunnel. After construction the md5-signature should be calculated and then replace the cleartext-password. The packet can then be sent to the server. This method thus allows verification of the password without sending the password over the network. The Server does the same thing, taking the command part of the packet, adding the password and calculating the md5 signature which can then be compared with the md5-signature which was sent by the client. If these match the packet can be processed further. When the md5-signatures don't match the server MUST silently ignore the packet. Calculation of the MD5 signature [RFC1321] MUST be done over the complete string excluding the NULL which is the string terminator in C and most other programming languages. The scenarios section demonstrates how this is performed. The currently defined commands HEARTBEAT and DISABLE both use the following common options to identify the endpoint for which this heartbeat is meant: common-options = ("HOST" endpoint | "TUNNEL" outer-endpoint SP inner-endpoint) outer endpoint = endpoint | "sender" inner endpoint = endpoint endpoint = IPv4address | IPv6address An endpoint MAY also be a MAC address or other defined 'address'. 3.1 Heartbeat Command This command is the main reason for this protocol to exist. It tells the Tunnel Server that the current endpoint specified by both the UDP's source address and the common-option's outer endpoint is still accepting tunneled packets. Specification: command = "HEARTBEAT" SP common-options Example's: Heartbeat from client host 192.0.2.2 : HEARTBEAT HOST 192.0.2.2 257209200 Massar Expires July 12, 2004 [Page 5] Internet-Draft SixXS Heartbeat Protocol January 2004 Heartbeat from client host 192.0.2.2 for IPv6 tunnel endpoint 2001:db8::2 : HEARTBEAT TUNNEL 2001:db8::2 192.0.2.2 409100400 In this example the server determines the inner-endpoint based on the sender IP of the packet. This could be used in all cases but is especially useful when the client is behind a NAT and doesn't know it's external address. An application MUST not use the 'sender' replacement when it knows it's public IP address. This because it adds an extra verification step to the heartbeat. HEARTBEAT TUNNEL 2001:db8::2 sender 257209200 3.2 Disable Command The disable command explicitly sets a tunnel 'down' on the Tunnel Server allowing a gracious and prompt shutdown of the tunnel on the Tunnel Server. One could even employ this command to stop huge traffic flows to the local endpoint which maybe could not cope with the traffic passed over it through the tunnel. Specification: command = "DISABLE" SP common-options Example: Disable the tunnel endpoint 2001:db8::2 to 192.0.2.2 : DISABLE TUNNEL 192.0.2.2 2001:db8::2 409100400 4. Acknowledgements The protocol presented has formed during the existence of IPng [IPNG] and SixXS [SIXXS] to allow the users of these tunnel broker systems to have a dynamic non-static IPv4 endpoint. This protocol is already in use by SixXS since October 2003 and has made a lot of users very happy and I would like to thank the numerous users requesting the support for dynamic non 24/7 reachable tunnel's. This was before this protocol was implemented one of the few requirements of obtaining a tunnel even when the project only consisted of one Tunnel Server and was called IPng. Massar Expires July 12, 2004 [Page 6] Internet-Draft SixXS Heartbeat Protocol January 2004 5. Security Considerations The password used for creating the MD5 [RFC1321] signature should never be made publicly available to 3rd parties otherwise that 3rd party could sign a packet and automatically reconfigure the tunnel endpoint. This could lead into the 3rd party sending traffic in both directions and thus posing as the actual user. The inclusion of the timestamp along with the verification on the Tunnel Server side should guard against any replay attacks. The Tunnel Server MUST limit that the local clock compared to the timestamp from the packet MUST never differ for more than 60 seconds, this allows for at least some latency and time-desync. Any packet that is not well formed or contains a invalid signature MUST be silently dropped. A side effect of this protocol is that whenever the local host cannot send a heartbeat in time to the Tunnel Server that it will deconfigure the tunnel. Envision a Denial of Service over the tunnel to the local endpoint. The local host's heartbeat cannot reach the Tunnel Server which in turn will automatically disable the tunnel, allowing the host to catch some breath again and thus effectively implementing a poor mans rate limiting. 6. Scenarios 6.1 Host heartbeat This scenario handles the case where a host, the client using either IPv6 or IPv4, sends notifications of it's aliveness to a server. This could be used for server management and fallover situations. In combination with extension commands, used on the additional lines in the packet the client could send along information about cpu load etc allowing the server to gather information about those factors. +--------+ +--------+ | Client | <--- Internet ---> | Server | +--------+ +--------+ Server's IPv6 : 2001:db8::1/64 Client's IPv6 : 2001:db8::2/64 Password : point The command, including the password and epochtime would be: HEARTBEAT HOST 2001:db8::2 409100400 point Massar Expires July 12, 2004 [Page 7] Internet-Draft SixXS Heartbeat Protocol January 2004 The packet to be transmitted, after md5 translation is: HEARTBEAT HOST 2001:db8::2 409100400 bd72fb8d98b8698fa70cdfeb33bb7342 6.2 IPv6 in IPv4 tunnel heartbeat This scenario handles the case where a IPv6 in IPv4 tunnel [RFC3056] is setup between two hosts. This is the normal case for a Tunnel Broker system with which a IPv4 only host is given acces to a IPv6 network. A tunnel like this can easily be setup using the Tunnel Setup Protocol [I-D.vg-ngtrans-tsp], SixXS Configuration Service [SCS] or similar protocols. A diagram of such a setup: +--------+ +--------+ | Client | <--- IPv6 in IPv4 Tunnel ---> | Server | +--------+ +--------+ Server's Outer IPv4 : 192.0.2.1 Server's Inner IPv6 : 2001:db8::1/64 Client's Outer IPv4 : 192.0.2.2 Client's Inner IPv6 : 2001:db8::2/64 Password : hartslag The command would be: HEARTBEAT TUNNEL 2001:db8::2 192.0.2.2 1051480800 hartslag The data to be transmitted is: HEARTBEAT TUNNEL 2001:db8::2 192.0.2.2 1051480800 3f0a026edb1b15e7c1a7a2d92b3c446a Disabling the same tunnel can be accomplished using: DISABLE TUNNEL 2001:db8::2 192.0.2.2 1055628000 hartslag The data to be transmitted is: DISABLE TUNNEL 2001:db8::2 192.0.2.2 1055628000 53d5bb7bfe4a3a80da01227da02cda24 The usage for which this protocol was defined in the first place is signalling the server of the current IPv4 address of the client. When the server receives a heartbeat packet it looks up the configuration information based on the supplied Inner IPv6 address, verifies that Massar Expires July 12, 2004 [Page 8] Internet-Draft SixXS Heartbeat Protocol January 2004 the password is correct by constructing the command and generating the md5 signature. When the md5 signature is incorrect the server MUST silently discard and ignore the packet. A check MUST also be made comparing the Inner IPv4 address with the IPv4 address from which the packet was sent, when incorrect the server MUST discard and ignore the packet. Logs noting these event MAY be made depending on the wishes of the administrator. When the password is correct and thus the md5 verifies the server will configure the IPv6 in IPv4 tunnel to point at the IPv4 address specified by the Inner IPv4 parameter. When the Inner IPv4 parameter is 'sender' the server MUST use the IPv4 address from which the packet originates. Note that TEST-NET [RFC3300] addresses could never reach a Tunnel Server over the public Internet due to filtering of this documentation prefix. References [I-D.vg-ngtrans-tsp] Blanchet, M, "Tunnel Setup Protocol (TSP)A Control Protocol to Setup IPv6 or IPv4 Tunnels", draft-vg-ngtrans-tsp-01 (work in progress), July 2002. [IPNG] van Pelt, P.B. and J.R. Massar, "IPng - IPv6 Enduser Deployment", . [RFC0768] Postel, J., "User Datagram Protocol", STD 6, RFC 768, August 1980. [RFC1321] Rivest, R., "The MD5 Message-Digest Algorithm", RFC 1321, April 1992. [RFC2030] Mills, D., "Simple Network Time Protocol (SNTP) Version 4 for IPv4, IPv6 and OSI", RFC 2030, October 1996. [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [RFC2234] Crocker, D.H. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", RFC 2234, November 1997. [RFC3053] Durand, A., Fasano, P., Guardini, I. and D. Lento, "IPv6 Tunnel Broker", RFC 3053, January 2001. [RFC3056] Carpenter, B. and K. Moore, "Connection of IPv6 Domains via IPv4 Clouds", RFC 3056, February 2001. [RFC3300] Reynolds, J., Braden, R., Ginoza, S. and A. De La Cruz, Massar Expires July 12, 2004 [Page 9] Internet-Draft SixXS Heartbeat Protocol January 2004 "Internet Official Protocol Standards", RFC 3300, November 2002. [RFC3513] Hinden, R. and S. Deering, "Internet Protocol Version 6 (IPv6) Addressing Architecture", RFC 3513, April 2003. [SCS] Massar, J.R., "SixXS Configuration Service", draft-massar-v6ops-sixxsconfig-00 (work in progress), January 2004, . [SIXXS] Massar, J.R. and P.B. van Pelt, "SixXS - IPv6 Deployment & Tunnelbroker", . Author's Address Jeroen Massar Unfix/SixXS Hofpoldersingel 45 Gouda 2807 LW NL EMail: jeroen@unfix.org URI: http://unfix.org/~jeroen/ Massar Expires July 12, 2004 [Page 10] Internet-Draft SixXS Heartbeat Protocol January 2004 Intellectual Property Statement The IETF takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on the IETF's procedures with respect to rights in standards-track and standards-related documentation can be found in BCP-11. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementors or users of this specification can be obtained from the IETF Secretariat. The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights which may cover technology that may be required to practice this standard. Please address the information to the IETF Executive Director. Full Copyright Statement Copyright (C) The Internet Society (2004). All Rights Reserved. This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English. The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assignees. This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION Massar Expires July 12, 2004 [Page 11] Internet-Draft SixXS Heartbeat Protocol January 2004 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Acknowledgment Funding for the RFC Editor function is currently provided by the Internet Society. Massar Expires July 12, 2004 [Page 12]