Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp314750ybt; Wed, 17 Jun 2020 01:26:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNBzlBeK2NKEomC12TaZdZiheIdF9qBYKAo6MI9eCcxAVeb9vzRwBmpfFbJ7YlPnQ57cav X-Received: by 2002:aa7:d4c5:: with SMTP id t5mr6021140edr.357.1592382409664; Wed, 17 Jun 2020 01:26:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592382409; cv=none; d=google.com; s=arc-20160816; b=QZfF9Y6vCmgzAENzskktQo47BLO9P9yqaX/QJybbpBKIjsrNnavRdQgfWcr9HfQEZ0 FNP5ZGG6Gz8QsJTzcSniJzfLZBjuGUIYzhvy4u1e+9ZlmK25ysq4tAqYBG8c4cWlEtSV hMFeR3j4E2p4YBXPvSMTL7lX8e3mXNQf3K4clTJmUHIbBbJ8LBXlUobIqG42XpgPDdmt ArF8/ZVpBibpasDNRDgQchkGH0lV0zFm5Yl17cIRiavpvrLsVd2lQnU+VDblEn5gQgEp yU6eV741A/a9cr+fm3Kbl6B38hLS/zWTSVV6bHs/5O8IBDG6tWMNpJB6g81g8aBhTr0I qLxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=VJ/NRH+QmbQ7xXGqJiL5ePg9uJTpuwFMgQd2vOtCWdw=; b=JYRV9XJk5uxRMPX60KZKbdunmDgiFWKadRiwlSqwFEjXoclWoATIRXpYL4ZAGPMYXc GR/wKRxcfCk1UrasM0HDJ4X/e1KyGtcqxVvhhd2IsCHBHSw+v0p7rHVFInQG1LPUSVXK 3Hhie42OhP5OgDtMEhNXLCwN3DmeKCLdUC2F69GimbqiOFhlpAAUp6Ik1fQwh6y44tvR DyVNENmiHoTwZ5Cm7u45ApHHvUnj1QS4aWZtVRB5080Yc6bzL0sUKiNx2OpatWrpZmml RyLnulnFwv3l9KVPfxRXjM2MtGz0m774zOC80r3v0g1APYWmmaG70qJl94AL4Bn0jnlZ Bihw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@silvair-com.20150623.gappssmtp.com header.s=20150623 header.b=tjvVoOLH; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m21si12017614eds.234.2020.06.17.01.26.19; Wed, 17 Jun 2020 01:26:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@silvair-com.20150623.gappssmtp.com header.s=20150623 header.b=tjvVoOLH; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725894AbgFQIYK (ORCPT + 99 others); Wed, 17 Jun 2020 04:24:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725846AbgFQIYK (ORCPT ); Wed, 17 Jun 2020 04:24:10 -0400 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B403C061573 for ; Wed, 17 Jun 2020 01:24:08 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id s1so1828823ljo.0 for ; Wed, 17 Jun 2020 01:24:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silvair-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=VJ/NRH+QmbQ7xXGqJiL5ePg9uJTpuwFMgQd2vOtCWdw=; b=tjvVoOLHuxkT5Aq2HBtFJGoDdbkjzEGmwdXWidfKCb3rMhak1N+7Nu6vaokPv9zzOu bdxW/qvBcVYIY1npQc9Z7bVaFHgZ7/sEHAkLd3meNJaA21uJWAz3E4WBfymZDljX0b2k sKsYvEiMV8i3Ed52kcCfJTto8R/p9CXlPtxJ+NvMBWAIYLuEkc8xlnmjfx+BVuE5zNUU 4K2LwKCWcmJZbovAPgcWCU5BBiJ1KPjkKxC551bV7c4/k8HVsAllcYJ5gL1qB00d/bZg UIeK9lFzme2b74D8xISFvaBg24GoQY0ptvILD7JHa0VVmXy0Ux7AzGy7tJxf3NxcGknU na5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=VJ/NRH+QmbQ7xXGqJiL5ePg9uJTpuwFMgQd2vOtCWdw=; b=j69I46UXWQcCXecENoCRNe5VEIofb9KUb8EkKYHZTH4PGzthhb6B5DAiMv0SQ2H2fn N1gOHTU87xQDPXM7OH1w26+n6I0WqO8VLlM84r5gMft8KHlDKwGtJ3p2cj3olo1Ro0qN 2we1pAHJpDX9hxtWzH50bYKGnI9WVTes9ReVnrKlOrHsPRE+C9aDihBtJle5EwWKGCe4 gqT5xyb24IPQXHG8mIdEaWblOgTQpCp+qQHgPcbQS5LvpfcsM0/fhfL0wjCBUrNg37MM vibKtr6WqewV4YKo/rHfi/uWyss0DdCEPTPVUe0elRgP8tdszjGmv9hBq1mEexGNcDY5 uqRg== X-Gm-Message-State: AOAM531xN+6N1pMb2fbMoSPCZM9uldk2GWt9ipRPgQU3tW74VOsBUaok FHQ1r8TTQz+EMMsfCJji9+pH8tJ1PwftnA== X-Received: by 2002:a2e:b5a3:: with SMTP id f3mr3184259ljn.361.1592382246919; Wed, 17 Jun 2020 01:24:06 -0700 (PDT) Received: from mlowasrzechonek2133 ([217.153.94.18]) by smtp.gmail.com with ESMTPSA id p15sm4862640ljn.53.2020.06.17.01.24.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 01:24:06 -0700 (PDT) Date: Wed, 17 Jun 2020 10:24:30 +0200 From: "michal.lowas-rzechonek@silvair.com" To: "Gix, Brian" Cc: "linux-bluetooth@vger.kernel.org" , "Stotland, Inga" , "przemyslaw.fierek@silvair.com" Subject: Re: [RFC BlueZ 0/2] mesh: Deliver mesh packets over datagram socket Message-ID: <20200617082430.hezshwckqtxq73bc@mlowasrzechonek2133> Mail-Followup-To: "Gix, Brian" , "linux-bluetooth@vger.kernel.org" , "Stotland, Inga" , "przemyslaw.fierek@silvair.com" References: <20200616122745.25056-1-michal.lowas-rzechonek@silvair.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Brian, On 06/16, Gix, Brian wrote: > This has the feeling of something that has been developed as the > result of a stress test to see how much data can be pushed through > the system as fast as possible, which should not be a common mesh use > case. Well, not really. We came up with this mechanism because of performance issues with *real world* networks on embedded platforms. And by "real world" I mean a single network of 200+ nodes. We need a way to monitor the nodes in such networks, and potentially much bigger ones too - mesh addess space is 32k+ nodes, and we already have runnin installations with ~1k nodes, all of which are publishing sensor data. Without this, bluetooth-meshd is *unusable*. > I also worry about the increase in system socket resorces... > Currently the daemon consumes 1 socket for App <--> daemon > communication (the one to the dbus daemon), and each App currently > being supported uses one more (again, to dbus daemon) And all > MUXing, marshaling and unmarshaling of messages is handled by > DBUS... the very reason for it's existance. While creating a > new socket between App and daemon would make the messages flow > faster, it comes at the cost of re-inventing MUXing, marshaling, > unmarshaling plus all the additional sockets. A larger code > footprint, and a *much* larger resource footprint. As you can see in the patch, serialization format is very simple (*much* simpler than D-Bus marshalling). As for MUXing, I don't really understand what you mean? A node can have only one application attached to it, so the daemon knows exactly which socket to use. Same for the application. About file descriptors: this patch targets primarily an embedded platform. While I've seen issues with number of open files on busy network servers, I don't think an IoT device is going to face such problems. As for the "resource footprint", it's a tradeoff between open files vs. CPU. By using D-Bus calls to deliver network packets, you need to: - copy the packet from the mesh daemon to dbus daemon - have the daemon look up the application by D-Bus address - have the daemon deserialize the message header and check permissions - copy the packet from dbus daemon to application This requires an additional copy and an additional context switch, and a potentially costly permission check (I've mentioned AppArmor in the previous mail). So this delivery method in fact consumes *more* resources. > This just feels to me like the kind of customization that is fine > for a vendor to do for a specialized high-flow mesh, but not > something that we want to impose on everyone who uses Mesh in the > open source community. I don't want to "impose" anything... the API is entirely optional and the "regular" Attach() works as it used to, and might be perfectly fine for simpler applications. Note that GATT API does the same thing wrt. AquireNotify() call. -- Michał Lowas-Rzechonek Silvair http://silvair.com Jasnogórska 44, 31-358 Krakow, POLAND