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

1

CHAPTER 1


INTRODUCTION
1.1 COMPANY PROFILE
As the training arm of HCL career development center (HCLCDC) carries forth a
legacy excellence spanning across more than three decades. HCL is a $5 billion leading global
Technology and IT Enterprise that comprises two companies listed in India - HCL Technologies
& HCL Info systems. The 3-decade-old Enterprise, founded in 1976, is one of India's original IT
garage start-ups. Its range of offerings spans Product Engineering, Custom & Package
Applications, BPO, IT Infrastructure Services, IT Hardware, Systems Integration, and
distribution of ICT products. Among the fastest growing IT education brands in India, HCL CDC
offers a complete spectrum of quality training programs on software, hardware, networking as
well as global certifications in association with leading IT organizations worldwide.
HCL PRODUCTS
The Engineering and R & D services department runs the largest outsourced
engineering center outside the US which is a testimony to the 30 year product engineering
experience. The company offers a comprehensive range of R&D and Engineering services to
component vendors, OEMs, ODMs and ISVs across multiple industry segments and domains.
Design and development of world-class

Dedicated to the planning

Customer relationship management

Product Engineering & Technology Development


2


Networking and Network Integration
Network management involves network monitoring of bandwidth utilization,
network errors, collisions, network trouble shooting day-to-day network operations, network
performance monitoring, tuning network operating system and advice action plan.
IT Services
HCL info system portfolio of products covers the entire spectrum of the information
technology needs of its customers.HCL info systems product offerings include everything from
high end enterprise level servers.
Networking and communication Architecture
Company goal is to:
Combine knowledge, technology and innovation to develop cost-
effective solutions
Conduct business in way that mutually benefits both customers and
employees
Adhere to exemplary moral standards in all relationship
HCL Key Technology Associates
Computing software
Network security
Office automation
Telecom, Microsoft
Ms-project, Oracle data warehousing, storage sun server


3


OUR VISION
"Together we create the enterprises of tomorrow".
OUR MISSION
"To provide world-class information technology solutions and services in order to
enable our customers to serve their customers better".
IT Infrastructure Consulting
HCL assists with the design, selection and implementation the IT infrastructure that
guarantees required performance, security, availability and scalability.
High level Design, Prototyping and implementation
Server Architecture and clustering Service
Messaging strategies
Security Consulting
Selection of hardware and software server platforms ,DBMS servers and
remote communication platforms
Quality Assurance
"To help people in HCL Info systems Ltd. share in the company's successes, which
they make possible; to provide job security based on their performance; to recognize their
individual achievements; and help them gain a sense of satisfaction and accomplishment from
their work.We shall develop and impart Industry relevant ICT Education to meet the
requirement of customers, Industry and society by continually updating technology content and
improving our processes"



4


1.2 OBJECTIVE:
Mobile Ad Hoc Networks (MANETs) have become one of the most highly
researched areas in wireless local area networking. The current research in MANETs involves all
layers in the TCP/IP model, as the very nature of these networks demands new design rules for
each layer in order to provide client end-to end communications. MANETs are made up of a
number of nodes, such as laptops and Personal Digital Assistance (PDA), which are capable of
communicating with each other without using a base station. This means that each node performs
routing in a distributed manner. The limitation in transmission range and the highly dynamic
nature of these networks makes data transmission between the source and the destination travel
over multiple hops, which can vary over time. Therefore, routing in MANETs is a challenging
task. In the MANET literature, a number of different routing protocols have been proposed.
Designing routing strategies for MANETs began by optimizing the routing protocols designed
for wired networks
The route discovery in these protocols were proactive in nature, which means that each
protocol periodically exchanged routing information with other nodes in the network, in order to
build their routing tables.
However, this approach to routing lacks scalability as the size of the network grows. On-
demand routing protocols were designed to reduce the route discovery overheads by allowing
each node to determine routes when they are required, rather than maintaining a route to every
destination.






5

CHAPTER 2

SYSTEM ANALYSIS


2.1 EXISTING SYSTEM
Routing overhead due to location information collection and retrieval in mobile ad-
hoc networks employing geographic routing with no hierarchy. In the existing system, the
problem of characterizing the minimum routing overhead as a rate-distortion problem. Mobile
users are provided with access to real-time information even when they are away from their
home or office Wireless networks offer more flexibility and adapt easily to changes in the
configuration.
2.1.1 Draw backs
Expensive to maintain the network due to many cables between computer
systems and even if a failure in the cables occur then it will be very hard to
replace that particular cable as it involved more and more costs.

When using a laptop which is required to be connected to the network, a
wired.

Network will limit the logical reason of purchasing a laptop in the first
place. Interference due to weather, other radio frequency devices, or
obstructions like walls.







6

2.2 PROPOSED SYSTEM

In the proposed system, we create a new framework for quantifying overhead due to
control messages generated to exchange location information. We compute the minimum number
of bits required on average to describe the locations of a node, borrowing tools from information
theory. The main source of in efficiency of proactive and reactive geographic routing as well as
the major contributors to routing overhead in MANETs. Network can be extended to places
which cannot be wired.

KEY TERMS

Data communications
Network management
Routing protocols.
Mobile communication system











7

2.3 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. 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
SOCIAL FEASIBILITY
TECHNICAL FEASIBILITY
2.3.1 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.
2.3.2 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.
2.3.3 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. The
developed system must have a modest requirement, as only minimal or null changes are required
for implementing this system.


8

CHAPTER 3


REQUIREMENT SPECIFICATIONS


3.1 HARDWARE REQUIREMENTS

Hard disk : 40 GB
RAM : 512MB
Processor : Pentium IV
Monitor : 17Color Monitor

3.2 SOFTWARE REQUIREMENTS

Front-End : VB .NET 2005
Coding Language : C#
Operating System : Windows XP.
Back End : SQLSERVER 2005








9


CHAPTER 4


SOFTWARE DESCRIPTION
4.1 FRONT END
.NET

ASP.NET is a new way to program dynamic and interactive Web applications. .NET is a
compiled environment that makes extensive use of the Microsoft .NET Framework, and the
entire .NET platform is available to any .NET application.
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. Theres 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).





10

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.






11

FEATURES OF THE .NET FRAMEWORK


Managed Code - is 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 youre using, impose
certain constraints on the features available.
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.
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.





12

INTRODUCTION TO SQL SERVER:
To create a database determines the name of the database, its owner (the user who
creates the database), its size, and the files and file groups used to store it.
Before creating a database, consider that:
Permission to create a database defaults to members of the system admin and decretory
fixed server roles, although permissions can be granted to other users.
The user who creates the database becomes the owner of the database.
A maximum of 32,767 databases can be created on a server.
The name of the database must follow the rules for identifiers.
Three types of files are used to store a database:
Primary files
These files contain the startup information for the database. The primary files are also used
to store data. Every database has one primary file
Secondary files
These files hold all the data that does not fit in the primary data file. Databases do not need
secondary data files if the primary file is large enough to hold all the data in the database. Some
databases may be large enough to need multiple secondary data files, or they may use secondary
files on separate disk drives to spread the data across multiple disks.
Transaction log

These files hold the log information used to recover the database. There must be at least one
transaction log file for each database, although there may be more than one. The minimum size
for a log file is 512 kilobytes (KB).

13


CREATING DATABASE PLAN
The first step in creating a database is creating a plan that serves both as a guide
to be used when implementing the database and as a functional specification for the database
after it has been implemented. The complexity and detail of a database design is dictated by
the complexity and size of the database application as well as the user population.
In planning the database, regardless of its size and complexity, use these basic steps:
Gather information.
Identify the objects.
Model the objects.
Identify the types of information for each object.
Gathering Information

It is also important to identify what they want the new system to do, as well as
to identify the problems, limitations, and bottlenecks of any existing system. Collect copies of
customer statements, inventory lists, management reports, and any other documents that are
part of the existing system, because these will be useful to you in designing the database and
the interfaces.

Identifying Objects
During the process of gathering information, you must identify the key objects or
entities that will be managed by the database. The object can be a tangible thing, such as a
person or a product, or it can be a more intangible item, such as a business transaction, a
department in a company, or a payroll period. There are usually a few primary objects, and
after these are identified, the related items become apparent. Each distinct item in your
database should have a corresponding table.
14


Modeling the Objects
As the objects in the system are identified, it is important to record them in a
way that represents the system visually. You can use your database model as a reference
during implementation of the database.
For this purpose, database developers use tools that range in technical
complexity from pencils and scratch paper to word processing or spreadsheet programs.

Identify the types of information for each object

After the primary objects in the database have been identified as candidates
for tables, the next step is to identify the types of information that must be stored for each
object. These are the columns in the object's table. The columns in a database table contain a
few common types of information

SQL-Server Database:
Its consist of six type of objects,
o TABLE
o QUERY
o FORM
o REPORT
o MACRO






15


4.2 FEATURES

NAMESPACES
ASP.NET uses a concept called namespaces. Namespaces are hierarchical object
models that support various properties and methods. For example, HTML server controls
reside in"System.web.Html Controls namespace, web server controls reside in
System.web.UI.WebControls" namespace and ADO+ resides in "System. Data namespace.
LANGUAGE INDEPENDENT
An ASP.NET page can be created in any language supported by .NET framework.
Currently .NET framework supports VB, C#, Script and Managed C++.
ASP.NET SERVER CONTROLS
Using ASP.NET Server Controls, browser variation is handled because these controls
output the HTML themselves based on the browser requesting the page.
TYPES OF CONTROLS
ASP.NET has two basic types of controls: HTML server controls and Web server
controls.HTML Server Controls are generated around specific HTML elements and the
ASP.NET engine changes the attributes of the elements based on server-side code that you
provide. Web server controls revolve more around the functional you need on the page. The
ASP.NET engine takes the extra steps to decide based upon the container of the requester,
what HTML to output.




16


CHAPTER 5

PROJECT DESCRIPTION


5.1 PROBLEM DEFINITION
MANETs there have been several suggestions for location services ranging from
simple flooding based services to hierarchical services. These location services have been
classified according to MANET based on how location servers are selected and queried. A major
difference between the flooding-based location services and the mapping based services are the
number of nodes acting as location servers.

A MANET( Mobile Ad-hoc Network ) where node B sends a signal to node A but
this does not tell anything about the quality of the connection in the reverse direction Routing
Overhead: In wireless ad hoc networks, nodes often change their location within network. So,
some stale routes are generated in the routing table which leads to unnecessary routing overhead.
This is the major problem with mobile ad-hoc networks as links come and go depending on the
transmission characteristics, one transmission might

5.2 OVERVIEW OF THE PROJECT
A mobile ad-hoc network (MANET) is a collection of mobile nodes that construct and
maintain a network without a centralized authority. Unlike in a more traditional wired network
(e.g., the Internet), there are no dedicated routers or switches responsible for forwarding packets;
instead, every node participates in relaying packets. In addition, since nodes are assumed mobile,
one-hop connectivity between nodes and the network topology can change over time.
Consequently, underlying routing protocols are asked to cope with potentially frequent changes
in topology. Recently there has been much research on understanding the network transport
throughput, or simply transport throughput, of multi-hop wireless networks.
17

5.3 MODULE DESCRIPTION
5.3.1 MODULES
1. Login
2. Network Formation
3. Send data using geographic routing
4. Receiving data
5. Expected overhead

Login
This is the module to Expected Routing Overhead for Location Service in MANETs
under Flat Geographic Routing

Network Formation
A mobile ad hoc network (MANET) is a collection of mobile nodes that construct and
maintain a network without a centralized authority. Un like in a more traditional wired network
(e.g., the Internet), there are no dedicated routers or switches responsible for forwarding packets
instead, every node participates in relaying packets.

Send data using geographic routing

Proactive and reactive routing, and suggested that control overhead is proportional to
the square of the number of nodes in the network. We assume that nodes employ flat geographic
position-based routing without designated location servers that maintain the location information
of mobile nodes.

Receiving data

Receive the data by the destination node there has been much research on understanding
the network transport throughput, or simply transport throughput, of multi hop wireless
networks: In their seminal paper Gupta and Kumar investigated the transport throughput of static
multi hop wireless networks and showed that the transport throughput increases, at best, as p
with an increasing number of nodes n.
18

Expected overhead

This result is then used to demonstrate that the expected overhead is where n is the
number of nodes, under both proactive and reactive geographic routing, with the assumptions
that nodes mobility is independent, and nodes adjust their transmission range to maintain
network connectivity. Finally, we prove that the minimum expected overhead under the same
assumptions is _on logon pp

5.4 Data Flow Diagram:
A graphic picture of the logical steps and sequence involved in a procedure or a
program is called a flow chart. Unlike detailed flowchart, Data Flow Diagrams do not supply
detailed description of the modules but graphically describes a systems data and how the data
interact with the system.
To construct a Data Flow Diagram, we use,
Arrow
Circles
Open End Box
Squares
An arrow identifies the data flow in motion. It is a pipeline through which information
is flown like the rectangle in the flowchart. A circle stands for process that converts data into
information. An open-ended box represents a data store, data at rest or a temporary repository of
data. A square defines a source or destination of system data.
Four rules for constructing a Data Flow Diagram
1. Arrows should not cross each other.
2. Squares, circles and files must bear names.
3. Decomposed data flow squares and circles can have same names.
4. Choose meaningful names for data flow
19

LEVEL 0

Network formation



Expected overhead


Fig 5.4.1 Network Formation
LEVEL 1












Nodes


Fig 5.4.2 Geographic routing

Login
Receiving
data

Sending data
using
geographic
routing

Login
Network
formation

Sending
data using
geographic
routing

Receiving
data
Expected overhead

20


LEVEL 2







Throughput









Throughput increase



Expected overhead



Fig 5.4.3 Sending the data to receiving data




Login

Network
formation
Sending data
using geographic
routing

Receivin
g data
21


5.5 ER DIAGRAM











Fig 5.5 ER Diagram







Login

Network
formation

Sending data using
geographic routing
Receiving
data

Expected overhead

22


5.5.1 Use Case Diagram



Fig 5.5.1 Use Case Diagram


User
Login

Network formation
Sending data using
geographic routing
Receiving data

Expected
overhead
23

5.5.2 Activity Diagram






Yes No








Fig 5.5.2 Activity Diagram



Login
Network formation
Sending data using
geographic touting
Receiving data
Expected overhead

24

5.5.3 COLLABARATION DIAGRAM







Fig 5.5.3 Collaboration Diagram









Login

Network formation
Sending data using
geographic routing
Expected overhead
Receiving data

25

5.6 INPUT DESIGN

Input design is the process of converting user-originated inputs to a computer-based
format. Input design is one of the most expensive phases of the operation of computerized
system and is often the major problem of a system. In the project, the input design is made in
various web forms with various methods.
For example, in the Admin form, the empty username and password is not allowed.
The username if exists in the database, the input is considered to be invalid and is not accepted.
Likewise, during the Download process, the download images, videos, documents, songs will
be noted.
5.7 OUTPUT DESIGN
Output design generally refers to the results and information that are generated by the
system for many end-users; output is the main reason for developing the system and the basis on
which they evaluate the usefulness of the application. In the project, the output is to create the
new folders, invite friends and download the files in the website.















26

CHAPTER 6


SYSTEM TESTING

The purpose of testing is to discover errors. Testing is the process of trying to discover
every conceivable fault or weakness in a work product. It provides a way to check the
functionality of components, sub assemblies, assemblies and/or a finished product it is the
process of exercising software. Software system meets its requirements and user expectations
and does not fail in an unacceptable manner. There are various types of test. Each test type
addresses a specific testing requirement.
TYPES OF TESTS

6.1 UNIT TESTING
Unit testing verification efforts on the smallest unit of software design, module. This is
known as Module Testing. The modules are tested separately. This testing is carried out during
programming stage itself. In these testing steps, each module is found to be working
satisfactorily as regard to the expected output from the module. Unit testing is conducted to
verify the functional performance of each modular component of the software. Unit testing
focuses on the smallest unit of the software design (i.e.), the module. As developing a driver
program, the test modules by developed or used. After the lower level modules were tested, the
modules that the next higher level those make use of the lower modules were tested each module
was tested against required functionality and test cases were developed to test boundary values.





27

6.2 USER ACCEPTANCE TESTING
Acceptance testing is a final stage of testing that is performed on a system prior to the
system being delivered to a live environment. Systems subjected to acceptance testing might
include such deliverables as a software system or a mechanical hardware system. Acceptance
tests are generally performed as "black box" tests. Black box testing means that the tester uses
specified inputs into the system and verifies that the resulting outputs are correct, without
knowledge of the system's internal workings. The system under consideration is tested for user
acceptance by constantly keeping in touch with prospective system and user at the time of
developing and making changes whenever required. This is done in regarding to the following
points.
Input screen design.
Output screen design.

6.3 SYSTEM TESTING
Testing is performed to identify errors. It is used for quality assurance. Testing is an
integral part of the entire development and maintenance process. The goal of the testing during
phase is to verify that the specification has been accurately and completely incorporated into the
design, as well as to ensure the correctness of the design itself. For example the design must not
have any logic faults in the design is detected before coding commences, otherwise the cost of
fixing the faults will be considerably higher as reflected. Detection of design faults can be
achieved by means of inspection as well as walkthrough. A test case in software engineering is a
set of conditions or variables under which a tester will determine whether an application or
software system is working correctly or not.





28


CHAPTER 7


SYSTEM IMPLEMENTATION
7.1 Implementation Procedure
Implementation is the stage of the project when the theoretical design is turned out into a
working system. Thus it can be considered to be the most critical stage in achieving a successful
new system and in giving the user, confidence that the new system will work and be effective
The implementation stage involves careful planning, investigation of the existing system and its
constraints on implementation, designing of methods to achieve changeover and evaluation of
changeover methods.
Implementation is the process of converting a new system design into operation. It is the
phase that focuses on user training, site preparation and file conversion for installing a candidate
system. The important factor that should be considered here is that the conversion should not
disrupt the functioning of the organization.
Implementation of the Software System
Its should be replace a manual system the problems encountered are converting files,
training users creating accurate files, and verifying printouts for integrity
Implementation of New Software System
Its should be replace an existing one this is usually a difficult conversion. if not properly
planned there can be many problems. Some large computer system have taken even years to
convert




29


CHAPTER 8


CONCLUSION & FUTURE ENHANCEMENT

8.1 CONCLUSION

It is concluded that the application works well and satisfy the end users. The
application is tested very well and errors are properly debugged. The application is
simultaneously accessed from more than one system. Simultaneous login from more than one
place is tested.
Further enhancements can be made to the application, so that the application
functions very attractive and useful manner than the present one. The speed of the transactions
become more enough now.

8.2 ENHANCEMENT
The project has covered almost all the requirements. Further requirements and
improvements can easily be done since the coding is mainly structured or modular in nature.
Improvements can be appended by changing the existing modules or adding new modules. One
important development that can be added to the project in future is file level backup, which is
presently done for folder level.






30



CHAPTER 9

APPENDIX
9.1 SOURCE CODE
SqlConnection cn = new SqlConnection("server=.;integrated security=true;database=evoting;");
cn.Open()
SqlCommandcmd1=newSqlCommand("select*fromreg
Name='"+txb_UName.Text.Trim()+"'",cn);
SqlDataReader dr = cmd1.ExecuteReader();
if (!dr.Read())
{
dr.Close();
SqlCommand cmd = new SqlCommand("insert reg values ('" + txb_UName.Text + "','" +
txb_Pass.Text + "','" + txb_Mail.Text + "','" + txb_Mobile.Text + "')", cn);
cmd.ExecuteNonQuery();
MessageBox.Show("Created
Successfully!","Information",MessageBoxButtons.OK,MessageBoxIcon.Asterisk);
Welcome we = new Welcome();
we.Show();
this.Hide();
}






31



Login Coding


SqlConnection cn = new SqlConnection("server=.;integrated security=true;database=evoting;");
SqlCommand cmd = new SqlCommand("select * from reg where Name='"+txb_UName.Text+"'
and Password='"+txb_Password.Text+"' ",cn);
cn.Open();
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
MessageBox.Show("Welcome: " + txb_UName.Text, "Information", MessageBoxButtons.OK,
MessageBoxIcon.Asterisk);
Routing_Graph rg = new Routing_Graph();
rg.Show();
this.Hide();
}
else
{
MessageBox.Show("Invalid UserName or
Password!","Alert!",MessageBoxButtons.OK,MessageBoxIcon.Error);
}






32


Nodes Identification Coding
StreamReader streamReader = new
string line;
listBox1.Items.Add("");
while ((line = streamReader.ReadLine()) != null)
{
if (line.StartsWith("\\"))
{
//Node_No++;
string name = (line.Substring(2).Substring(0, line.Substring(2).IndexOf(" ")).ToUpper());

//listBox1.Items.Add(tot_node+":"+name);

IPHostEntry ipEntry = Dns.GetHostEntry(name);
IPAddress[] iparrAddr = ipEntry.AddressList;
if (iparrAddr.Length > 0)

for (int intloop = 0; intloop < iparrAddr.Length; intloop++)
{
listBox1.Items.Add(tot_node + " : " + name + " -> " + iparrAddr[intloop].ToString());
cn.Open();
SqlCommand cmd4 = new SqlCommand("insert into LDetails (Node,NodeNo) values
('"+name+"','"+tot_node.ToString()+"')",cn);
cmd4.ExecuteNonQuery();
cn.Close();
}
tot_node++;
listBox1.Items.Add("");
}
33



Greddy Method formation

using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using EMK.Cartography;
using System.Data.SqlClient;
using System.Diagnostics;
using System.Net;
namespace GraphFormer
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Routing_Graph : System.Windows.Forms.Form
{
int tot_node = 0;
OpenFileDialog op = new OpenFileDialog();
#region Construction / Destruction
private ContextMenu MenuContextuel;
APropos DialogueAPropos = new APropos();
private FlickerFreePanel GraphPanel;
34

private System.Windows.Forms.ImageList ImagesActions;
private System.Windows.Forms.ImageList ImagesPasAPas;
private System.Windows.Forms.ToolBar FichierToolBar;
private System.Windows.Forms.ImageList ImagesFichier;
private System.Windows.Forms.ToolBarButton Sep1;
private System.Windows.Forms.Label LabelAide;
private System.Windows.Forms.ToolBarButton BoutonNouveau;
private System.Windows.Forms.ToolBarButton BoutonDessiner;
private System.Windows.Forms.ToolBarButton BoutonEffacer;
private System.Windows.Forms.ToolBarButton BoutonDeplacer;
private System.Windows.Forms.ToolBarButton BoutonChangerEtat;
private System.Windows.Forms.ToolBarButton BoutonAEtoile;
private System.Windows.Forms.ToolBar EditionToolBar;
private System.ComponentModel.IContainer components;
static int Rayon = 7;
static int Epaisseur = 1;
static Pen CrayonNoeuds;
static Pen CrayonArcs;
static Pen CrayonNoeudsInactifs;
static Pen CrayonArcsInactifs;
static Pen CrayonTemp;
static Pen CrayonChemin;
private StatusBarPanel CoordsPanel;
private StatusBarPanel NbArcsPanel;
private StatusBarPanel NbNodesPanel;
private StatusBar GraphStatusBar;
public ListBox listBox1;
private Label label1;
private Label lbl_Info;
private Timer timer_Check private Button button1;
static Pen CrayonArcsPas;
35


static Routing_Graph()
{
CrayonNoeuds = new Pen(Color.Black, Epaisseur);
CrayonNoeudsInactifs = new Pen(Color.Gray, Epaisseur);
CrayonArcs = new Pen(Color.Black, Epaisseur);
CrayonArcs.EndCap = LineCap.Custom;
CrayonArcs.CustomEndCap = new AdjustableArrowCap(3, 6, true);
CrayonArcsInactifs = new Pen(Color.Gray, Epaisseur);
CrayonArcsInactifs.EndCap = LineCap.Custom;
CrayonArcsInactifs.CustomEndCap = new AdjustableArrowCap(3, 6, true);
CrayonTemp = new Pen(Color.Gray, Epaisseur);
CrayonTemp.DashStyle = DashStyle.Dash;
CrayonChemin = new Pen(Color.DarkTurquoise, 3);
CrayonChemin.DashStyle = DashStyle.Dot;
CrayonArcsPas = new Pen(Color.LawnGreen, 3);
CrayonArcsPas.EndCap = LineCap.Custom;
CrayonArcsPas.CustomEndCap = new AdjustableArrowCap(4, 8, true);
}
public Routing_Graph()
{
MenuContextuel = new ContextMenu();
MenuContextuel.MenuItems.Add(new MenuItem("Automatic", new
MenuContextuel.MenuItems.Add(new MenuItem("Step by step", new
InitializeComponent();
BoutonAEtoile.DropDownMenu = MenuContextuel;
G = new Graph();
NouveauGraphe();
Mode = Action.Dessiner;
}
}
36



RECEVING DATA
using System;
using System.Collections;
namespace EMK.Collections
{
/// <summary>
/// The SortableList allows to maintain a list sorted as long as needed.
/// If no IComparer interface has been provided at construction, then the list expects the
Objects to implement IComparer.
/// If the list is not sorted it behaves like an ordinary list.
/// When sorted, the list's "Add" method will put new objects at the right place.
/// As well the "Contains" and "IndexOf" methods will perform a binary search.
/// </summary>
[Serializable]
public class SortableList : IList, ICloneable
{
private ArrayList _List;
private IComparer _Comparer;
private bool _UseObjectsComparison;
private bool _IsSorted;
private bool _KeepSorted;
private bool _AddDuplicates;
37


/// <summary>
/// Default constructor.
/// Since no IComparer is provided here, added objects must implement the
IComparer interface.
/// </summary>
public SortableList() { InitProperties(null, 0); }

/// <summary>
/// Constructor.
/// Since no IComparer is provided, added objects must implement the IComparer
interface.
/// </summary>
/// <param name="Capacity">Capacity of the list (<see
cref="ArrayList.Capacity">ArrayList.Capacity</see>)</param>
public SortableList(int Capacity) { InitProperties(null, Capacity); }

/// <summary>
/// Constructor.
/// </summary>
/// <param name="Comparer">Will be used to compare added elements for sort
and search operations.</param>
public SortableList(IComparer Comparer) { InitProperties(Comparer, 0); }
38


/// <summary>
/// Constructor.
/// </summary>
/// <param name="Comparer">Will be used to compare added elements for sort
and search operations.</param>
/// <param name="Capacity">Capacity of the list (<see
cref="ArrayList.Capacity">ArrayList.Capacity</see>)</param>
public SortableList(IComparer Comparer, int Capacity) { InitProperties(Comparer, Capacity); }

/// <summary>
/// 'Get only' property that indicates if the list is sorted.
/// </summary>
public bool IsSorted { get { return _IsSorted; } }

/// <summary>
/// Get : Indicates if the list must be kept sorted from now on.
/// Set : Tells the list if it must stay sorted or not. Impossible to set to true if the
list is not sorted.
/// <see cref="KeepSorted">KeepSorted</see>==true implies that <see
cref="IsSorted">IsSorted</see>==true
/// </summary>
39

/// <exception cref="InvalidOperationException">Cannot be set to true if the list
is not sorted yet.</exception>
public bool KeepSorted
{
set
{
if ( value==true && !_IsSorted ) throw new InvalidOperationException("The SortableList can
only be kept sorted if it is sorted.");
KeepSorted = value;
}
get { return _KeepSorted; }
}

/// <summary>
/// If set to true, it will not be possible to add an object to the list if its value is
already in the list.
/// </summary>
public bool AddDuplicates { set { _AddDuplicates = value; } get { return _AddDuplicates; } }

/// <summary>
/// IList implementation.
/// Gets - or sets - object's value at a specified index.
40

/// The set operation is impossible if the <see
cref="KeepSorted">KeepSorted</see> property is set to true.
/// </summary>
/// <exception cref="ArgumentOutOfRangeException">Index is less than zero or
Index is greater than Count.</exception>
/// <exception cref="InvalidOperationException">[] operator cannot be used to set
a value if KeepSorted property is set to true.</exception>
public object this[int Index]
{
get
{
if ( Index>=_List.Count || Index<0 ) throw new ArgumentOutOfRangeException("Index is less
than zero or Index is greater than Count.");
return _List[Index];
}
set
{
if ( _KeepSorted ) throw new InvalidOperationException("[] operator cannot be used to set a
value if KeepSorted property is set to true.");
if ( Index>=_List.Count || Index<0 ) throw new ArgumentOutOfRangeException("Index is less
than zero or Index is greater than Count.");
if ( ObjectIsCompliant(value) )
{
41

object OBefore = Index>0 ? _List[Index-1] : null;
object OAfter = Index<Count-1 ? _List[Index+1] : null;
if ( OBefore!=null && _Comparer.Compare(OBefore, value)>0 || OAfter!=null &&
_Comparer.Compare(value, OAfter)>0 ) _IsSorted = false;_List[Index] = value;
}
}
}

/// <summary>
/// IList implementation.
/// If the <see cref="KeepSorted">KeepSorted</see> property is set to true, the
object will be added at the right place.
/// Else it will be added at the end of the list.
/// </summary>
/// <param name="O">The object to add.</param>
/// <returns>The index where the object has been added.</returns>
/// <exception cref="ArgumentException">The SortableList is set to use object's
IComparable interface, and the specifed object does not implement this interface.</exception>
public int Add(object O)
{
int Return = -1;
if ( ObjectIsCompliant(O) )
{
42

if ( _KeepSorted )
{
int Index = IndexOf(O);
int NewIndex = Index>=0 ? Index : -Index-1;
if (NewIndex>=Count) _List.Add(O);
else _List.Insert(NewIndex, O);
Return = NewIndex;
}
Else
{
IsSorted = false;
Return = _List.Add(O);
}
}
return Return;
}

/// <summary>
/// IList implementation.
/// Search for a specified object in the list.
/// If the list is sorted, a <see cref="ArrayList.BinarySearch">BinarySearch</see>
is performed using IComparer interface.
/// Else the <see cref="Equals">Object.Equals</see> implementation is used.
43

/// </summary>
/// <param name="O">The object to look for</param>
/// <returns>true if the object is in the list, otherwise false.</returns>
public bool Contains(object O)
{
return _IsSorted ? _List.BinarySearch(O, _Comparer)>=0 : _List.Contains(O);
}

/// <summary>
/// IList implementation.
/// Returns the index of the specified object in the list.
/// If the list is sorted, a <see cref="ArrayList.BinarySearch">BinarySearch</see>
is performed using IComparer interface.
/// Else the <see cref="Equals">Object.Equals</see> implementation of objects is
used.
/// </summary>
/// <param name="O">The object to locate.</param>
/// <returns>
/// If the object has been found, a positive integer corresponding to its position.
/// If the objects has not been found, a negative integer which is the bitwise
complement of the index of the next element.
/// </returns>
public int IndexOf(object O)
44

{
int Result = -1;
if ( _IsSorted )
{
Result = _List.BinarySearch(O, _Comparer);
while ( Result>0 && _List[Result-1].Equals(O) ) Result--; // We want to point at the FIRST
occurence
}
else Result = _List.IndexOf(O);
return Result;
}
public void Insert(int Index, object O)
{
if ( _KeepSorted ) throw new InvalidOperationException("Insert method cannot be called if
KeepSorted property is set to true.");
if ( Index>=_List.Count || Index<0 ) throw new ArgumentOutOfRangeException("Index is less
than zero or Index is greater than Count.");
if ( ObjectIsCompliant(O) )
{
}



45



ROUTING PATH

using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO
public override bool Equals(object O)
{
SortableList SL = (SortableList)O;
if ( SL.Count!=Count ) return false;
for (int i=0; i<Count; i++)
if ( !SL[i].Equals(this[i]) ) return false;
return true;
}

/// <summary>
/// Object.GetHashCode() override.
/// </summary>
/// <returns>HashCode value.</returns>
public override int GetHashCode() { return _List.GetHashCode(); }

/// <summary>
/// Sorts the elements in the list using <see
cref="ArrayList.Sort">ArrayList.Sort</see>.
46

/// Does nothing if the list is already sorted.
/// </summary>
public void Sort()
{
if (_IsSorted) return;
_List.Sort(_Comparer);
_IsSorted = true;
}

/// <summary>
/// If the <see cref="KeepSorted">KeepSorted</see> property is set to true, the
object will be added at the right place.
/// Else it will be appended to the list.
/// </summary>
/// <param name="C">The object to add.</param>
/// <returns>The index where the object has been added.</returns>
/// <exception cref="ArgumentException">The SortableList is set to use object's
IComparable interface, and the specifed object does not implement this interface.</exception>
public void AddRange(ICollection C)
{
if ( _KeepSorted ) foreach (object O in C) Add(O);
else _List.AddRange(C);
}

/// <summary>
/// Inserts a collection of objects at a specified index.
/// Should not be used if the list is the KeepSorted property is set to true.
/// </summary>
/// <param name="Index">The index before which the objects must be
added.</param>
/// <param name="C">The object to add.</param>
47

/// <exception cref="ArgumentException">The SortableList is set to use objects's
IComparable interface, and the specifed object does not implement this interface.</exception>
/// <exception cref="ArgumentOutOfRangeException">Index is less than zero or
Index is greater than Count.</exception>
/// <exception cref="InvalidOperationException">If the object is added at the
specify index, the list will not be sorted any more and the <see cref="KeepSorted"/> property is
set to true.</exception>
public void InsertRange(int Index, ICollection C)
{
if ( _KeepSorted ) foreach (object O in C) Insert(Index++, O);
else _List.InsertRange(Index, C);
}

/// <summary>
/// Limits the number of occurrences of a specified value.
/// Same values are equals according to the Equals() method of objects in the list.
/// The first occurrences encountered are kept.
/// </summary>
/// <param name="Value">Value whose occurrences number must be
limited.</param>
/// <param name="NbValuesToKeep">Number of occurrences to keep</param>
public void LimitNbOccurrences(object Value, int NbValuesToKeep)
{
if (Value==null) throw new ArgumentNullException("Value");
int Pos = 0;
while ( (Pos=IndexOf(Value, Pos)) >= 0 )
{
if ( NbValuesToKeep<=0 ) _List.RemoveAt(Pos);
else { Pos++; NbValuesToKeep--; }
if ( _IsSorted && _Comparer.Compare(_List[Pos], Value)>0 ) break; // No need to follow
}
48

}

public void RemoveDuplicates()
{
int PosIt;
if (_IsSorted)
{
PosIt = 0;
while ( PosIt<Count-1 )
{
if ( _Comparer.Compare(this[PosIt], this[PosIt+1])==0 ) RemoveAt(PosIt);
else PosIt++;
}
}
else
{
int Left = 0;
while ( Left>=0 )
{
PosIt = Left+1;
while (PosIt>0)
{
if ( Left!=PosIt && _Comparer.Compare(this[Left], this[PosIt])==0 ) RemoveAt(PosIt);
else PosIt++;
}
Left++;
}
}
}
public int IndexOfMin()
{
49

int RetInt = -1;
if ( _List.Count>0 )
{
RetInt = 0;
object RetObj = _List[0];
if ( !_IsSorted )
{
for ( int i=1; i<_List.Count; i++ )
if ( _Comparer.Compare(RetObj, _List[i])>0 )
{
RetObj = _List[i];
RetInt = i;
}
}
}
return RetInt;
}
public int IndexOfMax()
{
int RetInt = -1;
if ( _List.Count>0 )
{
RetInt = _List.Count-1;
object RetObj = _List[_List.Count-1];
if ( !_IsSorted )
{
for ( int i=_List.Count-2; i>=0; i-- )
if ( _Comparer.Compare(RetObj, _List[i])<0 )
{
RetObj = _List[i];
RetInt = i;
50

}
}


9.2 SCREEN SHOT

9.2.1 Register Form




51


Fig 9.2.1 Register Form


9.2.2 LOGIN FORM




52

Fig 9.2.2 LOGIN FORM


9.2.3 ROUTING



Fig 9.2.3 ROUTING



53




9.2.4 ROUTER PATHS




Fig 9.2.4 ROUTER PATHS



54




9.2.5 ROUTING GREEDY FORMATION:



Fig 9.2.5 ROUTING GREEDY FORMATION





55




CHAPTER 10


REFERENCES
1. Douse and P. Thira,2004 Connectivity vs. Capacity in Dense Ad Hoc Networks, Proc.
IEEE.

2. P. Gupta and P.R. Kumar,2000. The Capacity of Wireless Networks, IEEE Trans.
Information Theory.

3. D.B. Johnson and D.A. Maltz, Dynamic Source Routing in Ad Hoc Wireless Networks,
Proc. Mobile Computing, pp.

4. M.D. Penrose, 1999A Strong Law for the Longest Edge of the Minimal Spanning Tree, The
Annals of Probability.

WEB REFERENCES:
1. www.msdn.microsoft.com
2.www.asp.net
3.www.fmexpense.com/quick start/asp plus/default.com

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