You are on page 1of 92

Chapter 1

NetSurvey Simulation

Abstrac t

Abstract

The main aim of the project Netsurvey Simulation System is to permit the authenticated users to Better Understand the Functionalities of Different Protocols in Different Stages of Data Transfer using OSI ayers! The Netsurvey Simulation System is a ne" system #ringing OSI ayers information in a #etter "ay$ in "hich different "ay ayers differ "ith each other and the "ay of running of information in each and every ayer! The ne" Netsurvey Simulation System includes a no of features "hich helps the %nd User in a relia#le and easiest Simulation of the Protocols &an &hec' any one of the ayers Directly Separate in's #et"een Protocols of different ayers Parallel e(ecution of the sessions )iving a chance for manipulating the settings or options of different ayers! &an #e accessed from any"here on the "e#

Project Synopsis

Introduction Synopsis

Netsurvey Simulation is a tool$ "hich helps the users of the system to get clear picture of the net"or' layers$ their functions and the protocols used in the layers! The simulation tool "ill clearly e(plain the functioning of the protocols used in all the layers in neat graphical interface! The tool ta'es some values from the users and simulates the "or'ing of the protocols! NSS tool has good animations )UI $user friendly interface this is done using s"ings in java language &omputers on a net"or' communicate in agreed upon "ays called protocols! The comple(ity of net"or'ing protocol soft"are calls for the pro#lem to #e divided into smaller pieces! * layering model aids this division and provides the conceptual #asis for understanding ho" soft"are protocols together "ith hard"are devices provide a po"erful communication system! 4.1 Layering Models In the early days of net"or'ing$ #efore the rise of the u#i+uitous Internet$ the International Organi,ation for Standardi,ation -ISO. developed a layering model "hose terminology persists today! Table 2. ISO 7-Layer Reference Model Name of Layer ayer / ayer 0 ayer 1 ayer 2 ayer *pplication Presentation Session Transport Net"or' Purpose of Layer Specifies ho" a particular application uses a net"or'! Specifies ho" to represent data! Specifies ho" to esta#lish communication "ith a remote system! Specifies ho" to relia#ly handle data transfer! Specifies addressing assignments and ho" pac'ets are

3 ayer 4 ayer 5 Data in' Physical

for"arded! Specifies the organi,ation of data into frames and ho" to send frames over a net"or'! Specifies the #asic net"or' hard"are!

The /6layer model has #een revised to the 16layer T&P7IP reference model to meet the current needs of protocol designers! Table 3. TCP/IP 5-Layer Reference Model Name of Layer Purpose of Layer ayer 1 *pplication ayer 2 Transport ayer 3 Internet ayer 4 Net"or' ayer 5 Physical Specifies ho" a particular application uses a net"or'! Specifies ho" to ensure relia#le transport of data! Specifies pac'et format and routing! Specifies frame organi,ation and transmittal! Specifies the #asic net"or' hard"are!

Chapter 3

System Configuration

The software requirement specification can produce at the culmination of the analysis task. The function and performance allocated to software as part of system engineering are refined by established a complete information description, a detailed functional description, a representation of system behavior, an indication of performance and design constrain, appropriate validation criteria, and other information pertinent to requirements. This

project requires the following H/W and them. They are as given below. Software Requirements: Operating System Windows "T/#$$$ %&lient/ erver'. Software requirements

/W equipment in order to e!ecute

(ront)end* +ava +,- ../, +# dk ..../,

wings.

Hardware Requirements: System Configuration

0entium 111 0rocessor with 2$$ 3H4 &lock

.#5 36 783, #$ 96 H,,, :# 6it 0&1 ;thernet &ard.

Chapter 4
peed

System Analysis

Existing and Proposed System

Existing system:1n the present situation people from all domains have less knowledge of networking , the reason for that is it not as easy concept as the other computer science topics ,theory about T&0/10 protocol layers not that easy to understand as it is very low level implementation format at the same time all these layers are already

taken care by the under lying operating system, so people do not really bother about the tcp/ip layers there by the coming generation as well forget importance of T&0/10 layers Proposed system:1n this application we are trying to generate awareness about the T&0/10 layers to all the people who are not in networking domain as well as to the people who feel difficulty in understanding these layers

Analysis Report

System Analysis

0roject

cope

When communication is desired among computers from different vendors, the software development effort can be very difficult.

,ifferent vendors use different data formats and data e!change protocols that do not allow computers to communicate with one another. 7ecogni4ing the problem, the 1nternational <rgani4ation for tandardi4ation %1 <' develops communications architecture known as the <pen ystem 1nterconnection %< 1' model that defines standards for linking heterogeneous computers. Overall escription

0roduct 0erspective The 0rotocol imulation is a new system that will help in

understanding the working of < 1 layers. 1t will give the simulation for working of the < 1 layers. 6y seeing this, every user will get a clear picture of how the < 1 layers will work and what are its functions. 0roduct (eatures The 0rotocol imulation ystem will permit the ;nd =sers to know the top the 0roceedings of the

inner functionalities of different 0rotocols in ,ifferent type of < 1 >ayers.The =ser can 0ause, 7esume and imulation at any time to check the functionality. He/ he can also vary the functionalities by setting different options as well as settings. He/ he can also get Help by clicking on the Help 6utton.

=ser &lasses and &haracteristics !" #ormal $sers * ) 8ny user can use the system and can analy4e the working of < 1 layers by using different settings. <perating ;nvironment 1. The 0rotocol imulation ystem shall operate with a web

browser having java runtime environment plugins.

,esign and 1mplementation &onstraints I" The system shall use the current corporate standard +,-..!, II" III" I%" 8ll HT3> code shall confirm to HT3> /.$ standard. 8ll scripts must be written in +ava cript. 8ll the computational statements must be separated from + 0 pages. =ser ,ocumentation I" The system shall provide an online hierarchical and cross linked help system in HT3> that describes and illustrates all system functions. 8ssumptions and ,ependencies The operations of the imulation of 0rotocols depends on the ,efault settings and changes made by the =ser. System &eatures tarting and ?iewing imulation

escription The ;nd user may start any one of the >ayers ,irectly. layer from the current layer. Stimulus'Response Sequences ome times the

user may want to go back to home page or to some other

timulus* a layer.

The user requests the system to know about ystem responds the user by opening the

7esponse*

corresponding layer page. timulus* protocol. 7esponse* ystem checks whether +?3 plugins are available. 1f they e!ists, the system opens the 0rotocol page along th corresponding java applet. timulus* the settings. 7esponse* timulus* The ystem responds by opening a The user request the system to change The user requests the system to simulate a

frame to change the settings or options. The user requests the system to confirm the settings by pressing ,one. 7esponse* temporarily for this ystem ession tore the changed settings

timulus* The user request to start the simulation. 7esponse*The system responds with appropriate simulation of that 0articular protocol.

&unctional Requirements

Request"(ade: The system shall let the user made a request to see any one of >ayers. Request"Register: The system starts processing the request. Request"C)ange"Settings: The system notes the requested changes and stores them temporarily in the current session. Request"start"simulation: 1f the user requests to start a imulation, the system start simulation with the default settings. Request"Help: The user must be able to get any help required about the using of the different settings and functions of any protocol.

*+ternal Interface Requirements =ser 1nterfaces .. The system shall provide help link from each displayed HT3> page. #. The web pages shall permit complete navigation through keyboard or mouse.

Hardware 1nterfaces @"1>A oftware 1nterfaces I" The 0rotocol imulation ystem shall get the +?3 plugins from operating system. II" The 0rotocol imulation ystem shall send request to

the system having a Web 6rowser and get response form that one only. &ommunications 1nterfaces The 0rotocol imulation ystem shall communicate with the end user in a user (riendly way. Ot)er #onfunctional Requirements 0erformance 7equirements II The 0rotocol imulation ystem must be in a position to accomodate " number of users in peak time. The 0rotocol imulation ystem must be in a position to

III

start simulation in case of failure. 8ll the web pages generated by the system shall be shown in the same browser.

IIII

oftware Buality 8ttributes Availability ! : ) The 0rotocol available to the users at any time. imulation ystem shall be

Chapter 5

System Design

*lements of

esign

Top Level Design


8 graphic representation of the CflowC of data through business functions or processes. 1t illustrates the processes, data stores, e!ternal entities, data flows, and their relationships.

etailed ,rocess

esign escription imulation ystem is to the

The main aim of the project 0rotocol permit the authenticated users to

6etter

=nderstand

(unctionalities of ,ifferent 0rotocols in ,ifferent Transfer using < 1 >ayers. The 0rotocol imulation

tages of ,ata

ystem is a new system bringing < 1 in which different way >ayers

>ayers information in a better way, and every >ayer. The new 0rotocol which helps the ;nd =ser in a reliable and easiest i. ii. iii. imulation

differ with each other and the way of running of information in each ystem includes a no of features

imulation of the 0rotocols

&an &heck any one of the >ayers ,irectly eparate >inks between 0rotocols of different >ayers 0arallel e!ecution of the sessions

iv.

9iving a chance for manipulating the settings or options of different >ayers.

v.

&an be accessed from anywhere on the web

-" 4.1

Implemetation

etails

,latform',rogramming .anguage and /ools

O,*RA/I#0 S1S/*( (AR2$, .A#0$A0*S

* W1",<W * HT3>

(831>D, >1"=E (831>D

SCRI,/I#0 .A#0$A0*S * +8?8

&710T

,RO0RA((I#0 .A#0$A0*S* +8?8

Dataflow Diagrams

ataflow

iagrams

3 .evel

iagram

&lient

Net"or' Protocol Simulation

&lient

!st .evel

iagram

sender

Sending 8essage

*pplication ayer

Uses SMTP Protocol

receiver

!st .evel

iagram

&lient

Send Packet

Data in' ayer

Sliding window Protocol

9eceiver

!st .evel

iagram

Sender

Sends Packet

Data in' ayer

Sliding window Goback n

9eceiver

!st .evel

iagram

&lient

Send Packet

Net"or' ayer

&lient

Flooding

!st .evel

iagram

Sender

Send Packet

Net"or' ayer

Fi(ed 9outing

9eceiver

UML

Diagrams

$se case

iagram

HIGH L ! L " #se $ase Diagram

%ppli&ation Layer Transport Layer Net'or( Layer DataLin( Layer P)ysi&al Layer

Chapter 6

System Descriptio n

System

escription

The ;nd user may start any one of the >ayers ,irectly.

ome times the

user may want to go back to home page or to some other layer from the current layer. Stimulus'Response Sequences timulus* The user requests the system to know about a layer. 7esponse* ystem responds the user by opening the corresponding layer page.

timulus* 7esponse*

The user requests the system to simulate a protocol. ystem checks whether +?3 plugins are available.

1f they e!ists, the system opens the 0rotocol page along With corresponding java applet. timulus* The user request the system to change the settings. 7esponse* The ystem responds by opening a frame to change the settings or options. timulus* The user requests the system to confirm the settings by pressing ,one. 7esponse* ession timulus* The user request to start the simulation. 7esponse* The system responds with appropriate simulation of that 0articular protocol. ystem tore the changed settings temporarily for this

UML Class & Collaboratio

n Diagrams

AR4Simulation Class

%ncrypt &lass 6666666666666666

)oBac' :N; &lass - Implementing Silding "indo" protocol.

Sliding &lass

Stac' &lass

S8TP &lass

Software Overview

&*A/$R*S O& /H* .A#0$A0* $S* About 5ava 1nitially the language was called as FoakG but it was renamed as F+avaG in .HHI. The primary motivation of this language was the need for a platform)independent %i.e., architecture neutral' language that could be used to create software to be embedded in various consumer electronic devices. +ava is a programmerJs language. +ava is cohesive and consistent. ;!cept for those constraints imposed by the 1nternet environment, +ava gives the programmer, full control. (inally, +ava is to 1nternet programming where & was to system programming. Applications and Applets 8n application is a program that runs on our &omputer under the operating system of that computer. 1t is more or less like one creating using & or &KK. +avaJs ability to create 8pplets makes it important. 8n 8pplet is an application designed, to be transmitted over the 1nternet and e!ecuted by a +ava Lcompatible web browser. 8n applet is actually a tiny +ava program, dynamically downloaded across the network, just like an image. 6ut the difference is, it is an intelligent program, not just a media file. 1t can react to the user input and dynamically change. &*A/$R*S O& 5A%A Security ;very time you that you download a FnormalG program, you are risking a viral infection. 0rior to +ava, most users did not download e!ecutable programs frequently, and those who did scanned them for viruses prior to

e!ecution. 3ost users still worried about the possibility of infecting their systems with a virus. 1n addition, another type of malicious program e!ists that must be guarded against. This type of program can gather private information, such as credit card numbers, bank account balances, and passwords. +ava answers both of these concerns by providing a FfirewallG between a networked application and your computer. When you use a +ava) compatible Web browser, you can safely download +ava applets without fear of virus infection or malicious intent. ,ortability (or programs to be dynamically downloaded to all the various types of platforms connected to the 1nternet, some means of generating portable e!ecutable code is needed .8s you will see, the same mechanism that helps ensure security also helps create portability. 1ndeed, +avaJs solution to these two problems is both elegant and efficient. /)e 6yte code The key that allows the +ava to solve the security and portability problem is that the output of +ava compiler is 6yte code. 6yte code is a highly optimi4ed set of instructions designed to e!ecute by the +ava run)time system, which is called the +ava ?irtual 3achine %+?3'. That is, in its standard form, the +?3 is an interpreter for byte code. Translating a +ava program into byte code helps makes it much easier to run a program in a wide variety of environments. The reason is, <nce the run)time package e!ists for a given system, any +ava program can run on it. 8lthough +ava was designed for interpretation, there is technically nothing about +ava that prevents on)the)fly compilation of byte code into native code. un has just completed its +ust 1n Time %+1T' compiler for byte code. When the +1T compiler is a part of +?3, it compiles byte code into e!ecutable code in real time, on a piece)by)piece, demand basis. 1t is not possible to compile an entire +ava program into e!ecutable code all at once, because

+ava performs various run)time checks that can be done only at run time. The +1T compiles code, as it is needed, during e!ecution. 5ava %irtual (ac)ine 75%(8 6eyond the language, there is the +ava virtual machine. The +ava virtual machine is an important element of the +ava technology. The virtual machine can be embedded within a web browser or an operating system. <nce a piece of +ava code is loaded onto a machine, it is verified. 8s part of the loading process, a class loader is invoked and does byte code verification makes sure that the code thatJs has been generated by the compiler will not corrupt the machine that itJs loaded on. 6yte code verification takes place at the end of the compilation process to make sure that is all accurate and correct. o byte code verification is integral to the compiling and e!ecuting of +ava code.

5ava Source

*ava&
Java byte code

5ava %irtual (ac)ine

"5ava

"Class

The above picture shows the development process a typical +ava programming uses to produce byte codes and e!ecutes them. The first bo! indicates that the +ava source code is located in a. +ava file that is processed with a +ava compiler called 5A%A. The +ava compiler produces a file called a. class file, which contains the byte code. The class file is then loaded across the network or loaded byte code. 5ava Arc)itecture locally on your machine into the e!ecution environment is the +ava virtual machine, which interprets and e!ecutes the

