「ピアツーピア層」を編集中

移動先: 案内検索

警告: ログインしていません。編集を行うと、あなたの IP アドレスが公開されます。ログインまたはアカウントを作成すれば、あなたの編集はその利用者名とともに表示されるほか、その他の利点もあります。

この編集を取り消せます。 下記の差分を確認して、本当に取り消していいか検証してください。よろしければ変更を保存して取り消しを完了してください。
最新版 編集中の文章
1行目: 1行目:
..p2p:
+
.. _p2p:
  
=ピアツーピア層=
+
= The peer-to-peer layer =
  
このドキュメントでは、Tezosシェルのピアツーピア層の内部動作について説明します。この部分は、他のノード(ゴシップ)とのネットワーク接続の確立と維持を担当しています。
+
This document explains the inner workings of the peer-to-peer layer of the Tezos shell. This part is in charge of establishing and maintaining network connections with other nodes (gossip).
  
P2P層はノードによってインスタンス化される。ネットワークを介して交換されるメッセージのタイプ(異なるP2Pプロトコルのバージョン/拡張を許可するため)、および各ピアに関連付けられたメタデータのタイプによってパラメータ化されます。後者は、私たちが持っている信頼のレベルを反映する各ピアのスコアを計算するのに便利です。異なるスコア値を持つピアと通信するときに、異なるポリシーを使用できます。
+
The P2P layer is instanciated by the node. It is parametrized by the type of messages that are exchanged over the network (to allow different P2P protocol versions/extensions), and the type of metadata associated to each peer. The latter is useful to compute a score for each peer that reflects the level of trust we have in it. Different policies can be used when communicating with peers with different score values.
  
P2Pレイヤーは、接続のプール、それらの接続上の一連の操作、およびコードベースで広く使用されるワーカーパターンに従った一連のワーカーで構成されます。
+
The P2P layer is comprised of a pool of connections, a set of operations on those connections, and a set of workers following the worker pattern pervasively used in the code base.
  
P2Pレイヤーは、パッケージ:<code> tezos-p2p </code>にパッケージ化されています。
+
The P2P layer is packaged in :package:<code>tezos-p2p</code>, which has documentation for all modules.
  
==一般的な操作==
+
== General operation ==
  
入出力スケジューリング<sub> <sub> <sub> <sub> <sub>?</sub> </sub> </sub> </sub> </sub>?
+
I/O Scheduling <sub><sub><sub><sub><sub><sub>~</sub></sub></sub></sub></sub></sub>~
  
P2P層は、帯域幅の使用を制御するとともに、異なるピア(例えば、読み出し/書き込みクォータ)に異なるポリシーを実装するために、I / Oスケジューリングを使用する。今のところ、各ピアにはグローバルに割り当てられた帯域幅の公平な配分が与えられますが、各ピアへの個々の割り当て帯域幅がピアのスコアの関数になるように計画されています。
+
The P2P layer uses I/O scheduling in order to be able to control its bandwidth usage as well as implementing different policies (e.g. read/write quotas) to different peers. For now, each peer is granted a fair share of the global allocated bandwidth, but it is planned for the individual allocated bandwidth to each peer to be a function of the peer's score.
  
暗号化<sub> <sub>?</sub>?</sub> ~~
+
Encryption <sub><sub>~</sub>~</sub>~~
  
各ピア間の接続は、<code> NaCl </code> authenticated-encryption <code> API <http://nacl.cr.yp.to/box.html&gt; </code> __を使用して暗号化されます。これは、ピア間の通信にセキュリティと改ざん防止の追加レベルを提供するために行われます。
+
The connection between each peer is encrypted using <code>NaCl</code> authenticated-encryption <code>API &lt;http://nacl.cr.yp.to/box.html&gt;</code>__. This is done to provide an additional level of security and tamper-proof guarantees in the communication between peers.
  
メッセージキュー<sub> <sub> <sub> <sub> <sub>?</sub> </sub> </sub> </sub> </sub>?
+
Message queues <sub><sub><sub><sub><sub><sub>~</sub></sub></sub></sub></sub></sub>~
  
基本I / Oスケジューリングに加えて、2つの有限サイズの型付きメッセージキューを使用して、各ピアの着信(発信)メッセージを格納します。これにより、ピアとの通信が可能になる速度がさらに制限されます。キューがいっぱいになると、追加のメッセージを読み取る(書き込む)ことはできません。 P2Pレイヤーによる高レベルの<code> P2p_socket.connection </..api / odoc / tezos-p2p / Tezos_p2p / P2p_socket / index.html#type-connection&gt; </code> __タイプは、 I / Oスケジューリング、ピアメタデータ、暗号鍵、およびこれらのキューで動作する専用のワーカーによって操作される2つのメッセージキューでアップグレードされます。
+
On top of basic I/O scheduling, two finite-size typed message queues are used to store incoming (resp. outgoing) messages for each peer. This further restricts the speed at which communication is possible with a peer; when a queue is full, it is not possible to read (resp. write) an additional message. The high-level <code>P2p_socket.connection &lt;../api/odoc/tezos-p2p/Tezos_p2p/P2p_socket/index.html#type-connection&gt;</code>__ type by the P2P layer is basically a UNIX socket upgraded with I/O scheduling, peer metadata, cryptographic keys and two messages queues operated by dedicated workers which operate on those queues.
  
接続のプール<sub> <sub>?</sub>?</sub>?</sub>?</sub>
+
Pool of connections <sub><sub><sub>~</sub></sub><sub><sub><sub>~</sub></sub></sub>~</sub>
  
上記のモジュールはすべて、P2Pレイヤのコアを構成する<code> P2p_pool&lt; .. / api / odoc / tezos-p2p / Tezos_p2p / P2p_pool / index.html&gt; </code> __、以下に説明する作業者プロセス。これは、さまざまな接続テーブルとそれらを照会するメソッドで構成されます。また、接続は、pingへの応答などの低レベルのメッセージがフィルタされ、アプリケーションレベルのメッセージだけが保持される別のメッセージキューで拡張されます。
+
All the above modules are used in <code>P2p_pool &lt;../api/odoc/tezos-p2p/Tezos_p2p/P2p_pool/index.html&gt;</code>__, which constitutes the core of the P2P layer, together with the worker processes described below. It comprises various tables of connections as well as methods to query them, also connections are extended with another message queue where lower level messages (like responses to ping) are filtered out and only application-level messages are kept.
  
P2Pレイヤのメインエントリポイントは、モジュール<code> P2p </api / odoc / tezos-p2p / Tezos_p2p / P2p / index.html&gt; </code> __にあります。 P2P層に作用する労働者の説明については、以下を参照してください。
+
The main entry point of the P2P layer is in module <code>P2p &lt;../api/odoc/tezos-p2p/Tezos_p2p/P2p/index.html&gt;</code>__. See below for a description of workers acting onto the P2P layer.
  
==ウェルカムワーカー==
+
== Welcome worker ==
  
ウェルカムワーカーは、着信接続を受け入れ、それらをP2Pレイヤーによって管理される接続プールに登録する責任があります。基本的には、<code> accept(2)</code>システムコールを実行し、<code> P2p_pool.accept <../api/ odoc / tezos-p2p / Tezos_p2p / P2p_pool / index.html#val-accept> / code> __を使用して、着信接続を認識させます。そこからプールは、この新しい接続をどのように処理するかを決定します。
+
The welcome worker is responsible for accepting incoming connections and register them into the pool of connections managed by the P2P layer. It basically runs the <code>accept(2)</code> syscall and call <code>P2p_pool.accept &lt;../api/odoc/tezos-p2p/Tezos_p2p/P2p_pool/index.html#val-accept&gt;</code>__ so that it is made aware of an incoming connection. From there, the pool will decide how this new connection must be handled.
  
==メンテナンスワーカー==
+
== Maintenance worker ==
  
メンテナンス担当者は、ブロックチェーンの状態を現実的に把握するために、他のノードと適切な数の接続を確立する役割を担っています。それはアクティブな接続を維持するのに必要なピアの望ましい量に関して到達する一連のターゲットで作成されます。
+
The maintenance worker is in charge of establishing an appropriate number of connections with other nodes in order to guarantee a realistic view of the state of the blockchain. It is created with a set of targets to reach regarding the desired amount of peers it needs to keep an active connection to.
  
プールレベルでは、許容可能な最小数(最大数)が定義されます。
+
At the pool level, the minimum (resp. maximum) acceptable number of connections is defined.
  
メンテナンスワーカーレベルでは、<code> target </code>(最小値と最大値)と<code>しきい値</code>(最小値と最大値)の2つの他のしきい値セットが定義されています。
+
At the maintenance worker level, two other sets of thresholds are defined: <code>target</code> (min and max) and <code>threshold</code> (min and max).
  
これらの境界を考えると、メンテナンス担当者は:
+
Given these bounds, the maintenance worker:
  
*シェルが尋ねたとき、または許容可能な接続の最小数または最大数に達したときのどちらか早い方が起きたときに、2分ごとにトリガーされます。
+
* Will be triggered every two minutes, when asked by the shell, or when the minimum or maximum number of acceptable connections is reached, whichever happens first.
*接続数が<code> max_threshold </code>を超えると、接続が<code> max_target </code>接続に到達するまでランダムに終了します。接続数が<code> min_threshold </code>未満の場合、少なくとも<code> min_target </code>接続に到達するまでピアに接続を試みます(<code> max_target </code>接続)。
+
* Will perform the following actions when triggered: if the number of connections is above <code>max_threshold</code>, it will kill connections randomly until it reaches <code>max_target</code> connections. If the number of connections is below <code>min_threshold</code>, it will attempt to connect to peers until it reaches at least <code>min_target</code> connections (and never more than <code>max_target</code> connections).

tezos-wikiへの投稿はすべて、a Creative Commons Attribution-ShareAlike 3.0 License (詳細はTezos-wiki:著作権を参照)のもとで公開したと見なされることにご注意ください。 自分が書いたものが他の人に容赦なく編集され、自由に配布されるのを望まない場合は、ここに投稿しないでください。
また、投稿するのは、自分で書いたものか、パブリック ドメインまたはそれに類するフリーな資料からの複製であることを約束してください。 著作権保護されている作品は、許諾なしに投稿しないでください!

取り消し | 編集の仕方 (新しいウィンドウで開きます)