<div dir="ltr">Hi Zeek,<div><br></div><div>Hope you&#39;re all doing well.</div><div>I have a big 4GB sized PCAP and I am running many iterations of it at 10 Gbps with the help of load balancer and multiple instance of bro running on top of it.</div><div>It takes around 3.5 seconds to finish one iteration. I have to run multiple iteration of the same pcap because of not having a test network which can pump 10Gbps traffic to my software. I don&#39;t even have a very large pcap so that I can run only one iteration for a long time.</div><div><br></div><div>Other than proper(SYN-SYNACK-ACK--------FIN/RST) TCP flows, bro is able to hold all the other connections. If the run is for let&#39;s say an hour, it notifies about the connection after the test is over. This particular scenario is a test specific, but the need to tackle long lived flows is a valid one.</div><div><br></div><div>I tired, <b>&quot;connection_status_update&quot; </b>way of handling this. If the update interval is configured to 10 min, it starts dropping exactly around 40 mins. If the interval is kept to 1 min, it starts having problem at around 4 min. I could not figure out why bro behaves this way, what is causing at (interval * 4) mins(there is one parameter i think is playing a role which is the time taken by a PCAP to complete one iteration, but still it doesn&#39;t help coming up with any theory). So, after it starts dropping, the number of broccoli sockets seems to be increasing and bro then goes into unresponsive state.</div><div><br></div><div>I tried Connection polling using ConnPolling::watch(), this approach is way better than <b>connection_status_update</b> for sure is what I observed, this takes a little while to drop but it doesn&#39;t go into the very bad state of sockets being increasing and the unresponsive state.</div><div><div><br></div><div>I also tried schedule, and it didn&#39;t serve my purpose either.<br></div><div></div></div><div><br></div><div><br></div><div>After trying out whatever bro suggests me to handle this, I came up with my own implementation.</div><div>--------------------------------------------------------------------------------------------------------------------</div><div>redef record connection += {<br>  loop_count: count &amp;default=1;<br>};<br></div><div><br></div><div>global connection_status_interval = 1 min;<br>global connTable: table[string] of conn_id = table();</div><div><br></div><div>event connection_state_remove(c: connection)<br>{<br>  delete connTable[c$uid];<br>}<br><br></div><div>event new_connection(c: connection)<br>{</div><div>  connTable[c$uid] = c$id;<br>}<br></div><div><br></div><div>event checkConnectionInterval()<br>{<br>      local conn: connection;<br>      for (uid1 in connTable)<br>      {<br>                conn = lookup_connection(connTable[uid1]);<br>                if (conn$duration &gt;= connection_status_interval * conn$loop_count)<br>                {<br>                handle_connection_data(conn, T);<br>                conn$loop_count += 1;<br>                }<br>      }<br>      schedule 30secs {checkConnectionInterval()};<br>}<br><br>schedule 30secs {checkConnectionInterval()};</div><div>-------------------------------------------------------------------------------------------------------------------- </div><div><br></div><div>As you can see, I maintained my own connection table, and with the help of schedule, I am managed to scan the table every 30 seconds and compare the connection&#39;s duration with the time configured.</div><div>I haven&#39;t explore if schedule routines works in the same main thread?? If yes, then obviously, this can hold bro&#39;s main packet processing thread and we may have a serious damage going through a big list of such table entries. But I also thought of scanning in some batches, with the help of <b>Two_Such_Tables</b> and a <b>flag_For_In_Which_To_Fill_NewConnections</b> approach. Scanning in some batches will surely help in overall balancing of the software.</div><div><br></div><div>With this approach, I am having a successful run.</div><div><br></div><div>I just want to know what do you guys feel about this by keeping everything(test scenario/overall system&#39;s condition etc.) in mind.</div><div>Can bro&#39;s suggested approach work in real 10Gbps network traffic??</div><div>Any suggestions how I can simulate 10Gbps real network traffic with the packet containing protocols or conversations I am interested in??</div><div><br></div><div><br></div><div>Regards,</div><div>Nabil Jada</div></div>