aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp.c
AgeCommit message (Collapse)AuthorFilesLines
2024-07-26tcp: improve tcp listener CLIAritra Basu1-0/+2
Type: improvement Change-Id: I11dc43bdf65cecfa5c48ac734a4727b377023c80 Signed-off-by: Aritra Basu <aritrbas@cisco.com>
2024-07-08session: improve enable and disable handlingFlorin Coras1-0/+4
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I3c79d16f6a19767d990e8a4683c296219b559ccd
2024-06-14tcp: make syn-rcvd timeout configurableFlorin Coras1-0/+3
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic89570315a5c3c00e0e89c5535929313916869eb
2024-03-12misc: remove GNU Indent directivesDamjan Marion1-4/+0
Type: refactor Change-Id: I5235bf3e9aff58af6ba2c14e8c6529c4fc9ec86c Signed-off-by: Damjan Marion <damarion@cisco.com>
2024-03-10session: use no for ports in transport port allocatorFlorin Coras1-1/+1
Type: improvement Change-Id: Ia1d8aaa3c51938cfa15dd09102471f52ebe67a3d Signed-off-by: Florin Coras <fcoras@cisco.com>
2024-02-17tcp: retransmit fins in last-ackFlorin Coras1-1/+1
Fix instances where timers are reset after programming fin. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ib80e3a401d585f388a97c7f2bb62e68ee774d50d
2023-06-25tcp: avoid initializing counters multiple timesFlorin Coras1-2/+7
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ia98dae5fdde16426d5457742aff0a1b04db4d034
2023-06-22tcp: add simple stats collectorFlorin Coras1-0/+44
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I435ff10fa3af15b0bed83607aca508a1c087a159
2023-05-04session: cleanup ho lookup table on closeFlorin Coras1-0/+8
Make sure half-open table is cleaned up on close and cleanup of half-open. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id7ad177f364d6395f7379dc927e449a40547510e
2023-04-21tcp: remove unused codeFilip Tehlar1-4/+0
Type: improvement Signed-off-by: Filip Tehlar <ftehlar@cisco.com> Change-Id: Ib188f3331696dff6357a18f5bac5f1db3cefaeab
2023-03-16session: support active opens with same source portFlorin Coras1-2/+2
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I2b426e9e988c32d261f36367087f358d8cc25e2f
2023-02-28session: consolidate port alloc logicFlorin Coras1-21/+8
Move port allocation logic from transports into generic transport layer. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I55a21f185d00f5e118c36bcc4a6ffba2cbda885e
2022-12-02session: move connects to first workerFlorin Coras1-3/+3
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I035e3fdbb52eca010ad7b2c20ca2930cb1645978
2022-11-29session: transport endpt cleanup on owner threadFlorin Coras1-2/+2
Maintain a single writer multiple readers usage model for transport endpoints pool. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I8555700ed725971341f145ea97f031042a298e83
2022-04-04tcp: use safe realloc poolFlorin Coras1-3/+3
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I8ba93643236aaa50eeb4755b74821a8c4ca6179b
2022-02-10session: use transport endpoint cfg for listenFlorin Coras1-2/+2
Makes it similar to connects. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I38c328670054e1a9ba4dc4ea8fe7519a5a09e8be
2022-01-06tcp: update snd_congestion only during congestionFlorin Coras1-0/+4
If running without sacks, if snd_una does not cover snd_congestion fast recovery can be missed but the two heuristics from RFC6582 should avoid that. Also snd_congestion was used as a means of inferring if the connection recently exited congestion while setting the persist timer but that does not always work correctly if not congested. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I94d4ac738cdd4f7f23f62e97dd63059de1cd4af9
2022-01-06tcp: cast timer ticks to u32Florin Coras1-1/+2
tc->rto * TCP_TO_TIMER_TICK can return garbage if not cast to u32 and that confuses clib_max Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> signed-off-by: Vipul Agrawal <Vipul.Agrawal@enea.com> Change-Id: Ief4d29b9625e2ef2e75e0c7e3d731ab147465f6d
2021-12-23tcp: fix endpoint lookup failed caused by key uninitializedMercury1-0/+1
fix ipv4 key uninitialized in local_endpoints_table, which will cause transport_endpoint_cleanup() failed to lookup the endpoint and can not delete it, as for ipv6, clib_memcpy_fast() will change all bytes of lcl_addr and there maybe no need to initalize, Type: fix Signed-off-by: Mercury <mercury124185@gmail.com> Change-Id: I56676493a393b1d64eaa438224e256094ca75d2f
2021-10-27tcp: fix use of invalid local sw_if_indexFlorin Coras1-1/+2
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id58ac44d45fb8b8a0d803f02e0242ec6f4b3db05
2021-10-25tcp: fix: TCP timewait port reuse rfc complianceMichal Kalderon1-1/+7
This patch provides a fix for early-kill of timewait sockets that is based on rfc's 1122, 6191. The following commits provided a solution for port re-use. However, they are not fully compliant with rfc 1122 4.2.2.13 ( Closing a connection ) and rfc 6191 (Reducing the TIME-WAIT State Using TCP Timestamps) commit b092b77cf238ba ("tcp: Enable TCP timewait port use") introduced a significant improvement by enabling TCP timewait port re-use. commit ee1cb469b2dd ("tcp: fix port reuse with multiple listeners") fixed usage of the wrong value for connection_index when searching for a listener, by storing the state in tcp.flags. Implementation details: When a SYN is received during time-wait state, the code checks whether all the requirements for accepting the SYN packet are met. If they aren't, the SYN can't be accepted and the packet is dropped, otherwise, connection is deleted and a new connection with same port is opened. Type: fix Signed-off-by: Ofer Heifetz <oferh@marvell.com> Signed-off-by: Yuval Caduri <cyuval@marvell.com> Signed-off-by: Michal Kalderon <mkalderon@marvell.com> Change-Id: I38a33c6e321c760d45ebec9154399e1c90dd0250
2021-09-13tcp session: initialize sw_if_index at connect timeFlorin Coras1-0/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id0e67a9ce9c5d8bca2cd7a30493f03a02a46dc46
2021-07-13tcp session: next node config on connectsFlorin Coras1-0/+2
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ief06b1509d31b55efc8d1436b6ff9e01c6037a32
2021-07-06tcp: use main thread pool for half-opensFlorin Coras1-27/+23
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I4b3427b966f9ff1ba8895fed7db662d56650f3f5
2021-06-15tcp: prevent timer handler being called frequentlyliuyacan1-0/+1
In the current implement, tcp would start or up an one tick retransmit timer for that connection if vlib_buffer_alloc() return 0. Now the tick is 0.1ms, this means that if VPP is in a buffer shortage state, there would be a large number of burst timer expirations. This commit limits the minimum interval of the retransmission timer to 100ms. Type: fix Signed-off-by: liuyacan <liuyacan@corp.netease.com> Change-Id: Ia11d693fe46119c5dc16b24ca93c30c31109057a
2021-06-12tcp: fix proto in port reuse checkFlorin Coras1-2/+2
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I338e61654a62ed6308ecd8bb15e1a8b13cd859b9
2021-05-14tcp: remove ho lockFlorin Coras1-9/+0
Half-open sessions are allocated by main thread and cleaned up on main with timers. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I37f000920a45908b62b5501ae9d54a88a9e4c609
2021-05-12session: support half-close connectionliuyacan1-1/+25
Some app(e.g. Envoy) may call shutdown() instead of close() when draining connection. Type: improvement Signed-off-by: liuyacan <liuyacan@corp.netease.com> Change-Id: I9543b9ca3caa87b10b134fd1fc4019124e41e4d2
2021-05-10session: use half-open sessions for vc establishmentFlorin Coras1-3/+15
Use half-open sessions to track virtual circuit connection establishment. These sesssions can only be allocated and freed by the thread that allocates half-open connections (main). Consequently, they can only be freed on half-open cleanup notifications from transports. Goal is to simplify state tracking within the session layer but it's also a first step towards allowing builtin apps to track and cleanup outstanding connects. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I8a535906d13eb7f8966deb82333839de80f8049f
2021-04-20tcp: req app deq notification on fifo fullFlorin Coras1-0/+22
If fifo full, default to requesting an app deq notification and forcing an ack (window update) if zero rcv window sent is still active. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Iade7e1722503da149c62c465c472edbb0a5599f7
2021-04-15tcp: support for rate sample attr flagFlorin Coras1-0/+14
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I94b8063c9d8f9b811589c6815cb5c8ca6220f2b5
2021-04-14session tcp vcl: api to update connection attributesFlorin Coras1-0/+96
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ifdd6024daf044751895bb8d2deabad41d3a80c92
2021-04-05tcp: time infra improvementsFlorin Coras1-3/+3
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I998c0686f9f7dc556dda8b28e23bbed127d0aafc
2021-03-26vlib: introduce vlib_get_main_by_index(), vlib_get_n_threads()Damjan Marion1-1/+1
Type: improvement Change-Id: If3da7d4338470912f37ff1794620418d928fb77f Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-03-08tcp: account for option alignment in initial snd_mssFlorin Coras1-2/+3
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I24225ada6623c5b5543341ecac0d6c1db43cc8a9
2020-10-23tcp: remove snd_una_maxFlorin Coras1-1/+0
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I03f923053499f219035c9b7b6640fc575568d474
2020-10-23tcp: remove delack time configFlorin Coras1-1/+0
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Iae5045686c62ad9279be350cffeaa41b8297d179
2020-10-22tcp: no send space in timer recoveryFlorin Coras1-1/+4
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I9461b6539c504ca844c25d04abe95929f842e4e9
2020-10-21tcp: updating time constans as timer tick changedRyujiro Shibuya1-8/+10
Type: fix Signed-off-by: Ryujiro Shibuya <ryujiro.shibuya@owmobility.com> Change-Id: Ibe305b96f04ffdc95ddb07d144dc00119ae69a07
2020-10-08tcp: treat pending timers as activeFlorin Coras1-1/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic63af51fab8dbefe79439554ea563f20e3788afa
2020-10-08tcp: custom geometry for timer wheelFlorin Coras1-17/+5
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I04f992e5d91d21f1e5bbafef070478cfe268d94a
2020-09-24session tcp udp tls quic: improve cli formattingFlorin Coras1-2/+3
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Iae5dbb8aaaf82d8e95c2ee8bbbe6844c9dd49f80
2020-09-16tcp: make max gso packet size configurableSimon Zhang1-1/+2
Type: improvement Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com> Change-Id: I14de90f07d825c5c99023996a88173ee855e9a6f
2020-08-20tcp: track reorder with sacksFlorin Coras1-6/+10
Type: feature Change-Id: I041bff2e8d589c171661de286fa1503531dff891 Signed-off-by: Florin Coras <fcoras@cisco.com>
2020-08-03tcp: improve timestamp rtt accuracyFlorin Coras1-6/+1
- switch to using vlib_time as reference for timestamps - use us precision ticks for tcp but keep using ms precision for timestamps. As a result, srtt, rttvar and rto are now measured in us instead of ms. MRTT samples from timestamps are converted from ms to us (not accurate under ms) while high precision samples are used with us precision, i.e., they're no longer converted to ms precision samples. Type: improvement Change-Id: Ibda559575d9b4fdc85b0985264f7c865ff367e34 Signed-off-by: Florin Coras <fcoras@cisco.com>
2020-07-23tcp: track pending timersFlorin Coras1-1/+8
Also removes delack timer and reuses the u32 for the pending timers list. Type: fix Ticket: VPP-1923 Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I4edbb72d5b2aa5e14f87659f49e675af1e834aca
2020-04-28vlib: add ASSERT to vlib_time_now(...)Dave Barach1-1/+2
Calling vlib_time_now (&vlib_global_main) from a worker thread is a bad mistake. ASSERT (vm->thread_index == __os_thread_index) will catch it. Type: improvement Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I55af6de84e06143f8f43adc62103b77267a7a441
2020-04-17tcp: cubic as default cc algorithmFlorin Coras1-1/+1
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I48ce827966667a767440149769eb1b24616ce4c1
2020-04-17session tcp: track half open in app wrkFlorin Coras1-2/+16
Type: improvement Do extra checks when establishing an active connect and cleanup pending connects if application detaches. Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ibe9349db57b313ba2aa5ea3960ef5cf755f5098a
2020-04-15tcp: allow local port sharing if 5-tuple availableFlorin Coras1-1/+14
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id0c4b46247e7419a328387678a4753cfb1e42d75