You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
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.
The text was updated successfully, but these errors were encountered: