aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp
AgeCommit message (Collapse)AuthorFilesLines
2017-08-25tcp: retransmit and multi-buffer segment fixes and improvementsFlorin Coras4-142/+211
- set session state as closed on session manager delete - enable retransmit as opposed to persist timer after persist timer completes - properly discard buffer chain bytes when new data overlaps ooo segments - don't use rxt bytes in snd space estimate used on tx path Change-Id: Id9cab686e532e5fe70c775d5440260e8eb890a9f Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-08-25Fix crash when TCP client using VPP host stack connects firsttjanciga1-0/+6
VPP is crashing without this fix if there is not any server using VPP host stack and client attemts to connect. Change-Id: I672977f78180bbc5ba9259116b2e165363463ccd Signed-off-by: tjanciga <tomas.janciga@pantheon.tech>
2017-08-18session: fix multi-buffer segmentsFlorin Coras2-15/+18
Change-Id: I0e22c85ea570b934b9c78dc5e86d86d690bdae5e Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-08-17TCP source address automationDave Barach4-13/+386
- v6 support - Non-default VRF ID collection - Break up ip source address list into CLI + API-friendly functions - Automate proxy arp / proxy nd configuration - Automate local adjacency insertion - Binary API support Change-Id: Iede31184f65cc1ec8c414447d2d60a1334e3fe15 Signed-off-by: Dave Barach <dave@barachs.net>
2017-08-16tcp: fix v6 sessionsroot3-21/+18
Change-Id: Ia6dd5e948b17b2f3866fe70838eabb09e35415e1 Signed-off-by: Dave Barach <dbarach@cisco.com> Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-08-16tcp: improve builtin http serverFlorin Coras2-186/+96
Additionally: - remove opaques from stream_session_t - ensure first segment manager is only used once per app. Change-Id: I143d1fdb8effc88815ef969b78122ba3ac29e06e Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-08-15tcp: state machine improvementsFlorin Coras3-14/+32
- Add SYN_RCVD timeout - Fix FIN_WAIT_1 to CLOSING transition Change-Id: I42ca7fc087f6fdfae15bd7a6175dd3226ed341c7 Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-08-14TCP: Update time_now once per burstFlorin Coras4-3/+15
Change-Id: I58089d7a9867ede9d8a36b2aea62edef04cb5b81 Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-08-14TCP: update builtin server/client cli helpFlorin Coras2-5/+19
Change-Id: I224ef3ce1c4ac2ade5ba733a42c78b7ba5c0040e Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-08-11Fix tcp multi buffer segments retransmissionFlorin Coras4-132/+263
- Fix tcp/udp sw checksum computation - Fix allocation of multi buffer tcp segments for retransmits - Send FIN only if/when tx fifo is empty Change-Id: I2e43a14b87a72c9e547b4339b9a51811cf5732c4 Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-08-10Improve the svm fifo allocatorDave Barach1-0/+14
- Round up requested fifo size to the next power of two - Maintain per-segment power-of-two freelists - Allocate fifos in chunks, to amortize alignment overhead - Detach builtin test client application after each run so we can use different fifo sizes each time - Be more suspicious of session / application indices Useful prep work for dynamically resizing fifos. As far as the svm fifo code is concerned, it's OK to set fifo->nitems anywhere in the interval: [0, 1<<(fifo->freelist_index) + FIFO_SEGMENT_MIN_FIFO_SIZE] It's unlikely that setting nitems below the path MTU will work out very well... Change-Id: Idad73a027dfb7412056cb02988b77e300fa7e8a7 Signed-off-by: Dave Barach <dave@barachs.net>
2017-08-10TCP proxy prototypeDave Barach4-187/+703
- Clean up internal API client registration - Add proxy server - Add a reference count to the svm fifo Change-Id: I5ace1c85497062ed412d26ae76a9e6741af1e984 Signed-off-by: Dave Barach <dave@barachs.net> Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-08-02Fix ip checksum offload, move badly-placed ASSERTDave Barach1-2/+2
Change-Id: I5e04d618c4b4987edc64f6d82fd0a81b8362dbb0 Signed-off-by: Dave Barach <dbarach@cisco.com>
2017-08-02Fix tcp tx buffer allocationFlorin Coras5-90/+203
- Make tcp output buffer allocation macro an inline function - Use per ip version per thread tx frames for retransmits and timer events - Fix / parameterize tcp data structure preallocation - Add a couple of gdb-callable show commands - Fix local endpoint cleanup Change-Id: I67b47b7570aa14cb4634b6fd93c57cd2eacbfa29 Signed-off-by: Florin Coras <fcoras@cisco.com> Signed-off-by: Dave Barach <dave@barachs.net>
2017-08-02Make ip csum configurable in vlib buffer functionsFlorin Coras1-6/+7
Also fixes csum computation for lisp control plane 4o6 encapsulated control messages. Change-Id: I991e0b5c0d16dc51e0b5bdc79e1d752270b34765 Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-07-30Make tcp active open data structures thread safeFlorin Coras8-168/+251
- Cleanup half-open connections and timers on the right thread - Ensure half-open connection and transport endpoint pools are thread safe - Enqueue TX events to the correct vpp thread in the builtin client - Use transport proto in transport connections instead of session type Change-Id: Id13239a206afbff6f34a38afa510fe014e4b2049 Signed-off-by: Florin Coras <fcoras@cisco.com> Signed-off-by: Dave Barach <dave@barachs.net>
2017-07-25Cleanup/refactor session layer codeFlorin Coras2-72/+55
Change-Id: Ica99e8cb919fca6b069c37c969d60e8ccc2c6bf9 Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-07-21Improvements to tcp rx path and debuggingFlorin Coras8-169/+482
- Increment rcv_nxt for fin packets - Call tcp_segment_rcv only if buffer has data - Parse rcv opts before deleting half-open connection - Fix initial rcv_wnd - Improved event logging Change-Id: I9b83c04f432c4cec832c480b03e534deff02c3b1 Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-07-18TCP/UDP checksum offload APIDave Barach1-3/+13
Change-Id: I2cb6ce4e29813f6602b14e6e61713fb381fbcef8 Signed-off-by: Dave Barach <dave@barachs.net>
2017-07-15Fixes and improved tcp/session debuggingFlorin Coras6-42/+631
- Fix rx sack option parsing - Add session sack scoreboard tracing and replaying - Add svm fifo tracing and replaying - Scoreboard/svm fifo ooo segment reception fixes - Improved overall debugging Change-Id: Ieae07eba355e66f5935253232bb00f2dfb7ece00 Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-07-14vnet_buffer_t flags cleanupDamjan Marion1-4/+4
Change-Id: I123eccea98abafeb31f25d2a162501e2eded60d4 Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-07-11Horizontal (nSessions) scaling draftDave Barach11-127/+480
- Data structure preallocation. - Input state machine fixes for mid-stream 3-way handshake retries. - Batch connections in the builtin_client - Multiple private fifo segment support - Fix elog simultaneous event type registration - Fix sacks when segment hole is added after highest sacked - Add "accepting" session state for sessions pending accept - Add ssvm non-recursive locking - Estimate RTT for syn-ack - Don't init fifo pointers. We're using relative offsets for ooo segments - CLI to dump individual session Change-Id: Ie0598563fd246537bafba4feed7985478ea1d415 Signed-off-by: Dave Barach <dbarach@cisco.com> Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-06-22Improve svm fifo and tcp tx path performance (VPP-846)Florin Coras4-16/+126
- multiarch on svm fifo - avoid ip lookup on tx Change-Id: Iab0d85204a710979417bca1d692cc47877131203 Signed-off-by: Florin Coras <fcoras@cisco.com> Signed-off-by: Dave Barach <dbarach@cisco.com>
2017-06-19Overall tcp performance improvements (VPP-846)Florin Coras10-413/+630
- limit minimum rto per connection - cleanup sack scoreboard - switched svm fifo out-of-order data handling from absolute offsets to relative offsets. - improve cwnd handling when using sacks - add cc event debug stats - improved uri tcp test client/server: bugfixes and added half-duplex mode - expanded builtin client/server - updated uri socket client/server code to work in half-duplex - ensure session node unsets fifo event for empty fifo - fix session detach Change-Id: Ia446972340e32a65e0694ee2844355167d0c170d Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-06-09Implement sack based tcp loss recovery (RFC 6675)Florin Coras9-372/+904
- refactor existing congestion control code (RFC 6582/5681). Handling of ack feedback now consists of: ack parsing, cc event detection, event handling, congestion control update - extend sack scoreboard to support sack based retransmissions - basic implementation of Eifel detection algorithm (RFC 3522) for detecting spurious retransmissions - actually initialize the per-thread frame freelist hash tables - increase worker stack size to 2mb - fix session queue node out-of-buffer handling - ensure that the local buffer cache vec_len matches reality - avoid 2x spurious event requeues when short of buffers - count out-of-buffer events - make the builtin server thread-safe - fix bihash template threading issue: need to paint -1 across uninitialized working_copy_length vector elements (via rebase from master) Change-Id: I646cb9f1add9a67d08f4a87badbcb117980ebfc4 Signed-off-by: Florin Coras <fcoras@cisco.com> Signed-off-by: Dave Barach <dbarach@cisco.com>
2017-06-01Improve fifo allocator performanceDave Barach4-137/+216
- add option to preallocate fifos in a segment - track active fifos with doubly linked list instead of vector - update udp redirect test code to read fifo pointers from API call instead of digging them up from fifo segment header - input-node based active-open session generator Change-Id: I804b81e99d95f8690d17e12660c6645995e28a9a Signed-off-by: Dave Barach <dave@barachs.net> Signed-off-by: Florin Coras <fcoras@cisco.com> Signed-off-by: Dave Barach <dbarach@cisco.com>
2017-05-20Improve session debuggingFlorin Coras6-68/+141
Also improves builtin client code. Change-Id: I8bca1aa632028f95c373726efb0abf2ee0eff414 Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-05-18Improve sack bytes accounting and testingFlorin Coras5-37/+140
Change-Id: Iabeda0d0615b0f6fe20dd00611cb4c594d90b7eb Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-05-17VPP-846: tcp perf / scale / hardeningDave Barach2-9/+5
Fix builtin server event queue handling Change-Id: I21b49c37188746cadb2fd9423291c5dc1335798c Signed-off-by: Dave Barach <dbarach@cisco.com>
2017-05-16Fixes to tcp active opens and receptionDave Barach1-0/+5
- Properly initialize connection index - Add new session to main hash table - Drop packets that are completely in the past with respect to the rcv wnd (e.g., retransmits due to premature timer pops) Change-Id: Ic0873018ff0a4c59e0913863dc7f0c0f822d5c34 Signed-off-by: Dave Barach <dbarach@cisco.com> Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-05-15Fix builtin tcp clientDave Barach2-37/+73
Change-Id: I83a1b02a73fd159f14cca04fed3993f571475a00 Signed-off-by: Dave Barach <dbarach@cisco.com>
2017-05-11Handle RST of TCP connections in SYN-RCVD state, VPP-822Florin Coras1-8/+23
Change-Id: Ieb0c1e690d6ae082cfedb276252a31fab480e561 Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-05-10Multi-thread enablement for the debug cli http serverDave Barach1-1/+20
Change-Id: Iec1f739fe24c722d0db6c10cc81b5e8333067ea1 Signed-off-by: Dave Barach <dbarach@cisco.com>
2017-05-10Improve TCP option handling, VPP-757Florin Coras3-15/+54
Change-Id: Ica634536387d1196366ec96c52770287fcab0768 Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-05-10Builtin debug cli http serverDave Barach1-0/+634
Visit http://<vpp-ip>/show/interface or similar. Change-Id: I076b4661cf19d1b94bb01efdadb5849446be915e Signed-off-by: Dave Barach <dave@barachs.net>
2017-05-10Ignore data in RST segments, VPP-723Florin Coras2-59/+53
Change-Id: I01650b3b10b79ec549be0d5eceb0e318c06fcb50 Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-05-09Fix remaining 32-bit compile issuesDamjan Marion2-9/+12
Change-Id: I9664214652229b663c3e3ba7406b4ede96bfb123 Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-05-09Add support for tcp/session buffer chainsFlorin Coras2-10/+10
Change-Id: I01c6e3dc3a1b2785df37bb66b19c4b5cbb8f3211 Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-05-07Include TCP options in segment size computationFlorin Coras4-41/+96
Ensure that TCP data plus options does not exceed peer's advertised MSS. Change-Id: I0de824cb3619346f0394dd694942fc1cf33a82b7 Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-05-07Fix TCP loss recovery, VPP-745Florin Coras5-48/+72
Allows pure loss recovery retransmits only on timeout. Change-Id: I563cdbf9e7b890a6569350bdbda4f746ace0544e Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-05-02Fix TCP tx when snd_wnd < smssFlorin Coras1-3/+4
Fixes VPP-728, VPP-729, VPP-730 Change-Id: Ie8c6c0dd006f98527525e87d19b508bb8d39db69 Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-05-01TCP ooo reception fixesFlorin Coras6-37/+186
- Improve svm fifo handling of out-of-order segments - Ensure tsval_recent is updated only if rcv_las falls withing the segments's sequence space - Avoid directly dropping old ACKs - Improve debugging Change-Id: I88dbe2394a0ad7eb389a4cc12d013a13733953aa Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-04-27[VPP-710] tcp TCP_TIMER_ESTABLISH timeout_handler occur segment faultflyingeagle231-1/+2
Change-Id: Ie43b8f1c91600d44dff67e9348fb2fe83efc60c2 Signed-off-by: flyingeagle23 <wang.hui56@zte.com.cn>
2017-04-25Session/tcp coverity fixesFlorin Coras5-101/+85
Change-Id: Ic5467df16e870b49c49678b1dbb40f4a2390b3c9 Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-04-25Add sack tx unit testFlorin Coras4-18/+185
Change-Id: Ib91db6e531231bdc52b0104673a912bee024872f Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-04-24Debug CLI to magically create / delete a TCP sessionDave Barach4-55/+127
The session ends up in established state, and is hand-crafted to look like it was created by the builtin_server. This will come in handy for injecting packets into tcp46-established, along with ancillary debug CLI to adjust connection parameters. Immediate applications include screwball window cases, out of order segments, paws checking, and so on and so forth. Debug CLI script: loop create set int ip address loop0 6.0.1.1/8 set int state loop0 up set ip arp loop0 6.0.1.2 feed.face.babe test tcp server test tcp session packet-generator new { name tcp limit 1 node ip4-input size 100-100 interface loop0 no-recycle data { TCP: 6.0.1.2 -> 6.0.1.1 TCP: 11234 -> 1234 ACK window 2000 seqnum 0 acknum 0 incrementing 100 } } Change-Id: I866c2159376064b7d14f70531022c1fe949258c2 Signed-off-by: Dave Barach <dave@barachs.net>
2017-04-24Session layer improvementsFlorin Coras6-46/+41
Among others: - Moved app event queue to shared memory segment - Use private memory segment for builtin apps - Remove pid from svm fifo - Protect session fifo (de)allocation - Use fifo event for session disconnects - Have session queue node poll in all wk threads Change-Id: I89dbf7fdfebef12f5ef2b34ba3ef3c2c07f49ff2 Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-04-19Add more svm fifo unit testsFlorin Coras1-59/+246
Change-Id: Ifc07b3f90ac155c26c3a216e073b474b499ebd44 Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-04-18Fix fifo ooo bugs and improve testingDave Barach5-56/+493
Change-Id: If3c01e318bcb740ca5b240c63f712e2167082a80 Signed-off-by: Dave Barach <dave@barachs.net> Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-04-15Set lower bound on persist timerFlorin Coras2-7/+10
Change-Id: Ie98ecb8944e4d27e943797948fad41ec074d6720 Signed-off-by: Florin Coras <fcoras@cisco.com>