The configuration files (scenario, settings and other related files) of the examples discussed in this section are not in NetSim’s UI (under built in examples) due to the large number of configuration files present (700+). Users can download the files from NetSim’s UWAN git-repository.
https://github.com/NetSim-TETCOS/UWAN_Experiments_v13_2/archive/refs/heads/main.zip
-
Click on the link given and download UWAN Experiments
-
Extract the zip folder. The extracted project folder consists of a NetSim Experiments file (UWAN experiments and measurements.netsimexp). How to import the workspace is explained in section 4.9.2 in NetSim User Manual.
Throughput and delay variation with distance#
In this example, we understand how UWAN throughput and delay varies as the distance between 1 transmitter and 1 receiver is varied. Even with No pathloss the throughput in UWAN varies with Tx-Rx distance which is not the case in terrestrial RF based transmissions. The two parameters that affect throughput and delay are the speed of sound and the slot length of s-Aloha. The speed of sound in water is given by the formula
csound = 1449.05 + 45.7t − 5.21 × t2+ 0.23 × t3 + ( 1.333−0.126t+0.009×t2)(S−35) + 16.3 × z + 0.18 × z2
where t is one-tenth of the temperature of the water in degrees Celsius, z is the depth in km and S is the salinity of the water in ppt. Then using $t = \frac{25}{10} = 2.5,$ z = 50, and S = 35 - where t is one-tenth of the temperature of the water in degrees Celsius, z is the depth in meters and S is the salinity of the water - we get csound = 2799.33 m/s. When the transmitter receiver distance is d = 2km, the propagation delay, $\Delta = \frac{{2 \times 10}^{3}}{2799.33} = \ 714,456.4\ \mu s$
Next, as explained in section 0, we consider ideal slot lengths for different transmitter receiver distances. In the case when dRxTx = 2 km the slot length turns out as
LSlot= Ttx + Δ = 16, 800 + 714, 456.4 = 731, 256.4 μs = 0.73
Table 4‑4 shows the ideal slot length settings for dRxTx = 4 km and dRxTx = 6 km.
Network setup:
- Create a scenario with 2 Underwater Devices
Figure 4‑1: Network Scenario. Two underwater devices connected via an acoustic ad hoc link
-
In case #1, distance between the underwater devices is set to be 2km. In case #2 the distance is 4km, while in case #3 it is set to 6 km
-
Channel characteristics as NO_PATHLOSS
Device Configuration:
Device > Interface (ACOUSTIC) > Datalink Layer | |
---|---|
Slot Length(µs) | 16800 |
Device> Interface (ACOUSTIC) > Physical Layer | |
Source Level (dB//1μPa) | 200 |
Modulation | QPSK |
Data Rate (kbps) | 20 |
Table 4‑1: Device properties set for this example
Application Configuration:
We run simulations for different traffic generation rates. The generation rate depends on the inter-packet arrival time – a GUI input in NetSim – in the following way
$$Generation\ Rate\ (Mbps) = \frac{Packet\ Size\ (Bytes)\ \times \ 8}{Interarrival\ Time\ (µs)}$$
Application Properties | ||
---|---|---|
Application Method | App1_CBR | |
Source ID | 1 | |
Destination ID | 2 | |
Packet Size (Bytes) | 14 | |
Inter arrival Time (µs) | Generation rate (bps) | |
Case-1 | 4480000 | 25 |
2240000 | 50 | |
1120000 | 100 | |
896000 | 125 | |
746666.6666 | 150 | |
640000 | 175 | |
560000 | 200 | |
Case-2 | 5600000 | 20 |
2800000 | 40 | |
1866666.6666 | 60 | |
1400000 | 80 | |
1120000 | 100 | |
Case-3 | 5600000 | 20 |
3733333.333 | 30 | |
2800000 | 40 | |
2240000 | 50 | |
1866666.6666 | 60 | |
1600000 | 70 |
Table ‑: Application properties for the different samples in each case studied in this example
-
Click on Packet Trace option and select the Enable Packet Trace > check box.
-
Run the Simulation for 100 sec.
Theoretical Predictions
The predicted propagation delay when the speed of sound csound = 2799.33 m/s is
Distance between devices | Propagation delay (Δ in μs) |
---|---|
2km | 714456.4 |
4km | 1428912.7 |
6km | 2143369.1 |
Table ‑: Theoretically predicted propagation delay for different Tx-Rx distances
Transmission delay and Saturation Throughput
Considering a slot length of 731, 256.4 μs, we see that one packet exactly fits one slot and hence the predicted saturation throughput would be
$$\theta_{sat}^{2km} = \frac{{(L}_{pkt} \times 8)}{L_{slot}} = \frac{(14 \times 8)}{731256.4 \times 10^{- 6}} = 153\ bps$$
Proceeding similarly for 4 km and 6 km, the predictions for saturation throughput are
Distance between devices | Slot Length (Lslot) | Saturation Throughput (θsat in bps) |
---|---|---|
2 km | 731256.4 | 153 |
4 km | 1445712.7 | 77 |
6 km | 2160169.1 | 52 |
Table ‑: Ideal slot lengths and theoretically predicted saturation throughputs (θsat) for different Tx-Rx distances
Simulation results
We calculate of queuing delay, transmission delay, propagation delay from the packet trace. The steps are:
-
Open Packet Trace file using the Open Packet Trace option available in the Simulation Results window.
-
The difference between the PHY LAYER ARRIVAL TIME(US) and the MAC LAYER ARRIVAL TIME(US) will give us the delay of a packet. (Refer Figure 4‑2)
Queuing Delay (μs) = PHYSICAL LAYER ARRIVAL TIME(μs) − MAC LAYER ARRIVAL TIME (μs)
Figure 4‑2 : Screen shot of NetSim trace showing the Queuing Delay column
-
Now, calculate the mean queuing delay by taking the average of the queueing delays of all the packets. This is nothing but the column average. (Refer Figure 4‑2)
-
Similarly, users can get the Mean Transmission Delay and Mean Propagation Delay from the packet trace using the formulas
Transmission Delay (μs) = PHY LAYER START TIME(μs) − PHY LAYER ARRIVAL TIME(μs)
Propagation Delay (μs) = PHY LAYER END TIME(μs) − PHY LAYER START TIME(μs)
Generation Rate (bps) | Throughput (bps) | Delay (µs) | Mean Propagation Delay(µs) | Mean Transmission Delay(µs) | Mean Queuing Delay(µs) | |
---|---|---|---|---|---|---|
|
25 | 26 | 736612.9 | 714456.4 | 16800 | 5356.52 |
50 | 50 | 736856.4 | 714456.34 | 16800 | 5600 | |
100 | 100 | 736793.4 | 714456.4 | 16800 | 5537.08 | |
125 | 124 | 736856.4 | 714456.4 | 16800 | 5600 | |
150 | 149 | 738666.9 | 714456.4 | 16800 | 7410.53 | |
175 | 151 | 7377656.4 | 714456.4 | 16800 | 6646400 | |
200 | 151 | 12737656.4 | 714456.4 | 16800 | 12006400 | |
|
20 | 20 | 1451313 | 1428912.7 | 16800 | 5600 |
40 | 40 | 1451313 | 1428912.7 | 16800 | 5600 | |
60 | 59 | 1453285 | 1428912.7 | 16800 | 7572.33 | |
80 | 76 | 3509313 | 1428912.7 | 16800 | 2063600 | |
100 | 76 | 12889313 | 1428912.7 | 16800 | 11443600 | |
|
20 | 20 | 2165769 | 2143369.1 | 16800 | 5600 |
30 | 30 | 2167636 | 2143369.1 | 16800 | 7466.67 | |
40 | 39 | 2165609 | 2143369.1 | 16800 | 5440 | |
50 | 49 | 2165769 | 2143369.1 | 16800 | 5600 | |
60 | 52 | 8922169 | 2143369.1 | 16800 | 6762000 | |
70 | 52 | 14922169 | 2143369.1 | 16800 | 12762000 |
Table 4‑5: Tabulated results (throughput and delays) for 3 different Tx-Rx distances
Figure 4‑3: Throughput vs. Generation rate plotted for Tx-Rx distances of 2km, 4km and 6km based on earlier tables
From Table 4‑5, we see that the propagation delays from simulation match predictions in Table 4‑3. Then from we observe that saturation throughput (the Y axis value once the curve flattens) matches prediction.
Distance between devices | Saturation Throughput. Predicted (θsat in bps) | Saturation Throughput. Simulation (θsat in bps) |
---|---|---|
2 km | 153 | 151 |
4 km | 77 | 76 |
6 km | 52 | 52 |
Table 4‑6: NetSim UWAN Simulation results vs. theoretical prediction of saturation throughput, for different Tx-Rx distances
Underwater propagation losses and device range#
In this example, we understand the Thorp propagation model, the sources of under-water noise, the passive sonar equation and how device range can be estimated based on received SNR. Refer to section 3.1 for the underlying theory on signal level, transmission losses, and the passive sonar equation.
Network setup
- Create a scenario with two underwater devices
Figure 4‑4: Network Scenario
-
Channel characteristics as PATHLOSS_ONLY
-
Change the Following parameters, Right Click on Underwater_Device_1 àProperties
Device Properties > Physical Layer | |
---|---|
Source Level (dB//1μPa) | 190.8, 187.78,183.91 |
Data Rate (kbps) | 20 |
Modulation Technique | QPSK, BPSK, FSK, 16QAM, 64QAM, 256QAM |
Table 4‑7: Device Properties
-
Create a CBR Application with Default Properties with Source ID as 1 > and Destination ID as 2.
-
Run the Simulation for 1000 sec.
Analytical computations
In the Thorp model, the db/km attenuation is given by.
$$10\log_{10}{\alpha(f)} = \left\{ \begin{matrix} 0.11 \times \left( \frac{f^{2}}{1 + f^{2}} \right) + \ + 44 \times \left( \frac{f^{2}}{4100 + f^{2}} \right) + 2.75 \times 10^{- 4} \times f^{2} + 0.003\ \ \ \ f \geq 0.4\ kHz \\ 0.02 + 0.11 \times \left( \frac{f}{1 + f} \right) + 0.011 \times f\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ f \< 0.4\ kHz \\ \end{matrix}\ \ \right.\ $$
For this example, substituting f = 20, we get 10log10α(f) = 4.133 db/km, we see that the total pathloss is
10 log A(d, f)= k× 10 log (dm) + dkm × 10 log α(f)
Using input parameters K (spread coefficient) = 2, f = 20 kHz and distance between the source and destination, d = 18 km, and we get the total transmission loss, TL, as
TL= 10 log A(d, f) = 153.51 dB
Next, we turn to noise level NL. The turbulence, shipping, wind, and thermal, noise level in dB is given by
10 logNt(f)= 17 − 30log( f)
10 logNs(f)= 40 + 20 × (s − 0.5)+ 26 log f − 60 × log(f + 0.03)
$$10\ logN_{w}(f) = \ 50\ + \ 7.5 \times \sqrt{w}\ + \ 20\ log\ f - 40\ log(f\ + \ 0.4)$$
10 logNth(f) = − 15 + 20 log f
Substituting f = 20 kHz, shipping factor s = 0.5, surface windspeed w = 0 m/s, we get Nt = − 22.03 dB, Ns = − 4.27 dB, Nw = 23.63 dB, and Nth = 11.02 dB. As explained in section 3.1.4 we see that wind noise has the most impact. After adding these noises in the linear scale and then converting back to dB, Total noise, NTotaldB = 23.87. From the passive sonar equation
SNR = SL − TL − (NL−DI)
Substituting we get
SNR = 190.80 − 153.51 − (23.87−0) = 7.41 dB
Results: Packet Error Rate vs Distance
For the above SNR, we plot PER vs. distance for different modulation schemes given default packet size of 14B.
Generally, range is defined as the Tx-Rx distance at which the PER is 10 %. From these plots we can determine a device’s range. In summary, we see how the device range is dependent on Source Level, Noise, MCS and packet size.
s-Aloha performance with multiple transmit nodes#
Network setup
We consider three scenarios as shown in the figure below, with 2, 3 and 4 transmitting nodes.
Figure 4‑5: Simulation scenarios with 2 transmitting nodes in (A), 3 transmitting nodes in (B) and 4 transmitting nodes in (C). In all cases there is a single receiver.
Properties
Then we set the UWAN device properties as shown below
Device Properties | |
---|---|
Device > Interface (ACOUSTIC) > Datalink Layer | |
Retry Limit | 0,4,6 |
Slot Length(µs) | 731256.4 |
Device> Interface (ACOUSTIC) > Physical Layer | |
Source Level (dB//1μPa) | 190.8 |
Modulation | QPSK |
Data Rate (kbps) | 20 |
Table 4‑8: UWAN Device Properties
-
Here, we set the Slot Time as 741256.4 μs, which is the ideal value of 731256.4 μs plus a guard interval of 10,000 μs
-
Create a CBR Application from the source nodes (2, 3, 4 and 5 per the cases) to the destination (Node 1) with a packet size of 14 bytes and Inter arrival time as 560000μs.
-
Run the Simulation for 10000sec.
Results
We observe throughputs from network metrics and packets transmitted and packets collided from the Link Metrics. We collision probability as $P_{c} = \frac{Collision\ Count}{Packet\ Transmitted}$ and tabulate the results in the different cases.
Case #1: Two transmitting nodes | ||||||
---|---|---|---|---|---|---|
Retry Limit | Throughput N1 (bps) | Throughput N2 (bps) | Aggregate Throughput(bps) | Collision Count | Packet Transmitted | |
Pc | ||||||
0 | 0 | 0 | 0 | 26980 | 26980 | 1 |
4 | 55 | 51 | 106 | 7104 | 16624 | 0.427 |
6 | 71 | 65 | 136 | 2548 | 14647 | 0.173 |
Table 4‑9: Simulation Results with 2 transmitting nodes
Case #2: Three transmitting nodes | |||||||
---|---|---|---|---|---|---|---|
Retry Limit | Throughput N1 (bps) | Throughput N2 (bps) | Throughput N3 (bps) | Aggregate Throughput (bps) | Collision Count | Packet Transmitted | |
Pc | |||||||
0 | 0 | 0 | 0 | 0 | 40470 | 40470 | 1 |
4 | 26 | 26 | 27 | 79 | 12234 | 19348 | 0.632 |
6 | 43 | 41 | 37 | 121 | 4969 | 15726 | 0.316 |
Table 4‑10: Simulation Results with 3 transmitting nodes
Case #3: Four transmitting nodes | ||||||||
---|---|---|---|---|---|---|---|---|
Retry Limit | Throughput N1 (bps) | Throughput N2 (bps) | Throughput N3 (bps) | Throughput N4 (bps) | Aggregate Throughput (bps) | Collision Count | Packet Transmitted | |
Pc | ||||||||
0 | 0 | 0 | 0 | 0 | 0 | 53998 | 53998 | 1 |
4 | 0 | 0 | 0 | 25 | 25 | 23361 | 25560 | 0.914 |
6 | 0 | 0 | 0 | 83 | 83 | 9966 | 17391 | 0.573 |
Table 4‑11: Simulation Results with 4 transmitting nodes
We carry out simulations with different settings of Retry Count. The final results are plotted below. When Retry count is set to zero, all packets collide even when just two nodes are transmitting. With retry count set to 0, the node attempts a packet transmission. If it fails, there is no retry and the packet is dropped. Recall, that in s-Aloha the transmitter does not back off before the first transmission attempt for a packet. With backlogged queues, the two transmitting nodes keep attempting at each slot. This leads to continuous collisions.
When the retry count is set to 4 (or 6) a transmitting node back off per the exponential backoff algorithm, before every retransmission. The back off algorithm is explained in section 3.2.3. Hence there is an element of randomness in packet transmissions at each slot. Nodes may or may not transmit. The probability of transmission at a particular slot reduces as the Retry Count is increased. Hence, we see lower collision probabilities for Retry count of 6.
Advanced: s-Aloha works as expected only if the slot time is greater than transmission time plus the propagation delay. What happens when slot length is lower than this limit? Under this condition a new slot is available for transmission even before completion of an existing packet transmission. Thus, if an idle node completes its back off before the transmission (where transmission time equals Ttx + Δ) of one another node is complete, it will attempt to transmit at the start of a new slot. The two packets collide and are lost. One would therefore expect higher collision probabilities with smaller slot lengths. NetSim simulation results for 2-node transmitting case with slot time, 250 ms is given below
| Retry Limit | Throughput N1 (bps) | Throughput N2(bps) | Aggregate Throughput(bps) | Collision Count | Packet Transmitted |
Pc | Pc (Ideal slot time) |
|-------------|---------------------|--------------------|---------------------------|-----------------|--------------------|-----------------------|-----------------------------------------|
| 0 | 0 | 0 | 0 | 26666 | 26666 | 1 | 1 |
| 4 | 20 | 20 | 40 | 14102 | 17696 | 0.797 | 0.427 |
| 6 | 45 | 46 | 91 | 6987 | 15109 | 0.462 | 0.153 |
Table 4‑12: Simulation Results with slot time vs collision probability
Observe the significant increase in collision probability when the slot time is set lower than the ideal slot time. Next, we fix the retry count at 6 and vary the slot time from 50 ms to 750 ms in steps of 50 ms. In the plot below showing collision probability vs. slot time, we again observe how low slot times lead to higher collision probabilities.
Figure 4‑7: Collision probability vs slot time