{"id":13797179,"url":"https://github.com/outscale/packetgraph","last_synced_at":"2025-04-05T14:31:27.912Z","repository":{"id":35374486,"uuid":"39637541","full_name":"outscale/packetgraph","owner":"outscale","description":"Packetgraph library is a collection of network bricks you can connect to form a network graph.","archived":false,"fork":false,"pushed_at":"2023-06-11T22:40:40.000Z","size":3087,"stargazers_count":83,"open_issues_count":82,"forks_count":28,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-03-21T05:43:09.214Z","etag":null,"topics":["brick","dpdk","firewall","hub","ipv4","ipv6","library","network-graph","nfv","nic","npf","packets","switch","tap","vhost","vhost-user","virtual-machine","virtualization","vtex","vxlan"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/outscale.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2015-07-24T14:09:25.000Z","updated_at":"2025-03-21T05:06:39.000Z","dependencies_parsed_at":"2024-04-06T10:43:20.045Z","dependency_job_id":null,"html_url":"https://github.com/outscale/packetgraph","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outscale%2Fpacketgraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outscale%2Fpacketgraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outscale%2Fpacketgraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outscale%2Fpacketgraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/outscale","download_url":"https://codeload.github.com/outscale/packetgraph/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247352625,"owners_count":20925306,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["brick","dpdk","firewall","hub","ipv4","ipv6","library","network-graph","nfv","nic","npf","packets","switch","tap","vhost","vhost-user","virtual-machine","virtualization","vtex","vxlan"],"created_at":"2024-08-03T23:01:24.260Z","updated_at":"2025-04-05T14:31:24.595Z","avatar_url":"https://github.com/outscale.png","language":"C","funding_links":[],"categories":["\u003ca id=\"8c5a692b5d26527ef346687e047c5c21\"\u003e\u003c/a\u003e收集"],"sub_categories":[],"readme":"[![Project Incubating](https://docs.outscale.com/fr/userguide/_images/Project-Incubating-blue.svg)](https://docs.outscale.com/en/userguide/Open-Source-Projects.html)\n\n# Packetgraph ?\n\nPacketgraph is a library aiming to give the user a tool to build networks graph easily, It's built upon the fast [DPDK library](http://dpdk.org/).\n\n[![Build Status](https://travis-ci.org/outscale/packetgraph.svg?branch=master)](https://travis-ci.org/outscale/packetgraph) [![packetgraph documentation](doc/packetgraph_doc.png)](https://outscale.github.io/packetgraph/doc/master)\n\nThe goal of this library is to provide a really EASY interface to\nbuild you own DPDK based application using [Network Function Virtualization](https://en.wikipedia.org/wiki/Network_function_virtualization)\nEveryone is free to use this library to build up their own network application.\n\nOnce you have created and connected all bricks in you network graph,\nsome bricks will be able to poll a burst of packets (max 64 packets)\nand let the burst propagate in you graph.\n\nConnections between bricks don't store any packets and each burst will\npropagate in the graph without any copy.\n\nEach graph run on one core but you can connect different graph using\nQueue bricks (which are thread safe). For example, a graph can be\nsplit on demand to be run on different core or even merged.\n\nIf you want a graphical representation of a graph, you can generate a [dot](https://en.wikipedia.org/wiki/DOT_%28graph_description_language%29) output.\n\n![Packetgraph features](doc/packetgraph_features.png \"packetgraph features\")\n\n# Available bricks (ipv4/ipv6):\n\n- switch: a layer 2 switch\n- rxtx: setup your own callbacks to get and sent packets\n- tap: classic kernel virtual interface\n- vhost: allow to connect a vhost NIC to a virtual machine (virtio based)\n- firewall: allow traffic filtering passing through it (based on [NPF](https://github.com/rmind/npf))\n- diode: only let packets pass in one direction\n- accumulator: batch bursted packets to increase poll and burst speed\n- hub: act as a hub device, passing packets to all connected bricks\n- nic: allow passing packets to a NIC of the system (accelerated by DPDK)\n- print: a basic print brick to show packets flowing through it\n- antispoof: a basic mac checking, arp anti-spoofing and ipv6 neighbor discovery anti-spoofing\n- vtep: VXLAN Virtual Terminal End Point switching packets on virtual LANs, can encapsulate packets over ipv4 or ipv6\n- queue: temporally store packets between graph\n- pmtud(ipv4 only): Path MTU Discovery is an implementation of [RFC 1191](https://tools.ietf.org/html/rfc1191)\n- user-dipole: setup your own callback in a dipole brick, to filter or implement your own protocol\n\nA lot of other bricks can be created, check our [wall](https://github.com/outscale/packetgraph/issues?q=is%3Aopen+is%3Aissue+label%3Awall) ;)\n\n# How should I use Packetgraph ?\n\nCode Documentation: [doxygen link](https://outscale.github.io/packetgraph/doc/master)\n\n![Packetgraph usage flow](packetgraph_flow.png \"packetgraph usage flow\")\n\n# Examples\n\nTo build and run examples, you may first check how to build Packetgraph below and adjust your configure command before make:\n```\n$ ./configure --with-examples\n$ make\n```\n\nTo run a specific example, check run scripts in tests directories:\n```\n$ ./examples/switch/run_vhost.sh\n$ ./examples/switch/run.sh\n$ ./examples/firewall/run.sh\n$ ./examples/rxtx/run.sh\n$ ./examples/dperf/run.sh\n...\n```\n\n# Building\n\nYou will need to build DPDK before building Packetgraph.\n\n## Install needed tools\n\nYou may adapt this depending on your Linux distribution:\n\nUbuntu\n```\n$ sudo apt-get install libpcap-dev libglib2.0-dev libjemalloc-dev libnuma-dev openssl\n```\nCentOS\n```\n$ sudo yum install -y glibc-devel glib2-devel libpcap-devel git wget numactl numactl-devel openssl-devel clang\n$ wget http://cbs.centos.org/kojifiles/packages/jemalloc/3.6.0/8.el7.centos/x86_64/jemalloc-devel-3.6.0-8.el7.centos.x86_64.rpm\n$ wget http://cbs.centos.org/kojifiles/packages/jemalloc/3.6.0/8.el7.centos/x86_64/jemalloc-3.6.0-8.el7.centos.x86_64.rpm\n$ sudo rpm -i jemalloc-devel-3.6.0-8.el7.centos.x86_64.rpm jemalloc-3.6.0-8.el7.centos.x86_64.rpm\n```\n\n## Build DPDK\n\n```\n$ git clone http://dpdk.org/git/dpdk\n$ cd dpdk\n$ git checkout -b v19.02 v19.02\n$ make config T=x86_64-native-linuxapp-gcc\n```\n\nNote: use `T=x86_64-native-linuxapp-clang` to build with clang\n\nEdit build/.config and be sure to set the following parameters to 'y':\n- CONFIG_RTE_LIBRTE_PMD_PCAP\n\nIf you don't want to use some special PMD in DPDK requiring kernel headers,\nyou will have to set the following parameters to 'n':\n- CONFIG_RTE_EAL_IGB_UIO\n- CONFIG_RTE_KNI_KMOD\n\nOnce your .config file is ready, you can now build dpdk as follows:\n\n```\n$ make EXTRA_CFLAGS='-fPIC'\n```\n\nFinally, set `RTE_SDK` environment variable:\n```\n$ export RTE_SDK=$(pwd)\n```\n\n## Build packetgraph\n```\n$ git clone https://github.com/outscale/packetgraph.git\n$ cd packetgraph\n$ git submodule update --init\n$ ./configure\n$ make\n$ make install\n```\n\nNote: to build with clang, you can use `./configure CC=clang`\n\nNote 2: You need a compiler that support C11 (gcc 4.9 or superior, or clang 3.4 or superior).\n\n## Configure Huge Pages\n\nPacketgraph uses some [huge pages](https://en.wikipedia.org/wiki/Page_%28computer_memory%29#Huge_pages)\n(adjust to your needs):\n\n- Edit your `/etc/sysctl.conf` and add some huge pages:\n```\nvm.nr_hugepages=2000\n```\n- Reload your sysctl configuration:\n```\n$ sudo sysctl -p /etc/sysctl.conf\n```\n- Check that your huge pages are available:\n```\n$ cat /proc/meminfo | grep Huge\n```\n- Mount your huge pages:\n```\n$ sudo mkdir -p /mnt/huge\n$ sudo mount -t hugetlbfs nodev /mnt/huge\n```\n- (optional) Add this mount in your `/etc/fstab`:\n```\nhugetlbfs       /mnt/huge  hugetlbfs       rw,mode=0777        0 0\n```\n# Compille Time Optimisation:\n\n-DPG_BRICK_NO_ATOMIC_COUNT: do not use atomic variable to count packets, if you do so, you must call `pg_brick_pkts_count_get` in the same thread you use to poll packets\n-DPG_VHOST_FASTER_YET_BROKEN_POLL: change the way vhost lock the queue so it spend less time locking/unlocking the queue, but can easily deadlock if badly use.\n\n# Compille Time Option\n-DTAP_IGNORE_ERROR: when packetgrapg can't burst or poll a tap, it return 0 instead of returning an error\n-DPG_QEMU_MEM_SIZE=SIZE: allow to specify qemy ram size in test, parameter must be a string in qemu format, examples: -DPG_QEMU_MEM_SIZE=\"1G\", -DPG_QEMU_MEM_SIZE=\"512M\"\n\n# Licence\n\nPacketgraph project is published under [GNU GPLv3](http://www.gnu.org/licenses/quick-guide-gplv3.en.html).\nFor more information, check LICENSE file.\n\n# Contribute\n\nNew to packetgraph ? Want to contribute and/or create a new brick ? Some\n[developer guidelines](https://github.com/outscale/packetgraph/blob/master/doc/contrib.md/) are available.\n\n# Question ? Contact us !\n\nPacketgraph is an open-source project, feel free to [chat with us on IRC](https://webchat.freenode.net/?channels=betterfly\u0026nick=packetgraph_user)\n\n\u003e server: irc.freenode.org\n\n\u003e chan: #betterfly\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foutscale%2Fpacketgraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foutscale%2Fpacketgraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foutscale%2Fpacketgraph/lists"}