Вы находитесь на странице: 1из 73

CHAPTER 1 INTRODUCTION

A Congestion Control algorithm for Tree Based reliable Multicast Protocols is a collection of nodes that are dynamically and arbitrarily located in such a manner that the interconnections between nodes are capable of changing on a continual basis. Multicasting is to send single copy of a packet to all of those of clients that requested it, and not to send multiple copies of a packet over the same portion of the network, nor to send packets to clients who dont want it. Approach of this Tree-based reliable multicasting protocol (TRAM) is it resends the pending data packets to the receiver if any congestion in the actual path occurs. Pending Packets starts from the node where it was previously stored and that node becomes the CORE node Objective Statement The problems of the present systems were considered. The scope of the project is identified. Scope The scope of the project involves capturing all work request information handled by the project team. The congestion control algorithm for tree-based reliable multicast algorithm provides confirmed data transmission. The following are the main advantages of this project over previously proposed algorithm. It supports bulk data transfer with single and multiple receivers. It includes Flow control and congestion control. It uses dynamic tree structure for transmission. It is simple and fast
1

CHAPTER 2 SYSTEM ANALYSIS


The analysis was done conducting various interviews and fact-finding sessions with the staff. The system analysis takes care of the detailed study of the system and the limitations. Finally, a report is generated that forms the basis to draw the design phase and other modules to be processed. In process of selecting a new system, the effort was made, To analyze the existing system and identify the problem. To make a thorough working model of the solution proposed

To submit working model, the study phase program in stages like problem identification, fact-finding techniques, research and feasibility analysis etc.

To submit a study phase report to the management, requesting their approval before proceeding into the development stages.

The study phase activities were done with the help of the guide, who gave valuable information and cooperation. The study phase activity findings were documented. 2.1 Existing system 2.1.1 System Overview At present, the congestion control algorithm had been implemented using the traditional protocol. That protocol was designed in such a way that the data transfer was done in a congested network, which yielded in data loss and retransmission of data packets from the source to destination. No provision was made to collect the client side details for transmission, No provision was made to collect the server capacity.
2

2.1.2 System Description The existing system will face the following problems that should be focused while developing the new system. At present, the data transmission was made through congested network. Too hard to pass the data from source to destination. The congested network will be yielding bulk data loss and thus need for retransmission. Since re-transmission is needed the time limit for certain packets may get lost, hence the transmission may be terminated. 2.2 Proposed System The scope of the project is to have the tree based structure of network. Those network are arranged in such a way that they can modify their positions dynamically. Since the network scenario is dynamic, the connection establishment made easy from source to destination. Before starting the data transfer the details regarding the clients are captured and also the server details (i.e., Server capacity, IP address) are gathered to initiate the transmission. The security of the project is assured by using the highly probable security algorithm, which includes encryption and decryption of messages for safer transmission from source to destination. Approach of this Tree-based reliable multicasting protocol (TRAM) is, it resends the pending data packets to the receiver if any congestion in the actual path occurs.
3

Pending Packets starts from the node where it was previously stored and that node becomes the CORE node. This TRAM consists of two protocols namely, Proactive Protocol These algorithms maintain a route to the destination much like the traditional fixed networks. Reactive Protocol As the name suggests these types of algorithm try to evolve the route to the destination only when they need it to transmit a data packet to the destination. Necessary algorithm is used then and there to heighten the efficiency of the overall project and make it effective in all kind of situations. The authorization of the users has been checked initially before the actual process starts. The TRAM protocol do not have any overhead while transferring of data packets, this may reduce the size of the data packets which in turn makes transmission faster and more effective. The network density is reduced by implementing the congestion control algorithm which intelligently manages all the nodes in this tree based network. An Insight to the proposed system. Identifying and analyzing all the drawbacks of the existing system and reports for the proposed system. Data packets are transferred with less overhead and in short span of time. TRAM protocol finds out the alternate ways of transmission incase failures and critical situations.
4

2.3 Feasibility Study It is necessary to determine whether the proposed system is feasible or not.Every project is feasible if given required resources and enough time. Unfortunately the development of a computer-based system is more likely to be plagued by scarcity of resources and short span of time. It is both necessary and prudent to evaluate the feasibility of the project at the earliest time possible. Precious time and money can be saved and untold professional embarrassment can be averted if an ill-conceived system is recognized early in the definition phase. So a detailed study is carried out to check the workability of the system. Feasibility study is undertaken to evaluate its workability, impact on the organization, ability to meet user needs, and effective use of resources. The main objective of feasibility study is to test the technical, operational and economical feasibility of developing the computer system. Thus, during feasibility analysis for this project the following three primary areas of interest were considered. Technical Feasibility Economical Feasibility Operational Feasibility 2.3.1 Technical Feasibility A study of resource availability may affect the availability to achieve and accept the system. The technical feasibility is frequently the most difficult area to ensure at this stage. Because objective, functions and performance are somewhat hazy, anything seems possible if the right assumptions are made. It is
5

essential that the process of analysis and definitions be conducted in parallel with an assessment of technical feasibility. The technical issues are usually raised during the feasibility stage of the investigation, including the following. Does the necessary technology exist to do what is suggested? Will the proposed system provide adequate response to enquires, regardless of the number of location of users? Can the system be expanded if developed? Does this technique guarantee accuracy, reliability, easy of access and data security? The consideration that is normally associated with technical feasibility includes resources availability of the organization, where the project is to be developed and implemented. By taking these factors into consideration before developing, the resources available are adequate. Thus the project is considered technically feasible for development. 2.3.2 Economic Feasibility A system that can be developed technically and that will be used, if installed, must still be a good investment for the organization. Economic feasibility deals with evaluation of development cost weighted against the ultimate income or benefit derived from the developed system. Financial benefits must equal or exceed the costs. The financial and economic questions raised by analysts during the preliminary investigation are for the purpose of estimating the following. The cost of conducting a full system investigation The cost of hardware and software for the application being considered The benefits in the form of reduced cost or fewer costly errors
6

Economical justification is generally the bottom line consideration for most systems. Economical justification includes a board range of concerns that include cost benefit analysis. Cost benefit analysis delineates costs for project development and weights them against tangible and intangible benefits of a system. 2.3.3 Operational Feasibility Proposed project are beneficial only if they can be turned into information system that will meet the organizations operating requirements. Operational feasibility is a consideration about the working of the system after installation in the company. Simply stated, this system of feasibility asks if the system will work when it is developed and installed. The following are the questions that help the operational feasibility of the project Is there sufficient support for the project from management and users? Have the users been involved in planning and development of the project? Will the proposed system cause harm? Will it produce poor results in any respect or area? Will accessibility of information be lost? Issues that appear to be relatively minor in the beginning have ways of growing in to major problems after implementation. Therefore all operational aspects must be considered carefully. Cases when occurred in this project were transmission of information initiated from the source might have a chance of failing between
7

the nodes. Considering those situations it is essential for us to check or verify whether it is possible to continue the transmission with intermediate nodes even after the failure of those packets. In source cannot make up to destination they have to ensure whether the intermediate nodes are really capable of continuing it especially when packets dont carry any overheads from the source. 2.4 Development Environment 2.4.1 Hardware Requirements PROCESSOR OPERATING SYSTEM MONITOR KEYBOARD AND MOUSE 2.4.2 Software Requirements FRONT - END DESIGN TOOL NETWORKING CONCEPTS PACKETS TRANSFERRING 2.4.3 About the Software In my project, I have chosen Java language for developing the code. SWINGS What Is Swing? Swing advertised as a set of customizable graphical components whose look-and-feel can be dictated at runtime. In reality, however, Swing is much more than this.
8

: Pentium IV 1.8 GHz : Windows Professional Edition : 14 LG Color : USB Keyboard and mouse

: Java Swing. : Sockets. : I/O Concepts, Threads.

Swing is the next-generation GUI toolkit that Sun Microsystems is developing to enable enterprise development in Java. By enterprise development, we mean that programmers can use Swing to create large-scale Java applications with a wide array of powerful components. In addition, you can easily extend or modify these components to control their appearance and behavior. Swing is not an acronym. The name represents the collaborative choice of its designers when the project was kicked off in late 1996. Swing is actually part of a larger family of Java products known as the Java Foundation Classes (JFC), which incorporate many of the features of Netscape's Internet Foundation Classes (IFC), as well as design aspects from IBM's Talent division and Lighthouse Design. Swing has been in active development since the beta period of the Java Development Kit (JDK) 1.1, circa spring of 1997. The Swing APIs entered beta in the latter half of 1997 and their initial release was in March of 1998. When released, the Swing 1.0 libraries contained nearly 250 classes and 80 interfaces. Although Swing was developed separately from the core Java Development Kit, it does require at least JDK 1.1.5 to run. Swing builds on the event model introduced in the 1.1 series of JDKs; you cannot use the Swing libraries with the older JDK 1.0.2. In addition, you must have a Java1.1-enabled browser to support Swing applets. AWT The Abstract Window Toolkit is the basic GUI toolkit shipped with all versions of the Java Development Kit. While Swing does not reuse any of the
9

older AWT components, it does build off of the lightweight component facilities introduced in AWT 1.1. Pluggable Look-and-Feels One of the most exciting aspects of the Swing classes is the ability to dictate the Look-and-feel (L&F) of each of the components, even resetting the look-and-feel at runtime. Look-and-feels have become an important issue in GUI development over the past five years. Most users are familiar with the Motif style of user interface, which was common in Windows 3.1 and is still in wide use on Unix platforms. Microsoft has since deviated from that standard with a much more optimized look-and-feel in their Windows 95/98 and NT 4.0 operating systems. In addition, the Macintosh computer system has its own branded look-and-feel, which most Apple users feel comfortable with. Java Swing OReilly Lightweight Components Most Swing components are lightweight. In the purest sense, this means that components are not dependent on native peers to render themselves. Instead, they use simplified graphics primitives to paint themselves on the screen and can even allow portions to be transparent. The ability to create lightweight components first emerged in JDK 1.1, although the majority of AWT components did not take advantage of it. Prior to that, Java programmers had no choice but to subclass java.awt.Canvas or java.awt.Panel if they wished to create their own components. With both classes, Java allocated an opaque peer object from the underlying operating system to represent the component, forcing each component to behave as if it were its own window, taking on a rectangular, solid shape. Hence, these components earned the name "heavyweight," because they frequently held extra baggage at the native level that Java did not use.
10

