I've developed a network traffic classification program in C. I used the 5 tuple to determine a flow. The 5 tuple is:
- source adress
- destination adress
- source port
- destination port
- protocol(tcp,udp,dns etc)
However, in addition to determine a flow, I have to decide the time that flow is closed. Firstly, I'm planning to use FIN flag in TCP but I have a issue for this:
It can be multiple packets which include FIN flag in the flow . When do I decide that flow is closed completely?
Secondly, if I am going to use timeout mechanism to determine that flow is closed/closing, what should be the time threshold?