Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
8f419a48
Commit
8f419a48
authored
Sep 13, 2021
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Add --frontend-quic-congestion-controller option
parent
fcdac50f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
1 deletion
+47
-1
gennghttpxfun.py
gennghttpxfun.py
+1
-0
src/shrpx.cc
src/shrpx.cc
+18
-0
src/shrpx_config.cc
src/shrpx_config.cc
+16
-0
src/shrpx_config.h
src/shrpx_config.h
+4
-0
src/shrpx_http3_upstream.cc
src/shrpx_http3_upstream.cc
+8
-1
No files found.
gennghttpxfun.py
View file @
8f419a48
...
...
@@ -191,6 +191,7 @@ OPTIONS = [
"frontend-quic-early-data"
,
"frontend-quic-qlog-dir"
,
"frontend-quic-require-token"
,
"frontend-quic-congestion-controller"
,
]
LOGVARS
=
[
...
...
src/shrpx.cc
View file @
8f419a48
...
...
@@ -1854,6 +1854,8 @@ void fill_default_config(Config *config) {
auto
&
bpfconf
=
quicconf
.
bpf
;
bpfconf
.
prog_file
=
StringRef
::
from_lit
(
PKGLIBDIR
"/reuseport_kern.o"
);
upstreamconf
.
congestion_controller
=
NGTCP2_CC_ALGO_CUBIC
;
}
auto
&
http3conf
=
config
->
http3
;
...
...
@@ -3226,6 +3228,15 @@ HTTP/3 and QUIC:
Require an address validation token for a frontend QUIC
connection. Server sends a token in Retry packet or
NEW_TOKEN frame in the previous connection.
--frontend-quic-congestion-controller=<CC>
Specify a congestion controller algorithm for a frontend
QUIC connection. <CC> should be either "cubic" or
"bbr".
Default: )"
<<
(
config
->
quic
.
upstream
.
congestion_controller
==
NGTCP2_CC_ALGO_CUBIC
?
"cubic"
:
"bbr"
)
<<
R"(
--no-quic-bpf
Disable eBPF.
--frontend-http3-window-size=<SIZE>
...
...
@@ -4022,6 +4033,8 @@ int main(int argc, char **argv) {
181
},
{
SHRPX_OPT_FRONTEND_QUIC_REQUIRE_TOKEN
.
c_str
(),
no_argument
,
&
flag
,
182
},
{
SHRPX_OPT_FRONTEND_QUIC_CONGESTION_CONTROLLER
.
c_str
(),
required_argument
,
&
flag
,
183
},
{
nullptr
,
0
,
nullptr
,
0
}};
int
option_index
=
0
;
...
...
@@ -4894,6 +4907,11 @@ int main(int argc, char **argv) {
cmdcfgs
.
emplace_back
(
SHRPX_OPT_FRONTEND_QUIC_REQUIRE_TOKEN
,
StringRef
::
from_lit
(
"yes"
));
break
;
case
183
:
// --frontend-quic-congestion-controller
cmdcfgs
.
emplace_back
(
SHRPX_OPT_FRONTEND_QUIC_CONGESTION_CONTROLLER
,
StringRef
{
optarg
});
break
;
default:
break
;
}
...
...
src/shrpx_config.cc
View file @
8f419a48
...
...
@@ -2571,6 +2571,9 @@ int option_lookup_token(const char *name, size_t namelen) {
if
(
util
::
strieq_l
(
"frontend-http2-dump-response-heade"
,
name
,
34
))
{
return
SHRPX_OPTID_FRONTEND_HTTP2_DUMP_RESPONSE_HEADER
;
}
if
(
util
::
strieq_l
(
"frontend-quic-congestion-controlle"
,
name
,
34
))
{
return
SHRPX_OPTID_FRONTEND_QUIC_CONGESTION_CONTROLLER
;
}
break
;
}
break
;
...
...
@@ -3997,6 +4000,19 @@ int parse_config(Config *config, int optid, const StringRef &opt,
config
->
quic
.
upstream
.
require_token
=
util
::
strieq_l
(
"yes"
,
optarg
);
#endif // ENABLE_HTTP3
return
0
;
case
SHRPX_OPTID_FRONTEND_QUIC_CONGESTION_CONTROLLER
:
#ifdef ENABLE_HTTP3
if
(
util
::
strieq_l
(
"cubic"
,
optarg
))
{
config
->
quic
.
upstream
.
congestion_controller
=
NGTCP2_CC_ALGO_CUBIC
;
}
else
if
(
util
::
strieq_l
(
"bbr"
,
optarg
))
{
config
->
quic
.
upstream
.
congestion_controller
=
NGTCP2_CC_ALGO_BBR
;
}
else
{
LOG
(
ERROR
)
<<
opt
<<
": must be either cubic or bbr"
;
return
-
1
;
}
#endif // ENABLE_HTTP3
return
0
;
case
SHRPX_OPTID_CONF
:
LOG
(
WARN
)
<<
"conf: ignored"
;
...
...
src/shrpx_config.h
View file @
8f419a48
...
...
@@ -389,6 +389,8 @@ constexpr auto SHRPX_OPT_FRONTEND_QUIC_QLOG_DIR =
StringRef
::
from_lit
(
"frontend-quic-qlog-dir"
);
constexpr
auto
SHRPX_OPT_FRONTEND_QUIC_REQUIRE_TOKEN
=
StringRef
::
from_lit
(
"frontend-quic-require-token"
);
constexpr
auto
SHRPX_OPT_FRONTEND_QUIC_CONGESTION_CONTROLLER
=
StringRef
::
from_lit
(
"frontend-quic-congestion-controller"
);
constexpr
size_t
SHRPX_OBFUSCATED_NODE_LENGTH
=
8
;
...
...
@@ -756,6 +758,7 @@ struct QUICConfig {
struct
{
StringRef
dir
;
}
qlog
;
ngtcp2_cc_algo
congestion_controller
;
bool
early_data
;
bool
require_token
;
}
upstream
;
...
...
@@ -1210,6 +1213,7 @@ enum {
SHRPX_OPTID_FRONTEND_KEEP_ALIVE_TIMEOUT
,
SHRPX_OPTID_FRONTEND_MAX_REQUESTS
,
SHRPX_OPTID_FRONTEND_NO_TLS
,
SHRPX_OPTID_FRONTEND_QUIC_CONGESTION_CONTROLLER
,
SHRPX_OPTID_FRONTEND_QUIC_DEBUG_LOG
,
SHRPX_OPTID_FRONTEND_QUIC_EARLY_DATA
,
SHRPX_OPTID_FRONTEND_QUIC_IDLE_TIMEOUT
,
...
...
src/shrpx_http3_upstream.cc
View file @
8f419a48
...
...
@@ -573,7 +573,7 @@ int Http3Upstream::init(const UpstreamAddr *faddr, const Address &remote_addr,
}
settings
.
initial_ts
=
quic_timestamp
();
settings
.
cc_algo
=
NGTCP2_CC_ALGO_BBR
;
settings
.
cc_algo
=
quicconf
.
upstream
.
congestion_controller
;
settings
.
max_window
=
http3conf
.
upstream
.
max_connection_window_size
;
settings
.
max_stream_window
=
http3conf
.
upstream
.
max_window_size
;
settings
.
max_udp_payload_size
=
SHRPX_QUIC_MAX_UDP_PAYLOAD_SIZE
;
...
...
@@ -665,6 +665,13 @@ int Http3Upstream::write_streams() {
ngtcp2_path_storage_zero
(
&
ps
);
ngtcp2_path_storage_zero
(
&
prev_ps
);
auto
config
=
get_config
();
auto
&
quicconf
=
config
->
quic
;
if
(
quicconf
.
upstream
.
congestion_controller
!=
NGTCP2_CC_ALGO_BBR
)
{
max_pktcnt
=
std
::
min
(
max_pktcnt
,
static_cast
<
size_t
>
(
10
));
}
for
(;;)
{
int64_t
stream_id
=
-
1
;
int
fin
=
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment