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 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 from n1
 47:     if (EVENT == "+" && SRCNODE == 1 && DSTNODE == 0 && PKTNAME == "tcp")
 48:         Send ++;
 49:     #Count up the drop packet
 50:     if (EVENT == "d" && SRCNODE == 0 && DSTNODE == 1 && PKTNAME == "ack")
 51:         Lost ++;
 52: }
 53:
 54: END {
 55:     printf("TCP:number of packets send: %d lost: %d\n", Send, Lost);
 56:     printf("TCP:the loss rate of packets: %.5f\n", Lost/Send);
 57: }

NS2网络模拟(2)-丢包率的更多相关文章

  1. 无线路由器wds桥接技术+丢包率

    半根毛线http://www.cnblogs.com/hsd-/ 今天下午鼓捣了一下无线路由的wds桥接 算是计算机网络的作业 码来分享一下 1.首先设置主路由 我的主路由是斐讯4线 路由ip为192 ...

  2. [转]网络性能评估工具Iperf详解(可测丢包率)

    原文链接:安全运维之:网络性能评估工具Iperf详解:http://os.51cto.com/art/201410/454889.htm 参考博文:http://linoxide.com/monito ...

  3. zabbix使用ICMP Ping模版实现对客户端网络状态的监控,监控丢包率、响应时间

    参考网站: https://www.cnblogs.com/saneri/p/6706578.html 使用fping报错注意事项: https://blog.csdn.net/oqqssh/arti ...

  4. 用ping命令简单的测试 延时、抖动、丢包率

    在DOS命令状态下输入 :ping 202.105.135.211 -t (连续的对该IP地址执行Ping命令,直到被用户以Ctrl+C中断)就会得到下面的结果:Pinging 202.105.135 ...

  5. [转载]UDP丢包率提升

    UDP丢包及无序问题 转载自:http://hi.baidu.com/gamedot/item/96cb9bf1a717eb14d6ff8cd5 最近在做一个项目,在这之前,做了个验证程序. 发现客户 ...

  6. zabbix使用fping监控任意两个节点之间的网络质量、丢包率和响应时间

    zabbix使用fping监控任意两个节点之间的网络质量.丢包率和响应时间 之前的博文 使用zabbix3..4的ICMP Ping模版实现对客户端网络状态的监控 https://www.cnblog ...

  7. shell 获取指定ip的丢包率

    shell 获取指定ip的丢包率 丢包率大于10%就重新网络 使用sed 替换字符串 [[ $(ping -c 10 -W 1 baidu.com | awk '$6 ~ /%/{print $6}' ...

  8. 收集TCP端口的访问延迟和丢包率

    需求: 找一款工具可以对TCP 80端口 收集 访问延迟和丢包率 找到的工具: 1.Hping :  http://www.hping.org/ 2.paping : https://docs.azu ...

  9. RFC2544丢包率测试——信而泰网络测试仪实操

    文章关键词:RFC2544.丢包率.吞吐量. 丢包率概述: 丢包率(Frame Loss Rate)测试的目的是确定DUT在不同的负载和帧长度条件下的丢包率.在稳定负载下,由于网络设备资源缺乏,应该正 ...

随机推荐

  1. [CSS] Use Generated Content to Augment Information

    When you create a pseudo element, you have access to the parent HTML attributes. They can be used in ...

  2. CISCO - 查找命令行

    http://www.cisco.com/c/en/us/support/web/tools/help/command_search_best_practices.html Support Best ...

  3. [转载]netcore 使用surging框架发布到docker

    demo运行在windows的docker中,系统是win10,所以需要先下载Docker for Windows,安装完毕后系统会重启,然后桌面上可以找到Docker for Windows的快捷图 ...

  4. 【t070】二进制

    Time Limit: 1 second Memory Limit: 128 MB [问题描述] 求所有可以只用1和00拼成的长度为N的二进制数的个数除以15746的余数. 比如当N=4的时候,有5个 ...

  5. margin隐藏最后的切割线

    <style> *{margin: 0;padding: 0;} #demo li{ border-bottom: 1px solid #ccc; } #demo ul{ margin-b ...

  6. 应用:udp聊天器

    说明 在一个电脑中编写1个程序,有2个功能 1.获取键盘数据,并将其发送给对方 2.接收数据并显示 并且功能数据进行选择以上的2个功能调用 要求 实现上述程序 参考代码 import socketde ...

  7. Ubuntu,右键->在终端中打开(apt-install,或者手动增加右键菜单)

    方法一: sudo apt-get install nautilus-open-terminal 然后重启 方法二: Ubuntu中,默认右键菜单中没有“在终端中打开”.要想添加此菜单,可以在主目录中 ...

  8. ECharts.js 超简单入门(本质canvas)

    ECharts.js 超简单入门(本质canvas) 一.总结 一句话总结:echarts这些图标的本质都是canvas. 二.ECharts.js学习(一) 简单入门 EChart.js 简单入门 ...

  9. react渲染和diff算法

    1.生成虚拟dom createElement的作用就是生成虚拟dom.虚拟dom到底是个啥,其实它就是个javascript对象~,这个对象的属性有props,vType,type, 而props也 ...

  10. [Django] Building the rest API

    Install the rest api framework: pip install djangorestfamework In settings.py: INSTALLED_APPS = [ 'd ...