# Linux # Google BBR TCP congestion control algorithm opening

Traditional TCP congestion control algorithms, protocols based on packet loss feedback.

Based on "feedback loss" protocol is a passive congestion control mechanisms, which make network congestion judgment based on network packet loss event. Even when the network load is high, as long as no congestion loss, the agreement will not take the initiative to reduce their transmission speed.

This protocol may be utilized to maximize the residual bandwidth network, improving the throughput. However, due to feedback protocol based on packet loss in the network near saturation demonstrated aggressive, while greatly improving network bandwidth utilization; but on the other hand, based congestion control protocol for packet loss feedback is greatly improve network utilization at the same time means that a congestion loss event not far off, so these agreements while improving network bandwidth utilization also indirectly increase the network packet loss rate, resulting in increased jitter of the entire network.

Who else has led to loss? Packet loss does not always lead to congestion, packet loss may be many reasons, such as:

  • The world's most cattle firewall GWF random packet loss strategy
  • Network signal due to multipath fading (multi-path fading) caused by the attenuation (signal degradation)
  • Loss (packet drop) caused by obstruction, furthermore damaged packet (corrupted packets) is rejected by
  • Defective network hardware, network driver software malfunction
  • Effects of signal to noise ratio (SNR) of

The emergence of Google BBR

We naturally do not like GWF this artificial random packet loss strategy, when passing GWF, data loss, we should immediately re-contract at this time, increasing the frequency of the transmitted and do not want to reduce the speed, that is, I do not want tradition TCP congestion control algorithm go.

Accordingly, there have been no packet loss based on the CDG congestion control algorithm, based on judgment as to delay, delay increases congestion description, the data begins to accumulate in the buffer of the router. Decrease the transmission window. However CDG algorithm is not compatible with an algorithm based on packet loss, only global devices are put CDG, but this is not possible, the equipment currently on the market can not suddenly switch to the CDG, so Google is not happy, Google scientists have developed a transition algorithm to solve this problem, the name of the algorithm is BBR (Bottleneck Bandwidth and RTT), which is a new congestion control algorithms, BBR CDG is consistent with the idea not to packet loss as congestion control signal, and CDG but the difference is, the BBR and cubic and reno can coexist.

Comparison before and after use of the network throughput BBR:

BBR developed by Google, for the Linux kernel TCP protocol stack to use, with BBR algorithm, Linux servers can significantly improve throughput and reduce latency connection, it simply BBR can accelerate the transmission speed of the network. In addition, the deployment of BBR is also very easy, because the algorithm requires only the sender, without the need to support the network or the recipient.

BBR deployed on the server instance Unbuntu16.04

1, first of all, to upgrade the server kernel version 4.9

2, enable BBR

Sysctl need to modify the configuration to enable BBR algorithm

First run lsmod | grep bbr view is not the BBR # modprobe tcp_bbr

# echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf

# echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf

# sysctl -p

It is wrong if the kernel does not support running modprobe command: modprobe: FATAL: Module tcp_bbr not found.

Check whether under the BBR # sysctl net.ipv4.tcp_available_congestion_control enabled

net.ipv4.tcp_available_congestion_control = reno cubic bbr hybla

# sysctl -n net.ipv4.tcp_congestion_control

bbr

# lsmod |grep bbr

tcp_bbr 20480 6

 

/etc/sysctl.conf configuration information is as follows:


#
# /etc/sysctl.conf - Configuration file for setting system variables
# See /etc/sysctl.d/ for additional system variables.
# See sysctl.conf (5) for information.
#

#kernel.domainname = example.com

# Uncomment the following to stop low-level messages on console
#kernel.printk = 3 4 1 3

##############################################################3
# Functions previously found in netbase
#

# Uncomment the next two lines to enable Spoof protection (reverse-path filter)
# Turn on Source Address Verification in all interfaces to
# prevent some spoofing attacks
#net.ipv4.conf.default.rp_filter=1
#net.ipv4.conf.all.rp_filter=1

# Uncomment the next line to enable TCP/IP SYN cookies
# See http://lwn.net/Articles/277146/
# Note: This may impact IPv6 TCP sessions too
#net.ipv4.tcp_syncookies=1

# Uncomment the next line to enable packet forwarding for IPv4
#net.ipv4.ip_forward=1

# Uncomment the next line to enable packet forwarding for IPv6
#  Enabling this option disables Stateless Address Autoconfiguration
#  based on Router Advertisements for this host
#net.ipv6.conf.all.forwarding=1


###################################################################
# Additional settings - these settings can improve the network
# security of the host and prevent against some network attacks
# including spoofing attacks and man in the middle attacks through
# redirection. Some network environments, however, require that these
# settings are disabled so review and enable them as needed.
#
# Do not accept ICMP redirects (prevent MITM attacks)
#net.ipv4.conf.all.accept_redirects = 0
#net.ipv6.conf.all.accept_redirects = 0
# _or_
# Accept ICMP redirects only for gateways listed in our default
# gateway list (enabled by default)
# net.ipv4.conf.all.secure_redirects = 1
#
# Do not send ICMP redirects (we are not a router)
#net.ipv4.conf.all.send_redirects = 0
#
# Do not accept IP source route packets (we are not a router)
#net.ipv4.conf.all.accept_source_route = 0
#net.ipv6.conf.all.accept_source_route = 0
#
# Log Martian Packets
#net.ipv4.conf.all.log_martians = 1
#
net.ipv4.neigh.default.base_reachable_time_ms = 600000
net.ipv4.neigh.default.mcast_solicit = 20
net.ipv4.neigh.default.retrans_time_ms = 250
net.ipv4.conf.all.rp_filter=0
net.ipv4.conf.eth0.rp_filter=0
net.ipv4.conf.eth1.rp_filter=0
net.ipv4.tcp_fastopen=3
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr

 

Reference: https: //github.com/google/bbr

Published 170 original articles · won praise 207 · Views 4.59 million +

Guess you like

Origin blog.csdn.net/xiaoting451292510/article/details/105308764