Skip to content

Commit 1ed9bd7

Browse files
oxtoacartmpminardi
andcommitted
prober: perform DERP bandwidth probes over TUN device to mimic real client
Updates tailscale/corp#24635 Co-authored-by: Mario Minardi <mario@tailscale.com> Signed-off-by: Percy Wegmann <percy@tailscale.com>
1 parent aa04f61 commit 1ed9bd7

File tree

5 files changed

+411
-28
lines changed

5 files changed

+411
-28
lines changed

cmd/derpprobe/derpprobe.go

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,19 @@ import (
1818
)
1919

2020
var (
21-
derpMapURL = flag.String("derp-map", "https://login.tailscale.com/derpmap/default", "URL to DERP map (https:// or file://) or 'local' to use the local tailscaled's DERP map")
22-
versionFlag = flag.Bool("version", false, "print version and exit")
23-
listen = flag.String("listen", ":8030", "HTTP listen address")
24-
probeOnce = flag.Bool("once", false, "probe once and print results, then exit; ignores the listen flag")
25-
spread = flag.Bool("spread", true, "whether to spread probing over time")
26-
interval = flag.Duration("interval", 15*time.Second, "probe interval")
27-
meshInterval = flag.Duration("mesh-interval", 15*time.Second, "mesh probe interval")
28-
stunInterval = flag.Duration("stun-interval", 15*time.Second, "STUN probe interval")
29-
tlsInterval = flag.Duration("tls-interval", 15*time.Second, "TLS probe interval")
30-
bwInterval = flag.Duration("bw-interval", 0, "bandwidth probe interval (0 = no bandwidth probing)")
31-
bwSize = flag.Int64("bw-probe-size-bytes", 1_000_000, "bandwidth probe size")
32-
regionCode = flag.String("region-code", "", "probe only this region (e.g. 'lax'); if left blank, all regions will be probed")
21+
derpMapURL = flag.String("derp-map", "https://login.tailscale.com/derpmap/default", "URL to DERP map (https:// or file://) or 'local' to use the local tailscaled's DERP map")
22+
versionFlag = flag.Bool("version", false, "print version and exit")
23+
listen = flag.String("listen", ":8030", "HTTP listen address")
24+
probeOnce = flag.Bool("once", false, "probe once and print results, then exit; ignores the listen flag")
25+
spread = flag.Bool("spread", true, "whether to spread probing over time")
26+
interval = flag.Duration("interval", 15*time.Second, "probe interval")
27+
meshInterval = flag.Duration("mesh-interval", 15*time.Second, "mesh probe interval")
28+
stunInterval = flag.Duration("stun-interval", 15*time.Second, "STUN probe interval")
29+
tlsInterval = flag.Duration("tls-interval", 15*time.Second, "TLS probe interval")
30+
bwInterval = flag.Duration("bw-interval", 0, "bandwidth probe interval (0 = no bandwidth probing)")
31+
bwSize = flag.Int64("bw-probe-size-bytes", 1_000_000, "bandwidth probe size")
32+
bwTUNIPv4Address = flag.String("bw-tun-ipv4-addr", "", "if specified, bandwidth probes will be performed over a TUN device at this address in order to exercise TCP-in-TCP in similar fashion to TCP over Tailscale via DERP. We will use a /30 subnet including this IP address.")
33+
regionCode = flag.String("region-code", "", "probe only this region (e.g. 'lax'); if left blank, all regions will be probed")
3334
)
3435

3536
func main() {
@@ -46,7 +47,7 @@ func main() {
4647
prober.WithTLSProbing(*tlsInterval),
4748
}
4849
if *bwInterval > 0 {
49-
opts = append(opts, prober.WithBandwidthProbing(*bwInterval, *bwSize))
50+
opts = append(opts, prober.WithBandwidthProbing(*bwInterval, *bwSize, *bwTUNIPv4Address))
5051
}
5152
if *regionCode != "" {
5253
opts = append(opts, prober.WithRegion(*regionCode))

0 commit comments

Comments
 (0)