NETCONF中远程过程调用的使用
use of remote procedure call in NETCONF
我正在阅读关于 netconf 的 RFC6241,其中提到 RPC 作为协议的消息传递机制。但是,规范中定义了XML用于传输RPC消息,所以我不太明白为什么这仍然称为RPC?我曾经认为 RPC 就像 ONC RPC 中描述的那样,即应该定义一个存根函数(如 Unix 上的 rpcgen 所做的那样)等等,但是 NETCONF 所说的确实如此不严格遵循此范例,而是定义了一种通过线路传输参数的机制。
也许,我对RPC这个概念有误解。有人可以为我澄清 netconf 中的 RPC 吗?谢谢,
远程过程调用概念只是客户端-服务器通信模型中请求-回复机制的抽象。客户端向(远程)服务器发送请求,等待响应,并在收到响应后根据收到的信息继续执行。这就对了。这本质上就是调用 NETCONF 操作时发生的情况。
你引用的specification:
The ONC RPC protocol is based on the remote procedure call model,
which is similar to the local procedure call model. In the local
case, the caller places arguments to a procedure in some well-
specified location (such as a register window). It then transfers
control to the procedure, and eventually regains control. At that
point, the results of the procedure are extracted from the well-
specified location, and the caller continues execution.
The remote procedure call model is similar. One thread of control
logically winds through two processes: the caller's process and a
server's process. The caller first sends a call message to the
server process and waits (blocks) for a reply message. The call
message includes the procedure's parameters, and the reply message
includes the procedure's results. Once the reply message is
received, the results of the procedure are extracted, and the
caller's execution is resumed.
和NETCONF specification说同样的话:
The NETCONF protocol uses a remote procedure call (RPC) paradigm. A
client encodes an RPC in XML [W3C.REC-xml-20001006] and sends it to a
server using a secure, connection-oriented session. The server
responds with a reply encoded in XML. The contents of both the
request and the response are fully described in XML DTDs or XML
schemas, or both, allowing both parties to recognize the syntax
constraints imposed on the exchange.
NETCONF uses an RPC-based communication paradigm. A client sends a
series of one or more RPC request messages, which cause the server to
respond with a corresponding series of RPC reply messages.
RPC is a kind of request–response protocol. An RPC is initiated by the client, which sends a request message to a known remote server to execute a specified procedure with supplied parameters. The remote server sends a response to the client, and the application continues its process. While the server is processing the call, the client is blocked (it waits until the server has finished processing before resuming execution), unless the client sends an asynchronous request to the server, such as an XHTTP call. There are many variations and subtleties in various implementations, resulting in a variety of different (incompatible) RPC protocols.
(迟到总比不到好,对吧?)
我正在阅读关于 netconf 的 RFC6241,其中提到 RPC 作为协议的消息传递机制。但是,规范中定义了XML用于传输RPC消息,所以我不太明白为什么这仍然称为RPC?我曾经认为 RPC 就像 ONC RPC 中描述的那样,即应该定义一个存根函数(如 Unix 上的 rpcgen 所做的那样)等等,但是 NETCONF 所说的确实如此不严格遵循此范例,而是定义了一种通过线路传输参数的机制。
也许,我对RPC这个概念有误解。有人可以为我澄清 netconf 中的 RPC 吗?谢谢,
远程过程调用概念只是客户端-服务器通信模型中请求-回复机制的抽象。客户端向(远程)服务器发送请求,等待响应,并在收到响应后根据收到的信息继续执行。这就对了。这本质上就是调用 NETCONF 操作时发生的情况。
你引用的specification:
The ONC RPC protocol is based on the remote procedure call model, which is similar to the local procedure call model. In the local case, the caller places arguments to a procedure in some well- specified location (such as a register window). It then transfers control to the procedure, and eventually regains control. At that point, the results of the procedure are extracted from the well- specified location, and the caller continues execution.
The remote procedure call model is similar. One thread of control logically winds through two processes: the caller's process and a server's process. The caller first sends a call message to the server process and waits (blocks) for a reply message. The call message includes the procedure's parameters, and the reply message includes the procedure's results. Once the reply message is received, the results of the procedure are extracted, and the caller's execution is resumed.
和NETCONF specification说同样的话:
The NETCONF protocol uses a remote procedure call (RPC) paradigm. A client encodes an RPC in XML [W3C.REC-xml-20001006] and sends it to a server using a secure, connection-oriented session. The server responds with a reply encoded in XML. The contents of both the request and the response are fully described in XML DTDs or XML schemas, or both, allowing both parties to recognize the syntax constraints imposed on the exchange.
NETCONF uses an RPC-based communication paradigm. A client sends a series of one or more RPC request messages, which cause the server to respond with a corresponding series of RPC reply messages.
RPC is a kind of request–response protocol. An RPC is initiated by the client, which sends a request message to a known remote server to execute a specified procedure with supplied parameters. The remote server sends a response to the client, and the application continues its process. While the server is processing the call, the client is blocked (it waits until the server has finished processing before resuming execution), unless the client sends an asynchronous request to the server, such as an XHTTP call. There are many variations and subtleties in various implementations, resulting in a variety of different (incompatible) RPC protocols.
(迟到总比不到好,对吧?)