summaryrefslogtreecommitdiffstats
path: root/src/vnet/sctp
AgeCommit message (Collapse)AuthorFilesLines
2018-12-28session: free session after transport and app confirmFlorin Coras2-4/+4
In addition to that, a bit of refactoring. Change-Id: Iea1eabc2167bcdef185ec53bc09bae087c5398e6 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-12-07VPP-1506: dump local punts and registered punt socketsPavel Kotucek1-0/+23
Change-Id: If7835e9b80ec9402404bfc8d271eb11a10ef992b Signed-off-by: Pavel Kotucek <pavel.kotucek@pantheon.tech>
2018-11-14Remove c-11 memcpy checks from perf-critical codeDave Barach2-36/+39
Change-Id: Id4f37f5d4a03160572954a416efa1ef9b3d79ad1 Signed-off-by: Dave Barach <dave@barachs.net>
2018-10-28session: extend connect api for internal appsFlorin Coras1-4/+4
Change-Id: Ie4c5cfc4c97acb321a46b4df589dc44de1b616ba Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-10-25SCTP: DATA chunk padding fix and hardeningMarco Varlese3-7/+37
According to the RFC 4096 (section 3.3.1) the DATA chunk needs to be padded to a boundary of 4 bytes with zeros. This patch addresses that requirement. At the same time, this patch takes care of adding some hardening for corner-cases where the transmitted tag could be wrong. Change-Id: I3b653926e9933d0d3d46bc5f37eaceefd932e874 Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-10-23c11 safe string handling supportDave Barach4-8/+8
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab Signed-off-by: Dave Barach <dave@barachs.net>
2018-10-04VPP-1430: remove unnecessary paddingMarco Varlese1-2/+0
A copy/paste mistake caused to add padding to the buffer used to send data. Change-Id: I04d8dfec4ae195927be1675c5ce8b30230d5b376 Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-10-01SCTP: fix overflow issue with timestampMarco Varlese5-23/+29
Change-Id: I03bb47a2baa4375b7bf9347d95c4cc8de37fe510 Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-09-27SCTP: fix advanced debug outputMarco Varlese1-2/+2
Change-Id: Ied63ebaec8e19189f8b1ab2a7f6d7474c3f2ad6e Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-06-11tcp: cleanup connection/session fixesFlorin Coras1-1/+1
- Cleanup session state after last ack and avoid using a cleanup timer. - Change session cleanup to free the session as opposed to waiting for delete notify. - When in close-wait, postpone sending the fin on close until all outstanding data has been sent. - Don't flush rx fifo unless in closed state Change-Id: Ic2a4f0d5568b65c83f4b55b6c469a7b24b947f39 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-06-11MTU: Software interface / Per-protocol MTU supportOle Troan1-4/+12
This patch separates setting of hardware interfaec and software interface MTU. Software MTU is L2 payload MTU (i.e. not including L2 header). Per-protocol MTU for IPv4, IPv6 and MPLS can also be set. Currently only IP4, IP6 are enabled in adjacency / rewrite code. Documentation in src/vnet/MTU.md Change-Id: Iee2fd6f0bbc8210748dd8e073ab9fab87d323690 Signed-off-by: Ole Troan <ot@cisco.com>
2018-05-18session: add session process nodeFlorin Coras1-0/+2
Add a session process node that handles main thread tx and retransmit in order to avoid having a polling input node. Change-Id: I3357e987c023a84b533b32793e37ab4204420f64 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-05-04Harmonize vec/pool_get_aligned object sizes and alignment requestsDave Barach1-0/+3
Object sizes must evenly divide alignment requests, or vice versa. Otherwise, only the first object will be aligned as requested. Three choices: add CLIB_CACHE_LINE_ALIGN_MARK(align_me) at the end of structures, manually pad to an even divisor or multiple of the alignment request, or use plain vectors/pools. static assert for enforcement. Change-Id: I41aa6ff1a58267301d32aaf4b9cd24678ac1c147 Signed-off-by: Dave Barach <dbarach@cisco.com>
2018-04-18typo fix: UNKOWN -> UNKNOWNAndrey "Zed" Zaikin3-10/+10
Change-Id: I008a4d7ad7160d1f07e7ceef712a5318a9368308 Signed-off-by: Andrey "Zed" Zaikin <zed.0xff@gmail.com>
2018-04-18SCTP: coverity warningsMarco Varlese1-5/+2
This patch addresses the warning 182994 Change-Id: I071f3cbdf9965c7b57d444f79430ee75c66c856e Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-04-17SCTP: coverity scan warningsMarco Varlese3-30/+39
This patch addresses 182346, 182347, 182353. Change-Id: I59c3d74bd3a2122b836c93e22ddb632fa032f7fe Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-03-28SCTP: use custom fibMarco Varlese2-7/+12
Following TCP fixes from Florin (11430), this patch follows the same approach to indicate a fib (not just using the default one). Change-Id: Ib883aa0e9a1c6157acfea69c44426ba07d6c932a Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-03-13SCTP: data retransmission & snd_space fixMarco Varlese3-4/+88
This patch addresses two things: 1) The data retransmission which needs to be taken care of when the SCTP_TIMER_T3_RXTX; 2) The correct calculation of the amount of data transmittable considered: the local window, the peer window and any data inflight. Change-Id: I2d03a6cb43e4e7770c4910f8547c66e1026aeace Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-03-13SCTP: cumulative SACK fixMarco Varlese4-15/+44
A bug was found affecting the cumulative sending of SACK messages. Because the next0 was never assigned to the next_output the SACK message was never leaving the peer. Further, two new flags have been added to distinguish when a peer is AWAITING a SACK message (e.g. DATA is inflight and waiting to be acknowledged). Change-Id: Ibb5a98f7e5fed15cdc76710b74195cac031d59ed Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-03-05SCTP: API to configure some tunablesMarco Varlese6-78/+129
This patch adds the possibility to configure some behaviors of the SCTP stack based on some tunable parameters (mainly ON/OFF). For the time being, that is limited to the bundling option (multiplexing messages) and to delaying the SACK message. Change-Id: I696493e0309e47163c1e119c7d9f82f7d8ee6b87 Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-03-05SCTP: retransmission in INIT/SHUTDOWN phaseMarco Varlese4-24/+124
This patch addresses the need to handle timers timeouts (e.g. sent chunks not being acked) for both the INIT and SHUTDOWN phases. The INIT phase requires the handling of two timers the T1-init and T1-cookie timers whilst the SHUTDOWN phase requires the handling of the T2-shutdown timer only for the retransmission case. Left to be implemented is the handling of the DATA chunks retransmission (e.g. T3-rxtx expiration) but that will be submitted with a separate patch. Change-Id: I2b2e13dce11000aea3c7d965f02b27b76c97e605 Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-03-02session: first approximation implementation of tlsFlorin Coras1-0/+2
It consists of two main parts. First, add an application transport type whereby applications can offer transport to other applications. For instance, a tls app can offer transport services to other applications. And second, a tls transport app that leverages the mbedtls library for tls protocol implementation. Change-Id: I616996c6e6539a9e2368fab8a1ac874d7c5d9838 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-03-01SCTP: API to delete a sub-connectionMarco Varlese4-2/+106
This patch adds an API to delete a sub-connection following a SRC/DST IP mapping as required by the RFC4960. Change-Id: I7673dd07352557442ffeed6c6c00da274b24953d Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-03-01SCTP: API to add a sub-connectionMarco Varlese6-38/+242
This patch adds an API to add a sub-connection following a SRC/DST IP mapping as required by the RFC4960. At the same time, it changes the way the next available sub-connection is being calculated: rather than having an index in the parent connection which is prone to many issues at run-time, the next available sub-connection is being calculated by looking at the state of the set sub-connections and if marked as DOWN it means that is an available slot to be used. Change-Id: I662be6a247bfbbe8bf9aaf3f485183c07ef862fe Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-02-28SCTP: handle COOKIE while in SHUTDOWN phaseMarco Varlese3-20/+40
This patch address the requirement to handle a COOKIE chunk whilst in SHUTDOWN phase. The COOKIE shouldn't just be dropped but an OPERATION ERROR chunk shall be sent to the peer to inform about the current situation. Change-Id: I1a47652402d49cfee3b0c810304d7902f3a62f40 Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-02-27sctp: sctp_output.c failed to compile when VLIB_BUFFER_TRACE_TRAJECTORY is ↵Steven1-1/+1
enabled Fixed a typo in sctp_push_header(). It was inherited from tcp_output.c Change-Id: I810fcb4c24cfd3d54f15da72a5184cfc4df24592 Signed-off-by: Steven <sluong@cisco.com>
2018-02-26SCTP: Handle a COOKIE ECHO/ACK when a TCB ExistsMarco Varlese4-17/+146
This patch addresses the requirements depicted in section 5.2.4 of the RFC 4960. It also takes care of handling the ERROR chunk and obviously the STALE COOKIE error. Change-Id: I6b88a9371546b18a52abac22f7c593a5f16be838 Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-02-26SCTP: handle INIT corner-case handlingMarco Varlese4-5/+215
As per RFC4960 the INIT chunk could be received in unexpected scenarios and - depending on the state of the internal state-machine - the INIT chunk requires different treatment. This patch addresses section 5.2.1 and 5.2.2 of the RFC4960. Change-Id: Ib23ef490c6a5ca3da6c46a9584b75e7577cb7042 Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-02-25SCTP: fix connection memory corruptionMarco Varlese4-14/+23
A bug was found when multiple SCTP connections were being opened to the same SCTP server. This patch addresses that problem, removing the use of the 'parent' pointer approach for sub-connection and saving instead within the sub-connection itself the ID representing its position. That facilitates pointer-arithmetic to be computed in the get_connection_from_transport(). Change-Id: Iaa1f4efc501590be1c93e42fd6fe3d6e02f635eb Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-02-21SCTP: minor refactorMarco Varlese4-30/+49
This patch adds some missing information in various debugging messages which can help with debugging state-machine and connection-tracking. It also renames some internal variable names for better code readibility. Change-Id: I68503fc0214300032f7514426c8b5b2b12edf11a Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-02-20SCTP: congestion controlMarco Varlese5-184/+251
This patch addresses the requirements depicted by section 7.1.1 and 7.1.2 of the RFC 4960. Specifically, it implements the Slow-start and Congestion-avoidance policies. The patch also took care of correctly implementing some 'formatting' functions required - for instance - in packet(s) tracing. Change-Id: I68eade1b30345de3acb3ac8a653a5ef76eb6d2ac Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-02-17SCTP: 'multi-home' supportMarco Varlese5-186/+217
This patch addresses the SCTP requirement for multiple sub-connections to implement the so called 'multi-homed' scenario. Change-Id: Ibce18f216e9d2bebe318992c441bf278e16aad17 Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-02-15SCTP: coverity warning fixMarco Varlese1-1/+5
Change-Id: I1f8a325eac2a9e2c825996f04026ae86259a7ddd Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-02-15SCTP: fix corrupted buffers seen in output nodeMarco Varlese4-44/+62
The issue observed in the output-node was actually caused by one of the input-node pushing buffers to the output node when not required. That is the case with the parsing/handling of incoming packets like the COOKIE_ACK, HEARTBEAT_ACK, DATA, SACK which do not require a response to be sent to the other peer. In all the mentioned cases the packets (buffers) need to be consumed and dropped instead of heading to the output-node. Change-Id: I3dcbe5de1cedb2ab8b06fff4364749b525cc7ac6 Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-02-15SCTP: refactoringMarco Varlese4-129/+97
This patch takes care of some refactoring, including the initialization of the timestamp to calculate the RTO, the output state-machine validation which can be enabled (disabled by default) when debugging and some clean-up of unused fields. It also addresses the requirement of Karn's algorithm when computing the RTO. Change-Id: I6b875152369bff23cad085708cec1f7e1151cfa8 Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-02-12SCTP: fix build errors on ubuntu bionicMarco Varlese1-4/+2
Change-Id: I070771794be92fd9a6e800ca0022e52d592cd1a4 Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-02-08SCTP: shutdown phaseMarco Varlese3-67/+92
This patch addresses some bugs discovered with the shutdown phase which were causing the actual chunks not to leave the output_node. While fixing the issue some minor refactoring was also performed to align the internal functions to a 'common' design. Change-Id: Ieac4f6e78cffad2e6982536f8e9f190a66f328f7 Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-02-07Refactor vlib_buffer flagsDamjan Marion1-1/+1
Change-Id: I853386aebfe488ebb10328435b81b6e3403c5dd0 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-02-07SCTP: address coverity-scan warningsMarco Varlese2-19/+10
Change-Id: Iba7c398a398e24b96eb536bbcefa841bd153a205 Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-02-06SCTP: handling of heartbeating and max-retransmitsMarco Varlese4-57/+164
This patch address the need to send/receive heartbeats between peers. At the same time, the number of unacked heartbeats is tracked and when the peer requests to send DATA to the remote-peer the value of unacked heartbeats needs to be checked against the maximum value allowed for retransmissions. If the unacked heartbeats value is higher then the remote-peer is considered unreachable and the connetion needs to be shutdown. Change-Id: I2b1a21c26775e734dbe82486f40982ed5702dc63 Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-02-06SCTP: missing spinlock init when multiple threadsMarco Varlese1-2/+5
When the number of threads results being more than 1, the spinlock structure requires to be initialized otherwise subsequent calls to the "lock" API (clib_spinlock_lock_if_init) would result in a void operation. Change-Id: Ia268c4687252e41962bb3f1217f0a849d8c40385 Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-02-05SCTP: calculate RTO / RTT and RTTVAR as per RFCMarco Varlese4-47/+122
This patch addresses the need to calculate the RTO / RTT and RTTVAR according to the rules depicted by the RFC4960 at section 6.3.1 Change-Id: I1d346f3c67610070b3f602f32c7738d58b99ffed Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-02-01Out-of-order data chunks handling and moreMarco Varlese4-69/+235
This patch addresses the need to handle out-of-order data chunks received by a peer. To do that effectively, we had to add the handling of data chunks flags (E/B/U bit) to understand whether the stream is fragmenting user-message data and in that case if a fragment is the FIRST/MIDDLE/LAST one of a transmission. The same patch also addresses the security requirement to have a HMAC calculated and incorporated in the INIT_ACK and COOKIE_ECHO chunks. The algorithm used is the HMAC-SHA1. Change-Id: Ib6a9a80492e2aafe5c8480d6e02da895efe9f90b Signed-off-by: Marco Varlese <marco.varlese@suse.com>
2018-01-31Prep-work patch for congestion-controlMarco Varlese6-450/+670
This patch addresses the missing field in various data-structures to track valuable information to implement the congestion-control algorithms and manage sub-connections states. It adds the possibility to queue up to 2 SACKs chunks when the connection is not gapping. At the same time, it pushes some variable/field renaming for better readibility. Change-Id: Idcc53512983456779600a75e78e21af078e46602 Signed-off-by: Marco Varlese <marco.varlese@suse.de>
2018-01-26session: move builtin apps to their own folderFlorin Coras3-1419/+0
This consolidates builtin apps under session-apps folder. It also removes duplicate builtin echo server/client implementations. Change-Id: I75ed879399c5aa9b75b1eb38b33aedf69dd8df3f Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-01-25session: add support for memfd segmentsFlorin Coras2-10/+2
- update segment manager and session api to work with both flavors of ssvm segments - added generic ssvm slave/master init and del functions - cleanup/refactor tcp_echo - fixed uses of svm fifo pool as vector Change-Id: Ieee8b163faa407da6e77e657a2322de213a9d2a0 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-01-24SCTP stack (RFC4960)Marco Varlese13-0/+8109
== CONTENT == * SCTP chunks definition as per RFC4960; * Helper functions to set/get values to/from the corresponding chunks; * Hooks to the session/application layers; * Complete state-machine handling; * Implementation for unexpected chunk received in a certain state (state-machine error handling) * Support for 1-single connection; * Sample application to test receive/transmit data-path; * Test to validate SCTP stack; Change-Id: I1b55c455ab400be9513f4e094dadfc3181d2ebc9 Signed-off-by: Marco Varlese <marco.varlese@suse.com>