A new Model of a Wireless AD-HOC Network with Sub-Layer Mac Using Simevents Tools

Wireless ad-hoc networks with different topologies proved to be a feasible solution for low-cost deployment of computer networks. It provides quick and easy networking in circumstances that require temporary network services or when cabling is difficult to be installed. In this paper, an analytical model of a wireless ad-hoc network is presented, in addition, a new model for wireless ad-hoc network with a sub-layer MAC is designed using Simevents tools. It is also taken into account the effect of the contention process and losses on the sub-layer MAC, then OPNET software is used to validate this model. Finally, the results of a practical single-hop wireless ad-hoc network using six computers are compared with the results of the proposed models. It is obvious that there is an excellent agreement between the throughput performances of the different models


I. Introduction
IEEE 802.11 defines two MAC sublayers: the Distributed coordination function (DCF) and Point coordination function (PCF). The DCF uses the protocol Carrier Sense Multiple Access with Collision Avoidance for the wireless channel access (CSMA/CA) [1]. Fig. 1 shows the timing diagram of the CSMA/CA protocol [2][3][4]. The standard defines two kinds of services; the Basic Service Set (BSS) and the Extended Service Set (ESS). It also defines two modes of operation for the BSS; infrastructure and ah-hoc modes [5].
Ad-hoc networks are a collection of wireless mobile nodes, which can communicate together without the need of access point or any type of controllers. The control of the network is distributed among the nodes. Under ad-hoc mode, the service set is called an independent basic service set (IBSS) [5].
In the literature, there have been many analytical models [6][7][8][9] developed to evaluate the performance of a single-hop wireless ad-hoc network (e.g., capacity, throughput and average packet delay). Markovian formalism is proposed, the Stochastic Automata Networks (SAN) formalism [10]. Networked modelling based on Simevents is proposed [11]. However, none of these models takes into account the effect of the sub-layer MAC on the proposed models [12].
This paper includes a mathematical analysis of the IEEE 802.11 throughput of a singlehop ad-hoc network. A single-hop ad-hoc network is designed and simulated using Simevents tools. Finally, a practical implementation of the single-hop wireless ad-hoc network is presented and compared with the mathematical and simulation models.

II. IEEE 802.11 Throughput Analysis of a Single-hop Ad-hoc Network
Referring to Fig. 1, a station transmits a packet in a generic (i.e., randomly chosen) slot time with a stationary probability (τ) which is given by [6]: Where: W is a contention window, p is a conditional collision probability and k represents any back off stage.
It is worth mentioning that the probability (τ) does not depend on the access mechanism (i.e., Basic or RTS/CTS) being applied. It is actually depends on the conditional collision probability p. To find the value of p, it is important to note that p (of a transmitted packet which encounters a collision) is the probability that, in a slot time, at least one of the N-1 remaining nodes transmit. If the system is in a steady state situation then each remaining station transmits a packet with probability τ. This yield Equations (1) and (2) represent a nonlinear system with two unknown's variables τ and p, they can be solved using numerical techniques.
Assume that, Ts denotes the time of the channel which is occupied by a successful transmission.
Where: DIFS is a DCF interframe space, H is a packet header, R is a data rate, P is a packet length, α is the maximum propagation delay in the network, SIFS is a short interframe space and ACK is an acknowledgment packet.
If σ denotes a slot time and T is the data transmission time, then T is given by: The throughput of both Basic and RTS/CTS access methods must be expressed as a function of the computed value (τ). Ref. [13] then give the throughput expression for a singlehop network of N nodes: ------------(5) Mbps data rate is adopted [14]. 3. A free-space channel with no external noise is considered. 4. Each node has a 20 packets MAC layer buffer capacity. 5. The application operates with the condition that there is always ready packets for transmission. The scheduling of packet transmission is FIFO. 6. Packet size is assumed to be fixed at 1460B (as specified in IEEE 802.11b MAC standard). 7. The maximum number of retransmissions at MAC layer is set to 16 for all packets. 8. All nodes are stationary (no mobility). 9. ACK size is assumed to be 14B (as specified in IEEE 802.11b MAC standard). 10. All nodes apply half-duplex mode of operation. 11. The time of simulation is equal to 300 sec.

5:
As shown in Fig. 2, the model consists of seven main blocks (six computers and one channel), the first three computers represent the three sources (senders) and the second three represents the three destination (receivers).The details of these blocks are as follows: A. Source unit: This unit consists of several blocks and three subsystems as shown in Fig. 3 and as follows: 1. Packet generator: It is designed to generate packets such that the intergeneration time between any two successive packets is random with an exponential probability distribution function.

Enable gate:
It represents a gate that opens whenever the control signal at the en input port is positive, and closes whenever the signal is zero or negative. It is worth to mention that the Initial Value block provides an initial value of 1 that opens the gate to permit the first packet to pass when the simulation starts, the remaining packets pass through this gate when the en input port is positive. In this model, the en is positive when receiving a packet or ACK.

Subsystem 1 unit:
It is used to buffer the newly generated packets and to introduce delay to the failed packets. It consists of several blocks and subsystem A as shown in Fig. 4.

Replicate block:
It delivers a copy of the arriving entity through each entity output port that is not blocked. According to the number of entity output ports parameter, the number of copies is specified. 5. Subsystem 2: It represents the back off algorithm for CSMA/CA which is similar to the backoff algorithm of CSMA/CD 6. Start Timer: This block associates a named timer to each arriving entity independently and starts the timer. It is used with Read Timer block to calculate the end-to-end delay of each packet.  -T -

From_ch1
[ok1] From_a2 [ok1]     8. Throughput calculation block: It is used to calculate the throughput. In any LAN, the throughput depends on the number of successful packets through a given time. In WLAN, the throughput does not depend on the number of successful packets through a given time only but also depends on the arriving ACK to the source of the packet. Therefore, the number of ACK packets represents the successful packets. In this paper, the throughput is calculated as follows: ------------ (6) B. The Channel unit: The modelling of wireless channel is proposed as shown in Fig. 6. The channel is divided to two parts: 1. The packet path: The arrival packet enters to the channel from port (In1) then the source address is checked to drop the unwanted packet in the entity sink, while the wanted packet is delayed by (DIFS) to represent the basic mechanism of IEEE 802.11. After that, the packet takes random number that represents the random number of slots then this packet will enter the contention process.
The contention process carries the address number of the winner node (enable signal), and the number of collisions of the packet using the get attribute block which will extract the attributes (source en and collision). Finally, the packet is delayed according to the chosen number of slots and the equation (7) [4], then the packet exits from out port 1: Delay = Packetization delay + propagation delay (7) Where :  Packetiazation delay = (Packet length / Data Rate)  propagation delay = (Distance between two nodes/ speed of signal in air)

The ACK path:
The arrival ACK packet enters the channel from port (Tx_ack) then it will be delayed by the server according to eq. (7) taking into account that the ACK packet length is equal to (14B). In single-hop, the ACK packet does not suffer from collision while this is not the case in multi-hop ad-hoc where the hidden terminal problem may cause collision between data and ACK packets.
C. The Destination unit: Fig. 7 shows the details of this unit which consists of the following main blocks: 1. FIFO Queue 1: This block is used to store the arrival packets, which comes from a channel. The packet remains in the queue until the signal enable is activated which will open the gate (Enable Gate 1), then a server will delay the packet by SIFS.

Replicate:
This block outputs a copy of the arriving entity through each entity output port that is not blocked. The number of copies is specified by the number of entity output ports parameter. Three copies can be specified as follows: a) OUT ' 1: It represents the original arrival packet, which enters from the Output Switch block. The packet has the following two probabilities (based on the destination address within the packet):  If the destination address is similar to the desired destination address, the packet enters Read Timer block, Delay of the packet from source to destination is measured.
 If the destination address is different from the desired destination address then the packet will enter (Enable Gate 2) block and terminated by the sink block. b) OUT ' 2: It initiates the ACK packet generation using the (Set Attribute) block then the already received source and destination addresses will be exchanged, after that a timer is added to the ACK packet then directed to the buffer. Subsystem 3 is used to check the destination address of the ACK packet before transmitting it. c) OUT ' 3: It will deliver the packet to (Calculation the # collision) block.    Fig. 8 shows the details of this subsystem, it is used only to calculate the number of collisions using the counter block. After that, the packet is terminated by the sink block.

Subsystem 1 and 2:
The first one is used to check the source address while the other one is devoted to check the destination address.

IV. Simulation of a Single-hop Ad-hoc Network Using OPNET
From the simulation point of view, the OPNET instruction wlan_workstation_advanced (wlan_wkstn_adv) is used to validate the performance of a single-hop wireless ad-hoc network as shown in Fig. 9a, which is based on the available Simevent tools in Matlab software and proposed in previous section. Fig. 9b shows the setting attributes in this node to make it as a source of traffic.

A. The Configuration of the network:
A single-hop wireless ad-hoc network is implemented with three laptops (Dell-1, Dell-2 and Dell-3) and three desktops (A, B and Pc99) computers. they are wirelessly connected with each other practically to form a wireless LAN as shown in Fig. 10. The laptops use windows seven while the desktops use window XP with D-Link Air Pulls G520 (as adapter WLAN card). The six computers for a single-hop ad-hoc network is practically shown in Fig.  11 after the setting process is completed. CommView 6.1 program is used practically to allow the packet-generating tool to edit and send packets via the network card. Packet generator can be configured as follows [15]:  Fig. 8: The details of (Calculation the # collision) block. Click on Tools Packet Generator, or select a packet from the Packets tab, right-click on it, then select the packet size, data rate, the number of packets sent and the Send Packet commands, this is illustrated in Fig.12.
In this paper, Wire shark program, which is a network packet analyser, is used. It captures network packets and displays the details of the packet data [16]. Wire shark provides a wide range of network statistics which can be accessed via the statistics menu. Fig. 13 shows the IP addresses, the MAC addresses and the connections of the six users using CommView

B. The Results
It is based on the following assumptions: 1. Packet size is selected to be (1460 B) (as in simulation models). 2. The transmission data rate of each user is range (10-130) packet/sec. 3. All nodes are within the range of each other, and send packets as fast as IEEE 802.11b allows. Fig. 14 shows the details of some of the packets being received by user 2 which has IP equal to (1.1.1.2) while Fig. 15 shows the packets received by this user with variable rates using CommView.  The instantaneously throughput performance using Wireshark (IO) graphs of the six computers is shown in Fig. 16. It is clear that the average value of the instantaneous throughput is equal to 180 kbps   The results of the analytical model are illustrated in Table 1, it shows the throughput of the basic access scheme which is strongly dependent on the number of nodes in the network.
The results of the different models, which are considered in this study, are compared with each other. Fig. 18 shows the total achievable network throughput as a function of the number of competing nodes.
It is obvious from the Figure that there is an excellent agreement between the throughput performances of the four models. Fig.18 declares that the average throughput increases as the data rate increases up to the data rate which is equal to (125 packet/sec). After that, the throughput remains at this value, the reason of that is related to the contention and overhead packets which prevent the throughput to increase. Fig. 19 shows the channel utilization as a function of the transmission data rate.  The maximum channel utilization is obtained when the maximum throughput (125 packet/sec) is used. Fig. 20 shows the channel utilization of a single-hop ad-hoc network at a data rate=100 packet/sec using Simevents tools.

VI. The Conclusions
In this paper, a new model of a wireless ad-hoc network which takes into account the effect of the sub-layer MAC is designed using Simevents tools then OPNET software is used to validate this model. Finally, a practical single-hop wireless ad-hoc network is implemented using six computers.
It is found that increasing the number of nodes will cause throughput degradation; the reasons of that is related to the contention loss at the data link layer. For the same resason, the maximum channel utilization being obtained is 86%.
It is obvious that there is an excellent agreement between the throughput performance of the different models. This study is to be extended in future to include the throughput of multi-hop wireless ad-hoc networks.