YANG feature statement gates optional module parts

300-435 By islever Editorial Last updated

Short answer

A YANG's feature statement declares an optional capability that gates module parts through if-feature and NETCONF capability advertisement, so choose conditional feature gating for optional module parts.

Question

What is YANG 'feature' statement?
  1. Conditional feature gating for optional module parts Correct Answer
  2. Required feature
  3. Always enabled
  4. Deprecated

Key Takeaways

YANG feature statements declare optional capabilities that gate schema branches through if-feature and are advertised during NETCONF capability exchange. Option A is correct because a feature enables conditional parts of a module rather than a required, always-on, or deprecated setting. The server's advertised module capability and its listed feature names determine which guarded nodes a client can validly use.

Expert Analysis

The deciding condition is that a YANG feature names an optional server capability whose presence controls whether guarded schema nodes exist, so option A is the only reading consistent with conditional module gating.

Misreading feature as required, always enabled, or deprecated breaks schema negotiation

Option A preserves the intended mechanism: a feature declares a named capability, and if-feature statements make the guarded nodes conditional on the server's support for that name. Option B breaks this by treating the declaration as a universal obligation: if every feature were required, a NETCONF server that omitted it would be non-conformant, yet servers routinely implement only a subset and the module's if-feature-guarded nodes simply disappear from the effective schema. Option C breaks the distinction between a capability and its state: supported features are advertised, unsupported ones are absent, so “always enabled” would make the feature name and the capability exchange pointless and would wrongly admit guarded data nodes on every device. Option D breaks the lifecycle model: deprecated is a status value attached to definitions, not a statement that marks optional capability gating, so treating feature as deprecation confuses schema versioning with conditional conformance. In a NETCONF/RESTCONF workflow, the client reads the server's hello capabilities, sees which feature names are listed for each module capability, and validates only the schema subset that those features enable; misclassifying feature as required, always enabled, or deprecated would cause the client to expect nodes that the device never exposes or to ignore legitimate optional branches.

The feature statement is the YANG declaration behind conditional module parts

YANG's feature statement introduces a named, optional capability at module scope; it is not a data node and does not by itself configure anything. Its effect appears through if-feature, which can guard a container, leaf, list, choice, case, rpc, notification, augment, or other schema statement, so the server's supported feature set determines whether those definitions are valid on that device. A NETCONF server advertises support as a module capability URI that includes a features parameter, and RESTCONF deployments expose the same YANG schema model through their API. When a feature name is absent from that advertisement, every branch guarded by that feature is omitted, and a client that tries to address those nodes is working outside the negotiated schema. YANG 1.1 also allows if-feature expressions such as and, or, and not, and a feature declaration itself can carry an if-feature, which lets module authors build layered optionality rather than a single on/off switch. The operational half of this mechanism is capability exchange; the schema half is that if-feature makes the guarded nodes conditional. The phrase “optional module parts” captures both halves: the feature is declared once, advertised as a capability, and then used to gate only the parts the implementation chooses to support.

A mandatory interpretation would require every advertised YANG feature to be implemented

If option B were correct, the feature statement would impose a requirement on every conforming server, so a device that did not advertise a declared feature would be in violation rather than simply offering a smaller schema. That would make feature names behave like mandatory nodes or a required conformance profile: all implementations would have to enable them, and if-feature would become a tautology. The condition is not met because YANG separates what a module can express from what a particular server supports; feature declarations are optional by design, and the capability exchange exists precisely to let a client discover the subset that is present. A module can declare a feature for an advanced capability, leave ordinary implementations without it, and still be conformant. The same logic rules out option C: if features were always enabled, the server would have nothing meaningful to advertise and if-feature could never remove a branch. Option D would become plausible only if “feature” were being used as a lifecycle status comparable to deprecated, but YANG already has a status statement for that purpose and the feature statement has no such meaning. The alternative that would win is a statement of mandatory conformance, not this optional capability marker.

Treat advertised YANG feature capabilities as the test for optional schema branches

Use a two-step test whenever a YANG term is described as a feature: first ask whether it is declared at module scope and referenced by if-feature to guard schema branches; second ask whether support is advertised as a feature name in the server's module capability, typically through a features= parameter on the capability URI. If both answers are yes, the construct is optional gating, which is exactly the behaviour described by conditional feature gating for optional module parts. If the term instead constrains data values, it is a type or must expression; if it marks a definition's lifecycle, it is status; if it forces a node to exist, it is mandatory. This test also transfers to RESTCONF: the payload schema follows the server's supported YANG modules and features, not the full published module text, so a client must not hard-code nodes from a feature-guarded branch without checking the device's capability set. The practical consequence is that a feature can be present on one IOS XE release and absent on another while both remain conformant, and automation should branch on the advertised capability rather than assume universal availability. Carry forward the pairing of feature with optional, if-feature, and capability exchange, and reject answers that turn it into a requirement, a permanent enablement, or a deprecation marker.

Official Reference

Exam Strategy

When a YANG term is paired with optional, conditional, capability, or if-feature, expect a feature statement; when paired with mandatory or required, think mandatory statement. Trace the operational check: the server advertises feature names in its module capability, and only nodes guarded by supported features become valid. Eliminate answers that imply universal enablement or lifecycle deprecation before examining syntax details.

Practice All 300-435 Questions

Access 150 questions with complete answers and detailed explanations.

View Full 300-435 Practice Test →

← Back to 300-435 Study Guide