ADDITIONAL FEATURES Several other features distinguish Swing from the older AWT components: A wide variety of new components, such as tables, trees, sliders, progress bars, internal frames, and text components. Swing components contain support for replacing their insets with an arbitrary number of concentric borders. Swing components can have ToolTips placed over them. A ToolTip is a textual popup that momentarily appears when the mouse cursor rests inside the component's painting region. ToolTips can be used to give more information about the component in question. You can arbitrarily bind keyboard events to components, defining how they will react to various keystrokes under given conditions. There is additional debugging support for the rendering of your own lightweight Swing components. Swing Packages Here is a short description of each package in the Swing libraries. Javax.accessibility Contains classes and interfaces that can be used to allow assertive technologies to interact with Swing components. Assertive technologies cover a broad range of items, from audible text readers to screen magnification. Although the accessibility classes are technically not part of Swing, they are used extensively throughout the Swing components. Javax.swing Contains the core Swing components, including most of the model interfaces and support Classes. Javax.swing.border: Contains the definitions for the abstract border class as well as eight predefined borders. Borders are not components; instead, they are special graphical elements that Swing treats as properties and places around components in place of their insets. If you wish to create your own

11

border, you can subclass one of the existing borders in this package, or you can code a new one from scratch. javax.swing.colorchooser: Contains support for the JColorChooser component.event defines several new listeners and events that Swing components use to communicate asynchronous information between classes. To create your own events, you can subclass various events in this package or write your own event class. Javax.swing.filechooser Contains support for the JFileChooser

component, Javax.swing.pending Contains an assortment of components that aren't ready for prime time, but may be in the future. Play here at your own risk. The contents of the pending package aren't discussed in this book. Javax.swing.plaf: Defines the unique elements that make up the

pluggable look-and-feel for each Swing component. Its various sub packages are devoted to rendering the individual look-and-feels for each component on a platform-by-platform basis. (Concrete implementations of the Windows and Motif L&Fs are in subpackages of com.sun.java.swing.plaf.) Javax.swing.table: Provides models and views for the table component. The table component allows you to arrange various information in a grid-based format with an appearance similar to a spreadsheet. Using the lower-level classes, you can manipulate how tables are viewed and selected, as well as how they display their information in each cell. Javax.swing.text: Provides scores of text-based classes and interfaces supporting a common design known as Document/view.

12

Javax.swing.text.html: Used specifically for reading and formatting HTML text through an ancillary editor kit. The Model-View-Controller Architecture Swing uses the model-view-controller architecture (MVC) as the fundamental design behind each of its components. Essentially, MVC breaks GUI components into three elements. Each of these elements plays a crucial role in how the component behaves. Model The model encompasses the state data for each component. There are different models for different types of components. For example, the model of a scrollbar component might contain information about the current position of its adjustable "thumb," its minimum and maximum values, and the thumb's width (relative to the range of values). A menu, on the other hand, may simply contain a list of the menu items the user can select from. Note that this information remains the same no matter how the component is painted on the screen; Model data always exists independent of the component's visual representation. View The view refers to how you see the component on the screen. For a good example of how views can differ, look at an application window on two different GUI platforms. Almost all window frames will have a title bar spanning the top of the window. However, the title bar may have a close box on the left side (like the older MacOS platform), or it may have the close box on the right side (as in the Windows 95 platform). These are examples of different types of views for the same window object.

13

Controller The controller is the portion of the user interface that dictates how the component interacts with events. Events come in many forms a mouse click, gaining or losing focus, a keyboard event that triggers a specific menu command, or even a directive to repaint part of the screen. The controller decides how each component will react to the eventif it reacts at all.

FIG 2.1: Model View Controller

Internal Frame Features of an internal frame: Same functions as a normal Frame object, but confined to the visible area of the container it is placed in Can be iconified (icon stays inside main application frame) Can be closed using the standard controls for popup windows Can be placed in a "layer," which dictates how the frame displays itself relative to other internal frames

14

Action Interface An action is defined by the interface it implements, which in this case is javax.swing.Action. Action extends the Action Listener interface from AWT; this forces concrete classes that implement Action to provide an action Performed () method. The programmer uses the action Performed () method to implement whatever behavior is desired. For example, if you are creating a Save action, you want to put the code to save the data inside of your action Performed () method. Events Objects implementing the Action interface must fire a PropertyChangeEvent when any keyed property is changed, or when the action is enabled or disabled. Containers that accept actions typically listen for these PropertyChangeEvent notifications so they can update their own properties or appearances. Action This example creates an Action for both a menu item and a toolbar, displaying both components and allowing the user to click on either one. When the components are clicked, the action Performed () method of the action is called. Don't worry if you don't understand all the methods behind the toolbar or the menu; these classes will be discussed later. For now, it is important to see that selecting either one performs the action.

