princeton-cabernet / beaucoup Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU Affero General Public License v3.0
License: GNU Affero General Public License v3.0
There is another issue here. When I run the python simulator, it reports errors as follows.
$ python3 py/simulator.py --seed=1 test/IR.json test/caida0.npy test/reports.npz
Traceback (most recent call last): File "py/simulator.py", line 34, in <module> lib_eval.simulate_run(args.npy_filename, args.out_filename, IR, args.seed, debug=args.verbose) File "/home/ltang/Workspace/research/store/BeauCoup/py/core/lib_eval.py", line 189, in simulate_run val=h_compute[j](Trace[i]) File "/home/ltang/Workspace/research/store/BeauCoup/py/core/lib_eval.py", line 108, in <lambda> return lambda val:pull_pack_and_compute(list_indexes,val, mask, seedbytes, Pack_formatstring) File "/home/ltang/Workspace/research/store/BeauCoup/py/core/lib_eval.py", line 105, in pull_pack_and_compute base+=struct.pack(Pack_formatstring[i],value_list[i]) struct.error: short format requires (-0x7fff - 1) <= number <= 0x7fff
The IR.json is compiled from the query_examples.yaml file in BeauCoup folder.
How to reproduce:
python3 py/compiler.py -v --gamma=1.0 query_examples.yaml IR.json
from repository rootpython3 py/p4gen.py -v IR.json p4src/beaucoup.p4template beaucoup.p4
I pinpointed this issue to the following blocks in the Jinja2 template:
{% for i in range(16) %}
{% if K1 in keydefn[i] %}
{{i}} : {{A1}}();
{% endif %}
{% if K2 in keydefn[i] %}
{{i}} : {{A2}}();
{% endif %}
{% endfor %}
The template receives the following dictionary as keydefn
argument, which does not have a "0"-element:
{1: ('hdr.ipv4.src_addr',), 2: ('hdr.ipv4.dst_addr', 'hdr.tcp.dst_port'), 3: ('hdr.ipv4.src_addr', 'hdr.ipv4.dst_addr'), 4: ('hdr.ipv4.dst_addr',), 5: ('hdr.ipv4.src_addr', 'hdr.tcp.dst_port'), 6: ('hdr.ipv4.src_addr', 'hdr.udp.dst_port'), 7: ('hdr.ipv4.dst_addr', 'hdr.udp.dst_port'), 8: ('hdr.ipv4.src_addr', 'hdr.ipv4.dst_addr', 'hdr.tcp.src_port'), 9: ('hdr.ipv4.src_addr', 'hdr.ipv4.dst_addr', 'hdr.udp.src_port'), 10: ('hdr.ipv4.src_addr', 'hdr.ipv4.dst_addr', 'hdr.tcp.dst_port'), 11: ('hdr.ipv4.src_addr', 'hdr.ipv4.dst_addr', 'hdr.udp.dst_port'), 12: ('hdr.ipv4.src_addr', 'hdr.ipv4.dst_addr', 'hdr.tcp.src_port', 'hdr.tcp.dst_port')}
Am I doing something wrong? Or is there an issue with the template?
The program work just fine, but I was wondering why you choose P4 switch?
Is there a necessary need for using P4 switch.
when running python3 py/trace_prep.py ../../dataset/pcap/test.pcap test/caida0.npy
I have the following error:
Traceback (most recent call last): File "py/trace_prep.py", line 22, in <module> nparray = lib_eval.parse_pcap_into_npy(args.PCAP_filename, args.count, args.verbose) File "/home/ltang/Workspace/research/store/BeauCoup/py/core/lib_eval.py", line 79, in parse_pcap_into_npy packets_numerical.append(tuple(to_list(pdict))) File "/home/ltang/Workspace/research/store/BeauCoup/py/core/lib_eval.py", line 73, in to_list line[i]=int(line[i]) TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
Note that test.pcap is a small pcap file extract from CAIDA18 traces
Hi Xiaoqi,
In py/core/lib_eval.py, line293, should it be
vect=trial_finish[QID]
?
I cannot get correct error results with vect=trial_finish[qid]
.
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.