Network Working Group                                         H. Kennedy
Request for Comments: 3091                        University of Michigan
Category: Informational                                     1 April 2001
        
Network Working Group                                         H. Kennedy
Request for Comments: 3091                        University of Michigan
Category: Informational                                     1 April 2001
        

Pi Digit Generation Protocol

Pi数字生成协议

Status of this Memo

本备忘录的状况

This memo provides information for 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.

版权所有(C)互联网协会(2001年)。版权所有。

Abstract

摘要

This memo defines a protocol to provide the Pi digit generation service (PIgen) used between clients and servers on host computers.

此备忘录定义了一个协议,以提供主机上客户端和服务器之间使用的Pi数字生成服务(PIgen)。

Introduction

介绍

This protocol is intended to provide the Pi digit generation service (PIgen), and be used between clients and servers on host computers. Typically the clients are on workstation hosts lacking local Pi support, and the servers are more capable machines with greater Pi calculation capabilities. The essential tradeoff is the use of network resources and time instead of local computational cycles.

此协议旨在提供Pi数字生成服务(PIgen),并在主机上的客户端和服务器之间使用。通常,客户机位于缺乏本地Pi支持的工作站主机上,而服务器是具有更高Pi计算能力的能力更强的机器。基本的折衷是使用网络资源和时间,而不是本地计算周期。

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].

本文件中的关键词“必须”、“不得”、“要求”、“应”、“不应”、“应”、“不应”、“建议”、“可”和“可选”应按照RFC 2119[RFC2119]中所述进行解释。

Note

笔记

All digits supplied by implementations of this service are ASCII [US-ASCII] representations of decimal (base 10) numbers following the decimal point in values or approximations of Pi. There MUST be an implied decimal value of 3 (three) preceding the values provided by the service defined by this protocol.

此服务的实现提供的所有数字都是ASCII[US-ASCII]表示的小数点后的十进制(以10为基数)数字,表示Pi值或近似值。在本协议定义的服务提供的值之前,必须有一个隐含的十进制值3(三)。

1. TCP Based Digit Generator Service
1. 基于TCP的数字生成服务

One REQUIRED PIgen service is defined as a stateless TCP service. A server listens on TCP port 314159. Once a connection is established the server sends a stream of data, one digit of Pi at at time,

一个必需的PIgen服务被定义为无状态TCP服务。服务器侦听TCP端口314159。一旦建立连接,服务器将发送数据流,每次发送一位Pi,

starting with the most significant digit following the decimal point. Any incoming data MUST be discarded. This continues until the client closes the connection.

从小数点后的最高有效位开始。必须丢弃任何传入数据。这将一直持续到客户端关闭连接为止。

The data flow over the connection is limited by the normal TCP flow control mechanisms, so there is no concern about the server sending data faster than the client can process it.

连接上的数据流受到正常TCP流控制机制的限制,因此不必担心服务器发送数据的速度超过客户端处理数据的速度。

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]. However, the method chosen SHOULD provide a precise value for the digits of Pi generated.

服务器可以使用任何适当的Pi数字生成方法来提供此服务,包括(但不限于)表格查找[数字]、数值计算[FIBPI、PIFFT]和统计采样[MCM]。然而,所选择的方法应为生成的Pi数字提供精确值。

Implementors of PIgen MUST provide this service to be conditionally compliant with this RFC.

PIgen的实现者必须提供此服务,以有条件地符合此RFC。

1.1. Approximate Service
1.1. 近似服务

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 following the decimal point. Any incoming data MUST be discarded. This continues until the client closes the connection.

可选的PIgen服务被定义为无状态TCP服务。服务器侦听TCP端口220007。一旦建立了连接,服务器就会发送一个数据流,一次发送一个有理数22/7的数字,从小数点后的最高有效位开始。必须丢弃任何传入数据。这将一直持续到客户端关闭连接为止。

2. UDP Based Digit Generator Service
2. 基于UDP的数字生成服务

An OPTIONAL PIgen service is defined as a stateless UDP service. A server listens on UDP port 314159. When a datagram requesting a specific digit of Pi is received, an answering datagram is sent containing the value of the requested digit of Pi according to the format defined in sections 2.1.1. and 2.1.2.

可选PIgen服务定义为无状态UDP服务。服务器侦听UDP端口314159。当接收到请求Pi特定数字的数据报时,根据第2.1.1节中定义的格式,发送包含请求的Pi数字值的应答数据报。和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].

所请求的数字值可以通过Pi数字生成的任何适当方法来确定。推荐的方法包括查表[数字]或数值计算[BBPPA]。

2.1. Packet Format
2.1. 数据包格式

The datagram-based components of the PIgen protocol suite all share the following UDP data payload formats (defined in the ABNF of RFC 2234 [RFC2234]).

PIgen协议套件中基于数据报的组件都共享以下UDP数据有效负载格式(在RFC 2234[RFC2234]的ABNF中定义)。

2.1.1. Request Payload Format
2.1.1. 请求有效负载格式
   request   = nth_digit
        
   request   = nth_digit
        
   nth_digit = 1*DIGIT  ; specifying the n-th digit following the
                        ; decimal point
        
   nth_digit = 1*DIGIT  ; specifying the n-th digit following the
                        ; decimal point
        
