DOCA Programable Congestion Control Simulator
Contents:
Instructions: Please replace all labels/tags such as
All the text that is marked in RED should be replaced with actual content for the specific guide.
This document describes DPI compiler architecture, supported signatures format, compiler usage , etc.
DPI compiler is used to compile a signature file which is loaded into the BlueField RegEx HW accelerator using a dedicated API (doca_dpi_load_signatures(cdo_file)
). The output for the DPI compiler is a JSON-based CDO file.
This diagram contains the following elements:
Input rules file – file containing a list of rules
Supported formats:
Suricata (limited support—see section "Description" for more information)
Third party signature files (for more information, contact NVIDIA Networking Support at: networking-support@nvidia.com).
RXP compiler – regular expression compiler which is part of the DPI compiler
Output CDO file – compiled signature output from compiler. File containing list of rules to be loaded to the RegEx engine.
Can be removed if there are none.
The following is a Suricata syntax example:
alert udp any any -> any 53 (msg:"ET DOS DNS BIND 9 Dynamic Update DoS attempt"; content:"|00 00 06|"; offset:8; content:"|c0 0c 00 ff|"; sid:2009701; )
Suricata rules are made of three parts – action, header, and options. Take the following rule for example:
drop tcp 1.1.1.1/11 8080 -> 2.2.2.2/22 9090 (msg:"ET TROJAN Likely Bot Nick in IRC (USA +..)"; flow: to_server; content:"NICK "; nocase; pcre:"/NICK .*USA.*[0-9]{3,}/iI"; sid:2008124;)
The following table breaks down the rule syntax:
Part | Rule Element |
Action | drop |
Header | tcp any any -> any any 1.1.1.1/11 8080 -> 2.2.2.2/22 9090 |
Options | (msg:”ET TROJAN Likely Bot Nick in IRC (USA +..)”; flow: to_server; content:”NICK “; nocase; pcre:”/NICK .*USA.*[0-9]{3,}/i”; sid:2008124;) Detailed explanation can be found in Suricata's official documentation. |
DPI compiler has limited support for Suricata format. Field support is detailed in the following table:
Part | Keyword | Support |
Action | Any | Accept any value. The application decides what to do with each action value. |
Header | Protocol |
Possible values: |
Header | Port | Single port number or range (ex. 100:150) |
Header | Address | Single IP address and netmask (ex. 1.2.3.4/5) |
Header | Direction |
|
Option | msg | Any string – use to identify the rule in case of match on the DPI |
Option | http. (must come before content option) | uri, cookie, user_agent, host, server, referer, content_type, location, request_body, response_body |
Option | http_ (must come after content option) | uri, cookie, user_agent, host, referer, content_type, request_body, response_body |
Option | content modifiers |
nocase, startswith, endswith, offset
Negation ( |
Option | PCRE modifiers |
|
Option | ip_proto | Supported values: 1 (ICMP), 6 (TCP), 17 (UDP) |
Option | flow | from_client, to_client, from_server, to_server |
Option | tls. | sni – server name indication |
Option | dns. | query |
Option | sid | Any number |
Option | gid | Group rules to have OR dependency for rules with the same SID. By default, every GID is 0. |
If content or PCRE are provided without a field (e.g., http_uri
), content/PCRE is searched on TCP/UDP payload according to the header protocol.
To execute the <tool name> :
Usage: doca_<tool name> [DOCA Flags] [Program Flags]
DOCA Flags:
-h, --help Print a help synopsis
-v, --version Print program version information
-l, --log-level <CRITICAL=20, ERROR=30, WARNING=40, INFO=50, DEBUG=60>
Program Flags:
-i, --input Full path to signature file
-f, --format Signature file format
-o, --output Full path to CDO file
-c, --classtype Path to the classtype file for priority in suricata file
For example:
doca_dpi_compiler -i ./suricata_rules.rules -o compiler_output.cdo -f suricata
To run doca_dpi_compiler
using a JSON file:
doca_dpi_compiler --json [json_file]
For example:
doca_dpi_compiler --json /tmp/doca_dpi_compiler.json
Refer to DOCA Arg Parser for more information.
Flag | Description | JSON Content |
| Print all information about the available options | N/A |
| Path to input files |
|
| Path to output file |
|
| Signatures format |
|
| Add the RegEx rules being passed to the RXPC to the CDO as well (useful for debug) |
|
| Print the current DOCA version in use | N/A |