Efficient Resource Allocation for Adhoc Networks

A Major Project Report on EFFICIENT RESOURCE ALLOCATION FOR ADHOC NETWORKS Submitted in partial fulfillment of the requirement for the award of the degree BACHELOR OF TECHNOLOGY In Computer Science and Engineering Submitted By A - Efficient Resource Allocation for Adhoc Networks introduction. Manasa (09R01A0501) B. Tejasvi (09R01A0510) K. Balakrishna (09R01A0527) C. Apurva (09R01A0560) Under the Esteemed Guidance of Ms. T. S. Suhasini Assistant Professor [pic] Department of Computer Science and Engineering CMR INSTITUTE OF TECHNOLOGY

(Approved by AICTE, Affiliated to JNTUH, Hyderabad) Kandlakoya, Medchal Road, Hyderabad. 2012-2013 CMR INSTITUTE OF TECHNOLOGY Approved by AICTE (Affiliated to Jawaharlal Nehru Technological University, Hyderabad) Department of Computer Science and Engineering [pic] CERTIFICATE This is to certify that the project report titled EFFICIENT RESOURCE ALLOCATION FOR ADHOC NETWORKS is submitted by Arravalli Manasa (09R01A0501) B. Tejasvi (09R01A0510) Kajjam Balakrishna (09R01A0527) Chimbili Apurva (09R01A0560)

We will write a custom essay sample on
Efficient Resource Allocation for Adhoc Networks
or any similar topic specifically for you
Do Not Waste
Your Time
SEND

By clicking "SEND", you agree to our terms of service and privacy policy. We'll occasionally send you account related and promo emails.

More Essay Examples on C++ Rubric

in partial fulfillment of the requirement for the award of the degree Bachelor of Technology in Computer Science and Engineering from Jawaharlal Nehru Technological University, Hyderabad for the academic year 2012-2013. Signature of the Guide Signature of the Head of the Department Ms. T. S. Suhasini Mr. P. Pavan Kumar Assistant Professor Professor and HOD Computer Science and Engineering Computer Science and Engineering External Examiner ACKNOWLEDGEMENT We are extremely grateful to Dr M. Janga Reddy, Principal, CMR Institute of Technology and Mr P.

Pavan Kumar, Head of Department, Department of Computer Science and Engineering, CMR Institute of Technology for their help and support during our academic career. We would like to express heartfelt gratitude to our internal guide Ms. T. S. Suhasini, Assistant Professor, for her valuable suggestions, guidance, encouragement and co-operation throughout the course of our project. We will be failing in duty if we do not acknowledge with grateful thanks to the authors of the references and other literatures referred to in this report. We express our thanks to Professor Mr.

S. M. Riyazuddin and all staff members and friends for all the help and co-ordination extended in bringing out this project report successfully in time. Table of Contents 0. 0 Abstract 1. 0 Introduction(Requirements Analysis) 1. 1. Purpose 2. Scope 3. Goals/ Aim 1. 4 Features of project ( Advantages) 2. 0 LITERATURE REVIEW 3. 0. SYSTEM Analysis AND DECRIPTION 3. 1. Existing system 3. 2. Proposed system 3. 3. Overall Description 3. 4 Modules Description 3. 5. Feasibility Study 3. 6 SDLC Model. 4. 0. SOFTWARE REQUIREMENT SPECIFICATIONS 4. 1 Software interfaces 4.

2 Hardware interfaces 4. 3 Communications interfaces 5. 0. LANGUAGES OF IMPLEMENTATION 5. 1 Asp. net description 5. 2 C#. net description. 5. 3 ADO. NET 5. 4 Sql server description. 6. 0. SOFTWARE DESIGN 6. 1 Design Overview ( Software arch and Application arch) 6. 2 UML Design (state, activity, collaboration also) 6. 3 DFD Design. 6. 4 DB Design (includes normalization theory, ER-diagram, Tables description 6. 5 User Interfaces or Output Screens. 7. 0. CODE 8. 0. TESTING 8. 1 Testing Introduction 8. 2 Unit Testing 8. 3 White Box Testing 8.

4 Black Box Testing 8. 5 Integration Testing 8. 6 Test Cases 9. 0 IMPLEMENTATION 9. 1 Running Application 9. 2 Configuring Data Base 10. 0. CONCLUSION 11. 0 FUTURE ENHANCEMENT 12. 0 BIBLIOGRAPHY 0. 0 ABSTRACT The project titled “Efficient Resource Allocation for Wireless Multicast” is designed using. NET with Microsoft Visual Studio. Net 2005 as front end which works in . Net framework version 2. 0. The coding language used is C# . Net. In this project we are dealing with resource allocations in heterogeneous multicast networks using a bandwidth-efficient multicast mechanism.

Our mechanism enables more mobile hosts to cluster together and leads to the use of fewer cells to save the scarce wireless bandwidth. Besides, the paths in the multicast tree connecting to the selected cells share more common links to save the wire line bandwidth. Our mechanism supports the dynamic group membership and offers mobility of group members. We formulate the selection of the cell and the wireless technology for each mobile host in the heterogeneous wireless networks as an optimization problem.

We use Integer Linear Programming to model the problem and show that the problem is NP-hard. To solve the problem, we propose a distributed algorithm based on Lagrangean relaxation and a network protocol based on the algorithm. The simulation results show that our mechanism can effectively save the wireless and wire line bandwidth as compared to the traditional IP multicast. This can be achieved through selecting the cell and the wireless technology for each mobile host to join the multicast group. As a result bandwidth cost of an internet protocol multicast tree will be reduced. 1.

INTRODUCTION The success of wireless and mobile communications in the 21st century has resulted in a large variety of wireless technologies such as second and third-generation cellular, satellite, Wi-Fi, and Bluetooth. The heterogeneous wireless networks combine various wireless networks and provide universal wireless access. The leading wireless companies in some countries have operated networks with multiple wireless technologies, such as T-Mobile in the United States, British Telecom in the United Kingdom, Orange Telecom in France, NTT DoCoMo in Japan, and Chunghwa Telecom in Taiwan.

The number of such Companies would increase because the standards for operators to provide seamless services in networks with multiple wireless technologies have been proposed by the Third-Generation Partnership Project (3GPP) and Unlicensed Mobile Access (UMA) . In addition, users in the heterogeneous wireless networks are usually covered by more than one cell to avoid connection drop and service disruption. More mobile terminals in the wireless networks are likely to own multiple wireless technologies.

Therefore, the heterogeneous wireless networks provide the mobile hosts with many choices for the cells and wireless technologies to access the Internet 1. 1 PURPOSE In this project we are dealing with resource allocations in heterogeneous multicast networks using a bandwidth-efficient multicast mechanism. Our mechanism enables more mobile hosts to cluster together and leads to the use of fewer cells to save the scarce wireless bandwidth. Besides, the paths in the multicast tree connecting to the selected cells share more common links to save the wire line bandwidth.

Our mechanism supports the dynamic group membership and offers mobility of group members. We formulate the selection of the cell and the wireless technology for each mobile host in the heterogeneous wireless networks as an optimization problem. We use Integer Linear Programming to model the problem and show that the problem is NP-hard. 1. 2 SCOPE In this project we are dealing with resource allocations in heterogeneous multicast networks using a bandwidth-efficient multicast mechanism. Our mechanism enables more mobile hosts to cluster together and leads to the use of fewer cells to save the scarce wireless bandwidth.

Besides, the paths in the multicast tree connecting to the selected cells share more common links to save the wire line bandwidth. Our mechanism supports the dynamic group membership and offers mobility of group members. We formulate the selection of the cell and the wireless technology for each mobile host in the heterogeneous wireless networks as an optimization problem. We use Integer Linear Programming to model the problem and show that the problem is NP-hard. To solve the problem, we propose a distributed algorithm based on Lagrangean relaxation and a network protocol based on the algorithm.

The simulation results show that our mechanism can effectively save the wireless and wire line bandwidth as compared to the traditional IP multicast. This can be achieved through selecting the cell and the wireless technology for each mobile host to join the multicast group. As a result bandwidth cost of an internet protocol multicast tree will be reduced. 1. 3 PROJECT DESCRIPTION THE PROJECT ENTITLED AS “EFFICIENT RESOURCE ALLOCATION FOR WIRELESS MULTICAST” DEVELOPED USING . NET USING C#. MODULES DISPLAY AS FOLLOWS. • Add nodes

• Resource allocation • Source and Destination • Lagrangean path Add nodes: In this module we provide number of nodes we required in the network. Once our requirement is provided group of nodes get arranged in each cell randomly. Each cell accesses the nodes according to its capability. Resource allocation: The resource allocation will find the nearest tower to the mobile. Then we will find the nearest tower to that. The main advantage of finding this is to use the available bandwidth. And by this way we will connect the mobile to the nearest tower.

And by this way we will maintain good band width usage. Source and Destination: In this module we are going to choose the source and destination nodes. Once the source node is entered, its position and the cell which contains the node is stored. Similarly the position of destination node is found in order to find the shortest path. Lagrangean path: In this module we divide the problem into two sub problems. With the help of first sub problem we find the method of accessing the nearest cell. With the help of second sub problem the consumption of bandwidth is found.

Finally the Lagrangean iteration process provides the shortest path to access the mobile. 2. LITERATURE REVIEW Mobile Multicast Protocol: Mobile IP supports (unicast) IP routing for mobile hosts in an IP internetwork. The c m t version of Mobile IP proposes two approaches to support mobile multicast which are remote subscription and bi-directional tunneling . In remote subscription, each MH (Mobile Host) always re-subscribes to its desired multicast group when it enters a foreign network. Therefore its multicast router (MR) must be added to the multicast distribution tree.

The updzte frequency of the multicast distribution tree will depend on how offen the mobile handoff occurs. The main advantage of this approach is that the multicast datagrams are always delivered on the shortest paths. However, the overhead is the cost of reconst~uctingt he delivery tree while a handoff occurs. In bi-duectional tunneling, the mobile host receives multicasl datagrams by way of its home agent (HA) using the unicast Mobile IP tunnels. This approach hides host mobility Bom all other members of the multicasi group.

In addition, the multicast distribution tree will not be updated for the sake of member location change. The main drawback of this approach is the routing path for multicast delivery can be far from optimal. Besides, the HA must replicate and deliver tunneled multicast datagrams to all its away MHs, regardless of at which foreip networks they resides. Therefore, the network resource will be wasted. The scheme is complicated by a phenomenon called runnel convergence problem resulting from the fact that multiple Mobile IP tunnels (from different HAS) can terminate at a particular FA (Foreign Agent).

where multiple HAS all happen to have mobile hosts that are members of the Same multicast group at the Same foreign network, managed by the foreign agent FA. Therefore more than one copy of every multicast package would be forwarded to the FA by every HA . Range-Based Mobile Mu//icas/ @? EMOM): RBMoM [6] intends to trade off between the shortest delivery path and the frequency of the multicast tree reconliguration. Multicast datagrams are delivered on the near-shortest paths without paying the high cost of reconstructing the multicast tree (the main drawback of remote ubscription).

Like the home agent in Mobile IP, RBMoM has a router, called mulficasf home agent m)t,ha t is responsible for tunneling multicast datagrams to the foreign agent to which the mobile host (MH) is currently attached. Therefore, each MHA must always be one of the multicast group members (this is like bi-directional tunneling in which every home agent must join the multicast group). Every MH can only have one MHA. The home agent (HA) of a MH is never changed. However, the MHA of a MH is changeable according to the MH location. The initial MHA of a mobile host is set to be its HA.

RBMoM addresses a concept of “range” for each MHA. The range of a MHA means the service mge to its MHs. That is, a MHA can only serve the mobile hosts which are roaming around the foreign networks which are within its service range, or the network to which the MHA is attached. If a mobile host is out of its MHA service range, then the MHA handof will occur. That is, another MHA will take over the multicast service to the mobile host. From the point of view of the range concept, we will find both bi-directional tunneling and remote subscription are the extremes of BMoM. Let R be the senice range of a multicast home agent.

Thus, (1) If we let R = m, then RBMoM is the Same as bi-direct i 0 ~ 1tu nneling. In this case, the MHA is always the home agent and is never changed. (2) If we let R = 0, then RBMoM is the same as remote subscription. That is, when a MH entm a foreign network (i. e. , handom, its MHA must be changed because of out ofthe senice range. (3) RBMoM is a generalization of the above cases and a unifying mobile multicast approach. According to the value of R, a MHA can determine whether the datagams should be tunneled to each of them. Observe that the service range reshicts the “al length of the iunne1 between a mobile host and its MHA.

Range-Based Mobile Mul/icas/ Forwarding Mechanism All routers in figure 4 are assumed running RBMoM. If Router RT, has been elected to be MHA for Campus Network, then it could service RT2 and RT, with range = 1. For simplicity, we assume mobile hosts MH, … MH5 join the same multicast group and there is only one source. The base stations in SubnetA and SubnetB join this multicast group via the IGMP (Internet Group Management Protocol). Similarly, using IGMP the routers and base stations in the Campus Network would join tlus multicast group. We assume RT, and RT3 are served by the RT, (i.

e. , RT, is the MHA of RT2 and RT3). Note that RT2 and RT, can be served by the other MHAs if they are also in these MHAs’ service range. But each multicast router must elect only one MHA. That is, each mnter can have only one MHA even though there is more than one in its neighborhood. To illustrate the delivery of a multicast datagram, sup pose that Multicast Source (attached to the Intemet) sends a multicast datagram to the “multicast group X”. This datagram will he through the Internet get to the MHA (Router RT,) by using some multicast routing protocol (e. g.

, CBT, DVMRP or PIM, etc. ), and then RT, forwards the datagram to the members of multicast p u p X located at SuhnetA and SubnetB. This is accomplished by sending a single copy of the datagram onto Campus Network as a data-lmk layer multicast. Upon receiving the multicast datagram from RT,, RT2 and RT, will then multicast the datagram on their connected networks (SuhnetA and SuhnetB, respectively). Note that, if MH2 moves from the area of BS, to the area of BS,, it still can receive the multicast datagrams since it is within the service range of the same MHA (RT,).

There will be the similar result when it migrates to the area of BSI, because the BS, is still still served by RT,. Thus, there is almost no datagram lost hecause of mobile host handoff only if the mobility is within the service range of the MHA (i. e. , the host mobility is hidden within the service range of the MHA). Mul/icas/ Home Agent Eleclion The multicast home agent (MHA) election is performed per handoff by a mobile host using a combination of distance tiebreakem (i. e. , the closest node to the multicast source should be the MHA) and loading tiebreakers in the case of equal distances.

Random tiebreakers will be used when both distance and loading are equal 161. For simplicity, we can let all mobile hosts staying in a subnet have the same MHA, and this MHA must be a multicast router. Then the tunnel convergence problem can be solved. Given a service range R, RBMoM, thus, elects the MHA among the group of multicast routers which have the hop distance less than or equal to R to the subnet. Those mobile hosts roaming at a common LAN have the same MHA. Service range = 1 is the network topology. Every node in this figure represents a LAN (or subnet). We assume that each LAN has a multicast router (MR).

The MR in a “squared” LAN (e. g. , LAN 2, 5 and 9, etc. ) means the qualified router to be able to act as a MHA. Once a qualified router is elected as a MHA, it must be on the multicast Tree If the MR at LAN 2, denoted MR,, acts as the MHA of LAN 1,3 and 7, it must be on the multicast tree to receive the multicast datagrams from the some and then to tunnel these received multicast datagrams to MR,, MR, and MR,. These MRs then further broadcast the datagrams to their local mobile participants. There are two possible candidates within the service range to be its MHA (i. e. , MR,, and MR,,).

We choose one which savice less MRs to be the MHA (loading tiebreakers). If the loading is equal, we can use the random tiebreakers to choose one. If we increase the service range, obviously the number of MHAs is decreased. How can we get the qualified MRs in the example mentioned above to be the candidates of MHAs for a given service range and a network topology? We need to develop an algorithm to elect a set of MRs such that every LAN can decide its MHA from this set with the constraint of the service range (i. e. , the MHA must be within the service range). Here we assume there is only one MR in each LAN.

The size of the set which is obtained from the algorithm must be as small as possible to reduce the multicast traffic delivmd on the tree. Additionally, the delivery paths must be as short as possible. We will use a distributed greedy algorithm to solve this problem to get an acceptable and quick answer rather than an optimal one. We model a network topology to be a graph in which each node represents a LAN and an edge between two nodes meam that both LANs are adjacent. It is specially notable that the term “neighbors” used in OUT algorithm is the set of nodes within the scope of the radius of the service range (called the locdlry).

There is a variable which is used to record whether this node is a member of the set of the candidate MHAs. Its initial value is assigned null. During the run time, the value of the status can be null, holding non-member and member. When the algorithm ends, the siaius must be either “member” or “non-member”. The MRs at the “member” nodes (LANs) are the possible MHA candidates. Each LAN can randomly choose one to be the MHA, but must meet the constraint of the service range. Once the MHA is decided, it cannot be changed during the multicast session.

1: At the start each node broadcasts its degree (i. e. , the number of adjacent nodes) to the neighbors of its locality. The TTL (Time-To-Live) field in the IP header can be used to limit the scope of this broadcast message. For a node, excluding the non-member nodes and holding nodes in its locality, if slatus = null and it has the highest degree in its locality, it must becomes the member node. Thus, sfafus = member and it broadcasts the MEMBER message to the neighbors. Lowest-ID tiebreakers are used bere. When receiving the MEMBER message, a node whose status is not ready (i. e.

, neither “member” nor “nonmember”) sets its stam to be “non-member” and broadcasts a NON-MEMBER message to the neighbors. If a node’s status is not ready and there exits a nonmember adjacent node, its sfaim is set to be “holding” (temporary status) and it sends “HOLDING” message to the neighbors. For a node, status = holding and all other nodes’ statuses in its locality are either non-member or holding. The status can be changed to member if it has the highest degree among all holding nodes in its locality. Lowest- W tiebreakers are also used here. Like the above rules, status update needs to inform all nodes in its locality.

6 When all nodes decide their statuses, the algorithm ends. 3. SYSTEM ANALYSIS AND DECRIPTION 3. 1 EXISTING SYSTEM The existing system of this project consumes more band width for the Internet Protocol multicast tree. It does not support the dynamic group of members and mobility of group members. Most previous works for mobile multicast in the heterogeneous wireless networks focus on the efficient mechanisms to provide seamless handover between different networks and the related security issues only. Apart from that there are no existing system deals the problem 3.

2 PROPOSED SYSTEM The aim of the proposed system is to reduce the bandwidth cost of an internet protocol multicast tree. This can be achieved through adaptively selecting the cell and the wireless technology for each mobile host to join the multicast group. This can be done through finding the shortest path. That the bandwidth consumption in the shortest path tree can be reduced in the heterogeneous wireless networks because the routing of the shortest path tree here is more flexible. The shortest path tree in the heterogeneous wireless networks consists of two parts.

The first one is composed of the cell and the wireless technology chosen by each mobile host. The second one is comprised of the wired links that connect the root of the tree and the chosen cells. Therefore, we can change the routing of the shortest path tree by selecting different cells and wireless technologies for the mobile hosts to reduce the bandwidth consumption. the selection of the cell and the wireless technology for each mobile host as an optimization problem, which is denoted as the Cell and Technology Selection Problem (CTSP) in the heterogeneous wireless networks for multicast communications.

The problem is to select the cell and the wireless technology for each group member to minimize the total bandwidth cost of the shortest path tree. We design a mechanism. 3. 3 PROJECT DESCRIPTION EFFICIENT RESOURCE ALLOCATION OUR MECHANISM SUPPORTS THE DYNAMIC GROUP MEMBERSHIP AND OFFERS MOBILITY OF GROUP MEMBERS. WE FORMULATE THE SELECTION OF THE CELL AND THE WIRELESS TECHNOLOGY FOR EACH MOBILE HOST IN THE HETEROGENEOUS WIRELESS NETWORKS AS AN OPTIMIZATION PROBLEM. WE USE INTEGER LINEAR PROGRAMMING TO MODEL THE PROBLEM AND SHOW THAT THE PROBLEM IS NP-HARD.

TO SOLVE THE PROBLEM, WE PROPOSE A DISTRIBUTED ALGORITHM BASED ON LAGRANGEAN RELAXATION AND A NETWORK PROTOCOL BASED ON THE ALGORITHM. THE SIMULATION RESULTS SHOW THAT OUR MECHANISM CAN EFFECTIVELY SAVE THE WIRELESS AND WIRE LINE BANDWIDTH AS COMPARED TO THE TRADITIONAL IP MULTICAST. THIS CAN BE ACHIEVED THROUGH SELECTING THE CELL AND THE WIRELESS TECHNOLOGY FOR EACH MOBILE HOST TO JOIN THE MULTICAST GROUP. AS A RESULT BANDWIDTH COST OF AN INTERNET PROTOCOL MULTICAST TREE WILL BE REDUCED. 3. 4 MODULES MODULE INPUT: We provide the number of nodes we required. Then the source and destination nodes are provided.

MODULE OUTPUT: The expected output of the module is to show the shortest path between the source and destination mobile 3. 5 FEASIBILITY STUDY The feasibility of the project is analyzed in this phase and business proposal is put forth with a very general plan for the project and some cost estimates. During system analysis the feasibility study of the proposed system is to be carried out. This is to ensure that the proposed system is not a burden to the company. For feasibility analysis, some understanding of the major requirements for the system is essential.

Three key considerations involved in the feasibility analysis are • ECONOMICAL FEASIBILITY • TECHNICAL FEASIBILITY • SOCIAL FEASIBILITY ECONOMICAL FEASIBILITY This study is carried out to check the economic impact that the system will have on the organization. The amount of fund that the company can pour into the research and development of the system is limited. The expenditures must be justified. Thus the developed system as well within the budget and this was achieved because most of the technologies used are freely available. Only the customized products had to be purchased.

TECHNICAL FEASIBILITY This study is carried out to check the technical feasibility, that is, the technical requirements of the system. Any system developed must not have a high demand on the available technical resources. This will lead to high demands on the available technical resources. This will lead to high demands being placed on the client. The developed system must have a modest requirement, as only minimal or null changes are required for implementing this system. SOCIAL FEASIBILITY The aspect of study is to check the level of acceptance of the system by the user.

This includes the process of training the user to use the system efficiently. The user must not feel threatened by the system, instead must accept it as a necessity. The level of acceptance by the users solely depends on the methods that are employed to educate the user about the system and to make him familiar with it. His level of confidence must be raised so that he is also able to make some constructive criticism, which is welcomed, as he is the final user of the system. 3. 6 SDLC Model. THE INCREMENTAL, ITERATIVE SOFTWARE ENGINEERING LIFE CYCLE:

When we defining and constructing credit card validation systems will uncover many requirements that may be difficult at outset. Instead knowledge of the system and requirements will grow as work progress the whole software engineering process is designed to uncover details and incompatibilities in the requirements that may not be obvious to customer and bankers at outset. Several cases or increments of software development additional increases will be build and delivered in successive increment system normally involves as are deliver successive new versions, the development of first version from

sketch called green field development is special case of incremental development the development of first increment is an important activity series we establish the architectural base that must last for the entire system’s life time. WATERFALL LIFECYCLE MODEL: Waterfall model states that the phases (analysis, design, and coding, testing, support) are systematized in a linear order and each phase should accomplished entirely earlier of the next phase begins.

In this way the step by step phase initially analysing phase is completed and that output takes place at the end of analyze phase after that output will be given as input for the design phase, depending on the inputs it generates all design steps ,like ways all phases processed and produced all successful outputs, And will to find out whether the project is pursuing on the exact path or not. If not the project may be discard or any other action takes place to continue. The model is the most commonly used and also known as linear sequential lifecycle model. ADVANTAGES: 1.

This model is very easy to use and implement. 2. Each phase is completed at a time and processed. 3. This model better works for smaller projects if only the requirements are well understood. 4. In each phase have deliverables and that must be reviewed. DISADVANTAGES: 1. If the requirements are gathered are inaccurate then the final product is inaccurate and the error is known in the final phase of the model. Any sort of errors that cannot be detected in any previous phase. 2. For long, object-oriented, complex and ongoing projects it’s a poor model. 3. This model has high risks. [pic]

Fig: Waterfall Lifecycle Model PROTOTYPE MODEL: In this model the requirements are gathered firstly, and the prototype is deployed according to the requirements. This prototype is a quick design which goes through the coding, design and testing. The phases are not done in detail. By seeing this prototype the client feels like a real system, so that the client understands the entire requirements of the systems. ADVANTAGES: 1. During the development process the developers are interestingly engaged. 2. The prototype developed that is used by the users for well understanding of the methodology 3.

The user involvement is increased and improved. 4. The flaws and faults are identified early. 5. The user’s opinion about the product is known early which leads to an improved system. DISADVANTAGES: 1. This model focuses on design quite than functionality. 2. The model is implemented firstly and then errors are evaluated later which becomes a complex process 3. The model is also known as throw-away prototype. 4. More time spent on development of the prototype that result in delay of the final product. Fig: Prototyping Methodology. 4. SOFTWARE REQUIREMENT SPECIFICATION 4.

1 SOFTWARE CONFIGURATION • Operating system :- Windows XP Professional • Front End :- Microsoft Visual Studio . Net 2005 • Coding Language:- C#. NET 4. 2 HARDWARE CONFIGURATION • SYSTEM: Pentium IV 2. 4 GHz • HARD DISK: 40 GB • FLOPPY DRIVE: 1. 44 MB • MONITOR: 15 VGA colour • MOUSE: Logitech. • RAM: 256 MB • KEYBOARD : 110 keys enhanced. 0. LANGUAGES OF IMPLEMENTATION 5. 1 FEATURES OF. NET MICROSOFT . NET IS A SET OF MICROSOFT SOFTWARE TECHNOLOGIES FOR RAPIDLY BUILDING AND INTEGRATING XML WEB SERVICES, MICROSOFT WINDOWS-BASED APPLICATIONS, AND WEB SOLUTIONS. THE .

NET FRAMEWORK IS A LANGUAGE-NEUTRAL PLATFORM FOR WRITING PROGRAMS THAT CAN EASILY AND SECURELY INTEROPERATE. THERE’S NO LANGUAGE BARRIER WITH . NET: THERE ARE NUMEROUS LANGUAGES AVAILABLE TO THE DEVELOPER INCLUDING MANAGED C++, C#, VISUAL BASIC AND JAVA SCRIPT. THE . NET FRAMEWORK PROVIDES THE FOUNDATION FOR COMPONENTS TO INTERACT SEAMLESSLY, WHETHER LOCALLY OR REMOTELY ON DIFFERENT PLATFORMS. IT STANDARDIZES COMMON DATA TYPES AND COMMUNICATIONS PROTOCOLS SO THAT COMPONENTS CREATED IN DIFFERENT LANGUAGES CAN EASILY INTEROPERATE. “. NET” is also the collective name given to various software components built upon the .

NET platform. These will be both products (Visual Studio. NET and Windows. NET Server, for instance) and services (like Passport, . NET My Services, and so on). THE . NET FRAMEWORK The . NET Framework has two main parts: 1. The Common Language Runtime (CLR). 2. A hierarchical set of class libraries. • The CLR is described as the “execution engine” of . NET. It provides the environment within which programs run. The most important features are • Conversion from a low-level assembler-style language, called Intermediate Language (IL), into code native to the platform being executed on.

• Memory management, notably including garbage collection. • Checking and enforcing security restrictions on the running code. • Loading and executing programs, with version control and other such features. The following features of the . NET framework are also worth description: Managed Code The code that targets . NET, and which contains certain extra Information – “metadata” – to describe itself. Whilst both managed and unmanaged code can run in the runtime, only managed code contains the information that allows the CLR to guarantee, for instance, safe execution and interoperability.

Managed Data With Managed Code comes Managed Data. CLR provides memory allocation and Deal location facilities, and garbage collection. Some . NET languages use Managed Data by default, such as C#, Visual Basic. NET and JScript. NET, whereas others, namely C++, do not. Targeting CLR can, depending on the language you’re using, impose certain constraints on the features available. As with managed and unmanaged code, one can have both managed and unmanaged data in . NET applications – data that doesn’t get garbage collected but instead is looked after by unmanaged code.

Common Type System The CLR uses something called the Common Type System (CTS) to strictly enforce type-safety. This ensures that all classes are compatible with each other, by describing types in a common way. CTS define how types work within the runtime, which enables types in one language to interoperate with types in another language, including cross-language exception handling. As well as ensuring that types are only used in appropriate ways, the runtime also ensures that code doesn’t attempt to access memory that hasn’t been allocated to it. Common Language Specification

The CLR provides built-in support for language interoperability. To ensure that you can develop managed code that can be fully used by developers using any programming language, a set of language features and rules for using them called the Common Language Specification (CLS) has been defined. Components that follow these rules and expose only CLS features are considered CLS-compliant. THE CLASS LIBRARY .NET provides a single-rooted hierarchy of classes, containing over 7000 types. The root of the namespace is called System; this contains basic types like Byte, Double, Boolean, and String, as well as Object.

All objects derive from System. Object. As well as objects, there are value types. Value types can be allocated on the stack, which can provide useful flexibility. There are also efficient means of converting value types to object types if and when necessary. The set of classes is pretty comprehensive, providing collections, file, screen, and network I/O, threading, and so on, as well as XML and database connectivity. The class library is subdivided into a number of sets (or namespaces), each providing distinct areas of functionality, with dependencies between the namespaces kept to a minimum.

LANGUAGES SUPPORTED BY . NET The multi-language capability of the . NET Framework and Visual Studio . NET enables developers to use their existing programming skills to build all types of applications and XML Web services. The . NET framework supports new versions of Microsoft’s old favorites Visual Basic and C++ (as VB. NET and Managed C++), but there are also a number of new additions to the family. Visual Basic . NET has been updated to include many new and improved language features that make it a powerful object-oriented programming language.

These features include inheritance, interfaces, and overloading, among others. Visual Basic also now supports structured exception handling, custom attributes and also supports multi-threading. Visual Basic . NET is also CLS compliant, which means that any CLS-compliant language can use the classes, objects, and components you create in Visual Basic . NET. Managed Extensions for C++ and attributed programming are just some of the enhancements made to the C++ language. Managed Extensions simplify the task of migrating existing C++ applications to the new . NET Framework.

C# is Microsoft’s new language. It’s a C-style language that is essentially “C++ for Rapid Application Development”. Unlike other languages, its specification is just the grammar of the language. It has no standard library of its own, and instead has been designed with the intention of using the . NET libraries as its own. Microsoft Visual J# . NET provides the easiest transition for Java-language developers into the world of XML Web Services and dramatically improves the interoperability of Java-language programs with existing software written in a variety of other programming languages.

Active State has created Visual Perl and Visual Python, which enable . NET-aware applications to be built in either Perl or Python. Both products can be integrated into the Visual Studio . NET environment. Visual Perl includes support for Active State’s Perl Dev Kit. Other languages for which . NET compilers are available include • FORTRAN • COBOL • Eiffel Fig1 . Net Framework | ASP. NET | Windows Forms

| |XML WEB SERVICES | | | Base Class Libraries | | Common Language Runtime | | Operating System | C#. NET is also compliant with CLS (Common Language Specification) and supports structured exception handling. CLS is set of rules and constructs that are supported by the CLR (Common Language Runtime).

CLR is the runtime environment provided by the . NET Framework; it manages the execution of the code and also makes the development process easier by providing services. C#. NET is a CLS-compliant language. Any objects, classes, or components that created in C#. NET can be used in any other CLS-compliant language. In addition, we can use objects, classes, and components created in other CLS-compliant languages in C#. NET . The use of CLS ensures complete interoperability among applications, regardless of the languages used to create the application. CONSTRUCTORS AND DESTRUCTORS:

Constructors are used to initialize objects, whereas destructors are used to destroy them. In other words, destructors are used to release the resources allocated to the object. In C#. NET the sub finalize procedure is available. The sub finalize procedure is used to complete the tasks that must be performed when an object is destroyed. The sub finalize procedure is called automatically when an object is destroyed. In addition, the sub finalize procedure can be called only from the class it belongs to or from derived classes. GARBAGE COLLECTION Garbage Collection is another new feature in C#. NET. The .

NET Framework monitors allocated resources, such as objects and variables. In addition, the . NET Framework automatically releases memory for reuse by destroying objects that are no longer in use. In C#. NET, the garbage collector checks for the objects that are not currently in use by applications. When the garbage collector comes across an object that is marked for garbage collection, it releases the memory occupied by the object. OVERLOADING Overloading is another feature in C#. Overloading enables us to define multiple procedures with the same name, where each procedure has a different set of arguments.

Besides using overloading for procedures, we can use it for constructors and properties in a class. MULTITHREADING: C#. NET also supports multithreading. An application that supports multithreading can handle multiple tasks simultaneously, we can use multithreading to decrease the time taken by an application to respond to user interaction. STRUCTURED EXCEPTION HANDLING C#. NET supports structured handling, which enables us to detect and remove errors at runtime. In C#. NET, we need to use Try…Catch…Finally statements to create exception handlers.

Using Try…Catch…Finally statements, we can create robust and effective exception handlers to improve the performance of our application. THE . NET FRAMEWORK The . NET Framework is a new computing platform that simplifies application development in the highly distributed environment of the Internet. Objectives of. NET FRAMEWORK 1. To provide a consistent object-oriented programming environment whether object codes is stored and executed locally on Internet-distributed, or executed remotely. 2. To provide a code-execution environment to minimizes software deployment and guarantees safe execution of code.

3. Eliminates the performance problems. There are different types of application, such as Windows-based applications and Web-based applications. 6. SOFTWARE DESIGN SYSTEM ARCHITECTURE: [pic] 6. 1 . 1 UML Diagrams: Use case diagram: [pic] In the above use case Diagram User can have the capability of Login, Add Nodes , Mobility and bandwidth consumption. 6. 1. 2 Class diagram: [pic] In the above class Diagram The classes are Login, Addnodes, Resource allocation and Legranges Path. 6. 1. 3 Object diagram: [pic] In the above object Diagram the object is client.

Different functionalities are add nodes, provide source and Destination And apply the algorithm and find path. 6. 1. 4 State diagram: [pic] 6. 1. 5 SEQUENCE DIAGRAM: [pic] 6. 1. 6 E-R DIAGRAM : [pic] [pic] 6. 2. 1 PROJECT FLOW DIAGRAM: 6. 5 SCREEN SHOTS Starting the Application [pic] Started the application and added the Nodes. Lagrangean Path [pic] Drew the Lagranges 7. 0 CODE Public Class frmSimulation Inherits System. Windows. Forms. Form #Region ” Windows Form Designer generated code ” Public Sub New() MyBase. New() ‘This call is required by the Windows Form Designer. InitializeComponent()

‘Add any initialization after the InitializeComponent() call End Sub ‘Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components. Dispose() End If End If MyBase. Dispose(disposing) End Sub ‘Required by the Windows Form Designer Private components As System. ComponentModel. IContainer ‘NOTE: The following procedure is required by the Windows Form Designer ‘It can be modified using the Windows Form Designer. ‘Do not modify it using the code editor. Friend WithEvents gboxMain As System. Windows. Forms.

GroupBox Friend WithEvents picMap As System. Windows. Forms. PictureBox Friend WithEvents timerMain As System. Windows. Forms. Timer Friend WithEvents btStart As System. Windows. Forms. Button Friend WithEvents StatusBar As System. Windows. Forms. StatusBar Friend WithEvents StatusBarPanel1 As System. Windows. Forms. StatusBarPanel Friend WithEvents StatusBarPanel2 As System. Windows. Forms. StatusBarPanel Friend WithEvents StatusBarPanel3 As System. Windows. Forms. StatusBarPanel Friend WithEvents StatusBarPanel4 As System. Windows. Forms. StatusBarPanel Friend WithEvents StatusBarPanel5 As System.

Windows. Forms. StatusBarPanel Friend WithEvents btMobilityRouting As System. Windows. Forms. Button Friend WithEvents btRouting As System. Windows. Forms. Button Friend WithEvents txtResult As System. Windows. Forms. TextBox Friend WithEvents btComparison As System. Windows. Forms. Button Friend WithEvents txtNetworkModel As System. Windows. Forms. TextBox Friend WithEvents btMobility As System. Windows. Forms. Button Friend WithEvents btRefreshMap As System. Windows. Forms. Button Friend WithEvents txtPath1 As System. Windows. Forms. TextBox Friend WithEvents txtPath2 As System.

Windows. Forms. TextBox Private Sub InitializeComponent() Me. components = New System. ComponentModel. Container Me. gboxMain = New System. Windows. Forms. GroupBox Me. txtPath2 = New System. Windows. Forms. TextBox Me. btRefreshMap = New System. Windows. Forms. Button Me. btMobility = New System. Windows. Forms. Button Me. btComparison = New System. Windows. Forms. Button Me. txtResult = New System. Windows. Forms. TextBox Me. btRouting = New System. Windows. Forms. Button Me. txtPath1 = New System. Windows. Forms. TextBox Me. btMobilityRouting = New System. Windows. Forms. Button Me. btStart = New System.

Windows. Forms. Button Me. txtNetworkModel = New System. Windows. Forms. TextBox Me. picMap = New System. Windows. Forms. PictureBox Me. timerMain = New System. Windows. Forms. Timer(Me. components) Me. StatusBar = New System. Windows. Forms. StatusBar Me. StatusBarPanel4 = New System. Windows. Forms. StatusBarPanel Me. StatusBarPanel1 = New System. Windows. Forms. StatusBarPanel Me. StatusBarPanel2 = New System. Windows. Forms. StatusBarPanel Me. StatusBarPanel3 = New System. Windows. Forms. StatusBarPanel Me. StatusBarPanel5 = New System. Windows. Forms. StatusBarPanel Me.

gboxMain. SuspendLayout() CType(Me. picMap, System. ComponentModel. ISupportInitialize). BeginInit() CType(Me. StatusBarPanel4, System. ComponentModel. ISupportInitialize). BeginInit() CType(Me. StatusBarPanel1, System. ComponentModel. ISupportInitialize). BeginInit() CType(Me. StatusBarPanel2, System. ComponentModel. ISupportInitialize). BeginInit() CType(Me. StatusBarPanel3, System. ComponentModel. ISupportInitialize). BeginInit() CType(Me. StatusBarPanel5, System. ComponentModel. ISupportInitialize). BeginInit() Me. SuspendLayout() ‘ ‘gboxMain ‘ Me. gboxMain.

BackColor = System. Drawing. Color. DarkGray Me. gboxMain. Controls. Add(Me. picMap) Me. gboxMain. Controls. Add(Me. txtPath2) Me. gboxMain. Controls. Add(Me. btMobility) Me. gboxMain. Controls. Add(Me. txtResult) Me. gboxMain. Controls. Add(Me. btRouting) Me. gboxMain. Controls. Add(Me. txtPath1) Me. gboxMain. Controls. Add(Me. btMobilityRouting) Me. gboxMain. Controls. Add(Me. btStart) Me. gboxMain. Controls. Add(Me. txtNetworkModel) Me. gboxMain. Controls. Add(Me. btComparison) Me. gboxMain. Controls. Add(Me. btRefreshMap) Me. gboxMain. Location = New System. Drawing. Point(8, 5) Me. gboxMain.

Name = “gboxMain” Me. gboxMain. Size = New System. Drawing. Size(648, 424) Me. gboxMain. TabIndex = 0 Me. gboxMain. TabStop = False ‘ ‘txtPath2 ‘ Me. txtPath2. BackColor = System. Drawing. Color. LightGray Me. txtPath2. Font = New System. Drawing. Font(“Verdana”, 8. 25! , System. Drawing. FontStyle. Regular, System. Drawing. GraphicsUnit. Point, CType(0, Byte)) Me. txtPath2. Location = New System. Drawing. Point(440, 259) Me. txtPath2. Multiline = True Me. txtPath2. Name = “txtPath2” Me. txtPath2. ReadOnly = True Me. txtPath2. ScrollBars = System. Windows. Forms. ScrollBars. Both Me.

txtPath2. Size = New System. Drawing. Size(200, 149) Me. txtPath2. TabIndex = 11 ‘ ‘btRefreshMap ‘ Me. btRefreshMap. Location = New System. Drawing. Point(440, 106) Me. btRefreshMap. Name = “btRefreshMap” Me. btRefreshMap. Size = New System. Drawing. Size(200, 24) Me. btRefreshMap. TabIndex = 10 Me. btRefreshMap. Text = “&Refresh Map” Me. btRefreshMap. Visible = False ‘ ‘btMobility ‘ Me. btMobility. BackColor = System. Drawing. Color. LightGray Me. btMobility. Location = New System. Drawing. Point(440, 160) Me. btMobility. Name = “btMobility” Me. btMobility. Size = New System.

Drawing. Size(200, 42) Me. btMobility. TabIndex = 9 Me. btMobility. Text = “Start &Mobility” Me. btMobility. UseVisualStyleBackColor = False ‘ ‘btComparison ‘ Me. btComparison. Location = New System. Drawing. Point(440, 202) Me. btComparison. Name = “btComparison” Me. btComparison. Size = New System. Drawing. Size(200, 24) Me. btComparison. TabIndex = 8 Me. btComparison. Text = “&Comparison” Me. btComparison. Visible = False ‘ ‘txtResult ‘ Me. txtResult. BackColor = System. Drawing. Color. LightGray Me. txtResult. Font = New System. Drawing. Font(“Verdana”, 8. 25! , System. Drawing.

FontStyle. Regular, System. Drawing. GraphicsUnit. Point, CType(0, Byte)) Me. txtResult. Location = New System. Drawing. Point(440, 321) Me. txtResult. Multiline = True Me. txtResult. Name = “txtResult” Me. txtResult. ReadOnly = True Me. txtResult. ScrollBars = System. Windows. Forms. ScrollBars. Both Me. txtResult. Size = New System. Drawing. Size(200, 87) Me. txtResult. TabIndex = 7 ‘ ‘btRouting ‘ Me. btRouting. Location = New System. Drawing. Point(440, 172) Me. btRouting. Name = “btRouting” Me. btRouting. Size = New System. Drawing. Size(200, 24) Me. btRouting.

TabIndex = 6 Me. btRouting. Text = “&Single Neighborset Routing” Me. btRouting. Visible = False ‘ ‘txtPath1 ‘ Me. txtPath1. Font = New System. Drawing. Font(“Verdana”, 8. 25! , System. Drawing. FontStyle. Regular, System. Drawing. GraphicsUnit. Point, CType(0, Byte)) Me. txtPath1. Location = New System. Drawing. Point(440, 259) Me. txtPath1. Multiline = True Me. txtPath1. Name = “txtPath1” Me. txtPath1. ReadOnly = True Me. txtPath1. ScrollBars = System. Windows. Forms. ScrollBars. Both Me. txtPath1. Size = New System. Drawing. Size(200, 56) Me. txtPath1. TabIndex = 5 Me. txtPath1. Visible = False

‘ ‘btMobilityRouting ‘ Me. btMobilityRouting. BackColor = System. Drawing. Color. LightGray Me. btMobilityRouting. Location = New System. Drawing. Point(440, 202) Me. btMobilityRouting. Name = “btMobilityRouting” Me. btMobilityRouting. Size = New System. Drawing. Size(200, 50) Me. btMobilityRouting. TabIndex = 4 Me. btMobilityRouting. Text = “Lagrangian Path” Me. btMobilityRouting. UseVisualStyleBackColor = False ‘ ‘btStart ‘ Me. btStart. BackColor = System. Drawing. Color. LightGray Me. btStart. Location = New System. Drawing. Point(440, 106) Me. btStart. Name = “btStart”

Me. btStart. Size = New System. Drawing. Size(200, 48) Me. btStart. TabIndex = 2 Me. btStart. Text = “&Add Nodes” Me. btStart. UseVisualStyleBackColor = False ‘ ‘txtNetworkModel ‘ Me. txtNetworkModel. BackColor = System. Drawing. Color. LightGray Me. txtNetworkModel. Font = New System. Drawing. Font(“Verdana”, 8. 25! , System. Drawing. FontStyle. Regular, System. Drawing. GraphicsUnit. Point, CType(0, Byte)) Me. txtNetworkModel. Location = New System. Drawing. Point(440, 13) Me. txtNetworkModel. Multiline = True Me. txtNetworkModel. Name = “txtNetworkModel” Me. txtNetworkModel. ReadOnly = True

Me. txtNetworkModel. ScrollBars = System. Windows. Forms. ScrollBars. Both Me. txtNetworkModel. Size = New System. Drawing. Size(200, 87) Me. txtNetworkModel. TabIndex = 0 ‘ ‘picMap ‘ Me. picMap. BackColor = System. Drawing. Color. LightGray Me. picMap. BorderStyle = System. Windows. Forms. BorderStyle. FixedSingle Me. picMap. Location = New System. Drawing. Point(8, 14) Me. picMap. Name = “picMap” Me. picMap. Size = New System. Drawing. Size(420, 400) Me. picMap. TabIndex = 0 Me. picMap. TabStop = False ‘ ‘timerMain ‘ Me. timerMain. Interval = 1000 ‘ ‘StatusBar ‘ Me. StatusBar.

Location = New System. Drawing. Point(0, 438) Me. StatusBar. Name = “StatusBar” Me. StatusBar. Panels. AddRange(New System. Windows. Forms. StatusBarPanel() {Me. StatusBarPanel4, Me. StatusBarPanel1, Me. StatusBarPanel2, Me. StatusBarPanel3, Me. StatusBarPanel5}) Me. StatusBar. ShowPanels = True Me. StatusBar. Size = New System. Drawing. Size(664, 16) Me. StatusBar. TabIndex = 4 ‘ ‘StatusBarPanel4 ‘ Me. StatusBarPanel4. AutoSize = System. Windows. Forms. StatusBarPanelAutoSize. Spring Me. StatusBarPanel4. Name = “StatusBarPanel4” Me. StatusBarPanel4. Text = “simulationTime:” Me.

StatusBarPanel4. Width = 136 ‘ ‘StatusBarPanel1 ‘ Me. StatusBarPanel1. AutoSize = System. Windows. Forms. StatusBarPanelAutoSize. Spring Me. StatusBarPanel1. Name = “StatusBarPanel1” Me. StatusBarPanel1. Text = “currentNode:” Me. StatusBarPanel1. Width = 136 ‘ ‘StatusBarPanel2 ‘ Me. StatusBarPanel2. AutoSize = System. Windows. Forms. StatusBarPanelAutoSize. Spring Me. StatusBarPanel2. Name = “StatusBarPanel2” Me. StatusBarPanel2. Text = “sourceNode:” Me. StatusBarPanel2. Width = 136 ‘ ‘StatusBarPanel3 ‘ Me. StatusBarPanel3. AutoSize = System. Windows. Forms. StatusBarPanelAutoSize. Spring Me.

StatusBarPanel3. Name = “StatusBarPanel3” Me. StatusBarPanel3. Text = “destinationNode:” Me. StatusBarPanel3. Width = 136 ‘ ‘StatusBarPanel5 ‘ Me. StatusBarPanel5. Name = “StatusBarPanel5” Me. StatusBarPanel5. Text = “XY:” ‘ ‘frmSimulation ‘ Me. AutoScaleBaseSize = New System. Drawing. Size(5, 13) Me. BackColor = System. Drawing. Color. DarkGray Me. ClientSize = New System. Drawing. Size(664, 454) Me. Controls. Add(Me. StatusBar) Me. Controls. Add(Me. gboxMain) Me. MaximizeBox = False Me. MinimizeBox = False Me. Name = “frmSimulation” Me. ShowInTaskbar = False Me. StartPosition = System. Windows. Forms.

FormStartPosition. Manual Me. Text = “Efficient WireLess Multicast” Me. gboxMain. ResumeLayout(False) Me. gboxMain. PerformLayout() CType(Me. picMap, System. ComponentModel. ISupportInitialize). EndInit() CType(Me. StatusBarPanel4, System. ComponentModel. ISupportInitialize). EndInit() CType(Me. StatusBarPanel1, System. ComponentModel. ISupportInitialize). EndInit() CType(Me. StatusBarPanel2, System. ComponentModel. ISupportInitialize). EndInit() CType(Me. StatusBarPanel3, System. ComponentModel. ISupportInitialize). EndInit() CType(Me. StatusBarPanel5, System. ComponentModel.

ISupportInitialize). EndInit() Me. ResumeLayout(False) End Sub #End Region Dim tMap As New Map Dim tSeconds As Integer Dim tGraphics As Graphics, tPen As New Pen(Color. Black, 1) Dim tFont As New Font(“Verdana”, 8), tBrush As Brush Dim simulationRunning As Boolean Dim simulationStarted As Boolean Private Sub frmSimulation_Load(ByVal sender As System. Object, ByVal e As System. EventArgs) Handles MyBase. Load Dim tbmp1 As New Bitmap(Application. StartupPath + “\manet. bmp”) ‘picMap. Image = tbmp1 ‘picMap. Refresh() timerMain. Interval = 50 End Sub Private Sub btStart_Click(ByVal sender As System.

Object, ByVal e As System. EventArgs) Handles btStart. Click tGraphics = picMap. CreateGraphics() tBrush = Brushes. Black Dim tStr As String tStr = InputBox(“Enter Number of Nodes:”, strTitle, “200”) If Val(tStr) = 0 Then Exit Sub maxNodes = Val(tStr) btStart. Enabled = False timerMain. Enabled = True timerMain. Start() End Sub Private Sub timerMain_Tick(ByVal sender As System. Object, ByVal e As System. EventArgs) Handles timerMain. Tick If tMap. getTotalNodesCount() >= maxNodes Then simulationRunning = False timerMain. Enabled = False SetNetworkModelText() Else tSeconds = tSeconds + 1

StatusBar. Panels(0). Text = “simulationTime: ” + Trim(Str(tSeconds)) Call tMap. addNodes(tGraphics, tPen, tFont, tBrush) tMap. draw(tGraphics, tPen, tFont, tBrush) simulationRunning = True simulationStarted = True End If End Sub Private Sub frmSimulation_Closing(ByVal sender As Object, ByVal e As System. ComponentModel. CancelEventArgs) Handles MyBase. Closing End End Sub Function HighLightSelectedNodes() If sourceNode -1 Then Dim tx As Integer = tMap. MapCells(tMap. getCellNoOfNode(sourceNode)). getNodeX(tMap. getNodeIndexInCell(sourceNode)) Dim ty As Integer = tMap. MapCells(tMap.

getCellNoOfNode(sourceNode)). getNodeY(tMap. getNodeIndexInCell(sourceNode)) Dim tPen1 As New Pen(Color. Red, 2) tGraphics. DrawEllipse(tPen1, tx, ty, nodeRadius, nodeRadius) End If If destinationNode -1 Then Dim tx As Integer = tMap. MapCells(tMap. getCellNoOfNode(destinationNode)). getNodeX(tMap. getNodeIndexInCell(destinationNode)) Dim ty As Integer = tMap. MapCells(tMap. getCellNoOfNode(destinationNode)). getNodeY(tMap. getNodeIndexInCell(destinationNode)) Dim tPen1 As New Pen(Color. Red, 2) tGraphics. DrawEllipse(tPen1, tx, ty, nodeRadius, nodeRadius) End If

End Function Private Sub picMap_Click(ByVal sender As System. Object, ByVal e As System. EventArgs) Handles picMap. Click If currentNode >= 0 Then If sourceSelected = False Then sourceNode = currentNode sourceSelected = True HighLightSelectedNodes() Else If currentNode sourceNode Then destinationNode = currentNode sourceSelected = False HighLightSelectedNodes() “destinationNode: ” + Trim(Str(destinationNode)) End If End Sub Private Sub picMap_MouseMove(ByVal sender As Object, ByVal e As System. Windows. Forms. MouseEventArgs) Handles picMap. MouseMove If simulationStarted = True Then

Dim tx As Integer = e. X() Dim ty As Integer = e. Y() Dim i As Integer, j As Integer Dim x1 As Integer, x2 As Integer, y1 As Integer, y2 As Integer StatusBar. Panels(4). Text = “(” + Trim(Str(tx)) + “, ” + Trim(Str(ty)) + “)” Dim n As Integer = tMap. getTotalNodesCount() Dim trad As Integer = nodeRadius – 2 Dim flag As Boolean flag = False For i = 0 To tCellCount – 1 For j = 0 To tMap. MapCells(i). getNodeCount() – 1 x1 = tMap. MapCells(i). getNodeX(j) – trad + 2 x2 = tMap. MapCells(i). getNodeX(j) + trad + 2 y1 = tMap. MapCells(i).

getNodeY(j) – trad + 2 y2 = tMap. MapCells(i). getNodeY(j) + trad + 2 If between(tx, ty, x1, y1, x2, y2) = True Then flag = True currentNode = tMap. MapCells(i). getNodeId(j) Exit For End If If flag = True Then Exit For Next Next If flag = False Then currentNode = -1 End If StatusBar. Panels(1). Text = “currentNode: ” + Trim(Str(currentNode)) End If End Sub Private Sub btMobilityRouting_Click(ByVal sender As System. Object, ByVal e As System. EventArgs) Handles btMobilityRouting. Click If sourceNode = -1 Or destinationNode = -1 Then

Exit Sub End If DrawPathFlag = True PathType = DualNeighborsetRouting tMap. findRouteMobility(tGraphics, tPen, tFont, tBrush) End Sub Private Sub btRouting_Click(ByVal sender As System. Object, ByVal e As System. EventArgs) Handles btRouting. Click If sourceNode = -1 Or destinationNode = -1 Then Exit Sub End If DrawPathFlag = True PathType = SingleNeighborsetRouting tMap. findRoute(tGraphics, tPen, tFont, tBrush) End Sub Private Sub btComparison_Click(ByVal sender As System. Object, ByVal e As System. EventArgs) Handles btComparison. Click Dim t As Integer Randomize() DrawPathFlag = False

DestReachedCount = 0 MobilityDestReachedCount = 0 Dim tStr As String tStr = InputBox(“Enter SimulationCount:”, strTitle, “50”) If Val(tStr) = 0 Then Exit Sub SimulationCount = Val(tStr) For t = 0 To SimulationCount – 1 Dim tSourceNode As Integer = -1, tDestinationNode As Integer = -1 tSourceNode = Rnd() * maxNodes tDestinationNode = Rnd() * maxNodes If tDestinationNode = tSourceNode Then tDestinationNode += 1 End If If tDestinationNode > maxNodes Then tDestinationNode = 0 End If If tSourceNode -1 And tDestinationNode -1 Then sourceNode = tSourceNode destinationNode = tDestinationNode tMap.

findRoute(tGraphics, tPen, tFont, tBrush) tMap. findRouteMobility(tGraphics, tPen, tFont, tBrush) End If Application. DoEvents() Next AddResultText(“Result:” + vbCrLf) Dim deliveryRatioOld As Double = (DestReachedCount / SimulationCount) * 100 Dim deliveryRatioNew As Double = (MobilityDestReachedCount / SimulationCount) * 100 AddResultText(“DeliveryRatio:” + vbCrLf) AddResultText(“Single Neighborset: ” + MyFormatNumber(deliveryRatioOld) + “%” + vbCrLf) AddResultText(“Proposed Dual Neighborset: ” + MyFormatNumber(deliveryRatioNew) + “%” + vbCrLf) btComparison.

Enabled = False End Sub Function AddResultText(ByVal tStr As String) txtResult. Text = txtResult. Text + tStr End Function Function SetNetworkModelText() txtNetworkModel. Text = tMap. getNodeListString() + vbCrLf txtNetworkModel. Refresh() End Function Private Sub btMobility_Click(ByVal sender As System. Object, ByVal e As System. EventArgs) Handles btMobility. Click Dim tStr As String tStr = InputBox(“Enter MovementCount:”, strTitle, “20”) If Val(tStr) = 0 Then Exit Sub Dim maxMovements As Integer = Val(tStr) Dim t As Integer For t = 0 To maxMovements – 1 tMap.

MoveRandomNode(tGraphics, tPen, tFont, tBrush) Application. DoEvents() Next End Sub Private Sub btRefreshMap_Click(ByVal sender As System. Object, ByVal e As System. EventArgs) Handles btRefreshMap. Click tMap. draw(tGraphics, tPen, tFont, tBrush) End Sub Private Sub StatusBar_PanelClick(ByVal sender As System. Object, ByVal e As System. Windows. Forms. StatusBarPanelClickEventArgs) Handles StatusBar. PanelClick End Sub End Class Module modGlobal ‘globals Public strTitle As String ‘forms Public tfrmMDIMain As New frmMDIMain Public tfrmSimulation As New frmSimulation

Public Sub Main() Randomize() strTitle = “Efficient Broadcasting” tfrmSimulation. MdiParent = tfrmMDIMain tfrmSimulation. Show() tfrmMDIMain. ShowDialog() End Sub Public Function Quit() Dim tChoice As Integer tChoice = MsgBox(“Sure to Quit? “, MsgBoxStyle. YesNo Or MsgBoxStyle. Question, strTitle) If tChoice = vbYes Then End End Function Function between(ByVal x As Integer, ByVal y As Integer, ByVal x1 As Integer, ByVal y1 As Integer, ByVal x2 As Integer, ByVal y2 As Integer) As Boolean Dim flag As Boolean = False If x >= x1 And x = y1 And y = 0 And tindex

Haven’t Found A Paper?

Let us create the best one for you! What is your topic?

By clicking "SEND", you agree to our terms of service and privacy policy. We'll occasionally send you account related and promo emails.

Haven't found the Essay You Want?

Get your custom essay sample

For Only $13/page

Eric from Graduateway Hi there, would you like to get an essay? What is your topic? Let me help you

logo