Project Report On Data Transmission Using Multitasking Socket
Project Report On Data Transmission Using Multitasking Socket
Project Report On Data Transmission Using Multitasking Socket
Submitted by
Awadhesh Kumar Singh (09EBKIT010)
CERTIFICATE
This is to certify that the work entitled Data Transmission Using Multi-Tasking Sockets is the original work being submitted by Awadhesh Kumar Singh(09EBKIT010) in partial fulfillment for the Degree of B.Tech in Information Technology of the Rajasthan Technical University, Kota. To the best of my knowledge and belief, the candidate has fulfilled the requirements of the rules and regulations relating to the degree in B.Tech. of Rajasthan Technical University, Kota. The matter embodied in this project has not been submitted for the award of any degree of any university.
Date:
College Seal
DECLARATION
I hereby declare that the work, which is being presented in the Project, entitled Data Transmission Using Multi-Tasking Sockets submitted in partial fulfillment of the requirement for the award of Degree of Bachelor of Technology in Department of CS & IT Engineering with Specialization in Information Technology, and submitted to the Department of CS & IT Engineering, B. K. Birla Institute of Engineering and Technology, Pilani, Rajasthan Technical University, Kota is an authentic record of my own investigations carried out under the supervision of Mr. Gopal Krishan Prajapat, Department of CS & IT Engineering, B. K. Birla Institute of Engineering and Technology, Pilani. I have not submitted the matter presented in this project anywhere for the award of any other degree.
Awadhesh Kumar Singh Enrolment No.: 09EBKIT010 B. K. Birla Institute of Engineering and Technology, Pilani. Counter Signed by (Dean- Mr. Shridhar B. Dandin) B. K. Birla Institute of Engineering and Technology, Pilani. (Guide- Mr. Gopal Krishan Prajapat) B. K. Birla Institute of Engineering and Technology, Pilani.
ACKNOWLEDGEMENTS
This work would not been possible, but it is the wealth of experience and acknowledges that is generated within the portals of B. K. Birla Institute of Engineering and Technology, Pilani, which enlightened my path to complete my project. First and foremost I wish to place my profound gratitude and sincere thanks to respected guide Mr. Gopal Krishan Prajapat for his valuable time and tireless efforts without which this work would not have completed on time. I also like to thank Dr. P.S. Bhatnagar (Director, B. K. Birla Institute of Engineering and Technology) and Mr. Shridhar Dandin(Dean CS & IT, B. K. Birla Institute of Engineering and Technology) for providing me with highly motivating and vibrant atmosphere in the college and department. Before bring it to end I would like to add little heartfelt words to my all friends who were part of this project in numerous ways.
Date: 07/01/2013
CONTENTS
CHAPTER
TOPIC
DECLARATION ACKNOWLEDGEMENTS CONTENTS LIST OF FIGURES LIST OF ABBREVATIONS TEAM INFORMATION ABSTRACT
PAGE NO.
3 4 5 7 8 9 10 11 12 12 12 13 13 13 14 14 14 15 15 16 16 16 5
CHAPTER 1
INTRODUCTION 1.1 1.2 1.3 PURPOSE SCOPE & OBJECTIVE EXISTING MODEL
CHAPTER 2
TOOLS & ENVIRONMENT USED 2.1 2.2 SOFTWARE REQUIREMENTS HARDWARE REQUIREMENTS
CHAPTER 3
ANALYSIS & DESIGN DOCUMENT 3.1 3.1.1 3.1.2 3.1.3 3.2 3.3 3.3.1 FEASIBILITY STUDY ECONOMIC FEASIBILITY TECHNICAL FEASIBILITY BEHAVIOURAL FEASIBILITY FUNCTIONAL DESCRIPTION MODULE CLASSIFICATION CLIENT BASED MODULE
3.3.2 3.4 3.5 3.6 3.7 3.7.1 3.7.2 3.8 CHAPTER 4 CHAPTER 5 CHAPTER 6
SERVER BASED MODULE E MAILS CLIENTS OPERATIONS E MAILS SERVERS OPERATIONS E MAIL INBOXS OPERATIONS DIAGRAMS DATA FLOW DIAGRAMS UML DIAGRAMS SNAPSHOTS
16 17 17 18 19 19 21 25 29 30 31 32 33 34
CONCLUSION LIMITATION OF THE PROJECT FUTURE SCOPE & APPLICATIONS REFERENCES GLOSSARY APPENDIX
LIST OF FIGURES
DFD Level 1(Interaction b/w client & server) DFD Level 2(Architecture for functionality of Java Mail in LAN) DFD Level 3 Class Diagram for Java Mail Use Case Diagram for client module Use Case Diagram for Storage Module Use Case Diagram for Client Module Use Case Diagram for Server Module Use Case Diagram for Sending/Receiving Module
LIST OF ABBREVIATION
TCP: Transmission Control Protocol. UDP: User Datagram Protocol. JDK: Java Development Tool Kit. IDE: Integrated Development Environment.
TEAM INFORMATION
AKANKSHA JANGIR Information & Technology 09EBKIT002 B. K. Birla Institute of Engineering and Technology, Pilani. AWADHESH KUMAR SINGH Information & Technology 09EBKIT010 B. K. Birla Institute of Engineering and Technology, Pilani. KAVITA CHOUHAN Information & Technology 09EBKIT022 B. K. Birla Institute of Engineering and Technology, Pilani.
ABSTRACT
In yesteryears Computer Science Engineering has entered a new phase where the characteristics of various platforms have been combined together to yield a new platform compatible with each and every working application which are characterized and controlled at a huge scale by the developers. Nowadays portable applications have been built which can run on similar environments or different after modifying them to some extent. This Project a new socket class which supports both TCP and UDP communication, but it provides some advantages compared to other classes that you may find here or on some other Socket Programming articles. First of all, this class doesnt have any limitation like the need to provide a window handle to be used. This limitation is bad if all you want is a simple console application. So this library doesnt have such a limitation. It also provides threading support automatically for you, which handles the socket connection and disconnection to a peer. It also features some options not yet found in any socket classes that I have seen so far. It supports both client and server sockets. A server socket can be referred as to a socket that can accept many connections. This document is meant for describing all the features and procedures that were followed while developing the system. This document specially mentions the details of the project how it will be developed, the primary requirements, as well as various features and functionalities of the project and the procedures which will be followed in achieving these objectives.
10
Chapter-1
INTRODUCTION
This article is about a client/server multi-threaded socket class. The thread is optional since the developer is still responsible to decide if needs it. There are other Socket classes here and other places over the Internet but none of them can provide feedback (event detection) to your application like this one does. It provides you with the following events detection: connection established, connection dropped, connection failed and data reception (including 0 byte packet). Data transmission, digital transmission, or digital communications is the physical transfer of data (a digital bit stream) over a point-to-point or point-to-multipoint communication channel. Examples of such channels are copper wires, optical fibers, wireless communication channels, and storage media. The data is represented as an electromagnetic signal, such as an electrical voltage, radio wave, microwave, or infrared signal. While analog communications is the transfer of continuously varying information signal, digital communications is the transfer of discrete messages. The messages are either represented by a sequence of pulses by means of a line code (baseband transmission), or by a limited set of continuously varying wave forms (pass band transmission), using a digital modulation method. The pass band modulation and corresponding demodulation (also known as detection) is carried out by modem equipment. According to the most common definition of digital signal, both baseband and pass band signals representing bit-streams are considered as digital transmission, while an alternative definition only considers the baseband signal as digital, and pass band transmission of digital data as a form of digital-to-analog conversion. Data transmitted may be digital messages originating from a data source, for example a computer or a keyboard. It may also be an analog signal such as a phone call or a video signal, digitized into a bit-stream for example using pulse-code modulation (PCM) or more advanced source coding (analog-to-digital conversion and data compression) schemes. This source coding and decoding is carried out by codec equipment.
11
3.8.
Purpose
This document describes the capabilities that will be provided by the software applications Data Transmission Using Sockets. Its purpose is to send the information from one place to another using through a secured interface. These programs use sockets to create the connection between the sender and the receiver. Special protocols like TCP and UDP are used to send the data through requests and acknowledgements. 1.2 Scope and objective A Data Transmission Application is a software application which enables a user to send and interact with other users and also to send information in the form of text, images and other information typically located on a local system within the LAN. Text and images are send as attachments to the receiver where on the other side the receiver opens the attachments and gets the information send by the sender in the safer manner. This model allows a user to quickly send the small amount of information or data within the secured LAN.
1.3 Existing Model We have many number of secure data transmission methods out of which data transmission using sockets is one of the best opted methods for the secured data transmission within a LAN. This existing model uses the TCP/IP protocols to connect the both sender and the receiver locations. .
12
1) Language 2) Platform
3) Client
4) Server
5) IDE
3) Processor Speed
13
Chapter-3
14
In present system assessing students answers is a very time consuming activity that makes teachers cut down the time they can allocate to other duties. It is considered to play a fundamental role in the educational process. If it is developed in the electronic system like computer then the burden on the teachers can be reduced. No need to waste the time. Using out tool results will come within fraction of a second. The decision making becomes easy. 3.1.2 TECHNICAL FEASIBILITY Evaluating the technical feasibility is the trickiest part of a feasibility study. This is because, at this point in time, not too many detailed design of the system, making it difficult to access issues like performance, costs on (on account of the kind of technology to be deployed). A number of issues have to be considered while doing a technical analysis: Understanding the different technologies involved in the proposed system before commencing the project. It should be very clear about what are the technologies that are to be required for the development of the new system. Finding out whether the organization currently possesses the required technologies. Our new web browser software is installed in any local system. So, it is necessary to install the primary software requirements prior to it. One major advantage in application is platform neutral. We can deploy and use it in any operating system since this browser works in Windows and Linux platforms as well. 3.1.3 BEHAVIORAL FEASIBILITY People are inherently resistant to change and computer has been known to facilitate changes. An estimate should be made of how strong the user is likely to move towards the development of computerized system. This software lets the owner of the desktop only to use it or say the user of the desktop can only use this software. This ensures proper authentication and authorization and no much security required as there is no data which can be corrupted.
15
3.2 FUNCTIONAL DESCRIPTION Transmitting Message and Files between Client and Server. The data will be valid until the Server is Valid. Everything defined as Object oriented. Server has been developed using Server Socket programming in Java. Client has been developed using Socket Programming. Transmitting data between Client and Server has been developed IP Address. We are running it as Server Client in PC itself. We can convert it to internet server and client processing by Implementing POP3 protocol and SMTP server. Because of Object Oriented Technology it is very easy to convert. We have Used Data file to store username and password. Usage of Sql Server will not be needed for sending Messages and attachments.
3.3 MODULE CLASSIFICATION 3.3.1 Client based: Email Client ( ) Email ( ) (maintenance) User ( ) 3.3.2 Server based: EmailServer ( ) Inbox: InboxList( ) RecipientList( ) Design view: FontChange( ) 16
MainFunctionmenuGUI( ) MainLoginmenuGUI( ) ReadMailWindowGUI( ) SendMailWindowGUI( ) ViewGraphicsAttachments( ) ViewMediaAttachments( ) ViewtextAttachments ( ) 3.4 OPERATIONS INVOLVED IN E MAIL CLIENTS EMail Clients: This is the module which Handles Client events as follows , Interacting with Login menu GUI of Design view. Getting User name from server. Sending undeleted mail back to server for storage. Setting up Client Data Storage. Shut down the server when finished. Delete mail from Inbox. Send inbox item to server for storage while exit. Create a copy of Inbox backup for UnDeletion.
3.5 OPERATIONS INVOLVED IN E MAIL SERVER 3.5.1 EMail Server : Create new instance of server storage vectors Create new instance of server GUI to display messages Starts the server 17
Set up socket to accept connections Accept new client Update server window details Run indefinitely Starts up the server in the correct manner Extract information for server from files Read object from file and add to server vector Gets a vector of emails from persistent storage Set up file input stream from persistent server file Read object from file and add to server vector Display message and close stream Output server information to persistent storage Sends all server usernames to file Set up new file output stream Update server message window Send all server mail to a file
18
Open email in new mail window Delete mail from mail vector Display message to user Retrieve the backup inbox from client Display message to user Updates the content of the inbox list If mail is unread create different description Set inbox window to description of mail
3.7 DIAGRAMS
3.7.1 Data flow Diagrams:
Client
Server
19
Client 3
20
Fig 3: DFD3: Step wise functions of a Java Mail from initial step to the final step 3.7.2 UML Diagrams Class Diagram A class is a set of objects that share same attributes, operations. Graphically a class is represented as a rectangle, including its name, attributes, and operations. A class diagram shows a set of classes and the relationships among them. Class Diagram for Java Mail
EMailClient inbox : Vector PORT : int host : InetAddress addMail() addUser() getMail() getName() getUserNames() deleteMail() deleteAll()
EMailServer userNames : Vector PORT : int getUser() addMail() addUser() getEmail() readInMailFromServerFile() readInUserNamesFromServerFile() deleteMail() LoginMenu login : JButton login()
21
Use Case Diagrams Use Case diagrams shows a set of use cases and actors and their relationships. These diagrams illustrate the static use case view of a system and are important in organizing and modeling the behaviors of a system.
Actor
Use Case
Request Server
Client
Server
Inbox
Accesing Mails
22
Fig 6: Case Diagram For Login Module Usecase diagram 1: This diagram illustrates the Login Module, thereby the actions performed between the Client and Server. Initially the Client requests the Server and Client gets login with desired username and password, therby access the mails from the Inbox. Use Case Diagram for Storage Module:
Usernames
Read Mails
Client
Unread Mails
Storage Manager
Attachments
Fig 7: Case Diagram For Storage Module Usecase diagram 2: This diagram illustrates the Storage Module. The 23sernames are saved in Usernames.dat and the mails are saved in Mail.dat. We can save all the attachments in our memory by downloading into our system.
23
Client
Login
Server
Accesing Mails
Client 1
Client 2
Login
Server
Client 3
24
Usecase diagram 4: This diagram illustrates the Server Module. This module integrates with all the clients present in the LAN. This module also facilitates the clients to interact with each other. Use Case Diagram for Sending/Receiving Module:
Login
Server
Client 1
Read Mails
Client 2
Received Mails
Fig 10: Case Diagram for Sending/Receiving Module Usecase diagram 5: This diagram illustrates the Client Module. This module uses the client/server method which integrates all the clients and server. The clients who are connected within the LAN can interact with each other and perform respective functions related to mailing.
25
3.8 SNAPSHOTS 3.8.1 This is Email system Login menu used by clients.
26
Chapter-4 29
CONCLUSIONS
1. Based on this project myself can conclude that the data transmission using sockets within a LAN enables the local users to exchange the data more conveniently. 2. This project can be enhanced with more functionality like virus checking, spasms, trash etc. The future enhancements may include more secure encryption and decryption of data being sent and received. 3. The use of socket programming enables the secure paths for the data to travel between authorized sender and receiver hence providing the security to greater extent.
30
Chapter-5
The main limitation of this project is that the end user must be connected to a secured LAN within his/her organization/institution.
To run the project safely, there must be installed JMF & JDK in the system.
31
Chapter-6
The working model will be shown in the near future. Using data transmission by sockets both sender and receiver can exchange data from one point to another without their physical displacement.
This project finds its own importance within a local area network where people from same organization can exchange data pertained to personal organization.
32
REFERENCES
WebSites: http://en.wikipedia.com http://www.google.com Books: Software Engineering-A Practitioners Approach JAVA-The Complete Reference 33
GLOSSARY
Feasibility Study : Feasibility Study is made on the system being developed to analyse whether the system development process require training of personnel.
Data Flow Diagram(DFD): Data Flow Diagrams(DFDs) reveal relationships among and between the various components in a program or system. Technical Feasibility : Technical Feasibility centers on the existing manual system of the test management process and to what extent it can support the support.
34
APPENDIX
Client Based Module
Page No.16
Class Diagram
Page No.21
Snapshots
Page No.25
35
36