SlideShare uma empresa Scribd logo
1 de 27
Baixar para ler offline
Speed up TCP to make the Web
WebRTC
faster
郑又中 Yuchung Cheng
Google
ycheng@google.com



                    http://googlecode.blogspot.com/2012/01/lets-make-tcp-faster.html
Desktop
                                                                                   Median: ~2.7s
                                                                                   Mean: ~6.9s

                                                                                Mobile *
                                                                                   Median: ~4.8s
                                                                                   Mean: ~10.2s


                                                                                * optimistic




How Fast Are Websites Around The World? - Google Analytics Blog (April, 2012)
Content Type            Avg # of Requests   Avg size
             HTML                    8                   44 kB
             Images                  53                  635 kB
             Javascript              14                  189 kB
             CSS                     5                   35 kB



HTTP Archive - Trends (Sept, 2012)
Transport Control Protocol (TCP)
1. Reliable and serialized delivery (RFC 793, 1981 - )
   a. Export a reliable data pipe to apps
   b. Retransmit if packet is not acked
2. Congestion control (RFC 5681, 1988 - )
   a. Adjust sending rate based on ACK rate (ack-clocking)
   b. Slide congestion window to send more data
3. Optimized for bulk transfer (large file)
TCP is slow for the Web
                                                                                                                Handshake




   Emulating a Chrome user in Hong Kong with 1.5Mbps DSL accesing sohu.com with a warmed browser cache (http:
   //webpagetest.org)
Existing TCP workarounds
Why it won't work in the long run
Persistent TCP connections

● Open & keep many TCP connections
  ○ Don't reduce cwnd after idle
● Problems
  ○ Still slow - TCP handshake for first contact and slow start after idle
  ○ Don't scale - need to manage many connections
     ■ Client, server, network
  ○ Port exhaustion - NAT boxes silently drop connections
  ○ Energy inefficient - TCP/FIN wakes up radios

● Persistent TCP connection is not a long term solution
Let's make TCP fast
Fast startup, loss recovery, and congestion control for mobile
TCP handshake
                                                Client                  Server
35% HTTP and 11% SPDY requests wait                      SYN
                                      connect
for handshake
                                                               SYNACK
● 1 RTT overhead
● HTTP-GET in SYN                     sendmsg

                                                           HTTP GET        accept

Challenges
● Resource exhaustion attack
● Amplification attack
Resource exhaustion & amplified reflection attacks

                                      Attacker
                         SYN:
                       src=victim
                       HTTP-GET

      Server




                                       Victim




  1 (spoofed) SYN packet for 10 data packets
TCP Fast Open
            Client                              Server
                                                                  Server grants a nonce, Fast
                                                                  Open cookie (FOC)
                                      SYN
                                                      Generates
                                                                  ● AES_encrypt(client_ip, secret)
                SYNACK,cookie                          cookie
                                                                  ● TCP option (32 - 64bits)
   Stores
   cookie
                                                                  Client sends HTTP-GET in SYN
                                                                  with cookie
                           SYN,cookie (HTTP-GET)

                                                                  Server accepts HTTP-GET in SYN
                       SYNACK
                                                                  if cookie is valid

                                                                  Defend simple SYN-data flood
                     [...] continues as regular TCP
                                                                  attacks
Defending attacks

An attacker can still
● Obtain valid cookie via a mole
● Flood spoofed SYN-data from another bot
Defense
● Periodically rotate server secret
● Disable and use SYN cookie if pressured
Other scenarios
● NAT
● Man-in-the-middle
● Firewalls drop SYN/data or strip cookie option
Graceful fallback
                                               Client                          Server



Server can always only acks the initial
(SYN) sequence (e.g., SYN flood attack)                 SYN,cookie(HTTP-GET)



                                                                                    invalid
Client retries the data after handshake like                                        cookie!
                                                          SYNACK ack:SYN
regular TCP
                                                              HTTP-GET


No performance penalty!                                   HTTP 200 OK
Page load time benchmarks




                   "TCP Fast Open", SIGCOMM CoNEXT 2011 (best paper nominee)
Using Fast Open for your applications

Client:
● connect() then write()
● sendto(data, MSG_FASTOPEN)

Server:
● setsockopt(TCP_FASTOPEN)

Available in Linux 3.7 & being deployed on Google.com
TCP slow start
 ●   TCP is designed to probe the network to figure out the available capacity
 ●   TCP Slow Start - feature, not a bug
                                                                         Packet Loss




                                                         Exponential
                                                         growth
HTTP Archive says...
●   1098kb, 82 requests, ~30 hosts... ~14kb per request!
●   Most HTTP traffic is composed of small, bursty, TCP flows




                                                                Where we
                                                                want to be




 You are here


                                                 1-3 RTT's
Update CWND from 3 to 10 segments, or ~14960 bytes
                    Default size on Linux 2.6.33+ - double check yours!
                             Google servers use it since 2010




An Argument for Increasing TCP's initial Congestion window
HTTP/TCP are 5 - 10 times slower on lossy networks
Why is TCP slow on packet losses

TCP recover losses in two ways
 ● Fast recovery (1 RTT): need dupacks
 ● Timeout (often 5-10 RTTs)

Most losses in HTTP are tail drops (lost last N packets)
● No dupack to trigger fast recovery
● 70% losses on Google.com are recovered by timeout
● Timeout is long on short flows due to few RTT samples

Solution: Tail Loss Probe (TLP)
 ● Retransmit the last packet to trigger fast recovery
Tail Loss Probe
Tail Loss Probe performance

● 6% avg. reduction in HTTP response latency. 10% for 99%ile



                                                    Mobile only
But TCP performance on mobile is
terrible
We have some ideas ...
Mobile networks are very different

                   Desktop                  Mobile

 Loss (TCP)        Low                      Low (wireless codec /
                                            rexmit)
 Delay variation   Low ( queuing)           High (wireless)
 Rate change       Stable (cross traffic)   Fluctuates (wireless)

 Cross traffic     Same and other users     Same user

 Disconnection     Frequent                 Almost never
TCP congestion control is not working on mobile

Current TCP congestion control
● Sender-based
● Slowly probe and react to network
   rate changes (until loss or delay is
   too large)
● Per-flow fairness
New mobile congestion control

Key feature: client-centric                        Mobile
                                                   client
● Measures the mobile link rate                                  Congestion
                                                                  Manager
● Instruments the rate to the sender
● Prioritizes important connections                                         Query/
                                                                            Reply

                                                    F1      F2         Fn

Version 0.01: SPDY-cwnd-persist frame
                                                                              Outgoing
● server: SPDY-GO_AWAY (cwnd is 25)     Incoming
                                            Data                                 ACKs
● client: SPDY-SYN (cwnd was 25)
Conclusions

TCP is critical for Web performance but it's not optimized for Web


1. Fast Open - client sends HTTP-GET when connect
   a. Linux 3.7
2. IW10 - server sends 10 packets initially
   a. Linux 2.6.33+
3. Tail Loss Probe - recover losses within 2-3 RTTs
   a. Open source in Q1/2013
4. Congestion control for mobile
   a. Under active research. Will open source in 2013


Google "ietf tcpm google" for our RFC proposals in IETF

Mais conteúdo relacionado

Mais procurados

debugging openstack neutron /w openvswitch
debugging openstack neutron /w openvswitchdebugging openstack neutron /w openvswitch
debugging openstack neutron /w openvswitch
어형 이
 

Mais procurados (20)

Real-Time Streaming Protocol -QOS
Real-Time Streaming Protocol -QOSReal-Time Streaming Protocol -QOS
Real-Time Streaming Protocol -QOS
 
Make gRPC great again
Make gRPC great againMake gRPC great again
Make gRPC great again
 
H2O - making the Web faster
H2O - making the Web fasterH2O - making the Web faster
H2O - making the Web faster
 
H2O - the optimized HTTP server
H2O - the optimized HTTP serverH2O - the optimized HTTP server
H2O - the optimized HTTP server
 
Are we really ready to turn off IPv4?
Are we really ready to turn off IPv4?Are we really ready to turn off IPv4?
Are we really ready to turn off IPv4?
 
Teknologiapaiva 13012021-jaljitettavyys ja pilvipalvelut isobus-standardiin v...
Teknologiapaiva 13012021-jaljitettavyys ja pilvipalvelut isobus-standardiin v...Teknologiapaiva 13012021-jaljitettavyys ja pilvipalvelut isobus-standardiin v...
Teknologiapaiva 13012021-jaljitettavyys ja pilvipalvelut isobus-standardiin v...
 
Programming TCP for responsiveness
Programming TCP for responsivenessProgramming TCP for responsiveness
Programming TCP for responsiveness
 
Computer Networking
Computer NetworkingComputer Networking
Computer Networking
 
gRPC or Rest, why not both?
gRPC or Rest, why not both?gRPC or Rest, why not both?
gRPC or Rest, why not both?
 
Technical Overview of QUIC
Technical  Overview of QUICTechnical  Overview of QUIC
Technical Overview of QUIC
 
MPEG DASH White Paper
MPEG DASH White PaperMPEG DASH White Paper
MPEG DASH White Paper
 
GopherFest 2017 - Adding Context to NATS
GopherFest 2017 -  Adding Context to NATSGopherFest 2017 -  Adding Context to NATS
GopherFest 2017 - Adding Context to NATS
 
SPDY & HTTP2.0 & QUIC - #bpstudy 2013-08-28
SPDY & HTTP2.0 & QUIC - #bpstudy 2013-08-28SPDY & HTTP2.0 & QUIC - #bpstudy 2013-08-28
SPDY & HTTP2.0 & QUIC - #bpstudy 2013-08-28
 
redGuardian DP100 large scale DDoS mitigation solution
redGuardian DP100 large scale DDoS mitigation solutionredGuardian DP100 large scale DDoS mitigation solution
redGuardian DP100 large scale DDoS mitigation solution
 
Reorganizing Website Architecture for HTTP/2 and Beyond
Reorganizing Website Architecture for HTTP/2 and BeyondReorganizing Website Architecture for HTTP/2 and Beyond
Reorganizing Website Architecture for HTTP/2 and Beyond
 
Introduction to QUIC
Introduction to QUICIntroduction to QUIC
Introduction to QUIC
 
NATS: Simple, Secure and Scalable Messaging For the Cloud Native Era
NATS: Simple, Secure and Scalable Messaging For the Cloud Native EraNATS: Simple, Secure and Scalable Messaging For the Cloud Native Era
NATS: Simple, Secure and Scalable Messaging For the Cloud Native Era
 
debugging openstack neutron /w openvswitch
debugging openstack neutron /w openvswitchdebugging openstack neutron /w openvswitch
debugging openstack neutron /w openvswitch
 
Cometdの紹介
Cometdの紹介Cometdの紹介
Cometdの紹介
 
I want the next generation web here SPDY QUIC
I want the next generation web here SPDY QUICI want the next generation web here SPDY QUIC
I want the next generation web here SPDY QUIC
 

Semelhante a 加快互联网核心协议,提高Web速度yuchungcheng

TCP Over Wireless
TCP Over WirelessTCP Over Wireless
TCP Over Wireless
Farooq Khan
 
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 FinalExploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
masoodnt10
 

Semelhante a 加快互联网核心协议,提高Web速度yuchungcheng (20)

Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the WebCleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
 
Primer to Browser Netwroking
Primer to Browser NetwrokingPrimer to Browser Netwroking
Primer to Browser Netwroking
 
Network and TCP performance relationship workshop
Network and TCP performance relationship workshopNetwork and TCP performance relationship workshop
Network and TCP performance relationship workshop
 
Transaction TCP
Transaction TCPTransaction TCP
Transaction TCP
 
TCP Over Wireless
TCP Over WirelessTCP Over Wireless
TCP Over Wireless
 
Quick QUIC Technical Update (2017)
Quick QUIC Technical Update (2017)Quick QUIC Technical Update (2017)
Quick QUIC Technical Update (2017)
 
gen_udp and gen_tcp in Elixir
gen_udp and gen_tcp in Elixirgen_udp and gen_tcp in Elixir
gen_udp and gen_tcp in Elixir
 
From Fast To SPDY
From Fast To SPDYFrom Fast To SPDY
From Fast To SPDY
 
Improving performance by changing the rules from fast to SPDY
Improving performance by changing the rules   from fast to SPDYImproving performance by changing the rules   from fast to SPDY
Improving performance by changing the rules from fast to SPDY
 
Introduction to HTTP/2
Introduction to HTTP/2Introduction to HTTP/2
Introduction to HTTP/2
 
High perf-networking
High perf-networkingHigh perf-networking
High perf-networking
 
Dumb Ways To Die: How Not To Write TCP-based Network Applications
Dumb Ways To Die: How Not To Write TCP-based Network ApplicationsDumb Ways To Die: How Not To Write TCP-based Network Applications
Dumb Ways To Die: How Not To Write TCP-based Network Applications
 
Linux HTTPS/TCP/IP Stack for the Fast and Secure Web
Linux HTTPS/TCP/IP Stack for the Fast and Secure WebLinux HTTPS/TCP/IP Stack for the Fast and Secure Web
Linux HTTPS/TCP/IP Stack for the Fast and Secure Web
 
SPDY, TCP, and the Single Connection Throttle
SPDY, TCP, and the Single Connection ThrottleSPDY, TCP, and the Single Connection Throttle
SPDY, TCP, and the Single Connection Throttle
 
UAV Data Link Design for Dependable Real-Time Communications
UAV Data Link Design for Dependable Real-Time CommunicationsUAV Data Link Design for Dependable Real-Time Communications
UAV Data Link Design for Dependable Real-Time Communications
 
Next generation web protocols
Next generation web protocolsNext generation web protocols
Next generation web protocols
 
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 FinalExploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
 
Ch05
Ch05Ch05
Ch05
 
What every Java developer should know about network?
What every Java developer should know about network?What every Java developer should know about network?
What every Java developer should know about network?
 
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)
 

