Salut . s'il vous plait j'ai besoin d'un script awk pour avoir le débit de tfrc et aussi loss delay . Aidez moi s'il vous plait .
Merci
Salut . s'il vous plait j'ai besoin d'un script awk pour avoir le débit de tfrc et aussi loss delay . Aidez moi s'il vous plait .
Merci
Bonsoir.
Non nous n'allons pas te pondre un script avec aussi peu de détails. Merci de nous montrer ce que tu as fait et surtout ce que tu attends et ce sur quoi tu bloques
Idriss
Bonsoir je vous remercie pour vos réponse.
J'ai testé des scripts tcl pour tfrc et tcp et pour les analyser j'ai besoin des courbes de taux de perte et de délai en fonction du temps
Mais je ne sais pas comment les écrire avec awk script.
Voila ci dessous mes scripts tcl pour tfrc et pour tcp
Merci pour vous
tcp.tcl
tfrc.tcl
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
77
78
79
80 #Create a simulator object set ns [new Simulator] #Define different colors for data flows (for NAM) $ns color 1 Blue $ns color 2 Red #Open the NAM trace file set nf [open out.nam w] $ns namtrace-all $nf #Open the Trace file set tf [open out.tr w] $ns trace-all $tf #Define a 'finish' procedure proc finish {} { global ns nf tf $ns flush-trace #Close the NAM trace file close $nf #Close the Trace file close $tf #Execute NAM on the trace file exec nam out.nam & exit 0 } #Create four nodes set n0 [$ns node] set n1 [$ns node] set n2 [$ns node] set n3 [$ns node] #Create links between the nodes $ns duplex-link $n0 $n2 2Mb 10ms DropTail $ns duplex-link $n1 $n2 2Mb 10ms DropTail $ns duplex-link $n2 $n3 1.7Mb 20ms DropTail #Set Queue Size of link (n2-n3) to 10 $ns queue-limit $n2 $n3 10 #Give node position (for NAM) $ns duplex-link-op $n0 $n2 orient right-down $ns duplex-link-op $n1 $n2 orient right-up $ns duplex-link-op $n2 $n3 orient right #Monitor the queue for link (n2-n3). (for NAM) $ns duplex-link-op $n2 $n3 queuePos 0.5 #Setup a TCP connection set tcp [new Agent/TCP] $tcp set class_ 2 $ns attach-agent $n0 $tcp set sink [new Agent/TCPSink] $ns attach-agent $n3 $sink $ns connect $tcp $sink $tcp set fid_ 1 #Setup a FTP over TCP connection set ftp [new Application/FTP] $ftp attach-agent $tcp $ftp set type_ FTP #Setup a UDP connection set udp [new Agent/UDP] $ns attach-agent $n1 $udp set null [new Agent/Null] $ns attach-agent $n3 $null $ns connect $udp $null $udp set fid_ 2 #Setup a CBR over UDP connection set cbr [new Application/Traffic/CBR] $cbr attach-agent $udp $cbr set type_ CBR $cbr set packet_size_ 1000 $cbr set rate_ 1mb $cbr set random_ false #Schedule events for the CBR and FTP agents $ns at 0.1 "$cbr start" $ns at 1.0 "$ftp start" $ns at 100.0 "$ftp stop" $ns at 100 "$cbr stop" #Detach tcp and sink agents (not really necessary) $ns at 99.5 "$ns detach-agent $n0 $tcp ; $ns detach-agent $n3 $sink" #Call the finish procedure after 5 seconds of simulation time $ns at 100.5 "finish" #Print CBR packet size and interval puts "CBR packet size = [$cbr set packet_size_]" puts "CBR interval = [$cbr set interval_]" #Run the simulation $ns run
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 #Create a simulator object set ns [new Simulator] #Define different colors for data flows (for NAM) $ns color 1 Blue $ns color 2 Red #Open the NAM trace file set nf [open tfrc_out.nam w] $ns namtrace-all $nf #Open the Trace file set tf [open tfrc_out.tr w] $ns trace-all $tf #Define a 'finish' procedure proc finish {} { global ns nf tf $ns flush-trace #Close the NAM trace file close $nf #Close the Trace file close $tf #Execute NAM on the trace file exec nam tfrc_out.nam & exit 0 } #Create four nodes set n0 [$ns node] set n1 [$ns node] set n2 [$ns node] set n3 [$ns node] #Create links between the nodes $ns duplex-link $n0 $n2 2Mb 10ms DropTail $ns duplex-link $n1 $n2 2Mb 10ms DropTail $ns duplex-link $n2 $n3 1.7Mb 20ms DropTail #Set Queue Size of link (n2-n3) to 10 $ns queue-limit $n2 $n3 10 #Give node position (for NAM) $ns duplex-link-op $n0 $n2 orient right-down $ns duplex-link-op $n1 $n2 orient right-up $ns duplex-link-op $n2 $n3 orient right #Monitor the queue for link (n2-n3). (for NAM) $ns duplex-link-op $n2 $n3 queuePos 0.5 #Setup a TCP connection set tcp [new Agent/TCP] $tcp set class_ 2 $ns attach-agent $n0 $tcp set sink [new Agent/TCPSink] $ns attach-agent $n3 $sink $ns connect $tcp $sink $tcp set fid_ 1 #Setup a FTP over TCP connection set ftp [new Application/FTP] $ftp attach-agent $tcp $ftp set type_ FTP #Setup a TFRC connection set tfrc [new Agent/TFRC] set tfrcsink [new Agent/TFRCSink] $tfrc set class_ 1 $tfrcsink set class_ 1 $ns attach-agent $n1 $tfrc $ns attach-agent $n3 $tfrcsink $ns connect $tfrc $tfrcsink $tfrc set fid_ 2 $ftp set packet_size_ 1000 $ns at 0.1 "$tfrc start" $ns at 1.0 "$ftp start" $ns at 100.0 "$ftp stop" $ns at 100 "$tfrc stop" #Detach tcp and sink agents (not really necessary) $ns at 99.5 "$ns detach-agent $n0 $tcp ; $ns detach-agent $n3 $sink" #Call the finish procedure after 5 seconds of simulation time $ns at 100.5 "finish" #Print CBR packet size and interval #puts "CBR packet size = [$cbr set packet_size_]" #puts "CBR interval = [$cbr set interval_]" #Run the simulation $ns run
Bonjour,
Je connais bien awk, et d'autre façon de formater du text d'un format à un autre mais je ne connais peut-être pas tcl...
Donc, un peu d'effort de ton coté, comme comment tu verrais l'algorithme de ton awk script:
-valeur d'input
-ce que cela doit donner en sortie avec des exemples
mais à part pour apprendre awk, pourquoi ne programme tu pas ton besoin directement en tcl ?
Partager