- 浏览: 459516 次
- 性别:
- 来自: 陕西.西安
文章分类
最新评论
-
gaodadawei:
登录失败,请重试楼主,我目前遇到这样一个错误,claros i ...
James+Claros+intouch2.1配置 -
VerRan:
qq346448412 写道请问。你上一节、 用的ORACLE ...
James+Claros+intouch2.1配置 -
qq346448412:
请问。你上一节、 用的ORACLE数据库、 这一节又用的是MY ...
James+Claros+intouch2.1配置 -
paladin1988:
good,我喜欢..
Hibernate自关联关系 -
lygxy12:
请问,能给163发邮件吗?该怎么配置?我安装上面的操作,发给1 ...
James+Claros+intouch2.1配置
Most network programming is done by writing application programs that call system-provided functions to perform specific network operations. For example, one function performs a TCP active open, another performs a TCP passive open, another sends data across a TCP connection, another sets specific protocol options (enable TCP's keepalive timer), and so on. In Section 1.15 we mentioned that two popular sets of functions for network programming (called APIs) are sockets and TLI. The API used by the client and the API used by the server can be different, as can the operating systems running on the client and server. It is the communication protocol and application protocol that determine if a given client and server can communicate with each other. A Unix client written in C using sockets and TCP can communicate with a mainframe server written in COBOL using some other API and TCP, if both hosts are connected across a network and both have a TCP/IP implementation.
Typically the client sends commands to the server, and the server sends replies back to the client. All the applications we've looked at so far— Ping, Traceroute, routing daemons, and the clients and servers for the DNS, TFTP, BOOTP, SNMP, Telnet, FTP, and SMTP— are built this way.
RPC, Remote Procedure Call, is a different way of doing network programming. A client program is written that just calls functions in the server program. This is how it appears to the programmer, but the following steps actually take place.
-
When the client calls the remote procedure, it's really calling a function on the local host that's generated by the RPC package. This function is called the client stub. The client stub packages the procedure arguments into a network message, and sends this message to the server.
-
A server stub on the server host receives the network message. It takes the arguments from the network message, and calls the server procedure that the application programmer wrote.
-
When the server function returns, it returns to the server stub, which takes the return values, packages them into a network message, and sends the message back to the client stub.
-
The client stub takes the return values from the network message and returns to the client application.
The network programming done by the stubs and the RPC library routines uses an API such as sockets or TLI, but the user application— the client program, and the server procedures called by the client— never deal with this API. The client application just calls the server procedures and all the network programming details are hidden by the RPC package, the client stub, and the server stub.
An RPC package provides numerous benefits.
-
The programming is easier since there is little or no network programming involved. The application programmer just writes a client program and the server procedures that the client calls.
-
If an unreliable protocol such as UDP is used, details like timeout and retransmission are handled by the RPC package. This simplifies the user application.
-
The RPC library handles any required data translation for the arguments and return values. For example, if the arguments consist of integers and floating point numbers, the RPC package handles any differences in the way integers and floating point numbers are stored on the client and server. This simplifies coding clients and servers that can operate in heterogeneous environments.
Details of RPC programming are provided in Chapter 18 of [Stevens 1990]. Two popular RPC packages are Sun RPC and the RPC package in the Open Software Foundation's (OSF) Distributed Computing Environment (DCE). Our interest in RPC is to see what the procedure call and procedure return messages look like for the Sun RPC package, since it's used by the Network File System, which we describe in this chapter. Version 2 of Sun RPC is defined in RFC 1057 [Sun Microsystems 1988a].
Sun RPC
Sun RPC comes in two flavors. One version is built using the sockets API and works with TCP and UDP. Another, called TI-RPC (for "transport independent"), is built using the TLI API and works with any transport layer provided by the kernel. From our perspective the two are the same, although we talk only about TCP and UDP in this chapter.
Figure 29.1 shows the format of an RPC procedure call message, when UDP is used.
Figure 29.1. Format of RPC procedure call message as a UDP datagram.
The IP and UDP headers are the standard ones we showed earlier (Figures 3.1 and 11.2). What follows after the UDP header is defined by the RPC package.
The transaction ID (XID) is set by the client and returned by the server. When the client receives a reply it compares the XID returned by the server with the XID of the request it sent. If they don't match, the client discards the message and waits for the next one from the server. Each time the client issues a new RPC, it changes the XID. But if the client retransmits a previously sent RPC (because it hasn't received a reply), the XID does not change.
The call variable is 0 for a call, and 1 for a reply. The current RPC version is 2. The next three variables, program number, version number, and procedure number, identify the specific procedure on the server to be called.
The credentials identify the client. In some instances nothing is sent here, and in other instances the numeric user ID and group IDs of the client are sent. The server can look at the credentials and determine if it will perform the request or not. The verifier is used with Secure RPC, which uses DES encryption. Although the credentials and verifier are variable-length fields, their length is encoded as part of the field.
Following this are the procedure parameters. The format of these depends on the definition of the remote procedure by the application. How does the receiver (the server stub) know the size of the parameters? Since UDP is being used, the size of the UDP datagram, minus the length of all the fields up through the verifier, is the size of the parameters. When TCP is used instead of UDP, there is no inherent length, since TCP is a byte stream protocol, without record boundaries. To handle this, a 4-byte length field appears between the TCP header and the XID, telling the receiver how many bytes comprise the RPC call. This allows the RPC call message to be sent in multiple TCP segments, if necessary. (The DNS uses a similar technique; see Exercise 14.4.)
Figure 29.2 shows the format of an RPC reply. This is sent by the server stub to the client stub, when the remote procedure returns.
Figure 29.2. Format of RPC procedure reply message as a UDP datagram.
The XID in the reply is just copied from the XID in the call. The reply is 1, which we said differentiates this message from a call. The status is 0 if the call message was accepted. (The message can be rejected if the RPC version number isn't 2, or if the server cannot authenticate the client.) The verifier is used with secure RPC to identify the server.
The accept status is 0 on success. A nonzero value can indicate an invalid version number or an invalid procedure number, for, example. As with the RPC call message, if TCP is used instead of UDP, a 4-byte length field is sent between the TCP header and the XID.
发表评论
-
AKKA 学习笔记之1
2013-09-15 15:08 23535AKKA 是一款基于actor模型实现的 并发处理框架。基 ... -
Ant 集成 junit 自动生成测试报告
2013-08-28 08:56 1024在当下Maven 统治大片江山,Gradle后起之秀的情况 ... -
很有用的测试工具
2013-08-27 11:21 7181. findbugs findbugs是一种静态 ... -
java 之 JNI
2013-08-27 11:06 1692前言: 在查看java socket实现代码时最终发现其 ... -
HSQLDB实现学习笔记-数据库服务器连接
2013-08-27 10:27 12671 数据库服务器连接 主要用于描述客户端是如何与 ... -
HSQLDB实现学习笔记-数据库服务器创建
2013-08-27 10:16 2987前言: HSQLDB作为一个纯java实现的开源数据库, ... -
反射实现 AOP 动态代理模式(Spring AOP 的实现 原理)(转)2
2011-04-13 14:01 12111package sinosoft.dj.aop ... -
反射实现 AOP 动态代理模式(Spring AOP 的实现 原理)(转)
2011-04-13 13:49 873转自: http://www.blogjava.net/Do ... -
pushlet
2011-03-31 22:54 879http://baike.baidu.com/view/246 ... -
Comet:基于 HTTP 长连接的“服务器推”技术(转)
2011-03-31 22:39 882http://www.ibm.com/developerwor ... -
冒泡排序
2011-03-30 16:03 992package com.datastruct.sort; ... -
快速排序
2011-03-30 16:02 943package com.datastruct.sort; ... -
Cookie
2011-03-30 14:11 8041、登录www.iteye.com 输入用户名,密 ... -
OCP秘笈
2011-03-29 22:19 735http://oracle.chinaitlab.com/Sp ... -
HashCode计算方法
2011-03-29 17:34 966Returns a hash code for this ... -
Merkle-Hellman背包算法
2011-03-23 17:54 1117转自:http://baike.baidu.com/view/ ... -
Android webService访问实例
2011-03-23 13:09 4293参考网上的例子实现一个简单的天气查看功能。 界面包含一个按钮, ... -
Android 源码查看
2011-03-22 14:10 1563在网上看了几个关于源码查看的方法但是都不是很清晰,此文列出 ... -
在Android中解析XML数据
2011-03-21 22:20 976http://www.williamhua.com/2009/ ... -
ANDROID访问WEBSERVICE
2011-03-21 22:10 887http://www.cnblogs.com/dynasty/ ...
相关推荐
RPC,即Remote Procedure Call Protocol,远程过程调用协议,是一种在分布式系统中实现客户端与服务器端通信的技术。这种协议允许一个程序(客户端)在不理解底层网络细节的情况下,调用运行在另一台计算机(服务器...
《轻量级远程过程调用(Lightweight Remote Procedure Call)详解》 在计算机科学领域,分布式系统中的通信机制是至关重要的。其中,轻量级远程过程调用(Lightweight Remote Procedure Call, LRPC)是一种被广泛...
NFS是基于SunRPC(Sun Remote Procedure Call)构建的客户-服务器应用程序,通过RPC请求在客户机和服务器之间进行通信。通常情况下,NFS客户机和服务器功能集成到操作系统中,以提高效率和透明度。客户机通过发送RPC...
SunRPC(Sun Remote Procedure Call)是一种远程过程调用协议,广泛应用于分布式系统中。`/proc/sys/sunrpc`提供了与RPC相关的参数设置。 **2.7 /proc/sys/net - 网络子系统可调参数** `/proc/sys/net`包含了大量...
- **功能**:Sun Remote Procedure Call协议,用于远程过程调用。 - **安全考虑**:存在多种安全漏洞,需加强安全配置。 #### 113端口 (Ident) - **功能**:身份验证服务,用于验证远程用户的身份。 - **安全考虑**...
- **Sun Remote Procedure Call (sunrpc111/tcp, sunrpc111/udp)**:实现远程过程调用的协议。 - **Identification Protocol (auth113/tcp)**:用于身份验证的协议。 - **Network News Transfer Protocol (nntp119/...
- **功能概述**:SUNRPC(Sun Remote Procedure Call)用于远程过程调用。 - **应用场景**:分布式应用程序之间实现远程过程调用。 #### 34. AUTH - 验证和身份识别协议 - **功能概述**:AUTH服务用于认证用户的...
Sun Remote Procedure Call (RPC) Services **描述**:Sun RPC是一组在Unix系统中使用的远程过程调用服务。它们提供了一种简单的方法,使得程序可以在不同的主机之间互相调用。 **端口号**:端口`113`。RPC服务...
sunrpc (Sun Remote Procedure Call) **含义:** Sun远程过程调用。 **用途:** 提供RPC服务,常用于分布式系统中。 #### 113. auth (Authentication Service) **含义:** 认证服务。 **用途:** 提供用户认证功能...
Sun RPC(Remote Procedure Call)是一种远程过程调用协议,最初是为支持客户端-服务器通信在Sun NFS(Network File System)网络文件系统中设计的。Sun RPC有时也被称为ONC(Open Network Computing)RPC。它作为...
RAP协议是基于远程过程调用(Remote Procedure Call,RPC)标准的,该标准是由SUN Microsystems Inc开发的,用于不同系统间进行C过程调用。 1. RAP协议的定义 ABB机器人应用协议(RAP)是一种应用层协议,提供了一...
1. **ONC+技术**:ONC+是一种基于RPC(Remote Procedure Call,远程过程调用)的协议,用于在不同计算机之间提供分布式服务。它包括了对NFS(Network File System)和其他Sun的网络服务的支持,如NIS(Network ...
RPC,即Remote Procedure Call(远程过程调用),是一种在分布式计算环境中进行通信的协议。它允许一台计算机(客户端)通过网络调用另一台计算机(服务器)上的程序,就像调用本地函数一样简单。RPC简化了分布式...
RPC(Remote Procedure Call)是计算机网络中的一种通信协议,它允许一台计算机上的程序调用另一台计算机上的程序,就像调用本地程序一样。在“RPC Sun Network”中,我们主要探讨的是Sun Microsystems(现已被...
ONCRPC,全称Open Network Computing Remote Procedure Call,是一种在分布式计算环境中实现进程间通信(IPC)的技术。它允许不同的计算机程序在不同的操作系统上相互通信,通过定义标准的协议和数据格式,使得应用...
本文介绍了一种名为RPC-DDSF(Remote Procedure Call - Distributed Data Sharing Framework)的分布式数据共享框架,该框架建立在Sun公司的ONC RPC(Open Network Computing Remote Procedure Call)框架基础之上。...
ONC RPC,全称为Open Network Computing Remote Procedure Call,是一种基于Internet协议栈的远程过程调用标准,它允许程序在不同的网络计算机之间进行通信,就像它们在同一台机器上运行一样。这个"ONCRPC.rar_ONC...