|||
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
Event
|
Time
|
From node
|
To node
|
Pkt type
|
Pkt size
|
Flags
|
Fid
|
Src addr
|
Dst addr
|
Seq num
|
Pkt id
|
BEGIN {
num_pkts_sent =0;
num_pkts_rcvd =0;
}
{
action =$1;
time =$2;
from =$3;
to =$4;
type =$5;
pktsize=$6;
flow_id=$8;
src=$9;
dst = $10;
seq_no =$11;
packet_id =$12;
if(from=="1"&&action=="+"&&flow_id=="2")
num_pkts_sent++;
if(to=="3"&&flow_id=="2"&&action=="r")
num_pkts_rcvd++;
}
END {
printf("number of packets sent:%d lost: %dn",num_pkts_sent,num_pkts_sent-num_pkts_rcvd);
printf("the loss rate of packets is %fn",num_pkts_rcvd/num_pkts_sent);
}
|
BEGIN {
largest_index =0;
}
{
action =$1;
time =$2;
from =$3;
to =$4;
type =$5;
pktsize=$6;
flow_id=$8;
src=$9;
dst = $10;
seq_no =$11;
packet_id =$12;
if(largest_index < seq_no)
largest_index = seq_no;
if(action=="+"&&from==1)start_time[seq_no]=time;
if(action=="r"&&to==3)end_time[seq_no]=time;
}
END {
printf("the largest_index is %dn",largest_index);
for(i =0;i<largest_index;i++)
printf("%d %f %fn",i,start_time[i],end_time[i]);
}
|
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-11-15 13:18
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社