Netify DPI - Data Streams

This document provides details on the network metadata information available through the Netify DPI Data Streams. If you would like to interact with the data in a live environment, please start with the getting started guide. For firewall and QoS integrations, Netify also provides optional integrations for high-speed interaction with IP sets, nftables, and connection tracking (CT) labels.

Integrations

Cybersecurity engines, QoE managers, performance analytics solutions, and other third-party applications can connect to the Netify DPI Agent to interact with the network flow metadata. The Netify Agent's socket interface (TCP/IP and UNIX sockets) provides near real-time agent status and flow/DPI detection data via JSON encoded payloads.

With the Netify DPI Data Stream, you can develop and create your own integrations: open source, proprietary, in-house... it's up to you.

Connection Tracking

Data Stream Types

There are several different types of data available via the Netify Agent JSON encoded data streams:

  • Flow - Flow detection and risk metadata
  • Flow Purge - Flow purge and performance data
  • Flow Stats - Flow stats time-based data
  • Agent Hello - Agent startup information
  • Agent Status - Agent, network interface information, and summary stats

Information on each type of data is described below. The structures should be self-documenting, but if further explanation or details are required, please don't hesitate to contact us.

Type: Flow - Detection and Risk Metadata

Description

Detection data is available as soon as the first 1-10 packets of a network conversation have been completed. This data provides a path to quickly react to network traffic patterns on the network. It also provides the network metadata extracted from the deep packet inspection engine.

Let's take a look at some sample data (see adjacent JSON data). This particular flow comes from a mobile phone that started up the WhatsApp app. You can see the usual network data in the JSON structure: IP version, MAC addresses, IPs, ports, network interfaces, and timestamps. In addition, you can see the additional DPI data. Read on.

Application: WhatsApp

The detected_application_name shows that it was a flow generated by WhatsApp. In this particular case, this detection was made using the TLS/SSL SNI hostname and certificate common name. Other heuristics are also used to detect applications.

Protocol: HTTPS

The DPI engine detected the HTTPS protocol (detected_protocol). This is more than just mapping port 443 to HTTPS, the engine did a full deep packet inspection and used the Application-Layer Protocol Negotiation (ALPN) data to fine-tune detections. In fact, Netify will detect SSL/SNI over any port.

Category

The application, domain and protocol categories are given in the flow data. In this example, the application category is "Messaging" (#17) and the protocol category is "Web" (#22).

Risks

Any flows that trigger a risk event will have details provided in the risk section of the metadata.

Other/Local Nomenclature

The local designation indicates the endpoint's local side, and the other designation will be indicated by the other_type field. These designations do not indicate a flow's direction. To determine which side of a flow started the conversation, consult the local_origin field. When this field is true, it indicates that the local endpoint started transmitting first. When false, the opposite endpoint started the flow. In the stats data (see below) and referencing the example to the right, we see:

local_origin: true
local_ip: 192.168.4.105 
local_bytes: 2434 
other_type: remote
other_ip: 31.13.80.53
other_bytes: 6139

Using the logic above, you can conclude that 192.168.4.105 transmitted 2434 bytes and received 6139 bytes from 31.13.80.53.

DPI: HTTPS Details

Detecting the protocol is just the start. The Netify Agent also breaks down the details of the SSL/TLS connection:

  • SNI hostname: static.whatsapp.net
  • Certificate CN: *.whatsapp.net
  • TLS version: 0x0303 (TLS 1.2)
  • Encryption cipher: 0xc02b info
  • JA3/TLS fingerprint: details
  • Subject DN

Other protocols will have different metadata attached. For example, HTTP traffic also includes the URL and user agent.

{
  "type": "flow",
  "interface": "ens34",
  "internal": true,
  "established": false,
  "flow": {
    "category": {
      "application": 17,
      "domain": 0,
      "protocol": 22
    },
    "risks": {
      "ndpi_risk_score": 10,
      "ndpi_risk_score_client": 5,
      "ndpi_risk_score_server": 5,
      "risks": [ 15 ]
    },
    "digest": "09c9e2b73d68fef245c09141cb63dad8d9001a6c",
    "ip_nat": false,
    "ip_version": 4,
    "ip_protocol": 6,
    "vlan_id": 0,
    "other_type": "remote",
    "local_origin": true,
    "other_mac": "00:90:fb:29:ca:ba",
    "local_mac": "a0:c9:a0:e5:2c:eb",
    "other_ip": "31.13.80.53",
    "local_ip": "192.168.4.105",
    "other_port": 443,
    "local_port": 38972,
    "detected_protocol": 196,
    "detected_protocol_name": "HTTPS",
    "detected_application": 544,
    "detected_application_name": "142.netify.whatsapp",
    "detection_guessed": 0,
    "ssl": {
      "alpn": [
        "h2",
        "http/1.1"
      ],
      "alpn_server": [],
      "version": "0x0303",
      "cipher_suite": "0xc02b",
      "client_sni": "static.whatsapp.net",
      "server_cn": "*.whatsapp.net",
      "client_ja3": "d8c87b9bfde38897979e41242626c2f3",
      "server_ja3": "6e15a5bf660856fa03186247ca41d059",
      "issuer_dn": "C=US, O=DigiCert Inc, OU=www...",
      "subject_dn": "C=US, ST=California, L=Menlo..."
    },
    "first_seen_at": 1574786068665,
    "first_update_at": 1574786068665,
    "last_seen_at": 1574786068715
  }
}

Example Use Cases

As you can imagine, the Netify data stream can be used to interact with the underlying operating system. Some sample uses cases:

  • SD-WAN routing policies based on applications
  • Firewall and QoS policies based on DPI information
  • Wireless access point (WAP) optimization

Type: Flow Purge - Stats and Performance Data

Description

When a network flow is either closed or becomes idle, the Netify Agent publishes a flow_purge record to the Data Stream. Today, this stream provides network statistics: byte counters, traffic counters, timestamps, etc. In the near future, expect to see performance information added to the payload, for example:

  • Statistics on DNS response times
  • HTTP response codes and times
  • Network performance statistics
  • and more

Note: requires netifyd version 3.06 or later.

"type": "flow_purge"
"reason": "terminate",
"flow": {
  "digest": "178bf5650a79d5e8ddc6a988d0c02b3d799180d0",
  "last_seen_at": 1606232131756,
  "local_bytes": 2434,
  "local_packets": 21,
  "other_bytes": 6139,
  "other_packets": 16,
  "total_bytes": 8573,
  "total_packets": 37,
  "detection_packets": 3,
  ... snip ...

Example Use Cases

  • Cybersecurity analysis
  • Policy and Charging Rules Function (PCRF)
  • Zero-rating policy engines

Type: Flow Stats - Stats Information

Description

Some network flows are long-lived, for example, audio/video streams and VPN connections. The Netify Agent will periodically publish a flow_stats record to the Data Stream. The network status on active flows provides real-time insights into the network.

Example Use Cases

  • Live bandwidth statistics
  • QoE based on live data usage

Note: requires netifyd version 4.2.0 or later.

"type": "flow_status",
"flow": {
  "digest": "178bf5650a79d5e8ddc6a988d0c02b3d799180d0",
  "last_seen_at": 1606232131756,
  "local_bytes": 2434,
  "local_packets": 21,
  "other_bytes": 6139,
  "other_packets": 16,
  "total_bytes": 8573,
  "total_packets": 37
},

Type: Agent Hello

The agent_hello data type provides versioning and feature information. This makes it possible for third-party applications to manage upgrades and changes to the Netify Agent data stream.

"type": "agent_hello",
"agent_version": 3.06,
"build_version": "Netify Agent/3.06 (debian; x86_64; netlink; dns-cache; plugins; tcmalloc; inotify; regex) nDPI/2.9.0 JSON/1.90",
"json_version": 1.9

Type: Agent Status

Overview

The agent_status data type provides agent information, system status, and network interface statistics. This makes it possible to monitor and manage the performance of the underlying DPI engine and network interfaces.

Interfaces

Information on the network interfaces monitored by the Netify Agent is provided. This includes:

  • MAC address
  • Role (WAN or LAN)
  • Bound IP Addresses

Interface Stats

Statistics for the network interfaces are given on the regular stats interval (15 seconds). You can find statistics on discarded packets, dropped packets, fragmentation, and much more.

"type": "agent_status",
"cpu_cores": 4,
"cpu_system": 11.980329,
"cpu_system_prev": 11.955085,
"cpu_user": 2.982633,
"cpu_user_prev": 2.978507,
"devices": null,
"dhc_size": 189,
"dhc_status": true,
"flow_count": 9,
"flow_count_prev": 9,
"interfaces": {
  "enp0s10": {
    "addr": [
      "10.0.5.15",
      "fe80::a00:27ff:fe92:be9f"
    ],
    "mac": "08:00:27:92:be:9f",
    "role": "WAN"
  },
  "enp0s3": {
    "addr": [
      "192.168.55.7",
      "fe80::a00:27ff:fe30:2736"
    ],
    "mac": "08:00:27:30:27:36",
    "role": "WAN"
  }
},
"maxrss_kb": 36212,
"maxrss_kb_prev": 36212,
"sink_queue_max_size_kb": 2048,
"sink_queue_size_kb": 0,
"sink_resp_code": 1,
"sink_status": true,
"sink_uploads": true,
"stats": {
  "enp0s10": {
    "discarded": 0,
    "discarded_bytes": 0,
    "ethernet": 26,
    "fragmented": 0,
    "icmp": 0,
    "igmp": 0,
    "ip": 26,
    "ip_bytes": 8594,
    "largest_bytes": 2974,
    "mpls": 0,
    "pcap_drop": 0,
    "pcap_ifdrop": 0,
    "pcap_recv": 26,
    "pppoe": 0,
    "queue_dropped": 0,
    "raw": 26,
    "tcp": 24,
    "tcp_resets": 3,
    "tcp_seq_error": 1,
    "udp": 2,
    "vlan": 0,
    "wire_bytes": 9218
  },
  ...
},
"tcm_kb": 11152,
"tcm_kb_prev": 11150,
"timestamp": 1654542530,
"update_imf": 1,
"update_interval": 15,
"uptime": 8510,
"version": 1.9

Further Reading

Related Information

Plugins and Addons

Evaluate Netify DPI

Do you want to get started with evaluating Netify DPI? Request the Integrators Kit today.

Integrators Kit