Mais de Michael Zhang

2014 GITC 帶上數據去創業 talkingdata—高铎
 2014 GITC 帶上數據去創業 talkingdata—高铎 2014 GITC 帶上數據去創業 talkingdata—高铎
2014 GITC 帶上數據去創業 talkingdata—高铎
Michael Zhang
 
Cuda 6 performance_report
Cuda 6 performance_reportCuda 6 performance_report
Cuda 6 performance_report
Michael Zhang
 
Q con shanghai2013-[ben lavender]-[long-distance relationships with robots]
Q con shanghai2013-[ben lavender]-[long-distance relationships with robots]Q con shanghai2013-[ben lavender]-[long-distance relationships with robots]
Q con shanghai2013-[ben lavender]-[long-distance relationships with robots]
Michael Zhang
 
Q con shanghai2013-[刘海锋]-[京东文件系统简介]
Q con shanghai2013-[刘海锋]-[京东文件系统简介]Q con shanghai2013-[刘海锋]-[京东文件系统简介]
Q con shanghai2013-[刘海锋]-[京东文件系统简介]
Michael Zhang
 
Q con shanghai2013-[韩军]-[超大型电商系统架构解密]
Q con shanghai2013-[韩军]-[超大型电商系统架构解密]Q con shanghai2013-[韩军]-[超大型电商系统架构解密]
Q con shanghai2013-[韩军]-[超大型电商系统架构解密]
Michael Zhang
 
