LoginSignup
9
12

More than 5 years have passed since last update.

Linux Kernel 3.0以降について調べてみた(NW周り)

Last updated at Posted at 2017-02-10

NWだけでかなりの量になったために分割
仮想化周りは除外しております。
重要そうなのは太字

2.6.39 Increase the initial congestion window to 10 packets

Mixi engineer blog 参照
http://alpha.mixi.co.jp/entry/2013/11663/

一度に送るパケット調整

3.0 sendmmsg(): batching of sendmsg() calls

データの送受信に使用されるシステムコールの追加
スループットと遅延を改善

3.1 Lower the default initRTO from 3secs to 1sec, as per RFC2988bis

Mixi engineer blog 参照
http://alpha.mixi.co.jp/entry/2013/11663/

TCP再送時間の短縮
CentOS6のパケット再送が途中から早くなったはこれだったのね
sysctlで指定せずともデフォルトで有効な模様

3.2 TCP Proportional Rate Reduction

NWパフォーマンスのアルゴリズム変更
bandwidthを徐々に増やすたときパケットロスが起きた場合のbandwidthを調整するアルゴリズムをgoogle提案のものに
sysctlで指定せずともデフォルトで有効な模様

3.3 Network priority control group

cgroupによるNW優先制御
このcgroupを使用すると、管理者は特定のインターフェイス上の出力トラフィックの優先順位を定義するグループにプロセスを割り当てることができます。

3.3 Support the socket monitoring interface used by the ss tool in UNIX sockets

ssコマンドによるsocketモニタリング
https://linux.die.net/man/8/ss

3.5 Bufferbloat fighting: CoDel queue management

CoDelキューサポート
NWのバッファによるbufferbloat対策として
重み付けによるキューイングシステムへの変更
これにより優先すべきパケットが優先されるようになる

3.5 TCP Early Retransmit(ER)

ネットワークに送出されているセグメントが4つ未満である場合、fast retransmitをトリガーするduplicate ackの回数を減らすらしい

エンジニアですよ! 参照
http://totem3.hatenablog.jp/entry/2016/06/05/160109
/proc/sys/net/ipv4/tcp_early_retrans
CentOS6には存在しない
Ubuntu16.04は3になっていた

tcp_early_retrans - INTEGER
         Enable Early Retransmit (ER), per RFC 5827. ER lowers the threshold
         for triggering fast retransmit when the amount of outstanding data is
         small and when no previously unsent data can be transmitted (such
         that limited transmit could be used). Also controls the use of
         Tail loss probe (TLP) that converts RTOs occurring due to tail
         losses into fast recovery (draft-dukkipati-tcpm-tcp-loss-probe-01).
         Possible values:
                 0 disables ER
                 1 enables ER
                 2 enables ER but delays fast recovery and fast retransmit
                   by a fourth of RTT. This mitigates connection falsely
                   recovers when network has a small degree of reordering
                   (less than 3 packets).
                 3 enables delayed ER and TLP.
                 4 enables TLP only.
         Default: 3

3.10のパラメータは4まで。3.9までは2までしかない

3.5 TCP microoptimization: 10Gb+ TCP sender was dropping lot of incoming ACKs because of sk_rcvbuf limit in sk_add_backlog()

10Gb+のTCP送信者が多くの着信ACKをドロップしていた修正

3.6 Bufferbloat fight: TCP small queues

送信して受ける側のバッファがあふれる問題の解決らしい
/proc/sys/net/ipv4/tcp_limit_output_bytes
CentOS6にも存在。
Ubuntu16.04共に262144

3.6 Speedup /proc/net/unix

unix socket(/proc/net/unix)の高速化

3.7 TCP Fast Open (server side)

これによりWebページの読み込み時間を4〜41%改善できるとしている。
正直、無料では最近で一番大きい改良かもしれない
しかし、実装が必用。

/proc/sys/net/ipv4/tcp_fastopen
後日3.13でデフォルト有効になった

3.10 TCP optimization: Tail loss probe

送信途中でパケットが壊れたときにタイムアウトまで検知できない問題の解決
/proc/sys/net/ipv4/tcp_early_retrans
TCP Early Retransmitと同じパラメータで調整

3.13 This release adds a new socket option, SO_MAX_PACING_RATE, which offers applications the ability to cap the rate computed by transport layer

ソケットオプションSO_MAX_PACING_RATEの追加
帯域制限がかけられる。ヘッダパケットも含まれていること
FQパケットスケジューラーを使っているので適応に制限がある

3.14 TCP automatic corking

アプリケーションがwrite/sendmsgシステムコールを実行する際に可能な限りパケットを合体させることでパケット送信の総量を抑える
/proc/sys/net/ipv4/tcp_autocorking

3.15 snmp stats for Fast Open, SYN rtx, and data pkts

