summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp_input.c
AgeCommit message (Collapse)AuthorFilesLines
2019-03-22tcp: improve handling of snd_nxtFlorin Coras1-63/+49
- avoid changing snd_nxt when doing fast retransmits - use snd_una_max only to keep track of the max seq number sent - simplify future ack testing Change-Id: I3580ad3aefe30128486c3375d0ac3f3f62c04c5e Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-03-14tcp: drop anything but fins in TIME_WAITFlorin Coras1-0/+4
Change-Id: I8414c2ed8bda59504330aad5f1a80dfe08dd85de Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-03-13tcp: fix entering closing state while in fast recoveryFlorin Coras1-5/+15
Change-Id: I30470e8a1404632b0350056769338dc69a94c105 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-03-08tcp: fix window probes in fin-wait-1Florin Coras1-1/+1
Change-Id: Idf060f385f4d9b2f42fdab6a1d372727beb8b19e Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-03-06tcp: migrate old MULTIARCH macros to VLIB_NODE_FNFilip Tehlar1-75/+47
Change-Id: Ifd9fa30eed343e2c5d40582b3e3aa589b070637d Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2019-03-02session: cleanup/rename functionsFlorin Coras1-13/+14
- remove unused functions - rename old "stream" functions Change-Id: Icbb03daa9f9f1c58b5be5c38aa8a9cbcf9159b47 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-03-01tcp: allow future acks if in windowFlorin Coras1-4/+9
Change-Id: I84ad1830b8db43f6031cf2876cd94f6a71216b83 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-02-22tcp: keep snd sack block free listFlorin Coras1-2/+3
Instead of constantly reallocating the new sack block list, keep the old one as a reusable free list. Change-Id: Iad79a72204f97b96352c1c6eea66c2839a35cfe6 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-02-21tcp: drop outstanding data when entering closing stateFlorin Coras1-5/+13
Change-Id: I92a009b9630b0d882ea3c5c99aad88ed6f5109a0 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-02-18session: move fifo allocation logic to app workerFlorin Coras1-1/+1
Change-Id: I1662ec4b5503cb64a8a86a2441842311d959b3a6 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-02-18tcp: harden for high scale scenariosFlorin Coras1-12/+32
- Better handle buffer starvation scenarios - Handle case when both peers enter recovery due to packet loss. - Fix passive open establish cleanup Change-Id: I2f28baa2ff0383bb8f5f6d2452b49aa38ce69bce Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-02-18tcp: fix handling of retransmitted synsFlorin Coras1-15/+24
Change-Id: I88fdeb0ca56d3a5d9c0f36def13c6de8142f59f0 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-02-09session: refactor listen logicFlorin Coras1-1/+1
Make app-listener the handle for app listens. Consequently transport and local listen sessions are now associated to the app-listener. Change-Id: I9397a26d42cccb100970b6b4794c15bac2e11465 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-02-07tcp: fix fib_index for v6 ll packetsFlorin Coras1-0/+7
Change-Id: Ie69bdb9860d61f2c599c0c80b0ea80dfdfe178bd Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-02-07tcp: fix reset sending in syn-sentFlorin Coras1-3/+3
Change-Id: I468b1015bca5f95b162fb49e904aa4e4d38db75e Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-02-04session: cleanup part 1Florin Coras1-5/+5
Rename core data structures. This will break compatibility for out of tree builtin apps. - stream_session_t to session_t - server_rx/tx_fifo to rx/tx_fifo - stream_session.h to session_types.h - update copyright Change-Id: I414097c6e28bcbea866fbf13b8773c7db3f49325 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-01-18tcp: allow data in passive open ack (VPP-1545)Florin Coras1-2/+3
Change-Id: Iceb99d3f8b7029bd1b1e9ebafb1e0b3790c573e4 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-01-12session: generate wrong thread errors instead of crashingFlorin Coras1-5/+5
Change-Id: I7e59ae718d2722c49d42b22a0874e1645a191e89 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-01-03tcp: add more closing state arcsFlorin Coras1-0/+19
Change-Id: If6f4d6404753b2d6b96e17f5414079bcdb9edde8 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-01-01vcl/ldp: add write msg function and fine tuningFlorin Coras1-1/+2
Allows app to push data. Additionally, ensure reset/close replies are not sent unless vcl closes the session. Change-Id: Icbbf933cf57b55cfbcc7b802af0f83919a066f65 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-28session: free session after transport and app confirmFlorin Coras1-1/+1
In addition to that, a bit of refactoring. Change-Id: Iea1eabc2167bcdef185ec53bc09bae087c5398e6 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-26tcp: add more last-ack arcsFlorin Coras1-0/+19
Change-Id: If538bb9d6fb489906099b727a7bfdb9d9af29402 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-26tcp: separate active and passive establish timersFlorin Coras1-6/+7
Change-Id: Ia2241e963cf45765d8d17c65eea781edbf74d4f9 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-25tcp: add fin-wait-1 dispatch arcsFlorin Coras1-0/+19
Change-Id: Ie4cb08f5d9f7fd025f1a8ae610cebb0b0c315d9f Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-24tcp: compute seq_end in tcp_inputFlorin Coras1-41/+29
syn/fin are no longer added to seq_end so they must be considered individually in each state. Change-Id: I5e3047194101c4fca2db9f9ad29a4a6468c397ab Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-22tcp: improve waitclose in closing statesFlorin Coras1-0/+5
Change-Id: I90056176194cb2a144d49a3cb283653d8d30f051 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-21tcp: fix fin_wait_1 condition to send finFlorin Coras1-2/+3
Also add the closed-waiting session state wherein the session still allows the transport to send oustanding data. Change-Id: Ic47807379906ef2010934381ff0b9e53c7e631d8 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-19session: add cli option to dump session elogFlorin Coras1-0/+1
Change-Id: I1f42644f143bb65ee764c0f869b402595126adac Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-19tcp: fix fin in syn-rcvdFlorin Coras1-5/+12
Change-Id: Iba7c08c9edcf76ea24d00d5ea9e0586e9f94df4e Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-19tcp: add more state machine arcsFlorin Coras1-5/+79
This mostly adds explicit drops or resets for state and flag combinations that would've been otherwise dropped with a warning message. It also adds some valid RST handlers. Change-Id: Ib0d19a0939fe275befeb29cf072b87b1a79937ce Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-19tcp/session: notify transport of close when tx fifo is not emptyFlorin Coras1-1/+4
Disconnect transport even if tx fifo is not empty and have transport deal with the problem. In case of tcp, add timer to fin_wait_1. If it expires and we're still in established state, cleanup but only after waiting for session tx events to cleanup. Change-Id: I45759a3c43dd096bb2c03daf5372416c30678d62 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-18tcp/session: drop connections if message queue is fullFlorin Coras1-13/+17
Also cleanup session table when transport closes and app didn't reply to the close notification. Change-Id: Ie3d518e3afff73437561561b46dbf695c24632ad Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-18tcp: cleanup connections if handshake failsFlorin Coras1-3/+2
Change-Id: If109d6772cbd58f4f2a56ae7ec593639d1fa1b96 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-17tcp: fix handling of broken syn optionsFlorin Coras1-2/+3
Change-Id: Ia8b2a077ba4897ddd15cf33221b191cd7a3f1d33 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-17tcp: accept rst that fail pawsFlorin Coras1-9/+9
Change-Id: I945d1644a23b6a3d50c9beaffc732d2b6facd974 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-13tcp: drop handshake ack with fin setFlorin Coras1-1/+1
Change-Id: I529c34235ad2b0e4c730959bb1b8c9d50a83738c Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-13tcp: fix handling of no wscale in synsFlorin Coras1-0/+2
Change-Id: I7219a8d315b312812acafd9d2709fba8b4a2a679 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-13tcp: validate seq for handshake ackFlorin Coras1-0/+8
Change-Id: Ifc0584d781efc30904069ea17c0afbb68c49c442 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-13session/tcp: support tx flush markFlorin Coras1-0/+6
For tcp this means that the last enqueued data goes out with a psh bit set. Change-Id: I29d357ecae6f02e748b59a7b799150ec73d14ba2 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-07tcp: improve check for invalid sack blocksFlorin Coras1-1/+3
Change-Id: Ic6a6202a2d5aca33eee7fc6ff8eeaa1db9b58525 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-07tcp: fix timestamp check and pawsFlorin Coras1-5/+2
Change-Id: I5a5ee48755befc370a1f89ddbb0d91f164ed564f Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-07tcp: better handling of options only allowed in synsFlorin Coras1-9/+18
Change-Id: I6debfe85d9d55f6f9a8ef0ce1dcc008393847a37 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-07tcp: fix length checkFlorin Coras1-3/+14
Change-Id: Iff75be238a231df88a37b61610c134e4a4770708 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-05session/tcp: postpone cleanup on resetFlorin Coras1-1/+1
Change-Id: I45fd7538853f84c6c8bf804cc20acbc9601db3ba Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-11-14Remove c-11 memcpy checks from perf-critical codeDave Barach1-11/+14
Change-Id: Id4f37f5d4a03160572954a416efa1ef9b3d79ad1 Signed-off-by: Dave Barach <dave@barachs.net>
2018-11-12tcp: handle disconnects after enq notificationsFlorin Coras1-14/+50
Make sure that we notify the app of the data enqueued in the burst before notifying of disconnect. Change-Id: I7747a5cbb4c6bc9132007f849c24ce04b7841273 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-11-09tcp: basic cubic implementationFlorin Coras1-3/+8
Because the code is not optimized, newreno is still the default congestion control algorithm. Change-Id: I7061cc80c5a75fa8e8265901fae4ea2888e35173 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-11-08tcp: pacer and mrtt estimation improvementsFlorin Coras1-11/+51
- update pacer once per burst - better estimate initial rtt - compute smoothed average for higher precision rtt estimate Change-Id: I06d41a98784cdf861bedfbee2e7d0afc0d0154ef Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-11-07tcp: consume incoming buffers instead of reusingFlorin Coras1-755/+628
Instead of reusing buffers for acking, consume all buffers and program output for (dup)ack generation. This implicitly fixes the drop counters that were artificially inflated by both data and feedback traffic. Moreover, the patch also significantly reduces the ack traffic as we now only generate an ack per frame, unless duplicate acks need to be sent. Because of the reduced feedback traffic, a sender's rx path and a receiver's tx path are now significantly less loaded. In particular, a sender can overwhelm a 40Gbps NIC and generate tx drop bursts for low rtts. Consequently, tx pacing is now enforced by default. Change-Id: I619c29a8945bf26c093f8f9e197e3c6d5d43868e Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-11-06tcp: dequeue acked only once per burstFlorin Coras1-23/+54
Avoid dequeuing acked bytes more than once per burst for a connection. Although the fifos do not use locks, size decrements are atomic, so they rely on locked instructions. Change-Id: Id65f4ea40b2c10057461402dfd0393034e6472d5 Signed-off-by: Florin Coras <fcoras@cisco.com>