Q con shanghai2013-[jains krums]-[real-time-delivery-archiecture]
Q con shanghai2013-[jains krums]-[real-time-delivery-archiecture]Q con shanghai2013-[jains krums]-[real-time-delivery-archiecture]
Q con shanghai2013-[jains krums]-[real-time-delivery-archiecture]
Michael Zhang
 
Q con shanghai2013-[黄舒泉]-[intel it openstack practice]
Q con shanghai2013-[黄舒泉]-[intel it openstack practice]Q con shanghai2013-[黄舒泉]-[intel it openstack practice]
Q con shanghai2013-[黄舒泉]-[intel it openstack practice]
Michael Zhang
 
Q con shanghai2013-罗婷-performance methodology
Q con shanghai2013-罗婷-performance methodologyQ con shanghai2013-罗婷-performance methodology
Q con shanghai2013-罗婷-performance methodology
Michael Zhang
 

Mais de Michael Zhang (20)

廣告系統在Docker/Mesos上的可靠性實踐
廣告系統在Docker/Mesos上的可靠性實踐廣告系統在Docker/Mesos上的可靠性實踐
廣告系統在Docker/Mesos上的可靠性實踐
 
HKIX Upgrade to 100Gbps-Based Two-Tier Architecture
HKIX Upgrade to 100Gbps-Based Two-Tier ArchitectureHKIX Upgrade to 100Gbps-Based Two-Tier Architecture
HKIX Upgrade to 100Gbps-Based Two-Tier Architecture
 
2014 GITC 帶上數據去創業 talkingdata—高铎
 2014 GITC 帶上數據去創業 talkingdata—高铎 2014 GITC 帶上數據去創業 talkingdata—高铎
2014 GITC 帶上數據去創業 talkingdata—高铎
 
Fastsocket Linxiaofeng
Fastsocket LinxiaofengFastsocket Linxiaofeng
Fastsocket Linxiaofeng
 
Spark sql meetup
Spark sql meetupSpark sql meetup
Spark sql meetup
 
2014 Hpocon 李志刚 1号店 - puppet在1号店的实践
2014 Hpocon 李志刚   1号店 - puppet在1号店的实践2014 Hpocon 李志刚   1号店 - puppet在1号店的实践
2014 Hpocon 李志刚 1号店 - puppet在1号店的实践
 
2014 Hpocon 姚仁捷 唯品会 - data driven ops
2014 Hpocon 姚仁捷   唯品会 - data driven ops2014 Hpocon 姚仁捷   唯品会 - data driven ops
2014 Hpocon 姚仁捷 唯品会 - data driven ops
 
2014 Hpocon 高驰涛 云智慧 - apm在高性能架构中的应用
2014 Hpocon 高驰涛   云智慧 - apm在高性能架构中的应用2014 Hpocon 高驰涛   云智慧 - apm在高性能架构中的应用
2014 Hpocon 高驰涛 云智慧 - apm在高性能架构中的应用
 
2014 Hpocon 黄慧攀 upyun - 平台架构的服务监控
2014 Hpocon 黄慧攀   upyun - 平台架构的服务监控2014 Hpocon 黄慧攀   upyun - 平台架构的服务监控
2014 Hpocon 黄慧攀 upyun - 平台架构的服务监控
 
2014 Hpocon 吴磊 ucloud - 由点到面 提升公有云服务可用性
2014 Hpocon 吴磊   ucloud - 由点到面 提升公有云服务可用性2014 Hpocon 吴磊   ucloud - 由点到面 提升公有云服务可用性
2014 Hpocon 吴磊 ucloud - 由点到面 提升公有云服务可用性
 
2014 Hpocon 周辉 大众点评 - 大众点评混合开发模式下的加速尝试
2014 Hpocon 周辉   大众点评 - 大众点评混合开发模式下的加速尝试2014 Hpocon 周辉   大众点评 - 大众点评混合开发模式下的加速尝试
2014 Hpocon 周辉 大众点评 - 大众点评混合开发模式下的加速尝试
 
Cuda 6 performance_report
Cuda 6 performance_reportCuda 6 performance_report
Cuda 6 performance_report
 
The Data Center and Hadoop
The Data Center and HadoopThe Data Center and Hadoop
The Data Center and Hadoop
 
Hadoop Hardware @Twitter: Size does matter.
Hadoop Hardware @Twitter: Size does matter.Hadoop Hardware @Twitter: Size does matter.
Hadoop Hardware @Twitter: Size does matter.
 
Q con shanghai2013-[ben lavender]-[long-distance relationships with robots]
Q con shanghai2013-[ben lavender]-[long-distance relationships with robots]Q con shanghai2013-[ben lavender]-[long-distance relationships with robots]
Q con shanghai2013-[ben lavender]-[long-distance relationships with robots]
 
Q con shanghai2013-[刘海锋]-[京东文件系统简介]
Q con shanghai2013-[刘海锋]-[京东文件系统简介]Q con shanghai2013-[刘海锋]-[京东文件系统简介]
Q con shanghai2013-[刘海锋]-[京东文件系统简介]
 
Q con shanghai2013-[韩军]-[超大型电商系统架构解密]
Q con shanghai2013-[韩军]-[超大型电商系统架构解密]Q con shanghai2013-[韩军]-[超大型电商系统架构解密]
Q con shanghai2013-[韩军]-[超大型电商系统架构解密]
 
Q con shanghai2013-[jains krums]-[real-time-delivery-archiecture]
Q con shanghai2013-[jains krums]-[real-time-delivery-archiecture]Q con shanghai2013-[jains krums]-[real-time-delivery-archiecture]
Q con shanghai2013-[jains krums]-[real-time-delivery-archiecture]
 
Q con shanghai2013-[黄舒泉]-[intel it openstack practice]
Q con shanghai2013-[黄舒泉]-[intel it openstack practice]Q con shanghai2013-[黄舒泉]-[intel it openstack practice]
Q con shanghai2013-[黄舒泉]-[intel it openstack practice]
 
Q con shanghai2013-罗婷-performance methodology
Q con shanghai2013-罗婷-performance methodologyQ con shanghai2013-罗婷-performance methodology
Q con shanghai2013-罗婷-performance methodology
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 

