项目作者: intrig-unicamp

项目描述 :
BB-Gen: Packet Crafter
高级语言: Python
项目地址: git://github.com/intrig-unicamp/BB-Gen.git
创建时间: 2018-03-03T17:27:17Z
项目社区:https://github.com/intrig-unicamp/BB-Gen

开源协议:BSD 3-Clause "New" or "Revised" License

下载


BB-Gen

About BB-Gen

BB-Gen is simple CLI based packet crafter written in Python over Scapy library to generate packet flows formatted as PCAP files by taking user-defined parameters as inputs based on the headers defined in a P414 program. It can natively crafts packets for different standard and custom protocols. It aims to create PCAP files to be used with a wide set of Traffic Generators (e.g., pktgen-dpdk, NFPA, TCPDUMP, etc.) helping network developers to validate the network and execute performance tests over the targets.

Build Status
License: BSD v3




If you find this useful, please don’t forget to star ⭐️ the repo, as this will help to promote the project.

Follow us on GitHub to keep updated about this project and others.




Installation

step 1: $ sudo apt-get install git
step 2: $ git clone --recursive https://github.com/intrig-unicamp/BB-Gen.git
step 3: $ cd BB-Gen
step 4: $ sudo ./dependencies.py
step 5: $ cd p4-hlir
step 6: $ sudo python setup.py install
step 7: $ cd ..
step 8: $ python main.py

BB-Gen generates a PCAP and Trace files.
The PCAPs can be used for testing together with tools such as NFPA.

Usage

  1. main.py [-h] [-p] [-t] [-n] [-nm] [-rnip] [-rnmac] [-rnport] [-pkt]
  2. [-p4] [-u] [-udata] [-perf] [-d] [-v]

BB-Gen PCAP generator

  1. optional arguments:
  2. -h, --help show this help message and exit
  3. -p , --protocol Type of packet:
  4. ipv4, ipv6, vxlan, gre, l2
  5. Default: ipv4
  6. -t , --tansport Specifies the transport protocol:
  7. tcp or udp
  8. For VXLAN and GRE is the encapsulated protocol
  9. Default: tcp
  10. -n , --number Number of entries
  11. Default: 100
  12. -nm , --name PCAP name
  13. Default: ipv4
  14. -rnip Random IP
  15. Default: False
  16. -rnmac Random MAC
  17. Default: False
  18. -rnport Random Port
  19. Default: False
  20. -pkt , --packetsize Specify here the required packetsize
  21. In case of more than one, separated the list with coma
  22. e.g. 64,215,514.
  23. Default: 64
  24. -p4 Specify a P4 code to autogenerates the traces
  25. Default: none
  26. -u , --usecase Use Case:
  27. macsad
  28. Default: none
  29. -udata , --userdata User Specified Data
  30. -perf, --performance Performance PCAPs
  31. 64, 128, 254, 512, 1024, 1280, 1518 pkt size
  32. Default: False
  33. -d, --debug Debug enable
  34. -v show program's version number and exit

Running BB-Gen

Designed for simplicity, BB-Gen delivers an intuitive CLI based interface. By specifying only a few flags, can be created a set of traces files.

Examples:

Generation of 100 vxlan traces with packet size of 64B:

$ python main.py -p vxlan -n 100

Generation of random 1k IPv4 traces for performance test:

$ python main.py -p ipv4 -n 1000 -rnip -rnmac -rnport --performance

MACSAD use case:

$ python main.py -u macsad

Using a P414 code to autogenerate 100 traces:

$ python main.py -p4 examples/p4_src/l3_fwd_ipv6.p4 -n 100

Supported Protocols:

  • Ethernet
  • IPv4 / IPv6
  • UDP
  • TCP
  • GRE
  • VXLAN

Contributing

PRs are very much appreciated. For bugs/features consider creating an issue before sending a PR.

Team

We are members of INTRIG (Information & Networking Technologies Research & Innovation Group) at University of Campinas - Unicamp, SP, Brazil.
Thanks to all contributors!

Fabricio Rodríguez
Fabricio Rodríguez

(frodri@dca.fee.unicamp.br)
💻 🔌 👀
Gyanesh Patra
Gyanesh Patra

(gyanesh@dca.fee.unicamp.br)
💻 🔌 👀
Christian Esteve Rothenberg
Christian Esteve Rothenberg

(chesteve@dca.fee.unicamp.br)
📢 🎨

Team member list is generated by the all-contributors specification (emoji key).

Acknowledgments

This work was supported by the Innovation Center, Ericsson Telecomunicações S.A., Brazil under grant agreement UNI.61.