How to Implement Heterogeneous Satellite Network in NS2
To implement a Heterogeneous Satellite Network within NS2 (Network Simulator 2), we require to replicate the network, which encompasses various kinds of satellites, like Low Earth Orbit (LEO), Medium Earth Orbit (MEO), and Geostationary Earth Orbit (GEO) satellites. These satellites have changing characteristics such as altitude, coverage area, communication delays, and mobility. This satellite networks are frequently used to combine the advantages of various satellite layers like low latency from LEO satellites and high coverage from the GEO satellites.
In this procedure, we will demonstrate how to model such a network within NS2 that has including setup the various satellite layers, connecting ground stations, and simulating communication among them.
Steps to Implement a Heterogeneous Satellite Network in NS2:
- Set up the Simulation Environment
Initially, describe the satellite nodes for the satellites LEO, MEO, and GEO. This satellites will connect to each other using the Inter-Satellite Links (ISL), and some satellite will connect to ground stations using the uplinks and downlinks.
Example TCL Script for Basic Setup:
# Create a simulator instance
set ns [new Simulator]
# Define link parameters for satellite communication
set bw_leo 1Gb ;# Bandwidth for LEO satellites
set bw_meo 500Mb ;# Bandwidth for MEO satellites
set bw_geo 100Mb ;# Bandwidth for GEO satellites
set delay_leo 20ms ;# Delay for LEO satellite communication
set delay_meo 50ms ;# Delay for MEO satellite communication
set delay_geo 200ms ;# Delay for GEO satellite communication
# Create satellite nodes
set leo1 [$ns node] ;# LEO satellite
set leo2 [$ns node]
set meo1 [$ns node] ;# MEO satellite
set meo2 [$ns node]
set geo1 [$ns node] ;# GEO satellite
set geo2 [$ns node]
# Create ground station nodes
set ground1 [$ns node] ;# Ground station 1
set ground2 [$ns node] ;# Ground station 2
# Connect LEO satellites with Inter-Satellite Links (ISL)
$ns duplex-link $leo1 $leo2 $bw_leo $delay_leo DropTail
# Connect MEO satellites with ISL
$ns duplex-link $meo1 $meo2 $bw_meo $delay_meo DropTail
# Connect GEO satellites with ISL
$ns duplex-link $geo1 $geo2 $bw_geo $delay_geo DropTail
# Connect LEO satellites to MEO satellites
$ns duplex-link $leo1 $meo1 $bw_meo $delay_meo DropTail
$ns duplex-link $leo2 $meo2 $bw_meo $delay_meo DropTail
# Connect MEO satellites to GEO satellites
$ns duplex-link $meo1 $geo1 $bw_geo $delay_geo DropTail
$ns duplex-link $meo2 $geo2 $bw_geo $delay_geo DropTail
# Connect ground stations to the satellites
$ns duplex-link $ground1 $leo1 $bw_leo $delay_leo DropTail ;# Ground station 1 connected to LEO
$ns duplex-link $ground2 $geo1 $bw_geo $delay_geo DropTail ;# Ground station 2 connected to GEO
This script configures the simple topology of a heterogeneous satellite network, containing the satellites like LEO, MEO, and GEO, including inter-satellite links (ISL) connecting satellites over the layers, and ground stations connected to satellites.
- Define Satellite Mobility
As LEO and MEO satellites are move relative to the Earth, we can replicate their orbital motion with the help of a mobility model in NS2. GEO satellites are deliberated stationary relative to the Earth.
Example of Defining Satellite Mobility:
# Set initial positions for LEO, MEO, and GEO satellites
$leo1 set X_ 0
$leo1 set Y_ 1000
$leo2 set X_ 500
$leo2 set Y_ 1000
$meo1 set X_ 1000
$meo1 set Y_ 2000
$meo2 set X_ 1500
$meo2 set Y_ 2000
$geo1 set X_ 2000
$geo1 set Y_ 36000
$geo2 set X_ 2500
$geo2 set Y_ 36000
# Simulate satellite movement (circular orbit for LEO and MEO)
$ns at 1.0 “$leo1 setdest 200 1000 10”
$ns at 2.0 “$leo2 setdest 700 1000 10”
$ns at 3.0 “$meo1 setdest 1200 2000 5”
$ns at 4.0 “$meo2 setdest 1700 2000 5”
- LEO satellites are in low Earth orbit and move more rapidly, therefore the mobility model sets their speed to 10 m/s in the instance.
- MEO satellites are move slower than LEO satellites and its cover higher heights.
- GEO satellites are stationary, so there is no require to describe the mobility for them.
- Configure Traffic between Ground Stations and Satellites
To replicate the communication among ground stations via the satellite network, and configure the UDP or TCP agents including CBR (Constant Bit Rate) traffic. It will mimic the data flows from one ground station to another through the satellite network.
Example of Creating Traffic between Ground Stations:
# Create UDP agent for ground station 1 (uplink to satellite)
set udp_ground1 [new Agent/UDP]
$ns attach-agent $ground1 $udp_ground1
# Create CBR traffic generator for ground station 1
set cbr_ground1 [new Application/Traffic/CBR]
$cbr_ground1 set packet_size_ 1000
$cbr_ground1 set rate_ 500Kb
$cbr_ground1 attach-agent $udp_ground1
# Create UDP sink for ground station 2 (downlink from satellite)
set null_ground2 [new Agent/Null]
$ns attach-agent $ground2 $null_ground2
# Connect ground station 1 to ground station 2 via the satellite network
$ns connect $udp_ground1 $null_ground2
# Start and stop the traffic
$ns at 1.0 “$cbr_ground1 start”
$ns at 10.0 “$cbr_ground1 stop”
In this setup:
- Ground station 1 transfers the data to ground station 2 through the satellite network.
- The traffic is routed via LEO, MEO, or GEO satellites based on the defined topology.
- Dynamic Routing Between Satellites
In a heterogeneous satellite network, we require to handle the routing of traffic between satellites actively, which particularly as LEO and MEO satellites move. AODV (Ad hoc On-Demand Distance Vector) or same routing protocols can be used to permit the dynamic routing among satellites.
Example of Using AODV for Routing:
# Enable AODV routing protocol
set val(rp) AODV
# Attach AODV routing protocol to all satellite nodes
for {set i 1} {$i <= 6} {incr i} {
set sat [set satellite($i)]
$ns at 0.0 “$sat set ragent [new Agent/AODV]”
}
In this instance, the AODV protocol is allowed on all satellites to find the routes actively as the topology alters because of the movement of LEO and MEO satellites.
- Monitor and Trace the Simulation
Allow tracing to observe how the heterogeneous satellite network acts such as packet delivery, delay, and routing changes.
Enable Trace Files:
# Enable tracing for the simulation
set tracefile [open “heterogeneous_satellite_trace.tr” w]
$ns trace-all $tracefile
# Define a finish procedure to end the simulation and close the trace file
proc finish {} {
global ns tracefile
$ns flush-trace
close $tracefile
exit 0
}
# Set the simulation end time
$ns at 20.0 “finish”
The trace file will capture the packet transmissions, routing updates, and satellite handover events that permit to evaluate the behaviour of the heterogeneous satellite network.
- Run the Simulation
Run the simulation to monitor the performance of the heterogeneous satellite network as data is routed via LEO, MEO, and GEO satellites.
# Run the simulation
$ns run
Example Complete TCL Script for Heterogeneous Satellite Network Simulation
# Create a simulator instance
set ns [new Simulator]
# Define link parameters for satellite communication
set bw_leo 1Gb
set bw_meo 500Mb
set bw_geo 100Mb
set delay_leo 20ms
set delay_meo 50ms
set delay_geo 200ms
# Create satellite nodes
set leo1 [$ns node]
set leo2 [$ns node]
set meo1 [$ns node]
set meo2 [$ns node]
set geo1 [$ns node]
set geo2 [$ns node]
# Create ground station nodes
set ground1 [$ns node]
set ground2 [$ns node]
# Connect LEO satellites with ISL
$ns duplex-link $leo1 $leo2 $bw_leo $delay_leo DropTail
# Connect MEO satellites with ISL
$ns duplex-link $meo1 $meo2 $bw_meo $delay_meo DropTail
# Connect GEO satellites with ISL
$ns duplex-link $geo1 $geo2 $bw_geo $delay_geo DropTail
# Connect LEO satellites to MEO satellites
$ns duplex-link $leo1 $meo1 $bw_meo $delay_meo DropTail
$ns duplex-link $leo2 $meo2 $bw_meo $delay_meo DropTail
# Connect MEO satellites to GEO satellites
$ns duplex-link $meo1 $geo1 $bw_geo $delay_geo DropTail
$ns duplex-link $meo2 $geo2 $bw_geo $delay_geo DropTail
# Connect ground stations to the satellites
$ns duplex-link $ground1 $leo1 $bw_leo $delay_leo DropTail
$ns duplex-link $ground2 $geo1 $bw_geo $delay_geo DropTail
# Set initial positions for LEO, MEO, and GEO satellites
$leo1 set X_ 0
$leo1 set Y_ 1000
$leo2 set X_ 500
$leo2 set Y_ 1000
$meo1 set X_ 1000
$meo1 set Y_ 2000
$meo2 set X_ 1500
$meo2 set Y_ 2000
$geo1 set X_ 2000
$geo1 set Y_ 36000
$geo2 set X_ 2500
$geo2 set Y_ 36000
# Simulate satellite movement (for LEO and MEO)
$ns at 1.0 “$leo1 setdest 200 1000 10”
$ns at 2.0 “$leo2 setdest 700 1000 10”
$ns at 3.0 “$meo1 setdest 1200 2000 5”
$ns at 4.0 “$meo2 setdest 1700 2000 5”
# Create UDP agent for ground station 1 (uplink to satellite)
set udp_ground1 [new Agent/UDP]
$ns attach-agent $ground1 $udp_ground1
# Create CBR traffic generator for ground station 1
set cbr_ground1 [new Application/Traffic/CBR]
$cbr_ground1 set packet_size_ 1000
$cbr_ground1 set rate_ 500Kb
$cbr_ground1 attach-agent $udp_ground1
# Create UDP sink for ground station 2 (downlink from satellite)
set null_ground2 [new Agent/Null]
$ns attach-agent $ground2 $null_ground2
# Connect ground station 1 to ground station 2 via the satellite network
$ns connect $udp_ground1 $null_ground2
# Start and stop the traffic
$ns at 1.0 “$cbr_ground1 start”
$ns at 10.0 “$cbr_ground1 stop”
# Enable AODV routing protocol on satellites
set val(rp) AODV
for {set i 1} {$i <= 6} {incr i} {
set sat [set satellite($i)]
$ns at 0.0 “$sat set ragent [new Agent/AODV]”
}
# Enable tracing
set tracefile [open “heterogeneous_satellite_trace.tr” w]
$ns trace-all $tracefile
# End simulation
$ns at 20.0 “finish”
proc finish {} {
global ns tracefile
$ns flush-trace
close $tracefile
exit 0
}
# Run the simulation
$ns run
Finally, this approaches will walk you via the comprehensive implementation and replication process of Heterogeneous satellite network including their example coding using ns2 tool. We will also offer the extra information on this satellite network or their advanced feature attachments, if you needed for the future enhancements.
For the best implementation outcomes in your projects, get in touch with ns2project.com. In relation to your projects, we connect ground stations and simulate communication between them by working on different satellite layers.