[PATCH series][6LoWPAN]
Subsystems (4)
PATCH 1/1 [PATCH series][6LoWPAN]
Hello all,
The following patch series adds both major feature and minor fixes. Please find detailed description in each of the patches.
Just to summarize current development status:
By using MAC and PHY layers support from
"http://sourceforge.net/projects/linux-zigbee"
project now it's possible to run generic network applications (ssh, iperf) over ieee802.15.4 network.
iperf shows about ~40Kbits/sec for TCP :-)
With best regards,
Alexander
PATCH 1/6 add fragmentation support
This patch adds support for frame fragmentation.
--- include/net/ieee802154.h | 6 + net/ieee802154/6lowpan.c | 254 +++++++++++++++++++++++++++++++++++++++++++++- net/ieee802154/6lowpan.h | 18 ++++ 3 files changed, 274 insertions(+), 4 deletions(-)
include/net/ieee802154.h +6 -0
@@ -21,11 +21,14 @@* Maxim Gorbachyov <[email protected]> * Maxim Osipov <[email protected]> * Dmitry Eremin-Solenikov <[email protected]> +* Alexander Smirnov <[email protected]> */ #ifndef NET_IEEE802154_H #define NET_IEEE802154_H +#define IEEE802154_MTU 127 +#define IEEE802154_FC_TYPE_BEACON 0x0/* Frame is beacon */ #define IEEE802154_FC_TYPE_DATA 0x1/* Frame is data */ #define IEEE802154_FC_TYPE_ACK 0x2/* Frame is acknowledgment */
@@ -56,6 +59,9 @@ (((x) &IEEE802154_FC_DAMODE_MASK ) >>IEEE802154_FC_DAMODE_SHIFT ) +/* MAC footer size */ +#define IEEE802154_MFR_SIZE 2/* 2 octets */ +/* MAC's Command Frames Identifiers */ #define IEEE802154_CMD_ASSOCIATION_REQ 0x01#define IEEE802154_CMD_ASSOCIATION_RESP 0x02
net/ieee802154/6lowpan.c +250 -4
306 lines not on this page · raw message
net/ieee802154/6lowpan.h +18 -0
@@ -159,6 +159,24 @@#define LOWPAN_DISPATCH_FRAG1 0xc0/* 11000xxx */ #define LOWPAN_DISPATCH_FRAGN 0xe0/* 11100xxx */ +#define LOWPAN_DISPATCH_MASK 0xf8/* 11111000 */ + +#define LOWPAN_FRAG_TIMEOUT (HZ * 60)/* time-out 60 sec */ + +#define LOWPAN_FRAG1_HEAD_SIZE 0x4 +#define LOWPAN_FRAGN_HEAD_SIZE 0x5 + +/* +* According IEEE802.15.4 standard: +* - MTU is 127 octets +* - maximum MHR size is 37 octets +* - MFR size is 2 octets +* +* so minimal payload size that we may guarantee is: +* MTU - MHR - MFR = 88 octets +*/ +#define LOWPAN_FRAG_SIZE 88 +/* * Values of fields within the IPHC encoding first byte * (C stands for compressed and I for inline)
Signature · 1 line
1.7.2.5
PATCH 3/6 set proper netdev flags
In reply to Alexander SmirnovThis patch fixes settings for device initialization which makes possible to use NDISC and TCP.
--- net/ieee802154/6lowpan.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
net/ieee802154/6lowpan.c +1 -2
@@ -967,13 +967,12 @@ static void lowpan_setup(struct net_device *dev) dev->addr_len =IEEE802154_ADDR_LEN ;memset (dev->broadcast,0xff ,IEEE802154_ADDR_LEN ); dev->type =ARPHRD_IEEE802154 ; - dev->features =NETIF_F_NO_CSUM ;/* Frame Control + Sequence Number + Address fields + Security Header */ dev->hard_header_len =2 +1 +20 +14 ; dev->needed_tailroom =2 ;/* FCS */ dev->mtu =1281 ; dev->tx_queue_len =0 ; - dev->flags =IFF_NOARP |IFF_BROADCAST ; + dev->flags =IFF_BROADCAST |IFF_MULTICAST ; dev->watchdog_timeo =0 ; dev->netdev_ops = &lowpan_netdev_ops;
Signature · 1 line
1.7.2.5
PATCH 2/6 disable debugging by default
In reply to a message not in the archiveThis patch disables debug output enabled by default.
--- net/ieee802154/6lowpan.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
net/ieee802154/6lowpan.c +0 -2
@@ -50,8 +50,6 @@* SUCH DAMAGE. */ -#define DEBUG -#include <linux/bitops.h> #include <linux/if_arp.h> #include <linux/module.h>
Signature · 8 lines
1.7.2.5 ------------------------------------------------------------------------------ RSA® Conference 2012 Save $700 by Nov 18 Register now! http://p.sf.net/sfu/rsa-sfdev2dev1
PATCH 4/6 UDP header compression
In reply to a message not in the archiveThis patch adds support for UDP header compression. Derived from Contiki OS.
--- net/ieee802154/6lowpan.c | 51 ++++++++++++++++++++++++++++++++++++++++++--- net/ieee802154/6lowpan.h | 5 ++++ 2 files changed, 52 insertions(+), 4 deletions(-)
net/ieee802154/6lowpan.c +47 -4
@@ -365,8 +365,6 @@ static int lowpan_header_create(struct sk_buff *skb,if (hdr->nexthdr ==UIP_PROTO_UDP ) iphc0 |=LOWPAN_IPHC_NH_C ; -/* TODO: next header compression */ -if ((iphc0 &LOWPAN_IPHC_NH_C ) ==0 ) { *hc06_ptr = hdr->nexthdr; hc06_ptr +=1 ;
@@ -454,8 +452,53 @@ static int lowpan_header_create(struct sk_buff *skb, } } -/* TODO: UDP header compression */ -/* TODO: Next Header compression */ +/* UDP header compression */ +if (hdr->nexthdr ==UIP_PROTO_UDP ) { +struct udphdr *uh =udp_hdr (skb); + +pr_debug ("(%s): UDP header compression\n" , __func__); + +if (((uh->source &LOWPAN_NHC_UDP_4BIT_MASK ) == +LOWPAN_NHC_UDP_4BIT_PORT ) && + ((uh->dest &LOWPAN_NHC_UDP_4BIT_MASK ) == +LOWPAN_NHC_UDP_4BIT_PORT )) { +pr_debug ("(%s): both ports compression to 4 bits\n" , + __func__); + *hc06_ptr =LOWPAN_NHC_UDP_CS_P_11 ; + *(hc06_ptr +1 ) =/* subtraction is faster */ + (u8)((uh->dest -LOWPAN_NHC_UDP_4BIT_PORT ) + + ((uh->source &LOWPAN_NHC_UDP_4BIT_PORT ) <<4 )); + hc06_ptr +=2 ; + }else if ((uh->dest &LOWPAN_NHC_UDP_8BIT_MASK ) == +LOWPAN_NHC_UDP_8BIT_PORT ) { +pr_debug ("(%s): remove 8 bits of dest\n" , __func__); + *hc06_ptr =LOWPAN_NHC_UDP_CS_P_01 ; +memcpy (hc06_ptr +1 , &uh->source,2 ); + *(hc06_ptr +3 ) = + (u8)(uh->dest -LOWPAN_NHC_UDP_8BIT_PORT ); + hc06_ptr +=4 ; + }else if ((uh->source &LOWPAN_NHC_UDP_8BIT_MASK ) == +LOWPAN_NHC_UDP_8BIT_PORT ) { +pr_debug ("(%s): remove 8 bits of source\n" , __func__); + *hc06_ptr =LOWPAN_NHC_UDP_CS_P_10 ; +memcpy (hc06_ptr +1 , &uh->dest,2 ); + *(hc06_ptr +3 ) = + (u8)(uh->source -LOWPAN_NHC_UDP_8BIT_PORT ); + hc06_ptr +=4 ; + }else { +pr_debug ("(%s): can't compress header\n" , __func__); + *hc06_ptr =LOWPAN_NHC_UDP_CS_P_00 ; +memcpy (hc06_ptr +1 , &uh->source,2 ); +memcpy (hc06_ptr +3 , &uh->dest,2 ); + hc06_ptr +=5 ; + } + +/* checksum is always inline */ +memcpy (hc06_ptr, &uh->check,2 ); + hc06_ptr +=2 ; + } + +/* TODO: other NH types support? */ head[0 ] = iphc0; head[1 ] = iphc1;
net/ieee802154/6lowpan.h +5 -0
@@ -219,6 +219,11 @@#define LOWPAN_NHC_UDP_CHECKSUMC 0x04#define LOWPAN_NHC_UDP_CHECKSUMI 0x00 +#define LOWPAN_NHC_UDP_4BIT_PORT 0xF0B0 +#define LOWPAN_NHC_UDP_4BIT_MASK 0xFFF0 +#define LOWPAN_NHC_UDP_8BIT_PORT 0xF000 +#define LOWPAN_NHC_UDP_8BIT_MASK 0xFF00 +/* values for port compression, _with checksum_ ie bit 5 set to 0 */ #define LOWPAN_NHC_UDP_CS_P_00 0xF0/* all inline */ #define LOWPAN_NHC_UDP_CS_P_01 0xF1/* source 16bit inline,
Signature · 8 lines
1.7.2.5 ------------------------------------------------------------------------------ RSA® Conference 2012 Save $700 by Nov 18 Register now! http://p.sf.net/sfu/rsa-sfdev2dev1
PATCH 5/6 UDP header decompression
In reply to a message not in the archiveThis patch provides possibility to decompress UDP headers. Derived from Contiki OS.
--- net/ieee802154/6lowpan.c | 50 +++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 49 insertions(+), 1 deletions(-)
net/ieee802154/6lowpan.c +49 -1
@@ -839,7 +839,55 @@ lowpan_process_data(struct sk_buff *skb) goto drop; } -/* TODO: UDP header parse */ +/* UDP data uncompression */ +if (iphc0 &LOWPAN_IPHC_NH_C ) { + tmp =lowpan_fetch_skb_u8 (skb); + +if ((tmp &LOWPAN_NHC_UDP_MASK ) ==LOWPAN_NHC_UDP_ID ) { +struct udphdr *uh =udp_hdr (skb); + +pr_debug ("(%s): UDP header uncompression\n" , __func__); +switch (tmp &LOWPAN_NHC_UDP_CS_P_11 ) { +case LOWPAN_NHC_UDP_CS_P_00 : +memcpy (&uh->source, &skb->data[0 ],2 ); +memcpy (&uh->dest, &skb->data[2 ],2 ); +skb_pull (skb,4 ); +break ; +case LOWPAN_NHC_UDP_CS_P_01 : +memcpy (&uh->source, &skb->data[0 ],2 ); + uh->dest = + skb->data[2 ] +LOWPAN_NHC_UDP_8BIT_PORT ; +skb_pull (skb,3 ); +break ; +case LOWPAN_NHC_UDP_CS_P_10 : + uh->source = skb->data[0 ] +LOWPAN_NHC_UDP_8BIT_PORT ; +memcpy (&uh->dest, &skb->data[1 ],2 ); +skb_pull (skb,3 ); +break ; +case LOWPAN_NHC_UDP_CS_P_11 : + uh->source = +LOWPAN_NHC_UDP_4BIT_PORT + (skb->data[0 ] >>4 ); + uh->dest = +LOWPAN_NHC_UDP_4BIT_PORT + (skb->data[0 ] &0x0f ); +skb_pull (skb,1 ); +break ; +default : +pr_debug ("(%s) ERROR: unknown UDP format\n" , __func__); + goto drop; + } + +pr_debug ("(%s): uncompressed UDP ports: src = %d, dst = %d\n" , + __func__, uh->source, uh->dest); + +/* copy checksum */ +memcpy (&uh->check, &skb->data[0 ],2 ); +skb_pull (skb,2 ); + }else { +pr_debug ("(%s): ERROR: unsupported NH format\n" , + __func__); + goto drop; + } + }/* Not fragmented package */ hdr.payload_len =htons (skb->len);
Signature · 8 lines
1.7.2.5 ------------------------------------------------------------------------------ RSA® Conference 2012 Save $700 by Nov 18 Register now! http://p.sf.net/sfu/rsa-sfdev2dev1
PATCH 6/6 update documentation
In reply to a message not in the archiveThis patch adds chapter to documentation which describes how to use 6lowpan technology.
--- Documentation/networking/ieee802154.txt | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-)
Documentation/networking/ieee802154.txt +26 -0
@@ -78,3 +78,29 @@ in software. This is currently WIP. See header include/net/mac802154.h and several drivers in drivers/ieee802154/. +6LoWPAN Linux implementation +============================ + +The IEEE 802.15.4 standard specifies an MTU of 128 bytes, yielding about 80 +octets of actual MAC payload once security is turned on, on a wireless link +with a link throughput of 250 kbps or less. The 6LoWPAN adaptation format +[RFC4944] was specified to carry IPv6 datagrams over such constrained links, +taking into account limited bandwidth, memory, or energy resources that are +expected in applications such as wireless Sensor Networks. [RFC4944] defines +a Mesh Addressing header to support sub-IP forwarding, a Fragmentation header +to support the IPv6 minimum MTU requirement [RFC2460], and stateless header +compression for IPv6 datagrams (LOWPAN_HC1 and LOWPAN_HC2) to reduce the +relatively large IPv6 and UDP headers down to (in the best case) several bytes. + +All the code related to 6lowpan you may find in files: net/ieee802154/6lowpan.* + +To setup 6lowpan interface you need: +1. Add IEEE802.15.4 interface and initialize PANid; +2. Add 6lowpan interface by command like: + # ip link add link wpan0 name lowpan0 type lowpan +3. Set MAC (if needs): + # ip link set lowpan0 address de:ad:be:ef:ca:fe:ba:be +4. Bring up 'lowpan0' interface + + +
Signature · 8 lines
1.7.2.5 ------------------------------------------------------------------------------ RSA® Conference 2012 Save $700 by Nov 18 Register now! http://p.sf.net/sfu/rsa-sfdev2dev1
From: Alexander Smirnov <[email protected]>
Date: Wed, 2 Nov 2011 19:25:20 +0300
Quoted 2 lines
The following patch series adds both major feature and minor fixes. Please find detailed description in each of the patches.
Right in the middle of the merge window is not the time to be submitting new features.
You'll need to repost these when the net-next tree opens back up.
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
Hello everybody,
2011/11/2, David Miller <[email protected]>:
Quoted 12 lines
From: Alexander Smirnov <[email protected]>
Date: Wed, 2 Nov 2011 19:25:20 +0300Quoted 2 lines
The following patch series adds both major feature and minor fixes. Please find detailed description in each of the patches.
Right in the middle of the merge window is not the time to be submitting new features.
You'll need to repost these when the net-next tree opens back up.
sorry if my question looks too silly, but I'm not so long here and don't know all the patch-submitting-process details. :-(
Could anyone please describe me (or link to some wiki) the merge process, how the new merge window is announced, what the proper time to send bug fixes/new features and so on..
Thank you for your time!
With best regards,
Alexander
Quoted 16 lines · Alexander Smirnov
Hello everybody,
2011/11/2, David Miller <[email protected]>:
Quoted 12 lines
From: Alexander Smirnov <[email protected]>
Date: Wed, 2 Nov 2011 19:25:20 +0300Quoted 2 lines
The following patch series adds both major feature and minor fixes. Please find detailed description in each of the patches.
Right in the middle of the merge window is not the time to be submitting new features.
You'll need to repost these when the net-next tree opens back up.
Quoted 8 lines
sorry if my question looks too silly, but I'm not so long here and don't know all the patch-submitting-process details. :-(
Could anyone please describe me (or link to some wiki) the merge process, how the new merge window is announced, what the proper time to send bug fixes/new features and so on..
Thank you for your time!
You may find answers in Documentation/development-process/ (in the kernel source tree).
-Ben
Re: [PATCH 6/6] [6LoWPAN] update documentation
In reply to Alexander SmirnovQuoted 34 lines · Alexander Smirnov
This patch adds chapter to documentation which describes how to use 6lowpan technology.
Signed-off-by Alexander Smirnov <[email protected]>--- Documentation/networking/ieee802154.txt | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-)Documentation/networking/ieee802154.txt +0
-0@@ -78,3 +78,29 @@ in software. This is currently WIP. See header include/net/mac802154.h and several drivers in
drivers/ieee802154/.+6LoWPAN Linux implementation
+============================Documentation/networking/ieee802154.txt +5
-0+ +The IEEE 802.15.4 standard specifies an MTU of 128 bytes, yielding about 80 +octets of actual MAC payload once security is turned on, on a wireless link +with a link throughput of 250 kbps or less. The 6LoWPAN adaptation format +[RFC4944] was specified to carry IPv6 datagrams over such constrainedlinks,
Documentation/networking/ieee802154.txt +2
-0+taking into account limited bandwidth, memory, or energy resources that are +expected in applications such as wireless Sensor Networks. [RFC4944]defines
+a Mesh Addressing header to support sub-IP forwarding, a Fragmentation headerDocumentation/networking/ieee802154.txt +3
-0+to support the IPv6 minimum MTU requirement [RFC2460], and stateless header +compression for IPv6 datagrams (LOWPAN_HC1 and LOWPAN_HC2) to reduce the +relatively large IPv6 and UDP headers down to (in the best case) several
Quoted 1 line
bytes.
It might be a good idea to mention fresh RFC 6282, to note that it updates RFC 4944,
deprecating old compression schemes and adding a new one. Then you can add a note
that following RFC 6282 6lowpan code doesn't implement compression via HC1 and HC2
schemes (it doesn't, am I right?).
Documentation/networking/ieee802154.txt in software. This is currently WIP. · line 100
Quoted 8 lines
Documentation/networking/ieee802154.txt +2
-0+ +All the code related to 6lowpan you may find in files:
net/ieee802154/6lowpan.*Documentation/networking/ieee802154.txt +5
-0+ +To setup 6lowpan interface you need: +1. Add IEEE802.15.4 interface and initialize PANid; +2. Add 6lowpan interface by command like: + # ip link add link wpan0 name lowpan0 type lowpan
Does this work with busybox ip or only with iproute2?
Quoted 2 lines
+3. Set MAC (if needs):
+ # ip link set lowpan0 address de:ad:be:ef:ca:fe:ba:be
IIRC address can be also specified at the step 2.
Quoted 1 line
+4. Bring up 'lowpan0' interface
Signature · 2 lines
With best wishes Dmitry
Re: [PATCH 5/6] [6LoWPAN] UDP header decompression
In reply to Alexander SmirnovQuoted 2 lines · Alexander Smirnov
This patch provides possibility to decompress UDP headers. Derived from Contiki OS.
This asks to go to a separate function.
Quoted 72 lines
Signed-off-by Alexander Smirnov <[email protected]>--- net/ieee802154/6lowpan.c | 50 +++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 49 insertions(+), 1 deletions(-)net/ieee802154/6lowpan.c +49
-2@@ -839,7 +839,55 @@ lowpan_process_data(struct sk_buff *skb) goto drop; } -/* TODO: UDP header parse */ +/* UDP data uncompression */ +if (iphc0 &LOWPAN_IPHC_NH_C ) { + tmp =lowpan_fetch_skb_u8 (skb); + +if ((tmp &LOWPAN_NHC_UDP_MASK ) ==LOWPAN_NHC_UDP_ID ) { +struct udphdr *uh =udp_hdr (skb); + +pr_debug ("(%s): UDP header uncompression\n" , __func__); +switch (tmp &LOWPAN_NHC_UDP_CS_P_11 ) { +case LOWPAN_NHC_UDP_CS_P_00 : +memcpy (&uh->source, &skb->data[0 ],2 ); +memcpy (&uh->dest, &skb->data[2 ],2 ); +skb_pull (skb,4 ); +break ; +case LOWPAN_NHC_UDP_CS_P_01 : +memcpy (&uh->source, &skb->data[0 ],2 ); + uh->dest = + skb->data[2 ] +LOWPAN_NHC_UDP_8BIT_PORT ; +skb_pull (skb,3 ); +break ; +case LOWPAN_NHC_UDP_CS_P_10 : + uh->source = skb->data[0 ] +LOWPAN_NHC_UDP_8BIT_PORT ; +memcpy (&uh->dest, &skb->data[1 ],2 ); +skb_pull (skb,3 ); +break ; +case LOWPAN_NHC_UDP_CS_P_11 : + uh->source = +LOWPAN_NHC_UDP_4BIT_PORT + (skb->data[0 ] >>4 ); + uh->dest = +LOWPAN_NHC_UDP_4BIT_PORT + (skb->data[0 ] &0x0f ); +skb_pull (skb,1 ); +break ; +default : +pr_debug ("(%s) ERROR: unknown UDP format\n" , __func__); + goto drop; + } + +pr_debug ("(%s): uncompressed UDP ports: src = %d, dst = %d\n" , + __func__, uh->source, uh->dest); + +/* copy checksum */ +memcpy (&uh->check, &skb->data[0 ],2 ); +skb_pull (skb,2 ); + }else { +pr_debug ("(%s): ERROR: unsupported NH format\n" , + __func__); + goto drop; + } + }/* Not fragmented package */ hdr.payload_len =htons (skb->len); --1.7.2.5
Signature · 2 lines
With best wishes Dmitry
Re: [PATCH 4/6] [6LoWPAN] UDP header compression
In reply to a message not in the archiveQuoted 4 lines · Alexander Smirnov
This patch adds support for UDP header compression. Derived from Contiki OS.
From my point of view, this code would also benefit from being refactored
to a separate function.
Quoted 97 lines
Signed-off-by Alexander Smirnov <[email protected]>--- net/ieee802154/6lowpan.c | 51 ++++++++++++++++++++++++++++++++++++++++++--- net/ieee802154/6lowpan.h | 5 ++++ 2 files changed, 52 insertions(+), 4 deletions(-)net/ieee802154/6lowpan.c +47
-4@@ -365,8 +365,6 @@ static int lowpan_header_create(struct sk_buff *skb,if (hdr->nexthdr ==UIP_PROTO_UDP ) iphc0 |=LOWPAN_IPHC_NH_C ; -/* TODO: next header compression */ -if ((iphc0 &LOWPAN_IPHC_NH_C ) ==0 ) { *hc06_ptr = hdr->nexthdr; hc06_ptr +=1 ;@@ -454,8 +452,53 @@ static int lowpan_header_create(struct sk_buff *skb, } } -/* TODO: UDP header compression */ -/* TODO: Next Header compression */ +/* UDP header compression */ +if (hdr->nexthdr ==UIP_PROTO_UDP ) { +struct udphdr *uh =udp_hdr (skb); + +pr_debug ("(%s): UDP header compression\n" , __func__); + +if (((uh->source &LOWPAN_NHC_UDP_4BIT_MASK ) == +LOWPAN_NHC_UDP_4BIT_PORT ) && + ((uh->dest &LOWPAN_NHC_UDP_4BIT_MASK ) == +LOWPAN_NHC_UDP_4BIT_PORT )) { +pr_debug ("(%s): both ports compression to 4 bits\n" , + __func__); + *hc06_ptr =LOWPAN_NHC_UDP_CS_P_11 ; + *(hc06_ptr +1 ) =/* subtraction is faster */ + (u8)((uh->dest -LOWPAN_NHC_UDP_4BIT_PORT ) + + ((uh->source &LOWPAN_NHC_UDP_4BIT_PORT ) <<4 )); + hc06_ptr +=2 ; + }else if ((uh->dest &LOWPAN_NHC_UDP_8BIT_MASK ) == +LOWPAN_NHC_UDP_8BIT_PORT ) { +pr_debug ("(%s): remove 8 bits of dest\n" , __func__); + *hc06_ptr =LOWPAN_NHC_UDP_CS_P_01 ; +memcpy (hc06_ptr +1 , &uh->source,2 ); + *(hc06_ptr +3 ) = + (u8)(uh->dest -LOWPAN_NHC_UDP_8BIT_PORT ); + hc06_ptr +=4 ; + }else if ((uh->source &LOWPAN_NHC_UDP_8BIT_MASK ) == +LOWPAN_NHC_UDP_8BIT_PORT ) { +pr_debug ("(%s): remove 8 bits of source\n" , __func__); + *hc06_ptr =LOWPAN_NHC_UDP_CS_P_10 ; +memcpy (hc06_ptr +1 , &uh->dest,2 ); + *(hc06_ptr +3 ) = + (u8)(uh->source -LOWPAN_NHC_UDP_8BIT_PORT ); + hc06_ptr +=4 ; + }else { +pr_debug ("(%s): can't compress header\n" , __func__); + *hc06_ptr =LOWPAN_NHC_UDP_CS_P_00 ; +memcpy (hc06_ptr +1 , &uh->source,2 ); +memcpy (hc06_ptr +3 , &uh->dest,2 ); + hc06_ptr +=5 ; + } + +/* checksum is always inline */ +memcpy (hc06_ptr, &uh->check,2 ); + hc06_ptr +=2 ; + } + +/* TODO: other NH types support? */ head[0 ] = iphc0; head[1 ] = iphc1;net/ieee802154/6lowpan.h +5
-1@@ -219,6 +219,11 @@#define LOWPAN_NHC_UDP_CHECKSUMC 0x04#define LOWPAN_NHC_UDP_CHECKSUMI 0x00 +#define LOWPAN_NHC_UDP_4BIT_PORT 0xF0B0 +#define LOWPAN_NHC_UDP_4BIT_MASK 0xFFF0 +#define LOWPAN_NHC_UDP_8BIT_PORT 0xF000 +#define LOWPAN_NHC_UDP_8BIT_MASK 0xFF00 +/* values for port compression, _with checksum_ ie bit 5 set to 0 */ #define LOWPAN_NHC_UDP_CS_P_00 0xF0/* all inline */ #define LOWPAN_NHC_UDP_CS_P_01 0xF1/* source 16bit inline, -- 1.7.2.5
Signature · 8 lines
With best wishes Dmitry ------------------------------------------------------------------------------ RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1
Re: [PATCH 6/6] [6LoWPAN] update documentation
In reply to a message not in the archiveQuoted 6 lines · Dmitry Eremin-Solenikov
Quoted 4 lines
+To setup 6lowpan interface you need:
Quoted 3 lines
+1. Add IEEE802.15.4 interface and initialize PANid; +2. Add 6lowpan interface by command like:
+ # ip link add link wpan0 name lowpan0 type lowpanDoes this work with busybox ip or only with iproute2?
It requires that commit :
http://git.busybox.net/busybox/commit/?id=6faebfa663fd008fa28f0d69d0663fe80675ebec
Which means a busybox release > 1.17.0
Kind Regards,
Signature · 12 lines
Christophe Aeschlimann Embedded Software Engineer & IT Manager ACN Advanced Communications Networks S.A. 2000 - Neuchâtel, Switzerland Tel. +41 32 724 74 31 ------------------------------------------------------------------------------ RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1
Re: [PATCH 3/6] [6LoWPAN] set proper netdev flags
In reply to Alexander SmirnovQuoted 4 lines · Alexander Smirnov
This patch fixes settings for device initialization which makes possible to use NDISC and TCP.
Signed-off-by Alexander Smirnov <[email protected]>
Signature · 2 lines
With best wishes Dmitry
Re: [PATCH 2/6] [6LoWPAN] disable debugging by default
In reply to Alexander SmirnovQuoted 3 lines · Alexander Smirnov
This patch disables debug output enabled by default.
Signed-off-by Alexander Smirnov <[email protected]>
Signature · 2 lines
With best wishes Dmitry