Skip to main content

Module classifier

Module classifier 

Source
Expand description

NNTP Command Classification for High-Performance Proxying

This module implements ultra-fast command classification optimized for 40Gbit line-rate processing with zero allocations. The hot path (70%+ of traffic) executes in 4-6ns.

§NNTP Protocol References

Commands are defined in:

  • RFC 3977 - Network News Transfer Protocol (NNTP) - Base specification
  • RFC 4643 - NNTP Extension for Authentication (AUTHINFO)
  • RFC 2980 - Common NNTP Extensions (legacy, mostly superseded)

§Performance Characteristics

  • Hot path: 4-6ns for ARTICLE/BODY/HEAD/STAT by message-ID (70%+ of traffic)
  • Zero allocations: Pure stack-based byte comparisons
  • SIMD-friendly: Compiler auto-vectorizes with SSE2/AVX2
  • Branch prediction: UPPERCASE checked first (95% hit rate in real traffic)

Enums§

NntpCommand
NNTP command classification for routing and handling strategy

Constants§

HEAD_CASES
RFC 3977 §6.2.2 - HEAD command Retrieve article headers by message-ID or number
STAT_CASES
RFC 3977 §6.2.4 - STAT command Check article existence by message-ID or number (no body transfer)

Functions§

matches_any
Check if command matches any of N case variations