5G-LENA nr-v4.0
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
xr-traffic-mixer-helper.h
1// Copyright (c) 2022 CTTC
2// Copyright (c) 2023 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3//
4// SPDX-License-Identifier: GPL-2.0-only
5
6#ifndef XR_TRAFFIC_MIXER_HELPER_H
7#define XR_TRAFFIC_MIXER_HELPER_H
8
9#include "traffic-generator-helper.h"
10
11#include "ns3/address.h"
12#include "ns3/application-container.h"
13#include "ns3/application.h"
14#include "ns3/node-container.h"
15#include "ns3/node.h"
16#include "ns3/ptr.h"
17#include "ns3/traffic-generator-3gpp-audio-data.h"
18#include "ns3/traffic-generator-3gpp-generic-video.h"
19#include "ns3/traffic-generator-3gpp-pose-control.h"
20#include "ns3/traffic-generator-ngmn-video.h"
21#include "ns3/traffic-generator-ngmn-voip.h"
22#include "ns3/traffic-generator.h"
23
24#include <list>
25#include <map>
26
27namespace ns3
28{
29
33enum NrXrConfig
34{
35 AR_M3, // AR Model 3
36 AR_M3_V2, // AR Model 3 that is using NGMN video instead of 3GPP video
37 VR_DL1, // VR 1 stream
38 VR_DL2, // VR 2 streams
39 VR_UL, // VR uplink
40 CG_DL1, // CG DL 1 stream
41 CG_DL2, // CG UL 1 stream
42 CG_UL, // CG UL 1 stream
43 NGMN_VOICE
44}; // NGMN voip
48enum NrXrConfig GetXrTrafficType(const std::string& item);
52std::string GetXrTrafficName(const NrXrConfig& item);
53
57static inline std::istream&
58operator>>(std::istream& is, NrXrConfig& item)
59{
60 std::string inputValue;
61 is >> inputValue;
62 item = GetXrTrafficType(inputValue);
63 return is;
64}
65
69static inline std::ostream&
70operator<<(std::ostream& os, const NrXrConfig& item)
71{
72 os << GetXrTrafficName(item);
73 return os;
74}
75
76extern const std::map<NrXrConfig, std::list<TypeId>> XrPreconfig;
77
84class XrTrafficMixerHelper : public Object
85{
86 public:
91 static TypeId GetTypeId();
93 ~XrTrafficMixerHelper() override;
94 /*
95 * @brief Adds a stream of provided TypeId
96 * @param trafficGenerator specifies the type ID of a stream to be added to a mixed traffic flow
97 */
98 void AddStream(TypeId trafficGenerator);
99
100 /*
101 * @brief Configures the configured XR traffic
102 * @param xrTrafficType the XR traffic type to be configured
103 */
104 void ConfigureXr(NrXrConfig xrTrafficType);
105
106 /*
107 * @brief Configures the stream mixtures of the traffic types added by
108 * function AddStream.
109 * @param transportProtocol the transport protocol to be configured
110 * @param remoteAddresses the vector of the remote address values toward which will be sent the
111 * generated data \param trafficGeneratorNode the traffic generator node container \return the
112 * container of the newly created traffic generator applications
113 */
114 ApplicationContainer Install(std::string transportProtocol,
115 std::vector<Address>& remoteAddresses,
116 Ptr<Node> trafficGeneratorNode);
117
118 private:
119 std::list<TypeId> m_trafficStreams;
120};
121
122} // namespace ns3
123
124#endif /* XR_TRAFFIC_MIXER_HELPER_H */
static TypeId GetTypeId()
Get the type ID.