Comments (2)
Hi wesly2000,
TL;DR
You are correct, we define a flow as the (ip source, ip destination, sport, dport, protocol)
-tuple.
However, when using (ip source, ip destination, sport, dport, protocol)
a flow communicating in one direction (e.g., client to server) would be different from a flow communicating in the other direction (e.g., server to client) (ip destination, ip source, dport, sport, protocol)
.
In the reader, tshark
deals with this for us by giving a unique identifier for the TCP/UDP connection (packet[2]
), however identifiers are reused for TCP and UDP so we need protocol information (packet[1]
). Finally, these identifiers are reused per .pcap
file so we also need to specify the filename to be unique. So the (packet[0], packet[1], packet[2])
should be equivalent to the (ip source, ip destination, sport, dport, protocol)
-tuple, but without having to deal with the mess of flow directions.
Detailed explanation
You correctly understood from the paper that the same (ip source, ip destination, sport, dport, protocol)
-tuple constitutes a flow. However, there are a couple of gory details that make the implementation a bit more complex. The most important one here is that often, a network connection is a two-way communication (e.g., a client sending data to a server, and a server responding with data to the client). In our work, we believe that this two-way communication should still be considered as a single flow. Therefore, if you use the (ip source, ip destination, sport, dport, protocol)
-tuple as a key for grouping, you would have to take into account that (ip destination, ip source, dport, sport, protocol)
has to map to the same grouping.
The tool that we use for reading tshark
offers the following two options:
-e tcp.stream
, assigns a unique number to each different TCP stream in the pcap-e udp.stream
, assigns a unique number to each different UDP stream in the pcap
That means that the first (ip source, ip destination, sport, dport, TCP)
/(ip destination, ip source, dport, sport, TCP)
it recognizes will get ID 0, the second will get ID 1, etc. The same goes for the UDP variant. We capture this in packet[2]
.
To differentiate between TCP and UDP connections (and make it a true (ip source, ip destination, sport, dport, protocol)
-tuple), we have to include information about the protocol packet[1]
. Finally, these options start counting from 0 for each file that is being parsed, we differentiate these identifiers by the filepath of the analyzed pcap.
In short, (packet[0], packet[1], packet[2])
should be equivalent to (ip source, ip destination, sport, dport, protocol)
where we let tshark
deal with the gory details of figuring out the direction of communication, but we need to include some extra information to make tshark
identifiers truely unique as a flow-tuple.
from flowprint.
Thanks for your detailed reply!
Following your answer, I've looked up the Wireshark manual and found it quite helpful. For those who are also wondering the problem, this link will also be useful:
https://cse.sc.edu/~pokeefe/tutorials/wireshark/ChAdvFollowTCPSection.html
Thanks for the nice explanation:)
from flowprint.
Related Issues (14)
- 'tshark' Error in running the preprocessing of pcaps HOT 2
- tshark raise an error : 'Some fields aren't valid: ' HOT 3
- TypeError: 'Flow' object is not iterable HOT 3
- ModuleNotFoundError: No module named 'flow_generator' HOT 1
- how to use Recon Dataset HOT 1
- A question about per-device fingerprinting HOT 2
- Trouble preprocessing pcaps and generating fingerprints HOT 3
- Request for Raw PCAP Files of ReCon and ReCon Extended Datasets HOT 1
- Problem about accuracy HOT 2
- Problem about store the fingerprints into one .json file HOT 5
- Can I save my model into files and load it from files to predict new unseen samples? HOT 4
- Some exception in reader.py HOT 1
- There a question in FingerprintGenerator._fit_single_batch_ HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flowprint.