cn-uofbasel / picn Goto Github PK
View Code? Open in Web Editor NEWPiCN: Python ICN and NFN by University of Basel
License: BSD 3-Clause "New" or "Revised" License
PiCN: Python ICN and NFN by University of Basel
License: BSD 3-Clause "New" or "Revised" License
def components_to_string in Name.py uses decode(ascii).
Decoding non-ascii chars leads to a UnicodeDecodeError which isn't caught.
Occurs rarely:
======================================================================
1) FAIL: Test a simple forwarding scenario with one additional node forwarding the data
----------------------------------------------------------------------
Traceback (most recent call last):
/home/claudio/software/PiCN/PiCN/ProgramLibs/NFNForwarder/test/test_NFNForwarder.py line 164 in test_NFNForwarder_simple_compute_two_nodes
self.assertEqual(len(self.forwarder1.pit.container), 0)
AssertionError: 1 != 0
Sending 'shutdown' is not handled properly (sent with Mgmt.py):
2018-01-31 16:36:17,998 - MgmtSys INFO: Shutdown
Process Process-6:
Traceback (most recent call last):
File "/usr/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "/home/claudio/software/PiCN/PiCN/Mgmt/Mgmt.py", line 157, in _run
self.mgmt(mgmt_sock)
File "/home/claudio/software/PiCN/PiCN/Mgmt/Mgmt.py", line 79, in mgmt
self.shutdown()
File "/home/claudio/software/PiCN/PiCN/ProgramLibs/ICNForwarder/ICNForwarder.py", line 86, in stop_forwarder
self.mgmt.stop_process()
File "/home/claudio/software/PiCN/PiCN/Mgmt/Mgmt.py", line 165, in stop_process
self.process.terminate()
File "/usr/lib/python3.6/multiprocessing/process.py", line 116, in terminate
self._popen.terminate()
AttributeError: 'NoneType' object has no attribute 'terminate'
6 Unit Tests in the BasicPacketEncodingLayer rely on Simple Packet Format.
Three Options:
Occasionally, a software test fails due to OS Error "Address already in use":
======================================================================
1) ERROR: Test adding content
----------------------------------------------------------------------
Traceback (most recent call last):
/home/claudio/software/PiCN/PiCN/Mgmt/test/test_Mgmt.py line 24 in setUp
self.linklayer = UDP4LinkLayer(9000+self.portoffset)
/home/claudio/software/PiCN/PiCN/Layers/LinkLayer/UDP4LinkLayer.py line 25 in __init__
self.sock.bind(("0.0.0.0", self._port))
OSError: [Errno 98] Address already in use
Hello guys,
I'm new in python and using PiCN too.
I follow the steps in your guthub to test the PiCN example but I have an error that I don't understand.
While running this command picn-repo --format ndntlv /tmp/repo /the/prefix 10000 &
I have the following error : Traceback (most recent call last): File "/home/ubuntu/PiCN/PiCN/Executable/ICNDataRepository.py", line 6, in <module> from PiCN.ProgramLibs.ICNDataRepository import ICNDataRepository File "/home/ubuntu/PiCN/PiCN/ProgramLibs/ICNDataRepository/__init__.py", line 3, in <module> from .ICNDataRepository import ICNDataRepository File "/home/ubuntu/PiCN/PiCN/ProgramLibs/ICNDataRepository/ICNDataRepository.py", line 59 self.repo: BaseRepository = SimpleMemoryRepository(prefix, manager, logger) ^ SyntaxError: invalid syntax
I use python version 3.7 in ubuntu 16.04.
Your help will be appreciated.
Inside the NFN Parser, the Escapes seem to be deprecated
Seems, tests must be in a separate Tree to switch to python-buildin tests.
Remove @unittest.skip("No Nack Crafting for NDNTLV yet") from Tests as soon as NACK Crafting is available for NDNTLV.
This temporally disables tests for for NDNTLV where a nack is required.
Do we need tests for the packet encoder or do we assume, they are working correctly?
NACK reason "No PIT Entry found" looks wrong and should be reviewed. Seen twice:
Layers/NFNLayer/test/test_BasicNFNLayer.py:242:
nack = Nack(name, reason="No PIT Entry found", interest=interest)
Layers/NFNLayer/test/test_BasicNFNLayer.py:267:
nack = Nack(name, reason="No PIT Entry found", interest=interest)
It occurs very rarely that a test fails with to the following output.
Looks like a race condition?
> python3 setup.py nosetests
running nosetests
running egg_info
writing PiCN.egg-info/PKG-INFO
writing dependency_links to PiCN.egg-info/dependency_links.txt
writing top-level names to PiCN.egg-info/top_level.txt
reading manifest file 'PiCN.egg-info/SOURCES.txt'
writing manifest file 'PiCN.egg-info/SOURCES.txt'
Searching for nose2
Best match: nose2 0.7.3
Processing nose2-0.7.3-py3.6.egg
Using /home/claudio/software/PiCN/.eggs/nose2-0.7.3-py3.6.egg
Searching for coverage>=4.4.1
Best match: coverage 4.4.2
Processing coverage-4.4.2-py3.6-linux-x86_64.egg
Using /home/claudio/software/PiCN/.eggs/coverage-4.4.2-py3.6-linux-x86_64.egg
.............................................................................
.............................................................................
...........................Exception in thread Thread-88:
Traceback (most recent call last):
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/home/claudio/software/PiCN/PiCN/Layers/NFNLayer/BasicNFNLayer.py", line 172, in handle_computation_queue
for cid in running_computations.keys():
RuntimeError: dictionary changed size during iteration
I encountered the following stacktraces (on separate occasions), crashing the BasicICNLayer process:
Process Process-98:
Traceback (most recent call last):
File "/usr/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File ".../picn/PiCN/Processes/LayerProcess.py", line 144, in _run
self._run_poll(from_lower, from_higher, to_lower, to_higher)
File ".../picn/PiCN/Processes/LayerProcess.py", line 85, in _run_poll
self.data_from_lower(to_lower, to_higher, from_lower.get())
File ".../picn/PiCN/Layers/ICNLayer/BasicICNLayer.py", line 83, in data_from_lower
self.handle_interest(face_id, packet, to_lower, to_higher, False)
File ".../picn/PiCN/Layers/ICNLayer/BasicICNLayer.py", line 103, in handle_interest
self.update_timestamp_in_pit(pit_entry)
File ".../picn/PiCN/Layers/ICNLayer/BasicICNLayer.py", line 282, in update_timestamp_in_pit
pit.update_timestamp(pit_entry)
File ".../picn/PiCN/Layers/ICNLayer/PendingInterestTable/PendingInterestTableMemoryExact.py", line 40, in update_timestamp
self._container.remove(pit_entry)
ValueError: list.remove(x): x not in list
Process Process-58:
Traceback (most recent call last):
File "/usr/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File ".../picn/PiCN/Processes/LayerProcess.py", line 144, in _run
self._run_poll(from_lower, from_higher, to_lower, to_higher)
File ".../picn/PiCN/Processes/LayerProcess.py", line 85, in _run_poll
self.data_from_lower(to_lower, to_higher, from_lower.get())
File ".../picn/PiCN/Layers/ICNLayer/BasicICNLayer.py", line 83, in data_from_lower
self.handle_interest(face_id, packet, to_lower, to_higher, False)
File ".../picn/PiCN/Layers/ICNLayer/BasicICNLayer.py", line 115, in handle_interest
self.add_used_fib_entry_to_pit(interest.name, new_face_id)
File ".../picn/PiCN/Layers/ICNLayer/BasicICNLayer.py", line 266, in add_used_fib_entry_to_pit
pit.add_used_fib_entry(name, used_fib_entry)
File ".../picn/PiCN/Layers/ICNLayer/PendingInterestTable/PendingInterestTableMemoryExact.py", line 47, in add_used_fib_entry
self._container.remove(pit_entry)
ValueError: list.remove(x): x not in list
Content from local may be meaningful even if there is no PIT entry. Cache it?
No routing solution was found in the code.
.... this is in one or the other way required for ageing!
Enhance escaping of special characters for ASCII interpretation of blobs (e.g. newline, backspace)
Only a problem in some terminals (e.g urxvt) but not in others (pycharm built-in).
claudio@notebook ~> picn-relay --format simple
2018-12-19 11:42:44,328 - ICNForwarder INFO: Starting a CCN Forwarder...
2018-12-19 11:42:44,329 - ICNForwarder INFO: UDP Port: 9000
2018-12-19 11:42:44,329 - ICNForwarder INFO: Log Level: info
2018-12-19 11:42:44,329 - ICNForwarder INFO: Packet Format: simple
Traceback (most recent call last):
File "/home/claudio/software/PiCN/PiCN/Executable/ICNForwarder.py", line 89, in <module>
main(args)
File "/home/claudio/software/PiCN/PiCN/Executable/ICNForwarder.py", line 76, in main
forwarder = PiCN.ProgramLibs.ICNForwarder.ICNForwarder(args.port, log_level, encoder, autoconfig=args.autoconfig)
File "/home/claudio/software/PiCN/PiCN/ProgramLibs/ICNForwarder/ICNForwarder.py", line 42, in __init__
encoder.set_log_level(log_level)
TypeError: set_log_level() missing 1 required positional argument: 'log_level'
Works fine with "ndntlv" packet format:
claudio@notebook ~> picn-relay --format ndntlv
2018-12-19 11:44:58,652 - ICNForwarder INFO: Starting a CCN Forwarder...
2018-12-19 11:44:58,652 - ICNForwarder INFO: UDP Port: 9000
2018-12-19 11:44:58,652 - ICNForwarder INFO: Log Level: info
2018-12-19 11:44:58,652 - ICNForwarder INFO: Packet Format: ndntlv
Potential Enhancements for picn-setup
:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.