summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp.c
AgeCommit message (Collapse)AuthorFilesLines
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
2020-04-03session: improve error reportingFlorin Coras1-5/+2
Type: improvement Change-Id: I9dd850a1ce85b0adb5136233f176117e0ee38817 Signed-off-by: Florin Coras <fcoras@cisco.com>
2020-04-02tcp: explicit use of timer wheel in timer apisFlorin Coras1-17/+28
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I06120d43c15b2fa3f437ef235bf5f83ec2beb45e
2020-04-02tcp: move features to separate filesFlorin Coras1-1052/+1
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ia477b8dba9266f47907967e363c11048e5cd95ab
2020-03-30tcp: reuse session infra for syns and resetsFlorin Coras1-25/+19
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I71df27049ef0193578f0c42f8f8bbd5c54e4d53e
2020-03-25session: api to add new transport typesFlorin Coras1-0/+2
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: If4dee6dba1ea942daa921d566b35cdecdda680ee
2020-03-19tcp: move accept init to separate reusable functionFlorin Coras1-0/+45
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I5120eb321e9e2050eb64dca9e2dfb6256ff2b62d
2020-03-19tcp: force deschedule if no send space availableFlorin Coras1-8/+8
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Iae9f118f710153b6c0e390265039db7434e67ed8
2020-03-19session tcp udp: consolidate transport snd apisFlorin Coras1-37/+28
Type: improvement Use only one api to retrieve transport send parameters. Additionally, allow transports to request postponing and descheduling of events. With this, tcp now requests descheduling of sessions when the connections are stuck probing for zero snd_wnd Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I722c974f3e68fa15424c519a1fffacda43af050c
2020-03-10tcp: protect against forced cleanupsFlorin Coras1-0/+2
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I0c3b847044d522f55dfd8262afa7c161d5bd5dd3
2020-02-25tcp: handle cleanups without timersFlorin Coras1-25/+60
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ida896e9fbe83b4c76578b089bb3fd2bef5e07fd2
2020-02-24tcp: dynamic max timers per loopFlorin Coras1-3/+19
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: If0a634c277d4f8e4d32321f52253721a990bdb1d
2020-02-18tcp: add fib to connection cli outputFlorin Coras1-2/+2
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I3de653fd90b8030125b627f751c7fb665ade5aee
2020-02-18tcp: allow custom mss on connectsFlorin Coras1-0/+5
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ie4bd68a387f706b3e6868bece2ec4c8c1d92a9c3
2020-02-18tcp: pace timer handlingFlorin Coras1-101/+147
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I93067054631d6ae2411a7b08d7b681aed7a121b2