NS2网络模拟(3)-吞吐率

  1: #NS2_有线部分\Throughput.awk
  2:
  3: BEGIN {
  4:     #Initialize the variable
  5:     init = 0;
  6:     i = 0;
  7: }
  8:
  9: {
 10: #Event Abbreviation Type Value
 11: #%g %d %d %s %d %s %d %d.%d %d.%d %d %d
 12: #Normal Event
 13:         #r: Receive
 14:         #d: Drop
 15:         #e: Error
 16:         #+: Enqueue
 17:         #-: Dequeue
 18: #double  Time
 19: #int  (Link-layer) Source Node
 20: #int  (Link-layer) Destination Node
 21: #string  Packet Name
 22: #int  Packet Size
 23: #string  Flags
 24: #int  Flow ID
 25: #int  (Network-layer) Source Address
 26: #int  Source Port
 27: #int  (Network-layer) Destination Address
 28: #int  Destination Port
 29: #int  Sequence Number
 30: #int  Unique Packet ID
 31:
 32:     #Evaluate the fields to new viariables
 33:     EVENT       = $1;
 34:     TIME        = $2;
 35:     SRCNODE     = $3
 36:     DSTNODE     = $4;
 37:     PKTNAME     = $5;
 38:     PKTSIZE     = $6;
 39:     FLAGS       = $7;
 40:     FLOWID      = $8;
 41:     SRCADDPORT  = $9;
 42:     DSTADDPORT  = $10;
 43:     SEQNO       = $11;
 44:     PKTID       = $12;
 45:
 46:     #Count up the packets send to DstNode
 47:     if (EVENT == "-" && SRCNODE == 0 && DSTNODE == 1)
 48:     {
 49:         ByteSum[i + 1] = ByteSum[i] + PKTSIZE;
 50:
 51: #        if (init == 0) {
 52: #            StartTime = Time;
 53: #            init = 1;
 54: #        }
 55:
 56:         EndTime[i] = TIME;
 57:         i = i + 1;
 58:     }
 59: }
 60:
 61: END {
 62:     printf("%.2f\t%.2f\n", EndTime[0], 0);
 63:
 64:     #Calcute the throughput
 65:     for (j = 1; j < i; j ++)
 66:     {
 67:         Throught = (ByteSum[j] / (EndTime[j] - EndTime[0])) * 8 / 1000;
 68:         printf("%.2f\t%.2f\n", EndTime[j], Throught);
 69:     }
 70:
 71:     printf("%.2f\t%.2f\n", EndTime[i - 1], 0);
 72: }
 73: 
时间: 2024-09-29 13:15:03

NS2网络模拟(3)-吞吐率的相关文章

NS2网络模拟(4)-吞吐率图

1: #NS2_有线部分\ForGnuplot.plot 2: 3: #gnuplot> 4: #set xtics 0, 1, 10 5: set grid 6: set xrange [0:10] 7: set yrange [0:1000] 8: set key top left set key bottom right 9: set key box 10: set title "TCP Throughput" 11: set xlabel "Time(s)&qu

NS2网络模拟(5)-homework01.tcl

1: #NS2_有线部分\homework01.tcl 2: 3: #创建两个结点,深圳到北京的TCP连接,图形将数据显示出来,计算吞吐率,画图分析 4: #tcp上层用ftp 5: #udp上层用cbr 6: #Create a simulator object 7: set ns [new Simulator] 8: 9: set nf [open SZ2BJ.nam w] 10: $ns namtrace-all $nf 11: 12: set nd [open SZ2BJ.tr w] 1

windows性能检测器参数中,我需要监视磁盘的写入速度、读取速度以及io的吞吐率,还有总使用内存,请说明单位

问题描述 //CPU使用情况PerformanceCounterpcCpu=newPerformanceCounter("Processor","%ProcessorTime","_Total");//剩余内存PerformanceCounterpcMemory=newPerformanceCounter("Memory","AvailableBytes","");指在读取操作时从磁盘上

NS2网络模拟(2)-丢包率

1: #NS2_有线部分\LossRate.awk 2: 3: BEGIN { 4: #Initialize the variable 5: Lost = 0; #the Sum of Lost packet 6: Send = 0; #the Sum of Send packet 7: } 8: 9: { 10: #Event Abbreviation Type Value 11: #%g %d %d %s %d %s %d %d.%d %d.%d %d %d 12: #Normal Even

英伟达发布TensorRT 3可编程推理加速器,比起CPU能实现高达40倍吞吐率

北京时间9月26日,在英伟达GPU技术峰会上,英伟达创始人兼CEO黄仁勋正式发布TensorRT 3 神经网络推理加速器.据官方介绍,TensorRT 3能极大改善处理性能,削减从云到边缘设备(自动驾驶汽车.机器人等)的推理开销.TensorRT 3 是在Volta GPU 实现最优推理性能的关键,比起CPU它能实现高达40倍的吞吐量,时延在7ms之内.目前,对于英伟达开发者计划成员,现在有针对Tesla GPU (P4, P100, V100)和Jetson嵌入式平台的TensorRT 3提供

nginx+redis 实现 jsp页面缓存,提升系统吞吐率

最近在开发的时候,发现之前APP客户端的一部分页面用的是webview交互,这些页面请求很多,打开一套试卷,将会产生100+的请求量,导致系统性能下降.于是考虑在最靠近客户端的Nginx服务器上做Redis缓存.综合了下网上对于php缓存的资料,经过一番改动,终于搭建成功.由于网上的是针对php的,而且没有说明,对于我这种完全不动运维的人来说,研究下来还是挺痛苦的.所以整理一份比较完整的,供大家参考. 以下的配置中,可能有不适合或者写的有问题的.请留言指出,谢谢! 最终缓存以后,整个项目结构图如

NS2网络模拟(7)-homework03.tcl

1: #NS2_有线部分\homework03.tcl 2: 3: #Create a simulator object 4: set ns [new Simulator] 5: 6: #Define different colors for data flows 7: $ns color 1 Blue 8: $ns color 2 Red 9: 10: #Open the nam trace file 11: set nf [open szsh.nam w] 12: $ns namtrace-

NS2网络模拟(6)-homework02.tcl

1: #NS2_有线部分\homework02.tcl 2: 3: #Create a simulator object 4: set ns [new Simulator] 5: 6: #Define different colors for data flows 7: $ns color 1 Blue 8: $ns color 2 Red 9: 10: #Open the nam trace file 11: set nf [open szsh.nam w] 12: $ns namtrace-

NS2网络模拟(1)-延迟

  1: #NS2_有线部分\EndDelay.awk 2: 3: BEGIN { 4: #Initialize the variable 5: MaxID = 0; 6: i = 0; 7: } 8: 9: { 10: #Event Abbreviation Type Value 11: #%g %d %d %s %d %s %d %d.%d %d.%d %d %d 12: #Normal Event 13: #r: Receive 14: #d: Drop 15: #e: Error 16: