From owner-freebsd-net@freebsd.org Tue Aug 18 17:18:03 2020 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B390C3C1D49 for ; Tue, 18 Aug 2020 17:18:03 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BWHfy2cGpz4NV8 for ; Tue, 18 Aug 2020 17:18:02 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-ej1-x62e.google.com with SMTP id bo3so22959728ejb.11 for ; Tue, 18 Aug 2020 10:18:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=YzWZ73X+CajokrsfKNHVHGJavszrOmLtRBbvDYQsZ94=; b=VwSoPP6lUFChM8qXrwVdzTLl+iAgXJbMgvRXNFjjYbHi+Wag1+DSEZjiRFD/rJHjhT p2Mn+3cYL1fWpuEFeKZi3wX9m5G3oeyGGd5LTyADjIiMdzGB5Adqs4S6QotSREFBiq1k gg/T05jv481cecoxaZokh4EPjGUrv1SQikOr4xxfJtiuJHWx5AcWi5aBuP62QL84gmvM yRVDBZy/ZeNsinN9sWcV9+JmBTIrERHRfy2rS3Zdmwh4oZHr9XssKfhGbSGp+S9bjdrf KlT469wjR5I2A75Dwnj+j9S4b8GOIMl5wXTAPi4w2KzW0lEIvxQnAGgU/OCqufb5YMeB qYIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=YzWZ73X+CajokrsfKNHVHGJavszrOmLtRBbvDYQsZ94=; b=fTtYsmXLn7yMFY1+e9OPKC67HRVM/4Vc4EAyT0YGqhU4OuqJTBKQDQSJCXYqcP2KJt Rs90AkjhR5IJ7JlQQNfY6G3HadR5IBt5fL2vxqa1r/5waFikhL+LI0z3NaQUOn6VGhOv 5wUmRJ0tnCoEF73WLhJ0N9ZK9Zl8/U3I1JUtTaDcSPYazFJsVNy9aJkdjXiX0SAsZ3oF 3F28oczc8hxB8Putr0OoOmpGN8uJc6w1i9T894eQ4JIPNZLDMfuqds26fHHkItheCeKq 0bpSWgZ/vefzSpBAOGsHO6Tu83Okx9qsZhL83Qw9srs0m8NUzwazKkPDCUIW0sUZzgvp svcQ== X-Gm-Message-State: AOAM530cjKiUT1t17nFkkDglthGm8mj7evJGDQzYfFnJfpMVjHfphhrT Otzf6rp75sHddT0tqIuBy6Cym6K8QeQy2KdlKoIsOsGmK5A= X-Google-Smtp-Source: ABdhPJxCHrPFffIiDTqKIk2SMYaHxcMaQbGYxf3W1buibqFAo3LPbwYEX6aqh48pF1Wx5QFSWzsaFVQZoDhw0Qfz2B4= X-Received: by 2002:a17:906:a182:: with SMTP id s2mr20583804ejy.526.1597771079460; Tue, 18 Aug 2020 10:17:59 -0700 (PDT) MIME-Version: 1.0 From: Ryan Stone Date: Tue, 18 Aug 2020 13:17:48 -0400 Message-ID: Subject: Is anybody using ng_pipe? To: freebsd-net Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4BWHfy2cGpz4NV8 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=VwSoPP6l; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of rysto32@gmail.com designates 2a00:1450:4864:20::62e as permitted sender) smtp.mailfrom=rysto32@gmail.com X-Spamd-Result: default: False [-0.17 / 15.00]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-net@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::62e:from]; NEURAL_HAM_SHORT(-0.17)[-0.174]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; SUBJECT_ENDS_QUESTION(1.00)[]; MAILMAN_DEST(0.00)[freebsd-net]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Aug 2020 17:18:03 -0000 I recently needed to be able to simulate a lossy, high-latency network in an environment where dummynet wasn't possible. I gave ng_pipe a try, and hit some major issues 1. Instead of configuring a packet drop rate, you configure a bit error rate, which I found significantly less intuitive 2. The use of BER makes for a very inconvenient implementation, as ng_pipe has to maintain a table of packet drop rates for every possible packet size 3. The table implementation isn't sized right for LRO or TSO, leading to ng_pipe going out of bounds of the array and panicking the system 4. The table calculation had two integer truncation bugs and used the wrong formula. I'm reasonably sure it would never calculate a probability other than 0 due a 64-bit constant being truncated to 32-bits. I'd like to dump all of this and just implement a packet loss rate, which would simplify all this immensely. Is anybody using ng_pipe with a non-zero BER who would object to this? Given this litany of issues I doubt it, but I thought that I'd be sure.