NETCONF Interaction Process
Figure 14-2 shows the NETCONF interaction process between an NMS and a switch.
- The switch sets up an SSH connection with the NMS. For details about how a switch sets up an SSH connection with iMaster NCE-Campus, see Interaction Between Huawei Switches and iMaster NCE-Campus.
- The switch and NMS exchange their supported capabilities by sending hello packets.
- After setting up a NETCONF session with the switch, the NMS sends an RPC request to the switch for configuration management.
- The switch parses and handles the received RPC request, and sends an RPC reply to the NMS.
- After the preceding operations are complete, the NMS sends an RPC request to close the NETCONF session. This reduces resource consumption on the switch and NMS.
- The switch closes the NETCONF session, and sends an RPC reply to the NMS.
<?xml version="1.0" encoding="UTF-8"?> <hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <capabilities> <capability>urn:ietf:params:netconf:base:1.0</capability> <capability>urn:ietf:params:netconf:capability:writable-running:1.0</capability> <capability>urn:ietf:params:netconf:capability:candidate:1.0</capability> <capability>urn:ietf:params:netconf:capability:confirmed-commit:1.0</capability> <capability>urn:ietf:params:netconf:capability:rollback-on-error:1.0</capability> <capability>urn:ietf:params:netconf:capability:validate:1.0</capability> <capability>urn:ietf:params:netconf:capability:startup:1.0</capability> </capabilities> <session-id>1227</session-id> </hello> ]]>]]>
<?xml version="1.0" encoding="UTF-8"?> <hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <capabilities> <capability>urn:ietf:params:netconf:base:1.0</capability> <capability>urn:ietf:params:netconf:capability:writable-running:1.0</capability> <capability>urn:ietf:params:netconf:capability:candidate:1.0</capability> <capability>urn:ietf:params:netconf:capability:confirmed-commit:1.0</capability> <capability>urn:ietf:params:netconf:capability:rollback-on-error:1.0</capability> <capability>urn:ietf:params:netconf:capability:validate:1.0</capability> <capability>urn:ietf:params:netconf:capability:startup:1.0</capability> </capabilities> </hello> ]]>]]>
<?xml version="1.0" encoding="UTF-8"?> <rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <close-session/> </rpc> ]]>]]>
<?xml version="1.0" encoding="UTF-8"?> <rpc-reply message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <ok/> </rpc-reply> ]]>]]>