How to Calculate Network Fronthaul Efficiency in NS2

To calculate Network Fronthaul Efficiency using NS2 which is essential parameter in wireless communication systems, especially in architectures such as Cloud Radio Access Networks (C-RAN), in which the fronthaul is responsible for sending data among the Remote Radio Heads (RRHs) and the Baseband Unit (BBU) pool. The network Fronthaul efficiency is calculates how successfully the obtainable fronthaul resources (such as bandwidth) are used for data transmission among RRHs and the central unit.

In NS2, we can compute the fronthaul efficiency rely on metrics like:

  1. Throughput: The amount of data successfully sent across the fronthaul link.
  2. Bandwidth: The total obtainable bandwidth of the fronthaul link.

Fronthaul efficiency can be described as the ratio of the actual data rate (throughput) to the maximum possible data rate (based on bandwidth), normally calculated in bps/Hz (bits per second per Hertz).

Fronthaul Efficiency=Throughput (bps)Bandwidth (Hz)\text{Fronthaul Efficiency} = \frac{\text{Throughput (bps)}}{\text{Bandwidth (Hz)}}Fronthaul Efficiency=Bandwidth (Hz)Throughput (bps)​

Steps to Calculate Network Fronthaul Efficiency in NS2

  1. Set up the Fronthaul Link

In the simulation platform NS2, the fronthaul can model as a high-capacity wired or wireless link among the Remote Radio Heads (RRHs) and the Baseband Unit (BBU).

For a wired fronthaul, we can setup a high-capacity duplex link:

# Create a duplex link between RRH and BBU with high bandwidth and low delay

$ns duplex-link $node_rrh $node_bbu 10Gb 0.1ms DropTail

For a wireless fronthaul, we could be configured a wireless channel among the RRHs and BBUs with particular PHY parameters like bandwidth and transmission power:

# Wireless channel setup with 20 MHz bandwidth

set val(bw) 20e6  ;# 20 MHz = 20e6 Hz

set val(chan) Channel/WirelessChannel

set val(netif) Phy/WirelessPhy

  1. Generate the Trace File

Make certain NS2 simulation generates a trace file, which logs packet transmissions, receptions, and other key events. This trace file will be supported to estimate the throughput across the fronthaul link.

Append the following to the NS2 script to enable trace generation:

set tracefile [open out.tr w]

$ns trace-all $tracefile

The trace file will encompass lines like this:

r 0.45678 1 0 tcp 1040 ——- [0 1 0 0] ——- [0:0 1:0 32 0] [0] 0 0

Here:

  • r: Packet received.
  • 0.45678: Time of the event.
  • 1040: Packet size in bytes.
  1. Calculate Throughput Over the Fronthaul

To compute the throughput, add the size of all packets effectively sent over the fronthaul link and divide by the total simulation time.

AWK Script to Calculate Throughput:

awk ‘{

if ($1 == “r” && $4 == “tcp”) {  # Count only received TCP packets over the fronthaul

total_bytes += $6;  # $6 is the packet size in bytes

}

} END {

simulation_time = 100.0;  # Replace with actual simulation time in seconds

throughput_bps = total_bytes * 8 / simulation_time;  # Convert bytes to bits

print “Throughput: ” throughput_bps ” bps”;

}’ out.tr

This script:

  • Counts the total number of bytes received over the fronthaul.
  • Converts the total bytes to bits by multiplying by 8.
  • Divides by the simulation time to estimate the throughput in bits per second (bps).
  1. Determine the Fronthaul Bandwidth

The fronthaul bandwidth is normally predefined in the simulation script. For a wired link, it might be set in the duplex-link command (e.g., 10Gb), but for a wireless link, it is stipulated as part of the PHY configuration (e.g., 20 MHz = 20e6 Hz).

For example, if the fronthaul bandwidth is 20 MHz, then:

Bandwidth=20×106 Hz\text{Bandwidth} = 20 \times 10^6 \text{ Hz}Bandwidth=20×106 Hz

Make sure that we understand the bandwidth of the fronthaul link, as it will use to estimate the efficiency.

  1. Calculate Fronthaul Efficiency

When we have the throughput (from the AWK script) and the fronthaul bandwidth then we can be estimated the fronthaul efficiency using the below formula:

Fronthaul Efficiency=Throughput (bps)Bandwidth (Hz)\text{Fronthaul Efficiency} = \frac{\text{Throughput (bps)}}{\text{Bandwidth (Hz)}}Fronthaul Efficiency=Bandwidth (Hz)Throughput (bps)​

AWK Script to Calculate Fronthaul Efficiency:

awk ‘{

if ($1 == “r” && $4 == “tcp”) {  # Only consider received TCP packets

total_bytes += $6;  # $6 is the packet size in bytes

}

} END {

simulation_time = 100.0;  # Replace with actual simulation time in seconds

fronthaul_bandwidth_hz = 20e6;  # Fronthaul bandwidth in Hz (e.g., 20 MHz = 20e6 Hz)

 

throughput_bps = total_bytes * 8 / simulation_time;  # Convert bytes to bits

fronthaul_efficiency = throughput_bps / fronthaul_bandwidth_hz;  # Efficiency in bps/Hz

print “Throughput: ” throughput_bps ” bps”;

print “Fronthaul Efficiency: ” fronthaul_efficiency ” bps/Hz”;

}’ out.tr

This script:

  • Computes the throughput in bps.
  • Divides the throughput by the fronthaul bandwidth to estimate the fronthaul efficiency in bps/Hz.
  1. Interpret the Results

If the throughput is 10 Mbps and the bandwidth is 20 MHz then the fronthaul efficiency will be:

Fronthaul Efficiency=10×10620×106=0.5 bps/Hz\text{Fronthaul Efficiency} = \frac{10 \times 10^6}{20 \times 10^6} = 0.5 \, \text{bps/Hz}Fronthaul Efficiency=20×10610×106​=0.5bps/Hz

It means the network is using 0.5 bits per second for every Hertz of bandwidth obtainable on the fronthaul link.

  1. Monitor Fronthaul Performance over Time

Also we can be traced the fronthaul efficiency over time by computing the throughput in smaller time intervals (e.g., every 1 second) and dividing it by the bandwidth to monitor variations in efficiency throughout the simulation.

AWK Script for Time-Windowed Fronthaul Efficiency:

awk ‘{

if ($1 == “r” && $4 == “tcp”) {

interval = int($2);  # Group events by time intervals (in seconds)

packet_count[interval] += $6;  # Sum packet sizes in bytes

}

} END {

fronthaul_bandwidth_hz = 20e6;  # Bandwidth in Hz (e.g., 20 MHz = 20e6 Hz)

for (interval in packet_count) {

throughput_bps = packet_count[interval] * 8;  # Convert bytes to bits

fronthaul_efficiency = throughput_bps / fronthaul_bandwidth_hz;  # Efficiency in bps/Hz

print “Time Interval: ” interval ” s, Fronthaul Efficiency: ” fronthaul_efficiency ” bps/Hz”;

}

}’ out.tr

This script will print the fronthaul efficiency for every time interval (e.g., per second), permitting to monitor how the efficiency alters over time.

In this simulation scenario, we acquire the concepts and the simplified procedure on how to calculate and estimate the Network Fronthaul efficiency using NS2 tool. Furthermore, if you require more details, we will be presented.

If you need information on Network Fronthaul Efficiency projects using the NS2 tool, don’t hesitate to reach out. We have all the necessary resources to assist you. Our team can provide you with excellent project ideas and topics. Just share your parameter details with us, and we will offer you the best comparative analysis support.