[Ns-developers] pcap trace refalgamization
Nicola Baldo
nbaldo at cttc.es
Mon Dec 14 01:06:05 PST 2009
Hi all,
>> As I explained when I nacked the orginal patch, the issue is not calling
>> Packet::Copy (which you _must_ do because a trace sink must _not_ modify
>> the content of a packet from the callee perspective) because this does
>> not trigger a full copy. The issue is triggering a deep copy of the byte
>> buffer when you add the header for pcap output because the byte buffer
>> is shared with other packet instances and you can't avoid this. You
>> really can't. So, you have to take this performance hit. Maybe it's not
>> relevant in practice: we just need to measure it. If so, all my concerns
>> are moot and I will support your proposal about the PcapWriter class.
>>
>
> If I understand correctly, it basically boils down to that you are
> concerned about the copy into the intermediate buffer below before that
> buffer is written to the ofstream in file.Write() ? Because in the
> current code, the CopyData writes directly into the ofstream?
>
I think Mathieu refers to the fact that both the radiotap and prism
headers add some receiver-specific information, such as RSSI and noise
measurements. If radiotap/prism are implemented with a ns3::Header, then
adding this receiver-specific information implies that a full packet
copy will be triggered at every receiver. This was the way I initially
implemented radiotap/prism support, though I have to confess that I
didn't bother measuring the difference in performance with the current
implementation.
Nicola
More information about the Ns-developers
mailing list