How to Start Network on Chip Topology Projects Using NS3

Starting a Network-on-Chip (NoC) Topology Project in NS-3

To create the Network-on-Chip (NoC) is a transmission framework for multi-core processors, in which on-chip components such as cores, memory, and IO modules are interconnected utilized an architecture topology. Generally, NoC topologies has contains the mesh, torus, tree, and custom layouts.

Although NoC does not have a built-in module for NS-3 we can replicate this behaviour by modelling their NoC nodes as regular NS-3 nodes and describing their custom routing and communication mechanisms.

Steps to Start Network-on-Chip Topology Projects Using NS3

Step 1: Set Up NS-3

  1. Install NS-3:
    • Download NS-3.
    • Build NS-3:

./waf configure

./waf build

  1. Verify Installation: Test NS-3 using a basic script:

./waf –run scratch/my_first

Step 2: Understand NoC Topology

  • Characteristics:
    • On-chip communication network by structured topology.
    • Topologies: Mesh, Torus, Tree, Ring, or Custom.
    • It Supports the low-latency and high-throughput communication.
  • Components:
    • Nodes: Signify the cores of memory or other processing units.
    • Links: Characterize the communication connections such as buses or interconnects.

Step 3: Plan the Topology

  1. Select the topology:
    • Sample: A 4×4 mesh with 16 nodes.
  2. Define traffic patterns:
    • Communication among cores.
    • Evenly random traffic and hotspot traffic, or burst traffic.
  3. Set simulation goals:
    • Calculate their latency, throughput, and packet delivery ratio.

Step 4: Set Up the NoC Topology

  1. Create Nodes: Describe the NoC nodes.

NodeContainer nocNodes;

uint32_t numNodes = 16; // For a 4×4 mesh

nocNodes.Create(numNodes);

  1. Set Up Links: Connect nodes in the desired topology. For a mesh topology connects the node to their neighbours such as up, down, left, right.

PointToPointHelper p2p;

p2p.SetDeviceAttribute(“DataRate”, StringValue(“1Gbps”));

p2p.SetChannelAttribute(“Delay”, StringValue(“2ns”));

NetDeviceContainer devices;

uint32_t gridSize = 4; // For a 4×4 mesh

for (uint32_t i = 0; i < gridSize; ++i) {

for (uint32_t j = 0; j < gridSize; ++j) {

uint32_t current = i * gridSize + j;

// Connect to the right neighbor

if (j < gridSize – 1) {

uint32_t right = current + 1;

NetDeviceContainer link = p2p.Install(nocNodes.Get(current), nocNodes.Get(right));

devices.Add(link);

}

// Connect to the bottom neighbor

if (i < gridSize – 1) {

uint32_t bottom = current + gridSize;

NetDeviceContainer link = p2p.Install(nocNodes.Get(current), nocNodes.Get(bottom));

devices.Add(link);

}

}

}

  1. Install Internet Stack: Enhance the Internet stack for routing.

InternetStackHelper stack;

stack.Install(nocNodes);

Ipv4AddressHelper address;

address.SetBase(“10.1.1.0”, “255.255.255.0”);

Ipv4InterfaceContainer interfaces = address.Assign(devices);

  1. Set Up Routing: Utilized their static routing or a custom procedure to control data flow among nodes.

Ipv4StaticRoutingHelper staticRoutingHelper;

for (uint32_t i = 0; i < numNodes; ++i) {

Ptr<Node> node = nocNodes.Get(i);

Ptr<Ipv4StaticRouting> staticRouting = staticRoutingHelper.GetStaticRouting(node->GetObject<Ipv4>());

// Add static routes as needed

}

Step 5: Simulate Traffic

  1. Set Up Traffic Generators: Describe the traffic among NoC nodes.
    • UDP Echo Example:

UdpEchoServerHelper echoServer(9); // Port 9

ApplicationContainer serverApp = echoServer.Install(nocNodes.Get(0)); // Server on Node 0

serverApp.Start(Seconds(1.0));

serverApp.Stop(Seconds(10.0));

UdpEchoClientHelper echoClient(interfaces.GetAddress(0), 9); // Server’s IP

echoClient.SetAttribute(“MaxPackets”, UintegerValue(100));

echoClient.SetAttribute(“Interval”, TimeValue(Seconds(0.1)));

echoClient.SetAttribute(“PacketSize”, UintegerValue(512));

ApplicationContainer clientApp = echoClient.Install(nocNodes.Get(15)); // Client on Node 15

clientApp.Start(Seconds(2.0));

clientApp.Stop(Seconds(10.0))

Step 6: Run and Analyze

  1. Run the Simulation:

Simulator::Run();

Simulator::Destroy();

  1. Enable Packet Capture: Save .pcap files for traffic analysis.

p2p.EnablePcapAll(“noc_topology”);

  1. Use Flow Monitor: Calculate the  throughput, delay, and packet loss.

FlowMonitorHelper flowmon;

Ptr<FlowMonitor> monitor = flowmon.InstallAll();

monitor->SerializeToXmlFile(“noc_flowmon.xml”, true, true);

Example: Minimal NS-3 Script for NoC Topology

#include “ns3/core-module.h”

#include “ns3/network-module.h”

#include “ns3/internet-module.h”

#include “ns3/point-to-point-module.h”

#include “ns3/applications-module.h”

#include “ns3/flow-monitor-module.h”

using namespace ns3;

int main(int argc, char *argv[]) {

uint32_t gridSize = 4;

uint32_t numNodes = gridSize * gridSize;

// Create NoC nodes

NodeContainer nocNodes;

nocNodes.Create(numNodes);

// Configure point-to-point links

PointToPointHelper p2p;

p2p.SetDeviceAttribute(“DataRate”, StringValue(“1Gbps”));

p2p.SetChannelAttribute(“Delay”, StringValue(“2ns”));

NetDeviceContainer devices;

// Connect nodes in a 4×4 mesh

for (uint32_t i = 0; i < gridSize; ++i) {

for (uint32_t j = 0; j < gridSize; ++j) {

uint32_t current = i * gridSize + j;

// Connect to the right neighbor

if (j < gridSize – 1) {

uint32_t right = current + 1;

NetDeviceContainer link = p2p.Install(nocNodes.Get(current), nocNodes.Get(right));

devices.Add(link);

}

// Connect to the bottom neighbor

if (i < gridSize – 1) {

uint32_t bottom = current + gridSize;

NetDeviceContainer link = p2p.Install(nocNodes.Get(current), nocNodes.Get(bottom));

devices.Add(link);

}

}

}

// Install Internet stack

InternetStackHelper stack;

stack.Install(nocNodes);

Ipv4AddressHelper address;

address.SetBase(“10.1.1.0”, “255.255.255.0”);

Ipv4InterfaceContainer interfaces = address.Assign(devices);

// Set up traffic

UdpEchoServerHelper echoServer(9);

ApplicationContainer serverApp = echoServer.Install(nocNodes.Get(0)); // Server on Node 0

serverApp.Start(Seconds(1.0));

serverApp.Stop(Seconds(10.0));

UdpEchoClientHelper echoClient(interfaces.GetAddress(0), 9); // Server’s IP

echoClient.SetAttribute(“MaxPackets”, UintegerValue(100));

echoClient.SetAttribute(“Interval”, TimeValue(Seconds(0.1)));

echoClient.SetAttribute(“PacketSize”, UintegerValue(512));

ApplicationContainer clientApp = echoClient.Install(nocNodes.Get(15)); // Client on Node 15

clientApp.Start(Seconds(2.0));

clientApp.Stop(Seconds(10.0));

// Enable packet capture

p2p.EnablePcapAll(“noc_topology”);

// Run simulation

Simulator::Run();

Simulator::Destroy();

return 0;

}

Step 7: Enhance the Simulation

  • Dynamic Traffic Patterns:
    • Replicate the random traffic or hotspots.
  • Advanced Routing:
    • Execute the custom NoC routing procedures like as XY-routing, turn models, etc.
  • Visualize:
    • Utilized their NetAnim we show the NoC topology and data flow.
  • Analyze Performance:
    • Utilized their Flow Monitor we estimate the latency, throughput, and packet.

The given above is the fundamental approach that was illustrated with sample coding for Network-on-chip Topology project that were simulated across the NS3 environment. We plan to deliver more information regarding this project in further manual.

Our developers specialize in mesh, torus, tree, and custom layouts, so feel free to reach out for further assistance. Initiating a Network-on-Chip Topology Project using NS3 can be challenging, but at phdprojects.org, we provide tailored support whenever you require it. Just send us a message, and we will help you with the best simulations and topics.