zeek / packet-bricks

A netmap-based packet layer for distributing and filtering traffic.
Other
176 stars 30 forks source link

About bricks-shell runtime error #13

Open shuaidonga opened 5 years ago

shuaidonga commented 5 years ago

After I installed it according to the reademe documentation.
Execute in the shell. /bricks -d /usr/local/etc/bricks-scripts/utils.lua /usr/local/etc/bricks-scripts/configs/single-threaded-setups.lua Then execute the bricks-shell The following error occurred image

ajamshed commented 5 years ago

@shuaidonga,

Since you are using a remote lua shell to connect to the bricks daemon, I suggest that you type in your code as a block, e.g. lb = Brick.new("LoadBalancer", 2); lb:connect_input("eth5") in the shell. You should probably run the binary like: bricks -d -f /usr/local/etc/bricks-scripts/startup-one-thread.lua

As a start, I suggest that you try running packet-bricks as a foreground process (bricks-server [-f startup_script_file]). Your commands should eventually be written in the form of a lua function and then stored in a script (similar to functions as defined in startup-one-thread.lua.

shuaidonga commented 5 years ago

@ajamshed , i am try running packet-bricks as a foreground process.Some errors occurred during runtime. bricks> pe = PktEngine.new("e0", 1024, 1) bricks> lb = Brick.new("LoadBalancer", 2) bricks> lb:connect_input("eth5") bricks> lb:connect_output("eth5{0", "eth5{1", "eth5{2", "eth5{3") bricks> pe:link(lb) [ lb_init(): line 66] Adding brick eth5{0 to the engine [ promisc(): line 96] Interface eth5 is already set to promiscuous mode 673.628315 nm_open [542] NIOCREGIF failed eth5 [netmap_link_iface(): line 121] Unable to open eth5: Invalid argument [pktengine_link_iface(): line 331] Could not link!!! [brick_link(): line 113] Linking e0 with link eth5 with batch size: 512 and qid: -1 [netmap_create_channel(): line 746] brick: 0x7fdabf8177d0, local_desc: (nil) 673.628437 nm_open [542] NIOCREGIF failed eth5{0 [netmap_create_channel(): 771]>> ERROR!!: Can't open (nil)(netmap:eth5{0) image

ajamshed commented 5 years ago

Are you running as root (or with sudo)? Can you please check if example netmap applications are running fine (such as pkt-gen?

shuaidonga commented 5 years ago

@ajamshed I have run as root. Netmap application running is fine. image

ajamshed commented 5 years ago

@shuaidonga ,

Hmm.. interesting. I tested packet-bricks (FreeBSD version) just two weeks ago. I believe you are running the Linux version (based on your output log). Can you please share the following details with me:

1- Linux kernel version, 2- Netmap commit ID, 3- Network adapter specs, and 4- your lua startup script.

I will test out packet-bricks in my testbed once you have provided me the details. nm_open() is failing which means that some part of the netmap Linux API has changed since the last time I updated the code.

shuaidonga commented 5 years ago

@ajamshed More details are as following 1、Linux kernel version is 3.10.0-327.el7.x86_64 2、Netmap commit id is fbeeaeea43be8858be0895f19170377f06e77dd3 3、NIC information is Broadcom Corporation NetXtreme II BCM57810 10 Gigabit. NIC driver is bnx2x 4、bricks -f /usr/local/etc/bricks-scripts/startup-one-thread.lua

ajamshed commented 5 years ago

@shuaidonga ,

Does netmap support bnx2x NICs? Please read this: https://github.com/luigirizzo/netmap/tree/master/LINUX#nic-drivers. And then this: https://github.com/luigirizzo/netmap/issues/13.

Can you please verify whether you were emulating netmap with pkt-gen? Most likely packet-bricks fails at nm_open() because it is trying to create netmap pipes.

By the way, there is no netmap patch for bnx2x driver over here as well: https://github.com/luigirizzo/netmap/tree/master/LINUX/final-patches. Do you have an Intel NIC that you can try running packet-bricks with?