SOLA
Loading...
Searching...
No Matches
core_network.h
1// Copyright 2023 The SOLA authors
2//
3// This file is part of DAISI.
4//
5// DAISI is free software: you can redistribute it and/or modify it under the terms of the GNU
6// General Public License as published by the Free Software Foundation; version 2.
7//
8// DAISI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
9// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
10// Public License for more details.
11//
12// You should have received a copy of the GNU General Public License along with DAISI. If not, see
13// <https://www.gnu.org/licenses/>.
14//
15// SPDX-License-Identifier: GPL-2.0-only
16
17#ifndef DAISI_MANAGER_CORE_NETWORK_H_
18#define DAISI_MANAGER_CORE_NETWORK_H_
19
20#include <cstdint>
21#include <vector>
22
23#include "ns3/network-module.h"
24
25// Forward declarations for private members/methods
26namespace ns3 {
27class Ipv4InterfaceContainer;
28class CsmaHelper;
29} // namespace ns3
30
31namespace daisi {
32
35public:
37
38 void addNodesCSMA(ns3::NodeContainer nodes);
39
40 void addNodesWifi(ns3::NodeContainer nodes, double topology_width, double topology_height);
41
42private:
43 static void setGatewayForAppNodes(uint32_t number_of_subnets,
44 std::vector<ns3::Ipv4InterfaceContainer> ip_container);
45
46 ns3::CsmaHelper setupCSMA();
47
48 std::vector<ns3::Ipv4InterfaceContainer> installIP(
49 uint32_t number_of_subnets, ns3::NetDeviceContainer core_router_devices,
50 std::vector<ns3::NetDeviceContainer> app_node_devices, uint32_t &base_address);
51
52 ns3::Ptr<ns3::Node> core_router_ = ns3::CreateObject<ns3::Node>();
53 uint32_t next_base_address_csma_ = 16842752; // 1.1.0.0
54 uint32_t next_base_address_wifi_ = 3232235520; // 192.168.0.0
55};
56} // namespace daisi
57
58#endif
Network structure with one central L3 router, forming a star topology.
Definition core_network.h:34