15

Position, Size, and Alignment You can set and retrieve a Swing component's current position and size on the screen through the bounds property, or more precisely, through the location and size properties of JComponent. The location property is defined as a Point in the parent's coordinate space where the upper-left corner of the component's bounding box resides. The size property is a Dimension that specifies the current width and height of the component. The bounds property is a Rectangle object that gives the same information: it bundles both the location and the size properties. Labels Swing allows you to create labels that can contain text, images, or both. We'll begin this chapter with a look at the JLabel class. The JLabel class allows you to add basic, nonfunctional labels to a user interface. Because of their inherent simplicity, there is no model class for JLabel components. The icon and disabledIcon properties specify the icon to be displayed by default and when the label is disabled respectively. If no disabledIcon is specified, a grayscale version of the default icon is created automatically. Buttons Buttons are simple UI components used to generate events when the user presses them. In AWT, buttons were very basic, able to display only simple text strings. In much the same way as JLabel provided improvements over java.awt.Label, the Swing button classes improve on
16

Java.awt.Button and java.awt.Checkbox by introducing the ability to display icons, text, or both. In this section, we'll introduce both the Button Model interface and DefaultButtonModel class (which define the state of the button). Next, we'll look at the AbstractButton class (which defines much of the functionality for all button types). Finally, we'll look at four concrete subclasses of AbstractButton and see how they can be grouped together using a Button Group. JButton Class JButton is the simplest of the button types, adding very little to what is provided by the AbstractButton class. JButtons are buttons that are not toggled on and off, but instead act as "push" buttons, which perform some action when clicked. JCheckBox Class The look-and-feels for the JCheckBox JToggleButton typically used to allow the user to turn a given feature on or off, or to make multiple selections from a set of choices. Showing a small box into which a check is placed when selected checkbox, this icon replaces the default box usually renders a JCheckBox. Therefore, if you choose to specify an icon, you should always also supply a selected icon otherwise, there will be no way to tell if a check box has been selected or not. Lists A list is a graphical component from which the user can select choices. Lists typically display several items at a time, allowing the user to make either a single selection or multiple selections. In the event that the inventory of the list
17

exceeds the component's display, the list is often coupled with a scrollbar to navigate through the entire contents. AWT limited the contents of its List component to strings. The Swing JList component lifts this restriction. List elements can now be strings, images any Java component capable of painting itself. Swing offers a wide degree of flexibility with list components; they can be as simple or as programmer's needs dictate. Combo Boxes A combo box component is actually a combination of a Swing list (embedded in a popup window) and a text field. Because combo boxes contain a list inside of them, many of the classes you read about previously with lists are used here as well. Unlike lists, a combo box only allows the user one selection at a time, which is usually copied into an editable component at the top, such as a text field. The user can be permitted, however, to manually enter in a selection as well. JFrame Class The most common Swing container for Java applications is the JFrame. Like java.awt.Frame, JFrame provides a top-level window with a title, border, and other platform-specific adornments (e.g., minimize, maximize, and close buttons). Because it uses a JRootPane as its only child, working with a JFrame is slightly different than working with an AWT Frame Constructors public JFrame () Creates a new unnamed, invisible frame.
18

complex as the

ScrollPaneLayout
The JScrollPane class is actually just a panel with a hard-working layout manager and some convenient access methods for the manager. While you probably will not use this class on its own, he ScrollPaneLayout class is the manager that provides layout control for the nine areas of a JScrollPane object: View port Row header Column header Vertical scrollbar Horizontal scrollbar Four corners (upper left, upper right, lower left, and lower right) Menus and Toolbars This chapter discusses Swing menus and toolbars. Menus are by far the larger and more extensible of the two, so they encompass most of the chapter. Swing offers the programmer a fully reimplementation menu system from AWT 1.1. This re-engineering allows you to use the Swing menus in a variety of eye-catching ways, and provides much more freedom to layout menu components. Toolbars are a new addition to Swing. Toolbars allow the programmer to group buttons, combo boxes, and other components together in reposition able panels; these tools can assist the user in performing many common tasks. You can add any component to a Swing toolbar, even non-Swing. Swing Menus If you've worked with menus before, you know that one of the most frustrating issues with AWT is that almost all of its menu components extend the abstract java.awt.MenuComponent class. This is an awkward design, as the remaining AWT components extend the more versatile java.awt.Component class. Consequently, menu components are divorced from regular components in AWT, since subclasses of Menu Component can perform only a fraction of the others' functionality.

19

In addition, AWT programmers are locked into placing a single menu bar at the top of each Frame and cannot position menu components in containers using layout managers. With Swing, this hierarchy has been redesigned. Menu components are now subclasses of JComponent. Consequently, they now have all the benefits of a true Swing component, and you can treat them as such with respect to layout managers and containers. Here are some other notable additions to the Swing menu system: Icons can augment or replace menu items a radio-button menu item Keyboard accelerators can be assigned to menu items that appear next to the menu item text most standard Swing components can be used as menu items

CHAPTER - 3 SYSTEM DESIGN


3.1 Input Design
The input is that set of values that is provided by the user to the system. The process of input design is the process of converting user input to system understandable form by careful design of the input screens. This input design must enable the user to provide the error free input for the system to process efficiently. In this proposed work inputs should be more consciously verified, Usually we get port numbers for every client that starts along with the ipaddress of their systems and then the messages or files to be transmitted. Here six port numbers are to be received were only 3 port numbers are enough to be started and those 3 ipaddress will be provided. We can also see the simultaneous transmission through that 3 ports which has been started and it also indicate the failures of intermediate nodes if the message happens to travel though that nodes.

3.2 Output Design


20

The output is the set of values that enables the users to identify the result of each processing of the developed system .Outputs are the computational result that is presented to the users by the system. The system generates the simultaneous output of the path of the message transmission and reception of messages in the destination in the form of file and it is saved in the destination system with new name. The goals of the output design is that, The output must be the desired one for the user. The output must be free of errors.

3.3 UML Diagrams


Each UML diagram is designed to let developers and customers view a software systems from different perspective and in varying degrees of abstraction. UML diagrams commonly created in visiual model tools include The usecase diagram displays the relationship among actors and use cases. The class diagram models class structure and contents using design elements such as classes packages and objects. The sequence diagram displays the time sequence of the object participating in interaction. Vertical dimension Time, Horizontal dimension Different objects.

3.3.1 Use case diagram

21

Login Make Data Packets Identify Destination Decide Path source


FIG 3.1 : Use Case Packets Send diagram

Destination

Receive Packets Logout


3.3.2 Sequence diagram

22

Source
Login

Intermediate Nodes

Destination

Identify Destination Select Path Send Data


Selects different path (if failed)
FIG 3.2: Sequence Diagram

Retransmits Data Receives Data

Transmission Completes

3.3.3 Collaboration diagram 23

4. successfully received on node 1 1.Selects Destination 2. Make Data packets 3. Select path 4. Send data packets

Node 1
5. Data traveling from node1 to node 2 7. Node 2 not started Transmission failure

SOURCE :
8. packets redirected to node n

Node 2

Node2 failed

: Node n
9. data received successfully 10. transmitted to destination

11. Received successfully to destination

DESTINATION

FIG 3.3: Collobaration Diagram

3.3.4 Activity diagram 24

Enter username & password

Send message/file

Vali d Yes

no
Exit

Message transmission through tree nodes

Create Tree nodes

Detect node failures in the selected path

Browse file or type Message Select path among treenodes Take alternate path among other tree nodes

Encrypt message/file for transmission

Decrypt message after safe reception

Enter server port

Receive acknowledgement on reception

Enter destination ipaddress

Yes
Go to beginning

Continue ?

No
Exit

FIG 3.4: Activity Diagram

25

3.3.5 Class diagram

SOURCE Username & password Ipaddress and port number getAddress( ) getPort( ) sendMessage( )

Node 1 Ipaddress port number getPort( ) recieveMessage( )

Node 2 Ipaddress port number getPort( ) recieveMessage( )

Node N Ipaddress port number core node getPort( ) recieveMessage( ) newcore( )

DESTINATION Ipaddress & port number file message getPort( ) recieveMessage( ) openfile( )

FIG 3.5: Class Diagram

26

3.4 System Flow Diagram

Start

Congestion Control Algorith m

For ward Data Through the links

Stop

FIG 3.6: System Flow diagram

3.5 Dataflow Diagram


27

Source Login

Valid Decide the Path Send Packets


Time-out successful

FIG 3.7: Data Flow Diagram

Regroup the packets


3.6 Modular Description

Received by destination

This Proposed project is broadly divided in to 4 modules which are as follows:

Retransmits the Data

MODULE 1 This module deals with the following: Finding the N/W members : IP address of all the nodes in the N/W including the core node should be identified initially. Receiving server details: Details about the server in the N/W has to be received

28

MODULE 2 This module deals with the following: Finding the core node among mesh members: IP address of the Source node among the nodes in the N/W should be identified to route data packets to the destination. Use of SHA-1 (MDA) algorithm for Encryption process. MODULE 3 This module deals with creating front-end GUIs for source and destination to prove its authenticity i.e., to verify the users authorization. MODULE 4 This module deals with the ultimate process of sending data packets from core to destination i.e., from source node to the receiver node.

3.7 Detailed Process Design Initial Route

FIG 3.8: Initial Route

29

Set of packets from SOURCE nodes are transmitted through A-B-G-H-I to destination DEST-1using PROACTIVE protocol.

Transmission Failure

FIG 3.9: Transmission Failure Due to congestion in the NETWORK the packets sent has been DELAYED or lost as the specified time for transmission expires. In those cases this algorithm helps us to restore those packets in the intermediate node.In this case it is node G.

Retransmission of Data

FIG 3.10: Retransmission of Data

30

