-
Notifications
You must be signed in to change notification settings - Fork 62
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
Q: The FCS information in the PCAP file header in draft-ietf-opsawg-pcap-00 #114
Comments
That is incorrect. I have just checked in a change to the spec to reflect reality.
That is correct, except that the Class field no longer applies. It was put in there for the benefit of something NetBSD was doing, where they had at least one link-layer type corresponding to "raw" link types, with the Class value being 0x224 and, if that's the Class value, the LinkType being a NetBSD NetBSD appear to have dropped that notion, and pcapng has only a 16-bit LinkType field and no provision for those "raw" link types. (If an option were added to the pcapng IDB to indicate a Class value, old code that doesn't know about the option will neither correctly interpret the LinkType value based on the Class value nor reject the file as having an unknown link-layer type; adding support for it would have to involve something such as an "IDB for non-standard LinkType values", so older software can at least reject it rather than misdissecting it.) So...
...I just marked that as reserved; it will probably remain reserved forever. (Or, at least, until 2038, at which point pcap can't handle current time stamps.)
There's a format in a document that I constructed and misdescribed the FCS in, and there's a format that code actually uses, and that I updated the document on the GitHub site to describe. The 3-bit + 1-bit is the first of those; the 4-bit + 1-bit is the one that code actually uses. Ignore the first of those, and follow the second of those.
No, the document is being fixed. The page at https://pcapng.github.io/pcapng/draft-ietf-opsawg-pcap.html now reflects the fix.
No, but I know of no cases where the incorrect format is used, and the libpcap code for DAG cards uses the correct format (and at some point I'll probably check in a change to Wireshark to use the correct format - currently, Wireshark doesn't look at the FCS stuff in that field at all), so any code that uses the incorrect format will have to be fixed.
As a reader, or as a writer? As a writer, the correct way to ignore its existence is to make the upper 16 bits of that field zero; that means that the presence bit is 0, and readers will assume the FCS information isn't available. That's also the correct thing to do if you truly don't know whether the packets have an FCS or not, or if, for example, incoming packets have them but outgoing packets don't. (For a case such as that, you'd need to use pcapng - or, as with pcap, just rely on the dissector to try to guess whether there's an FCS or not, as Wireshark does.) |
Note also that the draft you mentioned has a worse problem. See #106, which was filed in response to some private email, the first message of which said:
and my response was:
which Michael quoted in the issue. I changed the document to fix that, but got it wrong, as you noticed. It's good that the first token of the document's name is "draft". :-) |
Thank you very much for your kind reply. I clearly understand the format of the FCS information. And, I think it was a hard task to describe the specification of the Because I am new to the PCAP file format, what I can contribute (1) Abbreviation and expanded form In the current version in Github (as of March 4, 2022), It would be helpful for readers to change the first use of (2) Supplementary figure As you suggested in the second e-mail, endianness is often a source of As a non-native English user, I should carefully read figures, bit
(ref. https://en.wikipedia.org/wiki/Segment_descriptor ) So, I think a supplementary figure like following might be
(3) No padding To my another shame, in an early version of my PCAP writer, It may be a help for careless readers like me to add a note Thank you. |
Frame Check Sequence, at least according to IEEE 802.3-2018, not Frame Cyclic Sequence (most Frame Check Sequences happen to be Cyclic Redundancy Check values, but that's not an absolute requirement for arbitrary FCSes, it's just how various protocols specify that an FCS is computed). I've added that in 19119c9.
Thanks for cutting the field up like that, Intel! :-)
I've done that in 3b121bc; with the version of RFC markdown and XML we're using, we can't put that in the bulleted list of fields in the file header and, if we replaced the "LinkType and additional information" with that figure, we'd be back to where we were, when people could interpret the last 4 bytes of the file header as two 16-bit fields, so it took a bit of additional surgery, done in several commits. (The process of doing
and, instead, do
.That, plus 914c611, fixed the two problems that were causing the GitHub Action to fail, so the formatted versions of the draft are now getting updated again. The problem with kramdown-rfc is that it crashes inside Ruby rather than telling the user what to fix in YAML in their Markdown document. They fixed that, making kramdown-rfc print a warning rather crashing, in what will presumably be kramdown-rfc-1.6.4. See cabo/kramdown-rfc@548db41. The CircleCI builds are still failing, probably because, when they attempt to push the documents to GitHub Pages, they run a Git command that includes a token that doesn't work, for some reason, so Git asks for a password but never gets it, so it eventually times out. I've filed an issue, #113, asking whether we need the CircleCI testing for any reason.)
|
Thank you very much for all the changes you made to draft-ietf-opsawg-pcap, |
Hello,
I'm new to PCAP and PCAPNG. I'm writing a small routine to save
packets in the PCAP file format. I have a question regarding to
the FCS information in the PCAP file header described in
draft-ietf-opsawg-pcap-00.
According to draft-ietf-opsawg-pcap-00, the FCS information is
encoded as following.
But, according to comments in wireshark/wiretap/libpcap.c (L.362-399),
the same field is encoded as following.
The macros and comments in libpcap/pcap/pcap.h (L.217 - 225) and
libpcap/pcap/dlt.h (L.1593 - 1610) also assumes the same format.
I guess the authors and the working group decided not to describe the
10-bit class field as some other fields are described as "reserved".
So, my question is about the format of the FCS information.
If my understanding above is correct, there are two formats to encode
the FCS information (i.e., 3-bit + 1-bit or 4-bit + 1-bit). Is the
format being changed? If so, is there a method to distinguish the
difference? Is it possible to just ignore the existence of the FCS
information?
Thank you.
p.s. References: (as of March 4, 2022)
https://github.com/wireshark/wireshark/blob/master/wiretap/libpcap.c#L362
https://github.com/the-tcpdump-group/libpcap/blob/master/pcap/pcap.h#L217
https://github.com/the-tcpdump-group/libpcap/blob/master/pcap/dlt.h#L1593
https://www.ietf.org/archive/id/draft-ietf-opsawg-pcap-00.txt
The text was updated successfully, but these errors were encountered: