proposal: multiple ports, pcap options and isolating capture package · Issue #784 · buger/goreplay · GitHub
More Web Proxy on the site http://driver.im/
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
snapshot length: we have only two possibilities, if input-raw-override-snaplen is false the maximum transmission unit of an interface will become its handler snapshot length otherwise the snapshot length is set to 64kb which may be problematic to some interface like USB with snapshot length of up to 256kb. the user may also wish to have a smaller snapshot to only capture headers. for this, input-raw-snaplen ** can be an unsigned 32-bit integer** which indicates the snapshot length. if its 0, the snapshot will be the MTU (or 64kb if we can't get the MTU) else the snapshot will be equal to input-raw-snaplen flag.
promiscuous, monitor mode: should also be opt-in, this is to say they will not be enabled unless enabled by the user. for this, we need to add a new flag called --enable-promiscuous and --enable-monitor flag.
input raw expires: currently flag input-raw-expire has two functions, to set the maximum time to wait for the final packet in TCP and to set the timeout of a pcap handler. However, the behaviors of pcap timeout shouldn't be confused by the time we wait for the final packet otherwise there can be some unexpected behaviors like losing large amount of packets and it's likely that there will be only a single read for the entire message. For this, we can have two separate flags input-raw-message-expire and input-raw-buffer-expire. the default value of input-raw-buffer-expireis a negative time!
Isolating capture package
for the sake of scalability, future improvements, and supporting people who may wish to implement their own sniffer, we can isolate the functionalities of capturing. this is to say package capture will solely be responsible for handling the functionalities of reading packets and it will send data of type gopacket.Packet over channels. there will be other packages like tcp to handle re-ordering of packets and managing lost packets, this may help users to implement other transport layer protocols. However, Listener will have a field that indicates the transport layer expected(this will help us to set default BPFFilter so that listener can capture packet from one type of transport layer). Some other functionalities may be isolated into packages too, like output, input etc...
Multiple ports
pcap may listen to multiple ports when port is 0. range of ports can be configured by using BPF filters e.g: dst portrange 3000-8000 and src portrange 3000-8000. packets handling will be possible but how messages will be handled by the output, in this case, is not yet defined!
The text was updated successfully, but these errors were encountered:
it almost feels like that Pcap capability should be extracted from the raw-input itself, and act like a singleton. So multiple input raw plugins communicate with it via some interface.
About snap-shot, I realized it may require a lot of configurations to handle larger snapshot length since the normal packet length doesn't exceed 64kb, to limit the amount of data, max-message-size can be used.
Uh oh!
There was an error while loading. Please reload this page.
PCAP Options to improve
snapshot length: we have only two possibilities, if
input-raw-override-snaplen
is falsethe maximum transmission unit
of an interface will become its handler snapshot length otherwise the snapshot length is set to64kb
which may be problematic to some interface like USB with snapshot length of up to 256kb. the user may also wish to have a smaller snapshot to only capture headers. for this,input-raw-snaplen
** can be an unsigned 32-bit integer** which indicates the snapshot length. if its 0, the snapshot will be the MTU (or 64kb if we can't get the MTU) else the snapshot will be equal toinput-raw-snaplen
flag.promiscuous, monitor mode: should also be opt-in, this is to say they will not be enabled unless enabled by the user. for this, we need to add a new flag called
--enable-promiscuous
and--enable-monitor
flag.input raw expires: currently flag
input-raw-expire
has two functions, to set the maximum time to wait for the final packet in TCP and to set the timeout of apcap handler
. However, the behaviors of pcap timeout shouldn't be confused by the time we wait for the final packet otherwise there can be some unexpected behaviors likelosing large amount of packets
and it's likely that there will be onlya single read for the entire message
. For this, we can have two separate flagsinput-raw-message-expire
andinput-raw-buffer-expire
. the default value ofinput-raw-buffer-expire
is a negative time!Isolating capture package
for the sake of scalability, future improvements, and supporting people who may wish to implement their own sniffer, we can isolate the functionalities of capturing. this is to say package capture will solely be responsible for handling the functionalities of reading packets and it will send data of type gopacket.Packet over channels. there will be other packages like
tcp
to handle re-ordering of packets and managing lost packets, this may help users to implementother transport layer protocols
. However, Listener will have a field that indicates the transport layer expected(this will help us to setdefault BPFFilter
so that listener can capture packet from one type of transport layer). Some other functionalities may be isolated into packages too, likeoutput
,input
etc...Multiple ports
pcap may listen to multiple ports when port is
0
. range of ports can be configured by using BPF filters e.g:dst portrange 3000-8000 and src portrange 3000-8000
. packets handling will be possible but how messages will be handled by the output, in this case, is not yet defined!The text was updated successfully, but these errors were encountered: