Commit Graph
110 Commits
Author SHA1 Message Date
Frog Rocky 0895b3c31a fixes 2026-04-02 17:41:23 +02:00
Frog Rocky 3075cbdd1f test(benchmarks): add conn and conceal benchmark suites
Add benchmark harnesses for the conn and conceal packages with
deterministic crypto/rand, fake transports, and no live sockets in
timed loops.

Keep a compact default benchmark matrix for routine benchstat runs and
preserve the exhaustive matrix behind AMNEZWG_BENCH_FULL=1.
2026-03-27 12:56:45 +01:00
Frog Rocky b2d7894826 added end-to-end tests 2026-03-25 02:45:18 +01:00
Frog Rocky 374f91fe4c omit junk on tcp 2026-03-25 02:45:18 +01:00
Frog Rocky 8b17d27361 added stream record layer to conceal 2026-03-25 02:45:18 +01:00
Frog Rocky 6a110d4319 implemented prelude connection layer for net.Conn 2026-03-25 02:45:18 +01:00
Yaroslav Gurov 528e8aab99 fix: replace *net.UDPConn with UDPConn 2026-01-26 15:55:01 +00:00
Yaroslav Gurov da95c8cd6d feat: prelude conn H1-H4 compat support 2026-01-21 11:38:52 +00:00
Yaroslav Gurov b91d651ae0 chore: [WIP] common awg features refactoring 2026-01-20 14:00:43 +00:00
Yaroslav Gurov 0d55ebccb3 feat: add conceal to stdbind 2026-01-19 13:59:58 +00:00
Yaroslav Gurov b7111a7841 chore: stream bind reformatting 2026-01-15 23:05:39 +00:00
Yaroslav Gurov 7772925dfb fix: handle busy port properly 2026-01-15 22:56:40 +00:00
Yaroslav Gurov 8241945a66 chore: general cleanup and refactoring
* [WIP] moved out classic AWG params to conceal conns
* refactor of conceal rules locations
* refactor of working with concealment parameters
2026-01-15 21:44:01 +00:00
Yaroslav Gurov 45fa148913 chore: empty default obfuscators 2026-01-09 02:25:01 +00:00
Yaroslav Gurov 861b341f54 chore: stream read cleanup 2026-01-07 20:32:50 +00:00
Yaroslav Gurov 5f04c25146 feat: uapi support of fmt_in, fmt_out, and proper network fields 2026-01-07 16:24:14 +00:00
Yaroslav Gurov dc283472b5 chore: change bind sequence on windows 2026-01-07 16:22:32 +00:00
Yaroslav Gurov ec6d9a5f21 chore: multibind optimizations 2026-01-07 16:22:05 +00:00
Yaroslav Gurov bb8270bcfa feat: make obf packets work in stream; initial support of obfuscated connections 2025-12-20 07:44:16 +00:00
Yaroslav Gurov 997f578a9b feat: initial support of StreamObfuscators 2025-12-19 07:51:47 +00:00
Yaroslav Gurov 497de26f78 feat: initial support of Multibind and UAPI configuration 2025-12-19 05:43:36 +00:00
Yaroslav Gurov 030539bcf7 chore: use io.ReadFull instead of plain net.Conn.Read 2025-12-18 19:26:29 +00:00
Yaroslav Gurov e19237981d feat: [exp] added size information in front of each packet 2025-12-18 16:58:47 +00:00
Yaroslav Gurov 2791bea913 chore: safe handling of new connections 2025-12-18 03:27:52 +00:00
Yaroslav Gurov 787b2f6bbd chore: initialize stream on send only 2025-12-18 00:52:26 +00:00
Yaroslav Gurov f139b29094 feat: initial fwmark support for stream connections 2025-12-18 00:52:26 +00:00
Yaroslav Gurov d42bdde6da feat: rework stream listener 2025-12-18 00:52:26 +00:00
Yaroslav Gurov f867e4dba7 feat: resolve domain immediately while on configuration stage 2025-12-18 00:52:26 +00:00
Yaroslav Gurov b7f3497a8c feat: add syncronization and protection 2025-12-18 00:52:26 +00:00
Yaroslav Gurov f0b5c51c4d feat: add tcp bind 2025-12-18 00:52:26 +00:00
Jason A. Donenfeld 99f2e6d66f conn: don't enable GRO on Linux < 5.12
Kernels below 5.12 are missing this:

    commit 98184612aca0a9ee42b8eb0262a49900ee9eef0d
    Author: Norman Maurer <norman_maurer@apple.com>
    Date:   Thu Apr 1 08:59:17 2021

        net: udp: Add support for getsockopt(..., ..., UDP_GRO, ..., ...);

        Support for UDP_GRO was added in the past but the implementation for
        getsockopt was missed which did lead to an error when we tried to
        retrieve the setting for UDP_GRO. This patch adds the missing switch
        case for UDP_GRO

        Fixes: e20cf8d3f1f7 ("udp: implement GRO for plain UDP sockets.")
        Signed-off-by: Norman Maurer <norman_maurer@apple.com>
        Reviewed-by: David Ahern <dsahern@kernel.org>
        Signed-off-by: David S. Miller <davem@davemloft.net>

That means we can't set the option and then read it back later. Given
how buggy UDP_GRO is in general on odd kernels, just disable it on older
kernels all together.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-06-23 14:56:43 -06:00
Tom Holford ace3e11ef2 global: replaced unused function params with _
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-06-23 14:26:55 -06:00
Jason A. Donenfeld c0b6e6a200 global: bump copyright notice
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2025-06-23 14:20:32 -06:00
Iurii Egorov 2e7780471a Remove GetOffloadInfo() (#32)
* Remove GetOffloadInfo()
* Remove GetOffloadInfo() from bind_windows as well
* Allow lightweight tags to be used in the version
2024-05-24 16:18:23 +01:00
albexk e433d13df6 Add disabling UDP GSO when an error occurs due to inconsistent peer mtu 2024-05-14 03:51:01 -07:00
albexk 6705978fc8 Add debug udp offload info 2024-02-12 04:40:23 -08:00
albexk 032e33f577 Fix Android UDP GRO check 2024-02-12 04:40:23 -08:00
Iurii Egorov e3c9ec8012 Naming unify 2024-01-20 23:18:10 +03:00
Iurii Egorov 7af55a3e6f Merge remote-tracking branch 'upstream/master' 2023-11-17 22:42:13 +03:00
Jason A. Donenfeld b3df23dcd4 conn: set unused OOB to zero length
Otherwise in the event that we're using GSO without sticky sockets, we
pass garbage OOB buffers to sendmmsg, making a EINVAL, when GSO doesn't
set its header.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-10-21 19:32:07 +02:00
Jason A. Donenfeld f502ec3fad conn: fix cmsg data padding calculation for gso
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-10-21 19:06:38 +02:00
Jason A. Donenfeld 5d37bd24e1 conn: separate gso and sticky control
Android wants GSO but not sticky.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-10-21 18:44:01 +02:00
Jason A. Donenfeld 24ea13351e conn: harmonize GOOS checks between "linux" and "android"
Otherwise GRO gets enabled on Android, but the conn doesn't use it,
resulting in bundled packets being discarded.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-10-18 21:14:13 +02:00
Jason A. Donenfeld 177caa7e44 conn: simplify supportsUDPOffload
This allows a kernel to support UDP_GRO while not supporting
UDP_SEGMENT.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-10-18 21:02:52 +02:00
Jordan Whited 6a84778f2c conn, device: use UDP GSO and GRO on Linux
StdNetBind probes for UDP GSO and GRO support at runtime. UDP GSO is
dependent on checksum offload support on the egress netdev. UDP GSO
will be disabled in the event sendmmsg() returns EIO, which is a strong
signal that the egress netdev does not support checksum offload.

The iperf3 results below demonstrate the effect of this commit between
two Linux computers with i5-12400 CPUs. There is roughly ~13us of round
trip latency between them.

The first result is from commit 052af4a without UDP GSO or GRO.

Starting Test: protocol: TCP, 1 streams, 131072 byte blocks
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-10.00  sec  9.85 GBytes  8.46 Gbits/sec  1139   3.01 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
Test Complete. Summary Results:
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  9.85 GBytes  8.46 Gbits/sec  1139  sender
[  5]   0.00-10.04  sec  9.85 GBytes  8.42 Gbits/sec        receiver

The second result is with UDP GSO and GRO.

Starting Test: protocol: TCP, 1 streams, 131072 byte blocks
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-10.00  sec  12.3 GBytes  10.6 Gbits/sec  232   3.15 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
Test Complete. Summary Results:
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  12.3 GBytes  10.6 Gbits/sec  232   sender
[  5]   0.00-10.04  sec  12.3 GBytes  10.6 Gbits/sec        receiver

Reviewed-by: Adrian Dewhurst <adrian@tailscale.com>
Signed-off-by: Jordan Whited <jordan@tailscale.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-10-10 15:07:36 +02:00
Mark Puha 8f1a6a10b2 Advanced security (#2)
* Advanced security header layer & config
2023-10-05 21:41:27 +01:00
Brad Fitzpatrick 6e755e132a all: adjust build tags for wasip1/wasm
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-07-04 15:54:42 +02:00
springhack 1f25eac395 conn: windows: add missing return statement in DstToString AF_INET
Signed-off-by: SpringHack <springhack@live.cn>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-06-27 18:02:50 +02:00
James Tucker 25eb973e00 conn: store IP_PKTINFO cmsg in StdNetendpoint src
Replace the src storage inside StdNetEndpoint with a copy of the raw
control message buffer, to reduce allocation and perform less work on a
per-packet basis.

Signed-off-by: James Tucker <james@tailscale.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-06-27 17:48:32 +02:00
Jason A. Donenfeld 6f895be10d conn: move booleans to bottom of StdNetBind struct
This results in a more compact structure.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-03-24 17:05:07 +01:00