Step 4: Integrate 6LoWPAN into INET or INETMANET - michaelkirsche/6lowpan4omnet-diy GitHub Wiki
The next step is to integrate the 6LoWPAN wrapper into INET/INETMANET and link/compile INET/INETMANET with the contiki-omnetpp.a
library and the Contiki header files. Follow the next four steps if you want to adjust/configure the wrapper manually. If you want to start directly, simply copy/decompress the INET or INETMANET wrapper folder with all its subfolders into your INET or INETMANET framework. Then continue with Afterwards, else start with the First integration step.
First, integrate the 6LoWPAN wrapper into your INET/INETMANET framework. A simple integration is to include the 6LoWPAN module directly in the network layer of the standard INET IPv6 host. For this, decompress/copy the wrapper (_6lowpan
) directy into the /INET/src/networklayer/ipv6/
directory.
Second, you need to adjust two paths in the custom makefile of the _6lowpan
module (filename Makefile.6lowpan
).
- adjust CONTIKI_PATH to the root path of your Contiki installation (e.g.,
CONTIKI_PATH = /home/user/contiki-2.6
) - adjust CONTIKI_LIB to the directory and name of the library that you just compiled in Step 2 (e.g.,
CONTIKI_LIB = /examples/hello-world/contiki-omnetpp.a
)
Third, you must add this custom makefile into INET/INETMANET's makefrag file, so that the added includes are used when you compile INET/INETMANET.
- change to INET/INETMANET src dir,
- edit
makefrag
and include the makefile of the_6lowpan
module (e.g.,include ./networklayer/ipv6/_6lowpan/Makefile.6lowpan
)
Fourth, while the source code for the 6LoWPAN wrapper is now included in INET/INETMANET, you must also include the module in the actual network layer of an IPv6 host. Go to INET/INETMANET's nodes directory (e.g., /inet/src/nodes/ipv6
) and adjust the NetworkLayer6.ned
file. Refer to the provided source code for an example integration for INET or INETMANET.
Afterwards, you are ready to compile INET/INETMANET with the 6LoWPAN wrapper and Contiki's header files.
- Start the OMNeT++ Eclipse IDE.
- Open the INET/INETMANET project.
- Select necessary features and deselect features that you do not use (to speed up the build process).
- The following list of features must be enabled for INET: TCP common, TCP INET, IPv4 and IPv6 protocol, UDP protocol. Other recommend features are Mobility, Radio, and the according examples.
- The following list of features must be enabled for INETMANET: TCP Common, TCP INET, IPv4, INET Examples, IPv6, UDP, Ethernet, PPP, MPLS, OSPFv2, MANET routing, Mobility, Radio, 802.11a/b/g/e (infrastructure/adhoc), wireless examples, 802.15.4 code, 802.11a/b/g/e (mesh networking).
- BEWARE that you must not enable xMIPv6 as it breaks hybrid hosts with wireless and wired interfaces.
You can also compile INET/INETMANET manually on the shell (make cleanall
, make makefiles
and make all
). But you might run into troubles with INETMANET and its xMIPv6 module as described above. The recommended way is to use the Eclipse IDE, disable xMIPv6 and compile INETMANET afterwards.
If INET/INETMANET compiles without errors, you are ready to set up a 6LoWPAN simulation.