Upgrade to Pro — share decks privately, control downloads, hide ads and more …

flowstatd

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on.

 flowstatd

Avatar for Kudo Chien

Kudo Chien

July 12, 2014
Tweet

More Decks by Kudo Chien

Other Decks in Programming

Transcript

  1. Kudo Chien CCUCSIE 2002-2008 BS+MS (GAIS Lab)! CNA ! 曾⼯工作於

    Trend Micro、︑Waveface! 現任 biideal CTO
  2. Kudo Chien 打雜! UN*X system programming! Windows programming! Network programming!

    Cloud/Web backend! Web frontend! Browser extension development! DevOps! Hacking! iOS! Android! Debug
  3. 宿網流量統計 v1 來⾃自交⼤大 open source 的版本! flow-tools + Perl script!

    每⼩小時”重頭”算⼀一次統計! 是網管的災難,使⽤用者的福⾳音
  4. Architecture v1 collector! process! 
 listen port 1025 query! process!

    
 named pipe! socket shm Command! topN! over 5G
  5. Architecture v2 Single process multiplexing! kqueue / select UDP! collector

    port TCP! command port 那⼀一年,我還不知道 libevent / libev
  6. Object Oriented Programming Trained from Trend Micro ! 常⾒見的好習慣是把 shared

    code 拆成 functions
 OOP 則更進⼀一步把 shared behaviors 詮釋成 共同的 interfaces! 以上是本⼈人不負責任亂掰的說法 *誤*
  7. Multiple subnets 全校⽤用⼀一個 hash table 相對 簡單! 宿網 30 個

    subnets 反⽽而麻煩 subnet 1! hash table subnet 2! hash table subnet N! hash table Binary Search
  8. Netflow version 9 template! multiple source + multiple source id

    Image source: http://www.lancope.com/blog/netflow-v5-vs-netflow-v9/
  9. Netflow version 9 多個 source ip 下⾯面又可以有多個 source id! 又想⽤用

    hash 又不想⽤用太多 memory! two hash tables! source table! template table
  10. Hash from two factors source! table template! table template! table

    template! table source! table template table