Project

General

Profile

Actions

Task #1141

closed

ping application

Added by Junxiao Shi almost 11 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Normal
Category:
Tools
Target version:
Start date:
Due date:
01/28/2014
% Done:

100%

Estimated time:
6.00 h

Description

Develop a ping application, including client and server.

Client and server should both talk in NDN-TLV packet format.
The server should use NFD FIB Management protocol.

This application should be tested against ndnd-tlv.
The code for this program goes in ndn-tlv-ping repository.


Related issues 1 (0 open1 closed)

Blocked by NFD - Task #1124: FIB management protocolClosedJunxiao Shi

Actions
Actions #1

Updated by Alex Afanasyev almost 11 years ago

  • Target version set to v0.1
Actions #2

Updated by Junxiao Shi almost 11 years ago

  • Description updated (diff)
  • Due date changed from 01/25/2014 to 01/28/2014
Actions #3

Updated by Junxiao Shi almost 11 years ago

  • Description updated (diff)
  • Target version changed from v0.1 to Mock
Actions #4

Updated by Jerald Paul Abraham almost 11 years ago

  • Status changed from New to In Progress
  • Target version changed from Mock to v0.1
  • % Done changed from 0 to 80

Development almost complete. Facing issue with Face::setInterestFilter() while testing.
The subsequent registration of a prefix fails after server side is restarted.
The same issue was observed with the producer.cpp example.

Steps To Recreate:

  1. Run ndnd-tlv-start
  2. Run ./producer
  3. Check prefix presence with ndnd-tlv-status
  4. Stop ./producer
  5. Check prefix absence with ndnd-tlv-status
  6. Run ./producer
  7. Check prefix presence with ndnd-tlv-status - PREFIX DOES NOT APPEAR
Actions #5

Updated by Junxiao Shi almost 11 years ago

Please upload your code to a public GitHub repository so I can help.

Actions #6

Updated by Jerald Paul Abraham almost 11 years ago

The issue is reproducible with the ndncpp examples which is why I suspect it may be with the library. The previous ndnping with ndnx does not have this issue. Please see my previous update for exact scenario replication steps.

ndn-tlv-ping Public Development Repository

https://github.com/jeraldabraham/ndn-tlv-ping
Note: The code compiles but requires is not fully completed.

Actions #7

Updated by Jerald Paul Abraham almost 11 years ago

Jerald Paul Abraham wrote:

The issue is reproducible with the ndncpp examples which is why I suspect it may be with the library. The previous ndnping with ndnx does not have this issue. Please see my previous update for exact scenario replication steps.

ndn-tlv-ping Public Development Repository

https://github.com/jeraldabraham/ndn-tlv-ping

Note: The code compiles but is not fully complete

Actions #8

Updated by Junxiao Shi almost 11 years ago

I believe the prefix doesn't show up after producer restart is a bug in ndnd-tlv.
It is reported as ndnd-tlv issue 1.

Actions #9

Updated by Alex Afanasyev almost 11 years ago

This actually a small bug in ndn-cpp. The registration request is not unique (in the current hack) and require MustBeFresh selector, which is not by default assumed in NDN-TLV.

Actions #10

Updated by Jerald Paul Abraham almost 11 years ago

  • Status changed from In Progress to Code review

Public Repository URL:
https://github.com/jeraldabraham/ndn-tlv-ping

Notes:

  • I have to complete the README file
  • Not very good with waf script creations so I have made a usual makefile
  • To run the following must be ensured
    • Install ndnx
    • Install ndn-tlv
    • Install ndn-cpp
    • Install and Configure Security Environment with ndn-cpp-security-tools

Basic Run Instructions:
git clone git://github.com/jeraldabraham/ndn-tlv-ping ndntlvping
cd ndntlvping
make
sudo make install

Actions #11

Updated by Jerald Paul Abraham almost 11 years ago

  • % Done changed from 80 to 100

Public Repository URL:

https://github.com/jeraldabraham/ndn-tlv-ping


Notes:

  • The present build script is a simple makefile
  • To run the following must be ensured
    • Install ndnx
    • Install ndn-tlv
    • Install ndn-cpp
    • Install and Configure Security Environment with ndn-cpp-security-tools

Basic Run Instructions:

  • git clone git://github.com/jeraldabraham/ndn-tlv-ping ndntlvping
  • cd ndntlvping
  • make
  • sudo make install
Actions #12

Updated by Junxiao Shi almost 11 years ago

  • Description updated (diff)

I did a brief code review.
Line comments and bugs are added on GitHub.

Actions #13

Updated by Jerald Paul Abraham almost 11 years ago

Also, the application requires libboost1.47(boost/asio/signal_set.hpp) or higher to handle signals from the user that will abruptly stop the application execution. Have updated this requirement in the README and the code should build and execute successfully now.

Actions #14

Updated by Junxiao Shi almost 11 years ago

  • Category set to Tools
Actions #15

Updated by Alex Afanasyev almost 11 years ago

Jeral, i hope you saw the uploaded patch to ping to gerrit (http://gerrit.named-data.net/#/c/195/). Can you review it and if it's ok, incorporate with your code?

Actions #16

Updated by Jerald Paul Abraham almost 11 years ago

Yes I tested it on Ubuntu and it works fine, the application gets compiled and installed without issues. However, it failed on OSX and mentioned that it could not find pkg-config even when it was installed. I am assuming OSX installations are made available per user and was therefore inaccessible for my user account. Will check that and update.

Actions #17

Updated by Junxiao Shi almost 11 years ago

OS X pkg-config shouldn't be per-user. On Arizona's Mac Mini:

monaco:~ jeraldabraham$ which pkg-config
/opt/local/bin/pkg-config
monaco:~ jeraldabraham$ pkg-config --cflags --libs libndn-cpp-dev
-I/opt/local/include -L/opt/local/lib -lsqlite3 -lndn-cpp-dev -lssl -lcrypto -lcryptopp -framework Security -lboost_system-mt -lboost_filesystem-mt 

Here libndn-cpp-dev is installed from Macports.

Actions #18

Updated by Alex Afanasyev almost 11 years ago

Are you using macports? You may need to configure PKG_CONFIG_PATH (add a note in README.md or INSTALL.md)

Depending on where you have installed ndn-cpp-dev (assuming in /usr/local):

PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./waf configure 

If ndn-cpp-dev is installed from macports, then

PKG_CONFIG_PATH=/opt/local/lib/pkgconfig ./waf configure 
Actions #19

Updated by Jerald Paul Abraham almost 11 years ago

Here is an extract pf the config log waf produces when it fails to find pkg-config

    ----------------------------------------
    Checking for program pkg-config
    not found
    find program=['pkg-config'] paths=['/usr/bin', '/bin', '/usr/sbin', '/sbin', '/usr/local/bin'] var='PKGCONFIG' -> ''
    from /Users/jeraldabraham/ndn/src/ndntlvping: Could not find the program pkg-config

The OSX box has pkg-config installed inside the opt folder, this is another reason why compilation also fails to find the boost libraries even when boost is installed on the machine (but it is incide the /opt path and not in the usual /usr path).

Actions #20

Updated by Alex Afanasyev almost 11 years ago

Oh. That is simple :)

sudo port install pkgconfig

Updated:
Misread your reply. Still simple, but different approach. You need to update your PATH variable (which for some reason does not include /opt/local/bin). Or you can specify pkgconfig program directly

PKGCONFIG=/opt/local/bin/pkg-config ./waf configure

To update PATH, I have the following in my ~/.bashrc file:

export PATH=\
/opt/local/bin:/opt/local/sbin:\
/usr/local/bin:\
$PATH
Actions #21

Updated by Jerald Paul Abraham almost 11 years ago