Now the Node G become the core node i.e., the current source from where the packets are going to be retransmitted to the appropriate destinations.This retransmission may follow different routes not necessarily the same old route more importantly it selects the route which is congestion free. Here Node G follows the route G-F-I for retransmission to DEST-1 using REACTIVE Protocol

CHAPTER 4
31

ARCHITECTURAL ENVIRONMENT
4.1 Presentation Layer
This presentation layer deals with the User interface design of the project. User Interface design plays major role in the success of any project. Its efficiency helps the project to reach everyone. Since we have used Java as a software it contains lot of features such as swings, awt etc to generate user interfaces.

SWINGS:
Swing advertised as a set of customizable graphical components whose look-andfeel can be dictated at runtime. In reality, however, Swing is much more than this. Swing is the next-generation GUI toolkit that Sun Microsystems is developing to enable enterprise development in Java. By enterprise development, we mean that programmers can use Swing to create large-scale Java applications with a wide array of powerful components. In addition, you can easily extend or modify these components to control their appearance and behavior. Swing is not an acronym. The name represents the collaborative choice of its designers when the project was kicked off in late 1996. Swing is actually part of a larger family of Java products known as the Java Foundation Classes (JFC), which incorporate many of the features of Netscape's Internet Foundation Classes (IFC), as well as design aspects from IBM's Talent division and Lighthouse Design. Swing has been in active development since the beta period of the Java Development Kit (JDK) 1.1, circa spring of 1997. The Swing APIs entered beta in the latter half of 1997 and their initial release was in March of 1998. When released, the Swing 1.0 libraries contained nearly 250 classes and 80 interfaces. Although Swing was developed separately from the core Java Development Kit, it does require at least JDK 1.1.5 to run. Swing builds on the event model introduced in the 1.1 series of JDKs; you cannot use the Swing libraries with the older JDK 1.0.2. In addition, you must have a Java1.1-enabled browser to support Swing applets.

AWT:
32

The Abstract Window Toolkit is the basic GUI toolkit shipped with all versions of the Java Development Kit. While Swing does not reuse any of the older AWT components, it does build off of the lightweight component facilities introduced in AWT. Pluggable Look-and-Feels: One of the most exciting aspects of the Swing classes is the ability to dictate the Look-and-feel (L&F) of each of the components, even resetting the look-and-feel at runtime. Look-and-feels have become an important issue in GUI development over the past five years. Most users are familiar with the Motif style of user interface, which was common in Windows 3.1 and is still in wide use on Unix platforms. Microsoft has since deviated from that standard with a much more optimized look-and-feel in their Windows 95/98 and NT 4.0 operating systems. In addition, the Macintosh computer system has its own branded look-and-feel, which most Apple users feel comfortable with. Java Swing OReilly Lightweight Components: Most Swing components are lightweight. In the purest sense, this means that components are not dependent on native peers to render themselves. Instead, they use simplified graphics primitives to paint themselves on the screen and can even allow portions to be transparent. The ability to create lightweight components first emerged in JDK 1.1, although the majority of AWT components did not take advantage of it. Prior to that, Java programmers had no choice but to subclass java.awt.Canvas or java.awt.Panel if they wished to create their own components. With both classes, Java allocated an opaque peer object from the underlying operating system to represent the component, forcing each component to behave as if it were its own window, taking on a rectangular, solid shape. Hence, these components earned the name "heavyweight," because they frequently held extra baggage at the native level that Java did not use.

4.2 Business Layer


33

This Layer deals with the processing of the system proposed here. It is the main part of any project which performs the appropriate concept and provides the solutions for the problem defined.

The Model-View-Controller Architecture:


Swing uses the model-view-controller architecture (MVC) as the fundamental design behind each of its components. Essentially, MVC breaks GUI components into three elements. Each of these elements plays a crucial role in how the component behaves. Model: The model encompasses the state data for each component. There are different models for different types of components. For example, the model of a scrollbar component might contain information about the current position of its adjustable "thumb," its minimum and maximum values, and the thumb's width (relative to the range of values). A menu, on the other hand, may simply contain a list of the menu items the user can select from. Note that this information remains the same no matter how the component is painted on the screen; Model data always exists independent of the component's visual representation. View: The view refers to how you see the component on the screen. For a good example of how views can differ, look at an application window on two different GUI platforms. Almost all window frames will have a titlebar spanning the top of the window. However, the titlebar may have a close box on the left side (like the older MacOS platform), or it may have the close box on the right side (as in the Windows 95 platform). These are examples of different types of views for the same window object. Controller: The controller is the portion of the user interface that dictates how the component interacts with events. Events come in many forms a mouse click, gaining or losing focus, a keyboard event that triggers a specific menu command, or even a directive to repaint part of the screen. The controller decides how each component will react to the eventif it reacts at all. 34

Internal Frame: Features of an internal frame: Same functions as a normal Frame object, but confined to the visible area of the container it is placed in Can be iconified (icon stays inside main application frame) Can be closed using the standard controls for popup windows Can be placed in a "layer," which dictates how the frame displays itself relative to other internal frames Action Interface: An action is defined by the interface it implements, which in this case is javax.swing.Action . Action extends the ActionListener interface from AWT; this forces concrete classes that implement Action to provide an actionPerformed() method. The programmer uses the actionPerformed() method to implement whatever behavior is desired. For example, if you are creating a Save action, you want to put the code to save the data inside of your actionPerformed() method.

Events: Objects implementing the Action interface must fire a PropertyChangeEvent when any keyed property is changed, or when the action is enabled or disabled. Containers that accept actions typically listen for these PropertyChangeEvent notifications so they can update their own properties or appearances.

Action: This example creates an Action for both a menu item and a toolbar, displaying both components and allowing the user to click on either one. When the components are clicked, the actionPerformed() method of the action is called. Don't worry if you don't understand all the methods behind the toolbar or the menu; these classes will be discussed later. For now, it is important to see that selecting either one performs the action. 35

JFrame Class: The most common Swing container for Java applications is the JFrame. Like java.awt.Frame , JFrame provides a top-level window with a title, border, and other platformspecific adornments (e.g., minimize, maximize, and close buttons). Because it uses a JRootPane as its only child, working with a JFrame is slightly different than working with an AWT Frame Constructors public JFrame() Creates a new unnamed, invisible frame.

CHAPTER 5 TESTING AND IMPLEMENTATION


36

Software Testing is a process of executing program within the intent of finding an error. Software testing is a critical element of software quality assurance and represents the ultimate review of system specification, design, coding. Testing is last chance to uncover the error defects in the software and facilities delivery of quality system,

5.1 Testing Principles


The basic principles for effective software testing are follows: A good test case is the one that has a high probability of finding an as yet undiscovered error. A successful test is one that uncovers an as-yet undiscovered Error. All tests should net race able to the customer requirements. Tests should be planned long before testing begins. Testing should begin in the small and progress towards testing in the large. Exhaustive testing is not possible.

5.2 Testing Requirements


Software testing is not an activity to take up when the product is ready. An effective testing begins with a proper plan forms the user requirement stage itself. Software testability is the case with which a computer program is tested. Metrics can be used to measure the testability of a product.

5.3 Unit Testing


The first level of testing is the Unit Testing which is done during the development of the system. It is laid on each module of the project so that each module works individually according to the specification. Unit testing is essential for verification of the Code produced during the coding phase. Errors have been noted and corrected immediately and the program clarity has been increased. At the end of the unit testing, bug fixation is triggered and on completion of fixation and confirmation, the software under development passes to next level of testing. In the developed system the unit testing is performed by testing each module. 37

In the first module, details about the server has been collected to ensure that the server is available to satisfy the clients request and also details about intermediate nodes are collected which helps in case of retransmission. In the second module, details about the source node is verified which will initiate the transmission and the messages are ensured that they will get encrypted for it safety purposes. In the third module, authenticity of both the source and destination has been verified. In the final module, the testing verifies whether the data from source to destination has been transferred successfully. Screen Shots Authentication

38

Finding Network Members

Receiving the Server Details

39

Finding Core Node Among Mesh Member

40

Creating GUIs for Source and Destination

41

Data Packets are Send

42

43

44

45

46

47

48

49

50

51

5.4 Integration Testing


The second level of testing includes Integration Testing. It may not be the case that software packages whose modules when run individually and showing perfect results, will show perfect results when running as a whole. The individual modules were grouped and tested again and the results were verified. The goal is to see if all separate modules work properly and efficiently together and then cooperate with each other properly. The various modules after being tested individually are combined for proper test result in integration testing. Here in the developed system all the four modules are integrated one after the another starting from the first module the parameter transmission and verified for the efficient results. The project flow starts from collecting and verifying the details about the server and other nodes and then it encrypts the messages to be sent after that the details about the source that initiates the transmission has been checked and the data transfer takes place. 52

Screen Shots

53

54

55

56

57

5.5 Implementation
Implementation is the stage in the project where the theoretical design is turned into a working system and is giving confidence on the new system for the users, which it will work efficiently and effectively. It involves careful planning, investigation of the current System and its constraints on implementation, design of methods to achieve the change over, an evaluation, of change over methods. Apart from planning major task of preparing the implementation are education and training of users. The more complex system being implemented, the more involved will be the system analysis and the design effort required just for implementation. An implementation co-ordination committee based on policies of individual organization has been appointed. The implementation process begins with preparing a plan for the implementation of the system. According to this plan, the activities are to be carried out, discussions made regarding the equipment and resources and the additional equipment has to be acquired to implement the new system. Implementation is the final and important phase, the most critical stage in achieving a successful new system and in giving the users confidence. That the new system will work is effective .The system can be implemented only after through testing is done and if it found to working according to the specification. This method also offers the greatest security since the old system can take over if the errors are found or inability to handle certain type of transactions while using the new system. Congestion control using tree-based reliable multicast protocol implement using java is mainly used to reduce network density. This reduction of network density is done by selecting only selective path from the network. It is also capable of selecting the alternate path in case of failures. Every node analyze its child node as to which route to continue to reach the appropriate destination. Messages transferred from source are first encrypted to avoid intrusion. Those encrypted messages are again decrypted at receiver end. Module 1 deals with collection of server and other node details. Module 2 deals with encryption and decryption of information. Module 3 deals with collecting source details and packets.

