How I managed to run libcoap in DCE 1.9

455 views
Skip to first unread message

Samet Tonyalı

unread,
Mar 4, 2017, 4:08:54 AM3/4/17
to ns-3-users
Hi all,

I dont have a question this time as you can understand from the subject. I will explain how I managed to run obgm's libcoap implementation in DCE 1.9.

Almost 8 months ago, I needed to use libcoap in ns-3 so I tried to run it in DCE 1.8 but I couldnt run it. I had posted a question about the problem in this group, but I was not able to run it successfully.

For another reason, I needed to use it again so decided to give another try.

You can find my system specs and the steps below that I followed to run libcoap in DCE 1.9. Please note that this is tested only on Ubuntu 14.04. Also, I am assuming you are already installed all required external libraries

1) First of all, download the DCE and build it as described in the manual.
2) Download the libcoap, navigate to that folder in the terminal and follow those steps
    a) ./autogen.sh
    b) ./configure --enable-examples CFLAGS="-fPIC -pie -rdynamic -U_FORTIFY_SOURCE"
    c) make
    d) make check
    e) sudo make install
    f) sudo make installcheck
Item b configures the installation so that the runnable files are created as shared objects not traditional executables. In the end of these commands, you will have two shared server and client objects in your /usr/local/bin folder.
3) Add those lines into the end of bashrc file under your home directory and restart your terminal. Please be aware of that this is a hidden file
    a) export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
    b) export DCE_PATH=$DCE_PATH:/usr/local/bin
Item b points where to look to find the shared objects we will use in our ns3 script.
4) Create a folder named, for example, coap in dce/source/ns-3-dce/myscripts folder and copy the files that I attached.
5) Navigate to dce/source/ns-3-dce in the terminal and run this command
    a) ./waf --run dce-coap

This worked in my setup. I hope I didnt skip any step.

If you experience any problems please do not hesitate to ask.

Regards,
Samet Tonyali
dce-coap.cc
wscript

Konstantinos

unread,
Mar 5, 2017, 6:17:28 PM3/5/17
to ns-3-users
Hi,

This looks interesting.
Would you care contributing a HOW-TO page in the ns-3 wiki?

Regards,
K

Samet Tonyalı

unread,
Mar 6, 2017, 11:50:39 AM3/6/17
to ns-3-...@googlegroups.com
Sure. I will try to add a HowTo as soon as I have time.

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+unsubscribe@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.



--
Samet TONYALI
Tel: 618-303 78 11

Hajer Boujezza

unread,
Mar 6, 2017, 1:18:37 PM3/6/17
to ns-3-users
Hi Samet,
I followed the described steps, but after running ./waf --run dce-coap, I received this error message:

Waf: Entering directory `/home/hajjoura/dce_advanced/source/ns-3-dce/build'

--------------------------------------------------------------------
 Python bindings compilation
--------------------------------------------------------------------
[ 10/377] lib/pkgconfig/libns3-dev-netlink-debug.pc:  -> build/lib/pkgconfig/libns3-dev-netlink-debug.pc
[116/377] lib/pkgconfig/libns3-dev-dce-debug.pc:  -> build/lib/pkgconfig/libns3-dev-dce-debug.pc
Waf: Leaving directory `/home/hajjoura/dce_advanced/source/ns-3-dce/build'
'build' finished successfully (1.266s)
assert failed. cond="exeFullPath.length () > 0", msg="Executable 'coap-server' not found !  Please check your DCE_PATH and DCE_ROOT environment variables.", file=../model/dce-manager.cc, line=260
terminate called without an active exception
Command ['/home/hajjoura/dce_advanced/source/ns-3-dce/build/myscripts/coap/bin/dce-coap'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").

Hajer Boujezza

unread,
Mar 6, 2017, 3:23:00 PM3/6/17
to ns-3-users
Hi all,
I successfully run it.
You should add the two lines under: /etc/bash.bashrc
a) export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
b) export DCE_PATH=$DCE_PATH:/usr/local/bin

thank you Samet for this great tuto

Le samedi 4 mars 2017 10:08:54 UTC+1, Samet Tonyalı a écrit :

Vishal Rathod

unread,
Apr 19, 2018, 1:27:15 AM4/19/18
to ns-3-users
Hello sir,

I have tried to install libcoap in my system. I got the error like xsltproc didn't find in coap_attribute.xml.

I didn't get it actually. What it means.

Samet Tonyalı

unread,
Apr 19, 2018, 4:12:10 PM4/19/18
to ns-3-...@googlegroups.com
I dont remember such an error. Could you please briefly describe what you have done?

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.

Vishal Rathod

unread,
Apr 20, 2018, 1:48:24 AM4/20/18
to ns-3-users
I followed the steps that you have mentioned. I have installed DCE correctly and then start to install libcoap. First two steps are working correctly but when I have tried to make it shows me below error.

make[2]: Entering directory '/home/vishal/Desktop/libcoap-develop/man'
/usr/bin/a2x --doctype manpage --format manpage coap_attribute.txt
a2x: ERROR: "xsltproc"  --stringparam callout.graphics 0 --stringparam navig.graphics 0 --stringparam admon.textlabel 1 --stringparam admon.graphics 0  "/etc/asciidoc/docbook-xsl/manpage.xsl" "/home/vishal/Desktop/libcoap-develop/man/coap_attribute.xml" returned non-zero exit status 127
Makefile:695: recipe for target 'coap_attribute.3' failed
make[2]: *** [coap_attribute.3] Error 1
make[2]: Leaving directory '/home/vishal/Desktop/libcoap-develop/man'
Makefile:991: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/vishal/Desktop/libcoap-develop'
Makefile:600: recipe for target 'all' failed
make: *** [all] Error 2
vishal@vishal-OptiPlex-9020:~/Desktop/libcoap-develop$ 

In my system, asciidoc and a2x are perfectly installed. I tried several other solutions but they didn't work. 

Regards,
Vishal

Samet Tonyalı

unread,
Apr 25, 2018, 12:11:26 AM4/25/18
to ns-3-...@googlegroups.com
I am sorry, but I didn't face such problems. It may be about a missing external library. BTW, they have changed the source code significantly after I used it.

Vishal Rathod

unread,
Apr 25, 2018, 12:26:51 AM4/25/18
to ns-3-...@googlegroups.com
ok, sir.

Thanks for the reply.

To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+unsubscribe@googlegroups.com.

To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/t4dH9teYiIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+unsubscribe@googlegroups.com.

To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.



--
Vishal Rathod
Research Scholar,
Computer Science and Engineering Department,
National Institute of Technology, Karnataka.


Vishal Rathod

unread,
May 2, 2018, 6:19:27 AM5/2/18
to ns-3-users
Hello sir,

I resolved the error. It's a package problem. After instaling the package, I can run all commands. 

Now, I am trying to run the example. If I have any problem, then I will ask. 

Regards,
Vishal
Reply all
Reply to author
Forward
0 new messages