[Network Interface]
│
▼
[AF_PACKET / libpcap] ──► [BPF Filter Engine]
│
▼
[Ring Buffer (Lock-free)]
│
▼
[Packet Parser (Ethernet → IP → L4)]
│
▼
[Aggregation Hash Table]
│
▼
[Timer / Packet Limit Reached] ──► [Output Formatter]
tnhits -i eth0 -a dstport -t 60 -o json | jq '.' > stats.json
This is the most critical point. Piracy directly impacts the revenue of the filmmakers. When a movie leaks online, theatrical attendance drops. This hits the producers hard and can affect the budget for future projects. Supporting piracy ultimately hurts the industry you love.
| Feature | Description |
| :--- | :--- |
| Real-time counters | Incremental packet and byte counts. |
| Protocol filtering | TCP, UDP, ICMP, or ARP only. |
| Aggregation modes | By source IP, destination IP, port pair, or protocol. |
| Output formats | Human-readable table, JSON, or CSV. |
| Low overhead | Uses AF_PACKET (Linux) or libpcap (cross-platform) with zero-copy ring buffers. |
For emerging Vietnamese artists, a #1 spot on TNHits is career-changing. Established stars like Sơn Tùng M-TP, Hoàng Thùy Linh, and Jack have held the top spot multiple times. But the platform has also elevated relative unknowns whose songs went viral almost by accident.
One notable case: in 2021, a lo-fi R&B track by a then-underground singer entered the TNHits top 5 through sheer word of mouth on student forums. Within weeks, major labels came calling. The artist later said, "I knew I’d ‘made it’ not when I signed a contract, but when my mom called to say she saw my name on TNHits."