From f3cf2e0419d6c8fd3f458be8d1e7ce22f435800d Mon Sep 17 00:00:00 2001 From: Akihiro MOTOKI Date: Sun, 27 Apr 2014 01:55:46 +0900 Subject: [PATCH] (split) LDP: Complete packet.7 and tcp.7 --- draft/man7/packet.7 | 170 +++++++++++++++++++++----------------------------- draft/man7/tcp.7 | 56 +++++++---------- po4a/net/po/ja.po | 67 ++++++++++++-------- release/man7/packet.7 | 170 +++++++++++++++++++++----------------------------- release/man7/tcp.7 | 56 +++++++---------- stats/net | 2 - translation_list | 4 +- untrans.html | 4 +- 8 files changed, 231 insertions(+), 298 deletions(-) diff --git a/draft/man7/packet.7 b/draft/man7/packet.7 index 1f42d859..a5cbe766 100644 --- a/draft/man7/packet.7 +++ b/draft/man7/packet.7 @@ -29,7 +29,7 @@ packet \- デバイスレベルのパケットインターフェース .br \fB#include \fP .br -\fB#include /* the L2 protocols */\fP +\fB#include /* L2 プロトコル */\fP .sp \fBpacket_socket = socket(AF_PACKET, int \fP\fIsocket_type\fP\fB, int \fP\fIprotocol\fP\fB);\fP .fi @@ -140,16 +140,15 @@ struct packet_mreq { .TP \fBPACKET_AUXDATA\fP (Linux 2.6.21 以降) .\" commit 8dc4194474159660d7f37c495e3fc3f10d0db8cc -If this binary option is enabled, the packet socket passes a metadata -structure along with each packet in the \fBrecvmsg\fP(2) control field. The -structure can be read with \fBcmsg\fP(3). It is defined as +ブール値のオプションを有効すると、 パケットソケットは、パケットと一緒にメタデータ構造体を \fBrecvmsg\fP(2) コントロールフィールドで渡す。 +この構造体は \fBcmsg\fP(3) を使って読むことができる。 定義は以下の通りである。 .in +4n .nf struct tpacket_auxdata { __u32 tp_status; - __u32 tp_len; /* packet length */ - __u32 tp_snaplen; /* captured length */ + __u32 tp_len; /* パケット長 */ + __u32 tp_snaplen; /* キャプチャした長さ */ __u16 tp_mac; __u16 tp_net; __u16 tp_vlan_tci; @@ -160,124 +159,99 @@ struct tpacket_auxdata { .TP \fBPACKET_FANOUT\fP (Linux 3.1 以降) .\" commit dc99f600698dcac69b8f56dda9a8a00d645c5ffc -To scale processing across threads, packet sockets can form a fanout group. -In this mode, each matching packet is enqueued onto only one socket in the -group. A socket joins a fanout group by calling \fBsetsockopt\fP(2) with -level \fBSOL_PACKET\fP and option \fBPACKET_FANOUT\fP. Each network namespace can -have up to 65536 independent groups. A socket selects a group by encoding -the ID in the first 16 bits of the integer option value. The first packet -socket to join a group implicitly creates it. To successfully join an -existing group, subsequent packet sockets must have the same protocol, -device settings, fanout mode and flags (see below). Packet sockets can -leave a fanout group only by closing the socket. The group is deleted when -the last socket is closed. +スレッドにまたがって処理をスケールさせるため、 パケットソケットはファンアウトグループを構成することができる。 このモードでは、 +マッチしたそれぞれのパケットはグループ内のいずれか一つのソケットにだけキューイングされる。 ソケットをファンアウトグループに参加させるには、 レベル +\fBSOL_PACKET\fP でオプション \fBPACKET_FANOUT\fP を指定して \fBsetsockopt\fP(2) を呼び出す。 +ネットワーク名前空間毎に最大 65536 個の独立したグループを持つことができる。 整数のオプション値の先頭 16 ビットに ID +をエンコードすることで、 ソケットはグループを選択する。 あるグループへの最初のパケットソケットの参加があった時点で、 +グループは暗黙のうちに作成される。 既存のグループへの参加が成功するためには、 それ以降にそのグループに参加しようとするパケットソケットは、 +プロトコロ、 デバイス設定、ファンアウトモード、フラグが同じである必要がある (下記参照)。 パケットソケットがファンアウトグループから抜けるのは、 +そのソケットをクローズした場合だけである。 ファンアウトグループは最後のソケットがクローズした場合に削除される。 .\" commit 2d36097d26b5991d71a2cf4a20c1a158f0f1bfcd -Fanout supports multiple algorithms to spread traffic between sockets. The -default mode, \fBPACKET_FANOUT_HASH\fP, sends packets from the same flow to the -same socket to maintain per\-flow ordering. For each packet, it chooses a -socket by taking the packet flow hash modulo the number of sockets in the -group, where a flow hash is a hash over network\-layer address and optional -transport\-layer port fields. The load\-balance mode \fBPACKET_FANOUT_LB\fP -implements a round\-robin algorithm. \fBPACKET_FANOUT_CPU\fP selects the socket -based on the CPU that the packet arrived on. \fBPACKET_FANOUT_ROLLOVER\fP -processes all data on a single socket, moves to the next when one becomes -backlogged. \fBPACKET_FANOUT_RND\fP selects the socket using a pseudo\-random -number generator. \fBPACKET_FANOUT_QM\fP (available since Linux 3.14) selects -the socket using the recorded queue_mapping of the received skb. - -Fanout modes can take additional options. IP fragmentation causes packets -from the same flow to have different flow hashes. The flag -\fBPACKET_FANOUT_FLAG_DEFRAG\fP, if set, causes packet to be defragmented -before fanout is applied, to preserve order even in this case. Fanout mode -and options are communicated in the second 16 bits of the integer option -value. The flag \fBPACKET_FANOUT_FLAG_ROLLOVER\fP enables the roll over -mechanism as a backup strategy: if the original fanout algorithm selects a -backlogged socket, the packet rolls over to the next available one. +ファンアウトでは、 複数のソケットにトラフィックを分散させるアルゴリズムを複数サポートしている。 デフォルトのモードである +\fBPACKET_FANOUT_HASH\fP では、同じフローのパケットは同じソケットに送信され、 フロー単位の順序が維持される。 +パケットごとに、パケットフローのハッシュの、そのグループのソケット数に対する剰余が計算され、ソケットが選択される。 +なお、フローハッシュはネットワーク層のアドレスとトランスポート層のポートフィールドに対するハッシュである (トランスポート層ポートは存在する場合のみ)。 +負荷分散モード \fBPACKET_FANOUT_LB\fP はラウンドロビンアルゴリズムが採用されている。 \fBPACKET_FANOUT_CPU\fP では、 +パケットが到着した CPU に基づいてソケットを選択する。 \fBPACKET_FANOUT_ROLLOVER\fP +はすべてのデータを一つのソケットで処理し、 そのソケットで処理待ち (backlog) が発生した場合に次のソケットに移る。 +\fBPACKET_FANOUT_RND\fP では擬似乱数発生器を使ってソケットが選択される。 \fBPACKET_FANOUT_QM\fP (Linux +3.14 以降で利用可能) では受信 skb に記録された queue_mapping を使ってソケットが選択される。 + +ファンアウトモードでは追加のオプションがある。 IP フラグメンテーションが起こると、 +同じフローのパケットのフローハッシュが異なるハッシュを持つことになる。 フラグ \fBPACKET_FANOUT_FLAG_DEFRAG\fP +をセットすると、 パケットはファンアウトを行う前にフラグメント再構築が行われるようになり、 フラグメントがあった場合でも順序が維持される。 +ファンアウトモードとオプションは、 整数のオプション値の下位 16 ビットで指定される。 フラグ +\fBPACKET_FANOUT_FLAG_ROLLOVER\fP を指定すると、 バックアップ戦略としてロールオーバー方式が有効になる。 +元のファンアウトアルゴリズムが backlog ソケットを選択していれば、 パケットは次の利用可能なソケットにロールオーバーされる。 .TP -\fBPACKET_LOSS\fP (with \fBPACKET_TX_RING\fP) -If set, do not silently drop a packet on transmission error, but return it -with status set to \fBTP_STATUS_WRONG_FORMAT\fP. +\fBPACKET_LOSS\fP (\fBPACKET_TX_RING\fP で使用) +有効にすると、転送エラーの場合にパケットをエラーなしに黙って破棄せず、 ステータスを \fBTP_STATUS_WRONG_FORMAT\fP +にセットして返る。 .TP -\fBPACKET_RESERVE\fP (with \fBPACKET_RX_RING\fP) -By default, a packet receive ring writes packets immediately following the -metadata structure and alignment padding. This integer option reserves -additional headroom. +\fBPACKET_RESERVE\fP (\fBPACKET_RX_RING\fP で使用) +デフォルトでは、パケット受信リングはメタデータ構造体とアライメント用のパディングの直後にパケットを書き込む。 +この整数オプションを設定すると、パケットの前に追加で領域が予約される。 .TP \fBPACKET_RX_RING\fP -Create a memory\-mapped ring buffer for asynchronous packet reception. The -packet socket reserves a contiguous region of application address space, -lays it out into an array of packet slots and copies packets (up to -\fItp_snaplen\fP) into subsequent slots. Each packet is preceded by a -metadata structure similar to \fItpacket_auxdata\fP. The protocol fields -encode the offset to the data from the start of the metadata header. -\fItp_net\fP stores the offset to the network layer. If the packet socket is -of type \fBSOCK_DGRAM\fP, then \fItp_mac\fP is the same. If it is of type -\fBSOCK_RAW\fP, then that field stores the offset to the link\-layer frame. -Packet socket and application communicate the head and tail of the ring -through the \fItp_status\fP field. The packet socket owns all slots with -status \fBTP_STATUS_KERNEL\fP. After filling a slot, it changes the status of -the slot to transfer ownership to the application. During normal operation, -the new status is \fBTP_STATUS_USER\fP, to signal that a correctly received -packet has been stored. When the application has finished processing a -packet, it transfers ownership of the slot back to the socket by setting the -status to \fBTP_STATUS_KERNEL\fP. Packet sockets implement multiple variants -of the packet ring. The implementation details are described in -\fIDocumentation/networking/packet_mmap.txt\fP in the Linux kernel source tree. +非同期でのパケット受信用のメモリマップされたリングバッファを作成する。 パケットソケットはアプリケーションのアドレス空間に連続する領域を確保し、 +そこにパケットスロットの配列を構成し、 (最大 \fItp_snaplen\fP 個の) パケットを順にスロットにコピーする。 各パケットの前には +\fItpacket_auxdata\fP に似たメタデータ構造体が置かれる。 +プロトコルフィールドには、データの、メタデータヘッダーの先頭からのオフセットが入る。 \fItp_net\fP にはネットワーク層へのオフセットが格納される。 +パケットソケットが \fBSOCK_DGRAM\fP 型の場合、 \fItp_mac\fP も同じである。 \fBSOCK_RAW\fP 型の場合、 \fItp_net\fP +にはリンク層のフレームへのオフセットが入る。 パケットソケットとアプリケーションは \fItp_status\fP フィールドを通してリングの先頭 +(head) と末尾 (tail) の情報を受け渡す。 パケットソケットはすべてのスロットをステータス \fBTP_STATUS_KERNEL\fP +で所有しており、 スロットにデータが入ると、パケットソケットはそのスロットのステータスをアプリケーションに所有権を渡す状態に変更する。 +通常の動作では、新しいステータスは \fBTP_STATUS_USER\fP であり、これは正しく受信されたパケットが格納されたことを示している。 +アプリケーションがパケットの処理を終えると、アプリケーションはそのスロットのステータスを \fBTP_STATUS_KERNEL\fP +に設定し、そのスロットの所有権をソケットに返す。 パケットソケットは、複数バージョンのパケットリングを実装している。 実装の詳細は Linux +カーネルソースツリーの \fIDocumentation/networking/packet_mmap.txt\fP で説明されている。 .TP \fBPACKET_STATISTICS\fP -Retrieve packet socket statistics in the form of a structure +パケットソケットの統計情報を次の構造体形式で取得する。 .in +4n .nf struct tpacket_stats { - unsigned int tp_packets; /* Total packet count */ - unsigned int tp_drops; /* Dropped packet count */ + unsigned int tp_packets; /* 総パケット数 */ + unsigned int tp_drops; /* ドロップパケット数 */ }; .fi .in -Receiving statistics resets the internal counters. The statistics structure -differs when using a ring of variant \fBTPACKET_V3\fP. +統計情報を取得すると、内部カウンターはリセットされる。 \fBTPACKET_V3\fP のリングを使う場合には、統計情報構造体は違うものになる。 .TP -\fBPACKET_TIMESTAMP\fP (with \fBPACKET_RX_RING\fP; since Linux 2.6.36) +\fBPACKET_TIMESTAMP\fP (\fBPACKET_RX_RING\fP で使用; Linux 2.6.36 以降) .\" commit 614f60fa9d73a9e8fdff3df83381907fea7c5649 -The packet receive ring always stores a timestamp in the metadata header. -By default, this is a software generated timestamp generated when the packet -is copied into the ring. This integer option selects the type of -timestamp. Besides the default, it support the two hardware formats -described in \fIDocumentation/networking/timestamping.txt\fP in the Linux -kernel source tree. +パケット受信リングでは常にタイムスタンプがメタデータヘッダーに格納される。 +デフォルトでは、タイムスタンプはパケットがリングにコピーされた時点で生成されるソフトウェアによるタイムスタンプである。 +この整数オプションによりタイムスタンプの種類を選択できる。 デフォルト以外では、 Linux カーネルソースツリーの +\fIDocumentation/networking/timestamping.txt\fP に説明がある 2 +種類のハードウェアフォーマットがサポートされている。 .TP \fBPACKET_TX_RING\fP (Linux 2.6.31 以降) .\" commit 69e3c75f4d541a6eb151b3ef91f34033cb3ad6e1 -Create a memory\-mapped ring buffer for packet transmission. This option is -similar to \fBPACKET_RX_RING\fP and takes the same arguments. The application -writes packets into slots with status \fBTP_STATUS_AVAILABLE\fP and schedules -them for transmission by changing the status to \fBTP_STATUS_SEND_REQUEST\fP. -When packets are ready to be transmitted, the application calls \fBsend\fP(2) -or a variant thereof. The \fIbuf\fP and \fIlen\fP fields of this call are -ignored. If an address is passed using \fBsendto\fP(2) or \fBsendmsg\fP(2), then -that overrides the socket default. On successful transmission, the socket -resets the slot to \fBTP_STATUS_AVAILABLE\fP. It discards packets silently on -error unless \fBPACKET_LOSS\fP is set. +パケット送信用のメモリマップされたリングバッファを作成する。 このオプションは \fBPACKET_RX_RING\fP と同様で、同じ引き数を取る。 +アプリケーションはステータスが \fBTP_STATUS_AVAILABLE\fP のスロットにパケットを書き込み、 +\fBTP_STATUS_SEND_REQUEST\fP にステータスを変更することでそのパケットが送信できるようにする。 +パケットの送信準備ができたら、アプリケーションは続けて \fBsend\fP(2) 系のシステムコールを呼び出す。 システムコールの引き数 \fIbuf\fP と +\fIlen\fP は無視される。 \fBsendto\fP(2) や \fBsendmsg\fP(2) を使ってアドレスが渡された場合、 +ソケットのデフォルト値ではなくそのアドレスが使用される。 送信に成功すると、ソケットはそのスロットを \fBTP_STATUS_AVAILABLE\fP +に戻す。 エラーの場合、 \fBPACKET_LOSS\fP がセットされていなければエラーなしでパケットは廃棄される。 .TP -\fBPACKET_VERSION\fP (with \fBPACKET_RX_RING\fP; since Linux 2.6.27) +\fBPACKET_VERSION\fP (\fBPACKET_RX_RING\fP で使用; Linux 2.6.27 以降) .\" commit bbd6ef87c544d88c30e4b762b1b61ef267a7d279 -By default, \fBPACKET_RX_RING\fP creates a packet receive ring of variant -\fBTPACKET_V1\fP. To create another variant, configure the desired variant by -setting this integer option before creating the ring. +デフォルトでは、 \fBPACKET_RX_RING\fP は \fBTPACKET_V1\fP +のパケット受信リングを作成する。別のバージョンのリングを作成するには、そのリングを作成する前に希望するバージョンが使われるようにこの整数オプションを設定すること。 .TP \fBPACKET_QDISC_BYPASS\fP (Linux 3.14 以降) .\" commit d346a3fae3ff1d99f5d0c819bf86edf9094a26a1 -By default, packets sent through packet sockets pass through the kernel's -qdisc (traffic control) layer, which is fine for the vast majority of use -cases. For traffic generator appliances using packet sockets that intend to -brute\-force flood the network\(emfor example, to test devices under load in -a similar fashion to pktgen\(emthis layer can be bypassed by setting this -integer option to 1. A side effect is that packet buffering in the qdisc -layer is avoided, which will lead to increased drops when network device -transmit queues are busy; therefore, use at your own risk. +デフォルトでは、パケットはカーネルの qdisc (トラフィック制御) レイヤー経由で渡される。 これは大半のユースケースに合っている。 +ネットワークに対して可能な限りパケットを送信する (例えば pkggen と同様の方法で負荷対象のデバイスを試験する) +のにパケットソケットを使うトラフィック生成アプライアンスでは、この整数オプションを 1 に設定することで qdisc レイヤーを飛ばすことができる。 +qdisc レイヤーでのパケットバッファが行われなくなるという副作用がある。 これにより、 +ネットワークデバイスの送信キューの使用量が高い場合にパケット廃棄が起きやすくなる。 .SS ioctl .\" FIXME Document SIOCGSTAMPNS \fBSIOCGSTAMP\fP を用いると、最後に受信したパケットのタイムスタンプを得ることができる。 引き数は \fIstruct timeval\fP diff --git a/draft/man7/tcp.7 b/draft/man7/tcp.7 index a925abff..4006468d 100644 --- a/draft/man7/tcp.7 +++ b/draft/man7/tcp.7 @@ -198,12 +198,11 @@ ACK が遅延 ACK (delayed acknowledgment) を相殺するための 2 セグメ \fItcp_autocorking\fP (ブール値; デフォルト: 有効; Linux 3.14 以降) .\" commit f54b311142a92ea2e42598e347b84e1655caf8e3 .\" Text heavily based on Documentation/networking/ip-sysctl.txt -If this option is enabled, the kernel tries to coalesce small writes (from -consecutive \fBwrite\fP(2) and \fBsendmsg\fP(2) calls) as much as possible, in -order to decrease the total number of sent packets. Coalescing is done if -at least one prior packet for the flow is waiting in Qdisc queues or device -transmit queue. Applications can still use the \fBTCP_CORK\fP socket option to -obtain optimal behavior when they know how/when to uncork their sockets. +このオプションを有効にすると、 送信総パケット数を減らすため、 カーネルは小さな write (連続する \fBwrite\fP(2) や +\fBsendmsg\fP(2) の呼び出し) を可能な限り結合しようとする。 パケットの結合が行われるのは、そのフローの前のパケットが少なくとも一つは +qdisc キューかデバイスの送信キューで送信待ちの場合である。 このオプションが有効な場合でも \fBTCP_CORK\fP +オプションを使うことができ、アプリケーションがソケットの「コルク解除」(送信待ち状態の解除) +をいつどのように行えばよいか分かっている場合には、最適な動作をさせることができる。 .TP \fItcp_available_congestion_control\fP (String; read\-only; Linux 2.4.20 以降) .\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt @@ -579,13 +578,10 @@ TCP ソケットのオプションは、 オプションレベル引数に \fIIP \fBTCP_CONGESTION\fP (Linux 2.6.13 以降) .\" commit 5f8ef48d240963093451bcf83df89f1a1364f51d .\" Author: Stephen Hemminger -The argument for this option is a string. This option allows the caller to -set the TCP congestion control algorithm to be used, on a per\-socket basis. -Unprivileged processes are restricted to choosing one of the algorithms in -\fItcp_allowed_congestion_control\fP (described above). Privileged processes -(\fBCAP_NET_ADMIN\fP) can choose from any of the available congestion\-control -algorithms (see the description of \fItcp_available_congestion_control\fP -above). +このオプションの引き数は文字列である。 このオプションを使うと、呼び出し元がソケット単位に使用する TCP 輻輳制御アルゴリズムを設定することができる。 +非特権プロセスが使用できるアルゴリズムは (上述の) \fItcp_allowed_congestion_control\fP +で設定されたものだけに制限される。 特権プロセス (\fBCAP_NET_ADMIN\fP) は任意の輻輳制御アルゴリズムを選択することができる (上記の +\fBtcp_available_congestion_control\fP の説明を参照)。 .TP \fBTCP_CORK\fP (Linux 2.2 以降) .\" precisely: since 2.1.127 @@ -660,32 +656,24 @@ quickack モードでは ack はすぐに送信される。 このフラグは .\" The following text taken nearly verbatim from Jerry Chu's (excellent) .\" commit message. .\" -This option takes an \fIunsigned int\fP as an argument. When the value is -greater than 0, it specifies the maximum amount of time in milliseconds that -transmitted data may remain unacknowledged before TCP will forcibly close -the corresponding connection and return \fBETIMEDOUT\fP to the application. If -the option value is specified as 0, TCP will to use the system default. +このオプションは \fIunsigned int\fP 型の引き数を取る。 値が 0 より大きい場合、その値は、 どのくらいの時間、送信されたデータが ACK +を受信しないままの状態が続くと、 TCP がその接続を強制的にクローズし、アプリケーションに \fBETIMEDOUT\fP を返すかを、 +ミリ秒単位で指定する。 オプションの値が 0 の場合、TCP はシステムのデフォルト値を使用する。 -Increasing user timeouts allows a TCP connection to survive extended periods -without end\-to\-end connectivity. Decreasing user timeouts allows -applications to "fail fast", if so desired. Otherwise, failure may take up -to 20 minutes with the current system defaults in a normal WAN environment. +ユーザータイムアウトを長くすると、 通信の両端での接続性がない場合でも長い時間 TCP 接続が維持されるようになる。 ユーザータイムアウトを短くすると、 +アプリケーションは必要であれば「早く失敗」できるようになる。 設定しなかった場合は、 通常の WAN 環境では現在のシステムのデフォルトの 20 +分で失敗することになる。 -This option can be set during any state of a TCP connection, but is only -effective during the synchronized states of a connection (ESTABLISHED, -FIN\-WAIT\-1, FIN\-WAIT\-2, CLOSE\-WAIT, CLOSING, and LAST\-ACK). Moreover, when -used with the TCP keepalive (\fBSO_KEEPALIVE\fP) option, \fBTCP_USER_TIMEOUT\fP -will override keepalive to determine when to close a connection due to -keepalive failure. +このオプションは TCP 接続がどの状態の場合でも設定することができるが、 接続が同期状態 (ESTABLISHED, FIN\-WAIT\-1, +FIN\-WAIT\-2, CLOSE\-WAIT, CLOSING, LAST\-ACK) の場合のみ効果がある。 また、 TCP keepalive +(\fBSO_KEEPALIVE\fP) オプションとともに使用された場合、 \fBTCP_USER_TIMEOUT\fP は keepalive +失敗による接続クローズを判定するための keepalive 値を上書きする。 -The option has no effect on when TCP retransmits a packet, nor when a -keepalive probe is sent. +このオプションは TCP がパケットを再送する際や keepalive プローブを送信する際には影響を及ぼさない。 -This option, like many others, will be inherited by the socket returned by -\fBaccept\fP(2), if it was set on the listening socket. +他の多くのオプション同様、リッスン中のソケットでこのオプションがセットされていれば \fBaccept\fP(2) が返すソケットにオプションが継承される。 -Further details on the user timeout feature can be found in RFC\ 793 and -RFC\ 5482 ("TCP User Timeout Option"). +ユーザータイムアウト機能の詳細は RFC\ 793 と RFC\ 5482 ("TCP User Timeout Option") に書かれている。 .TP \fBTCP_WINDOW_CLAMP\fP (Linux 2.4 以降) .\" Precisely: since 2.3.41 diff --git a/po4a/net/po/ja.po b/po4a/net/po/ja.po index 93ad0a5a..481a6217 100644 --- a/po4a/net/po/ja.po +++ b/po4a/net/po/ja.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2014-04-24 00:51+0900\n" -"PO-Revision-Date: 2014-04-24 05:23+0900\n" +"PO-Revision-Date: 2014-04-27 01:54+0900\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" @@ -15986,7 +15986,7 @@ msgstr "B<#include Enetpacket/packet.hE>\n" #: build/C/man7/packet.7:22 #, no-wrap msgid "B<#include Enet/ethernet.hE /* the L2 protocols */>\n" -msgstr "B<#include Enet/ethernet.hE /* the L2 protocols */>\n" +msgstr "B<#include Enet/ethernet.hE /* L2 プロトコル */>\n" #. type: Plain text #: build/C/man7/packet.7:24 @@ -16282,7 +16282,7 @@ msgid "" "If this binary option is enabled, the packet socket passes a metadata " "structure along with each packet in the B(2) control field. The " "structure can be read with B(3). It is defined as" -msgstr "" +msgstr "ブール値のオプションを有効すると、 パケットソケットは、パケットと一緒にメタデータ構造体を B(2) コントロールフィールドで渡す。 この構造体は B(3) を使って読むことができる。 定義は以下の通りである。" #. type: Plain text #: build/C/man7/packet.7:258 @@ -16298,6 +16298,15 @@ msgid "" " __u16 tp_padding;\n" "};\n" msgstr "" +"struct tpacket_auxdata {\n" +" __u32 tp_status;\n" +" __u32 tp_len; /* パケット長 */\n" +" __u32 tp_snaplen; /* キャプチャした長さ */\n" +" __u16 tp_mac;\n" +" __u16 tp_net;\n" +" __u16 tp_vlan_tci;\n" +" __u16 tp_padding;\n" +"};\n" #. type: TP #: build/C/man7/packet.7:260 @@ -16320,7 +16329,7 @@ msgid "" "device settings, fanout mode and flags (see below). Packet sockets can " "leave a fanout group only by closing the socket. The group is deleted when " "the last socket is closed." -msgstr "" +msgstr "スレッドにまたがって処理をスケールさせるため、 パケットソケットはファンアウトグループを構成することができる。 このモードでは、 マッチしたそれぞれのパケットはグループ内のいずれか一つのソケットにだけキューイングされる。 ソケットをファンアウトグループに参加させるには、 レベル B でオプション B を指定して B(2) を呼び出す。 ネットワーク名前空間毎に最大 65536 個の独立したグループを持つことができる。 整数のオプション値の先頭 16 ビットに ID をエンコードすることで、 ソケットはグループを選択する。 あるグループへの最初のパケットソケットの参加があった時点で、 グループは暗黙のうちに作成される。 既存のグループへの参加が成功するためには、 それ以降にそのグループに参加しようとするパケットソケットは、 プロトコロ、 デバイス設定、ファンアウトモード、フラグが同じである必要がある (下記参照)。 パケットソケットがファンアウトグループから抜けるのは、 そのソケットをクローズした場合だけである。 ファンアウトグループは最後のソケットがクローズした場合に削除される。" #. commit 2d36097d26b5991d71a2cf4a20c1a158f0f1bfcd #. type: Plain text @@ -16338,7 +16347,7 @@ msgid "" "backlogged. B selects the socket using a pseudo-random " "number generator. B (available since Linux 3.14) selects " "the socket using the recorded queue_mapping of the received skb." -msgstr "" +msgstr "ファンアウトでは、 複数のソケットにトラフィックを分散させるアルゴリズムを複数サポートしている。 デフォルトのモードである B では、同じフローのパケットは同じソケットに送信され、 フロー単位の順序が維持される。 パケットごとに、パケットフローのハッシュの、そのグループのソケット数に対する剰余が計算され、ソケットが選択される。 なお、フローハッシュはネットワーク層のアドレスとトランスポート層のポートフィールドに対するハッシュである (トランスポート層ポートは存在する場合のみ)。 負荷分散モード B はラウンドロビンアルゴリズムが採用されている。 B では、 パケットが到着した CPU に基づいてソケットを選択する。 B はすべてのデータを一つのソケットで処理し、 そのソケットで処理待ち (backlog) が発生した場合に次のソケットに移る。 B では擬似乱数発生器を使ってソケットが選択される。 B (Linux 3.14 以降で利用可能) では受信 skb に記録された queue_mapping を使ってソケットが選択される。" #. type: Plain text #: build/C/man7/packet.7:320 @@ -16351,26 +16360,26 @@ msgid "" "value. The flag B enables the roll over " "mechanism as a backup strategy: if the original fanout algorithm selects a " "backlogged socket, the packet rolls over to the next available one." -msgstr "" +msgstr "ファンアウトモードでは追加のオプションがある。 IP フラグメンテーションが起こると、 同じフローのパケットのフローハッシュが異なるハッシュを持つことになる。 フラグ B をセットすると、 パケットはファンアウトを行う前にフラグメント再構築が行われるようになり、 フラグメントがあった場合でも順序が維持される。 ファンアウトモードとオプションは、 整数のオプション値の下位 16 ビットで指定される。 フラグ B を指定すると、 バックアップ戦略としてロールオーバー方式が有効になる。 元のファンアウトアルゴリズムが backlog ソケットを選択していれば、 パケットは次の利用可能なソケットにロールオーバーされる。" #. type: TP #: build/C/man7/packet.7:320 #, no-wrap msgid "B (with B)" -msgstr "" +msgstr "B (B で使用)" #. type: Plain text #: build/C/man7/packet.7:325 msgid "" "If set, do not silently drop a packet on transmission error, but return it " "with status set to B." -msgstr "" +msgstr "有効にすると、転送エラーの場合にパケットをエラーなしに黙って破棄せず、 ステータスを B にセットして返る。" #. type: TP #: build/C/man7/packet.7:325 #, no-wrap msgid "B (with B)" -msgstr "" +msgstr "B (B で使用)" #. type: Plain text #: build/C/man7/packet.7:330 @@ -16378,7 +16387,7 @@ msgid "" "By default, a packet receive ring writes packets immediately following the " "metadata structure and alignment padding. This integer option reserves " "additional headroom." -msgstr "" +msgstr "デフォルトでは、パケット受信リングはメタデータ構造体とアライメント用のパディングの直後にパケットを書き込む。 この整数オプションを設定すると、パケットの前に追加で領域が予約される。" #. type: TP #: build/C/man7/packet.7:330 @@ -16408,7 +16417,7 @@ msgid "" "status to B. Packet sockets implement multiple variants " "of the packet ring. The implementation details are described in " "I in the Linux kernel source tree." -msgstr "" +msgstr "非同期でのパケット受信用のメモリマップされたリングバッファを作成する。 パケットソケットはアプリケーションのアドレス空間に連続する領域を確保し、 そこにパケットスロットの配列を構成し、 (最大 I 個の) パケットを順にスロットにコピーする。 各パケットの前には I に似たメタデータ構造体が置かれる。 プロトコルフィールドには、データの、メタデータヘッダーの先頭からのオフセットが入る。 I にはネットワーク層へのオフセットが格納される。 パケットソケットが B 型の場合、 I も同じである。 B 型の場合、 I にはリンク層のフレームへのオフセットが入る。 パケットソケットとアプリケーションは I フィールドを通してリングの先頭 (head) と末尾 (tail) の情報を受け渡す。 パケットソケットはすべてのスロットをステータス B で所有しており、 スロットにデータが入ると、パケットソケットはそのスロットのステータスをアプリケーションに所有権を渡す状態に変更する。 通常の動作では、新しいステータスは B であり、これは正しく受信されたパケットが格納されたことを示している。 アプリケーションがパケットの処理を終えると、アプリケーションはそのスロットのステータスを B に設定し、そのスロットの所有権をソケットに返す。 パケットソケットは、複数バージョンのパケットリングを実装している。 実装の詳細は Linux カーネルソースツリーの I で説明されている。" #. type: TP #: build/C/man7/packet.7:370 @@ -16419,7 +16428,7 @@ msgstr "B" #. type: Plain text #: build/C/man7/packet.7:373 msgid "Retrieve packet socket statistics in the form of a structure" -msgstr "" +msgstr "パケットソケットの統計情報を次の構造体形式で取得する。" #. type: Plain text #: build/C/man7/packet.7:380 @@ -16430,19 +16439,23 @@ msgid "" " unsigned int tp_drops; /* Dropped packet count */\n" "};\n" msgstr "" +"struct tpacket_stats {\n" +" unsigned int tp_packets; /* 総パケット数 */\n" +" unsigned int tp_drops; /* ドロップパケット数 */\n" +"};\n" #. type: Plain text #: build/C/man7/packet.7:386 msgid "" "Receiving statistics resets the internal counters. The statistics structure " "differs when using a ring of variant B." -msgstr "" +msgstr "統計情報を取得すると、内部カウンターはリセットされる。 B のリングを使う場合には、統計情報構造体は違うものになる。" #. type: TP #: build/C/man7/packet.7:386 #, no-wrap msgid "B (with B; since Linux 2.6.36)" -msgstr "" +msgstr "B (B で使用; Linux 2.6.36 以降)" #. commit 614f60fa9d73a9e8fdff3df83381907fea7c5649 #. type: Plain text @@ -16454,7 +16467,7 @@ msgid "" "timestamp. Besides the default, it support the two hardware formats " "described in I in the Linux " "kernel source tree." -msgstr "" +msgstr "パケット受信リングでは常にタイムスタンプがメタデータヘッダーに格納される。 デフォルトでは、タイムスタンプはパケットがリングにコピーされた時点で生成されるソフトウェアによるタイムスタンプである。 この整数オプションによりタイムスタンプの種類を選択できる。 デフォルト以外では、 Linux カーネルソースツリーの I に説明がある 2 種類のハードウェアフォーマットがサポートされている。" #. type: TP #: build/C/man7/packet.7:396 @@ -16476,13 +16489,13 @@ msgid "" "that overrides the socket default. On successful transmission, the socket " "resets the slot to B. It discards packets silently on " "error unless B is set." -msgstr "" +msgstr "パケット送信用のメモリマップされたリングバッファを作成する。 このオプションは B と同様で、同じ引き数を取る。 アプリケーションはステータスが B のスロットにパケットを書き込み、 B にステータスを変更することでそのパケットが送信できるようにする。 パケットの送信準備ができたら、アプリケーションは続けて B(2) 系のシステムコールを呼び出す。 システムコールの引き数 I と I は無視される。 B(2) や B(2) を使ってアドレスが渡された場合、 ソケットのデフォルト値ではなくそのアドレスが使用される。 送信に成功すると、ソケットはそのスロットを B に戻す。 エラーの場合、 B がセットされていなければエラーなしでパケットは廃棄される。" #. type: TP #: build/C/man7/packet.7:425 #, no-wrap msgid "B (with B; since Linux 2.6.27)" -msgstr "" +msgstr "B (B で使用; Linux 2.6.27 以降)" #. commit bbd6ef87c544d88c30e4b762b1b61ef267a7d279 #. type: Plain text @@ -16491,7 +16504,7 @@ msgid "" "By default, B creates a packet receive ring of variant " "B. To create another variant, configure the desired variant by " "setting this integer option before creating the ring." -msgstr "" +msgstr "デフォルトでは、 B は B のパケット受信リングを作成する。別のバージョンのリングを作成するには、そのリングを作成する前に希望するバージョンが使われるようにこの整数オプションを設定すること。" #. type: TP #: build/C/man7/packet.7:434 @@ -16511,7 +16524,7 @@ msgid "" "integer option to 1. A side effect is that packet buffering in the qdisc " "layer is avoided, which will lead to increased drops when network device " "transmit queues are busy; therefore, use at your own risk." -msgstr "" +msgstr "デフォルトでは、パケットはカーネルの qdisc (トラフィック制御) レイヤー経由で渡される。 これは大半のユースケースに合っている。 ネットワークに対して可能な限りパケットを送信する (例えば pkggen と同様の方法で負荷対象のデバイスを試験する) のにパケットソケットを使うトラフィック生成アプライアンスでは、この整数オプションを 1 に設定することで qdisc レイヤーを飛ばすことができる。 qdisc レイヤーでのパケットバッファが行われなくなるという副作用がある。 これにより、 ネットワークデバイスの送信キューの使用量が高い場合にパケット廃棄が起きやすくなる。" #. FIXME Document SIOCGSTAMPNS #. type: Plain text @@ -19779,7 +19792,7 @@ msgid "" "at least one prior packet for the flow is waiting in Qdisc queues or device " "transmit queue. Applications can still use the B socket option to " "obtain optimal behavior when they know how/when to uncork their sockets." -msgstr "" +msgstr "このオプションを有効にすると、 送信総パケット数を減らすため、 カーネルは小さな write (連続する B(2) や B(2) の呼び出し) を可能な限り結合しようとする。 パケットの結合が行われるのは、そのフローの前のパケットが少なくとも一つは qdisc キューかデバイスの送信キューで送信待ちの場合である。 このオプションが有効な場合でも B オプションを使うことができ、アプリケーションがソケットの「コルク解除」(送信待ち状態の解除) をいつどのように行えばよいか分かっている場合には、最適な動作をさせることができる。" #. type: TP #: build/C/man7/tcp.7:321 @@ -21028,7 +21041,7 @@ msgid "" "(B) can choose from any of the available congestion-control " "algorithms (see the description of I " "above)." -msgstr "" +msgstr "このオプションの引き数は文字列である。 このオプションを使うと、呼び出し元がソケット単位に使用する TCP 輻輳制御アルゴリズムを設定することができる。 非特権プロセスが使用できるアルゴリズムは (上述の) I で設定されたものだけに制限される。 特権プロセス (B) は任意の輻輳制御アルゴリズムを選択することができる (上記の B の説明を参照)。" #. type: TP #: build/C/man7/tcp.7:922 @@ -21281,7 +21294,7 @@ msgid "" "transmitted data may remain unacknowledged before TCP will forcibly close " "the corresponding connection and return B to the application. If " "the option value is specified as 0, TCP will to use the system default." -msgstr "" +msgstr "このオプションは I 型の引き数を取る。 値が 0 より大きい場合、その値は、 どのくらいの時間、送信されたデータが ACK を受信しないままの状態が続くと、 TCP がその接続を強制的にクローズし、アプリケーションに B を返すかを、 ミリ秒単位で指定する。 オプションの値が 0 の場合、TCP はシステムのデフォルト値を使用する。" #. type: Plain text #: build/C/man7/tcp.7:1062 @@ -21291,7 +21304,7 @@ msgid "" "applications to \"fail fast\", if so desired. Otherwise, failure may take " "up to 20 minutes with the current system defaults in a normal WAN " "environment." -msgstr "" +msgstr "ユーザータイムアウトを長くすると、 通信の両端での接続性がない場合でも長い時間 TCP 接続が維持されるようになる。 ユーザータイムアウトを短くすると、 アプリケーションは必要であれば「早く失敗」できるようになる。 設定しなかった場合は、 通常の WAN 環境では現在のシステムのデフォルトの 20 分で失敗することになる。" #. type: Plain text #: build/C/man7/tcp.7:1072 @@ -21302,28 +21315,28 @@ msgid "" "with the TCP keepalive (B) option, B will " "override keepalive to determine when to close a connection due to keepalive " "failure." -msgstr "" +msgstr "このオプションは TCP 接続がどの状態の場合でも設定することができるが、 接続が同期状態 (ESTABLISHED, FIN-WAIT-1, FIN-WAIT-2, CLOSE-WAIT, CLOSING, LAST-ACK) の場合のみ効果がある。 また、 TCP keepalive (B) オプションとともに使用された場合、 B は keepalive 失敗による接続クローズを判定するための keepalive 値を上書きする。" #. type: Plain text #: build/C/man7/tcp.7:1075 msgid "" "The option has no effect on when TCP retransmits a packet, nor when a " "keepalive probe is sent." -msgstr "" +msgstr "このオプションは TCP がパケットを再送する際や keepalive プローブを送信する際には影響を及ぼさない。" #. type: Plain text #: build/C/man7/tcp.7:1079 msgid "" "This option, like many others, will be inherited by the socket returned by " "B(2), if it was set on the listening socket." -msgstr "" +msgstr "他の多くのオプション同様、リッスン中のソケットでこのオプションがセットされていれば B(2) が返すソケットにオプションが継承される。" #. type: Plain text #: build/C/man7/tcp.7:1082 msgid "" "Further details on the user timeout feature can be found in RFC\\ 793 and RFC" "\\ 5482 (\"TCP User Timeout Option\")." -msgstr "" +msgstr "ユーザータイムアウト機能の詳細は RFC\\ 793 と RFC\\ 5482 (\"TCP User Timeout Option\") に書かれている。" #. type: TP #: build/C/man7/tcp.7:1082 diff --git a/release/man7/packet.7 b/release/man7/packet.7 index 1f42d859..a5cbe766 100644 --- a/release/man7/packet.7 +++ b/release/man7/packet.7 @@ -29,7 +29,7 @@ packet \- デバイスレベルのパケットインターフェース .br \fB#include \fP .br -\fB#include /* the L2 protocols */\fP +\fB#include /* L2 プロトコル */\fP .sp \fBpacket_socket = socket(AF_PACKET, int \fP\fIsocket_type\fP\fB, int \fP\fIprotocol\fP\fB);\fP .fi @@ -140,16 +140,15 @@ struct packet_mreq { .TP \fBPACKET_AUXDATA\fP (Linux 2.6.21 以降) .\" commit 8dc4194474159660d7f37c495e3fc3f10d0db8cc -If this binary option is enabled, the packet socket passes a metadata -structure along with each packet in the \fBrecvmsg\fP(2) control field. The -structure can be read with \fBcmsg\fP(3). It is defined as +ブール値のオプションを有効すると、 パケットソケットは、パケットと一緒にメタデータ構造体を \fBrecvmsg\fP(2) コントロールフィールドで渡す。 +この構造体は \fBcmsg\fP(3) を使って読むことができる。 定義は以下の通りである。 .in +4n .nf struct tpacket_auxdata { __u32 tp_status; - __u32 tp_len; /* packet length */ - __u32 tp_snaplen; /* captured length */ + __u32 tp_len; /* パケット長 */ + __u32 tp_snaplen; /* キャプチャした長さ */ __u16 tp_mac; __u16 tp_net; __u16 tp_vlan_tci; @@ -160,124 +159,99 @@ struct tpacket_auxdata { .TP \fBPACKET_FANOUT\fP (Linux 3.1 以降) .\" commit dc99f600698dcac69b8f56dda9a8a00d645c5ffc -To scale processing across threads, packet sockets can form a fanout group. -In this mode, each matching packet is enqueued onto only one socket in the -group. A socket joins a fanout group by calling \fBsetsockopt\fP(2) with -level \fBSOL_PACKET\fP and option \fBPACKET_FANOUT\fP. Each network namespace can -have up to 65536 independent groups. A socket selects a group by encoding -the ID in the first 16 bits of the integer option value. The first packet -socket to join a group implicitly creates it. To successfully join an -existing group, subsequent packet sockets must have the same protocol, -device settings, fanout mode and flags (see below). Packet sockets can -leave a fanout group only by closing the socket. The group is deleted when -the last socket is closed. +スレッドにまたがって処理をスケールさせるため、 パケットソケットはファンアウトグループを構成することができる。 このモードでは、 +マッチしたそれぞれのパケットはグループ内のいずれか一つのソケットにだけキューイングされる。 ソケットをファンアウトグループに参加させるには、 レベル +\fBSOL_PACKET\fP でオプション \fBPACKET_FANOUT\fP を指定して \fBsetsockopt\fP(2) を呼び出す。 +ネットワーク名前空間毎に最大 65536 個の独立したグループを持つことができる。 整数のオプション値の先頭 16 ビットに ID +をエンコードすることで、 ソケットはグループを選択する。 あるグループへの最初のパケットソケットの参加があった時点で、 +グループは暗黙のうちに作成される。 既存のグループへの参加が成功するためには、 それ以降にそのグループに参加しようとするパケットソケットは、 +プロトコロ、 デバイス設定、ファンアウトモード、フラグが同じである必要がある (下記参照)。 パケットソケットがファンアウトグループから抜けるのは、 +そのソケットをクローズした場合だけである。 ファンアウトグループは最後のソケットがクローズした場合に削除される。 .\" commit 2d36097d26b5991d71a2cf4a20c1a158f0f1bfcd -Fanout supports multiple algorithms to spread traffic between sockets. The -default mode, \fBPACKET_FANOUT_HASH\fP, sends packets from the same flow to the -same socket to maintain per\-flow ordering. For each packet, it chooses a -socket by taking the packet flow hash modulo the number of sockets in the -group, where a flow hash is a hash over network\-layer address and optional -transport\-layer port fields. The load\-balance mode \fBPACKET_FANOUT_LB\fP -implements a round\-robin algorithm. \fBPACKET_FANOUT_CPU\fP selects the socket -based on the CPU that the packet arrived on. \fBPACKET_FANOUT_ROLLOVER\fP -processes all data on a single socket, moves to the next when one becomes -backlogged. \fBPACKET_FANOUT_RND\fP selects the socket using a pseudo\-random -number generator. \fBPACKET_FANOUT_QM\fP (available since Linux 3.14) selects -the socket using the recorded queue_mapping of the received skb. - -Fanout modes can take additional options. IP fragmentation causes packets -from the same flow to have different flow hashes. The flag -\fBPACKET_FANOUT_FLAG_DEFRAG\fP, if set, causes packet to be defragmented -before fanout is applied, to preserve order even in this case. Fanout mode -and options are communicated in the second 16 bits of the integer option -value. The flag \fBPACKET_FANOUT_FLAG_ROLLOVER\fP enables the roll over -mechanism as a backup strategy: if the original fanout algorithm selects a -backlogged socket, the packet rolls over to the next available one. +ファンアウトでは、 複数のソケットにトラフィックを分散させるアルゴリズムを複数サポートしている。 デフォルトのモードである +\fBPACKET_FANOUT_HASH\fP では、同じフローのパケットは同じソケットに送信され、 フロー単位の順序が維持される。 +パケットごとに、パケットフローのハッシュの、そのグループのソケット数に対する剰余が計算され、ソケットが選択される。 +なお、フローハッシュはネットワーク層のアドレスとトランスポート層のポートフィールドに対するハッシュである (トランスポート層ポートは存在する場合のみ)。 +負荷分散モード \fBPACKET_FANOUT_LB\fP はラウンドロビンアルゴリズムが採用されている。 \fBPACKET_FANOUT_CPU\fP では、 +パケットが到着した CPU に基づいてソケットを選択する。 \fBPACKET_FANOUT_ROLLOVER\fP +はすべてのデータを一つのソケットで処理し、 そのソケットで処理待ち (backlog) が発生した場合に次のソケットに移る。 +\fBPACKET_FANOUT_RND\fP では擬似乱数発生器を使ってソケットが選択される。 \fBPACKET_FANOUT_QM\fP (Linux +3.14 以降で利用可能) では受信 skb に記録された queue_mapping を使ってソケットが選択される。 + +ファンアウトモードでは追加のオプションがある。 IP フラグメンテーションが起こると、 +同じフローのパケットのフローハッシュが異なるハッシュを持つことになる。 フラグ \fBPACKET_FANOUT_FLAG_DEFRAG\fP +をセットすると、 パケットはファンアウトを行う前にフラグメント再構築が行われるようになり、 フラグメントがあった場合でも順序が維持される。 +ファンアウトモードとオプションは、 整数のオプション値の下位 16 ビットで指定される。 フラグ +\fBPACKET_FANOUT_FLAG_ROLLOVER\fP を指定すると、 バックアップ戦略としてロールオーバー方式が有効になる。 +元のファンアウトアルゴリズムが backlog ソケットを選択していれば、 パケットは次の利用可能なソケットにロールオーバーされる。 .TP -\fBPACKET_LOSS\fP (with \fBPACKET_TX_RING\fP) -If set, do not silently drop a packet on transmission error, but return it -with status set to \fBTP_STATUS_WRONG_FORMAT\fP. +\fBPACKET_LOSS\fP (\fBPACKET_TX_RING\fP で使用) +有効にすると、転送エラーの場合にパケットをエラーなしに黙って破棄せず、 ステータスを \fBTP_STATUS_WRONG_FORMAT\fP +にセットして返る。 .TP -\fBPACKET_RESERVE\fP (with \fBPACKET_RX_RING\fP) -By default, a packet receive ring writes packets immediately following the -metadata structure and alignment padding. This integer option reserves -additional headroom. +\fBPACKET_RESERVE\fP (\fBPACKET_RX_RING\fP で使用) +デフォルトでは、パケット受信リングはメタデータ構造体とアライメント用のパディングの直後にパケットを書き込む。 +この整数オプションを設定すると、パケットの前に追加で領域が予約される。 .TP \fBPACKET_RX_RING\fP -Create a memory\-mapped ring buffer for asynchronous packet reception. The -packet socket reserves a contiguous region of application address space, -lays it out into an array of packet slots and copies packets (up to -\fItp_snaplen\fP) into subsequent slots. Each packet is preceded by a -metadata structure similar to \fItpacket_auxdata\fP. The protocol fields -encode the offset to the data from the start of the metadata header. -\fItp_net\fP stores the offset to the network layer. If the packet socket is -of type \fBSOCK_DGRAM\fP, then \fItp_mac\fP is the same. If it is of type -\fBSOCK_RAW\fP, then that field stores the offset to the link\-layer frame. -Packet socket and application communicate the head and tail of the ring -through the \fItp_status\fP field. The packet socket owns all slots with -status \fBTP_STATUS_KERNEL\fP. After filling a slot, it changes the status of -the slot to transfer ownership to the application. During normal operation, -the new status is \fBTP_STATUS_USER\fP, to signal that a correctly received -packet has been stored. When the application has finished processing a -packet, it transfers ownership of the slot back to the socket by setting the -status to \fBTP_STATUS_KERNEL\fP. Packet sockets implement multiple variants -of the packet ring. The implementation details are described in -\fIDocumentation/networking/packet_mmap.txt\fP in the Linux kernel source tree. +非同期でのパケット受信用のメモリマップされたリングバッファを作成する。 パケットソケットはアプリケーションのアドレス空間に連続する領域を確保し、 +そこにパケットスロットの配列を構成し、 (最大 \fItp_snaplen\fP 個の) パケットを順にスロットにコピーする。 各パケットの前には +\fItpacket_auxdata\fP に似たメタデータ構造体が置かれる。 +プロトコルフィールドには、データの、メタデータヘッダーの先頭からのオフセットが入る。 \fItp_net\fP にはネットワーク層へのオフセットが格納される。 +パケットソケットが \fBSOCK_DGRAM\fP 型の場合、 \fItp_mac\fP も同じである。 \fBSOCK_RAW\fP 型の場合、 \fItp_net\fP +にはリンク層のフレームへのオフセットが入る。 パケットソケットとアプリケーションは \fItp_status\fP フィールドを通してリングの先頭 +(head) と末尾 (tail) の情報を受け渡す。 パケットソケットはすべてのスロットをステータス \fBTP_STATUS_KERNEL\fP +で所有しており、 スロットにデータが入ると、パケットソケットはそのスロットのステータスをアプリケーションに所有権を渡す状態に変更する。 +通常の動作では、新しいステータスは \fBTP_STATUS_USER\fP であり、これは正しく受信されたパケットが格納されたことを示している。 +アプリケーションがパケットの処理を終えると、アプリケーションはそのスロットのステータスを \fBTP_STATUS_KERNEL\fP +に設定し、そのスロットの所有権をソケットに返す。 パケットソケットは、複数バージョンのパケットリングを実装している。 実装の詳細は Linux +カーネルソースツリーの \fIDocumentation/networking/packet_mmap.txt\fP で説明されている。 .TP \fBPACKET_STATISTICS\fP -Retrieve packet socket statistics in the form of a structure +パケットソケットの統計情報を次の構造体形式で取得する。 .in +4n .nf struct tpacket_stats { - unsigned int tp_packets; /* Total packet count */ - unsigned int tp_drops; /* Dropped packet count */ + unsigned int tp_packets; /* 総パケット数 */ + unsigned int tp_drops; /* ドロップパケット数 */ }; .fi .in -Receiving statistics resets the internal counters. The statistics structure -differs when using a ring of variant \fBTPACKET_V3\fP. +統計情報を取得すると、内部カウンターはリセットされる。 \fBTPACKET_V3\fP のリングを使う場合には、統計情報構造体は違うものになる。 .TP -\fBPACKET_TIMESTAMP\fP (with \fBPACKET_RX_RING\fP; since Linux 2.6.36) +\fBPACKET_TIMESTAMP\fP (\fBPACKET_RX_RING\fP で使用; Linux 2.6.36 以降) .\" commit 614f60fa9d73a9e8fdff3df83381907fea7c5649 -The packet receive ring always stores a timestamp in the metadata header. -By default, this is a software generated timestamp generated when the packet -is copied into the ring. This integer option selects the type of -timestamp. Besides the default, it support the two hardware formats -described in \fIDocumentation/networking/timestamping.txt\fP in the Linux -kernel source tree. +パケット受信リングでは常にタイムスタンプがメタデータヘッダーに格納される。 +デフォルトでは、タイムスタンプはパケットがリングにコピーされた時点で生成されるソフトウェアによるタイムスタンプである。 +この整数オプションによりタイムスタンプの種類を選択できる。 デフォルト以外では、 Linux カーネルソースツリーの +\fIDocumentation/networking/timestamping.txt\fP に説明がある 2 +種類のハードウェアフォーマットがサポートされている。 .TP \fBPACKET_TX_RING\fP (Linux 2.6.31 以降) .\" commit 69e3c75f4d541a6eb151b3ef91f34033cb3ad6e1 -Create a memory\-mapped ring buffer for packet transmission. This option is -similar to \fBPACKET_RX_RING\fP and takes the same arguments. The application -writes packets into slots with status \fBTP_STATUS_AVAILABLE\fP and schedules -them for transmission by changing the status to \fBTP_STATUS_SEND_REQUEST\fP. -When packets are ready to be transmitted, the application calls \fBsend\fP(2) -or a variant thereof. The \fIbuf\fP and \fIlen\fP fields of this call are -ignored. If an address is passed using \fBsendto\fP(2) or \fBsendmsg\fP(2), then -that overrides the socket default. On successful transmission, the socket -resets the slot to \fBTP_STATUS_AVAILABLE\fP. It discards packets silently on -error unless \fBPACKET_LOSS\fP is set. +パケット送信用のメモリマップされたリングバッファを作成する。 このオプションは \fBPACKET_RX_RING\fP と同様で、同じ引き数を取る。 +アプリケーションはステータスが \fBTP_STATUS_AVAILABLE\fP のスロットにパケットを書き込み、 +\fBTP_STATUS_SEND_REQUEST\fP にステータスを変更することでそのパケットが送信できるようにする。 +パケットの送信準備ができたら、アプリケーションは続けて \fBsend\fP(2) 系のシステムコールを呼び出す。 システムコールの引き数 \fIbuf\fP と +\fIlen\fP は無視される。 \fBsendto\fP(2) や \fBsendmsg\fP(2) を使ってアドレスが渡された場合、 +ソケットのデフォルト値ではなくそのアドレスが使用される。 送信に成功すると、ソケットはそのスロットを \fBTP_STATUS_AVAILABLE\fP +に戻す。 エラーの場合、 \fBPACKET_LOSS\fP がセットされていなければエラーなしでパケットは廃棄される。 .TP -\fBPACKET_VERSION\fP (with \fBPACKET_RX_RING\fP; since Linux 2.6.27) +\fBPACKET_VERSION\fP (\fBPACKET_RX_RING\fP で使用; Linux 2.6.27 以降) .\" commit bbd6ef87c544d88c30e4b762b1b61ef267a7d279 -By default, \fBPACKET_RX_RING\fP creates a packet receive ring of variant -\fBTPACKET_V1\fP. To create another variant, configure the desired variant by -setting this integer option before creating the ring. +デフォルトでは、 \fBPACKET_RX_RING\fP は \fBTPACKET_V1\fP +のパケット受信リングを作成する。別のバージョンのリングを作成するには、そのリングを作成する前に希望するバージョンが使われるようにこの整数オプションを設定すること。 .TP \fBPACKET_QDISC_BYPASS\fP (Linux 3.14 以降) .\" commit d346a3fae3ff1d99f5d0c819bf86edf9094a26a1 -By default, packets sent through packet sockets pass through the kernel's -qdisc (traffic control) layer, which is fine for the vast majority of use -cases. For traffic generator appliances using packet sockets that intend to -brute\-force flood the network\(emfor example, to test devices under load in -a similar fashion to pktgen\(emthis layer can be bypassed by setting this -integer option to 1. A side effect is that packet buffering in the qdisc -layer is avoided, which will lead to increased drops when network device -transmit queues are busy; therefore, use at your own risk. +デフォルトでは、パケットはカーネルの qdisc (トラフィック制御) レイヤー経由で渡される。 これは大半のユースケースに合っている。 +ネットワークに対して可能な限りパケットを送信する (例えば pkggen と同様の方法で負荷対象のデバイスを試験する) +のにパケットソケットを使うトラフィック生成アプライアンスでは、この整数オプションを 1 に設定することで qdisc レイヤーを飛ばすことができる。 +qdisc レイヤーでのパケットバッファが行われなくなるという副作用がある。 これにより、 +ネットワークデバイスの送信キューの使用量が高い場合にパケット廃棄が起きやすくなる。 .SS ioctl .\" FIXME Document SIOCGSTAMPNS \fBSIOCGSTAMP\fP を用いると、最後に受信したパケットのタイムスタンプを得ることができる。 引き数は \fIstruct timeval\fP diff --git a/release/man7/tcp.7 b/release/man7/tcp.7 index a925abff..4006468d 100644 --- a/release/man7/tcp.7 +++ b/release/man7/tcp.7 @@ -198,12 +198,11 @@ ACK が遅延 ACK (delayed acknowledgment) を相殺するための 2 セグメ \fItcp_autocorking\fP (ブール値; デフォルト: 有効; Linux 3.14 以降) .\" commit f54b311142a92ea2e42598e347b84e1655caf8e3 .\" Text heavily based on Documentation/networking/ip-sysctl.txt -If this option is enabled, the kernel tries to coalesce small writes (from -consecutive \fBwrite\fP(2) and \fBsendmsg\fP(2) calls) as much as possible, in -order to decrease the total number of sent packets. Coalescing is done if -at least one prior packet for the flow is waiting in Qdisc queues or device -transmit queue. Applications can still use the \fBTCP_CORK\fP socket option to -obtain optimal behavior when they know how/when to uncork their sockets. +このオプションを有効にすると、 送信総パケット数を減らすため、 カーネルは小さな write (連続する \fBwrite\fP(2) や +\fBsendmsg\fP(2) の呼び出し) を可能な限り結合しようとする。 パケットの結合が行われるのは、そのフローの前のパケットが少なくとも一つは +qdisc キューかデバイスの送信キューで送信待ちの場合である。 このオプションが有効な場合でも \fBTCP_CORK\fP +オプションを使うことができ、アプリケーションがソケットの「コルク解除」(送信待ち状態の解除) +をいつどのように行えばよいか分かっている場合には、最適な動作をさせることができる。 .TP \fItcp_available_congestion_control\fP (String; read\-only; Linux 2.4.20 以降) .\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt @@ -579,13 +578,10 @@ TCP ソケットのオプションは、 オプションレベル引数に \fIIP \fBTCP_CONGESTION\fP (Linux 2.6.13 以降) .\" commit 5f8ef48d240963093451bcf83df89f1a1364f51d .\" Author: Stephen Hemminger -The argument for this option is a string. This option allows the caller to -set the TCP congestion control algorithm to be used, on a per\-socket basis. -Unprivileged processes are restricted to choosing one of the algorithms in -\fItcp_allowed_congestion_control\fP (described above). Privileged processes -(\fBCAP_NET_ADMIN\fP) can choose from any of the available congestion\-control -algorithms (see the description of \fItcp_available_congestion_control\fP -above). +このオプションの引き数は文字列である。 このオプションを使うと、呼び出し元がソケット単位に使用する TCP 輻輳制御アルゴリズムを設定することができる。 +非特権プロセスが使用できるアルゴリズムは (上述の) \fItcp_allowed_congestion_control\fP +で設定されたものだけに制限される。 特権プロセス (\fBCAP_NET_ADMIN\fP) は任意の輻輳制御アルゴリズムを選択することができる (上記の +\fBtcp_available_congestion_control\fP の説明を参照)。 .TP \fBTCP_CORK\fP (Linux 2.2 以降) .\" precisely: since 2.1.127 @@ -660,32 +656,24 @@ quickack モードでは ack はすぐに送信される。 このフラグは .\" The following text taken nearly verbatim from Jerry Chu's (excellent) .\" commit message. .\" -This option takes an \fIunsigned int\fP as an argument. When the value is -greater than 0, it specifies the maximum amount of time in milliseconds that -transmitted data may remain unacknowledged before TCP will forcibly close -the corresponding connection and return \fBETIMEDOUT\fP to the application. If -the option value is specified as 0, TCP will to use the system default. +このオプションは \fIunsigned int\fP 型の引き数を取る。 値が 0 より大きい場合、その値は、 どのくらいの時間、送信されたデータが ACK +を受信しないままの状態が続くと、 TCP がその接続を強制的にクローズし、アプリケーションに \fBETIMEDOUT\fP を返すかを、 +ミリ秒単位で指定する。 オプションの値が 0 の場合、TCP はシステムのデフォルト値を使用する。 -Increasing user timeouts allows a TCP connection to survive extended periods -without end\-to\-end connectivity. Decreasing user timeouts allows -applications to "fail fast", if so desired. Otherwise, failure may take up -to 20 minutes with the current system defaults in a normal WAN environment. +ユーザータイムアウトを長くすると、 通信の両端での接続性がない場合でも長い時間 TCP 接続が維持されるようになる。 ユーザータイムアウトを短くすると、 +アプリケーションは必要であれば「早く失敗」できるようになる。 設定しなかった場合は、 通常の WAN 環境では現在のシステムのデフォルトの 20 +分で失敗することになる。 -This option can be set during any state of a TCP connection, but is only -effective during the synchronized states of a connection (ESTABLISHED, -FIN\-WAIT\-1, FIN\-WAIT\-2, CLOSE\-WAIT, CLOSING, and LAST\-ACK). Moreover, when -used with the TCP keepalive (\fBSO_KEEPALIVE\fP) option, \fBTCP_USER_TIMEOUT\fP -will override keepalive to determine when to close a connection due to -keepalive failure. +このオプションは TCP 接続がどの状態の場合でも設定することができるが、 接続が同期状態 (ESTABLISHED, FIN\-WAIT\-1, +FIN\-WAIT\-2, CLOSE\-WAIT, CLOSING, LAST\-ACK) の場合のみ効果がある。 また、 TCP keepalive +(\fBSO_KEEPALIVE\fP) オプションとともに使用された場合、 \fBTCP_USER_TIMEOUT\fP は keepalive +失敗による接続クローズを判定するための keepalive 値を上書きする。 -The option has no effect on when TCP retransmits a packet, nor when a -keepalive probe is sent. +このオプションは TCP がパケットを再送する際や keepalive プローブを送信する際には影響を及ぼさない。 -This option, like many others, will be inherited by the socket returned by -\fBaccept\fP(2), if it was set on the listening socket. +他の多くのオプション同様、リッスン中のソケットでこのオプションがセットされていれば \fBaccept\fP(2) が返すソケットにオプションが継承される。 -Further details on the user timeout feature can be found in RFC\ 793 and -RFC\ 5482 ("TCP User Timeout Option"). +ユーザータイムアウト機能の詳細は RFC\ 793 と RFC\ 5482 ("TCP User Timeout Option") に書かれている。 .TP \fBTCP_WINDOW_CLAMP\fP (Linux 2.4 以降) .\" Precisely: since 2.3.41 diff --git a/stats/net b/stats/net index ad4c4eec..dd9d6e37 100644 --- a/stats/net +++ b/stats/net @@ -2,5 +2,3 @@ getaddrinfo_a.3,81,41,122 inet_net_pton.3,54,38,92 nss.5,20,7,27 -packet.7,94,19,113 -tcp.7,248,8,256 diff --git a/translation_list b/translation_list index 29d3d736..47157a73 100644 --- a/translation_list +++ b/translation_list @@ -2148,7 +2148,7 @@ ○:LDP man-pages:3.65:2013/03/15:netlink:7:2014/04/24::amotoki@gmail.com:Akihiro MOTOKI: ○:LDP man-pages:3.65:2012/08/05:numa:7:2014/04/24::amotoki@gmail.com:Akihiro MOTOKI: ○:LDP man-pages:3.65:2011/09/09:operator:7:2014/04/24::ysato444@yahoo.co.jp:Yuichi SATO: -☆:LDP man-pages:3.54=>3.65:2014/02/26:packet:7:2013/03/26::amotoki@gmail.com:Akihiro MOTOKI: +○:LDP man-pages:3.65:2014/02/26:packet:7:2014/04/27::amotoki@gmail.com:Akihiro MOTOKI: ○:LDP man-pages:3.65:2009/12/05:path_resolution:7:2014/04/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: ○:LDP man-pages:3.65:2005/12/08:pipe:7:2014/04/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: ○:LDP man-pages:3.65:2007/12/21:posixoptions:7:2014/04/24::ysato444@yahoo.co.jp:Yuichi SATO: @@ -2168,7 +2168,7 @@ ○:LDP man-pages:3.65:2000/11/16:suffixes:7:2014/04/24::ysato@h4.dion.ne.jp:Yuichi SATO: ○:LDP man-pages:3.65:2013/02/12:svipc:7:2014/04/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: ×:LDP man-pages:3.65:2014/04/06:symlink:7::::: -☆:LDP man-pages:3.54=>3.65:2014/03/31:tcp:7:2013/07/24::amotoki@gmail.com:Akihiro MOTOKI: +○:LDP man-pages:3.65:2014/03/31:tcp:7:2014/04/27::amotoki@gmail.com:Akihiro MOTOKI: ○:LDP man-pages:3.65:2013/02/12:termio:7:2014/04/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: ○:LDP man-pages:3.65:2012/10/28:time:7:2014/04/24::amotoki@dd.iij4u.or.jp:Akihiro MOTOKI: @:LDP man-pages:3.65:2014/02/16:tis-620:7:iso_8859-11:7: diff --git a/untrans.html b/untrans.html index 49fec374..b4909bf0 100644 --- a/untrans.html +++ b/untrans.html @@ -64,8 +64,6 @@ getaddrinfo_a.341/12266.39 inet_net_pton.338/9258.70 nss.57/2774.07 -packet.719/11383.19 -tcp.78/25696.88 process cpuset.7212/31432.48 signal @@ -92,6 +90,6 @@ futimesat.210/3772.97 utimensat.249/10754.21 zdump.81/2295.45 -Total 64 pages +Total 62 pages -- 2.11.0