From owner-freebsd-hackers@freebsd.org Sun Aug 16 16:38:59 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 0A68D3C08EE; Sun, 16 Aug 2020 16:38:59 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BV2tn5lp4z4XnH; Sun, 16 Aug 2020 16:38:57 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 07GGcmDr056885; Sun, 16 Aug 2020 09:38:48 -0700 (PDT) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: (from freebsd-rwg@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 07GGclX4056884; Sun, 16 Aug 2020 09:38:47 -0700 (PDT) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <202008161638.07GGclX4056884@gndrsh.dnsmgr.net> Subject: Re: ip(8) in base In-Reply-To: <202008161505.07GF5MMU054548@mail.karels.net> To: mike@karels.net Date: Sun, 16 Aug 2020 09:38:47 -0700 (PDT) CC: "Alexander V. Chernikov" , net , freebsd-hackers X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1597595938; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to; bh=Qve2p6dLbjM6S+nWEf+TbIblFLrrZTr5QIO+eKfZHyw=; b=rVeWSL0hX16fjr0P31GhrZDEzzsr0Dvkh9vccoiNOBK1RO0+HBcG8yH9Qq8LC55fnZC8PO 2EaMOnJSw/1fLpWfF5tIH45QsskMyCl87PYbmdkItL8Z5XhbFDqKPgY6+YOr8cGaWrASP6 8PJDvvzjSdI0FJGyxigT8oyemJIm1JAwcC+3nqLOGYw5ctA4kAagXezxgkg4chZJWyzxT9 9TcH3BBtV0e1YwGYtzcEeuE8WW8XMwaruP2/oN5HIYUebANzD6ud4vDSxnS8xmuX6VkdHE a8luVR+8gZWkvFz9O2yzS2oAgSSPpEMFq2udINOW7P28pugR4X95HMls1+9SZA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1597595938; a=rsa-sha256; cv=none; b=oU4Fu6H6fmGfdwUQBQJdL8aPNihm24TqhE+NLmMMOiAKmuMcdWl7T2KwpDz5OugjVkuvTH qGDt3SS//0N3KDip/eLNW7e32QMfiiRBI6NY2eN1Ahzgh+p+ceweFsmwqqkXnlvMh+ulNI rS+ACRwv70FSn9BDGj5Pz/Di7kRTXSMtfhhDi4A6GVw/Gf9wNgeel3IOPhDTBZV/s9LKal Hhbc/PUPA4sFTyBKBUHLvYynPZq//dTwKlxIYbgMcHFgeOLf+9OITnaalVWLhmVOTB0vLS lEV2ayUz+xpodsrvc5JZYcyeoSJqcqal3nmk89WlFVapyUuYLQ7Qkw7A0NPCyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of freebsd-rwg@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd-rwg@gndrsh.dnsmgr.net X-Rspamd-Queue-Id: 4BV2tn5lp4z4XnH X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd-rwg@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd-rwg@gndrsh.dnsmgr.net X-Spamd-Result: default: False [0.04 / 15.00]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.52)[-0.523]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.15)[-0.151]; MIME_GOOD(-0.10)[text/plain]; ARC_SIGNED(0.00)[i=1]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.18)[-0.182]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; RCVD_COUNT_TWO(0.00)[2]; MID_RHS_MATCH_FROM(0.00)[] 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 16:38:59 -0000 > > From: "Alexander V. Chernikov" > > To: net , freebsd-hackers > > Subject: ip(8) in base > > Date: Sun, 16 Aug 2020 10:11:11 +0100 > > > 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 agree with the others who said not to use ip(8) if the tool is not > compatible with the Linux ip. Also, routing is (at least in theory) > independent of address family, and that makes the name "ip" too specific. I strongly agree with this. > However, I think that route and netstat are sufficiently extensible to > add additional facilities, as they have been so far. One suggestion, > though, would be to preserve the general strategy of using "route verb ...", > e.g. "route add nhop ..." rather than "route nhop add ...". These seem > sufficiently similar to existing functionality to share a tool. Again, I agree with the above statement by Mike. The proposed commands are all in support of "route" features, and in BSD it is the route command that is used to maniplate these, please do not deviate from that. I have seen no strong reason given that route(8) and netstat(1) can not be extended to add the desired functionality. > Similarly, if possible I would prefer to see --libxo json rather than -j. I have no skin in this one, other than to state that iirc the route(8) command is currently without any long options so adding this --libxo would require adding long option support, which is probably not justifiable for 1 option. > Mike > > > 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 What is special about these nhop routes that this is not just a route add? Could that not be handled as either a route flag ala -iface/-static/-reject/-blackhole or via a route modifier ala -osi/-xns/-inet/-inet6? I am actually a bit confused in that all routes are really just an expression of the "next hop" as far as the kernel goes, or are we now doing lsdb type routing in the kernel? > > > 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 ^ nhgroup? > > 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 -- Rod Grimes rgrimes@freebsd.org