[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ns] Problems with LAN
> I made a small tcl file with two nodes to check the LAN simulation.
>
> the file is:
> tmp.tcl:
>
>
> #Create a simulator object
> set ns [new Simulator]
>
>
> set f [open trace.1 w]
> $ns trace-all $f
>
>
> proc finish {} {
> global ns f
> close $f
> }
>
>
>
> #Create two nodes
>
>
> set n0 [$ns node]
> set n1 [$ns node]
>
> #Create a duplex link between the nodes
> #$ns duplex-link $n0 $n1 1Mb 10ms DropTail
> set lan[$ns make-lan "$n0 $n1" 1Mb 10ms LL Queue/DropTail Mac/Csma/Cd]
>
> #Call the finish procedure after 5 seconds of simulation time
> $ns at 5.0 "finish"
>
>
> #Run the simulation
> $ns run
>
>
>
> I am getting compilation problems:
>
>
> _o14: unable to dispatch method init-vars
> while executing
> "_o14 init-vars -bw 1Mb -delay 10ms -llType LL -ifqType Queue/DropTail
> -macType Mac/Csma/Cd -chanType Channel"
> ("eval" body line 1)
> invoked from within
> "eval $self init-vars $args"
> (procedure "_o14" line 2)
> (LanNode init line 2)
> invoked from within
> "_o14 init _o3 -bw 1Mb -delay 10ms -llType LL -ifqType Queue/DropTail
> -macType Mac/Csma/Cd -chanType Channel"
> (Class create line 1)
> invoked from within
> "LanNode create _o14 _o3 -bw 1Mb -delay 10ms -llType LL -ifqType
> Queue/DropTail -macType Mac/Csma/Cd -chanType Channel"
> invoked from within
> "catch "$className create $o $args" msg"
> (procedure "new" line 3)
> invoked from within
> "new LanNode $self -bw $bw -delay $delay -llType $llType -ifqType
> $ifqType -macType $macType -chanType $chanType"
> (procedure "_o3" line 2)
> (Simulator make-lan line 2)
> invoked from within
> "$ns make-lan "$n0 $n1" 1Mb 10ms LL Queue/DropTail Mac/Csma/Cd"
> (file "tmp.tcl" line 25)
>
> Even simple simulation is not able to run.
> Will very much thankful if get the solution.
>
> seema.
>
Mac/Csma/Cd is not working. But you should be getting an error message instead
of all the "garbage". What version of ns are you running? I have also noticed a
typo, there should be a spacing between lan and [ : lan[$ns make-lan "$n0 $n1"
1Mb 10ms LL Queue/DropTail Mac/Csma/Cd].
Tarik.