Repository navigation
Conversation
Adds packet_layer_id (Unknown, Data Link, Network, Transport, Other) with its packet_layer sibling, so that byte counters state which protocol headers they include, plus payload_bytes, payload_bytes_in, payload_bytes_missed and payload_bytes_out alongside the existing byte counters. All are optional. Closes ocsf#1678 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Carol Iturralde <cei@cisco.com>
| "description": "The packet object describes a single captured network packet and its associated metadata.", | ||
| "type": "packet" | ||
| }, | ||
| "packet_layer": { |
There was a problem hiding this comment.
See my naming comment above.
| "description": "The packet layer, normalized to the caption of the <code>packet_layer_id</code> value. In the case of 'Other', it is defined by the event source.", | ||
| "type": "string_t" | ||
| }, | ||
| "packet_layer_id": { |
There was a problem hiding this comment.
See my naming comment above.
| }, | ||
| "2": { | ||
| "caption": "Network", | ||
| "description": "The packet is a network layer (L3) packet: the L3 header and its payload, which may include higher layer headers. Byte counters include the L3 header and the payload. Payload counters exclude the L3 header." |
There was a problem hiding this comment.
The word packet is correct at L2 but for consistency with the L2 and L4 descriptions it migth be better to use the generic OSI term protocol data unit (PDU).
Addresses review feedback: changelog entries link to the PR rather than the issue. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Carol Iturralde <cei@cisco.com>
Addresses review feedback: the field is not needed, and its meaning was ambiguous for transports with guaranteed delivery such as TCP. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Carol Iturralde <cei@cisco.com>
Schema Description ReviewAutomated suggestions for improving description clarity for LLM consumption. These are advisory — not required changes. Previous Review Status
|
Addresses review feedback: describe payload_bytes, payload_bytes_in and payload_bytes_out as byte counters excluding the packet header, rather than defining payload in terms of itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Carol Iturralde <cei@cisco.com>
|
Unfortunately when we say "packet" it is reserved for the Network layer in the OSI model: Where Packets Live in the OSI Model Data changes its form and name as it moves down through the seven layers: Interestingly, the current object If we are to add the enum for OSI Layer type, the packet counts would always refer to L3 Network, because that is how packets are defined on OSI. However, the This picture from Cisco illustrates it well:
Layer 2 is a problem. Total bytes would be the sum of the bytes of the frames and all the packets, the trailing bytes being the IP layer bytes. Given that L2 frames don't survive intact across a connection (each link replaces those frames), and are generally not output by Zeek, Suricata or flow logs, the Also, the object name is One twist, which would not be explicitly captured is when the traffic traverses a proxy or a NAT and headers are re-written because of termination at those points. In those cases, the exact IP header bytes are not transferred across the termination point, but assuming IP header size is constant, the network layer bytes counters would still be the same. |
Yes, we still need the enum. Why? Isn't the protocol number sufficient? No, because even though the protocol was known (such as TCP or UDP), that does not (necessarily) imply how the bytes were measured. |
|
"The total number of payload bytes, summed across all packets transferred in both directions (sum of payload_bytes_in and payload_bytes_out). Payload excludes the headers of the layer identified by packet_layer_id." I agree, we can improve our wording (for packet and payload), to address the question of whether counters refer to individual packets or to packets over time. I think this is a nice optimization but it does go beyond the scope of this ticket (it's true for the existing counters). @pagbabian-splunk if you'd like me to adjust descriptions of all counters in our traffic object to reflect the fact that exporters often accumulate counters over a period of time, I'm happy to do that. |
Addresses review feedback: remove the packet_layer / packet_layer_id enum and instead fix the meaning of the counters in their descriptions. - bytes, bytes_in, bytes_out and bytes_missed on network_traffic count bytes in Layer 3 (Network Layer) packets, including IP header and payload. Object-level descriptions, since query_info shares bytes. - payload_bytes, payload_bytes_in and payload_bytes_out count bytes in the Layer 4 (Transport Layer) payload, excluding headers. - CHANGELOG entries updated to match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Carol Iturralde <cei@cisco.com>
|
@pagbabian-splunk - please let me know if my changes reflect what was discussed in today's Network Activities meeting. If they do not, it was not intentional and I will address. |
|
@pagbabian-splunk @Aniak5 @davemcatcisco - My Ai agent noticed that we missed one (current) use case: Cisco's FTD Firewall Connection Logs, essentially Flow Logs, byte counters capture L2 Packet (headers plus payload) This was actually in my issue, but it was a sentence added to the end (not a bullet w/ bold text) so I missed it. So this means we have not (fully) addressed all use cases. Just FYI. |
…rk_activities # Conflicts: # CHANGELOG.md
This is why we need a new object for the Data Link layer (not overload the Network layer which is the current |
|
After more discussion at Maintainers, the term "data" seems to be more correct for the transport layer payload, since the term "payload" is interpreted relative to the OSI layer, while "data" is the same at any layer. So we might consider using the term One other discussion item is ICMP: technically also at the network layer, but defined as a "message" rather than "data" it includes the IP header but does not have separate transport layer headers. It is still part of the IP "datagram." Per Stevens, the ICMP message includes an ICMP header, the IP header of the datagram that generated an error, and a UDP header, for example if the message was a UDP port unreachable error. |


Related Issue:
Closes #1678
Overview
This PR addresses #1678, Network Traffic 'bytes' - What does this include?. Reviewers are encouraged to read the issue as it provides background of the problem we are solving.
We deliberately constrained this first enhancement to the most urgent problem, one that is real today. Existing telemetry sources send byte counters which have been counted in different ways. A consumer of
bytes,bytes_in,bytes_outorbytes_missedhas no way to determine what was counted, so traffic counters from different sources cannot be compared reliably.This PR provides that clarity by (a) defining, in their descriptions, what the existing byte counters measure, and (b) adding payload counters, defined the same way, to support the sources that count only the payload.
We stopped short of a less urgent use case: a single telemetry source providing several sets of counters, each measured at a different layer. We know this use case exists (IPFIX, for example, can export both L2 and L3 octet counters for the same flow), but it has not yet been seen in the wild as an urgent problem. If it becomes important to support, a later change could allow, say, a Network Activity event to hold multiple
trafficobjects, one per layer. We will cross that bridge if we come to it.Description of changes:
This PR defines what the byte counters on the
network_trafficobject count, and adds payload counters beside them.The four existing byte counters now say what they count. Each description ends with the same sentence: Counts bytes in Layer 3 (Network Layer) packets, including IP header and payload.
byteslong_tbytes_inlong_tbytes_outlong_tbytes_missedlong_tThree new optional counters report the payload. Each description ends with: Counts bytes in the Layer 4 (Transport Layer) payload, excluding headers (such as TCP, UDP, etc.).
payload_byteslong_tpayload_bytes_inlong_tpayload_bytes_outlong_tThe
payload_bytes*names mirror the existingbytes,bytes_inandbytes_out.The three payload counters are defined in
dictionary.json. The byte counter clarifications are object-level descriptions inobjects/network_traffic.json, because the dictionarybytesattribute is also used byquery_info, where it means the size of a query result.These definitions match how known producers count today. NetFlow, IPFIX, and AWS VPC, Azure and OCI flow logs count the Layer 3 packet. GCP and NVM flow logs count the Layer 4 payload. IPFIX and Zeek connection logs report both, so they can fill both sets of counters.
No class changes are required, since
trafficis already present on every Network Activity class.Files touched:
dictionary.json,objects/network_traffic.json,CHANGELOG.md.Confirmations
Unreleasedentry added toCHANGELOG.md, referencing this PR.python -m ocsf_validator .passesocsf-schema-compiler .compiles with zero errors and zero warnings, in both default and browser modepython -m ocsf.validate.compatibilityagainstmainpasses all five checksocsf-serverboots against the compiled schema, serves HTTP 200 and logs no warnings or errors