Enhancing Downlink Performance in Wireless Networks

Embed Size (px)

Citation preview

1. INTRODUCTIONWireless access networks have been more and more widely used in recent years, since compared to the wired networks, wireless networks are easier to install and use. Due to the tremendous practical interests, much research effort has been devoted to wireless access networks and great improvements have been achieved in the physical layer by adopting newer and faster signal processing techniques, for example, the data rate in 802.11 wireless Local Area Network (LAN) has increased from 1 Mbps in the early version of 802.11b to 54 Mbps in 802.11a. We have noted that in addition to increasing the point to point capacity, new signal processing techniques have also made other novel transmission schemes possible, which can greatly improve the performance of wireless networks. In this project, we study a novel Multiple-Input, Multiple-Output (MIMO) technique called Multiple Packet Transmission (MPT), with which the sender can send more than one packet to distinct users simultaneously. Traditionally, in wireless networks, it is assumed that one device can send to only one other device at a time. However, this restriction is no longer true if the sender has more than one antenna. By processing the data according to the channel state, the sender can make the data for one user appear as zero at other users such that it can send distinct packets to distinct users simultaneously. For now, we want to point out the profound impact of MPT technique on wireless LANs. A wireless LAN is usually composed of an Access Point (AP), which is connected to the wired network, and several users, which communicate with the AP through wireless channels. In wireless LANs, the most common type of traffic is the downlink traffic, i.e., from the AP to the users when the users are browsing the Internet and downloading data. In todays wireless LAN, the AP can send one packet to one user at a time. However, if the AP has two antennas and if MPT is used, the AP can send two packets to two users whenever possible, thus doubling the throughout of the downlink in the ideal case. MPT is feasible for the downlink because it is not difficult to equip the AP with two antennas,

Al Habeeb College of Engineering and Technology

1

in fact, many wireless routers today have two antennas. Another advantage of MPT that makes it very commercially appealing is that although MPT needs new hardware at the sender, it does not need any new hardware at the receiver. This means that to use MPT in a wireless LAN, we can simply replace the AP and upgrade software protocols in the user devices without having to change their wireless cards and, thus, incurring minimum cost.

1.1 Purpose:This project proposes simultaneous Multiple Packet Transmission (MPT) to improve the downlink performance of networks. Using this multiple packet transmissions, two compatible packets can send simultaneously by sender to two different systems. This will lead to a good performance of a network. The throughput of packet transmission can make to double. Project approves the problem of finding a schedule to send out buffered packets with in a time. Maximum matching algorithms are relatively complex and may not meet the timing requirements of real-time applications, and it is very difficult to implement. Project gives fast approximation algorithm that is capable of finding a matching at least 75% of the size of a maximum matching in a calculated time. These days everything in this world are fast and no one likes to wait. Therefore performance of multiple packet transmission downlinks should improve. There are some limits for arrival rate that can allow in a network. Our proposed one can enhance MPT, and the results show that the maximum arrival rate increases appreciably even with a very small compatibility probability.

Al Habeeb College of Engineering and Technology

2

1.2 Scope:Scope of the project To improve the downlink performance of wireless networks using simultaneous Multiple Packet Transmission (MPT) Future Enhancement 1. The Simultaneous Multiple Packet Transmission system can be also implanted in web application. 2. The number of file receiving systems can be increased.

Multiple-Input, Multiple-Output (MIMO) technique called Multiple Packet Transmission (MPT), with which the sender can send more than one packet to distinct users simultaneously. Traditionally, in wireless networks, it is assumed that one device can send to only one other device at a time. However, this restriction is no longer true if the sender has more than one antenna. By processing the data according to the channel state, the sender can make the data for one user appear as zero at other users such that it can send distinct packets to distinct users simultaneously. For now, we want to point out the profound impact of MPT technique on wireless LANs. A wireless LAN is usually composed of an Access Point (AP), which is connected to the wired network, and several users, which communicate with the AP through wireless channels.

Al Habeeb College of Engineering and Technology

3

2. SYSTEM ANALYSIS2.1 FEASIBILITY STUDYThe feasibility of the project is analyzed in this phase and business proposal is put forth with a very general plan for the project and some cost estimates. During system analysis the feasibility study of the proposed system is to be carried out. This is to ensure that the proposed system is not a burden to the company. For feasibility analysis, some understanding of the major requirements for the system is essential. Three key considerations involved in the feasibility analysis are ECONOMICAL FEASIBILITY TECHNICAL FEASIBILITY SOCIAL FEASIBILITY

Economical FeasibilityThis study is carried out to check the economic impact that the system will have on the organization. The amount of fund that the company can pour into the research and development of the system is limited. The expenditures must be justified. Thus the developed system as well within the budget and this was achieved because most of the technologies used are freely available. Only the customized products had to be purchased.

Technical FeasibilityThis study is carried out to check the technical feasibility, that is, the technical requirements of the system. Any system developed must not have a high demand on the available technical resources. This will lead to high demands on the available technical resources. This will lead to high demands being placed on the client. The developed

Al Habeeb College of Engineering and Technology

4

system must have a modest requirement, as only minimal or null changes are required for implementing this system.

Social FeasibilityThe aspect of study is to check the level of acceptance of the system by the user. This includes the process of training the user to use the system efficiently. The user must not feel threatened by the system, instead must accept it as a necessity. The level of acceptance by the users solely depends on the methods that are employed to educate the user about the system and to make him familiar with it. His level of confidence must be raised so that he is also able to make some constructive criticism, which is welcomed, as he is the final user of the system.

2.2 Existing SystemThe existing system was based on the parallel computing but this will not reduce the downloading time. Downloading a file or broadcasting a file will take so much time. Each and every system will have different response time, and there fore it is difficult to predict the downlink time. Existing method uses sending data in store-forward multicasting format to one system to another system. This types also not an efficient one.

Disadvantages1) Takes lot of time for sending a single file. 2) Worthless in wireless connections. 3) Do not considering user convenience.

Al Habeeb College of Engineering and Technology

5

2.3Proposed systemProject proposes MPT- that is multiple transmission packets. This suggests sending packets to multiple systems simultaneously. Access point can send two packets to two users whenever possible, thus doubling the throughout of the downlink in the ideal case. Project considers the case when the data rates of the users are the same. When the data rates are the same, all data packets takes roughly the same amount of time to transmit, which will be referred to as a time slot. Not making any assumption about the compatibilities of users and treat them as arbitrary. Project gives analytical bounds for maximum allowable arrival rate, which measures the speedup of the downlink.

Advantages1) Reducing actual file transfer time, the download time for each user can be minimized. 2) Packet delay can be greatly reduced even with a very small compatibility probability. 3) The maximum arrival rate increases significantly

Al Habeeb College of Engineering and Technology

6

2.4 SYSTEM REQUIREMENTSHard ware Specification Processor RAM Hard Disk Software Specification Technologies Language Database Web/Application server Operating System : : : : : .NET C#.NET SQL Web logic Server and IBM Web Sphere Windows NT/2000/XP : : : Pentium4 Processer 512MB 80GB

Al Habeeb College of Engineering and Technology

7

3. PROJECT DESCRIPTIONIn this project we study problems related to MPT and provide our solutions. We formalize the problem of sending out buffered packets in minimum time as finding a maximum matching in a graph. Since maximum matching algorithms are relatively complex and may not meet the speed of real time applications, we consider using approximation algorithms and present an algorithm that finds a matching with size at least 3/4 of the size of the maximum matching in O(|E|) time where |E| is the number of edges in the graph. We then study the performance of wireless LAN enhanced with MPT and give analytical bounds for maximum allowable arrival rate. We also use an analytical model and simulations to study the average packet delay. Enhancing wireless LANs with MPT requires the Media Access Layer (MAC) to have more knowledge about the states of the physical layer and is therefore a form of crosslayer design. In recent years cross-layer design in wireless networks has attracted much attention because of the great benefits in breaking the layer boundary. For example, [5, 6] considered packet scheduling and transmission power control in cross-layer wireless networks. However, to the best of our knowledge, packet scheduling in wireless networks in the context of multiple packet transmission has not been studied before. [3, 4] have considered Multiple Packet Reception (MPR) which means the receiver can receive more than one packets from distinct users simultaneously. MPR is quite different from MPT since MPR is about receiving multiple packets at one node while MPT is about sending multiple packets from one node to multiple nodes.

Al Habeeb College of Engineering and Technology

8

3.1 Multiple Packet TransmissionIn this section we briefly explain the MPT technique. As mentioned earlier, to use MPT, the sender makes the data sent for one user appear as zero at other users. This is possible if the sender has more than one antennas. With multiple antennas, the sender can adjust the amplitude and phase of the transmitted signals on different antennas such that the signals will add up constructively or destructively as desired. The following is a more detailed explanation which follows Chapter 10 in [1]. Wireless channels can be modeled as complex baseband channels, which means that with one antenna at the sender, the receiver will receive y = hd, where d is the complex data sent by the sender and h is the complex channel coefficient. The receiver can recover the data by dividing y by h. Note that here we consider flat fading which means that there is no inter-symbol-interference, and do not consider noise so that the core idea of MPT can be more easily seen. If there are two antennas at the sender, the sender can send two different symbols denoted as x1 and x2 on antenna 1 and antenna 2, respectively. If there are two receivers, receiver 1 will receive y1 = h 11x1 + h 12x2 and receiver 2 will receive y2 = h 21x1 + h 22x2, where hij is the channel coefficient from antenna j to user i. For simplicity we will use hi to denote [hi1, hi2]T and use x to denote [x1, x2]T , and call them the channel coefficient vector and the transmitted vector, respectively. In vector forms, receiver i will receive yi = h i x. Now let d1 and d2 denote the data that should be sent to receiver 1 and receiver 2, respectively. We cannot simply send d1 via antenna 1 and d2 via antenna 2 because the data will be mixed up at the receivers. However, suppose there are vectors u1 = [u11, u12]T and u2 = [u21, u22]T such that h 1u2 = 0 and h 2u1 = 0. We can let transmitted vector be x = d1u1 + d2u2, that is, send d1u11 + d2u21 on antenna 1 and d1u21 + d2u22 on antenna 2. Thus receiver 1 will receive h 1(d1u1 + d2u2) = d1h 1u1, and similarly receiver 2 will receive d2h 2u2, thus distinct data is sent to each receiver. u1 can be any vector lies in V1 which is the space orthogonal to h2, however, to maximize the received signal strength, u1 should lie in the same direction as the projection of h1 onto V1. u2 should be similarly chosen.

Al Habeeb College of Engineering and Technology

9

Since the total transmitted power is limited, not all pairs of receivers are compatible, i.e., can use MPT. Basically, the sender should choose two receivers if their channel coefficient vectors are already near orthogonal. To perform MPT, the sender needs 4 more complex multipliers. It also needs to know the channel coefficient vectors of the receivers and run algorithms to smartly pair up the receivers. However, the receivers needs no additional hardware and can receive the signal as if the sender is only sending to it. It is also possible to send to more than 2 receivers at the same time if the sender has more than 2 antennas. In this paper we focus on the more practical 2-antenna case. Also note that MPT requires wireless channels to be slow changing as compared to the data rate, which is often true in a wireless LAN where the wireless devices are stationary for most of the time.

MAC Layer ModificationsIn this section we describe the modifications to MAC layer protocol, in particular, 802.11, to support MPT. We say two users U1 and U2 are compatible if they can receive at the same time. If U1 and U2 are compatible, sometimes we also say that the packets destined for U1 and U2 are compatible. The AP keeps the channel coefficient vectors of all nodes that have been reported to it previously. If, based on the past channel coefficient vectors, U1 and U2 are compatible and there are two packets that should be sent to them, the AP sends out a RTS (Require To Send) packet, which contains, in addition to the traditional RTS contents, a bit field indicating that the packet about to send is a MPT packet. If U1 appears earlier than U2 in the destination field, upon receiving the RTS packet, U1 will first reply a CTS (Clear To Send) packet containing the traditional CTS contents plus its latest channel measurements. After a short fixed amount of time U2 will also reply a CTS packet. After received the two CTS packets, the AP will update the channel coefficient vectors. It will then decide whether U1 and U2 are still compatible and most likely they still are since the environment is slow changing. If in the rare case that the channels have changed significantly such that they are no longer compatible, the AP can choose to send to only one node. Therefore, before sending the data packets, the AP first sends 2 bits in which

Al Habeeb College of Engineering and Technology

10

bit i is 1 means the packet for Ui will be sent for 1 i 2. After the data packet is sent, U1 and U2 can reply an acknowledgment packet in turn. In this paper we consider matching user packets of the same size. For simplicity, we consider the case when the bit rates are also the same, such that all packets need the same transmission time which we call a time slot. We do not make any assumption about the compatibilities of users and treat them as arbitrary.

3.2 Scheduling Algorithms for Access PointsWhile the idea of MPT is simple, the AP will encounter the problem of how to match the packets with each other to send them out as fast as possible. For example, suppose in the buffer of the AP there are 4 packets destined for 4 users denoted as v1, v2, v3 and v4, respectively. Assume packet vi is compatible with vi+1 for 1 i 3, as shown at the top of Fig. 2 where there is an edge between two packets if they are compatible. If we match v2 with v3, the 4 packets have to be sent in 3 time slots since v1 and v4 are not compatible. However, a better choice is to match v2 with v1 and match v3 with v4 and send the 4 packets in only 2 time slots. When the number of packets grows the problem of finding the best matching strategy will become harder.

3.3 Algorithm for Optimal ScheduleWe call a schedule by which packets can be sent out in minimum time an optimal schedule. Clearly, in an optimal schedule maximum number of packets is sent out in pairs, therefore the problem of finding an optimal schedule is equivalent to finding maximum number of compatible pairs among the packets. To solve this problem, as shown in Fig. 2, we draw a graph G where each vertex represents a packet and two vertices are adjacent if the two packets are compatible. In a graph, a matching M is defined as a set of vertex disjoint edges, that is, no edge in M has a common vertex with another edge in M. Therefore the problem reduces to finding a maximum matching in G. For example, the second matching in Fig. 2 is a maximum matching while the first one is not. Maximum matching in a graph can be found in polynomial time by algorithms such as the Edmonds Blossom Algorithm which takes O(N4) time, where N is the number ofAl Habeeb College of Engineering and Technology

11

vertices in the graph [10, 2]. Before continuing our discussion, we first give definitions of some terms. Let M be a matching in a graph G. We call edges in M the matching edges. If a vertex is incident to an edge in M, we say it is saturated; otherwise, it is unsaturated or free or single. An M-augmenting path is defined as a path with edges alternating between edges in M and edges not in M, and with both ends being unsaturated vertices. For example, with regarding to the first matching in Fig. 2, v1 v2 v3 v4 is an augmenting path. It is well known in graph theory that the size of a matching can be incremented by one if and only if there can be found an augmenting path. The buffer of the AP may store many packets, as a result, the graph can be quite large. However, the size of the graph can be reduced by taking advantage of the fact that vertices represent packets for the same user has exactly the same set of neighbors in the graph. More specifically, in the graph, we say vertex u and v belong to the same equivalent Group, or simply the same group, if the packets they represent are for the same user. Vertices that belong to the same group have the same neighbors and are not adjacent to each other. Let A = {a1, a2, a3} and B = {b1, b2, b3} be two groups of vertices and suppose a i is matched to bi for 1 i 3. We have Lemma 1 If there is an augmenting path traversing all 3 matching edges between A and B, there must exist an augmenting path traversing only 1 matching edge between A and B. Proof. This can be best explained with the help of Fig. 3, where edges in the matching are shown as heavy lines and edges not in the matching are shown as dashed lines. As in the figure, suppose an augmenting path traversing all three matching edges between A and B is xa1 b1 cd b2 a2 e f a3 b3 y. However, if x is adjacentto

a1, it must also be adjacent to a3 since a1 and a3 belong to the same group, thus there is a shorter augmenting path traversing only to the last matching edge between A and B which is x a3 b3 y. (Note that the same proof also holds if in the augmenting path, the segment between, say, b1 and b2, is longer.) As a result of this lemma, if there exists an augmenting path, there must also exist an augmenting path traversing no more than two matching edges between any two groups of vertices. This is because if the path

Al Habeeb College of Engineering and Technology

12

traverses more than two matching edges between two groups of vertices, as we have shown in the lemma, there must be a shortcut by which we need only to traverse the last of the first three matching edges, and we can keep on finding such shortcuts and reducing the number of traversed matching edges until it is less than 3. Therefore, for any two groups of vertices, only two matching edges between them need to be kept and other redundant matching edges can be removed. After that there will be O(n2) saturated vertices left where n is the number of users. Also note that for the purpose of finding augmenting paths, only one of the unsaturated vertices belonging to each group needs to be considered. Therefore, the graph we work on contains O(n2) number of vertices which does not depend on the size of the buffer. Practical Considerations Although the optimal schedule can be found for a given set of packets by the maximum matching algorithm, in practice, the packets do not arrive all at once but arrive one by one. It is not feasible to run the maximum matching algorithm every time a new packet arrives due to the relatively high complexity of the algorithm. Therefore, after a new packet arrives, we can match it according to the following simple strategy: A new vertex is matched if and only if it can find an unsaturated neighbor. In this way we always maintain a maximal matching, where a matching M is maximal in G if no edge not belonging to M is vertex disjoint with all edges in M. For example, the two matching in Fig. 2 are all maximal matching. The maximum matching algorithm can be called only once a while to augment the existing maximal matching. Another problem is that the packets do not stay in the buffer forever and must be sent out. We will have to make the decisions of which packet(s) should be sent out oncethe AP

has gained access to the

media and there is a delicate tradeoff between throughput and delay. To improve the throughput, we should always send out packets in pairs; however, this policy favors the packets that can be matched over the packets that cannot be matched, and will increase the delay of the latter. To prevent excessive delay of the single packets, in practice, we can keep a time stamp for each packet and if the packet has stayed in the buffer for a time longer than a threshold, it will be sent out the next time the AP has gained access to the media. If there

Al Habeeb College of Engineering and Technology

13

are multiple such packets, the AP can choose one randomly. The threshold can be determined adaptively based on the measured delays of the packets that were sent out in pairs. Finally, although maximum matching can be found in polynomial time, maximum matching algorithms are in general complex [11] and may not meet the timing requirements of real time applications, considering that the processors in the AP are usually cheap and not powerful. Therefore in some cases, a fast approximation algorithm which is capable of finding a fairly good matching may be useful, which will be discussed next 3.4 Performance Study In this section we study the performance of the wireless LAN after enhanced by MPT. We first derive the maximum arrival rate of the downlink and then study the average packet delay by an analytical model and simulations. The performance of a wireless network depends on many factors, for example, the physical environment, the locations of the wireless nodes, etc., such that the performance of one network could be different from that of another even when they are using the same devices. In many cases the performance of the same network may also be changing due to the occasional movements of the wireless nodes. This makes the performance evaluation in general a difficult job. However, we note that the performance gain of adopting MPT is mainly determined by the probability of two nodes being compatible, and this probability should be the same in networks under similar environments and with same devices. It is thus more insightful to use the compatibility probability p as the parameter for performance evaluation. For simplicity, we assume that the probability that two users are compatible is independent of other users.

Maximum Arrival RateThe first and the most important question is: After using MPT, how much faster does the downlink become? This can be measured by the maximum allowable arrival rate, where an arrival rate is allowable if it does not cause the buffer of the AP to overflow. More specifically, suppose once the AP has got access to the media, on average it has to wait T seconds to be able to get access to the media again. In the following, forAl Habeeb College of Engineering and Technology

14

convenience, we refer to T as a time slot. The normalized arrival rate is defined as the average number of packets arrived in a time slot. Without MPT, clearly, max = 1 where max denotes the maximum allowable arrival rate. Next we derive the value of max when MPT is used. Suppose there are n users among which c users are compatible with some other users. These c users are called the non-isolated users and the rest are called the isolated users. Consider W arrived packets. Assuming packets have random destinations, there will be W(c/n) packets for. The non-isolated users and W(1 c/n) packets for the isolated users. The fastest way to send out these W packets is to always send out the packets for the non-isolated users in pairs, thus the minimum time needed to send out all the packets isW(1c/2n) time slots. In other word W packets should arrive in at least W(1 c/2n) time slots. Thus, the maximum arrival rate for given n and c is (1c/2n)1. The number of non-isolated users is a random variable. Let Pn(l) be the probability that out of n users, there are l isolated users. The average maximum arrival rate is max = _n c=0 Pn(n c)(1 c/2n)1 Therefore in the following we focus on finding Pn(l). Apparently, when n = 1, P1(0) = 0 and P1(1) = 1; when n = 2, P2(0) = p, P2(1) = 0 and P2(2) = 1 p where p is the compatibility probability. To find Pn(l) for larger n, we condition on the number of isolated users among the first n1 users. Let Ex,y be the event that in the x users, y are isolated and let L be random variable denoting the number of isolated users among n users. Pn(l) = P(L = l) =n_1 i=0 Pn1(i)P(L = l|En1,i) Clearly, for i < l 1, Pn(L = l|En1,i) = 0, since by adding a user, we can add at most one isolated user. For i = l 1, Pn(L = l|En1,l1) = (1 p)n1,

Al Habeeb College of Engineering and Technology

15

since given there are l 1 isolated users among the n 1 users, there are l isolated users in the n users if and only if the nth user is isolated, which occurs with probability (1 p)n1. For i = l, we have Pn(L = l|En1,l) = [1 (1 p)n1l](1 p)l, since if there are already l isolated users in the n 1 users, the nth user must not be isolated, i.e., must be compatible with some user in the first n1 users. However, it cannot be compatible with any of the isolated among the n 1 users, since this will reduce the number of isolated users, thus it must be compatible with at least one of the users among the n 1 l non-isolated users, which is an event that occurs with probability [1 (1 p)n1l](1 p)l. For i > l, Pn(L = l|En1,i) = _ i il _ pil(1 p)l, since if i > l, the addition of the nth user reduces the number of isolated users by i l, thus it must be compatible with exactly i l previous isolated users. Fig. 7 shows the maximum arrival rate for networks of different sizes under different compatibility probabilities. It is remarkable to see that a significant improvement can be achieved even with very small compatibility probability. For example, for n = 10, when p = 0.04, the maximum arrival rate is 1.2, which is a 20% increase. Finally, we want to argue that the maximum arrival rate is approximately achievable, although it is at the cost of excessive delay for the isolated users. Note that as mentioned earlier, the maximum arrival rate is achieved if packets destined for nonisolated users are always sent out in pairs and if no time slot is wasted, i.e., there is always at least one packet sent out in a time slot. Therefore, if there are compatible

Al Habeeb College of Engineering and Technology

16

packet pairs in the buffer, we send the pair; otherwise, we send packets destined for the isolated users and keep on doing so until a new pair has formed after some new packets have arrived. Since at a high arrival rate the queues for the isolated users are most likely quite long, it is highly likely that we can wait until a pair appears before the queues for the isolated users are exhausted.

3.5 Average Packet DelayAs we have seen, adopting MPT can greatly increase the maximum allowable arrival rate. Note that MPT can also reduce the queuing delay of the packets comparing to Single Packet Transmission (SPT). In this section we use an analytical model along with simulations to see how packet delay can be reduced. An Approximation Analytical Model We first describe our analytical model. The model is developed for the purpose of comparing MPT with SPT and therefore only considers arrival rates less than 1. We assume that the AP maintains n queues in its buffer, one for each user. Note that to exactly model the behavior of the queues in the AP, many MAC layer related issues have to be considered, for example, how often can the AP gain access to the media and how many packets will arrive at the AP in a given time period, etc. All such issues are interacting with each other which makes exact analytical modeling very difficult. We therefore use some approximations to simplify the model. As the simulations show, our model is very accurate when < 1. The model is based on Markov chains. We take the total number of packets stored in the buffer before the AP has gained access to the media, which we will later refer to as the AP sending for convenience, as the state of the Markov chain. The advantage of doing so is that the Markov chain becomes discrete-time since we are only looking at the buffer at some discrete time instants. We will assume that between two AP sendings, the number of packets arrived at the AP follows the widely used Poisson distribution, that is, Pa(K = k) = ek/k!, where K is the random variable denoting the number of arrived packets. It should be noted that our model is not limited to Poisson distribution and can also be used if the arrival follows other distributions. We

Al Habeeb College of Engineering and Technology

17

also assume that the arrived packets have random destinations. Note that we have avoided explicitly dealing with the complex issue of how often can the AP gain access to the media, because it has been encapsulated in the assumption of the arrival distribution. That is, if the AP has to wait longer to access the media, we can choose a large since more packets can be expected to arrive and otherwise we can choose a small since less packets can be expected to arrive. To more accurately model the queues, we also consider whether there exists a pair of compatible packets in the buffer. Therefore in our model, we use (b, r) as the state of the Markov chain, where b is the total number of packets, and r = 0 means that there is no compatible pair and r = 1 otherwise we assume that if there exists a compatible pair the AP will always send it, since when the arrival rate is small, most likely the packets will not be delayed longer than the threshold. Thus, the transition probability for (b, 0) is (b, 0) (b 1 + k, 0) : P1Pa(k) where P1 is the probability that given there is no compatible pair in the b 1 packets left in the buffer, there is no compatible pair after k new packets have arrived, and, clearly,(b, 0) (b 1 + k, 1) : (1 P1)Pa(k). Similarly, the transition probability for (b, 1) is(b, 1) (b 2 + k, 0) : P2Pa(k) where P2 is the probability that given there was a compatible pair, after sending out the pair and after receiving k new packets, there is no compatible pair. Also, (b, 1) (b 2 + k, 1) : (1 P2)Pa(k). Therefore in the following we need only to focus on finding P1 and P2. Note that since we have used only two random variables to model n queues, some information is lost, and the model is only an approximation model in the sense that the Markovian property only holds approximately.

Al Habeeb College of Engineering and Technology

18

4. MODULESThe project entitled as Enhancing Downlink Performance in Wireless Networks by Simultaneous Multiple Packet Transmission developed using .NET using C#. Modules display as follows.

1. Server module 2. Client Module 3. Sequence file transfer module 4. Simultaneous file transfer Module 5. Performance calculation module

4.1 MODULE DESCRIPTION Server ModuleIn this module, the available systems in the network are scanned. The systems are scanned along with the IP address and it is used for file transfer. The file is transferred from the local system to the client system based on the system selection.

Client ModuleIn this module the client system is activated to receive the file from the server system. The client system user has to select the file receiving path and start the server. The client is activated to receive the file from the server.

Al Habeeb College of Engineering and Technology

19

Sequence file Transfer moduleAfter the finding various systems in the network, the required two systems are to be selected. The corresponding client system should be activated before selection. After selection of two systems, the required file is to be selected for transferring. In this module the file is sequentially (i.e. one after another) transferred from server to clients. Total time taken for the file transfer is calculated.

Simultaneous file transfer moduleAfter the finding various systems in the network, the required two systems are to be selected. After selection of two systems, the required file is to be selected for transferring. In this module the file is transferred simultaneously to two distinct receivers. Total time taken for the file transfer is calculated.

Performance calculation moduleIn this module the time taken for sequence files Transfer (Single packet transmission) and simultaneous file transfer (Simultaneous Multiple Packet Transmission) is calculated. The Time difference between the two is evaluated for performance calculation.

Al Habeeb College of Engineering and Technology

20

4.2 MODULE I/O Server ModuleGiven Input - Work group name Expected Output - Available systems in the network

Client ModuleGiven Input Select the file receiving path Expected Output The users can get the respective source files from server.

Sequence file transfer ModuleGiven Input Two Distinct system Expected Output File is transferred to the appropriate systems.

Simultaneous file transfer ModuleGiven Input- Two Distinct system Expected Output File is transferred to the appropriate systems.

Performance calculation moduleGiven Input- Time taken by Sequence file transfer and Simultaneous file transfer Expected Output Performance Improvement.

Al Habeeb College of Engineering and Technology

21

5. LANGAUGE SPECIFICATION5.1 FEATURES OF .NETMicrosoft .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).

THE .NET FRAMEWORKThe .NET Framework has two main parts: 1. The Common Language Runtime (CLR). 2. A hierarchical set of class libraries. The CLR is described as the execution engine of .NET. It provides the environment within which programs run. The most important features are Conversion from a low-level assembler-style language, called Intermediate Language (IL), into code native to the platform being executed on. Memory management, notably including garbage collection. Checking and enforcing security restrictions on the running code. Loading and executing programs, with version control and other such features. The following features of the .NET framework are also worth description:

Al Habeeb College of Engineering and Technology

22

Managed CodeThe 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 DataWith 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. As with managed and unmanaged code, one can have both managed and unmanaged data in .NET applications - data that doesnt get garbage collected but instead is looked after by unmanaged code.

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

Common Language SpecificationThe 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.

Al Habeeb College of Engineering and Technology

23

The Class Library:.NET provides a single-rooted hierarchy of classes, containing over 7000 types. The root of the namespace is called System; this contains basic types like Byte, Double, Boolean, and String, as well as Object. All objects derive from System. Object. As well as objects, there are value types. Value types can be allocated on the stack, which can provide useful flexibility. There are also efficient means of converting value types to object types if and when necessary.The set of classes is pretty comprehensive, providing collections, file, screen, and network I/O, threading, and so on, as well as XML and database connectivity.The class library is subdivided into a number of sets (or namespaces), each providing distinct areas of functionality, with dependencies between the namespaces kept to a minimum.

5.2 LANGUAGES SUPPORTED BY .NETThe multi-language capability of the .NET Framework and Visual Studio .NET enables developers to use their existing programming skills to build all types of applications and XML Web services. The .NET framework supports new versions of Microsofts old favorites Visual Basic and C++ (as VB.NET and Managed C++), but there are also a number of new additions to the family. Visual Basic .NET has been updated to include many new and improved language features that make it a powerful object-oriented programming language. These features include inheritance, interfaces, and overloading, among others. Visual Basic also now supports structured exception handling, custom attributes and also supports multithreading. Visual Basic .NET is also CLS compliant, which means that any CLScompliant language can use the classes, objects, and components you create in Visual Basic .NET. Managed Extensions for C++ and attributed programming are just some of the enhancements made to the C++ language. Managed Extensions simplify the task of migrating existing C++ applications to the new .NET Framework. C# is Microsofts new language. Its a C-style language that is essentially C++ for Rapid Application Development. Unlike other languages, its specification is just the grammar of the

Al Habeeb College of Engineering and Technology

24

language. It has no standard library of its own, and instead has been designed with the intention of using the .NET libraries as its own. Microsoft Visual J# .NET provides the easiest transition for Java-language developers into the world of XML Web Services and dramatically improves the interoperability of Java-language programs with existing software written in a variety of other programming languages. Active State has created Visual Perl and Visual Python, which enable .NET-aware applications to be built in either Perl or Python. Both products can be integrated into the Visual Studio .NET environment. Visual Perl includes support for Active States Perl Dev Kit. Other languages for which .NET compilers are available include FORTRAN COBOL Eiffel

Fig1 .Net Framework ASP.NET Windows Forms

XML WEB SERVICES Base Class Libraries Common Language Runtime Operating System

Al Habeeb College of Engineering and Technology

25

5.3 FEATURES OF C#. NETC#.NET is also compliant with CLS (Common Language Specification) and supports structured exception handling. CLS is set of rules and constructs that are supported by the CLR (Common Language Runtime). CLR is the runtime environment provided by the .NET Framework; it manages the execution of the code and also makes the development process easier by providing services. C#.NET is a CLS-compliant language. Any objects, classes, or components that created in C#.NET can be used in any other CLS-compliant language. In addition, we can use objects, classes, and components created in other CLS-compliant languages in C#.NET .The use of CLS ensures complete interoperability among applications, regardless of the languages used to create the application.

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

Garbage Collection :Garbage Collection is another new feature in C#.NET. The .NET Framework monitors allocated resources, such as objects and variables. In addition, the .NET Framework automatically releases memory for reuse by destroying objects that are no longer in use. In C#.NET, the garbage collector checks for the objects that are not currently in use by applications. When the garbage collector comes across an object that is marked for garbage collection, it releases the memory occupied by the object.

Al Habeeb College of Engineering and Technology

26

Overloading :Overloading is another feature in C#. Overloading enables us to define multiple procedures with the same name, where each procedure has a different set of arguments. Besides using overloading for procedures, we can use it for constructors and properties in a class.

Multithreading :C#.NET also supports multithreading. An application that supports multithreading can handle multiple tasks simultaneously, we can use multithreading to decrease the time taken by an application to respond to user interaction.

Structured exception handling :C#.NET supports structured handling, which enables us to detect and remove errors at runtime. In C#.NET, we need to use TryCatchFinally statements to create exception handlers. Using TryCatchFinally statements, we can create robust and effective exception handlers to improve the performance of our application.

Al Habeeb College of Engineering and Technology

27

5.4 OBJECTIVES OF. NET FRAMEWORK1. To provide a consistent object-oriented programming environment whether object codes is stored and executed locally on Internet-distributed, or executed remotely. 2. To provide a code-execution environment to minimizes software deployment and guarantees safe execution of code. 3. Eliminates the performance problems. There are different types of application, such as Windows-based applications and Webbased applications. SECURITY The runtime enforces code access security. The security features of the runtime thus enable legitimate Internet-deployed software to be exceptionally feature rich. With regards to security, managed components are awarded varying degrees of trust, depending on a number of factors that include their origin to perform file-access operations, registry-access operations, or other sensitive functions. ROBUSTNESS: The runtime also enforces code robustness by implementing a strict type- and code-verification infrastructure called the common type system (CTS). The CTS ensures that all managed code is self-describing. The managed environment of the runtime eliminates many common software issues. PRODUCTIVITY: The runtime also accelerates developer productivity. For example, programmers can write applications in their development language of choice, yet take full advantage of the runtime, the class library, and components written in other languages by other developers.

Al Habeeb College of Engineering and Technology

28

PERFORMANCE: The runtime is designed to enhance performance. Although the common language runtime provides many standard runtime services, managed code is never interpreted. A feature called just-in-time (JIT) compiling enables all managed code to run in the native machine language of the system on which it is executing. Finally, the runtime can be hosted by high-performance, server-side applications, such as Microsoft SQL Server and Internet Information Services (IIS). DATA ACCESS WITH ADO.NET As you develop applications using ADO.NET, you will have different requirements for working with data. You might never need to directly edit an XML file containing data - but it is very useful to understand the data architecture in ADO.NET. ADO.NET offers several advantages over previous versions of ADO: Interoperability Maintainability Programmability Performance Scalability INTEROPERABILITY: ADO.NET applications can take advantage of the flexibility and broad acceptance of XML. Because XML is the format for transmitting datasets across the network, any component that can read the XML format can process data. The receiving component need not be an ADO.NET component. The transmitting component can simply transmit the dataset to its destination without regard to how the receiving component is implemented. The destination component might be a Visual Studio application or any other application implemented with any tool whatsoever. The only requirement is that the receiving component be able to read XML. SO, XML was designed with exactly this kind of interoperability in mind.

Al Habeeb College of Engineering and Technology

29

MAINTAINABILITY: In the life of a deployed system, modest changes are possible, but substantial, Architectural changes are rarely attempted because they are so difficult. As the performance load on a deployed application server grows, system resources can become scarce and response time or throughput can suffer. Faced with this problem, software architects can choose to divide the server's business-logic processing and user-interface processing onto separate tiers on separate machines. In effect, the application server tier is replaced with two tiers, alleviating the shortage of system resources. If the original application is implemented in ADO.NET using datasets, this transformation is made easier. ADO.NET data components in Visual Studio encapsulate data access functionality in various ways that help you program more quickly and with fewer mistakes.

PERFORMANCE:ADO.NET datasets offer performance advantages over ADO disconnected record sets. In ADO.NET data-type conversion is not necessary.

SCALABILITY:ADO.NET accommodates scalability by encouraging programmers to conserve limited resources. Any ADO.NET application employs disconnected access to data; it does not retain database locks or active database connections for long durations.

Al Habeeb College of Engineering and Technology

30

5.5 Features of SQL-SERVERThe OLAP Services feature available in SQL Server version 7.0 is now called SQL Server 2000 Analysis Services. The term OLAP Services has been replaced with the term Analysis Services. Analysis Services also includes a new data mining component. The Repository component available in SQL Server version 7.0 is now called Microsoft SQL Server 2000 Meta Data Services. References to the component now use the term Meta Data Services. The term repository is used only in reference to the repository engine within Meta Data Services SQL-SERVER database consist of six type of objects, They are Tables, Query, Forms, Report, Macro.

Al Habeeb College of Engineering and Technology

31

6. UML DIAGRAMS

Use case diagram

F in d a va ila b le s y s t e m

s e rve r

S e q u e n c e file t ra n s fe r

c li e n t

S im u lt a n e o u s file t ra n s fe r

P e rfo rm a n c e

Al Habeeb College of Engineering and Technology

32

Class diagram

serverserver client Access to User

Detect Access connect process()

sequence simultaneous

File transfer

Time difference

Performance Time taken for sequence Time taken for simultaneous

Difference Calculation

Object diagram

File transfer Network Details Node Creation

Node Connection

sequence simultaneous

Makes connection

Al Habeeb College of Engineering and Technology

33

State diagram

Network Nodes CreateNodes ()

Node Connection Connect_nod es Node Capacity

sequence Make connection Time taken

simultaneous Make connection Time taken

Activity diagram

c lie n t T im e d iffe re n c e c a lc u la t io n

s e rve r N e w S t a te

file tra n s fe r

Al Habeeb College of Engineering and Technology

34

Sequence diagramClient Start server Server Network systems Performance

Select file path

File transfer

File transfer

Time difference

Al Habeeb College of Engineering and Technology

35

Collaboration Diagram

login

1: Allocation

3: Nework Details

Server

Client

4: Access 2: Connections 5: calculation Network

performance

Component DiagramClient Start server

Network Network scan

Server Sequence

Simultaneous

Al Habeeb College of Engineering and Technology

36

E-R diagramClient Connection

login

Start server

Network

Server Sequen ce

HA S Time taken

Simultane ous

Performance

Dataflow diagramFile access path

Client

Sequence

Network Connection

Server Performance SimultaneousAl Habeeb College of Engineering and Technology

37

Project Flow Diagram

Client

Select file receiving path

Start server

Sequence file transfer

Performance

Time taken

Simultaneous file transfer

System Architecture

Start server

Client

Connecti on

Sever

File transfer

Performa nce

View

Al Habeeb College of Engineering and Technology

38

7. SCREENSHOTS

Al Habeeb College of Engineering and Technology

39

Al Habeeb College of Engineering and Technology

40

Al Habeeb College of Engineering and Technology

41

Al Habeeb College of Engineering and Technology

42

Al Habeeb College of Engineering and Technology

43

Al Habeeb College of Engineering and Technology

44

Al Habeeb College of Engineering and Technology

45

Al Habeeb College of Engineering and Technology

46

Al Habeeb College of Engineering and Technology

47

Al Habeeb College of Engineering and Technology

48

Al Habeeb College of Engineering and Technology

49

Al Habeeb College of Engineering and Technology

50

8. SYSTEM TESTING AND MAINTENANCETesting is vital to the success of the system. System testing makes a logical assumption that if all parts of the system are correct, the goal will be successfully achieved. In the testing process we test the actual system in an organization and gather errors from the new system operates in full efficiency as stated. System testing is the stage of implementation, which is aimed to ensuring that the system works accurately and efficiently. In the testing process we test the actual system in an organization and gather errors from the new system and take initiatives to correct the same. All the front-end and back-end connectivity are tested to be sure that the new system operates in full efficiency as stated. System testing is the stage of implementation, which is aimed at ensuring that the system works accurately and efficiently. The main objective of testing is to uncover errors from the system. For the uncovering process we have to give proper input data to the system. So we should have more conscious to give input data. It is important to give correct inputs to efficient testing. Testing is done for each module. After testing all the modules, the modules are integrated and testing of the final system is done with the test data, specially designed to show that the system will operate successfully in all its aspects conditions. Thus the system testing is a confirmation that all is correct and an opportunity to show the user that the system works. Inadequate testing or non-testing leads to errors that may appear few months later. This will create two problems 1. Time delay between the cause and appearance of the problem. The effect of the system errors on files and records within the system.

Al Habeeb College of Engineering and Technology

51

2. The purpose of the system testing is to consider all the likely variations to which it will be suggested and push the system to its limits. The testing process focuses on logical intervals of the software ensuring that all the statements have been tested and on the function intervals (i.e.,) conducting tests to uncover errors and ensure that defined inputs will produce actual results that agree with the required results. Testing has to be done using the two common steps Unit testing and Integration testing. In the project system testing is made as follows: The procedure level testing is made first. By giving improper inputs, the errors occurred are noted and eliminated. This is the final step in system life cycle. Here we implement the tested error-free system into real-life environment and make necessary changes, which runs in an online fashion. Here system maintenance is done every months or year based on company policies, and is checked for errors like runtime errors, long run errors and other maintenances like table verification and reports.

8.1 UNIT TESTINGUnit 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.

8.2 INTEGRATION TESTINGIntegration testing is a systematic technique for constructing tests to uncover error associated within the interface. In the project, all the modules are combined and then the entire programmer is tested as a whole. In the integration-testing step, all the error uncovered is corrected for the next testing steps.

Al Habeeb College of Engineering and Technology

52

9. SYSTEM IMPLEMENTATION

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.

Scope of the projectTo improve the downlink performance of wireless networks using simultaneous Multiple Packet Transmission (MPT)

Future Enhancement1 2 The Simultaneous Multiple Packet Transmission system can be also implanted in web application. The number of file receiving systems can be increased.

Al Habeeb College of Engineering and Technology

53

10.CODINGSHOME PAGEusing System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace SMPT { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { user3 obj = new user3(); obj.Show(); this.Hide();

Al Habeeb College of Engineering and Technology

54

} private void button2_Click(object sender, EventArgs e) { frmScanner obj = new frmScanner(); obj.Show(); this.Hide(); } } } using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Microsoft.Win32; using System.Net; using System.Net.Sockets; using System.IO; using System.Data.SqlClient; using System.Diagnostics; using System.Management; using System.Threading;

namespace SMPT {

Al Habeeb College of Engineering and Technology

55

public partial class user3 : Form { protected PerformanceCounter cpuCounter; protected PerformanceCounter ramCounter; public user3() { InitializeComponent(); } string hostname; private void button1_Click(object sender, EventArgs e) { hostname = Dns.GetHostName(); RegistryKey RegKey = Registry.LocalMachine; RegKey = RegKey.OpenSubKey("HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0"); Object cpuSpeed = RegKey.GetValue("~MHz"); Object cpuType = RegKey.GetValue("VendorIdentifier"); textBox1.Text = hostname; textBox2.Text = cpuSpeed.ToString(); textBox3.Text = cpuType.ToString(); textBox4.Text = getCurrentCpuUsage(); textBox5.Text = getAvailableRAM();

} private LinkLabelLinkClickedEventArgs e) { user3 u4 = new user3(); void linkLabel1_LinkClicked(object sender,

Al Habeeb College of Engineering and Technology

56

this.Hide(); u4.Show(); } private void button2_Click(object sender, EventArgs e) { } private void user3_Load(object sender, EventArgs e) { cpuCounter = new PerformanceCounter(); cpuCounter.CategoryName = "Processor"; cpuCounter.CounterName = "% Processor Time"; cpuCounter.InstanceName = "_Total"; ramCounter = new PerformanceCounter("Memory", "Available MBytes"); } public string getCurrentCpuUsage() { return cpuCounter.NextValue() + "%"; } public string getAvailableRAM() { return ramCounter.NextValue() + ""; } private void button3_Click(object sender, EventArgs e) {

Al Habeeb College of Engineering and Technology

57

Application.Exit(); } private void button4_Click(object sender, EventArgs e) { client c = new client(); this.Hide(); c.Show(); } } } using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Net; using System.Net.Sockets; using System.IO;

namespace SMPT { public partial class client : Form {

Al Habeeb College of Engineering and Technology

58

public client() { InitializeComponent(); FTServerCode.receivedPath = ""; } private void button1_Click(object sender, EventArgs e) { if (FTServerCode.receivedPath.Length > 0) backgroundWorker1.RunWorkerAsync(); else MessageBox.Show("Please select file receiving path"); } private void timer1_Tick(object sender, EventArgs e) { label5.Text = FTServerCode.receivedPath; label3.Text = FTServerCode.curMsg; } FTServerCode obj = new FTServerCode(); private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { obj.StartServer(); } private void button2_Click(object sender, EventArgs e) { FolderBrowserDialog fd = new FolderBrowserDialog(); if (fd.ShowDialog() == DialogResult.OK)

Al Habeeb College of Engineering and Technology

59

{ FTServerCode.receivedPath = fd.SelectedPath; } private void Form1_Load(object sender, EventArgs e) { } private void label5_Click(object sender, EventArgs e) { } private void label3_Click(object sender, EventArgs e) { } } //FILE TRANSFER USING C#.NET SOCKET - SERVER class FTServerCode { IPEndPoint ipEnd; Socket sock; public FTServerCode() { ipEnd = new IPEndPoint(IPAddress.Any, 5656); sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP); sock.Bind(ipEnd); } }

Al Habeeb College of Engineering and Technology

60

public static string receivedPath; public static string curMsg = "Stopped"; public void StartServer() { try { curMsg = "Starting..."; sock.Listen(100); curMsg = "Running and waiting to receive file."; Socket clientSock = sock.Accept(); byte[] clientData = new byte[1024 * 5000]; int receivedBytesLen = clientSock.Receive(clientData); curMsg = "Receiving data..."; int fileNameLen = BitConverter.ToInt32(clientData, 0); string fileName = Encoding.ASCII.GetString(clientData, 4, fileNameLen); BinaryWriter bWrite = new BinaryWriter(File.Open(receivedPath +"/"+ fileName, FileMode.Append)); ; bWrite.Write(clientData, 4 + fileNameLen, receivedBytesLen - 4 fileNameLen); curMsg = "Saving file..."; bWrite.Close(); clientSock.Close(); curMsg = "Received & Saved file; Server Stopped."; }

Al Habeeb College of Engineering and Technology

61

catch (Exception ex) { MessageBox.Show("Error " + ex); curMsg = "File Receving error."; } } } }

Server processusing System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Net; using System.DirectoryServices; using System.Runtime.InteropServices; namespace SMPT { public partial class frmScanner : Form { public static string system;

[DllImport("iphlpapi.dll", ExactSpelling = true)]

Al Habeeb College of Engineering and Technology

62

public static extern int SendARP(int DestIP, int SrcIP, [Out] byte[] pMacAddr, ref int PhyAddrLen);

public frmScanner() { InitializeComponent(); }

private void btnScan_Click(object sender, EventArgs e) { if (txtWorkGroupName.Text == "") return; DataTable dt = new DataTable(); dt.Columns.Add(new DataColumn("ComputerName", typeof(String))); dt.Columns.Add(new DataColumn("ComputerIP", typeof(String)));

try { DirectoryEntry DomainEntry = new DirectoryEntry("WinNT://" + txtWorkGroupName.Text + ""); DomainEntry.Children.SchemaFilter.Add("Computer");

Al Habeeb College of Engineering and Technology

63

foreach (DirectoryEntry machine in DomainEntry.Children) { string strMachineName = machine.Name; IPAddress IPAddress;

try { IPAddress = getIPByName(machine.Name); } catch(Exception ex) { continue; }

DataRow dr = dt.NewRow(); dr[0] = machine.Name ; dr[1] = IPAddress.ToString(); try { progressBar1.Value += 3; if (progressBar1.Value >= 1000) progressBar1.Dispose(); } catch (Exception ex) {

Al Habeeb College of Engineering and Technology

64

MessageBox.Show("Error!!!" + ex); } dt.Rows.Add(dr); } dgvComputers.DataSource = dt; } catch (Exception ex) { throw ex; } }

private IPAddress getIPByName(string strMachineName) { try { IPHostEntry hostInfo = Dns.GetHostEntry(strMachineName); return hostInfo.AddressList[0];

} catch (Exception ex) { throw ex;

Al Habeeb College of Engineering and Technology

65

}

}

private void frmScanner_Load(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { string s = dgvComputers.SelectedRows[0].Cells[0].Value.ToString(); listBox1.Items.Add(s); system = listBox1.Text; MessageBox.Show("Intimation send to " + s); } private void button3_Click(object sender, EventArgs e) { single obj = new single(); int c = listBox1.Items.Count; for(int i= 0;i