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

PacketFu::Capture / PacketFu::Inject / PacketFu::Packet#to_w #6

Open
lupine opened this issue Apr 26, 2012 · 1 comment
Open

PacketFu::Capture / PacketFu::Inject / PacketFu::Packet#to_w #6

lupine opened this issue Apr 26, 2012 · 1 comment
Labels

Comments

@lupine
Copy link

lupine commented Apr 26, 2012

Bit of an architecturing one, this. I'm using PacketFu to implement a DHCP server on a system that should technically be a mere bridge (so a UDP/IP socket isn't an option).

I was using PacketFu::Capture to receive ethernet frames with DHCP in them, building a response frame, and calling frame#to_w("iface_name") to inject a response, and it works quite nicely. However, there are issues when the server it's running on is loaded - PacketFu::UDPPacket#to_w was taking perhaps three seconds to return. This is because it's creating a temporary PacketFu::Inject instance, which itself creates a brand-new Pcap instance, which is slow, and seems to scale with the number of open captures, or network interfaces, or something.

Suggestion: PacketFu::Session, wrapped around a Pcap instance which it passes into PacketFu::Capture and PacketFu::Inject instances? I'm working around it for now by making my capture instance more widely available, and using #stream.inject(frame.to_s) - so maybe it just needs documentation on #to_w that it's slow?

Personally, I find the capture/inject separation to be a bit artificial; if you're interested in a new interface that conserves Pcap sessions, let me know and I'll see if I can slap a pull request together.

@todb
Copy link
Contributor

todb commented Apr 28, 2012

I find the capture/inject separation to be a bit artificial

It kind of is, and that piece does need a good, long look, especially under load. Most of the things I and others have used PacketFu for are injecting maybe one or two packets, once.

if you're interested in a new interface that conserves Pcap sessions

I love getting pull requests. Thanks! The whole notion of a "session" is kind of a big missing piece; PacketFu is packet-centric, after all, but it's high time to at least offer some kind of reference implementation of a session manager.

@todb-r7 todb-r7 added the feature label Aug 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants