Age | Commit message (Collapse) | Author |
|
PiperOrigin-RevId: 355751801
|
|
- Adds a function to enable RACK in tests.
- RACK update functions are guarded behind the flag tcpRecovery.
PiperOrigin-RevId: 355435973
|
|
Rename HandleNDupAcks() to HandleLossDetected() as it will enter this when
is detected after:
- reorder window expires and TLP (in case of RACK)
- dupAckCount >= 3
PiperOrigin-RevId: 355237858
|
|
Netstack today will send dupACK's with no rate limit for incoming out of
window segments. This can result in ACK loops for example if a TCP socket
connects to itself (actually permitted by TCP). Where the ACK sent in
response to packets being out of order itself gets considered as an out
of window segment resulting in another ACK being generated.
PiperOrigin-RevId: 355206877
|
|
...to remove the need for the transport layer to deduce the type of
error it received.
Rename HandleControlPacket to HandleError as HandleControlPacket only
handles errors.
tcpip.SockError now holds a tcpip.SockErrorCause interface that
different errors can implement.
PiperOrigin-RevId: 354994306
|
|
This change flips gvisor to use Neighbor unreachability detection by
default to populate the neighbor table as defined by RFC 4861 section 7.
Although RFC 4861 is targeted at IPv6, the same algorithm is used for
link resolution on IPv4 networks using ARP.
Integrators may still use the legacy link address cache by setting
stack.Options.UseLinkAddrCache to true; stack.Options.UseNeighborCache
is now unused and will be removed.
A later change will remove linkAddrCache and associated code.
Updates #4658.
PiperOrigin-RevId: 354850531
|
|
PiperOrigin-RevId: 354827491
|
|
...in IPv6 ICMP tests.
A channel link endpoint's channel is closed when the link endpoint is
closed.
When the stack tries to send packets through a NIC with a closed channel
endpoint, a panic will occur when attempting to write to a closed
channel (https://golang.org/ref/spec#Close). To make sure the stack does
not try to send packets through a NIC, we remove it.
PiperOrigin-RevId: 354822085
|
|
This stores each protocol's neighbor state separately.
This change also removes the need for each neighbor entry to keep
track of their own link address resolver now that all the entries
in a cache will use the same resolver.
PiperOrigin-RevId: 354818155
|
|
The network endpoint should not need to have logic to handle different
kinds of neighbor tables. Network endpoints can let the NIC know about
differnt neighbor discovery messages and let the NIC decide which table
to update.
This allows us to remove the LinkAddressCache interface.
PiperOrigin-RevId: 354812584
|
|
PiperOrigin-RevId: 354746864
|
|
This removes the need to provide the link address request with the NIC
the request is being performed on since the NetworkEndpoints already
have a reference to the NIC.
PiperOrigin-RevId: 354721940
|
|
This allows later decoupling of the backing network buffer implementation.
PiperOrigin-RevId: 354643297
|
|
This is dynamic state that can be re-learned when the NIC comes
back up.
Test: ipv4_test.TestIgmpV1Present
PiperOrigin-RevId: 354630921
|
|
...as per As per RFC 2236 section 3 page 3 (for IGMPv2) and
RFC 2710 section 4 page 5 (for MLDv1).
See comments in code for more details.
Test: ip_test.TestHandleQuery
PiperOrigin-RevId: 354603068
|
|
...per RFC 4861 s7.1.2.
Startblock:
has LGTM from sbalana
and then
add reviewer ghanan
PiperOrigin-RevId: 354539026
|
|
When a route does not need to resolve a remote link address to send a
packet, avoid having to obtain the pending packets queue's lock.
PiperOrigin-RevId: 354456280
|
|
After receiving an ACK(cumulative or selective), RACK will update the reorder
window which is used as a settling time before marking the packet as lost.
This change will add an init function to initialize the variables in RACK and
also store the reference to sender in rackControl.
The reorder window is calculated as per rfc:
https://tools.ietf.org/html/draft-ietf-tcpm-rack-08#section-7.2 Step 4.
PiperOrigin-RevId: 354453528
|
|
Avoid a race condition in which an entry is acquired while it is being
evicted by overlapping the entry lock with the cache lock.
PiperOrigin-RevId: 354452639
|
|
This makes it possible to add data to types that implement tcpip.Error.
ErrBadLinkEndpoint is removed as it is unused.
PiperOrigin-RevId: 354437314
|
|
Clockwork does not support timers being reset/stopped from different
goroutines. Our current use of clockwork causes data races and
gotsan complains about clockwork.
This change uses our own implementation of faketime, avoiding data
races.
PiperOrigin-RevId: 354428208
|
|
Previously, sending on an unconnected UDP socket would ignore the
SO_BINDTODEVICE option. Send on the configured interface when an UDP socket
is bound to an interface through setsockop SO_BINDTODEVICE.
Add packetimpact tests exercising UDP reads and writes with every combination
of bound/unbound, broadcast/multicast/unicast destination, and bound/not-bound
to device.
PiperOrigin-RevId: 354299670
|
|
As per RFC 4861 section 7.3.1,
A neighbor is considered reachable if the node has recently received
a confirmation that packets sent recently to the neighbor were
received by its IP layer. Positive confirmation can be gathered in
two ways: hints from upper-layer protocols that indicate a connection
is making "forward progress", or receipt of a Neighbor Advertisement
message that is a response to a Neighbor Solicitation message.
This change adds support for TCP to let the IP/link layers know that a
neighbor is reachable.
Test: integration_test.TestTCPConfirmNeighborReachability
PiperOrigin-RevId: 354222833
|
|
This clarifies that there is a lock involved.
PiperOrigin-RevId: 354213848
|
|
This CL adds support for the following fields:
- RTT, RTTVar, RTO
- send congestion window (sndCwnd) and send slow start threshold (sndSsthresh)
- congestion control state(CaState)
- ReorderSeen
PiperOrigin-RevId: 354195361
|
|
Fixes #5150.
PiperOrigin-RevId: 354194385
|
|
PiperOrigin-RevId: 354187603
|
|
- This CL will initialize the function handler used for getting the send
buffer size limits during endpoint creation and does not require the caller of
SetSendBufferSize(..) to know the endpoint type(tcp/udp/..)
PiperOrigin-RevId: 353992634
|
|
When sending packets through a stack.Route, we attempt to perform
link resolution. Neighbor Solicitation messages do not need link
resolution to be performed so send the packets out the interface
directly instead.
PiperOrigin-RevId: 353967435
|
|
This improves type-assertion safety.
PiperOrigin-RevId: 353931228
|
|
connect() can be invoked multiple times on UDP/RAW sockets and in such
a case we should release the cached route from the previous connect.
Fixes #5359
PiperOrigin-RevId: 353919891
|
|
...as it is unused.
PiperOrigin-RevId: 353896981
|
|
This CL moves {S,G}etsockopt of SO_SNDBUF from all endpoints to socketops. For
unix sockets, we do not support setting of this option.
PiperOrigin-RevId: 353871484
|
|
The RFC for icmpv6 specifies that an errant packet should be included
in the returned ICMP packet, and that it should include up to the amount
needed to fill the minimum MTU (1280 bytes) if possible. The current code
included the Link header in that calculation but the RFC is referring
to the IP MTU not the link MTU. Some conformance tests check this and
report an error agains the stack for this.
The full header length shoudl however continue to be used when allocating
header space.
Make the same change for IPv4 for consistency.
Add a test for icmp payload sizing.
Test that the included data in an ICMP error packet conforms to the
requirements of RFC 972, RFC 4443 section 2.4 and RFC 1812 Section 4.3.2.3.
Fixes #5311
PiperOrigin-RevId: 353790203
|
|
The ARP stat NetworkUnreachable was removed, and was replaced by
InterfaceHasNoLocalAddress. No stats are recorded when dealing with an
missing endpoint (ErrNotConnected) (because if there is no endpoint,
there is no valid per-endpoint stats).
PiperOrigin-RevId: 353759462
|
|
PiperOrigin-RevId: 353755271
|
|
Rewrite tcp.endpoint.Write to avoid manual locking and unlocking. This should
prevent similar mistakes in the future.
PiperOrigin-RevId: 353675734
|
|
It previously returned an error but it could only be UnknownNICID. It now
returns a boolean to indicate whether the nic exists or not.
PiperOrigin-RevId: 353337489
|
|
PiperOrigin-RevId: 353336894
|
|
The route resolution callback will be called with a
stack.ResolvedFieldsResult which will hold the route info so callers
can avoid attempting resolution again to check if a previous resolution
attempt succeeded or not.
Test: integration_test.TestRouteResolvedFields
PiperOrigin-RevId: 353319019
|
|
Fixes #1509.
PiperOrigin-RevId: 353295589
|
|
If a network address has a static mapping to a link address, calculate
it in GetLinkAddress.
Test: stack_test.TestStaticGetLinkAddress
PiperOrigin-RevId: 353179616
|
|
We have support for the output interface name, but not for the input
interface name.
This change adds the support for the input interface name, and adds the
test cases for it.
Fixes #5300
PiperOrigin-RevId: 353179389
|
|
GetLinkAddress's callback will be called immediately with a
stack.LinkResolutionResult which will hold the link address
so no need to also return the link address from the function.
Fixes #5151.
PiperOrigin-RevId: 353157857
|
|
...unless explicitly requested via ResolveWith.
Remove cancelled channels from pending packets as we can use the link
resolution channel in a FIFO to limit the number of maximum pending
resolutions we should queue packets for.
This change also defers starting the goroutine that handles link
resolution completion to when link resolution succeeds, fails or
gets cancelled due to the max number of pending resolutions being
reached.
Fixes #751.
PiperOrigin-RevId: 353130577
|
|
Test: integration_test.TestWritePacketsLinkResolution
Fixes #4458.
PiperOrigin-RevId: 353108826
|
|
fdbased and qdisc layers expect these fields to already be
populated before being reached.
PiperOrigin-RevId: 353099492
|
|
The error messages are not needed or used as these are not processing errors
so much as errors to be reported back to the packet sender. Implicitly
describe whether each error should generate ICMP packets or not. Most do
but there are a couple that do not.
Slightly alter some test expectations for Linux compatibility and add a
couple more. Improve Linux compatibility on error packet returns. Some
cosmetic changes to tests to match the upcoming packet impact version
of the same tests.
PiperOrigin-RevId: 352889785
|
|
|
|
Link addresses are cached on a per NIC basis so instead of having a
single cache that includes the NIC ID for neighbor entry lookups,
use a single cache per NIC.
PiperOrigin-RevId: 352684111
|