Thank you very much!!!!!!!!!!!!!!!
Problem:
Can 't read "mac_ (0)" : no to variable
While executing
"Subst $$var [subst]"
(procedure "_o10" line 5)
(SplitObject set line 5)
Invoked from within
"$node_ ($I) set mac_ (0)", "
Invoked from within
"$bop0 bop - get - MAC [$node_ ($I) set mac_ (0)", "
(the file "test. TCL" line 47)
Code:
[new set ns Simulator]
The set val (ifq) Queue
Ll set val (ll)
The set val (ifqlen) 50
The set val (MAC) MAC
$ns node - config - llType $val (ll) \
- ifqType $val (ifq) \
- ifqLen $val ifqLen \
(MAC) - macType $val \
Set tracef [open test. The tr w]
$ns trace -all $tracef
The set namtf [open test. Nam w]
$ns namtrace -all $namtf
Proc finish {} {
Global ns tracef namtf
$ns flush - trace
The close $tracef
The close $namtf
The exec nam test. Nam & amp;
The exit 0
}
The set I 0
The set node_ ($I) [$ns node]
The set n1 [$ns node]
The set n2 [$ns node]
The set n3 [$ns node]
The set n4 interchange [$ns node]
$ns duplex - link $node_ ($I) $n1 10 MB 10 ms DropTail
$ns duplex - link $n1 $n2 10 MB 10 ms DropTail
$ns duplex - link $n2 $10 MB n3 10 ms DropTail
$ns duplex - link $n3 $n4 interchange 10 MB 10 ms DropTail
$ns duplex - link - op $node_ ($I) $n1 received right
$ns duplex - link - op $n1 $n2 received right
$ns duplex - link - op $n2 $n3 received right
$ns duplex - link - op $n3 $n4 interchange received right
The set bop0 new Agent/BOP
# bop: a new transport layer protocol
$ns attach - agent $node_ ($I) $bop0
MAC [$$bop0 bop - get - node_ ($I) set mac_ (0)]
The set bop4 new Agent/BOPSink
$ns attach - agent $n4 interchange $bop4
$$bop0 $bop4 ns connect
Set the FTP new Application/FTP
$FTP attach - agent $bop0
$FTP set type_ FTP
1.0 "$$ns at the FTP start"
4.0 "$$ns at the FTP stop"
$ns at 5.0 "finish"
$ns run
CodePudding user response:
Ding!!!!!!!!!!!!!!