### Start Example NF with Simple Arguments Source: https://github.com/sdnfv/opennetvm/blob/master/docs/Releases.md Use this script to start an example NF with basic service ID and optional arguments. The NF name is derived from the first argument. ```sh ./start_nf.sh speed_tester 1 -d 1 ``` -------------------------------- ### Start Example NF with Complex Arguments Source: https://github.com/sdnfv/opennetvm/blob/master/docs/Releases.md This script allows starting an example NF with DPDK arguments, ONVM arguments, and NF-specific arguments. It uses '--' to separate argument groups. ```sh ./start_nf.sh speed_tester -l 4 -- -s -r 6 -- -d 5 ``` -------------------------------- ### Example onvm_mgr Setup Source: https://github.com/sdnfv/opennetvm/blob/master/examples/ndpi_stats/README.md Demonstrates a sample setup for onvm_mgr to resolve NF/mgr hugepage memory layout discrepancies. ```bash ./go.sh 0,1,2,3 3 -v 0x7f000000000 -s stdout ``` -------------------------------- ### Example: Basic Monitor NF Container Source: https://github.com/sdnfv/opennetvm/blob/master/docs/Docker.md This example demonstrates starting a container for a basic monitor NF. It maps two NIC devices, the hugepage directory, and the openNetVM source directory into the container. ```bash sudo ./docker.sh -h /mnt/huge -o /root/openNetVM -n Basic_Monitor_NF -D /dev/uio0,/dev/uio1 ``` -------------------------------- ### DPDK Setup Script Source: https://github.com/sdnfv/opennetvm/blob/master/docs/Install.md Steps to configure DPDK components using its setup script, including compiling, installing drivers, setting up hugepages, and registering ports. ```sh Run `dpdk/usertools/dpdk-setup.sh` then: - Press [38] to compile x86_64-native-linuxapp-gcc version - Press [45] to install igb_uio driver for Intel NICs - Press [49] to setup 1024 2MB hugepages - Press [51] to register the Ethernet ports - Press [62] to quit the tool ``` -------------------------------- ### Example: Speed Tester NF Container with Command Source: https://github.com/sdnfv/opennetvm/blob/master/docs/Docker.md This example shows how to start a container for a speed tester NF. It maps one NIC device and the openNetVM directory, and specifies a command to run the NF in detached mode. ```bash sudo ./docker.sh -h /mnt/huge -o /root/openNetVM -n Speed_Tester_NF -D /dev/uio0 -c "./examples/start_nf.sh speed_tester 1 -d 1" ``` -------------------------------- ### Example onvm_mgr Setup for Memory Layout Source: https://github.com/sdnfv/opennetvm/blob/master/docs/Debug.md An example command for setting up onvm_mgr, potentially to resolve memory layout discrepancies with complex NFs by specifying base virtual address and other parameters. ```bash ./go.sh 0,1,2,3 3 0xF0 -v 0x7f000000000 -s stdout ``` -------------------------------- ### Compile Example NFs Source: https://github.com/sdnfv/opennetvm/blob/master/docs/Install.md Navigate to the examples directory and run make to compile the example NFs. ```sh cd examples make cd .. ``` -------------------------------- ### Compile and Navigate to Example Directory Source: https://github.com/sdnfv/opennetvm/blob/master/examples/simple_fwd_tb/README.md Navigate to the example directory and compile the project using make. ```bash cd examples make cd simple_fwd_tb ``` -------------------------------- ### Basic Proxy Setup in setupProxy.js Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/react-app/README.md Create a src/setupProxy.js file to configure the Express app instance for custom proxy middleware. This example shows the basic structure. ```javascript const proxy = require('http-proxy-middleware'); module.exports = function(app) { // ... }; ``` -------------------------------- ### Install Docker Source: https://github.com/sdnfv/opennetvm/blob/master/docs/Docker.md Installs Docker on the system by downloading and executing the official installation script. This command ensures Docker is fully set up. ```bash sudo curl -sSL https://get.docker.com/ | sh ``` -------------------------------- ### Compile DPDK and Configure Hugepages Source: https://github.com/sdnfv/opennetvm/blob/master/docs/Install.md Execute the install script to compile DPDK and set up hugepages. This script also runs the environment setup script to load kernel modules and bind NIC ports. ```sh cd scripts ./install.sh ``` -------------------------------- ### Install Now CLI and Deploy Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/react-app/README.md Install the Now command-line tool and deploy your built application. Navigate to the build directory before running the 'now' command. ```sh npm install -g now npm run build cd build now --name your-project-name ``` -------------------------------- ### Compile and Run Scaling Example Source: https://github.com/sdnfv/opennetvm/blob/master/examples/scaling_example/README.md Compile the example and run it with specified service and destination IDs. Optionally enable advanced rings mode. ```bash cd examples make cd scaling_example ./go.sh SERVICE_ID -d DST_ID [ADVANCED_RINGS] ``` -------------------------------- ### Install Netlify CLI and Deploy Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/react-app/README.md Install the Netlify CLI globally and initiate a manual deployment. Ensure you select 'build' as the deploy path when prompted. ```sh npm install netlify-cli -g netlify deploy ``` -------------------------------- ### Start NF from its Directory Source: https://github.com/sdnfv/opennetvm/blob/master/docs/Examples.md Navigate to an NF's directory and use go.sh to start it, omitting the NF name argument. ```bash cd speed_tester && ./go.sh 1 -d 1 ``` ```bash cd speed_tester && ./go.sh -l 4 -- -s -r 6 -- -d 5 ``` -------------------------------- ### Execute NF within Container Source: https://github.com/sdnfv/opennetvm/blob/master/docs/Docker.md After starting a container, navigate into the openNetVM directory and execute the NF using its go.sh script. This example shows entering the 'basic_monitor' NF directory and running it. ```bash root@899618eaa98c:/openNetVM# cd examples/basic_monitor/ root@899618eaa98c:/openNetVM/examples/basic_monitor# ./go.sh 3 -d 1 ``` -------------------------------- ### Start Pktgen Source: https://github.com/sdnfv/opennetvm/wiki/Packet-generation-using-Pktgen Starts Pktgen on Node A with 2 ports. Use 'start all' to begin packet transmission. ```bash ./run-pktgen 2 ``` -------------------------------- ### Install reactstrap and Bootstrap Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/react-app/README.md Install reactstrap and Bootstrap v4 using npm or yarn. ```sh npm install --save reactstrap bootstrap@4 ``` ```sh yarn add bootstrap@4 reactstrap ``` -------------------------------- ### Install and Run Serve CLI Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/react-app/README.md Install the 'serve' package globally and use it to serve a static build. The default port is 5000, but can be changed with the -p flag. ```sh npm install -g serve serve -s build ``` -------------------------------- ### Configure Web App Manifest Start URL Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/react-app/README.md Modify the start_url in public/manifest.json to '.' to ensure client-side routers expect the app to be served from the root directory when installed to the homescreen. ```json "start_url": ".", ``` -------------------------------- ### Install libpcap Development Files Source: https://github.com/sdnfv/opennetvm/blob/master/examples/speed_tester/README.md Installs the necessary development files for the libpcap library, which is required for pcap replay functionality. Run this command if libpcap is not already installed on your system. ```bash sudo apt-get install libpcap-dev ``` -------------------------------- ### Serve Static Files with Express Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/react-app/README.md A programmatic example using Node.js and Express to serve static files from the 'build' directory. This setup serves index.html for any unknown paths to support client-side routing. ```javascript const express = require('express'); const path = require('path'); const app = express(); app.use(express.static(path.join(__dirname, 'build'))); app.get('/*', function (req, res) { res.sendFile(path.join(__dirname, 'build', 'index.html')); }); app.listen(9000); ``` -------------------------------- ### Start NF with Simple Arguments Source: https://github.com/sdnfv/opennetvm/blob/master/docs/Examples.md Use this script to start a Network Function with basic service ID and optional arguments. ```bash ./start_nf.sh NF_NAME SERVICE_ID (NF_ARGS) ``` ```bash ./start_nf.sh speed_tester 1 -d 1 ``` -------------------------------- ### Install Web Minification Tools Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/README.md Installs uglify-js and uglifycss globally for minifying web files. ```sh sudo npm install uglify-js -g ``` ```sh sudo npm install uglifycss -g ``` -------------------------------- ### Install npm Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/README.md Installs npm using apt-get if it is not automatically included with Node.js. ```sh sudo apt-get install npm ``` -------------------------------- ### Example Execution with Print and MAC Update Source: https://github.com/sdnfv/opennetvm/blob/master/examples/l2fwd/README.md Run the L2 Switch example to print every packet with MAC address information. This is useful for debugging and understanding packet flow. ```bash ./go.sh 1 -p 1 -m ``` -------------------------------- ### Start Packet Transmission (All Ports) Source: https://github.com/sdnfv/opennetvm/wiki/Packet-generation-using-Pktgen Enters the 'start all' command into the Pktgen command line prompt on Node A to begin transmitting packets on all configured ports. This is used after Pktgen has been started. ```text start all ``` -------------------------------- ### Compile and Execute Flow Table Example Source: https://github.com/sdnfv/opennetvm/blob/master/examples/flow_table/README.md Instructions for compiling and executing the simple flow table example. Supports direct execution or configuration file usage. ```bash cd examples make cd flow_table ./go.sh SERVICE_ID [PRINT_DELAY] ``` ```bash ./go.sh -F CONFIG_FILE -- -- [-p PRINT_DELAY] ``` ```bash sudo ./flow_table/x86_64-native-linuxapp-gcc/flow_table -l CORELIST -n NUM_MEMORY_CHANNELS --proc-type=secondary -- -r SERVICE_ID -- [-p PRINT_DELAY] ``` -------------------------------- ### Start Packet Transmission (Specific Port) Source: https://github.com/sdnfv/opennetvm/wiki/Packet-generation-using-Pktgen Enters a 'start' command with a port number (e.g., 'start 0' or 'start 1') into the Pktgen command line prompt on Node A. This begins packet transmission only on the specified port. ```text start 0 ``` ```text start 1 ``` -------------------------------- ### Setup Hugetable Script Source: https://github.com/sdnfv/opennetvm/blob/master/docs/moongen.md Run the setup script for hugetlbfs. This is necessary for MoonGen's memory management. ```bash sudo ./setup-hugetlbfs.sh ``` -------------------------------- ### Manually Start Web Console Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/README.md Manually starts the openNetVM web console from the onvm_web directory. ```sh cd onvm_web ./start_web_console.sh ``` -------------------------------- ### Start ONVM Manager Source: https://github.com/sdnfv/opennetvm/wiki/Packet-generation-using-Pktgen Starts the ONVM manager on Node B. The arguments specify ports and other configurations. ```bash ./go.sh 0,1,2 3 0xf0 -s stdout ``` -------------------------------- ### Start NF with Complex Arguments Source: https://github.com/sdnfv/opennetvm/blob/master/docs/Examples.md Use this script to start a Network Function with DPDK, ONVM, and NF-specific arguments. ```bash ./start_nf.sh NF_NAME DPDK_ARGS -- ONVM_ARGS -- NF_ARGS ``` ```bash ./start_nf.sh speed_tester -l 4 -- -s -r 6 -- -d 5 ``` -------------------------------- ### Install cpplint using pip (Windows) Source: https://github.com/sdnfv/opennetvm/wiki/Dev-Environment Install the cpplint tool using pip on Windows systems. ```bash $ pip install cpplint ``` -------------------------------- ### Install http-proxy-middleware Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/react-app/README.md Install the http-proxy-middleware package to enable custom proxy configurations. This is a prerequisite for setting up custom proxy logic. ```bash $ npm install http-proxy-middleware --save ``` ```bash $ yarn add http-proxy-middleware ``` -------------------------------- ### NF User Actions Callback Example Source: https://github.com/sdnfv/opennetvm/wiki/Overview Shows an example of a `user_actions` function callback, as seen in the Basic Monitor NF, demonstrating flexibility in NF task execution. ```c /* Basic Monitor's user_actions function */ static int user_actions(onvm_ ச_t * ச, void * ச_data) { // ... user-defined actions ... return 0; } ``` -------------------------------- ### Start openNetVM Manager Source: https://github.com/sdnfv/opennetvm/blob/master/onvm/README.md Command to start the openNetVM manager with various configuration options. Specify core lists, memory channels, and port masks. ```bash $sudo ./onvm_mgr/onvm_mgr/x86_64-native-linuxapp-gcc/onvm_mgr -l CORELIST -n MEMORY_CHANNELS --proc-type=primary -- -p PORTMASK -n NF_COREMASK [-r NUM_SERVICES] [-d DEFAULT_SERVICE] [-s STATS_OUTPUT] [-t TIME_TO_LIVE] [-l PACKET_LIMIT] ``` -------------------------------- ### Install Prettier, Husky, and Lint-staged Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/react-app/README.md Install necessary dependencies for automatic code formatting before commits. Use npm or yarn. ```sh npm install --save husky lint-staged prettier ``` ```sh yarn add husky lint-staged prettier ``` -------------------------------- ### Install Flow Bin Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/react-app/README.md Install the flow-bin package to enable Flow type checking in your project. ```sh npm install --save flow-bin ``` ```sh yarn add flow-bin ``` -------------------------------- ### Install Node.js and npm Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/README.md Installs the latest stable Node.js version and npm on Ubuntu systems. Requires running commands with sudo. ```sh curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash - # Install Node.js from the Debian-based distributions repository sudo apt-get install -y nodejs # Use package manager sudo npm cache clean -f sudo npm install -g n ``` -------------------------------- ### Start Basic Monitor NF Source: https://github.com/sdnfv/opennetvm/blob/master/docs/Examples.md Starts a basic_monitor NF, typically used as the last NF in a chain. ```bash # examples/start_nf.sh basic_monitor -d 6 ``` -------------------------------- ### Example CSS before Autoprefixer Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/react-app/README.md Shows the original CSS before vendor prefixes and minification are applied. ```css .App { display: flex; flex-direction: row; align-items: center; } ``` -------------------------------- ### Install cpplint using pip (macOS/Linux) Source: https://github.com/sdnfv/opennetvm/wiki/Dev-Environment Install the cpplint tool using pip on macOS or Linux systems. ```bash $ sudo pip install cpplint ``` -------------------------------- ### onvm_nflib_init_nf_init_cfg Source: https://github.com/sdnfv/opennetvm/blob/master/docs/Releases.md Initializes the configuration structure for starting an NF. Exposed for advanced ring NFs. ```APIDOC ## onvm_nflib_init_nf_init_cfg ### Description Initializes a configuration structure required for starting a Network Function (NF), using a provided tag for identification. This API is now exposed for advanced ring NFs. ### Method (Not specified, likely a function call in a C library) ### Endpoint (Not applicable, this is a library function) ### Parameters - **tag** (const char *) - Required - The tag associated with the NF configuration. ``` -------------------------------- ### Install Storybook CLI Globally Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/react-app/README.md Install the Storybook command-line interface globally to manage Storybook projects. ```sh npm install -g @storybook/cli ``` -------------------------------- ### Install GCC/G++ 4.8 and Set Alternatives Source: https://github.com/sdnfv/opennetvm/blob/master/docs/moongen.md Installs GCC/G++ version 4.8 and configures system alternatives to use it as the default compiler. This is necessary if the current compiler version is below 4.8. ```bash $ sudo add-apt-repository ppa:ubuntu-toolchain-r/test $ sudo apt-get update $ sudo apt-get install g++-4.8 $ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8 $ sudo update-alternatives --config gcc ``` -------------------------------- ### Install Lua from Source Source: https://github.com/sdnfv/opennetvm/blob/master/tools/Pktgen/README.md Download, extract, and build the Lua package from source. This ensures the correct version is installed for Pktgen. ```bash cd ~/ curl -R -O http://www.lua.org/ftp/lua-5.3.5.tar.gz tar -zxf lua-5.3.5.tar.gz cd lua-5.3.5 make linux test sudo make install ``` ```text $ lua Lua 5.3.5, Copyright (C)1994-2017 Lua.org, PUC Rico > ``` -------------------------------- ### onvm_nflib_start_nf Source: https://github.com/sdnfv/opennetvm/blob/master/docs/Releases.md Starts an NF with its local context and initialization configuration. Exposed for advanced ring NFs. ```APIDOC ## onvm_nflib_start_nf ### Description Initiates the startup process for a Network Function (NF) using its local context and initialization configuration. This API is now exposed for advanced ring NFs. ### Method (Not specified, likely a function call in a C library) ### Endpoint (Not applicable, this is a library function) ### Parameters - **nf_local_ctx** (struct onvm_nf_local_ctx *) - Required - The local context for the NF. - **nf_init_cfg** (struct onvm_nf_init_cfg *) - Required - The initialization configuration for the NF. ``` -------------------------------- ### Install Node.js Stable Version Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/README.md Installs the current stable version of Node.js using the 'n' version manager. ```bash sudo n stable ``` -------------------------------- ### Install Build Dependencies Source: https://github.com/sdnfv/opennetvm/blob/master/docs/Install.md Install essential build tools, Linux kernel headers, Git, BC, GCC, Make, and Pkg-config. This is necessary for compiling openNetVM and its dependencies. ```sh sudo apt-get install build-essential linux-headers-$(uname -r) git bc gcc make pkg-config ``` -------------------------------- ### Start openNetVM with Web Console (Custom Port) Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/README.md Starts openNetVM with four cores, one NIC port, and directs stats output to the web console on a specified port (9000). ```sh cd onvm ./go.sh 0,1,2,3 1 -s web -p 9000 ``` -------------------------------- ### Start Simple Forward NF Source: https://github.com/sdnfv/opennetvm/blob/master/docs/Examples.md Starts a simple_forward NF, specifying its core pinning, service ID, and destination service ID for chaining. ```bash # examples/start_nf.sh simple_forward 1 -d 6 ``` -------------------------------- ### Install React Styleguidist Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/react-app/README.md Add react-styleguidist as a project dependency to enable isolated component development and style guide generation. ```sh npm install --save react-styleguidist ``` ```sh yarn add react-styleguidist ``` -------------------------------- ### Install Enzyme and React Adapter (npm) Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/react-app/README.md Installs Enzyme, the React 16 adapter, and react-test-renderer using npm. This is required for shallow rendering tests. ```sh npm install --save enzyme enzyme-adapter-react-16 react-test-renderer ``` -------------------------------- ### Configure Manager Base Virtual Address Source: https://github.com/sdnfv/opennetvm/blob/master/onvm/README.md Example of starting the onvm_mgr with a specific base virtual address using the '-a' flag. ```bash onvm/go.sh -k 1 -n 0x3F8 -s stdout -a 0x7f000000000 ``` -------------------------------- ### Install Source Map Explorer Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/react-app/README.md Install the source-map-explorer package using npm. This tool helps analyze JavaScript bundle sizes. ```sh npm install --save source-map-explorer ``` -------------------------------- ### Start openNetVM with Web Console (Default Port) Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/README.md Starts openNetVM with four cores, one NIC port, and directs stats output to the web console on the default port 8080. ```sh cd onvm ./go.sh 0,1,2,3 1 -s web ``` -------------------------------- ### Setting Up Test Environment with `setupTests.js` Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/react-app/README.md Create `src/setupTests.js` to provide global setup or mock browser APIs for your tests. This file is automatically executed before tests run. ```javascript const localStorageMock = { getItem: jest.fn(), setItem: jest.fn(), clear: jest.fn(), }; global.localStorage = localStorageMock; ``` -------------------------------- ### Registering a Proxy with http-proxy-middleware Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/react-app/README.md Register a proxy middleware to forward requests starting with '/api' to a target server. This is an example of using http-proxy-middleware within src/setupProxy.js. ```javascript const proxy = require('http-proxy-middleware'); module.exports = function(app) { app.use(proxy('/api', { target: 'http://localhost:5000/' })); }; ``` -------------------------------- ### Install and Run Wireshark via SSH Source: https://github.com/sdnfv/opennetvm/wiki/Wireshark-&-Pdump-for-packet-sniffing Installs Wireshark on a remote machine and launches it. Ensure X11 forwarding is enabled with '-X -Y' when connecting via SSH. ```shell ssh your_node@cloudlab -X -Y sudo apt-get update sudo apt-get install wireshark sudo wireshark ``` -------------------------------- ### Importing Third-Party Assertion Libraries Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/react-app/README.md Import assertion libraries like Sinon and Chai if you are not using the default Jest setup. Ensure these libraries are installed in your project. ```javascript import sinon from 'sinon'; import { expect } from 'chai'; ``` -------------------------------- ### View Serve CLI Options Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/react-app/README.md Run this command to see all available options for the 'serve' CLI. ```sh serve -h ``` -------------------------------- ### ARP and LB NF Example Usage Source: https://github.com/sdnfv/opennetvm/blob/master/examples/load_balancer/README.md Example command to run the ARP NF and the Load Balancer NF together. The LB NF uses specified DPDK interfaces for client and server ports. ```bash ARP NF ./go.sh 1 -d 2 -s 10.0.0.37,11.0.0.37 LB NF ./go.sh 2 -c dpdk0 -s dpdk1 -f server.conf ``` -------------------------------- ### Set NF Setup Function for Automatic Execution Source: https://github.com/sdnfv/opennetvm/blob/master/docs/Releases.md Assign a setup function to an NF using `onvm_nflib_set_setup_function`. This function will be automatically executed once before the NF enters its main packet processing loop. ```c void onvm_nflib_set_setup_function(struct onvm_nf_info* info, setup_func setup); ``` -------------------------------- ### Compile and Run Fair Queue NF Source: https://github.com/sdnfv/opennetvm/blob/master/examples/fair_queue/README.md Navigate to the examples directory, compile the project, then change to the fair_queue directory and execute the Go script. The script requires a SERVICE_ID and DESTINATION_ID, with optional arguments for the number of queues and to print statistics. ```bash cd examples make cd fair_queue ./go.sh SERVICE_ID -d DESTINATION_ID [-n NUM_QUEUES] [-p] ``` -------------------------------- ### Compile and Run Flow Tracker Source: https://github.com/sdnfv/opennetvm/blob/master/examples/flow_tracker/README.md Instructions for compiling the Flow Tracker example and running it with different argument configurations. Use 'make' to compile, then execute the 'go.sh' script or the binary directly with service IDs, destination IDs, and optional print delays. ```bash cd examples make cd flow_tracker ./go.sh SERVICE_ID -d DESTINATION_ID [-p PRINT_DELAY] ``` ```bash ./go.sh -F CONFIG_FILE -- -- -d DESTINATION_ID [-p PRINT_DELAY] ``` ```bash sudo ./build/flow_tracker -l CORELIST -n NUM_MEMORY_CHANNELS --proc-type=secondary -- -r SERVICE_ID -- -d DESTINATION_ID [-p PRINT_DELAY] ``` -------------------------------- ### Install libnuma Development Files Source: https://github.com/sdnfv/opennetvm/blob/master/docs/Install.md Install the libnuma development library, which is a dependency for DPDK. If installation fails, update your package list first. ```sh sudo apt-get install libnuma-dev ``` ```sh sudo apt-get update ``` -------------------------------- ### Compile and Run Test Messaging NF Source: https://github.com/sdnfv/opennetvm/blob/master/examples/test_messaging/README.md Navigate to the examples directory, compile the project, change to the test_messaging directory, and execute the NF with a service ID. ```bash cd examples make cd test_messaging ./go.sh SERVICE_ID ``` -------------------------------- ### NF Initialization and Execution Flow Source: https://github.com/sdnfv/opennetvm/blob/master/docs/Releases.md Illustrates the sequence for initializing an NF, setting up signal handling, defining packet handlers, and running the NF lifecycle. Ensure NF_TAG is correctly defined. ```c struct onvm_nf_local_ctx *nf_local_ctx; struct onvm_nf_function_table *nf_function_table; nf_local_ctx = onvm_nflib_init_nf_local_ctx(); onvm_nflib_start_signal_handler(nf_local_ctx, NULL); nf_function_table = onvm_nflib_init_nf_function_table(); nf_function_table->pkt_handler = &packet_handler; if ((arg_offset = onvm_nflib_init(argc, argv, NF_TAG, nf_local_ctx, nf_function_table)) < 0) // error checks argc -= arg_offset; argv += arg_offset; if (parse_app_args(argc, argv, progname) < 0) // error checks onvm_nflib_run(nf_local_ctx); onvm_nflib_stop(nf_local_ctx); ``` -------------------------------- ### Install Python 3 on Debian/Ubuntu Source: https://github.com/sdnfv/opennetvm/blob/master/docs/Install.md Install Python 3 using the apt package manager on Debian-based systems like Ubuntu. Ensure your package repository is up-to-date before installation. ```sh sudo apt-get install python3 ``` -------------------------------- ### Execute Simple Forward with Token Bucket (Config File) Source: https://github.com/sdnfv/opennetvm/blob/master/examples/simple_fwd_tb/README.md Run the simple_fwd_tb NF using a configuration file. This method allows for more complex setups defined in a JSON file. ```bash ./go.sh -F CONFIG_FILE -- -- -d DST [-p PRINT_DELAY] [-D TOKEN_BUCKET_DEPTH] [-R TOKEN_BUCKET_RATE] ``` -------------------------------- ### Sample Makefile Source: https://github.com/sdnfv/opennetvm/blob/master/style/styleguide.md A sample Makefile demonstrating compilation, cleaning, and dependency management using common make variables. ```makefile #Use the gcc compiler CC = gcc CFLAGS = DEPS = LDFLAGS = #Objects created by makefile OBJS = test-file #Ensure compiling is done with all necessary dependencies %.o: %.c $(DEPS) $(CC) $(CFLAGS) -c -o $@ $< all: $(OBJS) rebuild: clean all #Builds test-file test-file: test-file.c $(CC) $(CFLAGS) -o $@ $^ clean: @rm -f $(OBJS) ``` -------------------------------- ### Install Yarn with npm Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/README.md Installs the Yarn package manager globally using npm. ```sh sudo npm install -g yarn ``` -------------------------------- ### Compile and Run Basic Monitor Source: https://github.com/sdnfv/opennetvm/blob/master/examples/basic_monitor/README.md Instructions for compiling and executing the Basic Monitor NF using different command-line options. The first option uses a service ID and an optional print delay. The second uses a configuration file. The third uses a specific build path with core list and memory channel specifications. ```bash cd examples make cd basic_monitor ./go.sh SERVICE_ID [PRINT_DELAY] ``` ```bash ./go.sh -F CONFIG_FILE -- -- [-p PRINT_DELAY] ``` ```bash sudo ./build/monitor -l CORELIST -n NUM_MEMORY_CHANNELS --proc-type=secondary -- -r SERVICE_ID -- [-p PRINT_DELAY] ``` -------------------------------- ### Install Cppcheck with Apt Source: https://github.com/sdnfv/opennetvm/blob/master/style/github-action-style.md Command to install the latest version of cppcheck using apt-get. ```shell sudo apt-get install cppcheck ``` -------------------------------- ### Compile DPDK HelloWorld Application Source: https://github.com/sdnfv/opennetvm/blob/master/docs/Install.md Navigate to the DPDK examples directory and compile the HelloWorld application. This is a test to ensure DPDK is functioning correctly. ```sh cd dpdk/examples/helloworld make ``` -------------------------------- ### Install Pylint with Pip Source: https://github.com/sdnfv/opennetvm/blob/master/style/github-action-style.md Command to install the latest version of pylint using pip3. ```shell pip3 install pylint ``` -------------------------------- ### AES Decrypt NF Execution Examples Source: https://github.com/sdnfv/opennetvm/blob/master/examples/aes_decrypt/README.md Illustrative examples of how to run the AES Decrypt NF with specific service IDs and destinations. These examples demonstrate the usage of the `-d` argument for specifying the destination service ID. ```bash ./examples/aes_encrypt/go.sh 1 -d 2 ``` ```bash ./examples/aes_decrypt/go.sh 2 -d 3 ``` -------------------------------- ### File Header with Licensing and Copyright Source: https://github.com/sdnfv/opennetvm/blob/master/style/styleguide.md All files should begin with licensing and copyright information. This example shows the standard BSD license format used in the openNetVM project. ```C /********************************************************************* * openNetVM * https://github.com/sdnfv/openNetVM * * BSD LICENSE * * Copyright (c) * 2015-2017 George Washington University * 2015-2017 University of California Riverside * 2010-2014 Intel Corporation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of the Intel Corporation nor the names of its * contributors may be used to endorse or promote products * derived from this software without specific prior written * permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. ********************************************************************/ ``` -------------------------------- ### Compile and Execute Simple Forward NF Source: https://github.com/sdnfv/opennetvm/blob/master/examples/simple_forward/README.md Shows how to compile and run the Simple Forward NF using different command-line argument patterns. This includes direct arguments, configuration file support, and execution with specific core lists for secondary processes. ```bash cd examples make cd simple_forward ./go.sh SERVICE_ID -d DST [PRINT_DELAY] ``` ```bash ./go.sh -F CONFIG_FILE -- -- -d DST [-p PRINT_DELAY] ``` ```bash sudo ./build/forward -l CORELIST -n 3 --proc-type=secondary -- -r SERVICE_ID -- -d DST [-p PRINT_DELAY] ``` -------------------------------- ### Install React Router DOM Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/react-app/README.md Install the react-router-dom package using npm for client-side routing. ```sh npm install --save react-router-dom ``` -------------------------------- ### Load Generator NF and Simple Forward Chain Example Source: https://github.com/sdnfv/opennetvm/blob/master/docs/Releases.md Demonstrates how to set up and run a chain of the Load Generator NF and the Simple Forward NF. Adjust the packet rate (`-t`) for the load generator based on your architecture's performance. ```sh cd examples/load_generator ./go.sh 1 -d 2 -t 4000000 cd examples/simple_forward ./go.sh 2 -d 1 ``` -------------------------------- ### Compile and Execute L2 Switch Source: https://github.com/sdnfv/opennetvm/blob/master/examples/l2fwd/README.md Commands to compile and run the L2 Switch example. Choose the execution method based on your needs, with options for service ID, configuration files, and print delays. ```bash cd examples make cd l2switch ./go.sh SERVICE_ID [PRINT_DELAY] ``` ```bash ./go.sh -F CONFIG_FILE -- -- [-p PRINT_DELAY] ``` ```bash sudo ./build/bridge -l CORELIST -n 3 --proc-type=secondary -- -r SERVICE_ID -- [-p PRINT_DELAY] ``` -------------------------------- ### Install Pktgen Dependencies Source: https://github.com/sdnfv/opennetvm/blob/master/tools/Pktgen/README.md Install necessary development libraries for Pktgen, including pcap and readline. ```bash sudo apt-get install libpcap-dev sudo apt-get install libreadline-dev ``` -------------------------------- ### Initialize ONVM and Adjust Arguments (Callback Mode) Source: https://github.com/sdnfv/opennetvm/wiki/NF-API Initializes ONVM, DPDK, and adjusts argc/argv based on the return value. Handles potential ONVM initialization failures or user termination signals. ```c if ((arg_offset = onvm_nflib_init(argc, argv, NF_TAG, nf_local_ctx, nf_function_table)) < 0) { onvm_nflib_stop(nf_local_ctx); if (arg_offset == ONVM_SIGNAL_TERMINATION) { printf("Exiting due to user termination\n"); return 0; } else { rte_exit(EXIT_FAILURE, "Failed ONVM init\n"); } } argc -= arg_offset; argv += arg_offset; ``` -------------------------------- ### Install gh-pages with yarn Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/react-app/README.md Install the `gh-pages` package using yarn to enable deployment to GitHub Pages. ```sh yarn add gh-pages ``` -------------------------------- ### Start Development Server with HTTPS on Windows (cmd.exe) Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/react-app/README.md Enable HTTPS for the development server on Windows using cmd.exe by setting the HTTPS environment variable. Note the intentional lack of whitespace. ```cmd set HTTPS=true&&npm start ``` -------------------------------- ### Install gh-pages with npm Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/react-app/README.md Install the `gh-pages` package using npm to enable deployment to GitHub Pages. ```sh npm install --save gh-pages ``` -------------------------------- ### Run Group Script Source: https://github.com/sdnfv/opennetvm/blob/master/docs/NF_Dev.md Deploys multiple NFs based on a provided JSON configuration file. Must be run from the /examples directory. ```bash python3 run_group.py ``` -------------------------------- ### Install React Router DOM with Yarn Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/react-app/README.md Install the react-router-dom package using Yarn for client-side routing. ```sh yarn add react-router-dom ``` -------------------------------- ### Install Relay Babel Plugin Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/react-app/README.md Install the babel-plugin-relay development dependency for using Relay with Babel Macros. ```sh npm install --save --dev babel-plugin-relay@dev ``` ```sh yarn upgrade babel-plugin-relay@dev ``` -------------------------------- ### Scaling Example with Shared Cores Source: https://github.com/sdnfv/opennetvm/wiki/Overview Demonstrates how to run NFs on shared cores using the `-c` flag and set the number of children with `-n`. NFs sleep when idle and wake via signals. ```c // Example usage in go.sh or start_nf.sh: // ./manager go.sh -c -n 4 ``` -------------------------------- ### Install Node Sass Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/react-app/README.md Installs the node-sass package, which is required to use Sass stylesheets in your React project. ```bash $ npm install node-sass --save $ # or $ yarn add node-sass ``` -------------------------------- ### Initialize OpenNetVM on CloudLab Source: https://github.com/sdnfv/opennetvm/wiki/Dev-Environment Commands to initialize and set up the OpenNetVM environment on a CloudLab instance after connecting via SSH. ```bash $ source setup_cloudlab.sh $ sudo ifconfig ethXXX down $ ./setup_environment.sh ``` -------------------------------- ### Install net-tools Package Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/README.md Installs the net-tools package on Ubuntu 18.04 to resolve potential runtime errors. ```sh sudo apt-get install net-tools ``` -------------------------------- ### Start ONVM Bridge NF Source: https://github.com/sdnfv/opennetvm/wiki/Packet-generation-using-Pktgen Starts the Bridge NF on Node B. This NF forwards packets between ports. ```bash ./go.sh 1 ``` -------------------------------- ### Install env-cmd Source: https://github.com/sdnfv/opennetvm/blob/master/onvm_web/react-app/README.md Install env-cmd using npm or yarn to manage custom environment variables for build environments. ```sh $ npm install env-cmd --save $ # or $ yarn add env-cmd ``` -------------------------------- ### Install Linters Script Source: https://github.com/sdnfv/opennetvm/blob/master/style/github-action-style.md Shell script to install the necessary static analysis tools: pylint, cppcheck, and shellcheck. ```shell ./style/install-linters.sh ``` -------------------------------- ### Compile and Execute Payload Scan NF Source: https://github.com/sdnfv/opennetvm/blob/master/examples/payload_scan/README.md Navigate to the examples directory, compile the project, then change to the payload_scan directory to execute the NF. Two execution methods are provided: one with direct arguments and another using a configuration file. ```bash cd examples make cd payload_scan ./go.sh SERVICE_ID -d DESTINATION_ID -s INPUT_STRING OR ./go.sh -F CONFIG_FILE -- -- -d DST -s INPUT_STRING [-p PRINT_DELAY] [-i inverse mode] ```