Applicable VersionsNetSim Academic
NetSim Standard
NetSim Pro


Applicable Releasesv12


Let us consider the following network configuration



Some of the simulation settings are given in the table below:


ParameterValue
Application TypeFTP
Source ID2
Destination ID3
Start Time0 Seconds
File Size100000 Bytes
DistributionConstant
Inter Arrival Time5 Seconds
DistributionConstant
Simulation Time20 Seconds


Unlike other application types such as CBR, Custom, etc where packets at intervals as specified by Inter Arrival Time in case of FTP a file is generated instead.


The generated file is segmented into one or more packets based on the Transport Layer segment size. All the segments of a file will have the same application layer start time or application out time.


The FTP delay shown in the results dashboard is the average per-packet delay which takes into account all the files, packets, and segments that were generated as part of the application.


In the case of FTP application, rather than the per-packet delay, file delay is a more practical representation.
 
The delay experienced by each file generated as part of the FTP application can be calculated from the packet trace or the event trace log files.


The file delay can be quickly computed by finding the difference between the time at which the last segment of the file reaches the destination and the time at which the first segment leaves the source node.


After running the simulation the FTP application delay as part of application metrics in the results dashboard is shown below:



Calculating file delay using packet trace:


As part of the FTP application, there can be multiple files created during the simulation, based on the inter-arrival time configured. In this case for a simulation time of 20 Seconds and Inter arrival time of 5 seconds a total of 4 files are generated.


Shown below is the delay calculated for all the 4 files that were generated using pivot tables from the packet trace log file. 


Steps followed to calculate the file delay from the packet trace log file:

1. Open Packet trace from the results dashboard.



2. Open a new sheet in the packet trace log file as shown below:



3. From Insert menu select the pivot table option. Once the Create Pivot Table window for Table/Range, switch to the Packet Trace sheet and select the entire table and click on OK. Pivot Table Fileds for the new pivot table will be displayed as shown below:



4. Add PACKET_ID from fields list to the Rows area. Add SEGMENT_ID and TRANSMITTER_ID to Filters area and add APP_LAYER_ARRIVAL_TIME to Values area to get a pivot table as shown below:



5. In the Pivot Table formed, filter the first segment (SEGMENT ID 1) and the source node id for transmitter id (Node 2 in this case) as shown below:



6. Insert one more pivot table next to the existing pivot table by clicking on a blank cell (say D1) by going to insert menu as explained in step 3 above to get one more pivot table as shown below:



7. Add PACKET_ID from fields list to the Rows area. Add SEGMENT_ID and RECEIVER_ID to Filters area and add PHY_LAYER_END_TIME to Values area to get a pivot table as shown below:



8. In the Pivot Table formed, filter the last segment (SEGMENT ID 68 in this case) and the destination node id for receiver id (Node 3 in this case) as shown below:



9. Now we have pivot table 1 with the time at which the first segment of each file started from the source and the second pivot table with the time at which the last segment of each file reached the destination. 


10. We copy these values to create a new table manually as shown below:

 

11. To calculate the file delay we subtract the app layer arrival time of each file from the phy layer arrival time and then format the new table optionally as shown below:



12. We now have the delay experienced by each file in microseconds. From this the average delay experienced by each segment can be calculated as: File Delay/Total No: of Segments. For Eg: In the case of file 1 this will be 

8491.76/68 = 124.87 microseconds.

Similarly, the average file delay can be calculated by taking the average delay of all the files as shown below:



Calculating file delay using event trace:


As part of the FTP application, there can be multiple files created during the simulation, based on the inter-arrival time configured. In this case for a simulation time of 20 Seconds and Inter arrival time of 5 seconds a total of 4 files are generated.


Shown below is the delay calculated for all the 4 files that were generated using pivot tables from the packet trace log file. 



Steps followed to calculate the file delay from the event trace log file:

1. Open Event trace from the results dashboard.



2. Open a new sheet in the event trace log file as shown below:



3. From Insert menu select the pivot table option. Once the Create Pivot Table window for Table/Range, switch to the Event Trace sheet and select the entire table and click on OK. Pivot Table Fileds for the new pivot table will be displayed as shown below:



4. Add PACKET_ID from fields list to the Rows area. Add SEGMENT_ID to Filters area, add Event_Type to Columns area and add Event_Time(US) to Values area to get a pivot table as shown below:



5. In the Pivot Table formed, filter the first and last segment (SEGMENT ID 0 and 68 in this case) for Segment_Id and filter the columns to APPLICATON_OUT and APPLICATION_IN for Event_Type as shown below:



9. Now we have a pivot table the time at which the first segment of each file started from the source and the the time at which the last segment of each file reached the destination. 


10. We copy these values to create a new table manually as shown below:


 

11. To calculate the file delay we subtract the APPLICATION_OUT time of each file from the APPLICATION_IN time and then format the new table optionally as shown below:



12. We now have the delay experienced by each file in microseconds. From this the average delay experienced by each segment can be calculated as: File Delay/Total No: of Segments. For Eg: In the case of file 1 this will be 

8491.76/68 = 124.87 microseconds.

Similarly, the average file delay can be calculated by taking the average delay of all the files as shown below:



Related articles:


https://support.tetcos.com/en/support/solutions/articles/14000121666-how-to-calculate-delay-for-ftp-application-over-tcp-in-netsim-

https://support.tetcos.com/en/support/solutions/articles/14000121822-how-to-calculate-delay-for-ftp-application-over-udp-in-netsim-