加快互联网核心协议,提高Web速度yuchungcheng

  • 1. Speed up TCP to make the Web WebRTC faster 郑又中 Yuchung Cheng Google ycheng@google.com http://googlecode.blogspot.com/2012/01/lets-make-tcp-faster.html
  • 2. Desktop Median: ~2.7s Mean: ~6.9s Mobile * Median: ~4.8s Mean: ~10.2s * optimistic How Fast Are Websites Around The World? - Google Analytics Blog (April, 2012)
  • 3. Content Type Avg # of Requests Avg size HTML 8 44 kB Images 53 635 kB Javascript 14 189 kB CSS 5 35 kB HTTP Archive - Trends (Sept, 2012)
  • 4. Transport Control Protocol (TCP) 1. Reliable and serialized delivery (RFC 793, 1981 - ) a. Export a reliable data pipe to apps b. Retransmit if packet is not acked 2. Congestion control (RFC 5681, 1988 - ) a. Adjust sending rate based on ACK rate (ack-clocking) b. Slide congestion window to send more data 3. Optimized for bulk transfer (large file)
  • 5. TCP is slow for the Web Handshake Emulating a Chrome user in Hong Kong with 1.5Mbps DSL accesing sohu.com with a warmed browser cache (http: //webpagetest.org)
  • 6. Existing TCP workarounds Why it won't work in the long run
  • 7. Persistent TCP connections ● Open & keep many TCP connections ○ Don't reduce cwnd after idle ● Problems ○ Still slow - TCP handshake for first contact and slow start after idle ○ Don't scale - need to manage many connections ■ Client, server, network ○ Port exhaustion - NAT boxes silently drop connections ○ Energy inefficient - TCP/FIN wakes up radios ● Persistent TCP connection is not a long term solution
  • 8. Let's make TCP fast Fast startup, loss recovery, and congestion control for mobile
  • 9. TCP handshake Client Server 35% HTTP and 11% SPDY requests wait SYN connect for handshake SYNACK ● 1 RTT overhead ● HTTP-GET in SYN sendmsg HTTP GET accept Challenges ● Resource exhaustion attack ● Amplification attack
  • 10. Resource exhaustion & amplified reflection attacks Attacker SYN: src=victim HTTP-GET Server Victim 1 (spoofed) SYN packet for 10 data packets
  • 11. TCP Fast Open Client Server Server grants a nonce, Fast Open cookie (FOC) SYN Generates ● AES_encrypt(client_ip, secret) SYNACK,cookie cookie ● TCP option (32 - 64bits) Stores cookie Client sends HTTP-GET in SYN with cookie SYN,cookie (HTTP-GET) Server accepts HTTP-GET in SYN SYNACK if cookie is valid Defend simple SYN-data flood [...] continues as regular TCP attacks
  • 12. Defending attacks An attacker can still ● Obtain valid cookie via a mole ● Flood spoofed SYN-data from another bot Defense ● Periodically rotate server secret ● Disable and use SYN cookie if pressured Other scenarios ● NAT ● Man-in-the-middle ● Firewalls drop SYN/data or strip cookie option
  • 13. Graceful fallback Client Server Server can always only acks the initial (SYN) sequence (e.g., SYN flood attack) SYN,cookie(HTTP-GET) invalid Client retries the data after handshake like cookie! SYNACK ack:SYN regular TCP HTTP-GET No performance penalty! HTTP 200 OK
  • 14. Page load time benchmarks "TCP Fast Open", SIGCOMM CoNEXT 2011 (best paper nominee)
  • 15. Using Fast Open for your applications Client: ● connect() then write() ● sendto(data, MSG_FASTOPEN) Server: ● setsockopt(TCP_FASTOPEN) Available in Linux 3.7 & being deployed on Google.com
  • 16. TCP slow start ● TCP is designed to probe the network to figure out the available capacity ● TCP Slow Start - feature, not a bug Packet Loss Exponential growth
  • 17. HTTP Archive says... ● 1098kb, 82 requests, ~30 hosts... ~14kb per request! ● Most HTTP traffic is composed of small, bursty, TCP flows Where we want to be You are here 1-3 RTT's
  • 18. Update CWND from 3 to 10 segments, or ~14960 bytes Default size on Linux 2.6.33+ - double check yours! Google servers use it since 2010 An Argument for Increasing TCP's initial Congestion window
  • 19. HTTP/TCP are 5 - 10 times slower on lossy networks
  • 20. Why is TCP slow on packet losses TCP recover losses in two ways ● Fast recovery (1 RTT): need dupacks ● Timeout (often 5-10 RTTs) Most losses in HTTP are tail drops (lost last N packets) ● No dupack to trigger fast recovery ● 70% losses on Google.com are recovered by timeout ● Timeout is long on short flows due to few RTT samples Solution: Tail Loss Probe (TLP) ● Retransmit the last packet to trigger fast recovery
  • 22. Tail Loss Probe performance ● 6% avg. reduction in HTTP response latency. 10% for 99%ile Mobile only
  • 23. But TCP performance on mobile is terrible We have some ideas ...
  • 24. Mobile networks are very different Desktop Mobile Loss (TCP) Low Low (wireless codec / rexmit) Delay variation Low ( queuing) High (wireless) Rate change Stable (cross traffic) Fluctuates (wireless) Cross traffic Same and other users Same user Disconnection Frequent Almost never
  • 25. TCP congestion control is not working on mobile Current TCP congestion control ● Sender-based ● Slowly probe and react to network rate changes (until loss or delay is too large) ● Per-flow fairness
  • 26. New mobile congestion control Key feature: client-centric Mobile client ● Measures the mobile link rate Congestion Manager ● Instruments the rate to the sender ● Prioritizes important connections Query/ Reply F1 F2 Fn Version 0.01: SPDY-cwnd-persist frame Outgoing ● server: SPDY-GO_AWAY (cwnd is 25) Incoming Data ACKs ● client: SPDY-SYN (cwnd was 25)
  • 27. Conclusions TCP is critical for Web performance but it's not optimized for Web 1. Fast Open - client sends HTTP-GET when connect a. Linux 3.7 2. IW10 - server sends 10 packets initially a. Linux 2.6.33+ 3. Tail Loss Probe - recover losses within 2-3 RTTs a. Open source in Q1/2013 4. Congestion control for mobile a. Under active research. Will open source in 2013 Google "ietf tcpm google" for our RFC proposals in IETF