-
Notifications
You must be signed in to change notification settings - Fork 53
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
flows: flow cache expiration and benchmarks #40
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the restructured nDPI wrapper. I haven't looked at the output of the benchmark, but I think there is room for improvement. I added a comment. I think otherwise this is a really good iteration!
README.md
Outdated
First you need a flow that contains the packet. There is a helper function for constructing a flow from a single packet. Simply call: | ||
First of all you need to initialize the library. You can do that with simply: | ||
```go | ||
godpi.Initialize() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a short explanation what this does?
README.md
Outdated
## Example usage | ||
|
||
The library and the modules APIs aim to be very simple and straightforward to use. The library relies on the [gopacket](https://godoc.org/github.com/google/gopacket) library and its Packet structure. Once you have a Packet in your hands, it's very easy to classify it with the library. | ||
First you need a flow that contains the packet. There is a helper function for constructing a flow from a single packet. Simply call: | ||
First of all you need to initialize the library. You can do that with simply: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You use a lot of 'simply', 'easily' 😄 try to keep it a bit more neutral.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright :) I'll push these changes to README.md to my other PR, as that's where that commit belongs, and rebase this PR once the other one is merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I just rebased it anyway, to have the changes here too.
README.md
Outdated
|
||
```go | ||
flow := godpi.CreateFlowFromPacket(&packet) | ||
flow, isNew := godpi.GetPacketFlow(&packet) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either explain what isNew
is, or use _
types/module.go
Outdated
flow, _ := GetFlowForPacket(&p) | ||
if flow.DetectedProtocol == Unknown { | ||
module.ClassifyFlow(flow) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was actually thinking about having the benchmark measure calls to ClassifyFlow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean, even if the flow is already classified? Or the generic ClassifyFlow
than runs both classifiers and wrappers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, meant the generic ClassifyFlow
as a beginning and then for all the different classifiers individually.
func BenchmarkClassifyFlow(b *testing.B) {
for n := 0; n < b.N; n++ {
godpi.ClassifyFlow(flow)
}
}
Needs a rebase |
* Create benchmark tests for modules. (closes mushorg#20) Signed-off-by: Nikos Filippakis <aesmade@gmail.com>
* Adds the capability to discard flows after some duration during which they have been inactive. (closes mushorg#30) Signed-off-by: Nikos Filippakis <aesmade@gmail.com>
Signed-off-by: Nikos Filippakis <aesmade@gmail.com>
Signed-off-by: Nikos Filippakis <aesmade@gmail.com>
Signed-off-by: Nikos Filippakis <aesmade@gmail.com>
Signed-off-by: Nikos Filippakis <aesmade@gmail.com>
Adds the capability to discard flows after some duration during which
they have been inactive. (closes Clean flows older than x minutes automatically from flow tracker #30)
Create benchmark tests for modules. (closes Add benchmark for wrappers and go-dpi layer #20)
Disable some wrapper tests when the wrappers are disabled. (closes Some tests failing when wrappers are disabled #41)
Add Go Report Card and fix minor code style issues.