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

Database management system chapter12
Database management system chapter12Database management system chapter12
Database management system chapter12
Md. Mahedi Mahfuj
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
Dvir Volk
 

What's hot (20)

OAuth2 - Introduction
OAuth2 - IntroductionOAuth2 - Introduction
OAuth2 - Introduction
 
Stability Patterns for Microservices
Stability Patterns for MicroservicesStability Patterns for Microservices
Stability Patterns for Microservices
 
HBaseCon 2013: Apache HBase Table Snapshots
HBaseCon 2013: Apache HBase Table SnapshotsHBaseCon 2013: Apache HBase Table Snapshots
HBaseCon 2013: Apache HBase Table Snapshots
 
From distributed caches to in-memory data grids
From distributed caches to in-memory data gridsFrom distributed caches to in-memory data grids
From distributed caches to in-memory data grids
 
Event Sourcing & CQRS, Kafka, Rabbit MQ
Event Sourcing & CQRS, Kafka, Rabbit MQEvent Sourcing & CQRS, Kafka, Rabbit MQ
Event Sourcing & CQRS, Kafka, Rabbit MQ
 
Deep-Dive: Secure API Management
Deep-Dive: Secure API ManagementDeep-Dive: Secure API Management
Deep-Dive: Secure API Management
 
PostgreSQL Replication High Availability Methods
PostgreSQL Replication High Availability MethodsPostgreSQL Replication High Availability Methods
PostgreSQL Replication High Availability Methods
 
SIngle Sign On with Keycloak
SIngle Sign On with KeycloakSIngle Sign On with Keycloak
SIngle Sign On with Keycloak
 
The Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and ContainersThe Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and Containers
 
OAuth2 + API Security
OAuth2 + API SecurityOAuth2 + API Security
OAuth2 + API Security
 
Building secure applications with keycloak
Building secure applications with keycloak Building secure applications with keycloak
Building secure applications with keycloak
 
Database management system chapter12
Database management system chapter12Database management system chapter12
Database management system chapter12
 
Introduction to HTTP protocol
Introduction to HTTP protocolIntroduction to HTTP protocol
Introduction to HTTP protocol
 
Event Driven-Architecture from a Scalability perspective
Event Driven-Architecture from a Scalability perspectiveEvent Driven-Architecture from a Scalability perspective
Event Driven-Architecture from a Scalability perspective
 
Grokking Techtalk #39: Gossip protocol and applications
Grokking Techtalk #39: Gossip protocol and applicationsGrokking Techtalk #39: Gossip protocol and applications
Grokking Techtalk #39: Gossip protocol and applications
 
Role of OSI Layer when we open a webpage
Role of OSI Layer when we open a webpageRole of OSI Layer when we open a webpage
Role of OSI Layer when we open a webpage
 
What’s New in NGINX Ingress Controller for Kubernetes Release 1.5.0
What’s New in NGINX Ingress Controller for Kubernetes Release 1.5.0What’s New in NGINX Ingress Controller for Kubernetes Release 1.5.0
What’s New in NGINX Ingress Controller for Kubernetes Release 1.5.0
 
OAuth 2
OAuth 2OAuth 2
OAuth 2
 
How to Design Indexes, Really
How to Design Indexes, ReallyHow to Design Indexes, Really
How to Design Indexes, Really
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
 

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

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 

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?