No Alex. pkgconfig was already installed.
The issue stopped after I configured the PKGCONFIG variable.

    export PKGCONFIG=/opt/local/lib/pkgconfig

Now the issue is with the ndn-cpp-dev library

    ----------------------------------------
    Checking for 'libndn-cpp-dev'
    ['/opt/local/lib/pkgconfig', '--cflags', '--libs', 'libndn-cpp-dev']
    not found
    from /Users/jeraldabraham/ndn/src/ndntlvping: The configuration failed

I am sure the latest ndn-cpp-dev code in git includes a waf script which configures pkgconfig for library flags retrieval.
However, I think the OSX machine needs to be installed with this latest ndn-cpp-dev library as the new one was updated on git just a few days ago.

Actions #22

Updated by Alex Afanasyev almost 11 years ago

What about this:

PKGCONFIG=/opt/local/bin/pkg-config PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./waf configure

or

export PKGCONFIG=/opt/local/bin/pkg-config
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
./waf configure
Actions #23

Updated by Junxiao Shi almost 11 years ago

Alex Afanasyev wrote:

PKGCONFIG=/opt/local/bin/pkg-config PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./waf configure

This definitely will not work.

Macports installs to a weird location:

monaco:ndn-tlv-ping shijunxiao$ ls /opt/local/lib/pkgconfig/libndn-cpp-dev.pc 
/opt/local/lib/pkgconfig/libndn-cpp-dev.pc
Actions #24

Updated by Jerald Paul Abraham almost 11 years ago

Yes the follow ensures the configure succeeds.

    export PKGCONFIG=/opt/local/bin/pkg-config
    export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
    ./waf configure

But I still think the ndn-cpp-dev library needs to be updated.

    ../ndn-tlv-pingserver.cpp:27:13: error: no matching conversion for functional-style cast from 'ptr_lib::shared_ptr<boost::asio::io_service>' to 'ndn::Face'
    face_ = Face(ioService_);

I remember that this constructor was recently added. How can I check if the ndn-cpp-dev library installed on a machine is up to date?

Actions #25

Updated by Junxiao Shi almost 11 years ago

Jerald Paul Abraham wrote:

But I still think the ndn-cpp-dev library needs to be updated.

    ../ndn-tlv-pingserver.cpp:27:13: error: no matching conversion for functional-style cast from 'ptr_lib::shared_ptr<boost::asio::io_service>' to 'ndn::Face'
    face_ = Face(ioService_);

This is what I have from Macports. I already executed sudo port selfupdate.

monaco:ndn-tlv-ping shijunxiao$ sudo port info ndn-cpp-dev
ndn-cpp-dev @0.2.2_1 (net)
Variants:             universal

Description:          C++ development library for NDN.
Homepage:             https://github.com/cawka/ndn-cpp

Build Dependencies:   autoconf, automake, libtool
Library Dependencies: boost, openssl, libcryptopp, sqlite3
Platforms:            darwin
License:              BSD

This looks like an old version.

One solution is adding a --with-ndn-cpp-dev option to wscript, so that you can specify a user copy of libndn-cpp-dev

Actions #26

Updated by Alex Afanasyev almost 11 years ago

I have removed that option, since compiling against the library requires a number of dependencies that are known to the library during compilation, but cannot be easily guessed when linking to the library.

In any case, I just updated macports definitions, so you should sudo port selfupdate and then reinstall ndn-cpp-dev, ndnd-tlv, and ndn-cpp-security-tools (I recommend reinstalling, not updating, but either should work).

Actions #27

Updated by Jerald Paul Abraham almost 11 years ago

I have added the waf script with the ndn-tlv-ping repository.
The waf building works fine one Ubuntu and OSX.

Actions #28

Updated by Junxiao Shi over 10 years ago

  • Status changed from Code review to Closed

This task shouldn't be in "Code Review" because its code is not hosted on Gerrit.

I confirm the basic functionality of ndn-tlv-ping is working, so I'm closing this task.

Actions

Also available in: Atom PDF