RFC 3091
Pi Digit Generation Protocol
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 Notice
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 ๐
- [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
- [US-ASCII] Coded Character Set--7-Bit American Standard Code for Information Interchange, ANSI X3.4-1986.
- [DIGITS]
ftp://pi.super-computing.org/pub/pi - [FIBPI] Pi and the Fibonacci Numbers
http://www.mcs.surrey.ac.uk/Personal/R.Knott/Fibonacci/fibpi.html - [PIFFT] Pi Calculation based on FFT and AGM
http://momonga.t.u-tokyo.ac.jp/~ooura/pi_fft.html - [MCM] The Monte Carlo Method
http://www.daimi.aau.dk/~u951581/pi/MonteCarlo/pimc.html - [BBPPA] Bailey-Borwien-Plouffe Pi Algorithm
http://www.mathsoft.com/asolve/plouffe/plouffe.html - [RFC2234] Crocker, D. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", RFC 2234, November 1997.
- [RANDOM] Randomness for Crypto
http://www.cs.berkeley.edu/~daw/rnd/ - [RFC2782] Gulbrandsen, A., Vixie, P. and L. Esibov, "A DNS RR for specifying the location of services (DNS SRV)", RFC 2782, February 2000.
- [CHARGEN] Postel, J., "Character Generation Protocol", STD 22, RFC 864, May 1983.
7. Author's Address ๐
Hugh Kennedy University of Michigan 2281 Bonisteel Blvd. Ann Arbor, MI 48109-2099 USA
EMail: kennedyh@engin.umich.edu
Full Copyright Statement
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
- ietf: rfc3091 2001-04
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms