-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dual HTTP/1.1 and HTTP/2 support at M5 #12
Comments
Open5GS already links in the microhttpd, nghttp2, gnutls and curl libraries (even though it doesn't use the microhttpd library anymore). Therefore I've been looking at how we can support HTTP/1.1 and HTTP/2 with and without TLS using these libraries. Microhttpd likes to manage its own sockets and select/epoll/poll loop, however it is possible to tell it that you wish to use external functions to manage some of these things. For example it is possible to allow the application to listen to a socket for connections and just pass the accepted client connections onto microhttpd to manage. You can also opt to run your own select/poll/epoll loop and feed the results to microhttpd for processing. If you are using TLS, then microhttpd will feed the data into a gnuTLS session. It is possible to obtain the gnuTLS session context from the microhttpd connection information. Microhttpd errors when it sees a nghttp2 prefers the application to manage sockets and uses callbacks to read and write data. This makes it easy to insert a TLS layer (or any other transport method you care to add). Given all this it looks like the best way for full integration is: non-TLS
This should allow h2c prior knowledge and connection upgrades to work when TLS is not in use. TLS
I think between these two methods we should be able to provide full HTTP/1.1 and HTTP/2 with optional TLS for the application function. Note: The open5gs PR open5gs/open5gs#1865 has now been merged and introduces the OpenSSL library alongside gnuTLS. It works by using OpenSSL SSL/TLS routines to manage a socket if |
Context
In order to unblock development of the Media Session Handler, issue #10 temporarily removed HTTP/2 support at reference point M5 in favour of HTTP/1.1. However, TS 26.512 clause 6.2.1.1 requires support for both versions of HTTP at this reference point (and at reference point M1).
The Open5GS framework currently supports only HTTP/2, but was patched to support HTTP/1.1 instead in #10.
This issue modifies the implementation so that the HTTP client is able to choose which of the two protocols it wishes to use, bringing it more in line with the requirements of TS 26.512.
Specification
Adjust
lib/sbi/server.c
behaviour in the Open5GS framework to support on the same server listening port:Detection of the HTTP/2 connection preface byte string (see section 3.5 of RFC 7540) moves the server into HTTP/2 (h2c) mode. Otherwise, it assumes HTTP/1.1 operation.
Support for protocol upgrade to HTTP/2 (h2c) operation after a period of HTTP/1.1 operation of an HTTP session (per section 6.7 of RFC 7230) is not required.
Adding TLS support (on a different server listening port) is not in the scope of this issue and will be tackled separately, possibly within the Open5GS project itself after discussion with the maintainer of that project.
Implementation notes
HTTP/1.1 support is of little use to the main Open5GS project because all service-based interactions in the Control Plane use HTTP/2 per TS 33.501 clause 13.1.0: this change to support both HTTP versions is only applicable when interacting with Application Functions in the Data Network.
It is therefore unclear whether it is best to change the server behaviour locally in this repository, or to clone the Open5GS repository and make it a submodule of this repository.
And there may be no value in contributing this change back to the Open5GS project.
The text was updated successfully, but these errors were encountered: