Skip to content

Fix issue DAN-169 #11

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,14 @@ Conflicts: vyatta-protocols-isis-v1-yang
Description: FRR ISIS yang module package
The YANG module package for vyatta-protocols-frr-isis-v1

Package: vyatta-protocols-frr-link-params-v1-yang
Architecture: all
Depends:frr,
vyatta-cfg (>= 0.18.56),vyatta-frr-vci,
vyatta-protocols-frr (>= ${source:Version}),
${misc:Depends},
${yang:Depends}
Conflicts: vyatta-protocols-link-params-v1-yang
Description: FRR LINK-PARAMS yang module package
The YANG module package for vyatta-protocols-frr-link-params-v1

1 change: 1 addition & 0 deletions debian/vyatta-frr-vci.component
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Modules=vyatta-protocols-frr-bgp-v1, \
vyatta-protocols-frr-ldp-v1, \
vyatta-protocols-frr-ospf-v1, \
vyatta-protocols-frr-isis-v1, \
vyatta-protocols-frr-link-params-v1, \
vyatta-protocols-frr-ospf-routing-instance-v1, \
vyatta-protocols-frr-switch-vif-ospf-v1, \
vyatta-protocols-frr-ospfv3-v1, \
Expand Down
1 change: 1 addition & 0 deletions debian/vyatta-protocols-frr-link-params-v1-yang.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yang/vyatta-protocols-frr-link-params-v1.yang usr/share/configd/yang/
16 changes: 16 additions & 0 deletions scripts/frr/configs/commands/zebra.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"/interfaces/@element/link-params/@enter": "link-params",
"/interfaces/@element/link-params/@exit": "exit-link-params",
"/interfaces/@element/link-params/enable": "enable",
"/interfaces/@element/link-params/admin-grp": "admin-grp {/@text}",
"/interfaces/@element/link-params/ava-bw": "ava-bw {/@text}",
"/interfaces/@element/link-params/delay": "delay {/@text}",
"/interfaces/@element/link-params/delay-variation": "delay-variation {/@text}",
"/interfaces/@element/link-params/max-bw": "max-bw {/@text}",
"/interfaces/@element/link-params/max-rsv-bw": "max-rsv-bw {/@text}",
"/interfaces/@element/link-params/metric": "metric {/@text}",
"/interfaces/@element/link-params/packet-loss": "packet-loss {/@text}",
"/interfaces/@element/link-params/res-bw": "res-bw {/@text}",
"/interfaces/@element/link-params/unrsv-bw": "unrsv-bw {/@text}",
"/interfaces/@element/link-params/use-bw": "use-bw {/@text}"
}
194 changes: 194 additions & 0 deletions yang/vyatta-protocols-frr-link-params-v1.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
module vyatta-protocols-frr-link-params-v1 {
namespace "urn:vyatta.com:mgmt:vyatta-protocols-frr-link-params:1";
prefix vyatta-protocols-frr-link-params-v1;

import vyatta-types-v1 {
prefix types;
}
import configd-v1 {
prefix configd;
}
import vyatta-interfaces-v1 {
prefix if;
}
import vyatta-interfaces-dataplane-v1 {
prefix interfaces-dataplane;
}
import vyatta-interfaces-loopback-v1 {
prefix interfaces-loopback;
}
import vyatta-interfaces-switch-v1 {
prefix interfaces-switch;
}

organization "Niral Networks Private Limited";
contact
"Niral Networks
Postal: Sigma Soft Tech Park, Whitefield Main Road,
Bengaluru, India 560066
Web: www.niralnetworks.com";

description
"Copyright (c) 2019-2020, Niral Networks Intellectual Property.
Copy link

Choose a reason for hiding this comment

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

Should this just be 2021 if a new file? Certainly should list 2021

Copy link
Author

Choose a reason for hiding this comment

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

2021 has been listed i.e 2019-2021

All rights reserved.

Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the following
conditions are met:

1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

SPDX-License-Identifier: BSD-3-Clause
The YANG module package for vyatta-protocols-frr-link-params-v1";

revision 2021-03-02 {
description
"Added link-params option.";
Copy link

Choose a reason for hiding this comment

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

'Initial revision' would seem more appropriate.

Copy link
Author

Choose a reason for hiding this comment

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

The description has been modified to "Initial revision"

}

grouping link-params {
container link-params {
configd:help "Configure interface link parameters";
leaf admin-group {
type string {
pattern "0[Xx][a-fA-F0-9]+";
}
must "(../enable)" {
Copy link

Choose a reason for hiding this comment

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

Does this not require an 'enable' leaf in this container, which is missing? Did you mean '../../enable' or would you be better removing all these musts, and having it so any link-param configuration here implicitly enables link-params? Or make it a presence container so configuration of the container with no child nodes means link-params are enabled?

Copy link
Author

Choose a reason for hiding this comment

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

The must statement has been removed in the updated code.

Copy link
Contributor

Choose a reason for hiding this comment

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

Given that enable is gone, these must statements don't seem right (on all of the leaf nodes below as well).

Copy link
Author

Choose a reason for hiding this comment

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

I've removed the must statement as enable was gone

error-message "link-params enable must be set.";
}
configd:help "Administrative group membership";
description "Administrative group membership";
}
leaf available-bandwidth {
type uint32;
Copy link
Contributor

Choose a reason for hiding this comment

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

Much cleaner. Please add units statements to all of these so it's clear what units are being used. Maybe also mention the units in the configd:help as units aren't exposed via the CLI help.

Copy link
Author

Choose a reason for hiding this comment

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

added units statements in each of the leaf nodes and configd:help

Copy link

Choose a reason for hiding this comment

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

So you're never going to exceed ~4GB? Would a uint64 be safer here? Same applies to all bandwidth fields

Copy link
Author

Choose a reason for hiding this comment

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

uint64 would be able to allocate more bandwidth than uint32.. It has been modified

Copy link

Choose a reason for hiding this comment

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

Please push changes - presumably you will be modifying ALL bandwidth nodes to uint64?

Copy link
Author

Choose a reason for hiding this comment

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

I've pushed my changes. In all the bandwidth I've modified to uint64

must "(../enable)" {
error-message "link-params enable must be set.";
}
configd:help "Unidirectional Available Bandwidth";
Copy link

Choose a reason for hiding this comment

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

You might want to give the user a clue about units? bits? Gigabytes?

Copy link
Author

Choose a reason for hiding this comment

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

The units have already been added i.e (Bytes/second).

description "Unidirectional Available Bandwidth";
}
leaf delay {
type uint32 {
range "0..16777215";
Copy link

Choose a reason for hiding this comment

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

nanoseconds? Years?

Copy link
Author

Choose a reason for hiding this comment

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

The units have already been added in the previous commit i.e (micro-second).

}
must "(../enable)" {
error-message "link-params enable must be set.";
}
configd:help "Unidirectional Average Link Delay";
description "Unidirectional Average Link Delay";
}
leaf delay-variation {
type uint32 {
range "0..16777215";
Copy link

Choose a reason for hiding this comment

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

Units?

Copy link
Author

Choose a reason for hiding this comment

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

The units have already been added in the previous commit i.e (micro-second).

}
must "(../enable)" {
error-message "link-params enable must be set.";
}
configd:help "Unidirectional Link Delay Variation";
description "Unidirectional Link Delay Variation";
}
leaf max-bandwidth {
type uint32;
Copy link

Choose a reason for hiding this comment

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

Units

Copy link
Author

Choose a reason for hiding this comment

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

The units have already been added in the previous commit i.e (Bytes/second).

must "(../enable)" {
error-message "link-params enable must be set.";
}
configd:help "Maximum bandwidth that can be used";
description "Maximum bandwidth that can be used";
}
leaf max-reserved-bandwidth {
Copy link

Choose a reason for hiding this comment

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

Can this exceed max-bandwidth? If not then perhaps a must statement enforcing this would be wise.

Copy link

Choose a reason for hiding this comment

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

How do these 2 relate to available-bandwidth, residual, unreserved and utilised?

Copy link
Author

Choose a reason for hiding this comment

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

  1. I've enforced must statement in each of the bandwidths. Before configuring other bandwidths the max-bandwidth has to be set in order to compare the values i.e (max-bandwidth >= ).
  2. I have described the bandwidth-related fields following draft-ietf-isis-te-metrics-extension-03.

Copy link

Choose a reason for hiding this comment

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

What determines the max bandwidth that can be used? Is this an inherent property of the link, or, like ADSL, depends on how well the link is working at a given time?

Copy link
Author

Choose a reason for hiding this comment

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

I am not sure about it. In frr the max-bandwidth is set upon setting link-param however in Danos CLI user can provide max-bandwidth according to the need.

Copy link

Choose a reason for hiding this comment

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

How can you code a feature when you don't know what it means???

type uint32;
Copy link

Choose a reason for hiding this comment

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

Units

Copy link
Author

Choose a reason for hiding this comment

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

The units have already been added in the previous commit i.e (Bytes/second).

must "(../enable)" {
error-message "link-params enable must be set.";
}
configd:help "Maximum bandwidth that may be reserved";
description "Maximum bandwidth that may be reserved";
}
leaf metric {
Copy link

Choose a reason for hiding this comment

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

Could you ever have other metrics? Maybe mpls-te-metric would be a better name?

Copy link
Author

Choose a reason for hiding this comment

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

It seems better.. It has been changed

type uint32 {
range "1..4294967295";
Copy link

Choose a reason for hiding this comment

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

I think this is equivalent '1..max' which might read better?

Copy link
Author

Choose a reason for hiding this comment

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

max would be better to read. It has been updated.

}
must "(../enable)" {
error-message "link-params enable must be set.";
}
configd:help "Link metric for MPLS-TE purpose";
description "Link metric for MPLS-TE purpose";
}
leaf neighbor {
type types:ipv4-address;
must "(../enable)" {
error-message "link-params enable must be set.";
}
configd:help "Configure remote ASBR information (Neighbor IP address and AS number)";
description "Configure remote ASBR information (Neighbor IP address and AS number)";
}
leaf packet-loss {
type uint32;
Copy link

Choose a reason for hiding this comment

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

Units

Copy link
Author

Choose a reason for hiding this comment

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

The units have already been added in the previous commit i.e (Percentage).

must "(../enable)" {
error-message "link-params enable must be set.";
}
configd:help "Configure remote ASBR information (Neighbor IP address and AS number)";
description "Configure remote ASBR information (Neighbor IP address and AS number)";

}
leaf residual-bandwidth {
type uint32;
must "(../enable)" {
error-message "link-params enable must be set.";
}
configd:help "Unidirectional Residual Bandwidth";
description "Unidirectional Residual Bandwidth";
Copy link

Choose a reason for hiding this comment

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

What is residual bandwidth? Description can (and often should) be multi-line to give a fuller description than configd:help.

Copy link
Author

Choose a reason for hiding this comment

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

Fuller description has been provided for residual bandwidth following draft-ietf-isis-te-metrics-extension-03.

}
leaf unreserved-bandwidth {
type uint32;
must "(../enable)" {
error-message "link-params enable must be set.";
}
configd:help "Unreserved bandwidth at each priority level";
description "Unreserved bandwidth at each priority level";
}
leaf utilised-bandwidth {
Copy link

Choose a reason for hiding this comment

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

Is this config or state? Please provide a better description.

Copy link
Author

Choose a reason for hiding this comment

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

Fuller description has been provided for utilised bandwidth following draft-ietf-isis-te-metrics-extension-03.

Copy link

Choose a reason for hiding this comment

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

This still sounds more like state than config - 'as measured in the router' is state not config AFAICT.

Copy link
Author

@akashniral akashniral May 28, 2021

Choose a reason for hiding this comment

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

This similar command is there in vtysh shell where I can use this to adjust utilized-bandwidth in Bytes/second and was req in Danos CLI and in the draft-ietf-isis-te-metrics-extension-03 the above description is given of the same therefore I've provided that description.

type uint32;
must "(../enable)" {
error-message "link-params enable must be set.";
}
configd:help "Unidirectional Utilised Bandwidth";
description "Unidirectional Utilised Bandwidth";

}
}
}

augment /if:interfaces/interfaces-dataplane:dataplane {
uses link-params;
}
augment /if:interfaces/interfaces-dataplane:dataplane/interfaces-dataplane:vif/interfaces-dataplane:ip {
uses link-params;
}
augment /if:interfaces/interfaces-loopback:loopback {
uses link-params;
}
augment /if:interfaces/interfaces-switch:switch/interfaces-switch:vif {
uses link-params;
}
}