Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bugs in BasicFlow.java and FlowGenerator.java #170

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

hexiaole1994
Copy link

bug 1: BasicFlow.java
In BasicFlow.java:firstPacket, the variable flowLengthStats is added
by payload of packet twice rather than once.
The first time is after enter BasicFlow.java:firstPacket, and before
checking whether it is forward packet or backward packet.
The second time is after checking whether it is forward packet or
backward packet.

bug 2: BasicFlow.java
In the first packet of a flow which is handled in
BasicFlow.java:firstPacket, the flags PSH and URG are counted
correctly.
But in the second and after packets of a flow which is handled in
BasicFlow.java:addPacket, the flags PSH and URG are not counted
correctly.

but 3: BasicFlow.java
In the first packet of a flow which is handled in
BasicFlow.java:firstPacket, when calling function:updateFlowBulk, the
BasicFlow.src is null, but the BasicFlow.src is used to compare with
the source ip of the first packet.
In function:updateFlowBulk, in order to compare with BasicFlow.src
and the source ip of the first packet, the code use operator ==
rather than Arrays.equals.

bug 4: FlowGenerator.java
When handling a closed flow which receives FIN flag, the code from
FlowGenerator.java:addPacket check if the flow receive FIN flag on
both direction, but the code incorrectly use
function:getBwdFINFlags + function:getBwdFINFlags == 2
rather than
function:getFwdFINFlags + function:getBwdFINFlags == 2.

In BasicFlow.java:firstPacket, the variable flowLengthStats is added
by payload of packet twice rather than once.
The first time is after enter BasicFlow.java:firstPacket, and before
checking whether it is forward packet or backward packet.
The second time is after checking whether it is forward packet or
backward packet.
This commit remove the second redundant one.
In the first packet of a flow which is handled in
BasicFlow.java:firstPacket, the flags PSH and URG are counted
correctly.
But in the second and after packets of a flow which is handled in
BasicFlow.java:addPacket, the flags PSH and URG are not counted
correctly.
This commit counts PSH and URG flags correctly for the second and
after packets.
In the first packet of a flow which is handled in
BasicFlow.java:firstPacket, when calling function:updateFlowBulk, the
BasicFlow.src is null, but the BasicFlow.src is used to compare with
the source ip of the first packet.
In function:updateFlowBulk, in order to compare with BasicFlow.src
and the source ip of the first packet, the code use operator ==
rather than Arrays.equals.
This commit fixes these 2 bugs.
When handling a closed flow which receives FIN flag, the code from
FlowGenerator.java:addPacket check if the flow receive FIN flag on
both direction, but the code incorrectly use
function:getBwdFINFlags + function:getBwdFINFlags == 2
rather than
function:getFwdFINFlags + function:getBwdFINFlags == 2.
This commit fixes this bug.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant