From owner-freebsd-hackers@freebsd.org Sun Aug 16 09:11:19 2020 Return-Path: Delivered-To: freebsd-hackers@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 485063B5DB1; Sun, 16 Aug 2020 09:11:19 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [77.88.28.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BTryF1JHhz45K0; Sun, 16 Aug 2020 09:11:16 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from mxback5o.mail.yandex.net (mxback5o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1f]) by forward100p.mail.yandex.net (Yandex) with ESMTP id 60F0E5980AA0; Sun, 16 Aug 2020 12:11:13 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback5o.mail.yandex.net (mxback/Yandex) with ESMTP id vVkjuFWMb4-BC1CTeWA; Sun, 16 Aug 2020 12:11:12 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfw.ru; s=mail; t=1597569072; bh=o/z/5CHexTyLBP4oABBLEnXWERyC9STzRW0zzwHcgoY=; h=Message-Id:Date:Subject:To:From; b=oisyVs954X7jSXpIWaHdLhWtTIqbQ7gZGCdGF2b2eEWFxejrGHUkKP8Dgqj6Rf+UN LO0cAA0MYyMZ9DIj4WVZ83E0JdrHziwWA0gVqYBpuAk47JAHbfjRhG8cWVFUrUVnGJ 6+mccpGwa7/RZKN8/iQmPxxLi94QTb9N4wa3vqmM= Received: by sas1-6059effbd848.qloud-c.yandex.net with HTTP; Sun, 16 Aug 2020 12:11:11 +0300 From: Alexander V. Chernikov To: net , freebsd-hackers Subject: ip(8) in base MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sun, 16 Aug 2020 10:11:11 +0100 Message-Id: <1634721597568903@mail.yandex.ru> Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1597569078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding:dkim-signature; bh=o/z/5CHexTyLBP4oABBLEnXWERyC9STzRW0zzwHcgoY=; b=Yhnu03SG5DqUDkmnlBTl2GGbx0PDFfxtPyBEndJ+OxK7bv4qm01D6RirMveSdW7GNHJZMU MvTY3AuTmv9TmcaZz4Zfh0cYhiU4Tv8XEwRxSd72XQj5HSuE28WUltKfV76iiwbJwsDAjQ QS7LVKN5LKZT7bJUkvfKMpZfM12UFNMYxjBpVOWcsoJ77G5wcjIpgwUjtBgxlEWONPf+H+ zyO7ZmWeh66ZcaQoR+V199iJ1N8UGZbOy6vdkanXOA+bj092sC2JiZxf9NlEV9hePXDcuU VRgr/ZwGmMNxnJT+9MP8SUH/9rvMmPNMkVJY5OciBTWkja5pAeHzUP5dSkh2vQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1597569078; a=rsa-sha256; cv=none; b=nOAf8wJw1HF7O2T+KIl5SBnRuvZEGbV1JmkT+fXmfmM/1ozzxuEGqqp4LB3WQQ2QRTZYhH 8xiU+YYnkxqZb7WVT1CCoDuB6oIaMflVZ2R5sVg263TdAKAoyOIhzKXcIM6phHs3JyMAwp hQ1Sv1kfCGrnaa9DGM8lEMpSACpApisdzK5ZfG6p+Sz04NOVEvzc4rnKgj0ED+p0saczl4 M34ocPnPW4HhJXVkaw5CiKd7p8v4tPcWOG65bpUjQ2wOQryZHNXoI4Pa1dbD7ewwsaeAjS ffh3cSUpwmNIK5k0icSCHtYR9qn+TVe/Eqmhh1VK9wmsYYcsGQ3aiQC18zvkZA== ARC-Authentication-Results: i=1; mxback5o.mail.yandex.net; dkim=pass header.i=@ipfw.ru X-Rspamd-Queue-Id: 4BTryF1JHhz45K0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=ipfw.ru header.s=mail header.b=oisyVs95; dmarc=none; spf=pass (mx1.freebsd.org: domain of melifaro@ipfw.ru designates 77.88.28.100 as permitted sender) smtp.mailfrom=melifaro@ipfw.ru X-Spamd-Result: default: False [-2.93 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.07)[-1.073]; R_DKIM_ALLOW(-0.20)[ipfw.ru:s=mail]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:77.88.0.0/18]; MIME_GOOD(-0.10)[text/plain]; ARC_SIGNED(0.00)[i=1]; DMARC_NA(0.00)[ipfw.ru]; NEURAL_HAM_LONG(-0.99)[-0.995]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[ipfw.ru:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[77.88.28.100:from]; NEURAL_HAM_SHORT(-0.36)[-0.362]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13238, ipnet:77.88.0.0/18, country:RU]; RWL_MAILSPIKE_POSSIBLE(0.00)[77.88.28.100:from] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2020 09:11:19 -0000 I want to introduce ip(8) or something similar in base. Basically, I need some userland tool to explicitly operates on nexthops, nexthop groups and fib lookup algorithms. The existing tools are not well suited for the job: route(8) may be a candidate, but (a) it would either add another bunch of options or drastically change the tool by introducing [route nhop add], [route nhgroup add] and (b) listing is traditionally done by netstat(8). I feel like there is a need of some cli tool that provides the ability to easily extend it by having separate namespaces for each sub-command (hello, ifconfig). Naming is hard. I can, for example, use "rt" as a name to address my use cases. However, given the kernel interfaces for managing nexthops/nexhop groups are the same as with routes/arp/ndp, why not spending some additional time and support operating on routes and neighbors and name it ip? Though, that arises multiple questions. Are we comfortable with ip(8) as a name in general? If we are, what’s our take on having the compatible interface with Linux ip(8)? Any comments/feedback is welcome :-) Appendix List of commands I need implemented cmd [-46m] nhop create [gw XX] [iface YYY] [mtu YYY] [reject] [proxyfib Y] [fib X][ipv4] [ipv6] cmd [-46m] nhop delete nhop_id cmd -46m nhop list cmd -j nhop list # json cmd -46m nhgroup create nhops 1,2,3,4,5,6 [fib X] cmd -46 nhgroup create nhops 1=100,2=100,3=200,4=100 [proxyfib Y][fib X] cmd -46 nhroup list cmd -46 nhgroup delete nhgroup_id cmd -46 fib algo list cmd -46 fib algo set algo dpdk_lpm6 fib 0 cmd -46 fib algo set algo auto fib 0 /Alexander