Design and Implementation of Client-Server Based

88 downloads 0 Views 245KB Size Report
developing a client server based application using socket programming in a ... Interface design, socket programming style, java classes, and exceptions are also .... http://db.cs.duke.edu/courses/spring06/cps196/slides/sockets.pdf. [Accessed: ...
Design and Implementation of Client-Server Based Application using Socket Programming in a Distributed Computing Environment Rolou Lyn R. Maata FCS, Gulf College Sultanate of Oman [email protected]

Ronald Cordova FCS, Gulf College Sultanate of Oman [email protected]

Abstract—This research study discusses the detail overview in developing a client server based application using socket programming in a distributed computing environment. The researchers developed a client-server based application called OpTel Billing System (OBS) using Java NetBeans and TCP datagram to demonstrate the concepts of socket programming and its communication in a distributed computing. Interface design, socket programming style, java classes, and exceptions are also considered in the development stage. The communications between client server application processes using socket mechanism were mainly analyzed. The main objective of this research study is to demonstrate the principles and concepts behind socket programming as well as the libraries available in Java. In conclusion, socket programming is one of the best method in distributed computing that can improve system’s performance. Keywords—socket programming; environment; client-server based

I.

distributed

computing

INTRODUCTION

Client-server program nowadays is no longer an unfamiliar concept in distributed computing and in computer networks [4]. In fact, the internet up to this date has many client server applications readily available anytime. In client-server model [5], each computer terminal or process on the network could be a client or a server. A “client” is a program or a computer terminal that allows users to access and view its interfaces. Every client communicates and connects with each through server [5]. In an overall concept, client serves as the one who initiates the communication wherein the server is the one who waits passively to respond to the client’s request. On the other hand, a socket is an abstraction which allows program to send and receive data [3]. The most essential characteristic of socket programming that drive programmers to design a program is due to its transparency [3]. It simply means that, whether a socket program is designed and written in Java language, it still has the ability to communicate with other socket program which is designed and written in other programming languages such as C or C++. To demonstrate the principles and concepts of socket programming, the researchers developed an application called OpTel Billing System.

978-1-5090-6621-6/17/$31.00 ©2017 IEEE

Balaji Sudramurthy FCS, Gulf College Sultanate of Oman [email protected] II.

Alrence Halibas FCS, Gulf College Sultanate of Oman [email protected]

LITERATURE REVIEW

This research study is supported by concepts and principles used in socket programming in a distributed computing environment. A. Client Server Communication

Fig 1: Client Server Communication Fig 1 shown above describes the use of client server model based on its request – reply protocol. In this model, the client directly sends his request to the server asking for an appropriate service, and later server does the work and returns immediately the data or error code as a response back to the client. The server offers various services to the clients based on its client’s request [6]. B. Sockets and Socket Programming In distributed computing environment, client server application (consist of client program and server program) can be designed using socket programming. Socket [13] is a twoway communication link between client and server programs that are running in a network environment. It has an effective communication mechanism between two computers. In Java programming, socket classes are used to represent connections between the client and the server [8]. Java provides two classes for this purpose: Socket and the ServerSocket. These sockets connect two programs and implement two sides of the program (client and server). The client server program allows user to run the client software to create a query. The client connects and sends query to the identified server through the use of socket (client

2017 IEEE International Conference on Computational Intelligence and Computing Research

side). The server once received the request from the client analyzes the query and sends the result directly to the client. f. C. Communication Protocol There are two communication protocols that are commonly used in socket programming, the datagram communication and stream communication [14]. The datagram communication protocol is popularly known as UDP (user datagram protocol) is considered a connectionless protocol. This means that every time the client sends datagram, it also requires them to send the local socket descriptor as well as the receiving socket’s address. However, the stream communication protocol, popularly known as TCP (transfer control protocol) is a connection-oriented protocol. This means that in order to establish communication over this type of protocol, a connection must be established first between two identified sockets [14]. One socket listens for a connection request (main responsibility of the server) and the other socket asks for a connection (main responsibility of the client) in order to establish connections. Once they have already established the connection, it can be used to transmit data in both directions [4].

III.

the requests coming from the client and maintains customers’ account information; and The application requires log-in and password for security purposes.

B. InterfaceDesign

Fig 2: Client Server Application creates OBS Project with Java Packages Fig 2 demonstrates the programming style used in the development of OBS client and server programs. The researchers used one project with two java classes namely: OBSClient and OBSServer. In this case, two programs were linked together to come up with functional application that meet specific objectives of the research.

METHODOLOGY

The application was designed using socket programming in Java NetBeans supported by TCP datagram. The client server based application has many functions. The two programs (client and server) were simulated, demonstrated and analyzed. A. Application Concepts This research study used a specific scenario in designing the client server application in order to demonstrate the proper implementation of socket programming. The researchers designed and implement a client server based application run in a distributed computing environment called “OpTel Billing Service (OBS)”. This application implements communication between a client and a server. Further, the application involves only one client and one server; with the following requirements: a. The client sends enquiries to the server; b. The server executes the commands and displays whatever the server sends back to the client; c. The OBS application is a standard application available in all OpTel branches wherein the customer can enquire about their bills; d. The application must be able to handle multi-users access on the client side; e. A distributed application OpTel Billing System (OBS) enables a client (customer) to send request to the server (OpTel machine). The server manages all

Fig 3: Authentication Access Fig 3 illustrates the authentication procedure of the application whereas it require users to perform authentication access in order for them to access.

Fig 4: Established connections with the use of temporary ports assigned

2017 IEEE International Conference on Computational Intelligence and Computing Research

Fig 4 demonstrate how the two programs is connected through sockets with the use of port. The two programs were successfully connected using the port 7777. The ports of two programs are essential as it

statement in the selection of the main menu, IOException | ClassNotFoundException, ObjectInputStream, ObjectOutputStream,Util.Scanner were also used to complete the application.

C. Main User Interface

Fig 5: Main User Interface of the OBS application Fig 5 demonstrates the main user interface of an application. The interface includes labels that increase the usability and user-friendliness of the application. D. Socket Programming Style

Fig 6: OBS Programming Style Fig 6 illustrates the programming style used in developing the OBS application. During the simulation and demonstration stage, OBS programs used classes, interfaces, exceptions, InetAddress, Socket, ServerSocket. However, switch

IV.

CONCLUSION AND FUTURE WORK

This research study presents the overview and the detail implementation of the OBS application using socket programming method. In the development of this study, we have chosen Java NetBeans programming language as it covers a wide range of functions and classes. In addition, researchers found out that programming style, concepts, functions, datagram and socket programming are easily done in Java programming language. The designed application is used to simulate scenario and able to illustrate the use of socket programming and how it works in the real-world environment. Thus, the researchers would like to recommend that the application can be designed in an object oriented approach and environment for future enhancement and further improvement. Other functionalities can also be embedded and integrated in order to design a newly updated version of this application in the future. REFERENCES D. Lowe, “Java All-in-one for Dummies 5th edition”, John Wiley & Sons, Inc. USA, 2017 [2] S. Shin, D. Yoon, H. Song, B. Kim, J. Han, “Communication System of a Segmented Rescue Robot Utilizing socket programming and ROS”, IEEE 14th International Conference on Ubiquitous Robots and Ambient Intelligence (URAI), South Korea, July 2017 [3] M. Al Yemem, “Voice Chat Application using Socket Programming:, European Academic Research, Vol. 2 Issue 8, August 2014. [4] T. Duong-Ba, T. Nguyen, B. Rose, D. Tan “Distributed Client Server Assignment for Computing, Volume 2, Issue 4, pp. 422 – 435, December 2014 [5] Z. Yuqing, W. Wu, D. Li, “Efficient Client Assignment for ClientServer Systems”, IEEE Transactions on Network and Service Management, Vol. 13 Issue 4, pp. 835-847, August 2016. [6] Xue, M. and Zhu, C. , “The Socket Programming and Software Design for Communication Based on Client/Server”,” 2009 Pacific-Asia Conference on Circuits, Communications and Systems, pp. 774-777, 2009 [7] M. Malik, Y. Ali, “Java Socket Programming: From Theory to Practice”, CreateSpace Independent Publishing, pp. 8-15, December 2014. [8] K. Calvert, M. Donahoo, “TCP/IP Sockets in Java: Practical Guide for Programmers 2nd edition”, Morgan Kaufmann, pp. 15-50 USA 2008 [9] P. Ashishkumar, P. Barkha, “Implementation of DNA cryptography in cloud computing and using socket programming”, 2016 International Conference on Computer Communication and Informatics, pp. 9-15, India, January 2016 [10] A. Jitbanyud, N. Toadithep, “The system of powerful computer laboratory class via socket program”, 2010 3rd IEEE International Conference on Computer Science and Information Technology, pp. 638 – 641 China, July 2010 [11] M. Xue, C. Zhu, “The Socket Programmiing and Software Design for Communication Based on Client/Server”, IEEE Pacific-Asia Conference on Circuits, Communications and Systems, pp. 775-777, China, May 2009. [12] O. Ayurzana, Y. Park, J. Kwon, H. Kim, “Development of Telemetering System of Water Supply using the RF module and TCP/IP socket [1]

2017 IEEE International Conference on Computational Intelligence and Computing Research Program”, IEEE 2006 SICE-ICASE International Joint Conference, pp. 3744-3746, South Korea [13] J. McManis, S. Hashmi, M Ahsan, and J. Haider, “Developing Intelligent Software Interface for Wireless Monitoring of Vehicle Speed and Management of Associated Data”, IET Wireless Sensor Systems, 2016. [14] IDG Communications (2017). Sockets Programming in Java World from IDG. [Online]. Available at: https://www.javaworld.com / article /

2077322/core-java/core-java-sockets-programming-in-java-atutorial.html. [Accessed 17-July-2017] [15] “Socket Programming in .NET”, Springer”, [Online] Available: https://link.springer.com/chapter/10.1007/978-1-4302-0660-6_4 [Accessed: 17-July-2017]

[16] Jeff, C. “Sockets and Client-Server Communication”, Duke University, [Online] Available: http://db.cs.duke.edu/courses/spring06/cps196/slides/sockets.pdf [Accessed: 02-May-2017]