load balancing implementation in wireless networks

Download Load balancing implementation in wireless networks

If you can't read please download the document

Upload: muthu-kumaar

Post on 18-Nov-2014

772 views

Category:

Education


1 download

DESCRIPTION

 

TRANSCRIPT

NOVEL LOAD-BALANCING APPROACH IN WIRELESS NETWORKS

A PROJECT REPORTSubmitted byKALYANARAMAN.S (011003099)

MUTHU KUMAAR.T (011003142)

VIGNESH.H (011003254)

Submitted in partial fulfillment of the requirements for the award of the Degree of B.Tech. (Computer Science & Engineering)

of

SASTRA University

2009-2010

Under the Guidance and supervision of

Dr.A.Umamakeswari

Associate Dean, School Of Computing

SASTRA University,Tirumalaisamudram

ABSTRACT:

The default Strongest-Signal-First (SSF) approach used in 802.11 products, in which each user chooses an AP with the strongest signal, results in unevenly distributed loads among APs. The IEEE 802.11 standards do not provide any mechanism for load distribution and as a result user quality of service (QoS) degrades significantly in congested networks where large numbers of users tend to congregate in the same area. The objective of this project is to provide load balancing techniques that optimize network throughput in areas of user congestion, thereby improving user QoS.

The project provides an efficient approach for solving the WLAN load balancing problem: distribute users amongst a set of APs under coverage to maximize the average bandwidth per user. Therefore, the algorithms will assign each user to an AP as opposed to each user making that choice independently. The use of the efficient iterative load balancing algorithm is proposed in the base paper. The incorporation of heterogeneous QoS requirements into the problem description can be made by defining different categories of users. The analytical expressions for the optimal channel usage time allocation are found out and a fast converging iterative algorithm to achieve the optimum channel usage is presented. Simulation results show that when users are clustered across multiple APs coverage, the utility maximization of a single AP yields substantial throughput gain over both the max-min scheme and the SSF scheme, which is currently being used in many WLAN products. Thus the implementation starts with analyzing and retrieving the specific QoS parameters and in turn the cumulative threshold which is the upper limit of the processing capability of a single AP. The nodes having overlapping signals from multiple APs, but conventionally using Strongest Signal First (SSF) besides reaching the cumulative threshold, there will be a switch in their channels to the relatively idle APs in real time as determined by the algorithm.

Regardless of the number of APs or users in a network, the convergence of the sum utility is fast in various network conditions such as users joining, leaving, or moving within the network. Therefore, the iterative algorithm has good scalability and can achieve good results in real time.

TABLE OF CONTENTS

Chapter no.

Title

Abstract

List of Figures

List of symbols

1.

Introduction

1.1 Overview

1.2 Related Work

1.3 Technology Used

1.4 Client/Server Technology

1.5 Literature Review

2.

System analysis

2.1 Existing Systems

2.2 Proposed System

3.

Feasibility study

3.1 Technical Feasibility

3.2 Operational Feasibility

3.3 Economic Feasibility

4.

Requirements

4.1 Hardware requirements

4.2 Software requirements

5.

Design

5.1 Use case Diagrams

5.2 Flow Diagrams

5.3 Sequence Diagrams

5.4 Activity Diagram

5.5 Data Flow Diagram

5.6 Class Diagram

5.7 Collaboration Diagram

6.

System Development

6.1 Load Balancing By Mobile Agent

6.2 Load balancing algorithm

7.

Sample code

7.1 SS calculation from site-specific details

7.2 SSF implementation

7.3 Water Filling Algorithm

7.4 Exporting to EXCEL documents

7.5 GUI implementing all of its functions

7.6 Node Details

8.

Screen Shots

8.1 GUI - WLAN load balancer

8.2 GUI - Topology

8.3 GUI - Node

8.4 Example GUI User Defined Topology

8.5 Output File

9.

Timeline Analysis

10.

Results

10.1 Performance Tables

11.

Conclusion And Future Work

12.

References

List of Figures

Figure no.

Title

1.1

Hot spot congestion

1.2

WLAN configuration

5.1,5.2

Use case diagram

5.3

Flow diagram

5.4

Sequence diagram

5.5

Activity diagram

5.6

DFD

5.7

Class diagram

5.8

Collaboration diagram

6.1

Agent execution environment

6.2

MAS functional role

8.1

GUI - WLAN load balancer

8.2

GUI Topology

8.3

GUI Node details

8.4

Example GUI User Defined Topology

8.5

Output file

9.1

Timeline diagram

10.1,10.2,10.3

Performance curves

List of Symbols and Abbreviations

S. NO

ABBREVIATIONS

DESCRIPTION

1

WLAN

Wireless LAN

2

Wifi

Wireless Fidget

3

AP

AP

4

MAS

Mobile Agent

5

QOS

Quality of Service

6

SS

Signal Strength

7

SSID

Service Set Identifier

8

RSSI

Receiver Signal Strength Indicator

9

BSS

Basic Service Set

10

ESS

Extended Service Set

12

a

Lagrange function

13

PCI

Peripheral Component Interface

15

MAC

Medium Access Control

16

Ra,s

Resource or Rate matrix

17

Ta,s

Optimized time matrix

18

TAVG

Average time of algorithm

CHAPTER 1

INTRODUCTION

1.1 OVERVIEW

The uptake in popularity of IEEE 802.11 wireless local area networks (WLANs) in recent years has been remarkable. WLANs are now the most popular technology used to provide broadband access to IP networks such as extended home networks and internet access in public locations. The proliferation of WLANs has resulted in an ever-increasing number of end-users with heterogeneous quality of service (QoS) requirements. In addition these users tend to congregate in certain areas of the network for various reasons such as availability of favorable network connectivity, proximity to power outlets and coffee shops. We will refer such places as hot spots. Such behavior leads to congestion at particular areas within the network. Such congestion creates an unbalanced load in the network and reduces overall network throughput.

A WLAN typically provides a number of Access Points (APs) that provide service to users in a particular geographical area. Users select access points based on the strongest received signal strength indicator (RSSI). Thus although a congested area may be offered service by several APs, if the users are clustered together, they will tend to be connected to the same AP. The more users that are connected to a single AP, the less bandwidth they will receive. For example, in the simple scenario depicted in the figure below, all users are connected to AP B because it has the strongest signal strength for each user.

Figure 1.1

The resulting system imbalance can be easily rectified if users 1 and 3 migrate to AP A and users 5 and 6 migrate to AP C. The objective of this project is to provide an efficient approach for solving the WLAN load balancing problem: distribute users amongst a set of APs to maximize the average bandwidth per user. Therefore, the algorithms will assign each user to an AP as opposed to each user making that choice independently. Since users connect to and disconnect from the network in real time, the objective was based on efficiency with which the algorithms deliver effective solutions.

The efficient iterative load balancing algorithm proposed in the base paper is being implemented. The algorithm, proposed in the same, show time and bandwidth allocation among access points (APs) and users subject to heterogeneous fairness and application requirements. The algorithm converges to maximum network resource utilization from any starting point, and usually converges in 3 to 9 iterations in various network conditions including users joining, leaving, and moving within a network and various network sizes. Such a fast convergence allows real-time implementations of our algorithm. In the context of the WLAN load balancing problem, the above algorithm is attractive as candidate solutions. The algorithm will be explained in the later part of the document.

1.1 RELATED WORK

1.1.1 Wireless Network Infrastructure:

Wireless networking is an extension of computer networks into the RF (radio frequency) world. The Wireless networks provide an increased flexibility and mobility for connecting to a network. A properly designed WLAN for a building provides mobile access for a user from virtually any location in the building. The user doesnt have to look for a connection to plug into; also, the expense of pulling cables and installing wall plates required for wired networks can be avoided. However, a network administrator must carefully plan the wireless LAN installation and have a good understanding of the issues of using WLAN technologies to ensure the installation of a reliable and secure network.

A typical computer network uses twisted-pair and fiber optic cable to interconnect LANs. Another media competing for use in higher data-rate LANs is wireless, based on the IEEE 802.11 wireless standard. The advantages of wireless include

User mobility in the workplace

A cost-effective networking media for use in areas which are difficult or too costly to wire.

The concept of user mobility in the workplace opens the door to many opportunities to provide more flexibility. Workers can potentially access the network or their telephones (via IP telephony) from virtually any location within the workplace. Accessing information from the network is as easy as if the information were on a disk. The benefits of wireless networks in the workplace are numerous. To provide wireless connectivity, the network administrator must be sure the network services are reliable and secure. Providing reliable network services means the administrator must have a good understanding of wireless LAN configurations and technologies. The 802.11 standard and its family, 802.11a, 802.11b, 802.11g and 802.11n; are some of the formidable standards which are used in the wireless networks.

A wireless LAN can be configured in many ways to meet the needs of an organization. Figure 2 below provides an example of a basic802.11b/g/n WLAN configuration. Each PC is outfitted with a wireless LAN adapter card. The PC cards come in many styles, such as PCI, ISA, or PCMCIA, and some units are external to the computer. The wireless adapter (wireless LAN adapter, which is otherwise termed as the access point in the project) is the device that connects the client to the wireless medium. The medium is typically a radio wave channel in the 2.4 GHz ISM band. The wireless medium can also be infrared, although this is not used very often. The following services are provided by the wireless LAN adapter:

Delivery of the data Authentication Privacy

Figure 1.2 [3]

The connection to a wired LAN is provided by a wireless access point, which provides a bridge between the wireless LAN and the wired network. A physical cable connection ties the access point to the wired networks switch or hub (typically Ethernet). For example, computer PC-A shown in the above figure sends a data packet to PC-D, a destination in the wired LAN. PC-A first sends a data packet over the wireless link. The access point recognizes the sender of the data packet as a host in the wireless LAN-X and allows the wireless data to enter the access point. At this time, the data is sent out the physical Ethernet connection to the wired LAN. The data packet is then delivered to PC-D in the wired LAN. A question should come up at this point: How does the access point know that the wireless data packet is being sent from a client in the wireless LAN? The answer is the 802.11 wireless LAN devices use an SSID to identify what wireless data traffic is allowed to connect to the network. The SSID is the wireless service set identifier, basically a password that enables the client to join the wireless network. The access point uses the SSID to determine whether the client is to become a member of the wireless network. The term association is used to describe that a wireless connection has been obtained.

1.3 TECHNOLOGY USED:

The client/server software architecture is a versatile, message-based and modular infrastructure that is intended to improve usability, flexibility, interoperability, and scalability as compared to centralized, mainframe, time sharing computing.

A client is defined as a requester of services and a server is defined as the provider of services. A single machine can be both a client and a server depending on the software configuration.

1.4 CLIENT/SERVER TECHNOLOGY

1.4.1 CLIENT/SERVER ARCHITECTURE

As a result of the limitations of file sharing architectures, the client/server architecture emerged. This approach introduced a database server to replace the file server. Using a relational database management system (DBMS), user queries could be answered directly. The client/server architecture reduced network traffic by providing a query response rather than total file transfer. It improves multi-user updating through a GUI front end to a shared database. In client/server architectures, Remote Procedure Calls (RPCs) or structured query language (SQL) statements are typically used to communicate between the client and server. Examples of client/server architecture

1.4.2 TWO TIER ARCHITECTURE

With two tier client/server architectures, the user system interface is usually located in the user's desktop environment and the database management services are usually in a server that is a more powerful machine that services many clients. Processing management is split between the user system interface environment and the database management server environment.

The database management server provides stored procedures and triggers. There are a number of software vendors that provide tools to simplify development of applications for the two tier client/server architecture.

The two tier client/server architecture is a good solution for distributed computing when work groups are defined as a dozen to 100 people interacting on a LAN simultaneously. It does have a number of limitations. When the number of users exceeds 100, performance begins to deteriorate. This limitation is a result of the server maintaining a connection via "keep-alive" messages with each client, even when no work is being done. A second limitation of the two tier architecture is that implementation of processing management services using vendor proprietary database procedures restricts flexibility and choice of DBMS for applications. Finally, current implementations of the two tier architecture provide limited flexibility in moving (repartitioning) program functionality from one server to another without manually regenerating procedural code.

1.5 LITERATURE REVIEW:

The fundamental topology of the WLAN is the Basic Service Set (BSS). This is also called the independent Basic Service Set, or ad hoc network. In this network, the wireless clients (stations) communicate directly with each other. This means the clients have recognized the other stations in the WLAN and have established a wireless data link. The performance of the Basic Service Set can be improved by including an access point. The access point is a transmit/receive unit (transceiver) that interconnects data from the wireless LAN to the wired network. Additionally, the access point provides 802.11 MAC layer functions and supports bridge protocols. The access point typically uses an RJ-45 jack for connecting to the wired network. If an access point is being used, users establish a wireless communications link through it to communicate with other users in the WLAN or the wired network.

The problem with the Basic Service Set is that mobile users can travel outside the radio range of a stations wireless link with one access point. One solution is to add multiple access points to the network. Multiple access points extend the range of mobility of a wireless client in the LAN. This arrangement is called an Extended Service Set (ESS). The mobile computer will establish an authorized connection with the access point that has the strongest signal level.

Now this adopts the SSF that is the Strongest Signal first, the strongest signal received by the node from the access point will be the one with which the connection will be established with the node.

As the user moves, the signal strength of the signal from the corresponding access point will decrease. At some point, the signal strength from the second access point sec will exceed than the first one, and the wireless bridge will establish a new connection with the second access point. This is called a hand-off. This is an automatic process for the wireless client adapter in 802.11, and the term used to describe this is roaming

.

SSF: SSF-Strongest Signal first is the mechanism which is used in the IEEE standards for the purpose of picking up the signals by the clients in general. As the name suggests, the distance plays an important role here, since distance and signal strengths are directly proportional. SSF does not bother about the number of users under an access point, its main concern revolves around the access point from where the node receives the maximum signal or in other words the nearest access point, since that is the AP with the maximum signal strength provided the mechanism follows the SSF.

So now this ignites the concern and thus alarms the need of proper distribution of the bandwidth and the signal so that the optimum usage of the same is done.

CHAPTER 2

SYSTEM ANALYSIS:

2.1 EXISTING SYSTEM:

The present system of network infrastructure holds the following methodology. The access point radiates the signal which is acquired by the various nodes in the subnet in proportion to the proximity of the user location. The nodes (i.e.) the users dont analyze the various possibilities of acquiring the best bandwidth from the various access points available in its range. Further the users tend to get concentrated more in particular hotspots where the bandwidth distribution becomes tedious due to approaching of more number of users towards a single access point. So to eliminate this problem in one way there need to be more access points in a hot spot. The other optimized and economical way of solving the problem is to balance the load in the hotpot region with a suitable load balancing algorithm.

2.2 PROPOSED SYSTEM:

In this, we use a mobile agent which can associate individually with various nodes in the subnet, collect the precise information about the signal strength, time fraction of channel allocation and balance the load with iterative water filling algorithm. Thus the optimized time fraction of channel usage can be found for a specific user with our algorithm by making a valid time allocation at the start which is concave and allowing it to converge as the algorithm proceeds to the subsequent stages and a lagrange function is used to make different optimized time allocation for each of its users at different instances. When the utility function is maximum, the system converges with maximum utilization of the bandwidth and thus the balanced load. The number of iterations required for this convergence will be 3 to 9.When users are clustered, our utility maximization formulation yields substantial throughput gain over the SSF scheme, which is currently being used in WLAN products. When users are uniformly distributed in space, our max utility scheme achieves better fairness than SSF. Regardless of the number of APs or users in a network, the convergence of the sum utility is fast in various network conditions. The load is balanced which ultimately eliminates the hotspot congestion which is the core of the chosen problem domain.

2.2.1 WATER FILLING ALGORITHM WITH HEURISTIC LOAD BALANCING

We implement our load balancing algorithm in a mobile agent which monitors and migrates from host to host and interacting with other users and resources

A continuous, concave function is applied this algorithm and made to converge to a water filling level which corresponds to maximum network resource utilization in 3 to 9 iterations in various network conditions like joining, leaving and moving of users within the network by solving a single variable Lagranges function (a).Simulation results are charted with a chosen rate matrix. Conventional and novel methods of load balancing were analyzed. Performance curves were drawn for maximum network utilization in both the cases.

2.2.2 PARAMETERS TO BE BALANCED :

We use the iterative water filling algorithm to balance the load by assuming a valid time allocation at the start and make it converge to an optimized channel usage time after consecutive iterations with variations in the lagrange function.

Time fraction of channel usage

Bandwidth

2.2.3 ALGORITHM MODE:

The algorithm is carried out in a decentralized manner with the use of mobile agent which is associated with each of its users.

This avoids the bottleneck in the server side (i.e.) access points due to its excess compensation in collecting the information of various nodes and optimizing the fraction of time allocation by the run of the load balancing algorithm.

Decentralizes the monitoring process and takes the advantage of the increased computational power in network nodes and decreases pressure on centralized network management systems and network bandwidth. It also enables temporal as well as spatial distribution of tasks.

CHAPTER 3

FEASIBILITY ANALYSIS:

3.1 TECHNICAL FEASIBILITY:

The windows version of this project has been on the java platform. It uses JAVA for the development of the required code. We use applets to get the input parameters from the users, run the algorithms and feed the values to XL spread sheet .A mobile agent connects to clients and server to run the algorithm and balance the load. Meanwhile the system locates the user location and readies a custom bandwidth for a particular user. The strength of the project lies in the future, thus reducing the technical complexity and thereby increasing the feasibility.

3.2 OPERATIONAL FEASIBILITY:

The projects operational feasibility has four facets to it.

3.2.1 FRAMEWORK:

The software is made using the java enterprise edition and thus uses many of the classes imported from its packages. Thus the server and client systems must run JDK1.4 or a higher version. The software was successfully tested on the java platform installed on a system.

3.2.2 OPERATING SYSTEM:

Since we use java platform for our project it is imperative that we need a compatible operating system. Although there are ways to make the system work on less popular operating systems, it works best on all contemporary windows operating system. The software was successfully tested on windows 2000 professional, windows XP and windows vista releases.

3.2.3 HARDWARE INDEPENDENCE:

The project aims at a large area of users connected to various large networks and soon to be, one global network. Thus the system is almost entirely hardware independent. The type and size of the infrastructure network specified has no effect on the operation of the system. The network must have the basic support for message transfer protocols such as TCP/IP. As we can see these various facets of the project make its operation extremely comfortable and reliable thus making it entirely feasible.

3.3 ECONOMIC FEASIBILITY:

The project assumes the existence of an infrastructure based wireless network before the actual implementation, therefore the major expenditure would be setting up of such a network, if we assume it to be a part of project requirements.

The other major features that would add cost to the end product

The hardware cost of the infrastructure network.

Cost of obtaining and installing a wireless domain controller.

Network management admin access and report generation support.

The cost of developing an access point map.

Cost of developing the services database

Most of the items that add to the cost as we can see are anyway part of establishing the wireless network. Thus the cost of developing and implementing the location based suggestion service is a minimum and that makes the project economically feasible.

CHAPTER 4

REQUIREMENTS:

4.1 HARDWARE:

Any system would require sophisticated hardware resources for its successful deployment and implementation. We specify the following hardware requirements for our project:

Wi-Fi infrastructure based network

A wireless domain controller which keeps track of all access points and clients connected to it under various DNS

A Wi-Fi enabled device for the client application to work

4.1.2 Minimum specifications:

HARDWARE SPECIFICATIONS:

Processor : Intel Pentium IV 2.2 GHZ

Hard Disk Drive : 40 GB.

RAM : 256 MB RAM minimum.

SOFTWARE SPECIFICATIONS:

Operating System: Windows 2000/XP /Vista

Software : Java programming platform

4.2 SOFTWARE:

JDK 1.4 or latest versions

IDE- NET BEANS & ECLIPSE

Back end MS-EXCEL Spread sheet application

4.2.1 DATABASE CONNECTIVITY:

The database has become an integral part of almost every humans life. Without it, many things become very tedious, perhaps impossible tasks, Banks, university, and libraries are three examples of organizations that depend heavily on some sort of database system, On the Internet, Search engines, inline shopping, and even the website naming convention would be impossible without the use of a database. A database that is implemented and interfaced on a computer is often termed database server.

The proposed system needs a strong database connectivity tool as it involves storages and timely retrieval of the node, access point details up to n users simultaneously.

In the project, we simulate the entire process. So theres not much tasks involving storage and retrieval from the main database as most of the values are directly fed and retrieved from the Java Run time environment in its integrated platform. Hence we use a MS excel application as simple as it is to store the load information before and after balancing.

4.2.2 NON FUNCTIONAL REQUIREMENTS:

Nonfunctional requirements are those that impose constraints on the functionality of the system. Some of the common requirements relate to the issues of performance, quality of the system etc.

4.2.2.1 PERFORMANCE REQUIREMENTS:

It is a measure of how well the system performs its functions. Common performance indicators include usability, availability, reliability, supportability, testability, maintainability.

4.2.2.2 USABILITY:

This is a requirement that arises out of the concern that our system should be easy to use. Here according to our project the user must have this algorithm working and helping him out in all the crowd areas and ensuring the better performance of the Wi-Fi.

4.2.2.3 AVAILABILITY:

Our system should be available under all circumstances. It should not fail unexpectedly.

4.2.2.4 RELIABILITY:

Our system should be highly reliable. It should not fail unexpectedly. In the event of any problem, it should exit gracefully.

4.2.2.5 TESTABILITY:

It should be easy to subject the system to testing, as and when needed. It should be tested for correctness before integration. Also, it should be tested to find errors in the event of a break down.

4.2.2.6 MAINTAINABILITY:

It should be simple to maintain the system. The system should not consume unnecessary resources. It should not cause burdens of any sort to the users and the management.

4.2.2.7 OTHER ISSUES:

There are a few other factors worthy of mention:

Provision for an efficient design team

Provision of timely solution to any problems faced

Assurance of high degree of satisfaction for the users

Ensuring that all of the needs of the technicians are addressed

CHAPTER 5

SYSTEM DESIGN:

Design is basically a bridge between analysis and implementation phase. It illustrates how to achieve the solution domain from the problem domain. The main objective of design is to transform high-level analysis concepts. It is used to describe problem domain into an implementation form.

UML DIAGRAMS:

5.1 USE CASE DIAGRAM

Figure 5.1

Figure 5.2

5.1 USE CASE DESCRIPTION:

Use case Specification:

Use case Name: Server bandwidth allocation

Brief Description: The Server continues to carry out its routine task of initial bandwidth allocation by SSF besides running the load-balancing algorithm

Use case Specification:

Use case Name: Collect the current R matrix values

Brief Description: Before running the load-balancing algorithm, the server collects the necessary data which are given as input for the algorithm that is to be executed in the mobile agent.

Flow of Events:

Basic Flow:

Server creates the necessary data structures to store the R matrix. Then, server collects the data and invokes the algorithm in the mobile agent.

Use case Specification:

Use case Name: Run the load-balancing algorithm

Brief Description:

The server invokes the algorithm to calculate the T matrix for the next TAVG .

Flow of Events:

Basic Flow:

The server gets ready with the R matrix from the previous TAVG . Invokes the load-balancing algorithm before it starts the next TAVG .

Use case Specification: < Allocate the bandwidth for users >

Use case Name: Allocate the bandwidth for the users

Brief Description:

The server allocates the users with bandwidth for the next TAVG interval using the T matrix obtain from the load-balancing algorithm.

5.2 FLOW DIAGRAM:

Collect the R

a,s

for the

previous T

AVG

Calculate the c

a,s

using

equation (3) in the algorithm

Calculate the T

a,s

Run the algorithm Does Maximum utility

converge?

*1Use T

a,i

values ro allocate

bandwidth to users for the

next T

AVG

seconds

for next T

AVG

intervalyesn o

Figure 5.3

The algorithms general flow aims at achieving the maximum utility by converging to a channel time fraction that is optimal (Ta,s) by working on the initial rate matrix (Ra,s) and the algorithm iterates once in TAVG seconds till the water filling level is reached.

5.3 SEQUENCE DIAGRAM

Figure 5.4

The above figure describes the flow of events in a sequence. The various events like bandwidth request, initial allocation using SSF, feeding the node details to mobile agent and the algorithm is run and reports are generated by exporting the values to a Excel spread sheet.

5.4 ACTIVITY DIAGRAM

Figure 5.5

Here the various activities pertaining to the load balancing algorithms execution are shown. The start and end of the process with sequence of activities occurring in the middle way like connection establishment, initialization of node details, algorithm execution, iteration till the reach of water filling algorithm and further load balancing with the optimized channel time are shown in the above figure.

5.5 DFD LEVEL 1:

Figure 5.6

The flow of data is analyzed and the various steps involved are charted down in the figure above. Level 0 DFD is the simple client server transaction and the Level 1 is added up with few core processes like feeding the values and balancing the load by the use of iterative water filling algorithm and the reports are generated in an EXCEL spread sheet

5.6 CLASS DIAGRAM:

Figure 5.7

The various functions to be implemented in the project are categorized under various classes to facilitate the code reusability and also easy debugging with check points in each class.

The home GUI carries out the base functions under various classes that in turn functions to collect node details, access point details, implement SSF and the water filling algorithm and load balancing based on the optimized channel time obtained.

5.7 COLLABORATION DIAGRAM

Figure 5.8

The above figure identifies the collaboration between various users and entities and the flow of information between them and the processes that link each of its components

CHAPTER 6

SYSTEM DEVELOPMENT:

6.1 LOAD BALANCING BY MOBILE AGENT:

Mobile agent based network monitoring and management is a new paradigm believed to be the suitable technique for growing heterogeneous networks. This technique of monitoring decentralizes the monitoring and management task and relieves the bottleneck around management station. The mobile agent is a software module that will travel to different nodes of network, collect status information and carry out load information tasks. These agents require an agent execution environment at the visiting node. Several mobile agent platforms are available, such as, AWB (aglets work bench), Agent TCL, Java mobile agent Aglets.

Mobile agent based frame work should be available at every managed node and MS in the network to support mobility of agents. Layered functions of this mobile agent framework comprises of agents (top layer), shell interpreter, agent server and TCP/IP (bottom layer for transport). Agent server is responsible for receiving agent, executing agent and sending the mobile agent to outside world. The shell interpreter executes the mobile shell script. This interpreter depends on the type of mobile scripting languages used. For example, mobile code written in java requires java interpreter and TCL mobile script requires TCL interpreter. Transport mechanism used for mobile agents is TCP, i.e., an agent is transferred to another machine using TCP connection.

The mobile agent based management system delegate the tasks from monitoring system to network host. Thus adopting decentralized management, that takes the advantage of the increased computational power in network nodes and decreases pressure on centralized network management systems and network bandwidth. It enables temporal as well as spatial distribution of tasks. The basic aim is to bring management intelligence as close as possible to managed resource.

Mobile agents are programs that can move through a network under their own control, migrating from host to host and interacting with other agents and resources on each .Mobile agents are autonomous and have the potential to provide a convenient efficient and robust paradigm for distributed applications, particularly when partially connected computers are involved.

Once the mobile agent starts the monitoring process, it will be on its own and it will be disposed of once the monitoring is done. During the monitoring process, once the mobile agent encounters with any unusual error, it will generate a warning message and notify it at the executing site. The following diagram shows how the mobile agent executes over network

SHAPE \* MERGEFORMAT

Figure 6.1: Agent execution environment

The agent is similar to that of applet in java language with some additional features. In addition to applet, it provides mobility. Hence the system must include security layer in order to protect from malicious agent that will damage the host system. The client server has been the base for most network load monitoring systems. The client server paradigm is a centralized method in the distributed computing environment and must install a program that measures the load of the network host. This program sends the load information when called from the monitoring system. Therefore it is impossible for a user to change the monitoring method on a single node. Mobile agent methodology is used for an efficient load monitoring on network host either LAN or WAN network. The system consists of list of network nodes to be monitored and a monitoring system used to monitor the load information of the network nodes. Each system contains MAS (Mobile Agent Server). It provides each host with an environment for the mobile agent to be executed and manages he creation, movement and extinction of the mobile agent. The agent is designed by combining the itinerary pattern and the master slave pattern related to the operation. The master agent is executed on the MAS of the monitoring system and creates the slave that will move to the host system. The slave agent then moves to first node measures the load on the system and reports it to master agent. The slave agent then moves to another to perform the same job after transmitting the load information to master agent.

The master agent resides in the monitoring system to provide network host load information gathered from slave agent and periodically creates a slave agent to monitor system load. Those function of mobile agent are shown below in the figure

SHAPE \* MERGEFORMAT figure 6.2

6.2 Load balancing algorithm:

A multi radio capability that allows reception of multiple channels can be decoded in parallel by each user. This multi radio assumption simplifies the computation of the time channel to be allocated more efficient. The problem formulation is convex thus allowing multi radio APs on a user.

The users exhibit a quasi static mobility pattern where the users tend to stay in the same physical places for long periods of time. This kind of model allows us to consider long term averaged link capacities over a time scale of about 2 seconds which is actually denoted to be TAVG. This time should be sufficient for resource reallocation and it should not be a noticeable time for the new users waiting to get associated with the access point.

The load balancing algorithm will be executed once in this TAVG interval. The load is balanced dynamically as soon as there is a change in the user map (i.e.) an existing user may move out or a new user can join the network or an user can move from one point to some other coordinate within the range of the access point of concern .There may also be radio frequency noise signals which may emit interfering signals. The effect of these transient events need to be quantized and sampled every TAVG interval with the proposed load balancing algorithm. The capacity with which an user is associated with the access point is Link capacity and it varies at least every TAVG

Here are some of the assumptions for implementation of the algorithm.

Let i denote the access points in general and a the specific AP.

Let j denote the users in general ands the specific users.

We consider the link capacity Ra,s, may be throughput between an access point a and a specific user s and this peak throughput for a single (unshared) user is predicted, measured and optimized for site specific information by the algorithm. In every TAVG , the iterative load balancing algorithm readjusts the time /bandwidth resource allocation over all users and APs .

Assuming a subnet in which a user receive signals from two access points with signal strengths say 30% and 50 %. So the user receives signal at a bandwidth of (30/100)RA,S from access point A and user interacts at the rate of (50/100)RB,S with access point B. Summing up both of these individual link capacities, we get the total allocated bandwidth for the specific user. In this case the throughput is same as the bandwidth. Hence we try to maximize the sum utility of throughput with a net utility function Ui(bi) which has a summation up to i users approaching the access point over the channel usage time.

We make an assumption that all APs are under the control of a network switch. However, some rogue APs or RFs emit interfering signals in the coverage area. In this case, some overlay sensors can be used to detect the rogue APs .The signal parameters detected can be used to identify the rogue APs and the channel assignments can be changed so that the APs near the rogue APs operate at orthogonal RF channels in order to eliminate the interference from those. The switch will predict SNR and link capacities between the users and controlled APs and transmit properties and our algorithm is applied to find the optimal resource allocation in each case.

Every AP associates with its users assigning a frequency channel. The time fraction resource that is dedicated for payload transmissions between the users and access point a over an RF channel is denoted as Tafrac. The value lies between 0 and 1.We have the subscript here as a since the payload time fractions may differ from AP to AP.

According to the algorithm, we share the utility function to the associated APS and transmit signals which are strong enough to reach the destination. The utility functions are assumed to be concave, continuously differentiable and strictly increasing to make our analysis easy.

Let i and j be the dummy indices of APs and users respectively when performing a summation.

Users is said to be in coverage of an access point a if Ra,s>0; otherwise it is zero.

Suppose an AP a allocates a time fraction Ta,s to user s whose allocated time fraction is between 0 and 1. The actual bandwidth of users from AP a is Ta,sRa,s.

The sum maximum utilization problem can be solved by a valid assumption of time fraction from APs from different RF channels to users. Max iUi (jTj,iRj,i)

When (Ta,i) =0 belonging to a,s.

To optimize, we consider the time fraction for a single AP assume that the other APs time fractions are already fixed and have a closed form expression. This optimization is made possible by finding a set of utility functions which helps us to land up with a closed form time fraction whenever associated with AP. The max utility function is to be found out in each case:

Max iUi (jTj,iRj,i)

MO AND WALRAND CLASS OF UTILITY FUNCTIONS:

This class of functions is parameterized by qi for different degree of application fairness and heterogeneity.

If qi=1, Ui(bi)=(1-qi)^-1bi^(1-qi)

If qi! =1, Ui(bi)=log(bi)

Where bi belongs to the closed interval of 0, infinity

The sum of concave functions is still a concave function; hence, problem is convex since a concave function is to be maximized over a convex constraint set which shows that if qi , the formulation becomes a special case that achieves max-min fairness, Within every TAVG, R remains constant after block processing, and the optimal sum utility and T will be determined.

Time resources of only AP a, Ta, =[Ta,1,Ta,2, . . . ,Ta,m], assuming that the time allocations from the other APs to users are fixed. Then the formulation is reduced to maxiUi(Ta,iRa,i+Ca,i) subject to

(Ta,i) 0 and < a if Ta,s=0

i Ta,i=Tafrac ; Ta,s>=0

Thus the optimal time allocation may be given as

Ta,s={ a(-1/qs)Ra,s(1/qs-1)-Ca,s/Ra,s}+

We get a closed form expression for Ta,s and the notation {x}+ is needed because Ta,s is non negative: {x}+=x if x>=0 and {x}+=0. In each iteration of the algorithm, finding the time resources of each AP requires solving a single-variable (a) polynomial equation with m terms; hence, the time complexity of each iteration is O(nm). If the parameter qs = 1, the expression above, Ta,s is the water-filling expression, where the constant a -1is known as the water-filling level .

SUBSTANTIATING THEOREMS:

Theorem 1:

{Ta,s a,s} is an optimal solution if and only if { Ta,1 Ta,2 Ta,3. Ta,m} for access point a with the valid time allocation from the other APs {Tj,s: ja,, s} fixed for a=1,2,n. Assuming time allocations from the other APs are fixed. Hence, the optimal time allocation for the multiple-AP optimization problem can be found by an iterative algorithm

Theorem 2:

The above algorithm results in the optimal sum utility and causes {Ta,s, a,s) to converge to an optimal time allocation for formulation. Algorithm 1 can be carried out in a decentralized manner: each AP a computes the optimal time allocation {Ta,s, s}only for those users who are in the coverage of this AP. For the computation of each users Ta,s, a constant Ca,s needs to be known, which in turn requires the knowledge of the bandwidth that this user s receives from APs other than AP a. In a realistic WLAN setup, a user is under the coverage of no more than 4 APs; hence, the computation of Ca,s at each user is efficient. APs sequentially perform such decentralized computing. When the sum utility converges, a control message may be sent to APs to stop the decentralized computing.

Given a rate matrix {Ra,s , for all a,s}

Start with a valid time allocation {Ta,s ,for all a,s}

Repeat

For each AP a= 1,2, . . ,n do

Compute{ca,s, for all s}

Compute{Ta,s, for all s}

End for

Until the sum utility converges

Output {Ta,s, for all a,s}

CHAPTER 7

SAMPLE CODE

7.1 SS calculation from site-specific details

private void calculate_SS() {

for (int counter = 0; counter < No_APs; counter++) {

dist = distance(aps[counter], node);

node.dis[counter] = dist;

if (dist >= 45) {

node.SS[counter] = 0;

} else {

node.No_AP++;

this.node.SS[counter] = SS(dist);

}

}

}

private int SS(int ss_dis) {

readExcelFile xls = new readExcelFile("C://ss.xls");

HSSFCell myCell, myCell2;

Vector cellStoreVector, cellStoreVector2 = new Vector();

for (int i = 2; i < 8; i++) {

cellStoreVector = (Vector) xls.dataHolder1.elementAt(i);

myCell = (HSSFCell) cellStoreVector.elementAt(0);

int t1 = (int) Float.parseFloat(myCell.toString());

if (i == 7) {

cellStoreVector2 = (Vector) xls.dataHolder1.elementAt(i - 1);

} else {

cellStoreVector2 = (Vector) xls.dataHolder1.elementAt(i + 1);

}

myCell2 = (HSSFCell) cellStoreVector2.elementAt(0);

int t2 = (int) Float.parseFloat(myCell2.toString());

if (ss_dis = t1) {

myCell2 = (HSSFCell) cellStoreVector.elementAt(3);

t1 = (int) Float.parseFloat(new String(myCell2.toString()));

myCell2 = (HSSFCell) cellStoreVector.elementAt(4);

t2 = (int) Float.parseFloat(new String(myCell2.toString()));

Random r = new Random((long) t2);

while (true) {

int t3 = r.nextInt(t1);

System.out.println("t3=" + t3);

if (t3 > t2) {

return (int) t3;

}

}

}

}

return -1;

}

private int distance(AP_Details ap, Node_Details node) {

int l = (int) Math.pow((double) (ap.X - node.X), 2.0);

int r = (int) Math.pow((ap.Y - node.Y), 2);

int n = (int) Math.pow((l + r), (0.5));

int d = n * 9 / 25;

if (d > 100)

return 100;

else

return d;

}

7.2 SSF implementation:

public void calculate_SSF() {

for (int in_counter = 0; in_counter < No_Nodes; in_counter++) {

this.sumSS[in_counter] = 0;

}

for (int in_counter = 0; in_counter < No_Nodes; in_counter++) {

this.sumSS[this.AP[in_counter]] += nodes[in_counter].SS[this.AP[in_counter]];

}

for (int in_counter = 0; in_counter < No_Nodes; in_counter++) {

float tempssf = (float)nodes[in_counter].SS[this.AP[in_counter]]

/ this.sumSS[this.AP[in_counter]];

this.data_rate[in_counter] = (float) tempssf

aps[this.AP[in_counter]].Bandwidth;

Random r = new Random();

float t = 0;

for (;;) {

if (5 < t && t < 25)

break;

t = r.nextInt(15);

}

t /= 100;

float temp=this.data_rate[in_counter] * t;

this.data_rate[in_counter]-=temp;

aps[this.AP[in_counter]].Bandwidth -= this.data_rate[in_counter];

aps[this.AP[in_counter]].No_users++;

}

}

7.3 Water Filling Algorithm

private void water_filling() throws FileNotFoundException {

this.T_initialize();

this.resource_allocator();

this.wf_iterator();

this.export_output();

}

private float b_calculator(int i) {

float t = 0;

for (int c1 = 0; c1 < 5; c1++) {

t += T[c1][i] * R[c1][i];

}

System.out.println("B_CAlculator ::: " + t);

return t;

}

private void T_calculator() {

System.out.println(" WF :: T calculator");

for (int c1 = 0; c1 < 5; c1++) {

for (int c2 = 0; c2 < No_Nodes; c2++) {

T[c1][c2] = 0;

if (R[c1][c2] != 0) {

if (nodes[c2].q == 1) {

float t = L[c2] / R[c1][c2];

float t1 = 1 / R[c1][c2];

float t2 = t1 * this.utility_calculator(t, c2);

float t3 = C[c1][c2] / R[c1][c2];

T[c1][c2] = t2 - t3;

} else {

float t = 1 / nodes[c2].q;

float t1 = (float) Math.pow(L[c2], -t);

float t2 = (float) Math.pow(R[c1][c2], t - 1);

float t3 = C[c1][c2] / R[c1][c2];

float t4 = t1 * t2;

T[c1][c2] = t4 - t3;

}

}

}

}

private void lagrange_calculator() {

System.out.println(" WF :: lagrange calculator");

for (int i = 0; i < 5; i++) {

L[i] = 0;

for (int j = 0; j < No_Nodes; j++) {

float t = T[i][j] * R[i][j];

t = t + C[i][j];

float t1 = this.utility_calculator(t, j);

L[i] += R[i][j] * t1;

}

}

for (int i = 0; i < 5; i++) {

System.out.println("after lag calci" + i + ": ::L" + L[i]);

}

}

private void T_calculator() {

System.out.println(" WF :: T calculator");

for (int c1 = 0; c1 < 5; c1++) {

for (int c2 = 0; c2 < No_Nodes; c2++) {

T[c1][c2] = 0;

if (R[c1][c2] != 0) {

if (nodes[c2].q == 1) {

float t = L[c2] / R[c1][c2];

float t1 = 1 / R[c1][c2];

float t2 = t1 * this.utility_calculator(t, c2);

float t3 = C[c1][c2] / R[c1][c2];

T[c1][c2] = t2 - t3;

} else {

float t = 1 / nodes[c2].q;

float t1 = (float) Math.pow(L[c2], -t);

float t2 = (float) Math.pow(R[c1][c2], t - 1);

float t3 = C[c1][c2] / R[c1][c2];

float t4 = t1 * t2;

T[c1][c2] = t4 - t3;

}

}

}

}

7.4 Exporting to EXCEL documents

private void WF_Output(String fileName) throws FileNotFoundException {

FileOutputStream out = new FileOutputStream(fileName);

HSSFCellStyle cs = hssfworkbook.createCellStyle();

HSSFDataFormat df = hssfworkbook.createDataFormat();

HSSFFont f = hssfworkbook.createFont();

HSSFFont f2 = hssfworkbook.createFont();

cs.setDataFormat(HSSFDataFormat.getBuiltinFormat("text"));

int row1 = 0;

HSSFRow row = sheet.createRow((short) row1++);

HSSFCell cell = row.createCell(0);

cell.setCellValue("Access Point Details ");

cell.setCellStyle(cs);

row = sheet.createRow((short) row1++);

String string_cellvalues[] = { "No", "Coverage", "Bandwidth",

"No_users", "X", "Y" };

for (int counter1 = 0; counter1 < 6; counter1++) {

System.out.println("xl for 1" + counter1);

cell = row.createCell((short) counter1);

cell.setCellValue(string_cellvalues[counter1]);

cell.setCellStyle(cs);

}

for (int counter2 = 0; counter2 < 5; counter2++) {

System.out.println("xl for 2" + counter2);

row = sheet.createRow((short) row1++);

cell = row.createCell((short) 0);

cell.setCellValue(counter2);

cell.setCellStyle(cs);

cell = row.createCell((short) 2);

for (int i = 0; i < 5; i++) {

System.out.println("xl for 3" + i);

String s = aps[i].toString();

}

cell.setCellValue(aps[counter2].Bandwidth);

cell.setCellStyle(cs);

cell = row.createCell((short) 1);

cell.setCellValue(aps[counter2].Coverage);

cell.setCellStyle(cs);

cell = row.createCell((short) 3);

cell.setCellValue(aps[counter2].No_users);

cell.setCellStyle(cs);

cell = row.createCell((short) 4);

cell.setCellValue(aps[counter2].X);

cell.setCellStyle(cs);

cell = row.createCell((short) 5);

cell.setCellValue(aps[counter2].Y);

cell.setCellStyle(cs);

}

row = sheet.createRow((short) row1++);

String string_cellvalues2[] = { "No", "usage", "X", "Y", "SS1", "Dis1", "SS2", "Dis2", "SS3", "Dis3", "SS4", "Dis4", "SS5", "Dis5",

"using AP", "SSF_data rate", "T1", "T2", "T3", "T4", "T5","WF_data rate" };

for (int counter1 = 0; counter1 < string_cellvalues2.length; counter1++) {

cell = row.createCell((short) counter1);

cell.setCellValue(string_cellvalues2[counter1]);

cell.setCellStyle(cs);

}

for (int c2 = 0; c2 < No_Nodes; c2++) {

int c1 = 0;

System.out.println("xl for 5" + c2);

row = sheet.createRow((short) row1++);

cell = row.createCell((short) c1++);

cell.setCellValue(c2);

cell.setCellStyle(cs);

cell = row.createCell((short) c1++);

cell.setCellValue(nodes[c2].usage);

cell.setCellStyle(cs);

cell = row.createCell((short) c1++);

cell.setCellValue(nodes[c2].X);

cell.setCellStyle(cs);

cell = row.createCell((short) c1++);

cell.setCellValue(nodes[c2].Y);

cell.setCellStyle(cs);

for (int c3 = 0; c3 < 5; c3++) {

System.out.println("xl for 6" + c3);

cell = row.createCell((short) c1++);

cell.setCellValue(nodes[c2].SS[c3]);

cell.setCellStyle(cs);

cell = row.createCell((short) c1++);

cell.setCellValue(nodes[c2].dis[c3]);

cell.setCellStyle(cs);

}

cell = row.createCell((short) c1++);

cell.setCellValue(this.AP[c2]);

cell.setCellStyle(cs);

cell = row.createCell((short) c1++);

cell.setCellValue(this.data_rate[c2]);

cell.setCellStyle(cs);

for (int c3 = 0; c3 < 5; c3++) {

cell = row.createCell((short) c1++);

cell.setCellValue(T[c3][c2]);

System.out.println("for 2 " + c3);

System.out.println("T =" + T[c3][c2] + " ==" + T[c3][c2]);

cell.setCellStyle(cs);

}

cell = row.createCell((short) c1);

cell.setCellValue(Bi[c2]);

System.out.println("U = " + Bi[c2]);

cell.setCellStyle(cs);

}

try {

hssfworkbook.write(out);

out.close();

} catch (Exception e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

7.5 GUI implementing all of its functions

package wlanloadbalancer;

import java.awt.*;

import java.awt.event.ActionEvent;a

import java.awt.event.ActionListener;

import java.awt.event.MouseEvent;

import java.awt.event.MouseListener;

import java.io.FileNotFoundException;

import java.util.logging.Level;

import java.util.logging.Logger;

import javax.swing.*;

public class Home extends JFrame implements ActionListener, MouseListener {

int No_Nodes = 0;

int No_APs = 0;

Node_Details nodes[] = new Node_Details[100];

AP_Details[] AP = new AP_Details[10];

Node no[] = new Node[100];

JButton b_SSF;

JButton b_LB;

Panel P_Buttons;

public static Home component = null;

public Home() {

No_Nodes = 0;

No_APs = 0;

this.initialise();

//t.start();

}

private Graphics ggg()

{

GraphicsEnvironment ge=GraphicsEnvironment.getLocalGraphicsEnvironment();

Graphics g=component.getGraphics();

return g;

}

private void ap_init()

{

this.AP_initialize(123, 312);

this.AP_initialize(435, 542);

this.AP_initialize(123, 431);

this.AP_initialize(412, 123);

this.AP_initialize(234, 123);

}

private void AP_initialize(int a, int b) {

Graphics g=component.getGraphics();

g.setColor(Color.blue);

g.fillOval(a, b, 10, 10);

g.setColor(Color.green);

g.drawOval(a - 120, b - 120, 250, 250);

AP[No_APs] = AP_Details.createAP(a, b);

}

public void mouseClicked(MouseEvent e) {

this.ap_init();

if (e.getButton() == MouseEvent.BUTTON1) {

System.out.println("Left Click");

no[No_Nodes++] = this.nodeinit(e.getX(), e.getY());

g = component.getGraphics();

g.setColor(Color.red);

g.fillOval(e.getX(), e.getY(), 10, 10);

}

}

public Node nodeinit(int a12, int b12) {

Node ax = new Node(a12, b12, AP);

ax.setVisible(true);

ax.setAlwaysOnTop(true);

return ax;

}

public void mousePressed(MouseEvent e) {

// throw new UnsupportedOperationException("Not supported yet.");

}

public void mouseReleased(MouseEvent e) {

// throw new UnsupportedOperationException("Not supported yet.");

}

public void mouseEntered(MouseEvent e) {

// throw new UnsupportedOperationException("Not supported yet.");

}

public void mouseExited(MouseEvent e) {

// throw new UnsupportedOperationException("Not supported yet.");

}

public void run() {

//throw new UnsupportedOperationException("Not supported yet.");

}

public static void main(String[] ar) {

component = new Home();

}

public void actionPerformed(ActionEvent e) {

if (e.getActionCommand() == "SSF") {

try {

System.out.println("SSF_event");

SSF ssf = new SSF(this.AP, this.nodes, this.No_Nodes);

} catch (FileNotFoundException ex) {

Logger.getLogger(Home.class.getName()).log(Level.SEVERE, null, ex);

}

} else if (e.getActionCommand() == "Load Balancer") {

try {

pre_WF pwf = new pre_WF(this.AP, this.nodes, this.No_Nodes);

} catch (FileNotFoundException ex) {

Logger.getLogger(Home.class.getName()).log(Level.SEVERE, null, ex);

}

}

}

}

7.6 Node Details:

public class Node_Details {

int usage=0;

int X=0,Y=0;

int No_AP=0;

int SS[]=new int [20];

int dis[]=new int [20];

int q=1;

AP_Details[] aps=new AP_Details[5];

public Node_Details()

{

System.out.println("NODE_Detail");

}

public void to_String()

{

System.out.println(this.usage+" "+this.X+" "+this.Y+" "+this.No_AP+" ");

}

Node_Details( int x, int y,AP_Details[] a) {

this.X=x;

this.Y=y;

this.aps=a;

for(int i=0;i