-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdel_1.awk
More file actions
76 lines (41 loc) · 891 Bytes
/
Copy pathdel_1.awk
File metadata and controls
76 lines (41 loc) · 891 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#This program is used to calculate the end-to-end delay for CBR
BEGIN {
highest_packet_id = 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 ( packet_id > highest_packet_id )
highest_packet_id = packet_id;
if ( start_time[packet_id] == 0 )
start_time[packet_id] = time;
if ( from== 0 && to > 2 && flow_id == 0 && action != "d" ) {
if ( action == "r" ) {
end_time[packet_id] = time;
}
} else {
end_time[packet_id] = -1;
}
}
END {
for ( packet_id = 1; packet_id <= highest_packet_id; packet_id++ ) {
start = start_time[packet_id];
end = end_time[packet_id];
packet_duration = end - start;
#Avg_value = packet_duration/packet_id;
}
printf("Required Bandwidth in Macrocell [MHz]:\t%1.4f\n", packet_duration);
if ( start < end )
{
#printf("%f \n", Avg_value);
}
}