2016-03-04 11:38:32

by Patrik Flykt

[permalink] [raw]
Subject: [RFC v3] doc: Add Management Interface Network API definitions

---
v3: added interface index to 'Network' block, removed Nework_Role parameter
and dropped text about LE being enabled.

doc/doc.txt | 0
doc/mgmt-api.txt | 142 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 142 insertions(+)
create mode 100644 doc/doc.txt

diff --git a/doc/doc.txt b/doc/doc.txt
new file mode 100644
index 0000000..e69de29
diff --git a/doc/mgmt-api.txt b/doc/mgmt-api.txt
index 731a088..6317255 100644
--- a/doc/mgmt-api.txt
+++ b/doc/mgmt-api.txt
@@ -2801,6 +2801,107 @@ Start Limited Discovery Command
Invalid Index


+Get Networks Command
+====================
+
+ Command Code: 0x0042
+ Controller Index: <controller id>
+ Command Parameters:
+ Return Parameters: Connection_Count (2 Octets)
+ Network1 {
+ Address (6 Octets)
+ Address_Type (1 Octet)
+ Interface Index (4 Octets)
+ }
+ Network2 { }
+ ...
+
+ This command is used to retrieve a list of BTLE network
+ connections. A pre-requisite is that LE is supported
+ by the controller, otherwise this command will return a
+ "not supported" response.
+
+ Possible values for the Address_Type parameter:
+ 0 Reserved
+ 1 LE Public
+ 2 LE Random
+
+ For devices using resolvable random addresses with a known
+ identity resolving key, the Address and Address_Type will
+ contain the identity information.
+
+ This command can only be used when the controller is powered.
+
+ This command generates a Command Complete event on success or
+ a Command Status event on failure.
+
+ Possible errors: Invalid Parameters
+ Not Supported
+ Invalid Index
+
+
+Add Network Command
+===================
+
+ Command Code: 0x0043
+ Controller Index: <controller id>
+ Command Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+ Return Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+ Interface Index (4 Octets)
+
+ This command is used to connect to establish a network connection
+ to a remote BTLE node. A pre-requisite is that LE is supported
+ by the controller, otherwise this command will return a
+ "not supported" response.
+
+ Possible values for the Address_Type parameter:
+ 0 Reserved
+ 1 LE Public
+ 2 LE Random
+
+ This command generates a Command Complete event on success
+ or failure.
+
+ Possible errors: Busy
+ Refused
+ Invalid Parameters
+ Not Supported
+ Invalid Index
+ Already Connected
+
+
+Remove Network Command
+======================
+
+ Command Code: 0x0044
+ Controller Index: <controller id>
+ Command Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+ Return Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+
+ This command is used to disconnect a network connection from a
+ remote BTLE node. A pre-requisite is that LE is supported
+ by the controller, otherwise this command will return a
+ "not supported" response.
+
+ Possible values for the Address_Type parameter:
+ 0 Reserved
+ 1 LE Public
+ 2 LE Random
+
+ This command generates a Command Complete event on success
+ or failure.
+
+ Possible errors: Busy
+ Not Connected
+ Invalid Parameters
+ Not Supported
+ Invalid Index
+
+
Command Complete Event
======================

@@ -3645,3 +3746,44 @@ Advertising Removed Event

The event will only be sent to management sockets other than the
one through which the command was sent.
+
+
+Network Added Event
+===================
+
+ Event Code: 0x0025
+ Controller Index: <controller id>
+ Event Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+ Interface Index (4 Octets)
+
+ This event indicates that a network connection to a remote
+ BTLE node has been established successfully.
+
+ Possible values for the Address_Type parameter:
+ 1 LE Public
+ 2 LE Random
+
+ For devices using resolvable random addresses with a known
+ identity resolving key, the Address and Address_Type will
+ contain the identity information.
+
+
+Network Removed Event
+=====================
+
+ Event Code: 0x0026
+ Controller Index: <controller id>
+ Event Parameters: Address (6 Octets)
+ Address_Type (1 Octet)
+
+ This event indicates that the BTLE network connection to a remote
+ node has been lost.
+
+ Possible values for the Address_Type parameter:
+ 1 LE Public
+ 2 LE Random
+
+ For devices using resolvable random addresses with a known
+ identity resolving key, the Address and Address_Type will
+ contain the identity information.
--
2.1.4



2016-03-04 17:27:17

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [RFC v3] doc: Add Management Interface Network API definitions

Hi Patrik,

> ---
> v3: added interface index to 'Network' block, removed Nework_Role parameter
> and dropped text about LE being enabled.
>
> doc/doc.txt | 0
> doc/mgmt-api.txt | 142 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 142 insertions(+)
> create mode 100644 doc/doc.txt
>
> diff --git a/doc/doc.txt b/doc/doc.txt
> new file mode 100644
> index 0000000..e69de29
> diff --git a/doc/mgmt-api.txt b/doc/mgmt-api.txt
> index 731a088..6317255 100644
> --- a/doc/mgmt-api.txt
> +++ b/doc/mgmt-api.txt
> @@ -2801,6 +2801,107 @@ Start Limited Discovery Command
> Invalid Index
>
>
> +Get Networks Command
> +====================
> +
> + Command Code: 0x0042
> + Controller Index: <controller id>
> + Command Parameters:
> + Return Parameters: Connection_Count (2 Octets)
> + Network1 {
> + Address (6 Octets)
> + Address_Type (1 Octet)
> + Interface Index (4 Octets)
> + }
> + Network2 { }
> + ...
> +
> + This command is used to retrieve a list of BTLE network
> + connections. A pre-requisite is that LE is supported
> + by the controller, otherwise this command will return a
> + "not supported" response.
> +
> + Possible values for the Address_Type parameter:
> + 0 Reserved
> + 1 LE Public
> + 2 LE Random
> +
> + For devices using resolvable random addresses with a known
> + identity resolving key, the Address and Address_Type will
> + contain the identity information.
> +
> + This command can only be used when the controller is powered.
> +
> + This command generates a Command Complete event on success or
> + a Command Status event on failure.
> +
> + Possible errors: Invalid Parameters
> + Not Supported
> + Invalid Index
> +
> +
> +Add Network Command
> +===================
> +
> + Command Code: 0x0043
> + Controller Index: <controller id>
> + Command Parameters: Address (6 Octets)
> + Address_Type (1 Octet)
> + Return Parameters: Address (6 Octets)
> + Address_Type (1 Octet)
> + Interface Index (4 Octets)

actually we have a bit of an issue here. So my understanding is that this command does not necessarily connects right away. If it is similar to Add Device, then you add your remote device here and at some point in the future if the device is found, it might get connected. If it gets connected it will also establish IPSP or BNEP.

So first of all, we are operating under the assumption that Add Network does not really do any trigger of scanning or advertising. We let that one be handled by Add Device and Add Advertising. This is just for the network side of things to decide if we establish the network layer.

The second problem here is really if the above is what we want, that the Interface Index will not be available at this point in time. Yes, for IPSP we can just create it at this point and have it available in the system, but for BNEP this is not going to work. That interface is only available once you actually connected. Unless we also want to change that and create the BNEP interface ahead of time and mark it has LOWER_DOWN (meaning no link).

In any case, we should keep a Type or Mode parameter here to select between IPSP and BNEP. Even while currently they are clearly limited to the address type, but in theory, there is nothing stopping us to run IPSP over BR/EDR or a new future IPv6 / 6LoWPAN solution coming up that might be connection-less.

And no matter what we should have a note here that mentions Add Device and Add Advertising to be used to handle the connection parts of the establishment.

Regards

Marcel


2016-11-02 17:06:43

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [RFC v3] doc: Add Management Interface Network API definitions

Hi Marcel,

