Lightweight network packet aggregation and efficient storage and querying of flows