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. POJ 1887 Testing the CATCHER(LIS的反面 最大递减子序列)

    Language: Default Testing the CATCHER Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 1 ...

  2. Chromium网页URL载入过程分析

    Chromium在Browser进程中为网页创建了一个Frame Tree之后,会将网页的URL发送给Render进程进行载入.Render进程接收到网页URL载入请求之后,会做一些必要的初始化工作, ...

  3. 将String转化为Long,并将Long转化为Date 分类: B1_JAVA 2014-06-30 16:23 1249人阅读 评论(0) 收藏

    package org.ljh.test.javaee; import java.text.SimpleDateFormat; import java.util.Date; public class ...

  4. Lucene学习总结之七:Lucene搜索过程解析 2014-06-25 14:23 863人阅读 评论(1) 收藏

    一.Lucene搜索过程总论 搜索的过程总的来说就是将词典及倒排表信息从索引中读出来,根据用户输入的查询语句合并倒排表,得到结果文档集并对文档进行打分的过程. 其可用如下图示: 总共包括以下几个过程: ...

  5. SharedPreferences基础 分类: H1_ANDROID 2013-11-04 22:35 2559人阅读 评论(0) 收藏

    见归档项目:SharedPreferencesDemo.zip 1.对于数据量较小,且有明显的K-V形式的数据而言,适合用SharedPreferences保存.SharedPreferences的数 ...

  6. Oracle null 处理

    null first null last 解决啦-

  7. [tmux] Copy and paste text from a tmux session

    One non-obvious, but extremely useful, feature in tmux is copy-pasting text between panes. This also ...

  8. linux 安装scrt

    http://www.vandyke.com/products/securecrt/  wget http://download.boll.me/securecrt_linux_crack.pl pe ...

  9. PatentTips - OpenCL compilation

    BACKGROUND The present disclosure relates generally to integrated circuits, such as field programmab ...

  10. Hudson版本控制 (备注)

    http://www.ttlsa.com/tools/install-hudson-on-linux/