SlideShare a Scribd company logo
1 of 25
Networking in .NET 7.0 and
YARP
WUG Days Brno 2022
Karel Zikmund – @ziki_cz
Agenda
• HTTP/3 and QUIC
• Evolution from HTTP/1.1 and HTTP/2 – key differences
• Advantages
• .NET 7.0 implementation
• Future in .NET 8.0+
• HTTP/2 WebSockets
• YARP – Yet Another Reverse Proxy
• What is Reverse Proxy
• When you need Reverse Proxy?
• YARP in production
HTTP versions
• What’s difference between:
• HTTP/1.1
• HTTP/2
• What’s difference between:
• HTTP/2
• HTTP/3
HTTP/1.1
• HTTP vs. HTTPS
• Textual protocol
• Multiple connections
• 3-way handshake (3 RTT)
• TCP – 1 RTT – SYN/ACK
• TLS 1.2 – 2 RTTs (Hello + Key)
• TLS 1.3 (2 RTT)
• TCP slow start – Window ramp up
• HTTP Pipelining
HTTP/2
• Binary protocol (packets with frames)
• Multiplexing streams on 1 connection
• TCP-based
• 3 RTT (or 2 RTT with TLS 1.3)
• Can be technically without SSL, unencrypted
• Head of the line blocking
• Packet loss blocks all streams, not just the one with lost packet
HTTP/3
• Binary protocol (packets with frames)
• Multiplexing streams on 1 connection
• QUIC-based
• QUIC = UDP + TLS
• 1 RTT
• 25.1% of all websites
• Major browsers – https://caniuse.com/http3
HTTP/3 – Advantages
• Unreliable networks – last mile network
• No head of the line blocking
• Improved loss recovery
• 0-RTT
• Keys from previous connection
• Dangerous – replay attacks
• Idempotent requests (e.g. harmless GET)
• Connection ID
• Transfer between networks
• Requires server support – by default in .NET
QUIC – Pros and Cons
• Multi-path … also for HTTP/3
• RFC in progress
• Increase bandwidth (multiple routes)
• Decrease latency (duplicated traffic) – streaming
• Unreliable delivery
• Not in .NET yet
• Extensible and versioned
• Network appliances (routers, proxies) – problems with UDP
HTTP/3 & QUIC – .NET support
• msquic-based – http://github.com/microsoft/msquic
• OSS, x-plat
• HTTP/3
• .NET 7.0 – full support (client and server) on Windows and Linux
• Performance – on par with HTTP/2
• QUIC APIs
• .NET 7.0 – GA quality
• API shape is Preview (reserve right to change it in .NET 8.0)
• Looking for consumers to validate
.NET Usage
• HTTP/3 opt-in
• HttpClient – defaults to HTTP/1.1
• HttpRequestMessage.Version = 3.0
• QUIC: EnablePreviewFeatures
.NET 8.0+
• HTTP/3 enabled by default in Kestrel
• More Performance work
• Finalize QUIC API shape
• Additional non-critical features
• 0-RTT (as opt-in)
• Support macOS, Mobile platforms (iOS, Android)
• Additional protocols and extensions
• gRPC over HTTP/3
• Multi-path
• WebTransport
• QUIC Datagram
HTTP/2 WebSockets
• Same WebSocket protocol, just over HTTP/2
• Pros:
• Reuse HTTP/2 connection – better perf
• Client:
HTTP/2 WebSockets
• Chrome and Edge – enabled by default
• Uses CONNECT word instead of GET – routes may need update
WebSockets Future
• HTTP/3 WebSockets
• WebTransport – WebSockets done right
• Session with multiple QUIC streams
• Multiple sessions on HTTP/3 connection
• Prototype in progress
YARP
• Yet Another Reverse Proxy
• https://microsoft.github.io/reverse-proxy
• OSS: https://github.com/microsoft/reverse-proxy
• Layer-7 proxy – terminates & re-issues requests
• Other popular reverse proxies: Nginx, HAProxy, Envoy, Ocelot, …
YARP and reverse proxies
• Who used YARP?
• Who used some Reverse Proxy?
• Who knows what a reverse proxy is?
What is a reverse proxy
• Public endpoint
• Load balancing between backend servers
• Can offload work from backend servers: Encryption, Auth, Compression, Caching
Reverse
proxy
contoso.com/orders
contoso.com/store
woodgrovebank.com
Public Internet Private Network
Reverse proxies – Why to use them?
• Load balancing
• A/B testing, or Version rollout
• Health checks, health status
• Indirection between URL-space and backend implementation
• API Management – consistent API surface for customers
• Offloading from backend
• Auth, compression, encryption, static files (like CDN)
• Authentication migration
• Cloud to On-prem reverse tunnel (*)
• Route local traffic to remote servers (single point of control and config)
• k8s and Service Fabric ingress control
• .NET Framework migration to .NET Core
YARP
• Library, not EXE
• 2 releases: 1.0 & 1.1
• .NET 5.0+ support
• Extensibility in C#, layered
• x-plat
• Great perf
• Latest protocols (gRPC , HTTP/3, HTTP/2 WebSockets)
• Drives innovation and perf improvements into .NET
YARP – docs
https://microsoft.github.io/reverse-proxy
YARP – Azure App Service
• Blog post
• 160B+ requests/day … 1.9M RPS
• 14M+ host names
• .NET 6.0 + YARP
• Why?
• Perf improvements
• 80% in throughput in perf tests
• Lower CPU usage
• More extensibility points
• New customer scenarios:
• gRPC, HTTP/3, per-host cipher suite config, custom error pages, …
YARP – Dynamics 365
• Announced 2021 November at .NET Conf
• >100B requests/month ... 38.5K RPS
• >7.5PB/month … transferred data
• ~700 instances of YARP
• Original authors
• Started on .NET Core 3.1
YARP – Architecture with pipeline
ASP.NET
Routing
TLS Termination
Auth2
Static Files
Other routes
Config
Session
Affinity
Load
Balancing
Request
Transformations
Http
Forwarder
Destination
Enumeration
HttpClient*
Health
checks
Specific
destination
server
http(s)
http(s)
Proxy process
Kestrel
Passive
Health
Checks
YARP – Architecture Http Forwarder
ASP.NET
Routing†
TLS Termination
Auth2
Static Files
Other routes
Http
Forwarder
HttpClient*
Specific
destination
server
http(s)
http(s)
Proxy process
Kestrel
Your custom
handler(s)
Request
Transformations
Site Information
/ Cache
Load balancing
Health checks
Summary
• HTTP/3 and QUIC support in .NET 7.0
• GA quality
• QUIC API shape may change in .NET 8.0
• Pro: Unreliable networks, Mobile scenarios
• HTTP/2 WebSockets
• Client needs new API call to reuse connection
• Server needs ConnectMethod change
• YARP
• Library, extensible via C#
• Micro-services world needs reverse proxies
@ziki_cz

More Related Content

What's hot

Arp and rarp
Arp and rarpArp and rarp
Arp and rarp
Mohd Arif
 
Hypertext transfer protocol and hypertext transfer protocol secure(HTTP and H...
Hypertext transfer protocol and hypertext transfer protocol secure(HTTP and H...Hypertext transfer protocol and hypertext transfer protocol secure(HTTP and H...
Hypertext transfer protocol and hypertext transfer protocol secure(HTTP and H...
rahul kundu
 

What's hot (20)

Ssl https
Ssl httpsSsl https
Ssl https
 
Load Testing - How to Stress Your Odoo with Locust
Load Testing - How to Stress Your Odoo with LocustLoad Testing - How to Stress Your Odoo with Locust
Load Testing - How to Stress Your Odoo with Locust
 
Radius vs. Tacacs+
Radius vs. Tacacs+Radius vs. Tacacs+
Radius vs. Tacacs+
 
Streaming replication in practice
Streaming replication in practiceStreaming replication in practice
Streaming replication in practice
 
PostgreSQL : Introduction
PostgreSQL : IntroductionPostgreSQL : Introduction
PostgreSQL : Introduction
 
Introduction to MQTT
Introduction to MQTTIntroduction to MQTT
Introduction to MQTT
 
Twitter - Architecture and Scalability lessons
Twitter - Architecture and Scalability lessonsTwitter - Architecture and Scalability lessons
Twitter - Architecture and Scalability lessons
 
Scaling your logging infrastructure using syslog-ng
Scaling your logging infrastructure using syslog-ngScaling your logging infrastructure using syslog-ng
Scaling your logging infrastructure using syslog-ng
 
Arp and rarp
Arp and rarpArp and rarp
Arp and rarp
 
Hypertext transfer protocol and hypertext transfer protocol secure(HTTP and H...
Hypertext transfer protocol and hypertext transfer protocol secure(HTTP and H...Hypertext transfer protocol and hypertext transfer protocol secure(HTTP and H...
Hypertext transfer protocol and hypertext transfer protocol secure(HTTP and H...
 
Simple Mail Transfer Protocol
Simple Mail Transfer ProtocolSimple Mail Transfer Protocol
Simple Mail Transfer Protocol
 
Advanced Percona XtraDB Cluster in a nutshell... la suite
Advanced Percona XtraDB Cluster in a nutshell... la suiteAdvanced Percona XtraDB Cluster in a nutshell... la suite
Advanced Percona XtraDB Cluster in a nutshell... la suite
 
Idram merchant api- Idram Payment System merchant interface description
Idram merchant api- Idram Payment System merchant interface descriptionIdram merchant api- Idram Payment System merchant interface description
Idram merchant api- Idram Payment System merchant interface description
 
PostgreSQL Replication Tutorial
PostgreSQL Replication TutorialPostgreSQL Replication Tutorial
PostgreSQL Replication Tutorial
 
Telnet & SSH
Telnet & SSHTelnet & SSH
Telnet & SSH
 
FOSDEM MySQL & Friends Devroom, February 2018 MySQL Point-in-Time Recovery l...
FOSDEM MySQL & Friends Devroom, February 2018  MySQL Point-in-Time Recovery l...FOSDEM MySQL & Friends Devroom, February 2018  MySQL Point-in-Time Recovery l...
FOSDEM MySQL & Friends Devroom, February 2018 MySQL Point-in-Time Recovery l...
 
HTTP/3, QUIC and streaming
HTTP/3, QUIC and streamingHTTP/3, QUIC and streaming
HTTP/3, QUIC and streaming
 
Postgresql 12 streaming replication hol
Postgresql 12 streaming replication holPostgresql 12 streaming replication hol
Postgresql 12 streaming replication hol
 
SMTP Simple Mail Transfer Protocol
SMTP Simple Mail Transfer ProtocolSMTP Simple Mail Transfer Protocol
SMTP Simple Mail Transfer Protocol
 
Hacking Exposed Live: Mobile Targeted Threats
Hacking Exposed Live: Mobile Targeted ThreatsHacking Exposed Live: Mobile Targeted Threats
Hacking Exposed Live: Mobile Targeted Threats
 

Similar to WUG Days 2022 Brno - Networking in .NET 7.0 and YARP -- Karel Zikmund

SignalR: Add real-time to your applications
SignalR: Add real-time to your applicationsSignalR: Add real-time to your applications
SignalR: Add real-time to your applications
Eugene Zharkov
 
Data power v7 update - Ravi Katikala
Data power v7 update - Ravi KatikalaData power v7 update - Ravi Katikala
Data power v7 update - Ravi Katikala
floridawusergroup
 

Similar to WUG Days 2022 Brno - Networking in .NET 7.0 and YARP -- Karel Zikmund (20)

.NET Conf 2022 - Networking in .NET 7
.NET Conf 2022 - Networking in .NET 7.NET Conf 2022 - Networking in .NET 7
.NET Conf 2022 - Networking in .NET 7
 
SignalR: Add real-time to your applications
SignalR: Add real-time to your applicationsSignalR: Add real-time to your applications
SignalR: Add real-time to your applications
 
Better performances with HTTP/2
Better performances with HTTP/2Better performances with HTTP/2
Better performances with HTTP/2
 
gRPC on .NET Core - NDC Sydney 2019
gRPC on .NET Core - NDC Sydney 2019gRPC on .NET Core - NDC Sydney 2019
gRPC on .NET Core - NDC Sydney 2019
 
Building a Router
Building a RouterBuilding a Router
Building a Router
 
Adding Support for Networking and Web Technologies to an Embedded System
Adding Support for Networking and Web Technologies to an Embedded SystemAdding Support for Networking and Web Technologies to an Embedded System
Adding Support for Networking and Web Technologies to an Embedded System
 
A New Internet? Introduction to HTTP/2, QUIC and DOH
A New Internet? Introduction to HTTP/2, QUIC and DOHA New Internet? Introduction to HTTP/2, QUIC and DOH
A New Internet? Introduction to HTTP/2, QUIC and DOH
 
PAC 2019 virtual Scott Moore
PAC 2019  virtual   Scott Moore PAC 2019  virtual   Scott Moore
PAC 2019 virtual Scott Moore
 
HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...
HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...
HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...
 
Data power v7 update - Ravi Katikala
Data power v7 update - Ravi KatikalaData power v7 update - Ravi Katikala
Data power v7 update - Ravi Katikala
 
Introduction to WebSockets
Introduction to WebSocketsIntroduction to WebSockets
Introduction to WebSockets
 
HTTP/2 and QUICK protocols. Optimizing the Web stack for HTTP/2 era
HTTP/2 and QUICK protocols. Optimizing the Web stack for HTTP/2 eraHTTP/2 and QUICK protocols. Optimizing the Web stack for HTTP/2 era
HTTP/2 and QUICK protocols. Optimizing the Web stack for HTTP/2 era
 
Internet of Things - protocols review (MeetUp Wireless & Networks, Poznań 21....
Internet of Things - protocols review (MeetUp Wireless & Networks, Poznań 21....Internet of Things - protocols review (MeetUp Wireless & Networks, Poznań 21....
Internet of Things - protocols review (MeetUp Wireless & Networks, Poznań 21....
 
Osnug meetup-tungsten fabric - overview.pptx
Osnug meetup-tungsten fabric - overview.pptxOsnug meetup-tungsten fabric - overview.pptx
Osnug meetup-tungsten fabric - overview.pptx
 
A new Internet? Intro to HTTP/2, QUIC, DoH and DNS over QUIC
A new Internet? Intro to HTTP/2, QUIC, DoH and DNS over QUICA new Internet? Intro to HTTP/2, QUIC, DoH and DNS over QUIC
A new Internet? Intro to HTTP/2, QUIC, DoH and DNS over QUIC
 
.NET Core Today and Tomorrow
.NET Core Today and Tomorrow.NET Core Today and Tomorrow
.NET Core Today and Tomorrow
 
Accelerating and Securing your Applications in AWS. In-depth look at Solving ...
Accelerating and Securing your Applications in AWS. In-depth look at Solving ...Accelerating and Securing your Applications in AWS. In-depth look at Solving ...
Accelerating and Securing your Applications in AWS. In-depth look at Solving ...
 
What's new in NGINX Plus R19
What's new in NGINX Plus R19What's new in NGINX Plus R19
What's new in NGINX Plus R19
 
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
 
Citrix Day 2015 Net Scaler Release 10.5 Update v10
Citrix Day 2015 Net Scaler Release 10.5 Update v10Citrix Day 2015 Net Scaler Release 10.5 Update v10
Citrix Day 2015 Net Scaler Release 10.5 Update v10
 

More from Karel Zikmund

More from Karel Zikmund (20)

NDC London 2020 - Challenges of Managing CoreFx Repo -- Karel Zikmund
NDC London 2020 - Challenges of Managing CoreFx Repo -- Karel ZikmundNDC London 2020 - Challenges of Managing CoreFx Repo -- Karel Zikmund
NDC London 2020 - Challenges of Managing CoreFx Repo -- Karel Zikmund
 
NDC Sydney 2019 - Async Demystified -- Karel Zikmund
NDC Sydney 2019 - Async Demystified -- Karel ZikmundNDC Sydney 2019 - Async Demystified -- Karel Zikmund
NDC Sydney 2019 - Async Demystified -- Karel Zikmund
 
.NET Core Summer event 2019 in Vienna, AT - .NET 5 - Future of .NET on Mobile...
.NET Core Summer event 2019 in Vienna, AT - .NET 5 - Future of .NET on Mobile....NET Core Summer event 2019 in Vienna, AT - .NET 5 - Future of .NET on Mobile...
.NET Core Summer event 2019 in Vienna, AT - .NET 5 - Future of .NET on Mobile...
 
.NET Core Summer event 2019 in Linz, AT - War stories from .NET team -- Karel...
.NET Core Summer event 2019 in Linz, AT - War stories from .NET team -- Karel....NET Core Summer event 2019 in Linz, AT - War stories from .NET team -- Karel...
.NET Core Summer event 2019 in Linz, AT - War stories from .NET team -- Karel...
 
.NET Core Summer event 2019 in Brno, CZ - Async demystified -- Karel Zikmund
.NET Core Summer event 2019 in Brno, CZ - Async demystified -- Karel Zikmund.NET Core Summer event 2019 in Brno, CZ - Async demystified -- Karel Zikmund
.NET Core Summer event 2019 in Brno, CZ - Async demystified -- Karel Zikmund
 
.NET Core Summer event 2019 in Brno, CZ - .NET Core Networking stack and perf...
.NET Core Summer event 2019 in Brno, CZ - .NET Core Networking stack and perf....NET Core Summer event 2019 in Brno, CZ - .NET Core Networking stack and perf...
.NET Core Summer event 2019 in Brno, CZ - .NET Core Networking stack and perf...
 
.NET Core Summer event 2019 in Brno, CZ - War stories from .NET team -- Karel...
.NET Core Summer event 2019 in Brno, CZ - War stories from .NET team -- Karel....NET Core Summer event 2019 in Brno, CZ - War stories from .NET team -- Karel...
.NET Core Summer event 2019 in Brno, CZ - War stories from .NET team -- Karel...
 
.NET Core Summer event 2019 in Prague, CZ - War stories from .NET team -- Kar...
.NET Core Summer event 2019 in Prague, CZ - War stories from .NET team -- Kar....NET Core Summer event 2019 in Prague, CZ - War stories from .NET team -- Kar...
.NET Core Summer event 2019 in Prague, CZ - War stories from .NET team -- Kar...
 
.NET Core Summer event 2019 in Vienna, AT - War stories from .NET team -- Kar...
.NET Core Summer event 2019 in Vienna, AT - War stories from .NET team -- Kar....NET Core Summer event 2019 in Vienna, AT - War stories from .NET team -- Kar...
.NET Core Summer event 2019 in Vienna, AT - War stories from .NET team -- Kar...
 
.NET Core Summer event 2019 in NL - War stories from .NET team -- Karel Zikmund
.NET Core Summer event 2019 in NL - War stories from .NET team -- Karel Zikmund.NET Core Summer event 2019 in NL - War stories from .NET team -- Karel Zikmund
.NET Core Summer event 2019 in NL - War stories from .NET team -- Karel Zikmund
 
NDC Oslo 2019 - War stories from .NET team -- Karel Zikmund
NDC Oslo 2019 - War stories from .NET team -- Karel ZikmundNDC Oslo 2019 - War stories from .NET team -- Karel Zikmund
NDC Oslo 2019 - War stories from .NET team -- Karel Zikmund
 
DotNext 2017 in Moscow - Challenges of Managing CoreFX repo -- Karel Zikmund
DotNext 2017 in Moscow - Challenges of Managing CoreFX repo -- Karel ZikmundDotNext 2017 in Moscow - Challenges of Managing CoreFX repo -- Karel Zikmund
DotNext 2017 in Moscow - Challenges of Managing CoreFX repo -- Karel Zikmund
 
DotNext 2017 in Moscow - .NET Core Networking stack and Performance -- Karel ...
DotNext 2017 in Moscow - .NET Core Networking stack and Performance -- Karel ...DotNext 2017 in Moscow - .NET Core Networking stack and Performance -- Karel ...
DotNext 2017 in Moscow - .NET Core Networking stack and Performance -- Karel ...
 
.NET MeetUp Brno 2017 - Microsoft Engineering teams in Europe -- Karel Zikmund
.NET MeetUp Brno 2017 - Microsoft Engineering teams in Europe -- Karel Zikmund.NET MeetUp Brno 2017 - Microsoft Engineering teams in Europe -- Karel Zikmund
.NET MeetUp Brno 2017 - Microsoft Engineering teams in Europe -- Karel Zikmund
 
.NET MeetUp Brno 2017 - Xamarin .NET internals -- Marek Safar
.NET MeetUp Brno 2017 - Xamarin .NET internals -- Marek Safar.NET MeetUp Brno 2017 - Xamarin .NET internals -- Marek Safar
.NET MeetUp Brno 2017 - Xamarin .NET internals -- Marek Safar
 
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund
 
.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
 
.NET MeetUp Prague 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Prague 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund.NET MeetUp Prague 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Prague 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
 
.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund
.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund
.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund
 
.NET MeetUp Amsterdam 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Amsterdam 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund.NET MeetUp Amsterdam 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Amsterdam 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
 

Recently uploaded

Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 

Recently uploaded (20)

Driving Innovation: Scania's API Revolution with WSO2
Driving Innovation: Scania's API Revolution with WSO2Driving Innovation: Scania's API Revolution with WSO2
Driving Innovation: Scania's API Revolution with WSO2
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
WSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
WSO2CON2024 - Why Should You Consider Ballerina for Your Next IntegrationWSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
WSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
 
WSO2CON 2024 - Designing Event-Driven Enterprises: Stories of Transformation
WSO2CON 2024 - Designing Event-Driven Enterprises: Stories of TransformationWSO2CON 2024 - Designing Event-Driven Enterprises: Stories of Transformation
WSO2CON 2024 - Designing Event-Driven Enterprises: Stories of Transformation
 
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdfAzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
 
WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...
WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...
WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
WSO2Con2024 - Low-Code Integration Tooling
WSO2Con2024 - Low-Code Integration ToolingWSO2Con2024 - Low-Code Integration Tooling
WSO2Con2024 - Low-Code Integration Tooling
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
WSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid EnvironmentsWSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid Environments
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...
WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...
WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
WSO2CON 2024 - Lessons from the Field: Legacy Platforms – It's Time to Let Go...
WSO2CON 2024 - Lessons from the Field: Legacy Platforms – It's Time to Let Go...WSO2CON 2024 - Lessons from the Field: Legacy Platforms – It's Time to Let Go...
WSO2CON 2024 - Lessons from the Field: Legacy Platforms – It's Time to Let Go...
 
WSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AI
 
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 

WUG Days 2022 Brno - Networking in .NET 7.0 and YARP -- Karel Zikmund

  • 1. Networking in .NET 7.0 and YARP WUG Days Brno 2022 Karel Zikmund – @ziki_cz
  • 2. Agenda • HTTP/3 and QUIC • Evolution from HTTP/1.1 and HTTP/2 – key differences • Advantages • .NET 7.0 implementation • Future in .NET 8.0+ • HTTP/2 WebSockets • YARP – Yet Another Reverse Proxy • What is Reverse Proxy • When you need Reverse Proxy? • YARP in production
  • 3. HTTP versions • What’s difference between: • HTTP/1.1 • HTTP/2 • What’s difference between: • HTTP/2 • HTTP/3
  • 4. HTTP/1.1 • HTTP vs. HTTPS • Textual protocol • Multiple connections • 3-way handshake (3 RTT) • TCP – 1 RTT – SYN/ACK • TLS 1.2 – 2 RTTs (Hello + Key) • TLS 1.3 (2 RTT) • TCP slow start – Window ramp up • HTTP Pipelining
  • 5. HTTP/2 • Binary protocol (packets with frames) • Multiplexing streams on 1 connection • TCP-based • 3 RTT (or 2 RTT with TLS 1.3) • Can be technically without SSL, unencrypted • Head of the line blocking • Packet loss blocks all streams, not just the one with lost packet
  • 6. HTTP/3 • Binary protocol (packets with frames) • Multiplexing streams on 1 connection • QUIC-based • QUIC = UDP + TLS • 1 RTT • 25.1% of all websites • Major browsers – https://caniuse.com/http3
  • 7. HTTP/3 – Advantages • Unreliable networks – last mile network • No head of the line blocking • Improved loss recovery • 0-RTT • Keys from previous connection • Dangerous – replay attacks • Idempotent requests (e.g. harmless GET) • Connection ID • Transfer between networks • Requires server support – by default in .NET
  • 8. QUIC – Pros and Cons • Multi-path … also for HTTP/3 • RFC in progress • Increase bandwidth (multiple routes) • Decrease latency (duplicated traffic) – streaming • Unreliable delivery • Not in .NET yet • Extensible and versioned • Network appliances (routers, proxies) – problems with UDP
  • 9. HTTP/3 & QUIC – .NET support • msquic-based – http://github.com/microsoft/msquic • OSS, x-plat • HTTP/3 • .NET 7.0 – full support (client and server) on Windows and Linux • Performance – on par with HTTP/2 • QUIC APIs • .NET 7.0 – GA quality • API shape is Preview (reserve right to change it in .NET 8.0) • Looking for consumers to validate
  • 10. .NET Usage • HTTP/3 opt-in • HttpClient – defaults to HTTP/1.1 • HttpRequestMessage.Version = 3.0 • QUIC: EnablePreviewFeatures
  • 11. .NET 8.0+ • HTTP/3 enabled by default in Kestrel • More Performance work • Finalize QUIC API shape • Additional non-critical features • 0-RTT (as opt-in) • Support macOS, Mobile platforms (iOS, Android) • Additional protocols and extensions • gRPC over HTTP/3 • Multi-path • WebTransport • QUIC Datagram
  • 12. HTTP/2 WebSockets • Same WebSocket protocol, just over HTTP/2 • Pros: • Reuse HTTP/2 connection – better perf • Client:
  • 13. HTTP/2 WebSockets • Chrome and Edge – enabled by default • Uses CONNECT word instead of GET – routes may need update
  • 14. WebSockets Future • HTTP/3 WebSockets • WebTransport – WebSockets done right • Session with multiple QUIC streams • Multiple sessions on HTTP/3 connection • Prototype in progress
  • 15. YARP • Yet Another Reverse Proxy • https://microsoft.github.io/reverse-proxy • OSS: https://github.com/microsoft/reverse-proxy • Layer-7 proxy – terminates & re-issues requests • Other popular reverse proxies: Nginx, HAProxy, Envoy, Ocelot, …
  • 16. YARP and reverse proxies • Who used YARP? • Who used some Reverse Proxy? • Who knows what a reverse proxy is?
  • 17. What is a reverse proxy • Public endpoint • Load balancing between backend servers • Can offload work from backend servers: Encryption, Auth, Compression, Caching Reverse proxy contoso.com/orders contoso.com/store woodgrovebank.com Public Internet Private Network
  • 18. Reverse proxies – Why to use them? • Load balancing • A/B testing, or Version rollout • Health checks, health status • Indirection between URL-space and backend implementation • API Management – consistent API surface for customers • Offloading from backend • Auth, compression, encryption, static files (like CDN) • Authentication migration • Cloud to On-prem reverse tunnel (*) • Route local traffic to remote servers (single point of control and config) • k8s and Service Fabric ingress control • .NET Framework migration to .NET Core
  • 19. YARP • Library, not EXE • 2 releases: 1.0 & 1.1 • .NET 5.0+ support • Extensibility in C#, layered • x-plat • Great perf • Latest protocols (gRPC , HTTP/3, HTTP/2 WebSockets) • Drives innovation and perf improvements into .NET
  • 21. YARP – Azure App Service • Blog post • 160B+ requests/day … 1.9M RPS • 14M+ host names • .NET 6.0 + YARP • Why? • Perf improvements • 80% in throughput in perf tests • Lower CPU usage • More extensibility points • New customer scenarios: • gRPC, HTTP/3, per-host cipher suite config, custom error pages, …
  • 22. YARP – Dynamics 365 • Announced 2021 November at .NET Conf • >100B requests/month ... 38.5K RPS • >7.5PB/month … transferred data • ~700 instances of YARP • Original authors • Started on .NET Core 3.1
  • 23. YARP – Architecture with pipeline ASP.NET Routing TLS Termination Auth2 Static Files Other routes Config Session Affinity Load Balancing Request Transformations Http Forwarder Destination Enumeration HttpClient* Health checks Specific destination server http(s) http(s) Proxy process Kestrel Passive Health Checks
  • 24. YARP – Architecture Http Forwarder ASP.NET Routing† TLS Termination Auth2 Static Files Other routes Http Forwarder HttpClient* Specific destination server http(s) http(s) Proxy process Kestrel Your custom handler(s) Request Transformations Site Information / Cache Load balancing Health checks
  • 25. Summary • HTTP/3 and QUIC support in .NET 7.0 • GA quality • QUIC API shape may change in .NET 8.0 • Pro: Unreliable networks, Mobile scenarios • HTTP/2 WebSockets • Client needs new API call to reuse connection • Server needs ConnectMethod change • YARP • Library, extensible via C# • Micro-services world needs reverse proxies @ziki_cz

Editor's Notes

  1. About me: Work on .NET team for 17y For last 5 years Manager on Networking team and for YARP (cross-collaboration with ASP.NET team)
  2. RTT = Round-Trip time Between data centers, from Australia – matters a lot
  3. Known headers not in textual form, custom headers are – built-in compression of repeating headers (HPACK) 100 streams default, technically ok to have multiple connections TCP slow start, but less 2-3 RTT handshakes
  4. Most major browsers Akamai (CDN)
  5. Azure Networking – some reverse proxies (not all)
  6. Preview in .NET 6.0 – under a switch Validation: Non-msquic implementation
  7. You have to supply handler / HttpClient yourself to share HTTP/2 connection Automatic pooling is bad (ServicePoint) We throw for ConnectAsync without handler
  8. Why build yet another one? – Extensibility & Customizability
  9. Public endpoint to your sites & services, or as Service mesh For example: Ingress for k8s and Service Fabric
  10. API Management solution - consistent API surface for customers backed by multitude of micro-services (replace Azure API Management) Routing local traffic to remote servers (single point of control and config) Like forward proxy, but client does not have to be aware of it
  11. YARP 1.0 – November 2021 YARP 1.1 – May 2022 Not Lua / C++ … Nginx On Windows runs better than most other proxies Can run in IIS and HTTP.sys Public benchmarks Community: Node.js migration – throughput was ~6-7x greater on ASP .NET Core; P99 latency was ~2-4x better on ASP .NET Core.
  12. Also GH Discussions and Issues
  13. Announced 8/24 (2022)
  14. We are a library, not EXE Config from json, but interface pluggable Apply config change
  15. Advanced mode for even higher customization (large services)
  16. Feedback – did you like it or not?