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

Add basic BIER support #10

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

nrybowski
Copy link

@nrybowski nrybowski commented Apr 5, 2024

This PR adds a partial implementation of a modified version of draft-ietf-bier-bier-yang-08. The differences with the original are the following:

  • sub-domain-id updated from u16 to u8 per RFC8279.
  • mt_id updated from u16 to u8 per draft-ietf-ospf-mt-ospfv3-03.
  • address_family updated from custom format to iana-routing-types:address_family.
  • bsl enum in draft-08 incorrectly copies the underlay-protocol-type enum, bsl enum from draft-07 is reused.
  • fixed some typos in the YANG model.
  • max-si updated from uint16 to uint8 per draft-ietf-bier-ospfv3-extensions.

TODO

  • Add iBus messages for BierCfgEncapUpdate event
  • Move draft-ietf-bier-bier-yang-08 modifications in YANG augmentations
  • Enforce BIER sub-domain configuration constraints in validation callback
  • Enforce BIER sub-domain encapsulation configuration constraints in validation callback

@rwestphal
Copy link
Member

@nrybowski Really interesting stuff!

I must say I'm not familiar with BIER and multicasting in general, but I'll follow this closely and learn more when I get the chance.

Could you provide a brief summary of the scope of this work? It seems like you're laying the groundwork containing BIER data structures and configuration options, which could eventually lead to implementing BIER IGP extensions like RFC 8444, right?

Regarding your changes done in the BIER YANG module, I'd suggest keeping the draft module intact, and do all changes in the form of deviations. Reporting the problems you found to the module authors would be nice as well, so that they can be fixed in the next draft version.

Regarding the code changes, it looks like you had some fun adding and implementing the BIER northbound callbacks. Yeah, it's not the most exciting work, but it's necessary. I'm hoping to automate the processing of configuration changes with code generation down the line, but we're not quite there yet.

Feel free to reach out to me on our Discord server if you need help with your implementation. I also plan to write more developer documentation in the coming days, which hopefully will help in your development efforts.

Looking forward to seeing more progress on this front!

@nrybowski nrybowski mentioned this pull request Apr 8, 2024
6 tasks
@nrybowski
Copy link
Author

Could you provide a brief summary of the scope of this work? It seems like you're laying the groundwork containing BIER data structures and configuration options, which could eventually lead to implementing BIER IGP extensions like RFC 8444, right?

Sure! To be honest, I worked backward. I first started by implementing BIER TLVs for OSPFv3 (draft-ietf-bier-ospfv3-extensions-07) (#16) which is like RFC8444 but for OSPFv3. I tested that with hardcoded values and then worked on this PR. My goal is to implement a functional BIER control plane in Holo and use a separate BIER data plane (e.g. https://github.com/louisna/bier-rust). I'm also thinking about implementing a BIER data plane in Click / FastClick to leverage upcoming support for DPDK in Holo (#14).

Regarding your changes done in the BIER YANG module, I'd suggest keeping the draft module intact, and do all changes in the form of deviations. Reporting the problems you found to the module authors would be nice as well, so that they can be fixed in the next draft version.

You are right, I also thought about using deviations but I was unsure how to indicate other variable types, I will look at that.

Regarding the code changes, it looks like you had some fun adding and implementing the BIER northbound callbacks. Yeah, it's not the most exciting work, but it's necessary. I'm hoping to automate the processing of configuration changes with code generation down the line, but we're not quite there yet.

Feel free to reach out to me on our Discord server if you need help with your implementation. I also plan to write more developer documentation in the coming days, which hopefully will help in your development efforts.

Sounds great!

@nrybowski
Copy link
Author

The BIER Forwarding Table (BIFT) configuration defined in draft-ietf-bier-bier-yang-08 is left unimplemented since the way to integrate a BIER data-plane with Holo is not defined yet.

@rwestphal
Copy link
Member

That's pretty awesome. I'm impressed with the progress you've made so far when there's so little developer documentation available (I'm working on that!).

I assume the Linux kernel doesn't support BIER yet, so yeah, we'll need to figure out a way to integrate with custom BIER dataplanes.

Let me know when the code is ready for review! @frederic-loui has some experience with BIER and can help with testing.

@nrybowski nrybowski marked this pull request as ready for review April 10, 2024 23:41
Partial implementation of updated draft-ietf-bier-bier-yang-08
- sub-domain-id updated from u16 to u8 per RFC8279
- mt_id updated from u16 to u8 per draft-ietf-ospf-mt-ospfv3-03
- address_family updated from custom format to iana-routing-types:address_family
- fixed some typos in the YANG model

Signed-off-by: Nicolas Rybowski <nicolas.rybowski@uclouvain.be>
Divergences with draft-ietf-bier-bier-yang-08:
- max-si type updated from uint16 to uint8 per draft-ietf-bier-ospfv3-extensions

Full BIER sub-domain configuration via YANG callbacks.

Signed-off-by: Nicolas Rybowski <nicolas.rybowski@uclouvain.be>
Signed-off-by: Nicolas Rybowski <nicolas.rybowski@uclouvain.be>
Signed-off-by: Nicolas Rybowski <nicolas.rybowski@uclouvain.be>
Signed-off-by: Nicolas Rybowski <nicolas.rybowski@uclouvain.be>
@nrybowski
Copy link
Author

The force push is a rebase on 8ad0dd1 and the cleanup of some commit messages. I still have to enforce the constraints on the acceptable values for the BIER configuration variables in validation callbacks. That being said, IMO the PR is ready for a first review.

@nrybowski nrybowski changed the title WIP: Add basic BIER support Add basic BIER support Apr 11, 2024
Copy link
Member

@rwestphal rwestphal left a comment

Choose a reason for hiding this comment

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

@nrybowski This is looking great!

I've left a few review comments below.

Also, please ensure the ietf-bier@2023-09-16.yang YANG module is kept intact and do all your changes in the deviations module. When people see ietf-bier@2023-09-16.yang, they expect the original standard module, so having a modified version with the same name could lead to confusion.

pub struct BierSubDomainCfg {
pub sd_id: SubDomainId,
pub addr_family: AddressFamily,
pub bfr_prefix: IpNetwork,
Copy link
Member

Choose a reason for hiding this comment

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

In the YANG module, this and all other fields below this one are optional, so you need wrap the types inside an Option (e.g. Option<IpNetwork>) and adjust the northbound callbacks accordingly.

Referencing the YANG tree output below, note that all leafs ending with ? indicate optional nodes:

  |     +--rw bier:sub-domain* [sub-domain-id address-family]
  |     |  +--rw bier:sub-domain-id             uint16
  |     |  +--rw bier:address-family            identityref
  |     |  +--rw bier:bfr-prefix?               inet:ip-prefix
  |     |  +--rw bier:underlay-protocol-type?   underlay-protocol-type
  |     |  +--rw bier:mt-id?                    uint16
  |     |  +--rw bier:bfr-id?                   uint16
  |     |  +--rw bier:bsl?                      bsl
  |     |  +--rw bier:igp-algorithm?            uint8
  |     |  +--rw bier:bier-algorithm?           uint8
  |     |  +--rw bier:load-balance-num?         uint8
  |     |  +--rw bier:encapsulation* [bsl encapsulation-type]

.path(bier::sub_domain::PATH)
.validate(|args| {
let addr_family = args.dnode.get_af_relative("./address-family").unwrap();
let mt_id = args.dnode.get_u8_relative("./mt-id").unwrap();
Copy link
Member

Choose a reason for hiding this comment

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

The "mt-id" leaf is optional, so you need to check if it's present (if let Some(...) ...).

// Update the shared BIER configuration by creating a new reference-counted copy.
self.shared.bier_config = Arc::new(self.bier_config.clone());

// Notify protocol instances about the updated SR configuration.
Copy link
Member

Choose a reason for hiding this comment

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

s/SR/BIER/ :)

@@ -61,6 +68,8 @@ pub enum Event {
SrCfgUpdate,
SrCfgLabelRangeUpdate,
SrCfgPrefixSidUpdate(AddressFamily),
BierCfgUpdate,
BierCfgEncapUpdate(SubDomainId, AddressFamily, Bsl, BierEncapsulationType),
Copy link
Member

Choose a reason for hiding this comment

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

For enum variants with multiple values, I recommend using the following alternative syntax, where you can name each value:

BierCfgEncapUpdate {
    sd_id :SubDomainId,
    af: AddressFamily,
    bsl: Bsl,
    encap_type: BierEncapsulationType,
}

@@ -408,6 +408,16 @@ fn load_callbacks() -> Callbacks<Master> {
None
}
})
.path(bier::sub_domain::PATH)
.get_iterate(|_context, _args| {
// TODO: implement me!
Copy link
Member

Choose a reason for hiding this comment

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

nit: you can replace this comment by // No operational data under this list.

pub struct BierEncapsulation {
pub bsl: Bsl,
pub encap_type: BierEncapsulationType,
pub max_si: u8,
Copy link
Member

Choose a reason for hiding this comment

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

This field should be optional as well.

Event::BierCfgEncapUpdate(sd_id, addr_family, bsl, encap_type) => {
let _ = self
.ibus_tx
.send(IbusMsg::BierCfgEvent(BierCfgEvent::EncapUpdate(sd_id, addr_family, bsl, encap_type)));
Copy link
Member

Choose a reason for hiding this comment

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

This line is too long. Please run cargo fmt to address this and other style issues.

Copy link

codecov bot commented Apr 11, 2024

Codecov Report

Attention: Patch coverage is 5.33333% with 71 lines in your changes are missing coverage. Please review.

Project coverage is 60.29%. Comparing base (0f211fc) to head (b0ad353).
Report is 2 commits behind head on master.

Files Patch % Lines
holo-utils/src/bier.rs 4.34% 66 Missing ⚠️
holo-utils/src/ibus.rs 0.00% 4 Missing ⚠️
holo-protocol/src/lib.rs 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #10      +/-   ##
==========================================
- Coverage   60.42%   60.29%   -0.13%     
==========================================
  Files         179      180       +1     
  Lines       31812    31887      +75     
==========================================
+ Hits        19222    19226       +4     
- Misses      12590    12661      +71     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

Successfully merging this pull request may close these issues.

None yet

2 participants