+ava

architecture

provides

portable,

robust,

high

performing

environment for development. +ava provides portability by compiling the byte codes for the +ava ?irtual 3achine, which is then interpreted on each platform by the run)time environment. +ava is a dynamic system, able to load code when needed from a machine in the same room or across the planet. Compilation of Code When you compile the code, the +ava compiler creates machine code %called byte code' for a hypothetical machine called +ava ?irtual 3achine %+?3'. The +?3 is supposed to e!ecute the byte code. The +?3 is created for overcoming the issue of portability. The code is written and compiled for one machine and interpreted on all machines. This machine is called +ava ?irtual 3achine. &ompiling and interpreting +ava ource &ode

PC Compiler Source Code .. <<<!! <<<!! Macintosh Compiler

Ja a !yte code

Ja a $nterpreter "PC%

Ja a $nterpreter "Macintosh%

<<< < "Plat#orm


$ndependent% Ja a $nterpreter "Sparc%

SPARC Compiler

,uring run)time the +ava interpreter tricks the byte code file into thinking that it is running on a +ava ?irtual 3achine. 1n reality this could be a 1ntel

0entium Windows HI or

un 87& station running

olaris or 8pple 3acintosh

running system and all could receive code from any computer through 1nternet and run the 8pplets. SI(,.* +ava was designed to be easy for the 0rofessional programmer to learn and to use effectively. 1f you are an e!perienced &KK programmer, learning +ava will be even easier. 6ecause +ava inherits the &/&KK synta! and many of the object oriented features of &KK. 3ost of the confusing concepts from &KK are either left out of +ava or implemented in a cleaner, more approachable manner. 1n +ava there are a small number of clearly defined ways to accomplish a given task. <bject)<riented +ava was not designed to be source)code compatible with any other language. This allowed the +ava team the freedom to design with a blank slate. <ne outcome of this was a clean usable, pragmatic approach to objects. The object model in +ava is simple and easy to e!tend, while simple types, such as integers, are kept as high)performance non)objects. Robust The multi)platform environment of the Web places e!traordinary demands on a program, because the program must e!ecute reliably in a variety of systems. The ability to create robust programs was given a high priority in the design of +ava. +ava is strictly typed languageM it checks your code at compile time and run time. +ava virtually eliminates the problems of memory management and de)allocation, which is completely automatic. 1n a well)written +ava program, all run time errors can Land should Lbe managed by your program.

9)at is #etwor:ing; &omputers running on the 1nternet communicate to each other using either the Transmission &ontrol 0rotocol %T&0' or the =ser ,atagram 0rotocol %=,0', as this diagram illustrates*

When you write +ava programs that communicate over the network, you are programming at the application layer. Typically, you donNt need to concern yourself with the T&0 and =,0 layers. 1nstead, you can use the classes in the
java.net

package. These classes provide system)independent network

communication. However, to decide which +ava classes your programs should use, you do need to understand how T&0 and =,0 differ. /C, When two applications want to communicate to each other reliably, they establish a connection and send data back and forth over that connection. This is analogous to making a telephone call. 1f you want to speak to 8unt 6eatrice in -entucky, a connection is established when you dial her phone number and she answers. Dou send data back and forth over the connection by speaking to one another over the phone lines. >ike the phone company, T&0 guarantees that data sent from one end of the connection actually gets to the other end and in the same order it was sent. <therwise, an error is reported.

T&0 provides a point)to)point channel for applications that require reliable communications. The Hyperte!t Transfer 0rotocol %HTT0', (ile Transfer 0rotocol %(T0', and Telnet are all e!amples of applications that require a reliable communication channel. The order in which the data is sent and received over the network is critical to the success of these applications. When HTT0 is used to read from a =7>, the data must be received in the order in which it was sent. <therwise, you end up with a jumbled HT3> file, a corrupt 4ip file, or some other invalid information. efinition: TCP %Transmission Control Protocol' is a connection)based