On Fri, Mar 4, 2016 at 7:27 PM, Marcel Holtmann <[email protected]> wrote=
:
> Hi Patrik,
>
>> ---
>> v3: added interface index to 'Network' block, removed Nework_Role parame=
ter
>> and dropped text about LE being enabled.
>>
>> doc/doc.txt | 0
>> doc/mgmt-api.txt | 142 +++++++++++++++++++++++++++++++++++++++++++++++++=
++++++
>> 2 files changed, 142 insertions(+)
>> create mode 100644 doc/doc.txt
>>
>> diff --git a/doc/doc.txt b/doc/doc.txt
>> new file mode 100644
>> index 0000000..e69de29
>> diff --git a/doc/mgmt-api.txt b/doc/mgmt-api.txt
>> index 731a088..6317255 100644
>> --- a/doc/mgmt-api.txt
>> +++ b/doc/mgmt-api.txt
>> @@ -2801,6 +2801,107 @@ Start Limited Discovery Command
>> Invalid Index
>>
>>
>> +Get Networks Command
>> +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>> +
>> + Command Code: 0x0042
>> + Controller Index: <controller id>
>> + Command Parameters:
>> + Return Parameters: Connection_Count (2 Octets)
>> + Network1 {
>> + Address (6 Octets)
>> + Address_Type (1 Octet)
>> + Interface Index (4 Octets)
>> + }
>> + Network2 { }
>> + ...
>> +
>> + This command is used to retrieve a list of BTLE network
>> + connections. A pre-requisite is that LE is supported
>> + by the controller, otherwise this command will return a
>> + "not supported" response.
>> +
>> + Possible values for the Address_Type parameter:
>> + 0 Reserved
>> + 1 LE Public
>> + 2 LE Random
>> +
>> + For devices using resolvable random addresses with a known
>> + identity resolving key, the Address and Address_Type will
>> + contain the identity information.
>> +
>> + This command can only be used when the controller is powered.
>> +
>> + This command generates a Command Complete event on success or
>> + a Command Status event on failure.
>> +
>> + Possible errors: Invalid Parameters
>> + Not Supported
>> + Invalid Index
>> +
>> +
>> +Add Network Command
>> +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>> +
>> + Command Code: 0x0043
>> + Controller Index: <controller id>
>> + Command Parameters: Address (6 Octets)
>> + Address_Type (1 Octet)
>> + Return Parameters: Address (6 Octets)
>> + Address_Type (1 Octet)
>> + Interface Index (4 Octets)
>
> actually we have a bit of an issue here. So my understanding is that this=
command does not necessarily connects right away. If it is similar to Add =
Device, then you add your remote device here and at some point in the futur=
e if the device is found, it might get connected. If it gets connected it w=
ill also establish IPSP or BNEP.
>
> So first of all, we are operating under the assumption that Add Network d=
oes not really do any trigger of scanning or advertising. We let that one b=
e handled by Add Device and Add Advertising. This is just for the network s=
ide of things to decide if we establish the network layer.
>
> The second problem here is really if the above is what we want, that the =
Interface Index will not be available at this point in time. Yes, for IPSP =
we can just create it at this point and have it available in the system, bu=
t for BNEP this is not going to work. That interface is only available once=
you actually connected. Unless we also want to change that and create the =
BNEP interface ahead of time and mark it has LOWER_DOWN (meaning no link).
>
> In any case, we should keep a Type or Mode parameter here to select betwe=
en IPSP and BNEP. Even while currently they are clearly limited to the addr=
ess type, but in theory, there is nothing stopping us to run IPSP over BR/E=
DR or a new future IPv6 / 6LoWPAN solution coming up that might be connecti=
on-less.
>
> And no matter what we should have a note here that mentions Add Device an=
d Add Advertising to be used to handle the connection parts of the establis=
hment.

Another thing to consider here is that IPSP actually mention that
security level 2 and 3 (and I guess fips as well although not
mentioned) may be used depending on the use case, but the 6lowpan only
does level 1 which might actually not be what we want by default, so
Id consider adding a MGMT command to tell when to enable the L2CAP
channel and what security level it shall use. Also maybe this could be
applied to router if we want to force a certain security level then
Add Network perhaps should the security level as input.


--=20
Luiz Augusto von Dentz