public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
* [PATCH v3 00/15] RFC: Unified flow table
@ 2023-12-21  7:02 David Gibson
  2023-12-21  7:02 ` [PATCH v3 01/15] flow: Common data structures for tracking flow addresses David Gibson
                   ` (14 more replies)
  0 siblings, 15 replies; 33+ messages in thread
From: David Gibson @ 2023-12-21  7:02 UTC (permalink / raw)
  To: Stefano Brivio, passt-dev; +Cc: David Gibson

This is a third draft of the first steps in implementing more general
"connection" tracking, as described at:
    https://pad.passt.top/p/NewForwardingModel

This series changes the TCP connection table and hash table into a
more general flow table that can track other protocols as well.  Each
flow uniformly keeps track of all the relevant addresses and ports,
which will allow for more robust control of NAT and port forwarding.

ICMP is converted to use the new flow table.

Caveats:
 * We significantly increase the size of a connection/flow entry
   - Can probably be mitigated, but I haven't investigated much yet
 * We perform a number of extra getsockname() calls to know some of
   the socket endpoints
    - Haven't yet measured how much performance impact that has
    - Can be mitigated in at least some cases, but again, haven't
      tried yet
 * UDP is not converted yet

Changes since v2:
 * Cosmetic fixes based on review
 * Extra doc comments for enum flow_type
 * Rename flowside to flowaddrs which turns out to make more sense in
   light of future changes
 * Fix bug where the socket flowaddrs for tap initiated connections
   wasn't initialised to match the socket address we were using in the
   case of map-gw NAT
 * New flowaddrs_from_sock() helper used in most cases which is cleaner
   and should avoid bugs like the above
 * Using newer centralised workarounds for clang-tidy issue 58992
 * Remove duplicate definition of FLOW_MAX as maximum flow type and
   maximum number of tracked flows
 * Rebased on newer versions of preliminary work (ICMP, flow based
   dispatch and allocation, bind/address cleanups)
 * Unified hash table as well as base flow table
 * Integrated ICMP

Changes since v1:
 * Terminology changes
   - "Endpoint" address/port instead of "correspondent" address/port
   - "flowside" instead of "demiflow"
 * Actually move the connection table to a new flow table structure in
   new files
 * Significant rearrangement of earlier patchs on top of that new
   table, to reduce churn

David Gibson (15):
  flow: Common data structures for tracking flow addresses
  tcp, flow: Maintain guest side flow information
  tcp, flow: Maintain host side flow information
  tcp_splice,flow: Maintain flow information for spliced connections
  flow, tcp, tcp_splice: Uniform debug helpers for new flows
  tcp, flow: Replace TCP specific hash function with general flow hash
  flow: Add helper to determine a flow's protocol
  flow, tcp: Generalise TCP hash table to general flow hash table
  tcp: Re-use flow hash for initial sequence number generation
  icmp: Store ping socket information in the flow table
  icmp: Populate guest side information for ping flows
  icmp: Populate and use host side flow information
  icmp: Use 'flowside' epoll references for ping sockets
  icmp: Merge EPOLL_TYPE_ICMP and EPOLL_TYPE_ICMPV6
  icmp: Eliminate icmp_id_map

 Makefile     |   6 +-
 flow.c       | 260 ++++++++++++++++++++++++++++++++++++++++++
 flow.h       | 104 +++++++++++++++++
 flow_table.h |   2 +
 icmp.c       | 211 +++++++++++++++++++---------------
 icmp.h       |  15 +--
 icmp_flow.h  |  31 +++++
 passt.c      |  15 +--
 passt.h      |   9 +-
 tap.c        |  11 --
 tap.h        |   1 -
 tcp.c        | 313 +++++++++++++++------------------------------------
 tcp_conn.h   |   9 --
 tcp_splice.c |  63 ++++++++---
 tcp_splice.h |   3 +-
 util.c       |   4 +-
 util.h       |  18 +++
 17 files changed, 683 insertions(+), 392 deletions(-)
 create mode 100644 icmp_flow.h

-- 
2.43.0


^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2024-01-19  0:26 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-21  7:02 [PATCH v3 00/15] RFC: Unified flow table David Gibson
2023-12-21  7:02 ` [PATCH v3 01/15] flow: Common data structures for tracking flow addresses David Gibson
2024-01-13 22:50   ` Stefano Brivio
2024-01-16  6:14     ` David Gibson
2023-12-21  7:02 ` [PATCH v3 02/15] tcp, flow: Maintain guest side flow information David Gibson
2024-01-13 22:51   ` Stefano Brivio
2024-01-16  6:23     ` David Gibson
2023-12-21  7:02 ` [PATCH v3 03/15] tcp, flow: Maintain host " David Gibson
2023-12-21  7:02 ` [PATCH v3 04/15] tcp_splice,flow: Maintain flow information for spliced connections David Gibson
2024-01-17 19:59   ` Stefano Brivio
2024-01-18  1:01     ` David Gibson
2023-12-21  7:02 ` [PATCH v3 05/15] flow, tcp, tcp_splice: Uniform debug helpers for new flows David Gibson
2024-01-17 19:59   ` Stefano Brivio
2024-01-18  1:04     ` David Gibson
2024-01-18 15:40       ` Stefano Brivio
2023-12-21  7:02 ` [PATCH v3 06/15] tcp, flow: Replace TCP specific hash function with general flow hash David Gibson
2024-01-17 19:59   ` Stefano Brivio
2024-01-18  1:15     ` David Gibson
2024-01-18 15:42       ` Stefano Brivio
2024-01-18 23:55         ` David Gibson
2023-12-21  7:02 ` [PATCH v3 07/15] flow: Add helper to determine a flow's protocol David Gibson
2023-12-21  7:02 ` [PATCH v3 08/15] flow, tcp: Generalise TCP hash table to general flow hash table David Gibson
2023-12-21  7:02 ` [PATCH v3 09/15] tcp: Re-use flow hash for initial sequence number generation David Gibson
2023-12-21  7:02 ` [PATCH v3 10/15] icmp: Store ping socket information in the flow table David Gibson
2023-12-21  7:02 ` [PATCH v3 11/15] icmp: Populate guest side information for ping flows David Gibson
2023-12-21  7:02 ` [PATCH v3 12/15] icmp: Populate and use host side flow information David Gibson
2024-01-17 19:59   ` Stefano Brivio
2024-01-18  1:22     ` David Gibson
2024-01-18 15:43       ` Stefano Brivio
2024-01-18 23:58         ` David Gibson
2023-12-21  7:02 ` [PATCH v3 13/15] icmp: Use 'flowside' epoll references for ping sockets David Gibson
2023-12-21  7:02 ` [PATCH v3 14/15] icmp: Merge EPOLL_TYPE_ICMP and EPOLL_TYPE_ICMPV6 David Gibson
2023-12-21  7:02 ` [PATCH v3 15/15] icmp: Eliminate icmp_id_map David Gibson

Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).