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

Support Ipv6 #70

Merged
merged 6 commits into from Jan 14, 2020
Merged

Support Ipv6 #70

merged 6 commits into from Jan 14, 2020

Conversation

zhangxp1998
Copy link
Collaborator

@zhangxp1998 zhangxp1998 commented Jan 4, 2020

I added code to parse Ipv6 packets and ipv6 addresses from lsof. But the network I'm on does not seem to support ipv6... Can anyone try this for me?

This is an attempt to resolve issue 53

@zhangxp1998
Copy link
Collaborator Author

zhangxp1998 commented Jan 4, 2020

@imsnif Unfortunately, my network does not support Ipv6. But this code should correctly display ipv6 traffic. Would you be willing to try running this on your machine?

@imsnif
Copy link
Owner

imsnif commented Jan 4, 2020

Sorry friend, mine doesn't either :/ afaik most don't.

I think you might be able to replicate an ipv6 network with a couple of docker containers, but beware - that might be a bit of work.

@zhangxp1998
Copy link
Collaborator Author

zhangxp1998 commented Jan 4, 2020

@coreylane How about you :) Since you spend the issue maybe you could test this?

@zhangxp1998 zhangxp1998 changed the title WIP: Support Ipv6 Support Ipv6 Jan 4, 2020
@coreylane
Copy link

I'm still not seeing the ipv6 traffic in bandwhich, but not completely sure I correctly compiled the binary to include your PR. Steps I took below, did I miss anything?

$ git clone https://github.com/imsnif/bandwhich.git
$ git remote add upstream https://github.com/imsnif/bandwhich.git
$ git fetch upstream pull/70/head:ipv6
$ git checkout ipv6

bandwhich[ipv6] $ git status
# On branch ipv6
nothing to commit, working directory clean

bandwhich[ipv6] $ cargo run

bandwhich[ipv6] $ ./target/debug/bandwhich --version
bandwhich 0.6.0

@zhangxp1998
Copy link
Collaborator Author

I'm still not seeing the ipv6 traffic in bandwhich, but not completely sure I correctly compiled the binary to include your PR. Steps I took below, did I miss anything?

$ git clone https://github.com/imsnif/bandwhich.git
$ git remote add upstream https://github.com/imsnif/bandwhich.git
$ git fetch upstream pull/70/head:ipv6
$ git checkout ipv6

bandwhich[ipv6] $ git status
# On branch ipv6
nothing to commit, working directory clean

bandwhich[ipv6] $ cargo run

bandwhich[ipv6] $ ./target/debug/bandwhich --version
bandwhich 0.6.0

I think your steps are correct.. Can you set a breakpoint at ui.update_state and see if variable utilization contain any ipv6 connection data? Thanks!

@coreylane
Copy link

This may take me some time as this is the first Rust project I've poked around

@Ma27
Copy link
Contributor

Ma27 commented Jan 9, 2020

So, after a brief review the changes seem fine, however I don't get any IPv6 traffic (not via my VPN, but via an uplink interface, so tested with layer2-packets). However, this seems to work fine on my branch where I merged my previous fixes with IPv6 Support (https://github.com/Ma27/bandwhich/tree/ipv6-int-test). I might've "accidentally" fixed an issue as I had to resolve several merge conflicts due to changes to the data structure on master and on this branch.

For now I'll check what went wrong and report back. After that we could also push my changes into this branch to get rid of all the merge conflicts :)

@Ma27
Copy link
Contributor

Ma27 commented Jan 9, 2020

So first of all thanks a lot for this PR! This is actually the last thing on my list to get perfectly happy with this tool!

I'm not entirely sure why no traffic is shown on your branch, but the issues can be fixed by merging master into this branch (I tested upstream/master with and without my layer3-fixes).

Just refreshed my test-branch by merging the latest master and your changes together: Ma27@916be4c

@zhangxp1998
Copy link
Collaborator Author

zhangxp1998 commented Jan 13, 2020

Xnip2020-01-12_20-02-40
I finally get it to show some IPv6 traffic!
@Ma27 @coreylane

@zhangxp1998
Copy link
Collaborator Author

This also adds support for sniffing the loopback interface

@imsnif
Copy link
Owner

imsnif commented Jan 13, 2020

Great work! :) I want to hold off on this for the next version because master already has some big changes. I hope to release it soon and then also take a more thorough look at this one.

@zhangxp1998 - I hope you don't mind if we also ask @Ma27 to test this? I myself don't have easy access to ipv6, so would love to have as much input on this change as possible before we release it.

@Ma27
Copy link
Contributor

Ma27 commented Jan 13, 2020

Built the PR locally and it seems to work fine 👍

@zhangxp1998
Copy link
Collaborator Author

zhangxp1998 commented Jan 14, 2020

Hmm now version 0.9 is released, can we start reviewing this PR? @imsnif

@imsnif
Copy link
Owner

imsnif commented Jan 14, 2020

Yes! It's on my TODOs - unless @ebroto has time and wants to do it?

(I'm reviewing #107 atm)

@ebroto
Copy link
Collaborator

ebroto commented Jan 14, 2020

Sure, I'll give it a try :)

@ebroto ebroto self-requested a review January 14, 2020 19:03
Copy link
Collaborator

@ebroto ebroto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great work 👍

Left a couple comments. Otherwise I tested on linux and swapping the cfgs to use lsof. It looks good in both cases. Can't test with IPv6 though.

src/network/sniffer.rs Outdated Show resolved Hide resolved
src/tests/fakes/fake_input.rs Outdated Show resolved Hide resolved
@ebroto
Copy link
Collaborator

ebroto commented Jan 14, 2020

Got to see IPv6 traffic with iperf against the loopback interface, both procfs and lsof implementations. 🎉

@ebroto ebroto self-requested a review January 14, 2020 19:46
@ebroto
Copy link
Collaborator

ebroto commented Jan 14, 2020

LGTM! @imsnif want to take a look, or should we merge it after the CI passes?

@imsnif
Copy link
Owner

imsnif commented Jan 14, 2020

LGTM! @imsnif want to take a look, or should we merge it after the CI passes?

I glanced at this briefly and it seems pretty straightforward. If you two think this is good, let's go for it. If I'm confused about something when maintaining later on, I might ask one of you for directions. :)

@ebroto ebroto merged commit c6f7ac4 into imsnif:master Jan 14, 2020
@zhangxp1998 zhangxp1998 deleted the ipv6 branch January 14, 2020 22:23
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.

Support IPv6
5 participants