- play_arrow Overview
- play_arrow NETCONF XML Management Protocol Overview
- play_arrow NETCONF and Junos XML Tags Overview
- XML and Junos OS Overview
- XML Overview
- XML and NETCONF XML Management Protocol Conventions Overview
- Map Junos OS Commands and Command Output to Junos XML Tag Elements
- Map Configuration Statements to Junos XML Tag Elements
- Using NETCONF Configuration Response Tag Elements in NETCONF Requests and Configuration Changes
-
- play_arrow Manage Configurations Using NETCONF
- play_arrow Change the Configuration Using NETCONF
- Edit the Configuration Using NETCONF
- Upload and Format Configuration Data in a NETCONF Session
- Set the Edit Configuration Mode in a NETCONF Session
- Handle Errors While Editing the Candidate Configuration in a NETCONF Session
- Replace the Candidate Configuration Using NETCONF
- Roll Back Uncommitted Changes in the Candidate Configuration Using NETCONF
- Delete the Configuration Using NETCONF
- Change Individual Configuration Elements Using NETCONF
- Merge Configuration Elements Using NETCONF
- Create Configuration Elements Using NETCONF
- Delete Configuration Elements Using NETCONF
- Replace Configuration Elements Using NETCONF
- Replace Patterns in Configuration Data Using the NETCONF or Junos XML Protocol
- play_arrow Commit the Configuration Using NETCONF
- play_arrow Ephemeral Configuration Database
- Understanding the Ephemeral Configuration Database
- Unsupported Configuration Statements in the Ephemeral Configuration Database
- Enable and Configure Instances of the Ephemeral Configuration Database
- Commit and Synchronize Ephemeral Configuration Data Using the NETCONF or Junos XML Protocol
- Managing Ephemeral Configuration Database Space
- Example: Configure the Ephemeral Configuration Database Using NETCONF
-
- play_arrow Request Operational and Configuration Information Using NETCONF
- play_arrow Request Operational Information Using NETCONF
- play_arrow Request Configuration Information Using NETCONF
- Request the Committed Configuration and Device State Using NETCONF
- Request Configuration Data Using NETCONF
- Specify the Source for Configuration Information Requests Using NETCONF
- Specify the Scope of Configuration Information to Return in a NETCONF Response
- Request the Complete Configuration Using NETCONF
- Request a Configuration Hierarchy Level or Container Object Without an Identifier Using NETCONF
- Request All Configuration Objects of a Specified Type Using NETCONF
- Request Identifiers for Configuration Objects of a Specified Type Using NETCONF
- Request A Specific Configuration Object Using NETCONF
- Request Specific Child Tags for a Configuration Object Using NETCONF
- Request Multiple Configuration Elements Simultaneously Using NETCONF
- Retrieve a Previous (Rollback) Configuration Using NETCONF
- Compare Two Previous (Rollback) Configurations Using NETCONF
- Retrieve the Rescue Configuration Using NETCONF
- Request an XML Schema for the Configuration Hierarchy Using NETCONF
-
- play_arrow NETCONF Utilities
- play_arrow NETCONF Perl Client
- play_arrow Develop NETCONF Perl Client Applications
- Write NETCONF Perl Client Applications
- Import Perl Modules and Declare Constants in NETCONF Perl Client Applications
- Connect to the NETCONF Server in Perl Client Applications
- Collect Parameters Interactively in NETCONF Perl Client Applications
- Submit a Request to the NETCONF Server in Perl Client Applications
- Example: Request an Inventory of Hardware Components Using a NETCONF Perl Client Application
- Example: Change the Configuration Using a NETCONF Perl Client Application
- Parse the NETCONF Server Response in Perl Client Applications
- Close the Connection to the NETCONF Server in Perl Client Applications
-
- play_arrow YANG
- play_arrow YANG Overview
- Understanding YANG on Devices Running Junos OS
- Understanding Junos YANG Modules
- YANG Modules Overview
- Understanding the YANG Modules That Define the Junos OS Configuration
- Understanding the YANG Modules for Junos Operational Commands
- Junos Genstate YANG Data Models
- Understanding the Junos DDL Extensions YANG Module
- YANG Metadata Annotations for Junos Devices
- Use Juniper Networks YANG Modules
- play_arrow Create and Use Non-Native YANG Modules
- Understanding the Management of Nonnative YANG Modules on Devices Running Junos OS
- Manage YANG Packages, Modules, and Scripts on Junos Devices
- Managing YANG Packages and Configurations During a Software Upgrade or Downgrade
- Create Translation Scripts for YANG Configuration Models
- Disable and Enable YANG Translation Scripts on Devices Running Junos OS
- Commit and Display Configuration Data for Nonnative YANG Modules
- Create Custom RPCs in YANG for Devices Running Junos OS
- Create Action Scripts for YANG RPCs on Junos Devices
- Use Custom YANG RPCs on Devices Running Junos OS
- Example: Use a Custom YANG RPC to Retrieve Operational Information on Junos Devices
- Understanding Junos OS YANG Extensions for Formatting RPC Output
- Customize YANG RPC Output on Devices Running Junos OS
- Define Different Levels of Output in Custom YANG RPCs for Junos Devices
- Display Valid Command Option and Configuration Statement Values in the CLI for Custom YANG Modules
- Configure a NETCONF Proxy Telemetry Sensor in Junos
-
- play_arrow OpenDaylight Integration
- play_arrow Configure OpenDaylight Integration
-
- play_arrow Configuration Statements and Operational Commands
Configure RFC-Compliant NETCONF Sessions
Understanding RFC-Compliant NETCONF Sessions
When you use NETCONF to manage Junos devices, you can require that the NETCONF session enforce certain behaviors that are compliant with specific RFCs. You can configure Junos devices to be compliant with the following RFCs:
RFC 4741, NETCONF Configuration Protocol
RFC 6242, Using the NETCONF Protocol over Secure Shell (SSH)
To enforce RFC 4741 compliance, configure the rfc-compliant
statement at
the [edit system services netconf]
hierarchy level. Configuring the
rfc-compliant
statement affects the following aspects of the NETCONF
session:
Namespaces emitted in NETCONF server replies
NETCONF server replies for
<get>
and<get-config>
operations in cases where there is no configuration data to returnNETCONF server replies that would return both an
<ok/>
element and an<rpc-error>
element with a severity level of warning- NETCONF server replies for
<commit>
and<validate>
operations
To also enforce RFC 6242 compliance, configure both the rfc-compliant
and
version-1.1
statements at the [edit system services
netconf]
hierarchy level. If you configure RFC 6242 compliance, and both peers
advertise the :base:1.1
capability in the capabilities exchange, the
NETCONF session uses chunked framing instead of the end-of-message character sequence
(]]>]]>) for message framing. For additional details, see (RFC 6242) Chunked Framing.
The session differences are described in detail in the corresponding sections.
Benefits of RFC-Compliant Sessions
Standards Compliance: Ensures that NETCONF communications are compliant with the latest industry standards, facilitating interoperability with other compliant systems.
Enhanced Reliability: By using chunked framing, NETCONF messages are encoded in a way that prevents misinterpretation of character sequences within XML elements, ensuring reliable message parsing.
(RFC 4741) Namespaces
By default, the NETCONF server, sets the default namespace to the NETCONF namespace in the opening tag of the server’s reply, and NETCONF tag names are not qualified. For example:
<hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <capabilities> <capability>urn:ietf:params:netconf:base:1.0</capability> ... </capabilities> <session-id>27700</session-id> <hello> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/15.1R1/junos">
When you configure the rfc-compliant
statement, the NETCONF server does
not define a default namespace in its replies. Instead, the server includes a namespace
declaration for the NETCONF namespace, which is bound to the nc
prefix, and
qualifies all NETCONF tags in its replies with the prefix. If you set the default namespace
to the NETCONF namespace in an RPC request, the server discards the default namespace and
emits its reply using only the declared namespace that is bound to the nc
prefix.
The following sample output shows the NETCONF server’s <hello>
message and capabilities exchange when the rfc-compliant
statement is
configured. The <hello>
tag contains the xmlns:nc
declaration, and all NETCONF tags include the nc
prefix.
<nc:hello xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"> <nc:capabilities> <nc:capability>urn:ietf:params:netconf:base:1.0</nc:capability> ... </nc:capabilities> <nc:session-id>27703</nc:session-id> </nc:hello>
The following output shows a sample RPC reply when the rfc-compliant
statement is configured:
<nc:rpc-reply xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/15.1R1/junos"> <nc:data> <configuration xmlns="http://xml.juniper.net/xnm/1.1/xnm" junos:changed-seconds="1417554471" junos:changed-localtime="2014-12-02 13:07:51 PST"> <!--configuration data--> </configuration> <database-status-information> <database-status> <user>root</user> <terminal></terminal> <pid>47868</pid> <start-time junos:seconds="1417560303">2014-12-02 14:45:03 PST</start-time> <edit-path></edit-path> </database-status> </database-status-information> </nc:data> </nc:rpc-reply>
Starting with Junos OS Release 17.2R1, when you configure the
rfc-compliant
statement and request configuration data in a NETCONF
session, the server sets the default namespace for the
<configuration>
element to the same namespace as in the
corresponding YANG model.
<rpc> <get-config> <source> <running/> </source> </get-config> </rpc> ]]>]]> <nc:rpc-reply xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/17.2R1/junos"> <nc:data> <configuration xmlns="http://yang.juniper.net/yang/1.1/jc/configuration/junos/17.2R1.13" junos:commit-seconds="1493761452" junos:commit-localtime="2017-05-02 14:44:12 PDT" junos:commit-user="user"> ... </configuration> </nc:data> </nc:rpc-reply> ]]>]]>
(RFC 4741) Changes to <get> and <get-config> Operations
The rfc-compliant
statement affects the <get>
and
<get-config>
server replies in cases where there is no
configuration data to return. This can occur, for example, when you apply a filter to return
a subset of the configuration, and that portion of the configuration is empty.
In these cases, if you do not configure the rfc-compliant
statement, the
RPC reply contains an empty <configuration>
element inside the
<data>
element.
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/15.1D0/junos"> <data> <configuration> </configuration> </data> </rpc-reply>
If you configure the rfc-compliant
statement, the RPC reply instead
returns an empty <data>
element and omits the
<configuration>
element.
<nc:rpc-reply xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/15.1R1/junos"> <nc:data> </nc:data> </nc:rpc-reply>
(RFC 4741) <rpc-error> Elements with a Severity Level of Warning in RPC Replies
Starting in Junos OS Release 17.4R3, 18.2R2, 18.3R2, and 18.4R1, when you configure the
rfc-compliant
statement, the NETCONF server cannot return an RPC reply
that includes both an <rpc-error>
element and an
<ok/>
element. If the operation is successful, but the server reply
would include one or more <rpc-error>
elements with a severity level
of warning in addition to the <ok/>
element, then the warnings are
omitted. In addition, starting in Junos OS Release 21.2R1, any warnings that are omitted
during a <commit>
operation are redirected to the system log file for
tracking.
In earlier releases, or when the rfc-compliant
statement is not
configured, the NETCONF server might issue an RPC reply that includes both an
<rpc-error>
element with a severity level of warning and an
<ok/>
element. For example, a commit operation might be successful
but return a warning as in the following NETCONF server reply:
<nc:rpc-reply xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/17.4R1/junos"> <nc:rpc-error> <nc:error-severity>warning</nc:error-severity> <nc:error-message> uid changed for jadmin (2001->2014) </nc:error-message> </nc:rpc-error> <nc:ok/> </nc:rpc-reply> ]]>]]>
If you configure the rfc-compliant
statement, then the warning is
omitted.
<nc:rpc-reply xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/18.4R1/junos"> <nc:ok/> </nc:rpc-reply> ]]>]]>
(RFC 4741) NETCONF Server Response to <commit> and <validate> Operations
Starting in Junos OS Release 21.2R1, when you configure the rfc-compliant
statement, the NETCONF server's response to <commit>
operations
includes the following changes:
If a successful
<commit>
operation returns a response with one or more warnings, the warnings are redirected to the system log file, in addition to being omitted from the response.The NETCONF server response emits the
<source-daemon>
element as a child of the<error-info>
element instead of the<rpc-error>
element.If you also configure the
flatten-commit-results
statement at the[edit system services netconf]
hierarchy level, the NETCONF server emits only an<ok/>
or<rpc-error>
element in its response and suppresses any<commit-results>
XML subtree.
Starting in Junos OS Release 23.2R1 and Junos OS Evolved Release 23.4R1, when you configure
the rfc-compliant
statement, the NETCONF server emits only an
<ok/>
or <rpc-error>
element in response to
<validate>
operations. In earlier releases, the RPC reply also
includes the <commit-results>
element.
(RFC 6242) Chunked Framing
NETCONF sessions use a framing mechanism to separate the messages that the NETCONF server
and client send within a session. By default, the NETCONF server emits the
:base:1.0
capability, and both the NETCONF server and client use the
character sequence ]]>]]> defined in RFC 4742 as the message separator. However, this
character sequence can also potentially appear in XML attributes, comments, and processing
instructions, where it could be misinterpreted as a message boundary.
To clearly define message boundaries, you can configure RFC 6242 compliance with support
for chunked framing on Junos devices that support this feature. Chunked framing is a
standardized framing mechanism that ensures that character sequences within XML elements are
not misinterpreted as message boundaries. When you enable RFC 6242 compliance, and both
peers advertise the :base:1.1
capability in the capabilities exchange, the
NETCONF session uses chunked framing for the remainder of the session.
The chunked framing mechanism encodes all NETCONF messages as chunked following the Augmented Backus-Naur Form (ABNF) rule Chunked-Message, which is defined as follows:
Chunked-Message = 1*chunk end-of-chunks chunk = LF HASH chunk-size LF chunk-data chunk-size = 1*DIGIT1 0*DIGIT chunk-data = 1*OCTET end-of-chunks = LF HASH HASH LF DIGIT1 = %x31-39 DIGIT = %x30-39 HASH = %x23 LF = %x0A OCTET = %x00-FF
The ABNF specification is defined in RFC 5234, Augmented BNF for Syntax Specifications: ABNF.
The chunk framing protocol divides NETCONF messages into distinct chunks, each with a
specified size (chunk-size) and data (chunk-data), followed by an end-of-chunks marker. This
structure ensures that sequences such as ]]>]]>
within XML elements
are not misinterpreted as end-of-message markers.
For example, when the NETCONF client emits the
<get-system-information>
RPC using the end-of-document character
sequence, it emits the message as follows:
<rpc message-id="102" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <get-system-information/> </rpc> ]]>]]>
When the NETCONF client emits the same RPC using chunked framing, it might structure the message as follows:
#4 <rpc #18 message-id="102" #85 xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <get-system-information/> </rpc> ##
Similary, the NETCONF server returns its reply using chunked framing.
#141 <nc:rpc-reply xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/24.4R1/junos" message-id="102" > #21 <system-information> #90 <host-name>R1</host-name> <hardware-model>mx960</hardware-model> <os-name>junos</os-name> #73 <os-version>24.4R1.10</os-version> <serial-number>ABC123</serial-number> #22 </system-information> #16 </nc:rpc-reply> ##
To enable RFC 6242 compliance with chunked framing support:
Enable the NETCONF service.
content_copy zoom_out_map[edit system services netconf] user@host# set ssh
Configure NETCONF session compliance with RFC 4741 and RFC 6242.
content_copy zoom_out_map[edit system services netconf] user@host# set rfc-compliant user@host# set version-1.1
Commit the configuration.
content_copy zoom_out_map[edit system services netconf] user@host# commit
To use chunked framing in the NETCONF session, the client application and NETCONF server
must both advertise the :base:1.1
capability in the capabilities exchange.
For example:
admin@host:~$ ssh 198.51.100.1 -p 830 -s netconf <nc:hello xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"> <nc:capabilities> <nc:capability>urn:ietf:params:netconf:base:1.1</nc:capability> </nc:capabilities> </nc:hello> ]]>]]> <!-- No zombies were killed during the creation of this user interface --> <!-- user admin, class j-super-user --> <nc:hello xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"> <nc:capabilities> <nc:capability>urn:ietf:params:netconf:base:1.0</nc:capability> <nc:capability>urn:ietf:params:netconf:base:1.1</nc:capability> ... </nc:capabilities> <nc:session-id>80206</nc:session-id> </nc:hello> ]]>]]>
After both peers advertise the :base:1.1
capability, the NETCONF session
uses chunked framing for the remainder of the session.
Change History Table
Feature support is determined by the platform and release you are using. Use Feature Explorer to determine if a feature is supported on your platform.
rfc-compliant
statement, the NETCONF server emits
only an <ok/>
or <rpc-error>
element in
response to <validate>
operations. In earlier releases, the RPC
reply also includes the <commit-results>
element.rfc-compliant
statement, the NETCONF server's response to
<commit>
operations is modified.rfc-compliant
statement, the NETCONF server cannot return
an RPC reply that includes both an <rpc-error>
element and an
<ok/>
element.