linux-wpan.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How to test a 6lowpan patch w/o physical devices?
@ 2019-02-04 19:50 Peter Oskolkov
  2019-02-05  2:27 ` Alexander Aring
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Oskolkov @ 2019-02-04 19:50 UTC (permalink / raw)
  To: linux-wpan, Alexander Aring, Jukka Rissanen

Hello!

I'd like to change 6lowpan defragmentation
(net/ieee802154/6lowpan/reassembly.c) code to match that of regular
IPv6, as in https://www.spinics.net/lists/netdev/msg546133.html.

However, I don't have a physical Linux/6lowpan setup to test my
changes. Is it possible to create a virtual 6lowpan device/network
inside net namespaces to run tests like these:

https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/tree/tools/testing/selftests/net/ip_defrag.c
?

Thanks,
Peter

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

* Re: How to test a 6lowpan patch w/o physical devices?
  2019-02-04 19:50 How to test a 6lowpan patch w/o physical devices? Peter Oskolkov
@ 2019-02-05  2:27 ` Alexander Aring
  2019-02-05 16:46   ` Peter Oskolkov
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Aring @ 2019-02-05  2:27 UTC (permalink / raw)
  To: Peter Oskolkov; +Cc: linux-wpan, Alexander Aring, Jukka Rissanen

Hi,

On Mon, Feb 04, 2019 at 11:50:30AM -0800, Peter Oskolkov wrote:
> Hello!
> 
> I'd like to change 6lowpan defragmentation
> (net/ieee802154/6lowpan/reassembly.c) code to match that of regular
> IPv6, as in https://www.spinics.net/lists/netdev/msg546133.html.
> 

cool.

I am curious, what is your exact testing plan for 6lowpan fragmentation?
Or just cc me, then I will take a look. :-)

> However, I don't have a physical Linux/6lowpan setup to test my
> changes. Is it possible to create a virtual 6lowpan device/network
> inside net namespaces to run tests like these:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/tree/tools/testing/selftests/net/ip_defrag.c
> ?

yes, on kernel since 4.19 you can setup a virtual phy network with the
mac802154_hwsim driver, which works basic similar like the wireless
mac80211_hwsim driver.

Unfortunately you need iwpan to setup basic specific L2 configuration.
It is part of wpan-tools [0].

When you load mac802154_hwsim it will register two phy's which can
reach each other virtually. I guess it will be enough for your test
setup.

Sample setup:

--- snip
modprobe mac802154_hwsim

iwpan dev wpan0 set pan_id 0xbeef
ip link add link wpan0 name lowpan0 type lowpan
ip link set wpan0 up
ip link set lowpan0 up

iwpan dev wpan1 set pan_id 0xbeef
ip netns add foo
iwpan phy1 set netns name foo
ip netns exec foo ip link add link wpan1 name lowpan1 type lowpan
ip netns exec foo ip link set wpan1 up
ip netns exec foo ip link set lowpan1 up
--- snap

I hope this answers your question, let me know if I you have still
questions.

Thank you!

- Alex

[0] https://github.com/linux-wpan/wpan-tools

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

* Re: How to test a 6lowpan patch w/o physical devices?
  2019-02-05  2:27 ` Alexander Aring
@ 2019-02-05 16:46   ` Peter Oskolkov
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Oskolkov @ 2019-02-05 16:46 UTC (permalink / raw)
  To: Alexander Aring; +Cc: linux-wpan, Alexander Aring, Jukka Rissanen

On Mon, Feb 4, 2019 at 6:27 PM Alexander Aring <aring@mojatatu.com> wrote:
>
> Hi,
>
> On Mon, Feb 04, 2019 at 11:50:30AM -0800, Peter Oskolkov wrote:
> > Hello!
> >
> > I'd like to change 6lowpan defragmentation
> > (net/ieee802154/6lowpan/reassembly.c) code to match that of regular
> > IPv6, as in https://www.spinics.net/lists/netdev/msg546133.html.
> >
>
> cool.
>
> I am curious, what is your exact testing plan for 6lowpan fragmentation?

I plan to add a 6lowpan test case to
tools/testing/selftests/net/ip_defrag.[sh|c]

> Or just cc me, then I will take a look. :-)

Will definitely cc you.

>
> > However, I don't have a physical Linux/6lowpan setup to test my
> > changes. Is it possible to create a virtual 6lowpan device/network
> > inside net namespaces to run tests like these:
> >
> > https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/tree/tools/testing/selftests/net/ip_defrag.c
> > ?
>
> yes, on kernel since 4.19 you can setup a virtual phy network with the
> mac802154_hwsim driver, which works basic similar like the wireless
> mac80211_hwsim driver.
>
> Unfortunately you need iwpan to setup basic specific L2 configuration.
> It is part of wpan-tools [0].
>
> When you load mac802154_hwsim it will register two phy's which can
> reach each other virtually. I guess it will be enough for your test
> setup.
>
> Sample setup:
>
> --- snip
> modprobe mac802154_hwsim
>
> iwpan dev wpan0 set pan_id 0xbeef
> ip link add link wpan0 name lowpan0 type lowpan
> ip link set wpan0 up
> ip link set lowpan0 up
>
> iwpan dev wpan1 set pan_id 0xbeef
> ip netns add foo
> iwpan phy1 set netns name foo
> ip netns exec foo ip link add link wpan1 name lowpan1 type lowpan
> ip netns exec foo ip link set wpan1 up
> ip netns exec foo ip link set lowpan1 up
> --- snap
>
> I hope this answers your question, let me know if I you have still
> questions.

Thanks a lot, Alex! Yes, it seems exactly what I need!

>
> Thank you!
>
> - Alex
>
> [0] https://github.com/linux-wpan/wpan-tools

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

end of thread, other threads:[~2019-02-05 16:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-04 19:50 How to test a 6lowpan patch w/o physical devices? Peter Oskolkov
2019-02-05  2:27 ` Alexander Aring
2019-02-05 16:46   ` Peter Oskolkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).