All of lore.kernel.org
 help / color / mirror / Atom feed
* No device found for binding socket ieee802.15.4
@ 2016-03-28 15:46 Adika Bintang Sulaeman
  2016-03-29  8:37 ` Alexander Aring
  0 siblings, 1 reply; 10+ messages in thread
From: Adika Bintang Sulaeman @ 2016-03-28 15:46 UTC (permalink / raw)
  To: linux-wpan

Dear all linux-wpan developers and users,

This is my first time exploring 6LoWPAN and I would like to ask you
some questions. Before getting into questions, these are the devices
and set up that I use:
-Raspberry Pi Model B Rev 2
-Raspbian OS
-kernel from bluetooth-next ver 4.5.0-rc5+
-MRF24J40MA Transceiver

After setting up and installing the wpan-tools, I got my interface
work by prompting "ip link show" and there is something like:

3: wpan0 <BROADCAST,NOARP> mtu 123 qdisc noop state DOWN mode DEFAULT
group default qlen 1000
        link/ieee802.15.4 ee:3b:07:84:64:8c:2a:71 brd ff:ff:ff:ff:ff:ff:ff

The first thing I notice strange is why after the command "sudo ip
link add link wpan0 name lowpan0 type lowpan" the output in "ip link
show" is a bit different, especially in link/[825]:

7: lowpan0 <BROADCAST,MULTICAST> mtu 1280 qdisc noop state DOWN mode
DEFAULT group default qlen 1
        link/[825] ee:3b:07:84:64:8c:2a:71 brd ff:ff:ff:ff:ff:ff:ff

So this is the FIRST QUESTION:
1. Is that normal/ok to have link/[825] instead of link/ieee802.15.4?

The second thing I notice strange is after "sudo ip link set wpan0 up"
for both wpan0 and lowpan0, the "ifconfig" command shows that these
network interfaces have "Link encap:UNSPEC". If I'm not mistaken, Link
encap shows the hardware family of the interface, right?

So the SECOND QUESTION is:
2. Is that normal/ok to have Link encap:UNSPEC? Because this thing
makes me suspicious about the next problem that I face.

I tried to run wpan-ping daemon from /wpan-tools/wpan-ping by
prompting "wpan-ping --daemon" but the output is "bind: No such
device". I tried to make my own code to make a server program which
listen to this socket interface. But when binding with bind(), I got
the same error status "No device found".

This leads to my THIRD QUESTION:
3. Why "no device found" appears? The transceiver is attached, the
hardware address exists, the interface is up, and I am able to ping
between two devices using ping6. I am suspicious that the problems
that I ask you before have caused this problem.

Do you know what's wrong here?

Thank you for your time and help

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: No device found for binding socket ieee802.15.4
  2016-03-28 15:46 No device found for binding socket ieee802.15.4 Adika Bintang Sulaeman
@ 2016-03-29  8:37 ` Alexander Aring
  2016-03-30  1:43   ` Adika Bintang Sulaeman
  0 siblings, 1 reply; 10+ messages in thread
From: Alexander Aring @ 2016-03-29  8:37 UTC (permalink / raw)
  To: Adika Bintang Sulaeman; +Cc: linux-wpan, stefan, jukka.rissanen

Hi,

On Mon, Mar 28, 2016 at 10:46:04PM +0700, Adika Bintang Sulaeman wrote:
> Dear all linux-wpan developers and users,
> 
> This is my first time exploring 6LoWPAN and I would like to ask you
> some questions. Before getting into questions, these are the devices
> and set up that I use:
> -Raspberry Pi Model B Rev 2
> -Raspbian OS
> -kernel from bluetooth-next ver 4.5.0-rc5+
> -MRF24J40MA Transceiver
> 
> After setting up and installing the wpan-tools, I got my interface
> work by prompting "ip link show" and there is something like:
> 
> 3: wpan0 <BROADCAST,NOARP> mtu 123 qdisc noop state DOWN mode DEFAULT
> group default qlen 1000
>         link/ieee802.15.4 ee:3b:07:84:64:8c:2a:71 brd ff:ff:ff:ff:ff:ff:ff
> 
> The first thing I notice strange is why after the command "sudo ip
> link add link wpan0 name lowpan0 type lowpan" the output in "ip link
> show" is a bit different, especially in link/[825]:
> 
> 7: lowpan0 <BROADCAST,MULTICAST> mtu 1280 qdisc noop state DOWN mode
> DEFAULT group default qlen 1
>         link/[825] ee:3b:07:84:64:8c:2a:71 brd ff:ff:ff:ff:ff:ff:ff
> 
> So this is the FIRST QUESTION:
> 1. Is that normal/ok to have link/[825] instead of link/ieee802.15.4?
> 

It's okay. lowpan0 != wpan0 these are different interfaces. It should be
link/6lowpan, but this interface type is just too new and iproute2
doesn't know it. That's why it shows the identifier of such type.

We need a patch for iproute2:

diff --git a/lib/ll_types.c b/lib/ll_types.c
index 2c5bf8b..6c71c8b 100644
--- a/lib/ll_types.c
+++ b/lib/ll_types.c
@@ -35,6 +35,7 @@ static const struct {
        const char *name;
 } arphrd_names[] = {
 { 0, "generic" },
+__PF(6LOWPAN,6lowpan)
 __PF(ETHER,ether)
 __PF(EETHER,eether)
 __PF(AX25,ax25)

Feel free somebody to submit such patch! I cc jukkar here, because this
issue is related to btle 6lowpan also. btw: I didn't test it, just
compile.

The 6lowpan interface is the same type for 802.15.4 6LoWPAN and BTLE
6loWPAN, see slides [0].

> The second thing I notice strange is after "sudo ip link set wpan0 up"
> for both wpan0 and lowpan0, the "ifconfig" command shows that these
> network interfaces have "Link encap:UNSPEC". If I'm not mistaken, Link
> encap shows the hardware family of the interface, right?
>
> So the SECOND QUESTION is:
> 2. Is that normal/ok to have Link encap:UNSPEC? Because this thing
> makes me suspicious about the next problem that I face.
> 

I think this requires a similar fix like above for "ifconfig". It's just
eyecandy. Remember: ip > ifconfig, because ifconfig is deprecated.

> I tried to run wpan-ping daemon from /wpan-tools/wpan-ping by
> prompting "wpan-ping --daemon" but the output is "bind: No such
> device". I tried to make my own code to make a server program which
> listen to this socket interface. But when binding with bind(), I got
> the same error status "No device found".
> 
> This leads to my THIRD QUESTION:
> 3. Why "no device found" appears? The transceiver is attached, the
> hardware address exists, the interface is up, and I am able to ping
> between two devices using ping6. I am suspicious that the problems
> that I ask you before have caused this problem.
> 
> Do you know what's wrong here?
> 

Don't know, I never tried the socket interface for 802.15.4. Stefan
Schmidt did some stuff there, maybe he can help here.

btw: the socket interface need a complete rework/cleanup. [1]

What I test is the raw socket interface over AF_PACKET for 802.15.4 interfaces.

- Alex

[0] http://www.netdevconf.org/1.1/proceedings/slides/aring-generic-6lowpan-branch.pdf
[1] https://github.com/linux-wpan/linux-wpan/issues/20

^ permalink raw reply	[flat|nested] 10+ messages in thread

* No device found for binding socket ieee802.15.4
  2016-03-29  8:37 ` Alexander Aring
