[go: up one dir, main page]

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

flows: flow cache expiration and benchmarks #40

Merged
merged 6 commits into from
Aug 16, 2017

Conversation

nikofil
Copy link
Collaborator
@nikofil nikofil commented Aug 5, 2017

Copy link
Member
@glaslos glaslos left a 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()
Copy link
Member

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:
Copy link
Member

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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)
Copy link
Member

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)
}
Copy link
Member

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

Copy link
Collaborator Author

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?

Copy link
Member

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)
        }
}

@glaslos
Copy link
Member
glaslos commented Aug 9, 2017

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>
@coveralls
Copy link

Coverage Status

Coverage increased (+0.6%) to 100.0% when pulling 1a9f2d5 on nikofil:benchmarks into 89e674a on mushorg:master.

@mushorg mushorg deleted a comment from coveralls Aug 16, 2017
@mushorg mushorg deleted a comment from coveralls Aug 16, 2017
@mushorg mushorg deleted a comment from coveralls Aug 16, 2017
@mushorg mushorg deleted a comment from coveralls Aug 16, 2017
@mushorg mushorg deleted a comment from coveralls Aug 16, 2017
@glaslos glaslos merged commit ea2f99a into mushorg:master Aug 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants