Code Monkey home page Code Monkey logo

nfd-nightly's Introduction

NFD nightly packages

NFD nightly logo

This repository contains a GitHub Workflow to generate .deb packages for NFD and other Named Data Networking software. Every week, the workflow builds each packages from the latest source code. Successfully built packages are subsequently published to an APT repository.

Instructions: https://nfd-nightly.ndn.today/

nfd-nightly's People

Contributors

yoursunny avatar

Watchers

 avatar  avatar  avatar

nfd-nightly's Issues

Python API "put_raw_packet" not Being Received

Environment:

  • Ubuntu 20.04 running on WSL2 (Windows 10)
  • Latest NFD-nightly packages (ensured before testing)
  • No registered routes or faces as both consumer and producer both running same machine
  • Python version 3.8

Problem:
When using the python-ndn, using the API, "put_data" works successfully; however making a data packet with "make_data" and using "put_raw_packet" to put the data packet is unsuccessful. The consumer receives no data packet which results in a timeout.

Steps to Produce
Using a basic consumer, provided below. (run using python3 consumer.py)

import logging
from ndn.app import NDNApp
from ndn.types import InterestNack, InterestTimeout, InterestCanceled, ValidationFailure
from ndn.encoding import Name
from argparse import ArgumentParser, SUPPRESS

logging.basicConfig(format='[{asctime}]{levelname}:{message}',
                    datefmt='%Y-%m-%d %H:%M:%S',
                    level=logging.INFO,
                    style='{')

async def consumer(app:NDNApp, name:Name):
    try:
        logging.info(f'Expressing Interest {Name.to_str(name)}')
        data_name, meta_info, content = await app.express_interest(name, must_be_fresh=True, can_be_prefix=False, lifetime=6000)
        logging.info(f'Received Data Name: {Name.to_str(data_name)}')
        logging.info(f'\t{meta_info}')
        if content:
            logging.info(f'\tContent: {bytes(content).decode()}')
        else:
            logging.info(f'\tContent: None')
    except InterestNack as e:
        logging.warning(f'Nacked with reason={e.reason}')
    except InterestTimeout:
        logging.warning(f'Timeout')
    except InterestCanceled:
        logging.warning(f'Canceled')
    except ValidationFailure:
        logging.warning(f'Data failed to validate')
    finally:
        app.shutdown()

def main():
    # Command Line Parser
    parser = ArgumentParser(add_help=False,description="Request an Interest")
    requiredArgs = parser.add_argument_group("required arguments")
    optionalArgs = parser.add_argument_group("optional arguments")
    # Adding All Command Line Arguments
    requiredArgs.add_argument("-n","--name",required=True,help="name of the interest")
    optionalArgs.add_argument("-h","--help",action="help",default=SUPPRESS,help="show this help message and exit")
    # Getting All Arugments
    args = vars(parser.parse_args())
    name = Name.from_str('/sample') + Name.from_str(args["name"])
    app = NDNApp()
    try:
        app.run_forever(after_start=consumer(app, name))
    except FileNotFoundError:
        logging.warning(f'Error: could not connect to NFD')

if __name__ == '__main__':
    main()

Using a basic producer, provided below. (run using python3 producer.py)

from typing import Optional
from ndn.app import NDNApp
from ndn.encoding import Name, InterestParam, BinaryStr, FormalName, MetaInfo, make_data
import logging
import sys

logging.basicConfig(format='[{asctime}]{levelname}:{message}',
                    datefmt='%Y-%m-%d %H:%M:%S',
                    level=logging.INFO,
                    style='{')

app = NDNApp()
logging.info(f'NDN Producer Startup')

@app.route('/sample')
def on_interest(name: FormalName, param: InterestParam, app_param: Optional[BinaryStr]):
    logging.info(f'Received an Interest')
    print(f'\n>> I: {Name.to_str(name)}, {param}, {Name.to_str(app_name) if app_param else None}')
    content = str("HELLO THIS IS A TEST").encode()
    #app.put_data(name, content=content, freshness_period=500, final_block_id=None)
    data_packet = make_data(name, MetaInfo(freshness_period=500, final_block_id=None), content)
    app.put_raw_packet(data_packet)

    print(f'<< D: {Name.to_str(name)}')
    print(f'\t{MetaInfo(freshness_period=500, final_block_id=None)}')
    print(f'\tContent: {content}\n')

def main():
    logging.info(f'listening to prefix /')
    try:
        app.run_forever()
    except FileNotFoundError:
        logging.warning(f'Error: could not connect to NFD')

if __name__ == "__main__":
    sys.exit(main())

Running ndn-cxx trivial examples with NFD-nightly

I may be blind to using C++ packages in general but I aim to learn. I figured that reaching out was the best way to get the answers I require the quickest. Hopefully you have time to help me.

I am using NFD-nightly, I have it fully installed with ndn-cxx, and I am looking to how I would compile C++ with the installed library.
Lets say, I want to compile the simple consumer and producer which leads me to have consumer.cpp and producer.cpp. How would I then compile them using g++ (without forming an entire waf build config)?

Modifying the statement below..
g++ -o producer producer.cpp // throws errors relating to the library

Frequent Prefix Registration Failure

System: Ubuntu 20.04

Forwarder Version: NFD-nightly, latest pull

Scope: Likely just my machine / Individual Experience via configuration / setup

Error Frequency: Around 1 per 10 registrations

Problem: When working with applications (running it multiple times) that listen to around 6+ different prefixes, I occasionally get this error Registration for PREFIX failed: 403 authorization rejected. Since the frequency does not happen every run, I am able to just restart the application in order to successfully test what I need to test. However, I am curious on what could be the issue and ways to prevent this. What do you suggest or know about this problem? Any configuration that might help?

Notes: Everything else related to the Forwarder works as intended and I can perform all the other related operations.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.