# Simple Representation of Teledesic Network Connection # Modeled as an RF LAN # Copyright 1998 Minerva Engineering, LLC ##################################### # INSERT DESCRIPTION AND SUCH HERE ##################################### # This is going to be a representation of 2 UE's connecting # over the Teledesic Network. Each UE will connect to an # SV with 2 simplex links. ##################################### ##################################### # First we need to set up some base line variables and definitions # # satBW Bandwidth of constellation internal links. # satDelay Delay for constellation internal links. # # ue_BWup Bandwidth of UE uplink # ue_Delayup Delay of UE uplink # ue_BWdn Bandwidth of UE downlink # ue_Delaydn Delay of UE downlink # ##################################### set satBW 4000Mb set satDelay 1us set ue_Delayup 2ms set ue_Delaydn 2ms ##################################### # TCP related settings # # packetSize_: size of a TCP packet # window_: size of the sliding window # 45 = 65KB # ##################################### Agent/TCP set packetSize_ 1500 Agent/TCP set window_ 45 ##################################### # Traffic related settings # # UE_traffic ammount of traffic generated at # each UE. In this case, the size of the FTP # Transfer. ##################################### set numBytesFTP 537000 ##################################### # Misc Settings # # doNam: Create a nam file? # sim_end: End time of simulation (in seconds) # ##################################### set doNam true set sim_end 45 ##################################### # Here we go!! # Create the new simulator object. # This object is needed for almost every other # function. ##################################### set ns [new Simulator] ##################################### # Nam Setup ##################################### if {$doNam} { $ns color 0 black $ns color 1 red $ns color 2 blue $ns color 3 green $ns color 4 yellow $ns color 5 white $ns color 6 cyan $ns color 7 magenta $ns color 8 pink $ns color 28 purple $ns color 29 orange set nf [open RF_LAN.nam w] $ns namtrace-all $nf } # Open the file for output of nam trace data set nf [open RF_LAN.nam w] $ns namtrace-all $nf ##################################### # Enter the 2 stations to represent the UEs ##################################### set UE_1 [$ns node] set UE_1 [$ns node] ##################################### # Enter the 2 stations to represent the SVs ##################################### set SV_1 [$ns node] set SV_2 [$ns node] #################################### # Create SV Network #################################### $ns duplex-link $SV_1 $SV_2 $satBW $satDelay DropTail #################################### # Create UE Links, 1 pair of simplex links per UE Connection #################################### $ns simplex-link $UE_1 $SV_1 3Mb $ue_Delayup DropTail $ns simplex-link $SV_1 $UE_1 3Mb $ue_Delaydn DropTail $ns simplex-link $UE_2 $SV_2 3Mb $ue_Delaydn DropTail $ns simplex-link $SV_2 $UE_2 3Mb $ue_Delaydn DropTail ######################################## # Set up an FTP transfer to and from each # UE. Each UE needs a TCP and FTP Agent # and an associated TCP sink. ######################################## # UE TCP Processes # Reno TCP Agent @ UE_1 # Assigned Flow Id 1 set tcp_1 [new Agent/TCP/Reno] $ns attach-agent $UE_1 $tcp_1 $tcp_1 set fid_ 1 # Reno TCP Agent @ UE_2 # Assigned Flow Id 2 set tcp_2 [new Agent/TCP/Reno] $ns attach-agent $UE_2 $tcp_2 $tcp_2 set fid_ 2 # UE TCP Sinks # The sink @ UE_1 set Tsink_1 [new Agent/TCPSink] $ns attach-agent $UE_1 $Tsink_1 # The sink @ UE_2 set Tsink_2 [new Agent/TCPSink] $ns attach-agent $UE_2 $Tsink_2 # Create Traffic Applications # FTP Agent # Attached to TCP @ UE_1 set ftp_1 [new Application/FTP] $ftp_1 attach-agent $tcp_1 # FTP Agent # Attached to TCP @ UE_2 set ftp_2 [new Application/FTP] $ftp_2 attach-agent $tcp_2 # make connections # TCP @ UE_1 connects to TCP sink @ UE_2 $ns connect $tcp_1 $Tsink_2 # TCP @ UE_2 connects to TCP sink @ UE_1 $ns connect $tcp_2 $Tsink_1 #start transmissions at .1 and .5 seconds $ns at 0.1 "$ftp_1 send $numBytesFTP" $ns at 0.5 "$ftp_2 send $numBytesFTP" # Finish up, close out the trace file and start nam proc finish {} { global ns nf $ns flush-trace close $nf exec nam RF_LAN.nam & exit 0 } ##################################### # Run the sim, then execute 'finish'. ##################################### $ns at $sim_end "finish" ##################################### # Actually run the sim. ##################################### $ns run