Commit Graph

224 Commits

Author SHA1 Message Date
Srivats P
6108de9b4f Remove comment about trying read-write lock
The stream timingHash is read by getStreamStats() while it is read/write
for processRecords(), the latter is a more frequent operation so there's
no real benefit of using a read-write lock instead of simple mutex.
2023-04-27 11:15:26 +05:30
Srivats P
e761bfa5c4 Make app QObject parent of StreamTiming singleton 2023-04-27 11:09:31 +05:30
Srivats P
b9345463c4 Add thread name for PcapRxStats
PcapTxTtagStats thread name has also been shortened since names beyond 16
chars are truncated.
2023-04-26 12:22:26 +05:30
Srivats P
dc6c4963a2 Change stream timing GC timer to CLOCK_REALTIME 2023-04-26 11:38:00 +05:30
Srivats P
cded62246e Don't fix incorrect checksum for Ttag packets
See comments in code
2023-04-26 10:01:24 +05:30
Srivats P
10befe0a66 Remove PcapTxTtagStats::handle_ member
PcaptxTtagStats inherits from PcapSession which already includes a protected
handle_ member.

This removal was likely left off when PcapTxTtagStats started inheriting from
PcapSession.
2023-04-24 17:26:50 +05:30
Srivats P
4394c7ffee Rework sequential mode build for new ttag algo
The previous commit changed the algo to determine which packets were Ttag'd,
but changes were done only for interleaved mode.

This commit adds the changes required for sequential mode.
2023-04-24 17:05:40 +05:30
Srivats P
ef1c166e7f Change algo to infer next Ttag pkt (interleaved mode)
The algo works for the following cases of interleaved streams -
 * pktListDuration < ttagTimeInterval
 * pktListDuration > ttagTimeInterval
 * some streams have Ttag, some don't
    - first stream has Ttag
    - first stream does NOT have Ttag
 * no streams have Ttag

Changes for sequential mode are pending
2023-04-21 18:32:17 +05:30
Srivats P
d1d2a5c1b5 Fix infinite loop in building interleaved streams
Incorrect timestamp comparison was leading to infinite loop
2023-04-21 17:11:43 +05:30
Srivats P
f56ce2e2ec Add explicit packet set for interleaved streams
Interleaved mode used an implicitly added packet set in both base and Turbo
code. This has been chaned to use an explicit mode to keep things consistent.

Turbo code still has the implicit packet set related code - that needs to be
removed, once the explicit packet set code is validated and tested.
2023-04-17 11:59:00 +05:30
Srivats P
c91475d416 Use qFrom/ToBigEndian instead of ntohs/htons
For consistency with rest of the code
2023-04-13 18:10:43 +05:30
Srivats P
b2ad3c5d08 Recompute L4 checksum on-the-fly for TTag packets 2023-04-12 15:47:55 +05:30
Srivats P
896371b987 Calculate L4 checksum offset for TTag packets 2023-04-11 18:09:14 +05:30
Srivats P
f5bb2e5d80 Rename delay as latency in Protobuf/RPC
The GUI uses the term 'latency', so it's better if the API alsos use the same
term instead of 'delay'
2023-04-04 18:34:20 +05:30
Srivats P
7cfccd686e Fix StreamTiming TxRxKey
makeKey was incorrect by mistake
2023-04-04 13:22:18 +05:30
Srivats P
aa140cd32a Process pending before fetching streamTiming delay 2023-04-03 12:58:58 +05:30
Srivats P
3b499263ec Fix MacOS build break by removing unused member
PcapTxTtagStats::lastPcapStats_ was unused because debugStats() was moved to
PcapSession, but removing this member var was left out
2023-04-03 12:54:13 +05:30
Srivats P
c378600baf Fix streamTiming garbage collection infinite loop 2023-04-03 12:47:30 +05:30
Srivats P
68734c44ca Delete PcapTxTtagSession::debugStats
debugStats() was moved to base class PcapSession earlier, but removing it
from here was missed out
2023-03-31 18:21:36 +05:30
Srivats P
05a9dd5743 Rename PcapRxStats::id_ as PcapRxStats::portId_
Better code clarity
2023-03-31 16:58:52 +05:30
Srivats P
05335b31d5 Integrate StreamTiming with the code
Bugs found during integration were fixed and minor code improvements were made
such as using consts, const params, renaming members etc.
2023-03-31 16:55:03 +05:30
Srivats P
f4c21e1ae4 Change StreamTiming::timing_ from QList to QHash
Using QList meant we need to know the port count in the constructor - which is
difficult to know because StreamTiming is designed as a singleton
2023-03-29 17:13:12 +05:30
Srivats P
757d3f1b24 Add initial cut of StreamTiming class
This singleton class will keep track of Ttag timing across all ports and GUIDs.

A bunch of FIXMEs/TODOs are pending for this class implementation; also this
class has not been hooked up to the rest of the code yet.
2023-03-28 16:06:28 +05:30
Srivats P
7e30ef5541 Fix another MacOS build break
Break was due to following warnings (being promoted to errors) -
 * id_ private member was unused
 * tv_usec is int on MacOS (but long on Linux)
2023-03-23 15:55:35 +05:30
Srivats P
f7b6b46a5d Move debugStats() from PcapRx to base PcapSession
With this change, other classes that use PcapSession as base can also
use debugStats(), if required
2023-03-23 15:42:41 +05:30
Srivats P
823f01557b Ignore failures when stopping stream stats tracking
Stop everything irrespective of any failures
2023-03-22 16:42:54 +05:30
Srivats P
682d0cc5c9 Create a Tx Ttag tracker thread
For now we are just debug printing timestamp with T-TagId and GUID. We
need to store this tuple and compare when we Rx the same - this will be
in a upcoming commit.
2023-03-22 16:32:41 +05:30
Srivats P
f1cfaa6e89 Fix MacOS build break
For some reason udiffTimeStamp is not defined for MacOS. To be investigated
later.
2023-03-22 16:29:51 +05:30
Srivats P
072dfcdc3b Add an incrementing tag id to T-Tag packets 2023-03-18 16:34:47 +05:30
Srivats P
90a3731a90 Add infra to update L4 checksum for T-Tag packets
Pending
 * Calculate L4 checksum offset instead of hardcoded value
 * Recalculate packet L4 checksum instead of using 0 value
2023-03-18 15:01:11 +05:30
Srivats P
5d4a19174e Change T-Tag on the fly 2023-03-17 12:45:59 +05:30
Srivats P
2104936b69 Don't create implicit packet sets for Tx
As part of Turbo changes, we made changes to create explicit packet
sets, but for the base code we continued creating implicit packet
sets for some cases. With this change we don't create any implicit
packet set.

This change needs to be tested thoroughly for multiple cases.
2023-03-17 12:36:29 +05:30
Srivats P
5dc1b851cc Reduce vertical whitespace in sendQueueTransmit() 2023-03-16 12:10:42 +05:30
Srivats P
ebccc44cdf Reformat TxThread/run {} to use less vertical space 2023-03-08 18:14:45 +05:30
Srivats P
f3a9b507b0 Update comments about implict packetset 2023-03-08 18:10:09 +05:30
Srivats P
7b7ede351b Fix build break with stream stats fix
The fix was validated with Windows, but not on Linux. This commit fixes
the build break for non-windows platforms.
2023-02-09 15:06:34 +05:30
Srivats P
c70811eaa4 Fix spurious stream stats drops
The problem happens for bidirectional flows. The sequence of events is
as follows when you start Tx on Ports p1, p2 with the current code -

1. Clear stream stats on p1
2. Start tx on p1
3. Clear stream stats on p2
4. Start tx on p2

By the time #3 is executed, it may have already rx packets from p1 which
are being incorrectly cleared, this will cause these number of packets
to show up as dropped instead - incorrectly.

The fix is to change the order like this -

1. Clear stream stats on p1
2. Clear stream stats on p2
3. Start tx on p1
4. Start tx on p2

Unidirectional flows will not see this problem - as long as startTx is
done only on the Tx port and not the Rx port.

This bug is a regression caused due to the code changes introduced for the
stream stats rates feature implemented in 1.2.0
2023-02-08 16:34:03 +05:30
Srivats P
c07d9e8691 Fix drone crash at startup on Linux
The crash happens if there is a default route without a gateway in
the main routing table
2022-12-23 13:14:19 +05:30
Srivats P
42091e5221 Allow user to add a port description
If a user description is available, that is shown in the ports window
other wise the system determined description is shown.

Updates #223
2022-09-09 12:25:17 +05:30
Srivats P
2970a292c6 Fix build break and warnings 2022-06-28 18:32:39 +05:30
Srivats P
701a058c7d Merge commit 'refs/subrepo/ostinato/fetch' into subrepo/ostinato
Update from master repo into turbo
2022-06-27 14:35:22 +05:30
Srivats P
2103f2c5a6 Minor editorial change for cleaning up message 2022-06-27 13:43:48 +05:30
Srivats P
4be8a2969d Create and print activation hash on request
To request, pass option -a on the command-line
2022-06-27 13:43:48 +05:30
Srivats P
46a54fd56b Define PCAP promisc flag only if not defined 2022-06-27 13:43:48 +05:30
Srivats P
d32f89d30b Enable libbpf logging when drone logs are enabled 2022-06-27 13:43:48 +05:30
Srivats P
1b647ade1b Print "Starting..." after processing command line args 2022-06-27 13:43:47 +05:30
Srivats P
789338c8e1 Add startup/shutdown console prints 2022-06-27 13:43:47 +05:30
Srivats P
898b56fc76 Add turbo license validation code
Signed up for and using keygen.sh licensing SAAS
2022-06-27 13:43:47 +05:30
Srivats P
c949dc6682 Integrate XdpPort more cleanly into port manager
* No ugly #ifdef TURBO
* Turbo ports need to be specified explicitly in drone.ini
* If a port is not a turbo port, fall back to LinuxPort
* Turbo ports set their description as 'Turbo' which shows up in GUI
* Some XdpPort creation/destruction error checks
2022-06-27 13:43:47 +05:30
Srivats P
eb2ca12f32 Reorg (part 4) - add left out file
ostinato/server/timespecops.h got left out from part 1 commit of
the reorg - because it was a new file and was ignored by a wrong
.gitignore rule
2022-06-27 13:43:46 +05:30