TCPFastOpenのSNMP追加

3.18 Networking performance optimization: transmission queue batching

ソケットバッファ処理のバッチ処理
ネットワークパフォーマンスの向上

4.1 ipv4: Create probe timer for tcp PMTU as per RFC4821

RFC4821に従いPMTU probe timerを作成
sysctl tcp_probe_intervalで変更できる

4.1 Raise tcp PMTU probe mss base size from 512 to 1024 bytes

PMTU probeのmssベースサイズを512から1024

4.1 ipvs: allow rescheduling of new connections when port reuse is detected

IPVSにおいてポート再利用の際に使い回ししていた処理の制御
sysctl conn_reuse_modeで変更できる。偏りの阻止

4.1 RFC7413 option support for Fast Open client and server commit

TCPFastOpenオプションのFast Open cookiesをサーバ、クライアントでサポート

4.4 TCP listener handling completely lockless, making TCP servers faster and more scalable

TCPサーバーの高速化とスケーラビリティの向上
TCPリスナーを完全にロックレスな高速処理

4.4 TCP: Recent ACK (RACK) loss recovery

Recent ACK(RACK)によるパケロスの回復
net.ipv4.tcp_recoveryで制御

4.5 Performance improvements for SO_REUSEPORT UDP sockets

UDPの最適化
3.9からのSO_REUSEPORTを使う場合高速化

4.5 Proper control of socket memory usage in the memory controller

メモリコントローラでのソケットメモリ使用の適切な制御
匿名メモリ、ページキャッシュ、およびソケットバッファ間の調整が行われていなかったが
cgroup.memory = nosocketを指定すると、ソケットメモリを強制的にアクティブメモリリソース制御から除外できる

4.5 Add 802.3ad support for 100G speeds

bondingで802.3adにて100Gサポート

4.6 fastopen: accept data/FIN present in SYNACK message, as per RFC 7413 (TCP Fast Open) 4.2.2, which states that the SYNACK message MAY include data and/or FIN

TCPFastOpenでSYNACKにFINのクライアント側のサポートを追加
RFC 7413(TCP Fast Open)4.2.2に準拠
既にSYNのためにこれをサポートしているので、既存のコードを作り直す必要がある

4.7 Improve even more the resistance to synflood (performance under synflood goes from 3.2 Mpps to 6 Mpps)

synfloodに対する耐性を3.2→6Mppsに

4.10 randomize TCP timestamp offsets for each connection

tcp_timestampsの実装が変わりました

4.10 UDP: use it's own memory accounting schema (improves performance)

UDPで独自のメモリアカウンティングスキーマを使用
エンキューとデキューの両方でソケットロックを削除し、エンキュー時にバックログを使用しない

4.11 Enables RACK loss detection (draft-ietf-tcpm-rack-01) to trigger fast recovery with a reordering timer

TCPは、ACKを元にパケットロスを検出していたが複雑になりすぎた。RACKはタイマーベースに変更してより早くパケットロスを検出する

4.11 TCP fast open: Adds a new socket option

クライアント側で新しいソケットオプションTCP_FASTOPEN_CONNECTを有効にするだけでTCP fast openが有効に

4.11 Namespaceify knobs tcp_max_syn_backlog, tcp_tw_recycle and tcp_max_tw_buckets

tcp_max_syn_backlog、tcp_tw_recycle、tcp_max_tw_bucketsのsysctlを追加

4.11 Add net.ipv4.ip_unprivileged_port_start

ip_unprivileged_port_startをsysctlに追加。コンテナを意識した設定

4.12 remove tcp_tw_recycle sysctl

tcp_tw_recycleを削除

4.13 Kernel TLS acceleration

カーネルでhttpsなどのTLSを処理することでパフォーマンスが若干高速化(2%~)する

4.13 Switch TCP Timestamp option (RFC 7323) to 1ms clock

1ms単位だったTCP Timestampを1ns単位に変更した模様

4.13 scalability improvements

udp floodに対し20-35%性能向上

4.15 Configure TFO without cookie per socket and/or per route.

ソケットやルートごとにCookieなしでTFOを設定します。
クッキーなしでTFOを有効にすることができます。

4.15 New socket option TCP_FASTOPEN_KEY to allow different keys per listener

socketオプションでTCP_FASTOPEN_KEYを追加
リスナーはこのオプションでデフォルトはグローバルキーを使用するが、異なるキーを許可する

4.15 Add namespaces support for the sysctl tcp_fastopen commit, tcp_fastopen_blackhole_timeoutcommit, tcp_fastopen_key

ごめんなさい。よくわかってません。Docker?

4.15 Maintain the TCP retransmit queue using an rbtree

rb-treeベースの再送信キューを実装
100Gbで1GBのウィンドウサイズが必要

9
12
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
12