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

caplen annotation ignored in FromDump element for PCAP files #177

Closed
bozakov opened this issue Feb 23, 2015 · 4 comments
Closed

caplen annotation ignored in FromDump element for PCAP files #177

bozakov opened this issue Feb 23, 2015 · 4 comments

Comments

@bozakov
Copy link

bozakov commented Feb 23, 2015

Attempting to replay a PCAP trace in which only the first caplen bytes have been recorded and len contains the actual packet length, generates packets which only have a length of caplen.

It seem that the line
SET_EXTRA_LENGTH_ANNO(p, len - caplen);

in elements/userlevel/fromdump.cc does not have any effect.

@kohler
Copy link
Owner

kohler commented Feb 23, 2015

No, this is the expected behavior. Rather than generate packets with extra, invalid bytes, the element sets an annotation to say “the wire packet had N more bytes than this packet does.”

Not all other elements understand or obey the EXTRA_LENGTH annotation, but many do.

@bozakov
Copy link
Author

bozakov commented Feb 23, 2015

Sorry for the misunderstanding and thanks a lot for the clarification - the issue can be closed. Is there any element to reverse this type of truncation (e.g., zero padding the packet, replicating the behavior of tcpreplay?). I'm having trouble replaying 10G traces.

@kohler
Copy link
Owner

kohler commented Feb 23, 2015

Yes, there is. If you update to the latest git, the standard Pad element does what you want.

@bozakov
Copy link
Author

bozakov commented Feb 23, 2015

Excellent - that works! Thank you for the pointer.

@kohler kohler closed this as completed Feb 23, 2015
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

No branches or pull requests

2 participants