58

Module 4 deals with sending packets through selective path from source to destination.

5.6 Sample Screens

FIG 5.1 : Login

FIG 5.2 : Accepting the Port Numbers 59

FIG 5.3: Accepting Port Number for Server Port

FIG 5.4: Tree Nodes are Created

FIG 5.5: Entering the Message 60

FIG 5.6: Entering the IP Address for 3333

FIG 5.7: Entering the IP Address for 4444

FIG 5.8: Entering the IP Address for 5555

FIG 5.9: Entering the IP Address for 6666

61

FIG 5.10: Entering the IP Address for 7777

FIG 5.11: Entering the IP Address for 8888

FIG 5.12: Entering the IP Address for 9999

FIG 5.13: Message Send to Port 3333

62

FIG 5.14: Connection Error in Port 5555

FIG 5.15: Message Send to Port 6666

FIG 5.16: Connection Error in Port 7777

FIG 5.17: Message Send to Port 8888

63

FIG 5.18: Message Send to Port 9999

FIG 5.19: Message Received from Sever Port 3456

FIG 5.20: Final Message, Received from 3456

FIG 5.21: Enter the File Name

64

FIG 5.22: File Opened in WordPad at Receiver

65

5.7 Coding Details (pseudo code): Coding for Authentication:


import necessary packages design using JFC components place all the JFC Components inside the Container create an instance for serversocket class and socket class using the accept( ) method establish the connection enter username and password if(username = admin && pwd =admin) display a message successfully logged in else display a message invalid user end

Coding for Actual process:


Import necessary packages Design using JFC components Place all the JFC Components inside the Container Create an instance for serversocket class and socket class Using the accept ( ) method establish the connection Enter the port numbers for all the intermediate nodes and destination node to create tree nodes. Enter the message or browse the file to send. 66

Enter the server port number where transmission begins. Simultaneously start the intermediate nodes for transmission. Send the message/file to start transmission. After successful transmission use showpath() method to view the path of transmission of data. End

Coding for reception of files:


Import necessary packages Design using JFC components Place all the JFC Components inside the Container Create an instance for serversocket class and socket class Using the accept( ) method establish the connection. Using the receive( ) method to receive the file. Using OpenUrl( ) method to open the file using wordpad. Using save( ) method to save that file in the destination system. End

67

CONCLUSION
The transmission of data packets should be secure, effective in all means is a decisively important task, and it should be taken care. Thus concluding, the contemporary disadvantages such as Congestion problems, increased network density, increased time consumption for data transfer, unsubstantiated data transmission are rectified using this system. Thus CONGESTION CONTROL algorithm easily overcomes the disadvantages of the previous algorithms. It provides elimination of congestion, confirmed transmission of data, reduction of network density, and lesser consumption of energy, portable network irrespective of geographical area. This system is very optimal in smaller network coverage area. This can be enhanced to satellite transmissions, which will be possible to achieve message communication over a wide range of networks where congestions are more obvious to occur.

68

FUTURE ENHANCEMENT
The proposed project has the efficiency of transferring only the text messages through the TRAM network as an initial stage. In future this project as an enhancement of incorporating the following changes, which will add some more zest to our systems

PICTURE FILES
The picture messages can also be transmitted by carrying its color information, edge information, and pixel positions.

ANIMATED MOVIES, AUDIO AND VIDEO PACKAGES


The audio and video animated are also planned to be transmitted through the enhanced network as a step further.

69

APPENDIX 1 GLOSSARY OF TERMS

A
Architectural environment Swings AWT

C
Congestion control algorithm Core node

D
Dataflow diagram

F
Feasibility Economic Feasibility Operation Feasibility Technical Feasibility

H
Hardware requirement

M
Model view controller
70

S
Software requirement

T
Testing Implementation Integration Testing Principles Unit testing Tram protocol Proactive Protocol Reacting Protocol Transmission

U
Uml diagram Sequence Diagram Use Case Diagram

71

Appendix
Acronyms

JFC: Java Foundation Class JVM: Java Virtual Machine TCP/IP: Transmission Control Protocol / Internet Protocol AWT: Abstract Window Toolkit JDK: Java Developers Kit

72

REFERENCES
Reference Books

1. CORE JAVA complete reference 2. Programming in java by Deitel and Deitel 3. Java Swing, 2nd Edition - by Dave Wood, Marc Loy, James Elliott, Brian Cole, ... 1278 pages 4. Java Cookbook, 2nd Edition - by Ian F. Darwin - 862 pages 5. Java Cookbook - by Ian F. Darwin 6. Effective Java Programming Language Guide (Paperback) by Joshua Bloch 7. Core Java(TM) 2, Volume I--Fundamentals (7th Edition) (Core Java 2) by Cay Horstmann

Websites

1. www.java.sun.com 2. www.javaworld.com 3. www.freewarejava.com 4. www.javapages.com 5. www.deitel.com 6. www.javacoffeebreak.com 73

Вам также может понравиться