P. 1
IEEE Chapter

IEEE Chapter

|Views: 3|Likes:
Published by Niranjan Hn
on abbrevations
on abbrevations

More info:

Published by: Niranjan Hn on Feb 03, 2013
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less





Scalable Wireless Ad-hoc Network Simulation

Literature Survey

Chapter 2

We have used java programming language for implementing this project. The description of Java, its features, components and functions are described below.

2.1 Why Java platform?
Work on Java originally began with the goal of creating a platform-independent language and operating system for consumer electronics. Java facilitates the building of distributed applications by a collection of classes for use in networked applications. By using Java's URL (Uniform Resource Locator) class, an application can easily access a remote server. Classes also are provided for establishing socket-level connections.

Features of the Java Language:
 Simple  Object-Oriented  Distributed  Interpreted  Robust  Secure  Architecture-Neutral  Portable  High-Performance  Multithreaded  Dynamic

Dept of CSE, SJCIT



The Swing related classes are contained in javax. can be round.  Swing components don’t have to be rectangular. SJCIT 6 2007-2008 .swing. JFC1. Features of Swing components:  Swing buttons and labels can display images instead of.  Swing components are implemented with no native code and aren’t restricted to the least common denominator.  Swing let’s to specify which look and feel a program’s GUI uses. It is available in two forms: 1.  Users can easily change the behavior or appearance of a swing component by either invoking methods on it or creating a subclass of it. As a core part of the Java2 platform 2. The APIs included with JFC include the following:  The Abstract Windowing Toolkit  Swing  Java 2D  Drag and Drop  Accessibility Swing components provide a pluggable look and feel. or in addition to text. which is easy to substitute another appearance and behavior for an element.Scalable Wireless Ad-hoc Network Simulation Literature Survey The Java Foundations Classes Java Foundations Classes (JFC) is a set of APIs for building the GUI-related components of Java applets and applications.  User can easily add or change the borders drawn around most swing components. such as javax.g..1 Dept of CSE.  Assistive technologies such as screen renders can get information from swing components. powerful and immense. buttons. The Swing API is flexible. for e.tree.swing and its sub packages.

When we enter the required parameters into the text field of login window and click on login button an event is generated. number of nodes in the network etc. JPasswordField: JPasswordField is used for entering the password into the edit field in the login window. The classes of the Swing which we have used for this project are described below. the actionlistener listens to the event generated and performs the action of logging into the system. JLable: JLable class is used for naming the windows and textboxes that we created in our project. into the textfield. Dept of CSE. The classes of the Swing which we have used for this project are described below.. JTextArea: JTextArea class displays multiple lines of text in a single font and style. SJCIT 7 2007-2008 . JButton: JButton is a push button used to fire action events when they activated. In this project this class is used to create the status window which shows the status of the operation being performed in this project. JTextField: JTextField class is used for entering the input into the username.Scalable Wireless Ad-hoc Network Simulation In our project we are making use of the JFC’s. JPanel: JPanel class is used for creating the panel to login window. Literature Survey For implementing this project we have mainly used “Swing” that is nothing but a set of class that provides more powerful and flexible components.

This class is also used to create the icons also in the application.”Distance”. JInternalFrame: In this application this class is used to add the columns named “IP Address”.Scalable Wireless Ad-hoc Network Simulation Literature Survey JScrollPane: Here we are using the JScrollPane class to view contents of the tables if it exceeds the default size. SJCIT 8 2007-2008 . JOptionPane: In this application if the username and password are not entered properly. JTable: In this application this class is mainly used to create the tables of this application. JTabbedPane: We have used JTabbedPane class for switching from one text field to another or from one button to another very quickly. JScrollPane: In this application if we want to calculate the ranks for 12 or more than 12 nodes in the network then this class will create an automatic vertical scrollbar in the nodes’ parameter table for viewing parameters of the nodes together.”Portnumber”. It also adds the “END” and “Send To all” button to the table also. it is wrong and if the information about the nodes are incorrect then this class creates popup windows as “Invalid name and password . the scrollbar shows up so that we can view the contents of the table by scrolling upwards or downwards. Dept of CSE.This class is mainly used for creating various window.”Energy” and “Link Quality” in the parameter entry table. It also resize the tables depending upon the nodes entered by the user.

Other prominent feature that this project demonstrates are listed below:     No existing infrastructure is required Mobile users can easily communicate High Bandwidth. quality.. So the need of this project arises to make adhoc network more scalable. In fact.. OOP treats data as a critical element in the program development and does not allow it to flow freely around the system. SJCIT 9 2007-2008 . Core resolution algorithms etc. The major objective of object-oriented approach is to eliminate some of the flaws encountered in the procedural approach.2 Need of Our Project:The Scalable Wireless Ad-hoc Network Simulation project is mainly intended to demonstrate the advantages that are obtained by using the XTC Algorithm over the other multicasting algorithm’s such as expanded ring search algorithm.. It ties data more closely to the functions that operate on it and protects it from unintentional modification Dept of CSE. more convenient to use and for smooth data transfer by reducing the network congestion.Scalable Wireless Ad-hoc Network Simulation Literature Survey 2. all Java programs are object-oriented-this isn’t an option the way that is in C++. reliability and variance Energy conservation very less Wonderful Scalability Quality of Service Simplicity and ease of implementation Efficient computing QoS support     OBJECT ORIENTED PROGRAMMING: Object-oriented programming is an approach that provides a way of modularizing programs by creating partitioned memory area for both data and functions that can be used as templates for creating copies of such modules on demand. Object-oriented programming is at the core of Java.

a leading exponent of the object-oriented approach. ADVANTAGES OF OBJECT.Scalable Wireless Ad-hoc Network Simulation Literature Survey by other functions. SJCIT 10 2007-2008 . It may display a behavior. It has a unique identity. THREE OOP PRINCIPLES: ♦ ♦ ♦ Encapsulation Inheritance Polymorphism Encapsulation: The Wrapping up of data and methods into a single unit (called Class) is known as encapsulation. an object has the following characteristics. The combination of data and methods make up an object.ORIENTATION: Dept of CSE. OOP allows us to compose a problem into a number of entities called Objects and then build data and functions around these entities. Polymorphism: Polymorphism means the ability to take more than one form. an operation may exhibit different behavior in different instances. Inheritance: Inheritance is the process by which objects of one class acquire the properties of objects of another class. According to Grady Booch. ♦ ♦ ♦ It has state. For Example.

Dept of CSE. Chris Warth. the old system need not be completely abandoned and rebuilt from scratch. The benefit of reusability translates to a saving in time and effort. Reusability. even during construction. JAVA HISTORY: James Gosling. which in turn results in cost benefits. procedural approach. Arthur Van Hoff. results in ease of maintenance. and Tim Lindholm were key contributors to the maturing of the original prototype. SJCIT 11 2007-2008 . Realistic Modeling: Since we live in a world of objects. system can be allowed to evolve. Reusability: In the object-oriented approach. it logically follows that the objectoriented approach models the real world more accurately than the conventional. you build classes. Bill Joy. in 1991. which can then be used by several applications. Inc. Patrick Naughton. Resilience to change. and Mike Sheridan conceived JAVA. When a change is suggested. at Sun Micro Systems. Ed Franck.Scalable Wireless Ad-hoc Network Simulation Literature Survey ♦ ♦ ♦ Realistic Modeling. For the same reason. Resilience to change: Through the object-oriented approach. paths of the system under development can be refined without any major change to other parts. Jonathan Payne. This language was initially called “ OAK” but was renamed “JAVA” in 1995. Franck Yellin. Resilience to change.

First. Robust and secure. High performance. Although it is possible to compile a c++ program for just about any type of CPU. This effort ultimately led to the creation of JAVA. Java compiler translates source code into what is known as byte code Instructions. Dept of CSE. Familiar. simple and small. The problem is that compilers are expensive and time –consuming to create. such as microwave ovens and remote controls. many different types of CPUs are used as controllers. As you can probably guess. An Easier and more costefficient solution were needed. Object-oriented. In an attempt to find such a solution. Compiled and Interpreted: Java combines both this approaches thus making Java a two-stage system. platform-independent language that could be used to produce code that would run on a variety of CPUs under different environments. to do so requires a full c++ compiler targeted for that CPU. JAVA FEATURES: Sun micro systems officially describes Java with the following attributes: ♦ ♦ ♦ ♦ ♦ ♦ ♦ ♦ ♦ Compiled and interpreted.Scalable Wireless Ad-hoc Network Simulation Literature Survey The original impetus for Java was not the Internet! Instead. Platform . Gosling and others began work on a portable. the primary motivation was the need for a platform-independent language that could be used to create software to be embedded in various consumer electronic devices. Dynamic and extensible. Multithreaded and Interactive. Distributed.independent and portable. SJCIT 12 2007-2008 . The trouble with C and C++ is that they are designed to compile for a specific target.

that we can use in our programs by inheritance. arranged in packages. Distributed: Dept of CSE. Java also incorporates the concept of exception handling. SJCIT 13 2007-2008 . processors and system resources will not force any changes in Java programs. a Java compiler generates byte code instructions that can be implemented on any machine. Java ensures portability in two ways. The object model in Java is simple and easy to extend. It is designed as a garbage-collected language relieving the programmers virtually all memory management problems. It has strict compile time and runtime checking for data types. Java interpreter generates machine code that can be directly executed by the machine that is running the Java program. It provides many safeguards to ensure reliable code. Security becomes an important issue for a language that is used for programming on Internet.Scalable Wireless Ad-hoc Network Simulation Literature Survey In the second stage. Robust and Secure: Java is a robust language. Java systems not only verify all memory access but also ensure that no viruses are communicated with an applet. Almost everything in Java is an object. Changes and upgrades in operating systems. The absence of pointers in Java ensures that programs cannot gain access to memory locations without proper authorization. Secondly. the sizes of the primitive data types are machine-independent. Platform-Independent and Portable: The most significant contribution of Java over other languages is its portability. which captures series errors and eliminates any risk of crashing the system. All program code data reside within object and classes. Object-oriented: Java is a true object-oriented language. Java comes with an extensive set of classes. Threat of viruses and abuse of resources is everywhere. First.

To make the language look familiar to the existing programmers. This feature greatly improves the interactive performance of graphical applications. In fact. Multithreaded and interactive: Multithreaded means handling multiple tasks simultaneously. It also eliminates operator overloading and multiple inheritance. Java uses many constructs of C and C++ and therefore. Familiarity is another striking feature of Java. Java applications can open and access remote objects on Internet as easily as they can do in a local system. preprocessor header files. Java speed is comparable to the native C/C++. High performance: Java performance is impressive for an interpreted language. it was modeled on C and C++ languages. Java supports multithreaded programs. Many features of C and C++ that are either redundant or sources of unreliable code are not part of Java. Java is simplified version of C++. For example. “go to” statement and many others. This means that we need not wait for the application to finish one task before beginning another. the incorporation of multithreaded enhances the overall execution speed of Java programs. Java code “looks like a C++” code. Java does not use pointers. The Java runtime comes with tools that support multiprocessors synchronization and constructs smoothly running interactive systems.Scalable Wireless Ad-hoc Network Simulation Literature Survey Java is designed as a distributed language for creating applications on networks. Java architecture is also designed to reduce overheads during runtime. small and familiar: Java is a small and simple language. Simple. It has the ability to share both data and programs. Dynamic and extensible: Dept of CSE. According to sun. Further. This enables multiple programmers at multiple remote locations to collaborate and work together on a single project. SJCIT 14 2007-2008 . mainly due to the use of intermediate byte code.

active programs. JAVA AND INTERNET Internet helped catapult Java to the forefront of programming. they also present serious problems in the area of security and portability. making it possible to either dynamically link or abort the program. These functions are known as native methods. depending on the response. not interpreted mostly because of performance concerns. That is. The reason for this is quite simple: Java expands the universe of objects that can move about freely in cyberspace. most modern languages are designed to compiled. and Java. SJCIT 15 2007-2008 . Dept of CSE. in its standard form. Native methods are linked dynamically at runtime. by doing so.Scalable Wireless Ad-hoc Network Simulation Literature Survey Java is a dynamic language. This facility enables the programmers to use the efficient functions available in these languages. In a network too very broad categories of objects are transmitted between the server and your personal computer: passive information and dynamic. which is called the Java Virtual Machine (JVM). in turn has had a profound effect on the Internet. In fact. The fact that a Java program is executed by the JVM helps solve the major problems associated with downloading programs over the Internet. Java can also determine the type of class through a query. Java address those concerns and. Rather. cyberspace was effectively closed to half the entities that now live there. the JVM is an interpreter byte code. JAVA’S MAGIC: THE BYTECODE: The key that allows Java to solve both the security and the portability problems just described is that the output of a Java compiler is not executable code. has opened the door to an exciting new form of program: the applet. it is Byte code. Java is capable of dynamically linking in new class libraries. Prior to Java. Byte code is a highly optimized set of instruction designed to be executed by the Java runtime system. Java programs support functions written in other languages such as C and C++. methods and objects. As you will see. networked programs are. As desirable as dynamic.

on a piece-by-piece. the probability and safety features still apply.Scalable Wireless Ad-hoc Network Simulation Literature Survey Translating a Java program into Byte code makes it much easier to run a program in a wide variety of environments. the differential between the two is not great. The reason is straightforward: only the JVM need to be implemented for each platform. As you will see. SJCIT 16 2007-2008 . Even when dynamic compilation is applied to byte code. then different versions of the same program would have to exist for each type of CPU connected to the Internet. It is important to understand that it is not possible to compile an entire Java program into executable code all at once. However. Because the execution of every Java program is under the control of the JVM. its functionality is the same. The fact that a Java programs is interpreted also helps to make it secure. any Java program can run on it. the JVM can contain the program and prevent it from generating side effects outside of the system. it compiles byte code into executable code in real time. Along these lines. Once the runtime package exists for a given system. not a feasible solution. This is. Java was designed for interpretation. When a program is interpreted. with Java. Sun supplies its Just in Time (JIT) compiler for byte code. which is included in the Java 2 release. Dept of CSE. demand basis. Instead. Thus the interpretation of byte code is the easiest way to create truly portable programs. during execution. safety is also enhanced by certain functions that exist in the Java language. there is technically nothing about Java that prevents on-the-fly compilation of byte code into native code. it generally runs substantially slower than it would run if compiled to executable code. When the JIT compiler is part of the JVM. the JIT compiles code. because the runtime system still is in charge of the environment. The use of byte code enables the Java. Remember. runtime system to execute programs much faster. Whether your java program is actually interpreted in the traditional way or compiled On-The-Fly. as it is needed. However. because Java performs various runtime checks that can be done only at runtime. although the details of the Java program were compiled to native code. the Just-In-Time approach still yields a significant performance boost. of course.

JAVA ENVIRONMENT: Java environment includes a large number of development tools and hundreds of classes and methods. Its biggest draw is that it was the first Web browser to provide support for the Java language. Though. if necessary. the programs and examples in this book were tested under Windows 95. A Hard drive.compatible 486 system. The minimum hardware and software requirements for Windows 2000 version of Java are follows: ♦ ♦ ♦ IBM . JAVA DEVELOPMENT KIT: ♦ ♦ ♦ ♦ Dept of CSE. they can implemented on any of the above systems. using the java language. A CD-ROM drive. HARDWARE AND SOFTWARE REQUIREMENTS: Java is currently supported on Windows 95. thus making the web more dynamic and interactive.Scalable Wireless Ad-hoc Network Simulation Literature Survey HOT JAVA: Hot java is the web browser from Sun Microsystems that enables the display of interactive content on the Web. the most popular operating system today. A Microsoft-compatible mouse. Sun Solaris. SJCIT 17 2007-2008 . Macintosh. The development tools are part of the system known as Java Development Kit (JDK) and the classes and methods are part of the Java Standard Library (JSL). and UNIX machines. also known as the Application Programming Interface (API). Windows NT. Minimum of 8 MB memory Windows 2000 software A Windows-compatible and sound card.

Dept of CSE. SJCIT 18 2007-2008 . They include: ♦ ♦ ♦ ♦ ♦ ♦ ♦ Applet viewer (for viewing Java applets) Javac (Java compiler) Java (java interpreter) Javap (java disassembler) Javah (for C header files) Javadoc (for creating HTML documents) Jdb (Java debugger) JAVA DEVELOPMENT TOOLS Tools Applet viewer Description Enables us to run Java applets (without actually using a Java-compatible browser).Scalable Wireless Ad-hoc Network Simulation Literature Survey The Java Development Kit comes with a collection of tools that are used for developing and running Java programs. Java Java interpreter. which runs applets and application by reading and interpreting byte code files.

The way these tools are applied to build and run application program is illustrated in the following figure. Text Editor Java Source Javadoc HTML Files Javac Java Class Javah Header Files Java Jdb Dept of CSE.Scalable Wireless Ad-hoc Network Simulation Literature Survey Javac The Java compiler. Javadoc Creates HTML–format documentation from Java source code files. Javah Javap Produces header files for use with native methods. Jdb Java debugger. Java disassembler. SJCIT 19 2007-2008 . which translates Java source code to byte code files that the interpreter can understand. which helps us to find errors in our programs. which enables us to convert byte code files into a program description.

The use of these library classes will become evident when start developing java programs. The java debugger jdb is used to find errors. Applet Package: This includes a set of classes that allows us to create Java applets. Most commonly used packages are: Language Support Package : A collection of classes and methods required for implementing basic features of Java. Utilities Packages : A collection of classes to provide utility functions such as date and time functions. in the source code. we need to create a source code file using a text editor. APPLICATION PROGRAMMING INTERFACE: The java standard library (or API) includes hundreds of classes and methods grouped into several functional packages. The source code is then compiled using the Java compiler javac and executed using the Java interpreter java.Scalable Wireless Ad-hoc Network Simulation Literature Survey Java Program Output Figure: Process of building and running Java application programs To create a Java program. Dept of CSE. Input/Output Packages: A collection of classes required for input/output manipulation. if any. Networking Packages: A collection of classes for communicating with other computers via internet. SJCIT 20 2007-2008 . AWT Package: The Abstract Window Tool package contains classes that implements platformindependent graphical user interface.

but they have graphical user interfaces. These applications are used in the Windows environment. Dept of CSE. They are widely used to extend the functionality of web servers. Servlets Servlets do not have graphical user interfaces. Applets are the programs that you running on web page. Applets These programs run on a web page and require a java-enabled browser like Internet explorer or Netscape navigator. Applications using GUI These are similar to the applications described above. Packages Packages are collections of classes that can be shared by applications and applets. SJCIT 21 2007-2008 .Scalable Wireless Ad-hoc Network Simulation Literature Survey JAVA PROGRAMS: A few type of java applications are listed below: Applications that do not use Graphical User Interface (GUI): They are similar to traditional programs written in C and C++.

Scalable Wireless Ad-hoc Network Simulation Literature Survey Dept of CSE. SJCIT 22 2007-2008 .

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->