RFC 3091

Pi Digit Generation Protocol

๐Ÿ“… published April 2001, from ietf

RFC 3091: Pi Digit Generation Protocol ๐Ÿฅงโœจ

  • Who wrote it: Hugh Kennedy, from the University of Michigan ๐ŸŽ“
  • Category: Informational ๐Ÿ’–
  • Date: 1 April 2001 ๐ŸŒธ (yes, it's an April Fools' RFC, and yes, it's still a real spec ๐Ÿ’…)
  • Obsoletes / Updates: This title block doesn't list anything it obsoletes or updates.

Status of This Memo

This memo gives information to the Internet community. It does not specify an Internet standard of any kind. Distribution of this memo is unlimited. ๐Ÿ“„

Copyright (C) The Internet Society (2001). All Rights Reserved. ๐Ÿ”’

Abstract

This memo defines a protocol for the Pi digit generation service (PIgen) that clients and servers on host computers use to talk to each other. ๐Ÿฅง

Introduction

Okay so this protocol is meant to give you the Pi digit generation service (PIgen), and it's used between clients and servers on host computers. ๐Ÿ’ป Usually the clients are workstation hosts that don't have Pi support locally, and the servers are beefier machines that are way better at calculating Pi. The big tradeoff is that you use network resources and time instead of your own local computing cycles. It's giving "let someone else do the heavy lifting" ๐Ÿซถ

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 RFC 2119 [RFC2119]. ๐Ÿ“š

Note

Every digit these implementations hand out is an ASCII [US-ASCII] representation of a decimal (base 10) number, written after the decimal point, for values or approximations of Pi. ๐Ÿ”ข There MUST be an implied decimal value of 3 (three) in front of the values this protocol gives you. Don't forget the 3! ๐Ÿ™ˆ


1. TCP Based Digit Generator Service โœจ

One REQUIRED PIgen service is defined as a stateless TCP service. ๐ŸŒˆ A server listens on TCP port 314159. Once a connection is set up, the server starts sending a stream of data, one digit of Pi at a time, beginning with the most significant digit after the decimal point. Any incoming data MUST be discarded, and this keeps going until the client closes the connection. ๐Ÿ”Œ

The data flow over the connection is limited by the normal TCP flow control mechanisms, so the server can't spam the client faster than the client can handle it. ๐Ÿ™Œ No overwhelmed vibes here!

Servers MAY use any appropriate method of Pi digit generation to provide this service, including (but not limited to) table lookup [DIGITS], numerical calculation [FIBPI,PIFFT], and statistical sampling [MCM]. Still, the method chosen SHOULD provide a precise value for the digits of Pi it generates. ๐ŸŽฏ

Implementors of PIgen MUST provide this service to be conditionally compliant with this RFC. ๐Ÿ’…

1.1. Approximate Service

An OPTIONAL PIgen service is defined as a stateless TCP service. ๐Ÿฆ‹ A server listens on TCP port 220007. Once a connection is established, the server sends a stream of data, one digit of the rational number 22/7 at a time, starting with the most significant digit after the decimal point. Any incoming data MUST be discarded. This continues until the client closes the connection. ๐Ÿ“

2. UDP Based Digit Generator Service ๐Ÿงš

An OPTIONAL PIgen service is defined as a stateless UDP service. ๐Ÿ’œ A server listens on UDP port 314159. When a datagram asking for a specific digit of Pi comes in, the server sends back an answering datagram with the value of the requested digit, following the format in sections 2.1.1. and 2.1.2.

The requested digit value MAY be determined by any appropriate method of Pi digit generation. RECOMMENDED methods include table lookup [DIGITS] or numerical calculation [BBPPA]. ๐Ÿงฎ

2.1. Packet Format

Every datagram-based part of the PIgen protocol suite shares the same UDP data payload formats, which are defined in the ABNF of RFC 2234 [RFC2234]. ๐Ÿ“ฆ

2.1.1. Request Payload Format

request   = nth_digit

nth_digit = 1*DIGIT  ; specifying the n-th digit following the
                     ; decimal point

2.1.2. Reply Payload Format

reply  = nth_digit ":" DIGIT ; where DIGIT is the value of the n-th
                             ; digit following the decimal
                             ; point

2.2. Approximate Service

An OPTIONAL PIgen service is defined as a stateless UDP service. ๐ŸŒธ A server listens on UDP port 220007. When a datagram asking for a specific digit of the rational number 22/7 comes in, the server sends back an answering datagram with the value of that digit of 22/7, following the format in sections 2.1.1. and 2.1.2. ๐Ÿ’–

3. IP Multicast Based Digit Generator Service ๐Ÿ“ก

An OPTIONAL PIgen service is defined as a stateless UDP service. ๐ŸŒˆ A random distribution of digits of Pi gets sent to the IP multicast group 314.159.265.359, using the payload format from section 2.1.2. ๐Ÿซง

There is no request structure here. If a server running this part of the protocol suite joins the PIgen multicast group and doesn't detect a server providing digits within 30 seconds, it MAY elect to become the PIgen multicast provider. ๐Ÿ‘‘

The PIgen multicast provider generates a random distribution of the digits of Pi and sends them out to the multicast group. PIgen multicast clients build up a coherent value of Pi by listening to the group over time. It's like a group project where everyone slowly figures it out together ๐Ÿฅน

The randomly selected digit value MAY be determined by any appropriate method of Pi digit generation. RECOMMENDED methods include table lookup [DIGITS] or numerical calculation [BBPPA]. To make sure the distribution is random enough, a proper random number generator should be used. See [RANDOM] for some examples. ๐ŸŽฒ

4. Service Discovery ๐Ÿ”

Clients SHOULD discover PIgen servers through the DNS SRV algorithm [RFC2782]. The service used is "pigen", and the protocols used are "tcp" and "udp". Approximate services (sections 1.1. and 2.2.) should be discovered using a service of "pigem". ๐Ÿ’… This setup allows for central administration of addressing, fallback for failed relays and collectors, and static load balancing. Very organized, very iconic ๐Ÿ—‚๏ธ

5. Security Considerations ๐Ÿ’€

Okay bestie, listen closely ๐Ÿ™ˆ Almost every secure Internet protocol needs a highly accurate value of Pi to work correctly, so it is absolutely imperative that clients only use a trusted PIgen server. The imminent collapse of the Internet is assured if this guideline is not strictly followed. ๐Ÿ˜ญ๐Ÿ”ฅ Not me panicking about the internet ending over a bad Pi server!

6. References ๐Ÿ“š

7. Author's Address ๐ŸŽ€

Hugh Kennedy University of Michigan 2281 Bonisteel Blvd. Ann Arbor, MI 48109-2099 USA

EMail: kennedyh@engin.umich.edu


Copyright (C) The Internet Society (2001). 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 assigns.

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 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

Acknowledgement ๐Ÿซถ

Funding for the RFC Editor function is currently provided by the Internet Society. ๐Ÿ’–

๐Ÿ“ฆ where this page comes from