Installieren des Netzwerksimulators (NS-2, allinone) unter Linux Mandriva

6298

Ich habe den Netzwerksimulator NS-2 von hier heruntergeladen -

http://www.isi.edu/nsnam/ns/ns-build.html#allinone

Bauen Sie ns über GCC 4.2.2 -

tar-xzf ns-allinone-2.35.tar.gz cd ns-allinone-2.35 ./install 

Holen Sie sich die Fehlermeldung -

make: *** [tk3d.o] Error 1 tk8.5.10 make failed! Exiting ... For problem with Tcl / Tk see http://www.scriptics.com 

Ich gebe den Link weiter - Scriptics.com - dort eine Nachricht - "Das Skriptarchiv wird gerade rekonstruiert. Bitte kommen Sie bald wieder."

Dann versuche ich -

cd ns-allinone-2.35/ && export CC=gcc-4.2 CXX=g++-4.2 && ./install 

Erhalten Sie die folgende Nachricht -

================================ * Build tcl8.5.10 ================================ checking whether to use symlinks for manpages... no checking whether to compress the manpages... no checking whether to add a package name suffix for the manpages... no checking for gcc... gcc-4.2 checking for C compiler default output file name... configure: error: C compiler cannot create executables See 'config.log' for more details tcl8.5.10 configuration failed! Exiting... Tcl is not part of the ns project. Please see www.Screeptics.com to see if they have a fix for your platform. 

Wie baut man den NS-2 unter Linux Mandriva richtig auf ?


Ich habe GCC auf Version GCC-4.7.2 aktualisiert und dann ns-2.34 installiert . Zuvor wurden einige Änderungen am Quellcode vorgenommen -

in mac / mac-802_Ext.h (oder in mac-802_11Ext.h für ns 2.35 ) Zeile 65 - hinzufügen

# include "cstddef"; 

auch-in-Datei linkstate / ls.h in Zeile 137 ersetzen -

void eraseAll () 

zu

void eraseAll () 

Machen wir jetzt einen einfachen Test ( ns-simple.tcl ) -

#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  #Define a 'finish' procedure proc finish {} { global ns nf $ns flush-trace #Close the NAM trace file close $nf #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 

Ausführen (gemäß http://networksimulator2.files.wordpress.com/2010/10/faqtr fehlerbehebunginstallationsprobleme.pdf ) -

export DISPLAY localhost:6000 ns ns-simple.tcl 

Ausgabe -

CBR packet size = 1000 CBR interval = 0.0080000000000000002 [root@localhost ...]# _X11TransSocketINETConnect() can't get address for http://localhost:12000: Name or service not known nam: couldn't connect to display "http://localhost:6000" 

Was könnte das bedeuten? Wie bekomme ich das Bild?

Nächster. Wenn ich die IP des Remote-Servers verweise, auf dem ich ns-2 installiert habe, erhalte ich die folgende Fehlermeldung:

[root@localhost ...]# export DISPLAY=..ip_of_remote_server_:0.0 [root@localhost ...]# ns ns-simple.tcl CBR packet size = 1000 CBR interval = 0.0080000000000000002 [root@localhost ...]# Xlib: connection to "ip_of_remote_server_:0.0" refused by server Xlib: No protocol specified  nam: couldn't connect to display "ip_of_remote_server_:0.0" 
4
Hallo ivanov-void, sind das zwei getrennte Fragen? Im ersten Teil geht es um das Kompilieren von ns2, und im zweiten Teil scheint es um die Verwendung zu gehen, was darauf hindeutet, dass es funktioniert. Wenn dies zwei Fragen sind, können Sie sie aufteilen, so dass es sich hier um zwei Fragen handelt. Wenn nicht, kannst du etwas darüber erklären, wie sie miteinander in Beziehung stehen? Paul vor 11 Jahren 0
Hallo Paul! Danke für die Antwort. Ich gab einen vollständigen Bericht - von Assembly * ns2 * zur Durchführung eines einfachen Tests. Ich konnte keine vollständige Dokumentation zur Installation von * ns2 * unter * Linux Mandriva * finden. Möglicherweise ist die Installation nicht korrekt (obwohl Tests - *. / Validate * - erfolgreich sind). vor 11 Jahren 0
In Network viele Fragen zu diesem Thema, aber die Antworten sind fast keine. vor 11 Jahren 0
Ah ich sehe. Ist dies ein Tippfehler: `export $ DISPLAY localhost: 6000`? Sie setzen nicht das "$", wenn Sie bash-Variablen zuweisen, und haben Sie einen X11-Server mit der ID "6000"? Paul vor 11 Jahren 1
Ja, es ist ein Tippfehler. Ich korrigierte, danke. Port `6000` - das ist nur ein Experiment. vor 11 Jahren 0
Ok, läuft auf dem ip_of_remote_server ein X-Server und ist er so konfiguriert, dass er Verbindungen von dem Computer akzeptiert, von dem aus Sie ns im letzten Abschnitt ausführen? Paul vor 11 Jahren 0
Hallo Ivanov, bitte kreuzen Sie nicht zwischen den Seiten. Paul vor 11 Jahren 0
Hallo Paul. Ok, ich werde eine Antwort formulieren. vor 11 Jahren 0
Das ist also eine komplizierte Situation. Cross-Posting ist nicht zulässig, und jetzt haben wir das Problem, dass Ihre Frage und die Antwort darauf auf zwei verschiedene Websites aufgeteilt sind. Dies ist genau der Grund, warum wir nicht ermutigen, auf zwei Websites gleichzeitig zu veröffentlichen. Ich habe Ihre Antwort hier gelassen, aber können Sie Ihre Selbstantwort auf Unix.SE posten, wo sie hingehört? Vielen Dank! slhck vor 11 Jahren 0
Hi, slhck ♦! Ok, ich werde meine Antwort dort posten. Vielen Dank! vor 11 Jahren 0

2 Antworten auf die Frage

0
Vivek

From your log, its looks like you are running the display on the localhost only. My suggestion is to use the following export command:

% export DISPLAY=:0.0 

and try running it again. I use this same command on my Ubuntu 12.10 system and it works.

0
Keoma

Vergewissern Sie sich bei der Installation, dass Sie alle zum Erstellen erforderlichen Tools installiert haben. Ich hatte das gleiche Problem mit einer Ubuntu 10.04 und ich fand dieses .

Die Tools, die ich installiert habe:

  • autoconf
  • automake
  • gcc
  • g ++
  • Build-Essential
  • libxmu-dev
  • Libtool
  • libxt-dev

Ich habe sie alle mit apt-get install installiert und es hat funktioniert.

Viel Glück.