Skip to main content

SNI

Counts TLS traffic and flows by the Server Name Indication hostname in the ClientHello, keyed by that hostname.

PropertyValue
GUID{38497403-23FB-4206-65C2-0AD5C419DD53}
LayerL7 Application
InputPackets
Key typeSNI hostname string
ImplementationLua — sni.lua (group, reassembly), sni-tls.lua (ClientHello parser) (apps/analyzers/sni-tls)
Trisul Appsni-tls (install from Trisul Apps)
Bucket / Topper30 s / 300 s
Enabled by defaultYes, after the app is installed

What it measures​

  • The script handles only TCP flows whose flow key contains port 443 (p-01BB). It reads reassembled payload in direction 1 (client to server) and parses the first TLS record.
  • From a ClientHello with a server_name extension (type 0), each hostname adds 1 to Flows. It also attaches a flow counter, so every later packet of the flow, in both directions, adds its wire length to meter 0.
  • After the ClientHello the parser stops reading the flow. A ClientHello with no extensions is not counted.
  • The script also adds a flow → SNI edge and sets the flow attribute SNI, which other scripts can read.
  • Each flow updates one key, so there is no double counting.

Keys​

One key is the hostname from the SNI extension, as sent by the client. Names of 60 characters or more are cut to the first 60 characters, with a NUL byte added. No labels are set.

KeyMeaning
www.google.comFlows that asked for www.google.com
api.github.comFlows that asked for api.github.com
outlook.office365.comFlows that asked for outlook.office365.com

Special keys​

KeyMeaning
SYS:GROUP_TOTALSSum of every update made to this group in the interval: all port-443 flows with an SNI hostname.

Meter list​

IDNameTypeUnitsTopBottomDescription
0Total TrafficVT_RATE_COUNTERBps500Short name bytes. Wire bytes of the flow's packets, both directions, from the ClientHello onward.
1FlowsVT_COUNTERFlows500Short name flows. 1 per ClientHello hostname.
2uniqsVT_GAUGEUniques2020Reserved cardinality slot. Not populated.
3uniqsVT_GAUGEUniques2020Reserved cardinality slot. Not populated.