summaryrefslogtreecommitdiff
path: root/networkQuality.go
diff options
context:
space:
mode:
authorWill Hawkins <[email protected]>2023-07-23 01:27:40 -0400
committerWill Hawkins <[email protected]>2023-07-25 00:20:31 -0400
commit2cef6fe8cc06ee889c3eef0bf37166cb7813a8d5 (patch)
tree6ef8bf5f5820b27da18f24126aa4b532f03da940 /networkQuality.go
parent0ee7e42425ba977f028e0bc51ffcc3d5a36e4561 (diff)
[Feature] Add support for L4S
Signed-off-by: Will Hawkins <[email protected]>
Diffstat (limited to 'networkQuality.go')
-rw-r--r--networkQuality.go20
1 files changed, 18 insertions, 2 deletions
diff --git a/networkQuality.go b/networkQuality.go
index d551026..67b7ba1 100644
--- a/networkQuality.go
+++ b/networkQuality.go
@@ -165,6 +165,8 @@ var (
false,
"Calculate a relative RPM.",
)
+ withL4S = flag.Bool("with-l4s", false, "Use L4S (with default TCP prague congestion control algorithm.)")
+ withL4SAlgorithm = flag.String("with-l4s-algorithm", "", "Use L4S (with specified congestion control algorithm.)")
)
func main() {
@@ -250,6 +252,18 @@ func main() {
}
}
+ var congestionControlChosen *string = nil
+ if *withL4S || *withL4SAlgorithm != "" {
+ congestionControlChosen = &constants.DefaultL4SCongestionControlAlgorithm
+ if *withL4SAlgorithm != "" {
+ congestionControlChosen = withL4SAlgorithm
+ }
+ }
+
+ if congestionControlChosen != nil && debug.IsDebug(debugLevel) {
+ fmt.Printf("Doing congestion control with the %v algorithm.\n", *congestionControlChosen)
+ }
+
if err := config.Get(configHostPort, *configPath, *insecureSkipVerify,
sslKeyFileConcurrentWriter); err != nil {
fmt.Fprintf(os.Stderr, "%s\n", err)
@@ -414,12 +428,12 @@ func main() {
*/
downloadDirection.CreateLgdc = func() lgc.LoadGeneratingConnection {
lgd := lgc.NewLoadGeneratingConnectionDownload(config.Urls.LargeUrl,
- sslKeyFileConcurrentWriter, config.ConnectToAddr, *insecureSkipVerify)
+ sslKeyFileConcurrentWriter, config.ConnectToAddr, *insecureSkipVerify, congestionControlChosen)
return &lgd
}
uploadDirection.CreateLgdc = func() lgc.LoadGeneratingConnection {
lgu := lgc.NewLoadGeneratingConnectionUpload(config.Urls.UploadUrl,
- sslKeyFileConcurrentWriter, config.ConnectToAddr, *insecureSkipVerify)
+ sslKeyFileConcurrentWriter, config.ConnectToAddr, *insecureSkipVerify, congestionControlChosen)
return &lgu
}
@@ -440,6 +454,7 @@ func main() {
URL: config.Urls.SmallUrl,
ConnectToAddr: config.ConnectToAddr,
InsecureSkipVerify: *insecureSkipVerify,
+ CongestionControl: congestionControlChosen,
}
}
@@ -448,6 +463,7 @@ func main() {
URL: config.Urls.SmallUrl,
ConnectToAddr: config.ConnectToAddr,
InsecureSkipVerify: *insecureSkipVerify,
+ CongestionControl: congestionControlChosen,
}
}