protocol that provides a reliable flow of data between two computers. $ , The =,0 protocol provides for communication that is not guaranteed between two applications on the network. =,0 is not connection)based like T&0. 7ather, it sends independent packets of data, called datagrams, from one application to another. ending datagrams is much like sending a letter through the postal service* The order of delivery is not important and is not guaranteed, and each message is independent of any other. efinition: UDP %User Datagram Protocol' is a protocol that sends

independent packets of data, called datagrams, from one computer to another with no guarantees about arrival. =,0 is not connection)based like T&0. (or many applications, the guarantee of reliability is critical to the success of the transfer of information from one end of the connection to the other. However, other forms of communication donNt require such strict standards. 1n fact, they may be slowed down by the e!tra overhead or the reliable connection may invalidate the service altogether. &onsider, for e!ample, a clock server that sends the current time to its client when requested to do so. 1f the client misses a packet, it doesnNt really

make sense to resend it because the time will be incorrect when the client receives it on the second try. 1f the client makes two requests and receives packets from the server out of order, it doesnNt really matter because the client can figure out that the packets are out of order and make another request. The reliability of T&0 is unnecessary in this instance because it causes performance degradation and may hinder the usefulness of the service. 8nother e!ample of a service that doesnNt need the guarantee of a reliable channel is the ping command. The purpose of the ping command is to test the communication between two programs over the network. 1n fact, ping needs to know about dropped or out)of)order packets to determine how good or bad the connection is. 8 reliable channel would invalidate this service altogether. The =,0 protocol provides for communication that is not guaranteed between two applications on the network. =,0 is not connection)based like T&0. 7ather, it sends independent packets of data from one application to another. ending datagrams is much like sending a letter through the mail service* The order of delivery is not important and is not guaranteed, and each message is independent of any others. #ote: 3any firewalls and routers have been configured not to allow =,0 packets. 1f youNre having trouble connecting to a service outside your firewall, or if clients are having trouble connecting to your service, ask your system administrator if =,0 is permitted. $nderstanding ,orts 9enerally speaking, a computer has a single physical connection to the network. 8ll data destined for a particular computer arrives through that connection. However, the data may be intended for different applications running on the computer. o how does the computer know to which application to forward the dataO Through the use of ports.

,ata transmitted over the 1nternet is accompanied by addressing information that identifies the computer and the port for which it is destined. The computer is identified by its :#)bit 10 address, which 10 uses to deliver data to the right computer on the network. 0orts are identified by a .P)bit number, which T&0 and =,0 use to deliver the data to the right application. 1n connection)based communication such as T&0, a server application binds a socket to a specific port number. This has the effect of registering the server with the system to receive all data destined for that port. 8 client can then rende4vous with the server at the serverNs port, as illustrated here*

efinition: The T&0 and =,0 protocols use ports to map incoming data to a particular process running on a computer. 1n datagram)based communication such as =,0, the datagram packet contains the port number of its destination and =,0 routes the packet to the appropriate application, as illustrated in this figure*

0ort numbers range from $ to PI,I:I because ports are represented by .P) bit numbers. The port numbers ranging from $ ) .$#: are restrictedM they are reserved for use by well)known services such as HTT0 and (T0 and other system services. These ports are called well-known ports. Dour applications should not attempt to bind to them.

#etwor:ing Classes in t)e 5 2 Through the classes in java.net, +ava programs can use T&0 or =,0 to communicate over the 1nternet. The URL, URLConnection, Socket, and
ServerSocket classes all use T&0 to communicate over the network. The DatagramPacket, DatagramSocket, and MulticastSocket classes are for use

with =,0. 9)at Is a $R.; 1f youNve been surfing the Web, you have undoubtedly heard the term =7> and have used =7>s to access HT3> pages from the Web. 1tNs often easiest, although not entirely accurate, to think of a =7> as the name of a file on the World Wide Web because most =7>s refer to a file on some machine on the network. However, remember that =7>s also can point to other resources on the network, such as database queries and command output. efinition: =7> is an acronym for Uniform Resource Locator and is a

reference %an address' to a resource on the 1nternet. The following is an e!ample of a =7> which addresses the +ava Web site hosted by un 3icrosystems*

8s in the previous diagram, a =7> has two main components* 0rotocol identifier 7esource name

"ote that the protocol identifier and the resource name are separated by a colon and two forward slashes. The protocol identifier indicates the name of the protocol to be used to fetch the resource. The e!ample uses the Hyperte!t Transfer 0rotocol %HTT0', which is typically used to serve up hyperte!t documents. HTT0 is just one of many different protocols used to access different types of resources on the net. <ther protocols include (ile Transfer 0rotocol %(T0', 9opher, (ile, and "ews. The resource name is the complete address to the resource. The format of the resource name depends entirely on the protocol used, but for many protocols, including HTT0, the resource name contains one or more of the components listed in the following table* Host #ame &ilename ,ort #umber The name of the machine on which the resource lives. The pathname to the file on the machine. The port number to which to connect %typically optional'. 8 reference to a named anchor within a resource that Reference usually identifies a specific location within a file %typically optional'. (or many protocols, the host name and the filename are required, while the port number and reference are optional. (or e!ample, the resource name for an HTT0 =7> must specify a server on the network %Host "ame' and the path to the document on that machine %(ilename'M it also can specify a port number and a reference. 1n the =7> for the +ava Web site java.sun.com is the host name and the trailing slash is shorthand for the file named /index.html.

Sequence of soc:et calls for connection<oriented protocol: System Calls ocket ) create a descriptor for use in network communication. <n success, socket system call returns a small integer value similar to a file descriptor "ame. 6ind < 6ind a local I, address and protocol port to a soc:et When a socket is created it does not have nay notion of endpoint address. 8n application calls bind to specify the localM endpoint address in a socket. (or T&0/10 protocols, the endpoint address uses the socket address in structure. ervers use bind to specify the well)known port at which they will await connections. Connect < connect to remote client 8fter creating a socket, a client calls connect to establish an actual connection to a remote server. 8n argument to connect allows the client to specify the remote endpoint, which include the remote machines 10 address and protocols port number. <nce a connection has been made, a client can transfer data across it. Accept 78 < accept t)e ne+t incoming connection 8ccept creates a new socket for each new connection request and returns the descriptor of the new socket to its caller. The server uses the new socket only for the new connections it uses the original socket to accept additional connection requests once it has accepted connection, the server can transfer data on the new socket. Return %alue: This system)call returns up to three values 8n integer return code that is either an error indication or a new socket description The address of the client process The si4e of this address

>isten ) place the socket in passive mode and set the number of incoming T&0 connections the system will en)queue. 6acklog ) specifies how many connections requests can be queued by the system while it wants for the server to e!ecute the accept system call it us usually e!ecuted after both the socket and bind system calls, and immediately before the accept system call. send, sendto, recv and recvfrom system calls These system calls are similar to the standard read and write system calls, but additional arguments are requested. close ) terminate communication and de)allocate a descriptor. The normal ="1E close system call is also used to close a socket.

CTh a p t e r esting & 7D e b u g g i n g

Strategies

Overview
Soft"are testing identifies errors at an early stage and hence prevents a #rea'do"n at a later stage$ "here it might #e costlier! It is not unusual for a soft"are development organi,ation to e(pend 2=> of the total project effort on testing! In the e(treme$ the testing of mission6critical soft"are -e!g!$ flight control$ nuclear reactor monitoring. can cost three to five times as much as all other soft"are engineering activities com#ined! * planned testing identifies the difference #et"een the e(pected results and the actual results! Since the main o#jective of soft"are testing is to find errors$ the person "ho does it must "or' to prove that the soft"are fails! * successful testing is one that uncovers$ as many as yet undiscovered errors$ "hich helps to ma'e the soft"are more rugged and relia#le! ?o"ever it should #e clear$ that testing cannot sho" the a#sence of defects$ it can only highlight that the defects are present in soft"are!

.evels of /esting
Testing is applied at different levels in the soft"are development life6cycle$ #ut the testing done is different in nature and has different o#jectives at each level! The focus of all testing is to find errors$ #ut different type of errors are loo'ed for at each level! The levels of testing in a development project could #e@ Unit Testing @ To test individual soft"are items Integration Testing @ To test the interfaces #et"een the soft"are items System Testing @ To validate the entire product *cceptance Testing @ To test the product for acceptance Further levels of testing than stated a#ove could include *lpha Testing @ Testing #y users at the developers site or on a test environment Beta Testing @ Testing #y a large num#er of users at the user site Field Testing @ To test the system on the target environment *ll levels of testing should #e planned in advance and conducted systematically! The activities that are to #e carried out include@ Test planning Test case preparation

Test e(ecution

#nit testing +,)ite -o. Testing/


*t the lo"est level$ the function of the #asic unit of soft"are is tested in isolation! This is "here the most detailed investigation of the internal "or'ings of individual units are carried out! Unit testing is often performed #y the programmer "ho "rote the code! The purpose of unit testing is to find errors in the individual units$ "hich could #e data or logic related errors! The test can #e derived from the program specification or design document! Units "hich cannot #e tested in isolation may re+uire the creation of small test programs 'no"n as test harness! *ctivities to #e follo"ed for Unit Testing %nsure that all paths are traversed and #ranching ta'es properly! %nsure that instructions related to a testcase are e(ecuted properly! Aerify operation at normal value range! Aerify operation outside range values! Aerify program e(ecution at #oundary conditions! &hec' the calls to all programs! %nsure all data structures are handled properly! &hec' file handling! %nsure that all loops are terminated normally! Identify and remove a#normal termination of all loops! %nsure all errors are trapped! &hec' the values returned from called programs - stu#s may #e used if called program is not yet ready.

Integration testing +Interfa&es Testing/


Bhen t"o or more tested units are com#ined the tests should loo' for errors in t"o "aysC in the interfaces #et"een the units and in the functions "hich can #e performed #y the integrated unit "hich could not #e assessed during unit testing!

The tests are derived from the design document!

System testing +0un&tionality Testing/


*fter integration testing is completed the entire system is tested as "hole! System testing loo's for errors in the end6to6end functionality of the system and also for errors in non6functional +uality attri#utes such as performance$ relia#ility$ volume$ usa#ility$ maintaina#ility security etc! System testing can #e carried out #y independent personnel! The tests are derived from the Functional Specification

1egression testing
9egression testing is a testing process that is applied after the programs are modified! 9egression testing is a major component in maintenance and conversion projects! 8odifying a program involves creating ne" logic to correct an error or implement a change$ and incorporating that logic into an e(isting program! The ne" logic may involve minor modification such as adding$ deleting or re"riting a fe" lines of code or may involve major modifications such as adding$ deleting or replacing one or more modules or su#6systems! 9egression testing aims to chec' the correctness of the ne" logic$ to ensure the continuous "or'ing of the unmodified portions of a program and to validate that the "hole functions correctly!

%&&eptan&e testing +-la&( -o. Testing/


*fter system testing or regression testing is completed$ the system is handed over to the customer or user$ and acceptance testing mar's the transition from o"nership #y the developers to the o"nership #y the users! The acceptance test is different in nature in three "ays@ It is the responsi#ility of the accepting organi,ation rather than the developing organi,ation

The purpose of acceptance testing is to give confidence that the system is "or'ing rather than trying to find errors! The acceptance testing is a demonstration rather than a test!

*cceptance testing also includes testing of the user organi,ation "or'ing practices$ to ensure the computer system "ill fit the operational procedures! The acceptance test gives a confidence to the users that the system is ready for operational use!

0eneral tips

For every testing activity planning should #e done! Test plan should #e prepared$ revie"ed and approved #efore testing commences! Test plan should #e documented and testing should #e done as per the approved plan! Test cases should #e prepared$ revie"ed and approved prior to testing and must #e as per the test plan! * good test should have a reasona#le pro#a#ility of catching an error! It should not #e redundant and should ma'e the program failure o#vious "ithout #eing too simple or too comple(! Tests must #e documented for their description$ e(pected results and actual results! If a #ug is discovered$ its nature$ severity and fi( done should also #e documented Testing never ends$ it just gets transferred from the developer to the customer! %very time the customer uses the program a test gets conducted! The testing process during development should therefore terminate "hen the num#er of errors found in the unit time reduces to a very lo" e(tent! For system or regression testing it is prefera#le to install the system afresh! For multi6user systems aspects such as security measures$ integrity and recovery measures must #e thoroughly tested!
Test 0lan should indicate the test coverage % statement, path, branch and usage profile'

Chapter 8

Output Screens

Home Page

P)ysi&al Layer

P)ysi&al Layer Simulation

Data Lin( Layer

Data Lin( Layer Simulation

Net'or( Layer

Net'or( Layer Simulation

Transport Layer

Transport Layer Simulation

%ppli&ation Layer

%ppli&ation Layer Simulation

Chapter 9

Conclusion & Recommendation s

Conclusion:

The entire project has been developed and implemented as per the requirements stated by the user, it is found to be bug free as per the testing standards that is implemented. 8ny specification)untraced errors will be concentrated in the coming versions, which are planned to be developed in near future. The system at present does not take care of lower level check constraints in accessing the file types in distributed environments, which is to be considered in the future up gradations. 8s per the present status the project developed is well equipped to handle the &entral file system of an organi4ation in a server and provide access to the users with various privileges as prescribed by the higher authorities in the password file.

6I6.IO0RA,H1
"o. T1T>; .. #. :. /. I. P. 2. 8=TH<7 0=6>1&8T1<" T8T8 3c9raw H1>> .HH5 0ublication ,06 T8T8 3c 9raw H1>> W1>;D ,reamtech <7;1>>D 0=6>1&8T1<" 7<9;7 07; 38" T8T8 3c 9raw H1>> .HH5 #$$/ #$$# #$$/ #$$/ ;,1T1<" .HH/

TH; &<30>;T; 08T71&- "8=9HT<" 7;(;7;"&; +8?8# H;76;7T &H1>,T +8?8 +8W<7 1&&;7T1(1&8T1<" &<30>;T; +8?8 # ;7"; T &7D0T<9780HD ,;3D T1(1;, 38 T;71"9 +8?8 ;&=71TD +8?8 ";TW<707<978331"9 <(TW87; ;"91";;71"9 T;&H.3;,18 7<6;7T H;>>;7 0=6>1&8T1<" +<H" ;. H;7 H;D 71&H H;>T<" +<H;""1; H;>T<"

You might also like