Theme begins here - https://superuser.com/questions/525110/installing-network-simulator-ns-2-allinone-on-linux-mandrivaThere is a certain emulator- NS-2.It can be used to describe the network topology, configuration of source and destination of traffic, all connection parameters (bandwidth, delay, packet loss probability, and many other parameters of the simulated system).I installed it on Linux Mandriva 2008 and it works.But I not possible to achieve visualization -this is due with Xorg.I'm trying to implement a simple example (I repeat the code again) -ns-simple.tcl:#Create a simulator objectset ns [new Simulator]#Define different colors for data flows (for NAM)$ns color 1 Blue$ns color 2 Red#Open the NAM trace fileset nf [open out.nam w]$ns namtrace-all $nf#Define a 'finish' procedureproc 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 nodesset 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 connectionset tcp [new Agent/TCP]$tcp set class_ 2$ns attach-agent $n0 $tcpset sink [new Agent/TCPSink]$ns attach-agent $n3 $sink$ns connect $tcp $sink$tcp set fid_ 1#Setup a FTP over TCP connectionset ftp [new Application/FTP]$ftp attach-agent $tcp$ftp set type_ FTP#Setup a UDP connectionset udp [new Agent/UDP]$ns attach-agent $n1 $udpset null [new Agent/Null]$ns attach-agent $n3 $null$ns connect $udp $nullBut I get error message.[root@localhost ...]# startx -- :1xauth:  creating new authority file /root/.serverauth.20336X Window System Version 1.3.0Release Date: 19 April 2007X Protocol Version 11, Revision 0, Release 1.3Build Operating System: Linux_2.6.12-12mdksmp MandrivaCurrent Operating System: Linux localhost 2.6.22.9-desktop-1mdv #1 SMP Thu Sep 27 04:07:04 CEST 2007 i686Build Date: 01 October 2007        Before reporting problems, check http://wiki.x.org        to make sure that you have the latest version.Module Loader presentMarkers: (--) probed, (**) from config file, (==) default setting,        (++) from command line, (!!) notice, (II) informational,        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.(==) Log file: /var/log/Xorg.1.log, Time: Sat Dec 29 18:59:34 2012(==) Using config file: /etc/X11/xorg.confUsing vt 8(**) RADEON(0): RADEONPreInit(II) Module already built-in(II) Module already built-in(II) Module already built-in(**) RADEON(0): RADEONScreenInit d0000000 0(**) RADEON(0): Map: 0xd0000000, 0x01000000(**) RADEON(0): RADEONSave(**) RADEON(0): RADEONSaveMode(0x823a6a0)(**) RADEON(0): Read: 0x00000006 0x00030047 0x00000000(**) RADEON(0): Read: rd=6, fd=71, pd=3(**) RADEON(0): RADEONSaveMode returns 0x823a6a0(**) RADEON(0): RADEONInitMemoryMap() :(**) RADEON(0):   mem_size         : 0x04000000(**) RADEON(0):   MC_FB_LOCATION   : 0xd3ffd000(**) RADEON(0):   MC_AGP_LOCATION  : 0xffffffc0(**) RADEON(0): RADEONModeInit()1024x768       78.75  1024 1040 1136 1312   768  769  772  800 (16,16) +H +V1024x768       78.75  1024 1040 1136 1312   768  769  772  800 (16,16) +H +V(**) RADEON(0): Pitch = 8388736 bytes (virtualX = 1024, displayWidth = 1024)(**) RADEON(0): dc=7875, of=15750, fd=350, pd=2(**) RADEON(0): RADEONInit returns 0x823b050(**) RADEON(0): RADEONRestoreMode()(**) RADEON(0): RADEONRestoreMemMapRegisters() :(**) RADEON(0):   MC_FB_LOCATION   : 0xd3ffd000(**) RADEON(0):   MC_AGP_LOCATION  : 0xffffffc0(**) RADEON(0):   Map Changed ! Applying ...(**) RADEON(0):   Map applied, resetting engine ...(**) RADEON(0): Updating display base addresses...(**) RADEON(0): Memory map updated.(**) RADEON(0): Programming CRTC1, offset: 0x00000000(**) RADEON(0): Wrote: 0x0000003c 0x0001015e 0x00000000 (0x0000bf00)(**) RADEON(0): Wrote: rd=60, fd=350, pd=1(**) RADEON(0): GRPH_BUFFER_CNTL from 20005c5c to 20055c5c(**) RADEON(0): RADEONSaveScreen(0)(**) RADEON(0): Setting up initial surfaces(**) RADEON(0): Initializing fb layer(**) RADEON(0): Setting up accel memmap(**) RADEON(0): Initializing backing store(**) RADEON(0): Setting up final surfaces(**) RADEON(0): Initializing Acceleration(**) RADEON(0): EngineInit (16/16)(**) RADEON(0): Pitch for acceleration = 128(**) RADEON(0): EngineRestore (16/16)(**) RADEON(0): Initializing DPMS(**) RADEON(0): Initializing Cursor(**) RADEON(0): Initializing color map(**) RADEON(0): Initializing DGA(**) RADEON(0): Initializing Xv(**) RADEON(0): RADEONScreenInit finished(EE) AIGLX: Screen 0 is not DRI capable(**) RADEON(0): RADEONSaveScreen(2)Run ns:[root@localhost ...]# export DISPLAY=localhost:1[root@localhost ...]# ns ns-simple.tclCBR packet size = 1000CBR interval = 0.0080000000000000002[root@localhost ...]# **nam: couldn't connect to display localhost:1**I tried to rebuild the nam, as they say here, my remote-create-animator function looks like this -AnimControl instproc remote-create-animator {trace_file args} {    catch array set opts $args    AnimControl instvar PORT_FILE_    if [catch {set f [open $PORT_FILE_ RDONLY]}] {        error Cannot read server port from $PORT_FILE_    }    set port [read $f]    close $f        puts -nonewline Cannot connect to existing nam instance.     puts Starting a new one...    $self local-create-animator $trace_file [join $args]    #if [catch {set sock [socket localhost $port]}] {    #   puts -nonewline Cannot connect to existing nam instance.     #   puts Starting a new one...    #   $self local-create-animator $trace_file [join $args]    #} else {    #   if {$trace_file == } {    # puts A nam instance already exists. Use nam <trace file> to view an animation    #       close $sock    #   } else {    #   global tcl_platform    #   if {$tcl_platform(platform) == windows} {    #       if [regexp {^(\\\\|[A-Za-z]:[/\\])} $trace_file] {    #           set tf $trace_file  ;# Absolute pathname    #       } else {    #           set tf [pwd]/$trace_file    ;# Relative pathname    #       }    #   } else {    #       if [regexp {^[~/]} $trace_file] {    #           set tf $trace_file  ;# Absolute pathname    #       } else {    #           set tf [pwd]/$trace_file ;# Relative pathname    #       }    #   }    #   puts $sock CA $tf [join $args]    #   flush $sock    #   close $sock    #   }    #}}But nothing has changed. Message now is - Cannot connect to existing nam instance. Starting a new one...And all ..How to get the picture? I would be very grateful for the information!Thanks!
Network Simulator NS-2 in Linux Mandriva 2008 - nam error: Cannot connect to existing nam instance
networking;x11
It has been a long time since I used NS2, but if I recall correctly you may have a problem with tunneling your X11.Are you using SSH to connect to the linux server running the NS2?Try typing xclock and see if you can see the clock...You need to enable tunneling on whatever program you are using to SSH.If you use putty it is just a matter of ticking the tunneling under X11You should also make sure your Xserver is running (I personally use Xming).