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

Buffer Occupancy #55

Merged
merged 20 commits into from Dec 8, 2018
@@ -2,7 +2,7 @@ Title : In-band Network Telemetry (INT) Dataplane Specification
Title Note : Working draft. Note: consider using tagged versions for implementation.
Title Footer: 2018-05-08
Author : The P4.org Applications Working Group. Contributions from
Affiliation : *Alibaba, Arista, Barefoot Networks, Dell, Intel, Marvell, Netronome, VMware*
Affiliation : *Alibaba, Arista, Barefoot Networks, Cisco Systems, Dell, Intel, Marvell, Netronome, VMware*
Heading depth: 5
Pdf Latex: xelatex
Document Class: [11pt]article
@@ -318,6 +318,11 @@ simply leaves those decisions to device vendors.
- The build-up of traffic in the queue (in bytes, cells, or packets) that the
INT packet observes in the device while being forwarded.

* Buffer occupancy
- The build-up of traffic in the buffer (in bytes, cells, or packets) that the
INT packet observes in the device while being forwarded. Use case is when buffer is
shared between multiple queue.

This comment has been minimized.

Copy link
@mhira1

mhira1 Oct 3, 2018

Contributor

Perhaps remove the word "shared". Reporting both queue occupancy and buffer occupancy makes sense only if the buffer is shared, but technically the buffer could be a per-queue buffer, just that in this case, both values reported will be the same. INT source does not know whether downstream switches have shared buffers or not. It can set both bits. Switches that have per-queue buffers (unlikely, switches typically use shared buffers) will just report the same value for both instructions.

This comment has been minimized.

Copy link
@mhira1

mhira1 Oct 3, 2018

Contributor

May be word this differently, to say this instruction is to get buffer occupancy. Use-case is when buffer is shared.

This comment has been minimized.

Copy link
@rsivakolundu

rsivakolundu Oct 3, 2018

Author Contributor

Removed the reference to shared.

This comment has been minimized.

Copy link
@mickeyspiegel

mickeyspiegel Oct 4, 2018

Contributor

Minor editorial rewording:
The use case is when the buffer is shared between multiple queues.

This comment has been minimized.

Copy link
@rsivakolundu

rsivakolundu Oct 4, 2018

Author Contributor

Added the minor editorial change suggested.

# INT Headers

This section specifies the format and location of INT Headers.
@@ -752,12 +757,12 @@ hop-by-hop INT header must fit in a single Geneve option.
In this section, we define the format for INT hop-by-hop metadata headers,
and the metadata itself.

INT Metadata Header and Metadata Stack:
INT Metadata Header and Metadata Stack (Version = 1):
This conversation was marked as resolved by rsivakolundu

This comment has been minimized.

Copy link
@jklr

jklr Dec 4, 2018

Contributor

Shall we remove "(Version = 1)" from above? We are not going to present two versions in one document.
The version number in the header format below is good to have though.

This comment has been minimized.

Copy link
@rsivakolundu

rsivakolundu Dec 6, 2018

Author Contributor

Removed (Version = 1)

`
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Ver |Rep|C|E|M| Reserved | Hop ML |RemainingHopCnt|
|Ver = 1|Rep|C|E|M| Reserved | Hop ML |RemainingHopCnt|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Instruction Bitmap | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -821,7 +826,7 @@ The original packet must have C bit set to 0.
switch(es) set the M bit based on knowledge of the network topology
and "Switch ID, Ingress port ID, Egress port ID" tuples in the INT
metadata stack.
- R: Reserved bits.
- R (10b): Reserved bits.
- Hop ML (5b): Per-hop Metadata Length, the length of metadata in 4-Byte words
to be inserted at each INT hop.
- While the largest value of Per-hop Metadata Length is 31, an INT-capable
@@ -854,6 +859,7 @@ each bit corresponds to a specific standard metadata as specified in Section 3.
- bit5: Egress timestamp
- bit6: Level 2 Ingress Port ID + Egress Port ID (4 bytes each)
- bit7: Egress port Tx utilization
- bit8: Buffer Occupancy (32 bits)
- bit15: Checksum Complement
- The remaining bits are reserved.
Each instruction requests 4 bytes of metadata to be inserted at each hop,
@@ -1219,6 +1225,10 @@ header int_egress_port_tx_util_t {
bit<32> egress_port_tx_util;
}

header int_b_occupancy_t {
bit<32> q_occupancy;

This comment has been minimized.

Copy link
@jklr

jklr Dec 4, 2018

Contributor

Please make it consistent with the (example) layout provided in line 866, which has 8b buffer id.

This comment has been minimized.

Copy link
@rsivakolundu

rsivakolundu Dec 4, 2018

Author Contributor

Let us discuss the semantics of Queue and Buffer occupancy. I will make it consistent after the discussion.

This comment has been minimized.

Copy link
@rsivakolundu

rsivakolundu Dec 6, 2018

Author Contributor

Added Buffer ID (8 bits) and Buffer Occupancy (24 bits)

}

/* standard ethernet/ip/tcp headers */
header ethernet_t {
bit<48> dstAddr;
@@ -1279,6 +1289,7 @@ struct headers {
int_egress_tstamp_t int_egress_tstamp;
int_level2_port_ids_t int_level2_port_ids;
int_egress_port_tx_util_t int_egress_port_tx_util;
int_b_occupancy_t int_b_occupancy;

This comment has been minimized.

Copy link
@mickeyspiegel

mickeyspiegel Oct 4, 2018

Contributor

nit: fix indent

This comment has been minimized.

Copy link
@rsivakolundu

rsivakolundu Oct 4, 2018

Author Contributor

Done.

}

struct empty_metadata_t {
@@ -1610,6 +1621,11 @@ control EgressDeparserImpl(packet_out packet,
ck.add({hdr.int_egress_port_tx_util.egress_port_tx_util});
}

if (hdr.int_b_occupancy.isValid()) {

This comment has been minimized.

Copy link
@mickeyspiegel

mickeyspiegel Oct 4, 2018

Contributor

nit: fix indent

This comment has been minimized.

Copy link
@rsivakolundu

rsivakolundu Dec 6, 2018

Author Contributor

Fixed

ck.add({
hdr.int_b_occupancy.b_occupancy
This conversation was marked as resolved by rsivakolundu

This comment has been minimized.

Copy link
@jklr

jklr Dec 4, 2018

Contributor

Same here. If we want buffer_id in line 866, let's make the code consistent.

This comment has been minimized.

Copy link
@rsivakolundu

rsivakolundu Dec 6, 2018

Author Contributor

Done.

});
}
if (hdr.tcp.isValid()) {
ck.add({
hdr.tcp.srcPort,
@@ -1656,6 +1672,7 @@ control EgressDeparserImpl(packet_out packet,
packet.emit(hdr.int_egress_tstamp);
packet.emit(hdr.int_level2_port_ids);
packet.emit(hdr.int_egress_port_tx_util);
packet.emit(hdr.int_b_occupancy);

This comment has been minimized.

Copy link
@mickeyspiegel

mickeyspiegel Oct 4, 2018

Contributor

nit: fix indent

This comment has been minimized.

Copy link
@rsivakolundu

rsivakolundu Oct 4, 2018

Author Contributor

Done.

}
}

@@ -2020,6 +2037,21 @@ INT packet was served. The calculation mechanism of this value is device
specific.
* Queue drop count
- Total # of packets dropped from the queue

* Buffer occupancy
- The build-up of traffic in the buffer (in bytes, cells, or packets) that the
INT packet observes in the device while being forwarded. Use case is when buffer is
shared between multiple queue.
This conversation was marked as resolved by rsivakolundu

This comment has been minimized.

Copy link
@mhira1

mhira1 Oct 16, 2018

Contributor

typo: multiple queues

This comment has been minimized.

Copy link
@rsivakolundu

rsivakolundu Dec 4, 2018

Author Contributor

Fixed the typo.

* Instantaneous buffer occupance

This comment has been minimized.

Copy link
@mhira1

mhira1 Oct 16, 2018

Contributor

typo: occupance -> occupancy

This comment has been minimized.

Copy link
@rsivakolundu

rsivakolundu Dec 6, 2018

Author Contributor

Fixed

- The instantaneous value (in bytes, or cells) of the buffer occupancy the INT
packet has observed in the device while being forwarded. The units used need
not be consistent across an INT domain, but care must be taken to ensure that
there is a known, consistent mapping of {device, buffer} values to their
respective unit {bytes, cells}.
* Average buffer occupancy
- The average value (in bytes or cells) of the buffer occupancy
the INT packet was observed. The calculation mechanism of this value is device
This conversation was marked as resolved by rsivakolundu

This comment has been minimized.

Copy link
@mhira1

mhira1 Oct 16, 2018

Contributor

grammar: average value of buffer occupancy that the INT packet observed.

This comment has been minimized.

Copy link
@rsivakolundu

rsivakolundu Dec 4, 2018

Author Contributor

Added that

specific.

## Miscellaneous

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.