forked from cisco/ns3-rmcat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtopo.h
134 lines (120 loc) · 5.54 KB
/
topo.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/******************************************************************************
* Copyright 2016-2017 Cisco Systems, Inc. *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* *
* You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an "AS IS" BASIS, *
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
* See the License for the specific language governing permissions and *
* limitations under the License. *
******************************************************************************/
/**
* @file
* Common network topology setup for rmcat ns3 module.
*
* @version 0.1.1
* @author Jiantao Fu
* @author Sergio Mena
* @author Xiaoqing Zhu
*/
#ifndef TOPO_H
#define TOPO_H
#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/internet-apps-module.h"
#include "ns3/ipv4-global-routing-helper.h"
#include "ns3/internet-trace-helper.h"
#include "ns3/mobility-module.h"
#include "ns3/stats-module.h"
#include "ns3/wifi-module.h"
#include "ns3/traffic-control-helper.h"
#include "ns3/rmcat-constants.h"
namespace ns3 {
class Topo
{
protected:
/**
* Install two applications (sender and receiver) implementing a TCP flow.
* The sender of application data (resp. receiver) will be installed at the
* sender (resp. receiver) node.
*
* @param [in] flowId A string denoting the flow's id. Useful for
* logging and plotting
* @param [in,out] sender ns3 node that is to contain the sender bulk TCP
* application
* @param [in,out] receiver ns3 node that is to contain the receiver bulk
* TCP application
* @param [in] serverPort TCP port where the server application is
* to listen
*
* @retval A container with the two applications (sender and receiver)
*
*/
static ApplicationContainer InstallTCP (const std::string& flowId,
Ptr<Node> sender,
Ptr<Node> receiver,
uint16_t serverPort);
/**
* Install two applications (sender and receiver) implementing a constant
* bitrate (CBR) flow over UDP.
* The sender of application data (resp. receiver) will be installed at the
* sender (resp. receiver) node.
*
* @param [in,out] sender ns3 node that is to contain the sender CBR UDP
* application
* @param [in,out] receiver ns3 node that is to contain the receiver CBR
* UDP application
* @param [in] serverPort UDP port where the receiver application is
* to read datagrams
* @param [in] bitrate Bitrate (constant) at which the flow is to
* operate
* @param [in] packetSize Size of of the data to be shipped in each
* datagram
*
* @retval A container with the two applications (sender and receiver)
*
*/
static ApplicationContainer InstallCBR (Ptr<Node> sender,
Ptr<Node> receiver,
uint16_t serverPort,
uint64_t bitrate,
uint32_t packetSize = DEFAULT_PACKET_SIZE);
/**
* Install two applications (sender and receiver) implementing an RMCAT
* flow.
* The sender of application data (resp. receiver) will be installed at the
* sender (resp. receiver) node.
*
* @param [in] flowId A string denoting the flow's id. Useful for
* logging and plotting
* @param [in,out] sender ns3 node that is to contain the #RmcatSender
* application
* @param [in,out] receiver ns3 node that is to contain the #RmcatReceiver
* application
* @param [in] serverPort UDP port where the receiver application is
* to read media packets
*
* @retval A container with the two applications (sender and receiver)
*/
static ApplicationContainer InstallRMCAT (const std::string& flowId,
Ptr<Node> sender,
Ptr<Node> receiver,
uint16_t serverPort);
/**
* Simple logging callback to be passed to the congestion controller
*
* @param [in] msg Message that the congestion controller wants to log
*/
static void logFromController (const std::string& msg);
};
}
#endif /* TOPO_H */