21 Commits
Author SHA1 Message Date
Kevin KrakauerandgVisor bot 5b4fbd06d8 netstack: remove PacketBufferPtr
PacketBufferPtr is leftover from a dead experiment. Just use *PacketBuffer.

PiperOrigin-RevId: 611531815
2024-02-29 11:10:38 -08:00
Kevin KrakauerandgVisor bot 89d6bf18c8 have gVisor use renamed buffer package
PiperOrigin-RevId: 537209194
2023-06-01 21:27:49 -07:00
Adin ScannellandgVisor bot 1ceb814544 Add default_applicable_licenses rules to packages.
PiperOrigin-RevId: 513581243
2023-03-02 10:50:04 -08:00
Kevin KrakauerandgVisor bot 4eca206fa4 netstack: introduce PacketBufferPtr
PiperOrigin-RevId: 479437464
2022-10-06 16:16:54 -07:00
Lucas ManningandgVisor bot 22ca20c0f1 Move checksum to its own package and optimize bufferv2 checksumming.
Checksum capabilities are logically separate from tcpip header definitions
and operations. It makes sense to extract this logic into its own package.
This is also necessary to avoid circular dependencies with bufferv2.

PiperOrigin-RevId: 473096480
2022-09-08 15:17:00 -07:00
Lucas ManningandgVisor bot 1f2b30d70c Refactor netstack to use bufferv2 instead of buffer.
This change has significant performance implications. bufferv2 is reference
counted and pooled, which alleviates heap/GC pressure. Below are the results
from running the iperf benchmark.

HEAD:
BenchmarkIperf/operation.Upload-16    1552  ns/op   46.6GiB total allocations
BenchmarkIperf/operation.Download-16  1114  ns/op   68.6GiB total allocations

w/ change:
BenchmarkIperf/operation.Upload-16    1139  ns/op (-27%)   1.41GiB total allocations (-97%)
BenchmarkIperf/operation.Download-16  753.2 ns/op (-33%)   706MiB  total allocations (-99%)

PiperOrigin-RevId: 462453185
2022-07-21 13:09:31 -07:00
Lucas ManningandgVisor bot e64458ff08 Remove VectorisedView everywhere.
PiperOrigin-RevId: 453471156
2022-06-07 10:36:23 -07:00
Lucas ManningandgVisor bot f175fb526f Move prependable to its own package.
#CodeHealth

PiperOrigin-RevId: 452099435
2022-05-31 11:39:06 -07:00
Nate HurleyandgVisor bot 98f5323163 Use testutil.MustParse4/6 instead of net.ParseIP in tcpip test utils.
Also dedupe the RemoteIPv4Addr.

Updates #7338.

PiperOrigin-RevId: 449488567
2022-05-18 08:30:52 -07:00
Ghanan GowripalanandgVisor bot abd993f608 Don't pass link addresses in rx path
...as they are not used in all cases expect in the packet endpoint
which can get the link address directly from the link header.

PiperOrigin-RevId: 424427195
2022-01-26 13:24:35 -08:00
Ghanan GowripalanandgVisor bot 381a17d923 Support REJECT hook
PiperOrigin-RevId: 420174647
2022-01-06 17:11:19 -08:00
Ghanan GowripalanandgVisor bot 7b6078e252 Provide MTU for pipe LinkEndpoint
...so that callers can set different MTUs for different configurations.

PiperOrigin-RevId: 416629560
2021-12-15 13:09:47 -08:00
Lucas ManningandgVisor bot 84b38f4c6e Add reference counting to packet buffers.
PiperOrigin-RevId: 408426639
2021-11-08 13:28:38 -08:00
Ghanan GowripalanandgVisor bot 3015c0ac67 NAT ICMPv4 errors
...so a NAT-ed connection's socket can handle ICMP errors.

Updates #5916.

PiperOrigin-RevId: 405970089
2021-10-27 13:41:53 -07:00
Ghanan GowripalanandgVisor bot d877254511 Track UDP connections
This will enable NAT to be performed on UDP packets that are sent
in response to packets sent by the stack.

This will also enable ICMP errors to be properly NAT-ed in response
to UDP packets (#5916).

Updates #5915.

PiperOrigin-RevId: 398373251
2021-09-22 17:55:49 -07:00
Tony GongandgVisor bot 8b56b6b83b Pass address properties in a single struct
Replaced the current AddAddressWithOptions method with
AddAddressWithProperties which passes all address properties in
a single AddressProperties type. More properties that need to be
configured in the future are expected, so adding a type makes adding
them easier.

PiperOrigin-RevId: 396930729
2021-09-15 15:00:01 -07:00
Ghanan GowripalanandgVisor bot 2b457d9ee9 Check filter table when forwarding IP packets
This change updates the forwarding path to perform the forwarding hook
with iptables so that the filter table is consulted before a packet is
forwarded

Updates #170.

Test: iptables_test.TestForwardingHook
PiperOrigin-RevId: 373702359
2021-05-13 18:54:09 -07:00
Ghanan GowripalanandgVisor bot baa0888f11 Rename SetForwarding to SetForwardingDefaultAndAllNICs
...to make it clear to callers that all interfaces are updated with the
forwarding flag and that future NICs will be created with the new
forwarding state.

PiperOrigin-RevId: 373618435
2021-05-13 11:24:20 -07:00
Ghanan GowripalanandgVisor bot 091badcb9c Do not forward link-local packets
As per RFC 3927 section 7 and RFC 4291 section 2.5.6.

Test: forward_test.TestMulticastForwarding
PiperOrigin-RevId: 367519336
2021-04-08 15:30:53 -07:00
Ghanan GowripalanandgVisor bot 4065604e1b Drop loopback traffic from outside of the stack
Loopback traffic should be stack-local but gVisor has some clients
that depend on the ability to receive loopback traffic that originated
from outside of the stack. Because of this, we guard this change behind
IP protocol options.

Test: integration_test.TestExternalLoopbackTraffic
PiperOrigin-RevId: 363461242
2021-03-17 11:12:06 -07:00
Ayush RanjanandgVisor bot d8590f6337 [infra] Split tcpip/integration test targets to aid investigation.
tcpip integration tests have been flaky lately. They usually run in 20 seconds
and have a 60 seconds timeout. Sometimes they timeout which could be due to
a bug or deadlock. To further investigate it might be helpful to split the
targets and see which test is causing the flake.

Added a new tcpip/tests/utils package to hold all common utilities across all
tests.

PiperOrigin-RevId: 358012936
2021-02-17 12:54:55 -08:00