@ 2016-03-30  1:43   ` Adika Bintang Sulaeman
  2016-03-30  8:29     ` Stefan Schmidt
  0 siblings, 1 reply; 10+ messages in thread
From: Adika Bintang Sulaeman @ 2016-03-30  1:43 UTC (permalink / raw)
  To: Alexander Aring; +Cc: linux-wpan, stefan, jukka.rissanen

Hi Alexander Aring,

I have watched your presentation on [1] and I saw that you had the
"Link encap: UNSPEC" as well. Thank you for your explanation. I hope I
can get some directions or hints about the problem I face on running
"wpan-ping --daemon" and the socket for 802.15.4.

[1] https://archive.fosdem.org/2015/schedule/event/deviot09/

On 3/29/16, Alexander Aring <alex.aring@gmail.com> wrote:
> Hi,
>
> On Mon, Mar 28, 2016 at 10:46:04PM +0700, Adika Bintang Sulaeman wrote:
>> Dear all linux-wpan developers and users,
>>
>> This is my first time exploring 6LoWPAN and I would like to ask you
>> some questions. Before getting into questions, these are the devices
>> and set up that I use:
>> -Raspberry Pi Model B Rev 2
>> -Raspbian OS
>> -kernel from bluetooth-next ver 4.5.0-rc5+
>> -MRF24J40MA Transceiver
>>
>> After setting up and installing the wpan-tools, I got my interface
>> work by prompting "ip link show" and there is something like:
>>
>> 3: wpan0 <BROADCAST,NOARP> mtu 123 qdisc noop state DOWN mode DEFAULT
>> group default qlen 1000
>>         link/ieee802.15.4 ee:3b:07:84:64:8c:2a:71 brd
>> ff:ff:ff:ff:ff:ff:ff
>>
>> The first thing I notice strange is why after the command "sudo ip
>> link add link wpan0 name lowpan0 type lowpan" the output in "ip link
>> show" is a bit different, especially in link/[825]:
>>
>> 7: lowpan0 <BROADCAST,MULTICAST> mtu 1280 qdisc noop state DOWN mode
>> DEFAULT group default qlen 1
>>         link/[825] ee:3b:07:84:64:8c:2a:71 brd ff:ff:ff:ff:ff:ff:ff
>>
>> So this is the FIRST QUESTION:
>> 1. Is that normal/ok to have link/[825] instead of link/ieee802.15.4?
>>
>
> It's okay. lowpan0 != wpan0 these are different interfaces. It should be
> link/6lowpan, but this interface type is just too new and iproute2
> doesn't know it. That's why it shows the identifier of such type.
>
> We need a patch for iproute2:
>
> diff --git a/lib/ll_types.c b/lib/ll_types.c
> index 2c5bf8b..6c71c8b 100644
> --- a/lib/ll_types.c
> +++ b/lib/ll_types.c
> @@ -35,6 +35,7 @@ static const struct {
>         const char *name;
>  } arphrd_names[] = {
>  { 0, "generic" },
> +__PF(6LOWPAN,6lowpan)
>  __PF(ETHER,ether)
>  __PF(EETHER,eether)
>  __PF(AX25,ax25)
>
> Feel free somebody to submit such patch! I cc jukkar here, because this
> issue is related to btle 6lowpan also. btw: I didn't test it, just
> compile.
>
> The 6lowpan interface is the same type for 802.15.4 6LoWPAN and BTLE
> 6loWPAN, see slides [0].
>
>> The second thing I notice strange is after "sudo ip link set wpan0 up"
>> for both wpan0 and lowpan0, the "ifconfig" command shows that these
>> network interfaces have "Link encap:UNSPEC". If I'm not mistaken, Link
>> encap shows the hardware family of the interface, right?
>>
>> So the SECOND QUESTION is:
>> 2. Is that normal/ok to have Link encap:UNSPEC? Because this thing
>> makes me suspicious about the next problem that I face.
>>
>
> I think this requires a similar fix like above for "ifconfig". It's just
> eyecandy. Remember: ip > ifconfig, because ifconfig is deprecated.
>
>> I tried to run wpan-ping daemon from /wpan-tools/wpan-ping by
>> prompting "wpan-ping --daemon" but the output is "bind: No such
>> device". I tried to make my own code to make a server program which
>> listen to this socket interface. But when binding with bind(), I got
>> the same error status "No device found".
>>
>> This leads to my THIRD QUESTION:
>> 3. Why "no device found" appears? The transceiver is attached, the
>> hardware address exists, the interface is up, and I am able to ping
>> between two devices using ping6. I am suspicious that the problems
>> that I ask you before have caused this problem.
>>
>> Do you know what's wrong here?
>>
>
> Don't know, I never tried the socket interface for 802.15.4. Stefan
> Schmidt did some stuff there, maybe he can help here.
>
> btw: the socket interface need a complete rework/cleanup. [1]
>
> What I test is the raw socket interface over AF_PACKET for 802.15.4
> interfaces.
>
> - Alex
>
> [0]
> http://www.netdevconf.org/1.1/proceedings/slides/aring-generic-6lowpan-branch.pdf
> [1] https://github.com/linux-wpan/linux-wpan/issues/20
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: No device found for binding socket ieee802.15.4
  2016-03-30  1:43   ` Adika Bintang Sulaeman
@ 2016-03-30  8:29     ` Stefan Schmidt
  2016-03-30 19:21       ` Adika Bintang Sulaeman
  0 siblings, 1 reply; 10+ messages in thread
From: Stefan Schmidt @ 2016-03-30  8:29 UTC (permalink / raw)
  To: Adika Bintang Sulaeman, Alexander Aring; +Cc: linux-wpan, jukka.rissanen

Hello.

On 30/03/16 03:43, Adika Bintang Sulaeman wrote:
> Hi Alexander Aring,
>
> I have watched your presentation on [1] and I saw that you had the
> "Link encap: UNSPEC" as well. Thank you for your explanation. I hope I
> can get some directions or hints about the problem I face on running
> "wpan-ping --daemon" and the socket for 802.15.4.

Are you actually sure you have the socket code for ieee802154 enabled in 
your kernel build?
CONFIG_IEEE802154_SOCKET

If it is not build into the kernel, are you sure the module is loaded?

regards
Stefan Schmidt

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: No device found for binding socket ieee802.15.4
  2016-03-30  8:29     ` Stefan Schmidt
@ 2016-03-30 19:21       ` Adika Bintang Sulaeman
  2016-03-30 20:42         ` Stefan Schmidt
  0 siblings, 1 reply; 10+ messages in thread
From: Adika Bintang Sulaeman @ 2016-03-30 19:21 UTC (permalink / raw)
  To: Stefan Schmidt; +Cc: Alexander Aring, linux-wpan, jukka.rissanen

> On 3/30/16, Stefan Schmidt <stefan@osg.samsung.com> wrote:
> Are you actually sure you have the socket code for ieee802154 enabled in
> your kernel build?
> CONFIG_IEEE802154_SOCKET
>
> If it is not build into the kernel, are you sure the module is loaded?
>
> regards
> Stefan Schmidt
>

Hi Stefan,

Fortunately I got 802.15.4 socket work by modifying wpan-ping code. By
the way, does the function generate_packet(unsigned char *buf, struct
config *conf, unsigned int seq_num) try to generate a packet which is
not 6LoWPAN? The code set 0x00 for the dispatch header. Now I need an
example of using 6LoWPAN socket API instead of creating packet
manually. Would anyone mind sharing the code if you have implement it?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: No device found for binding socket ieee802.15.4
  2016-03-30 19:21       ` Adika Bintang Sulaeman
@ 2016-03-30 20:42         ` Stefan Schmidt
  2016-03-30 20:49           ` Adika Bintang Sulaeman
  0 siblings, 1 reply; 10+ messages in thread
From: Stefan Schmidt @ 2016-03-30 20:42 UTC (permalink / raw)
  To: Adika Bintang Sulaeman; +Cc: Alexander Aring, linux-wpan, jukka.rissanen

Hello.

On 30/03/16 21:21, Adika Bintang Sulaeman wrote:
>> On 3/30/16, Stefan Schmidt <stefan@osg.samsung.com> wrote:
>> Are you actually sure you have the socket code for ieee802154 enabled in
>> your kernel build?
>> CONFIG_IEEE802154_SOCKET
>>
>> If it is not build into the kernel, are you sure the module is loaded?
>>
>> regards
>> Stefan Schmidt
>>
> Hi Stefan,
>
> Fortunately I got 802.15.4 socket work by modifying wpan-ping code.

I still don't see why you would need to do this. What did you change?

>   By
> the way, does the function generate_packet(unsigned char *buf, struct
> config *conf, unsigned int seq_num) try to generate a packet which is
> not 6LoWPAN? The code set 0x00 for the dispatch header.

Yes, it is a 802.15.4 ping utility not using 6lowpan at all. Thus the 
dispatch header is set to not a 6lowpan frame to avoid problems.

> Now I need an
> example of using 6LoWPAN socket API instead of creating packet
> manually. Would anyone mind sharing the code if you have implement it?

Its the normal IPv6 socket API of linux.

regards
Stefan Schmidt

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: No device found for binding socket ieee802.15.4
  2016-03-30 20:42         ` Stefan Schmidt
@ 2016-03-30 20:49           ` Adika Bintang Sulaeman
  2016-03-30 20:58             ` Stefan Schmidt
  0 siblings, 1 reply; 10+ messages in thread
From: Adika Bintang Sulaeman @ 2016-03-30 20:49 UTC (permalink / raw)
  To: Stefan Schmidt; +Cc: Alexander Aring, linux-wpan, jukka.rissanen

> I still don't see why you would need to do this. What did you change?

Sorry, I think I didn't explain clearly. I forgot to set pan_id and
short address. Now the wpan-ping works fine. I tried to create a
server program which is based on 802.15.4 and 6LoWPAN, and I imitate
the code from wpan-ping. I didn't mean that I literally changed the
wpan-ping.

> Its the normal IPv6 socket API of linux.

Thank you for your explanation, Stefan Schmidt.

Regards

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: No device found for binding socket ieee802.15.4
  2016-03-30 20:49           ` Adika Bintang Sulaeman
@ 2016-03-30 20:58             ` Stefan Schmidt
  2016-04-03 17:09               ` Adika Bintang Sulaeman
  0 siblings, 1 reply; 10+ messages in thread
From: Stefan Schmidt @ 2016-03-30 20:58 UTC (permalink / raw)
  To: Adika Bintang Sulaeman; +Cc: Alexander Aring, linux-wpan, jukka.rissanen

Hello.

On 30/03/16 22:49, Adika Bintang Sulaeman wrote:
>> I still don't see why you would need to do this. What did you change?
> Sorry, I think I didn't explain clearly. I forgot to set pan_id and
> short address. Now the wpan-ping works fine. I tried to create a
> server program which is based on 802.15.4 and 6LoWPAN, and I imitate
> the code from wpan-ping. I didn't mean that I literally changed the
> wpan-ping.

OK, that makes more sense now. Without the address being setup this 
would fail.

>> Its the normal IPv6 socket API of linux.
> Thank you for your explanation, Stefan Schmidt.

If you have no specific requirements for the 6LoWPAN part normal 
client/server code written for the Linux IPv6 socket API should work 
over the lowpan0 interface.

regards
Stefan Schmidt

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: No device found for binding socket ieee802.15.4
  2016-03-30 20:58             ` Stefan Schmidt
@ 2016-04-03 17:09               ` Adika Bintang Sulaeman
  0 siblings, 0 replies; 10+ messages in thread
From: Adika Bintang Sulaeman @ 2016-04-03 17:09 UTC (permalink / raw)
  To: Stefan Schmidt; +Cc: Alexander Aring, linux-wpan, jukka.rissanen

> If you have no specific requirements for the 6LoWPAN part normal
> client/server code written for the Linux IPv6 socket API should work
> over the lowpan0 interface.

Hi Stefan,

I'm sorry if my question would be too stupid or shallow, I just want
to make sure because I'm really new to this.

I have run an example from [1] on client-server model using UDP and
IPv6. To run this example, on the client side I run the command:

"listener <IPv6 of another machine for lowpan interface>%lowpan0
the-payload-is-here"

According to [2], <IPv6 address>%<interface's name> notation means the
machine will try to communicate  to <IPv6 address> machine through the
<interface's name> interface. Hence, I basically have run
client/server program with Linux IPv6 over the lowpan0 interface.
Alexander Aring gave me a good presentation slide [3] and on page 12
it is clearly written that Linux still uses AF_INET6 for 6LoWPAN.

I just want to make sure whether my approach on making client-server
model over 6LoWPAN is right. I am not sure because I don't know
whether the IPv6 header is compressed using 6LoWPAN adaptation layer.

[1] http://beej.us/guide/bgnet/output/html/singlepage/bgnet.html#datagram
[2] http://veithen.github.io/2013/12/30/how-to-correctly-parse-ipv6-addresses.html
[3] http://www.netdevconf.org/1.1/proceedings/slides/aring-generic-6lowpan-branch.pdf

Best regards

^ permalink raw reply	[flat|nested] 10+ messages in thread

* No device found for binding socket ieee802.15.4
@ 2016-03-28 15:21 Adika Bintang Sulaeman
  0 siblings, 0 replies; 10+ messages in thread
From: Adika Bintang Sulaeman @ 2016-03-28 15:21 UTC (permalink / raw)
  To: linux-wpan

Dear all linux-wpan developers and users,

This is my first time exploring 6LoWPAN and I would like to ask you
some questions. Before getting into questions, these are the devices
and set up that I use:
-Raspberry Pi Model B Rev 2
-Raspbian OS
-kernel from bluetooth-next ver 4.5.0-rc5+
-MRF24J40MA Transceiver

After setting up and installing the wpan-tools, I got my interface
work by prompting "ip link show" and there is something like:

3: wpan0 <BROADCAST,NOARP> mtu 123 qdisc noop state DOWN mode DEFAULT
group default qlen 1000
	link/ieee802.15.4 ee:3b:07:84:64:8c:2a:71 brd ff:ff:ff:ff:ff:ff:ff

The first thing I notice strange is why after the command "sudo ip
link add link wpan0 name lowpan0 type lowpan" the output in "ip link
show" is a bit different, especially in link/[825]:

7: lowpan0 <BROADCAST,MULTICAST> mtu 1280 qdisc noop state DOWN mode
DEFAULT group default qlen 1
	link/[825] ee:3b:07:84:64:8c:2a:71 brd ff:ff:ff:ff:ff:ff:ff

So this is the FIRST QUESTION:
1. Is that normal/ok to have link/[825] instead of link/ieee802.15.4?

The second thing I notice strange is after "sudo ip link set wpan0 up"
for both wpan0 and lowpan0, the "ifconfig" command shows that these
network interfaces have "Link encap:UNSPEC". If I'm not mistaken, Link
encap shows the hardware family of the interface, right?

So the SECOND QUESTION is:
2. Is that normal/ok to have Link encap:UNSPEC? Because this thing
makes me suspicious about the next problem that I face.

I tried to run wpan-ping daemon from /wpan-tools/wpan-ping by
prompting "wpan-ping --daemon" but the output is "bind: No such
device". I tried to make my own code to make a server program which
listen to this socket interface. But when binding with bind(), I got
the same error status "No device found".

This leads to my THIRD QUESTION:
3. Why "no device found" appears? The transceiver is attached, the
hardware address exists, the interface is up, and I am able to ping
between two devices using ping6. I am suspicious that the problems
that I ask you before have caused this problem.

Do you know what's wrong here?

Thank you for your time and help

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-04-03 17:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-28 15:46 No device found for binding socket ieee802.15.4 Adika Bintang Sulaeman
2016-03-29  8:37 ` Alexander Aring
2016-03-30  1:43   ` Adika Bintang Sulaeman
2016-03-30  8:29     ` Stefan Schmidt
2016-03-30 19:21       ` Adika Bintang Sulaeman
2016-03-30 20:42         ` Stefan Schmidt
2016-03-30 20:49           ` Adika Bintang Sulaeman
2016-03-30 20:58             ` Stefan Schmidt
2016-04-03 17:09               ` Adika Bintang Sulaeman
  -- strict thread matches above, loose matches on Subject: below --
2016-03-28 15:21 Adika Bintang Sulaeman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.