The ONC-RPC protocol is a set of standards for remote procedure calls and allows computer programs to communicate over the network. This article will help you to understand ONC-RPC (ONC Remote Procedure Call) programs that transmit information through Wireshark.
ONC-RPC:
In the field of software design, a remote procedure call (RPC) is a way for a computer program to cause a subroutine or procedure to execute in another address space, often on another computer on the same network. Remote Procedure Calls can be communicated over networks using Internet Protocols such as TCP/IP and UDP. These calls are among many low-level Internet protocols referred to as the “TCP/IP stack” which correspond directly with protocols at higher levels of standardization such as HTTP and SMTP. Consequently, RPCs are one form of internet service that can be used over both TCP and UDP; they allow programs running on different computers connected by an IP network, such as the Internet, to communicate with each other.
ONC RPC Processing Flow:
In the early years of the Internet, remote procedure calls were implemented using the Inter-Process Communication protocol, because TCP/IP was not available. This protocol is also known as Microsoft RPC and Sun RPC (and more recently as standard RPC). The basic idea behind this programming model is that a client program invokes one or more functions on a server, which will process the request and deliver results back to the client. ONC RPC Processing Flow is given below:
- The application generates a request PDU and sends it to the server.
- The server processes the request creates a response PDU, and sends it back.
- Now the client’s job is to receive the response from the server, process it, get some data out of it (or perform some other action), and return that value in another PDU to the server for confirmation.
- In this way, RPC can be used as both a client-to-server communication protocol or as a server-to-client protocol.
- The first two steps of each direction are identical; steps 3 and 4 are different depending on which direction one is going in.
The first step in this process is to understand how Wireshark has two different views that can be used for both capturing and analyzing packets, namely:
- The packet list view displays all the packets being sent and received by your device. You can filter out packets with specific criteria, such as TCP or IP addresses or protocol types.
- The packet Details view displays the individual information for each packet that appeared in the packet list.
- After selecting a packet, you can expand several values, such as the number of bytes, protocol type, and other information to analyze details.
- Create the ONC-RPC program: To create an ONC-RPC program, you will need to use a language that supports the CORBA standard and includes a file named “ORB.def” in the program. The ORB.def file contains information about how ONC-RPC will work on a network, including computer system names and addresses. The following table shows the basic parameters that are used to create the ORB.def file. ORB stands for Object Request Broker and is the program that handles calls on a network.
- Create a header file and add methods to it: We can create a header file and add methods, including remote procedures and functions, to that file. The method will execute when called by other programs or executable files. The following shows an example of how an ONC-RPC package is created. The package follows the naming convention “my package name. my package name”. Similar to a function, the parameter name is a path, and it is required. The return value is optional and if you do not include one, it should be 0. The parameter name will start with the first letter of the method, followed by two underscores and another underscore in that order.
- Write your methods: Each method will call another method in the same way that a function calls a method in another function. Each of the methods is wrapped by an ORB object.
Troubleshooting:
If you encounter problems when running the program, make sure that your executable file is in the same folder as previous programs. You also need to make sure that you are calling methods or functions within the same package. For example, if you have created a package called myPackage1 and want to call one of its methods but use a name that was inspired by a different package, it will not work. The reason is that your method will not be able to find it and an error message will display on your screen.
ORB packages can also handle exceptions in your methods by using the method throw ().