PcapPacket expectedLowerBound = mLowerBound.get(mMatchedPackets.size());
PcapPacket expectedUpperBound = mUpperBound.get(mMatchedPackets.size());
// First verify if the received packet has the length we're looking for (the length should be within the range).
-// if (expectedLowerBound.getOriginalLength() - (int) mEps <= packet.getOriginalLength() &&
-// packet.getOriginalLength() <= expectedUpperBound.getOriginalLength() + (int) mEps){
+ if (expectedLowerBound.getOriginalLength() - (int) mEps <= packet.getOriginalLength() &&
+ packet.getOriginalLength() <= expectedUpperBound.getOriginalLength() + (int) mEps){
// TODO: TEMPORARILY WITHOUT EPS
- if (expectedLowerBound.getOriginalLength() <= packet.getOriginalLength() &&
- packet.getOriginalLength() <= expectedUpperBound.getOriginalLength()){
+// if (expectedLowerBound.getOriginalLength() <= packet.getOriginalLength() &&
+// packet.getOriginalLength() <= expectedUpperBound.getOriginalLength()){
// If this is the first packet, we only need to verify that its length is correct. Time constraints are
// obviously satisfied as there are no previous packets. Furthermore, direction matches by definition as we
// don't know the MAC of the device (or phone) in advance, so we can't enforce a rule saying "first packet
while ((match = findSubsequenceInSequence(lowerBound, upperBound, cPkts, mClusterMemberDirections, null)).
isPresent()) {
List<PcapPacket> matchSeq = match.get();
-// // Notify observers about the match.
+ // Notify observers about the match.
// mObservers.forEach(o -> o.onMatch(Layer3ClusterMatcher.this, matchSeq));
if (!matchSeq.get(matchSeq.size()-1).getTimestamp().isAfter(matchSeq.get(0).getTimestamp().
plusMillis(mInclusionTimeMillis))) {
while ((match = findSubsequenceInSequence(signatureSequence, cPkts, mClusterMemberDirections, null)).
isPresent()) {
List<PcapPacket> matchSeq = match.get();
-// // Notify observers about the match.
+ // Notify observers about the match.
// mObservers.forEach(o -> o.onMatch(Layer3ClusterMatcher.this, matchSeq));
if (!matchSeq.get(matchSeq.size()-1).getTimestamp().isAfter(matchSeq.get(0).getTimestamp().
plusMillis(mInclusionTimeMillis))) {
// We only have a match if packet lengths and directions match.
// The packet lengths have to be in the range of [lowerBound - eps, upperBound+eps]
// TODO: Maybe we could do better here for the double to integer conversion?
-// int epsLowerBound = lowBndPkt.length() - (int) mEps;
-// int epsUpperBound = upBndPkt.length() + (int) mEps;
+ int epsLowerBound = lowBndPkt.length() - (int) mEps;
+ int epsUpperBound = upBndPkt.length() + (int) mEps;
// TODO: TEMPORARILY REMOVE EPS BOUNDS
- int epsLowerBound = lowBndPkt.length();
- int epsUpperBound = upBndPkt.length();
+// int epsLowerBound = lowBndPkt.length();
+// int epsUpperBound = upBndPkt.length();
if (epsLowerBound <= seqPkt.getOriginalLength() &&
seqPkt.getOriginalLength() <= epsUpperBound &&
subsequenceDirections[subseqIdx] == sequenceDirections[seqIdx]) {