Applicable ReleasesAll NetSim releases
Applicable VersionAll versions (Academic, Standard, and Professional)
Third-Party toolsMS Excel


TABLE OF CONTENTS

To compute the total packet loss, users will need to enable logging of the Packet trace in the GUI before running the simulation. 


In this example, we have considered 4 applications from multiple source nodes of application-type CBR. The steps discussed here will be applicable to any traffic type such as video, voice, etc.


We have provided two ways to get the total loss: (i) Manually via Excel, and (ii) by executing a visual basic (VB) script. 


Generating pivot tables using a Visual Basic Macro

Go to Developer Tab and click on Visual Basic. The Developer tab isn't displayed by default, but you can add it to the ribbon. (For steps please refer to Show the Developer tab - Microsoft Support ) 

Import the attached visual basic script. Visual Basic > File > Import > (Path to downloaded file GetPacketLoss.bas). After successful import, you may see a module added with the VB Script.


After import, close the Visual Basic window, Go to Macro > Select GetPacketLoss.bas > Run. Upon execution, it will perform all the steps mentioned above.


Manually generating pivot table to get packet loss table 

  • Open the Packet Trace file using the Open Packet Trace option available in the Simulation Results window.

                                                             Fig 1: Packet Trace                   

  • Click on the below-highlighted icon to create a new Pivot Table. 
  • Click on Insert on Top ribbon à Select Pivot Table.

Fig 2: Top Ribbon


  • Then select packet trace and press Ctrl + A Select OK.

Fig 3: Packet Trace Pivot Table

  • Then we will get a blank Pivot table.

Fig 4: Blank Pivot Table

  • Add the following to the respective fields
    • CONTROL PACKET TYPE/APP_NAME  drag and drop into the Values field
    • SOURCE ID, DESTINATION ID into Filter field
    • CONTROL PACKET TYPE/APP_NAME into the Rows field
    • PACKET_STATUS to Columns Field see Fig 5

Fig 5: Adding fields into Filter, Columns, Rows, and Values

Results: Packet loss table

Steps to plot packet loss vs simulation time

Please follow the procedure explained below to obtain plots on packet loss over simulation time.

  • Open the Packet Trace file using the Open Packet Trace option available in the Simulation Results window.
 
                                                                                   Fig 1: Packet Trace                           
  • Click on below highlighted icon to create new Pivot Table. 
  • Click on Insert on Top ribbon à Select Pivot Table.
 
Fig 2 : Top Ribbon
  • Then select packet trace and press Ctrl + A à Select OK.
Fig 3: Packet Trace Pivot Table
  • Then we will get blank Pivot table.
Fig 4: Blank Pivot Table
  • CONTROL PACKET TYPE/APP NAME drag and drop into Values field, SOURCE ID, DESTINATION ID, CONTROL PACKET TYPE/APP NAME, PACKET_STATUS into Filter field, PHY_LAYER_ARRIVAL_TIME(US) into Rows field see Fig 5.
  • Change Sum of CONTROL PACKET TYPE/APP NAME -> Values Field Settings à Summarize Values By à  Select Count and Show Values As à Running Total in à Base Field as PHY_LAYER_ARRIVAL_TIME(US) à Click on OK.
Fig 5: Adding fields into Filter, Columns, Rows and Values
  • Then use the plot option to plot Packet Loss vs Simulation time.

Note: The plot generated is for the running total of packet loss vs time. In a similar way, a plot can also be generated for instantaneous packet loss by averaging over a jumping time window.