Open NetSim, Select Examples->IOT-WSN->Wireless Sensor Networks->CAP Time Analysis then click on the tile in the middle panel to load the example as shown in Figure 4‑38.
Figure 4‑38: List of scenarios for the example of CAP Time Analysis
The following network diagram illustrates, what the NetSim UI displays when you open the example configuration file.
Figure 4‑39: Network set up for studying the CAP Time Analysis
Settings done in example config file
-
The following Environment properties are already set, as Manually Via Click and Drop.
-
In SinkNode->INTERFACE_1(Zigbee)> Datalink Layer enable Beacon mode set Superframe Order (SO) -> 10 and Beacon Order (BO) -> 12
Figure 4‑40: Datalink layer Properties window for Sink node
-
In Adhoc Link Properties change Channel characteristics -> Path Loss only, Path Loss Model -> Log Distance and path loss exponent -> 2.
-
Generate SENSOR_APP Traffic Between Wireless_Sensor_1 to WSN_Sink_3 and set the transport layer protocol as UDP other properties are default.
-
Enable Packet Trace and Plots.
-
Set Simulation time as 100 sec.
Theoretical CAP Time Calculation
-
To find CAP time, BI is 62914.56ms -> So in 100s, two beacon frames should be transmitted at 0 & 62s.
-
Check no. of beacon frames transmitted in 802.15.4 metrics.
-
Here CFP = 0 because there is only 1 sensor.
-
CAP Time = SD – beacon time = (15728.64ms) – (983.04ms) = 14745.6ms.
-
Open packet trace and filter Control_Packet_Type to Zigbee_Beacon_Frame, users should get two zigbee_beacon_frames at 0, 62.9secs, because the time interval between two beacon frames is 62 seconds. Since we have 2 nodes so user can get 2 beacon frames for each node.
-
Since two Beacon frames are transmitted, CAP time = 2 * 14745.6ms = 29491200µs.
NetSim Results:
-
Check and compare the theoretical CAP time with NetSim simulation results in IEEE 802.15.4 metrics in Results Windows.
-
CAP time = 29491200.0000Microsec.