2.1.2. Reply Payload Format
2.1.2. 应答有效负载格式
   reply  = nth_digit ":" DIGIT ; where DIGIT is the value of the n-th
                                ; digit following the decimal
                                ; point
        
   reply  = nth_digit ":" DIGIT ; where DIGIT is the value of the n-th
                                ; digit following the decimal
                                ; point
        
2.2. Approximate Service
2.2. 近似服务

An OPTIONAL PIgen service is defined as a stateless UDP service. A server listens on UDP port 220007. When a datagram requesting a specific digit of the rational number 22/7 is received, an answering datagram is sent containing the value of the requested digit of 22/7 according to the format defined in sections 2.1.1. and 2.1.2.

可选PIgen服务定义为无状态UDP服务。服务器侦听UDP端口220007。当收到请求有理数22/7的特定数字的数据报时,根据第2.1.1节中定义的格式,发送包含请求的22/7数字值的应答数据报。和2.1.2。

3. IP Multicast Based Digit Generator Service
3. 基于IP组播的数字生成服务

An OPTIONAL PIgen service is defined as a stateless UDP service. A random distribution of digits of Pi are sent using the payload format described in section 2.1.2. to the IP multicast group 314.159.265.359.

可选PIgen服务定义为无状态UDP服务。Pi数字的随机分布使用第2.1.2节中描述的有效载荷格式发送。到IP多播组314.159.265.359。

There is no request structure. If a server implementing this component of the protocol suite joins the PIgen multicast group and does not detect a server providing digits within 30 seconds, it MAY elect to become the PIgen multicast provider.

没有请求结构。如果实现协议套件的此组件的服务器加入PIgen多播组,并且在30秒内未检测到提供数字的服务器,则它可以选择成为PIgen多播提供商。

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 multicast group over time.

PIgen多播提供商生成Pi数字的随机分布,并将其发送到多播组。PIgen多播客户端通过随时间监听多播组来建立一致的Pi值。

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 ensure an adequately random distribution, a proper random number generator should be used, see [RANDOM] for some examples.

可通过Pi数字生成的任何适当方法来确定随机选择的数字值。推荐的方法包括查表[数字]或数值计算[BBPPA]。为确保充分的随机分布,应使用适当的随机数生成器,有关示例,请参见[随机]。

4. Service Discovery
4. 服务发现

Clients SHOULD discover PIgen servers via 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 allows for central administration of addressing, fallback for failed relays and collectors, and static load balancing.

客户端应通过DNS SRV算法[RFC2782]发现PIgen服务器。使用的服务是“pigen”,使用的协议是“tcp”和“udp”。应使用“pigem”服务查找近似服务(第1.1节和第2.2节)。这允许集中管理寻址、故障继电器和收集器的回退以及静态负载平衡。

5. Security Considerations
5. 安全考虑

As almost every secure Internet protocol requires a highly accurate value of Pi in order to function correctly, it is imperative that clients only use a trusted PIgen server. The imminent collapse of the Internet is assured if this guideline is not strictly followed.

由于几乎每一个安全的互联网协议都需要一个高度精确的Pi值才能正常工作,因此客户端必须只使用可信的PIgen服务器。如果不严格遵守这一准则,互联网即将崩溃是有把握的。

6. References
6. 工具书类

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.

[RFC2119]Bradner,S.,“RFC中用于表示需求水平的关键词”,BCP 14,RFC 2119,1997年3月。

[US-ASCII] Coded Character Set--7-Bit American Standard Code for Information Interchange, ANSI X3.4-1986.

[US-ASCII]编码字符集——信息交换用7位美国标准代码,ANSI X3.4-1986。

   [DIGITS]   ftp://pi.super-computing.org/pub/pi
        
   [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
        
   [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
        
   [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
        
   [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
        
   [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.

[RFC2234]Crocker,D.和P.Overell,“语法规范的扩充BNF:ABNF”,RFC 2234,1997年11月。

   [RANDOM]   Randomness for Crypto http://www.cs.berkeley.edu/~daw/rnd/
        
   [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.

[RFC2782]Gulbrandsen,A.,Vixie,P.和L.Esibov,“用于指定服务位置(DNS SRV)的DNS RR”,RFC 2782,2000年2月。

[CHARGEN] Postel, J., "Character Generation Protocol", STD 22, RFC 864, May 1983.

[CHARGEN]Postel,J.,“字符生成协议”,STD 22,RFC 864,1983年5月。

7. Author's Address
7. 作者地址

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

休米甘乃迪密歇根大学2281 Boi钢铁公司BLVD。美国密歇根州安阿伯48109-2099

   EMail: kennedyh@engin.umich.edu
        
   EMail: kennedyh@engin.umich.edu
        

Full Copyright Statement

完整版权声明

Copyright (C) The Internet Society (2001). All Rights Reserved.

版权所有(C)互联网协会(2001年)。版权所有。

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.

RFC编辑功能的资金目前由互联网协会提供。