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:         #+: 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:     #Record the maxmum
 47:     if (PKTID > MaxID)
 48:         MaxID = PKTID;
 49:
 50:     #Record the transmitter time
 51:     if (StartTime[PKTID] == 0)
 52:         StartTime[PKTID] = TIME;
 53:
 54:
 55:     if (EVENT == "r" && FLOWID == 1)
 56:     {
 57: #        printf("after: %s\t%d\t%s\n", EVENT, FLOWID, TIME);
 58:         EndTime[PKTID] = TIME;
 59: #        printf("%g %d %d %s %d %s %d %d.%d %d.%d %d %d\n", EVENT, TIME, FLOWID, PKTID);
 60: #        printf("after: %s    %d    %s    %d\n", EVENT, FLOWID, EndTime[PKTID], PKTID);
 61: #        if (EVENT == "r")
 62: #        {
 63: #            EndTime[PKTID] = TIME;
 64: #        }
 65:
 66:     }
 67:     else
 68:     {
 69:         EndTime[PKTID] = -1;
 70:
 71:     }
 72:
 73:
 74: }
 75:
 76: END {
 77:     for (PKTID = 0; PKTID <= MaxID; PKTID ++)
 78:     {
 79:         Start = StartTime[PKTID];
 80:         End = EndTime[PKTID];
 81:         Delay = End - Start;
 82:         if (Delay >= 0)
 83:             printf("%f\t%f\n", Start, Delay);
 84: #        packet_duration = EndTime[PKTID] - StartTime[PKTID];
 85:
 86: #            printf("%f\t%f\n", start, packet_duration);
 87:     }
 88: }
 89: 
												

NS2网络模拟(1)-延迟的更多相关文章

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

    1: #NS2_有线部分\homework03.tcl 2: 3: #Create a simulator object 4: set ns [new Simulator] 5: 6: #Define ...

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

    1: #NS2_有线部分\homework02.tcl 2: 3: #Create a simulator object 4: set ns [new Simulator] 5: 6: #Define ...

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

    1: #NS2_有线部分\homework01.tcl 2: 3: #创建两个结点,深圳到北京的TCP连接,图形将数据显示出来,计算吞吐率,画图分析 4: #tcp上层用ftp 5: #udp上层用c ...

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

    1: #NS2_有线部分\ForGnuplot.plot 2: 3: #gnuplot> 4: #set xtics 0, 1, 10 5: set grid 6: set xrange [0: ...

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

    1: #NS2_有线部分\Throughput.awk 2: 3: BEGIN { 4: #Initialize the variable 5: init = 0; 6: i = 0; 7: } 8: ...

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

    1: #NS2_有线部分\LossRate.awk 2: 3: BEGIN { 4: #Initialize the variable 5: Lost = 0; #the Sum of Lost pa ...

  7. Facebook 网络模拟工具 ATC部署及使用

    废话引用: Facebook此前开源了增强网络流量控制工具 ATC,能利用WiFi网络模拟各种移动网络,测试智能手机和APP在不同国家地区和应用环境下的性能表现.ATC能够模拟2G.2.5G(Edge ...

  8. 与NS2一起度过第一个圣诞夜!(NS2入门学习参考资料)

    Merry xmas! 安装好NS2后正式开始学习NS2啦,先转发一哥们的博客内容,慢慢看! 一). NS常用基本网站         1. 寻求问题答案最好的地方.           http:/ ...

  9. Facebook网络模拟测试工具ATC使用

    Facebook在其工程博客(原文)上宣布开源移动网络测试工具Augmented Traffic Control(ATC),我迅速试用了一番,非常不错,对手游或者其他APP的调试和测试都非常有帮助,介 ...

随机推荐

  1. AE中地图查询方式

    樱木 原文 AE中地图查询方式 地图查询主要有两种查询:空间查询和属性查询 所用到知识点: 1  Cursor(游标)对象 本质上是一个指向数据的指针,本身不包含数据内容,提供一个连接到ROW对象或者 ...

  2. Web前端--黑客技术揭秘(菜鸟知识)

    一,Web安全的关键点 1.同源策略是众多安全策略的一个,是Web层面上的策略.很重要. 2.同源策略规定:不同域的client脚本在没明白授权的情况下.不能读写对方的资源. 3.同域要求两个网站同协 ...

  3. [Angular] How to styling ng-content

    Let's say you are builing a reuseable component. The style structure like this: div > input If yo ...

  4. [Angular Router] Lazy loading Module with Auxiliary router

    Found the way to handle Auxiliary router for lazy loading moudle and erge load module are different. ...

  5. php实现 简单密码(代码颜色变化)

    php实现  简单密码(代码颜色变化) 一.总结 一句话总结:写代码的时候一定要关注代码的颜色变化,不然低级错误害死人.常量变量会有不同颜色,所以$str少$符号变成常量的时候很容易发现. 1.变量$ ...

  6. [Flow] More tips about Flow

  7. ios 第一篇文章-xcode6.2键盘调不出来

    ios 第一篇文章 不晓得有没有人遇到过ios代码内调用键盘(keyboard)调不出来的情况,反正我是遇到了,按官方文档的说法调用键盘事件非常easy事实上: 我用了之后,不晓得为嘛,键盘就是不显示 ...

  8. js进阶 11-4/5 jquery中css的类的操作有哪些

    js进阶 11-4/5  jquery中css的类的操作有哪些 一.总结 一句话总结:jquery中css的类的操作有增删切三种. 1.jquery中css的类的操作有哪些? 增删切三种 addCla ...

  9. 【codeforces 546A】Soldier and Bananas

    time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou ...

  10. Hibernate中的配置文件

    Hibernate中配置文件 主配置文件 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE h ...