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

[Sonic HLD] Metering requirements #313

Merged
merged 8 commits into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ dataplanes
datastore
DBs
DDoS
deallocating
Decap
decap
deliverables
Expand Down Expand Up @@ -193,6 +194,7 @@ ENI
eni
Eni
ENIs
ENI's
entrypoints
enum
EPUs
Expand Down Expand Up @@ -578,6 +580,7 @@ UF
UFID
Ufs
UI
UINT
undeploy
unpair
Unpair
Expand Down
37 changes: 34 additions & 3 deletions documentation/general/dash-sonic-hld.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
* [1.2 CLI requirements](#12-cli-requirements)
* [1.3 Warm Restart requirements ](#13-warm-restart-requirements)
* [1.4 Scaling requirements ](#14-scaling-requirements)
* [1.5 Design considerations ](#15-design-considerations)
* [1.5 Metering requirements ](#15-metering-requirements)
* [1.6 Design considerations ](#16-design-considerations)
* [2 Packet Flows](#2-packet-flows)
* [3 Modules Design](#3-modules-design)
* [3.1 Config DB](#31-config-db)
Expand Down Expand Up @@ -102,8 +103,38 @@ Following are the minimal scaling requirements
| ACLs per ENI | 6x10K SRC/DST ports |
| CA-PA Mappings | 10M |
| Active Connections/ENI | 1M (Bidirectional TCP or UDP) |

## 1.5 Design Considerations
| Metering Buckets per ENI | 4000 |

## 1.5 Metering requirements
Metering is essential for billing the customers and below are the high-level requirements. Metering/Bucket in this context is related to byte counting for billing purposes and not related to traffic policer or shaping.
- Billing shall be at per ENI level and shall be able to query metering packet bytes per ENI
- All metering buckets must be UINT64 size and start from value 0 and shall be counting number of bytes. A bucket contains 2 counters; 1 inbound (Rx) and 1 outbound (Tx).
- Implementation (a.k.a H/W pipeline implementation) must support metering at the following levels:
- Policy based metering. - E.g. For specific destinations (prefix) that must be billed separately, say action_type 'direct'
- Route table based metering - E.g. For Vnet peering cases.
- Mapping table based metering - E.g For specific destinations within the mapping table that must be billed separately
- Policy in the metering context refers to metering policy associated to Route tables. This is not related to ACL policy or any ACL packet counters.
- If packet flow hits multiple metering buckets, order of priority shall be **Policy->Route->Mapping**
- User shall be able to override the precedence between Routing and Mapping buckets by setting an _override_ flag. When policy is enabled for a route, it takes higher precedence than routing and mapping metering bucket.
- Implementation shall aggregate the counters on an "_ENI+Metering Bucket_" combination for billing:
- All traffic from an ENI to a Peered VNET
- All traffic from an ENI to a Private Link destination
- All traffic from an ENI to an internet destination
- All traffic from an ENI to cross-AZ destination (within the same VNET)
- All traffic from an ENI to cross-region destination (towards the peer VNET)
- All outbound metered traffic from an ENI
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this "outbound metered traffic" different from the everything listed before it? Should this be "All other" outbound metered traffic....."? When you say implementation, which "implementation"? Is this "HW pipeline", "SW on the DPU", or "the SDN controller"? Also, you could have cross-AZ peer VNET traffic as well, would you not want to count separately as well? I guess I don't understand why you are listing these outbound traffic categories. Is it that these are the ones you want to bill separately?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All outbound metered traffic means query on ENI + * -> Aggregated counter from all metering buckets associated with ENI. For cross-AZ peer VNET, requirement is to bill as peer VNET. But this is made generic in the modeling that if it requires to be billed differently, it is still possible. Yes, those are the cases that must be billed separately.
I've updated the meaning for "Implementation" in the first usage.

- All inbound metered traffic towards an ENI
- Customer is billed based on number of bytes sent/received separately. A distinct counter must be supported for outbound vs inbound traffic of each category.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix terminology: replace inbound/outbound with TX/RX ? since inbound/outbound refers to the first (initiator) packet for the flow

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vijasrin , i cannot commit to this forked branch anymore after migration. Since its a minor fix, i'll update it in one of the future commits.

- For outbound flow and associated metering bucket, created as part of VM initiated traffic, the metering bucket shall account for outbound (Tx) bytes. Based on this outbound flow, pipeline shall also create a unified inbound flow. The same metering bucket shall account for the inbound (Rx) bytes for the return traffic to VM that matches this flow.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From scale point of view, there are going be 5M connection and 10M flows (if we count inbound and outbound flows separately). Let's say we support 5M combined unified flows and if the scale required is 4K buckets per ENI, for a total of 64 ENIs, we will have 256K buckets per DPU. Considering we are sharing these buckets across ENIs and across flows, we will be limited to how much we can count separately for each of the categories you have listed above? Is this not true?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is true. But note that many connections may share same bucket id. For example, if there are 100's of mapping for a cross-Az, it will all share the same bucket. However, it is possible that in future we may have to increase the limit from 4k per ENI.

- Application shall utilize the metering hardware resource in an optimized manner by allocating meter id and deallocating when not-in-use
- Application shall bind all associated metering buckets to an ENI. During ENI deletion, all associated metering bucket binding should be auto-removed.
- A route rule table can also have a metering bucket association for explicitly accounting the inbound traffic for an ENI.

_Open Items_
- Can we avoid explicit dependency between ENI's and mappings?
- Bucket id integer to be associated to an optional metadata string?

## 1.6 Design Considerations

DASH Sonic implementation is targeted for appliance scenarios and must handles millions of updates. As such, the implementation is performance and scale focussed as compared to traditional switching and routing based solutions. The following are the design considerations.

Expand Down