29 m_s5uSocket(s5uSocket),
30 m_s5cSocket(s5cSocket),
31 m_s1uSocket(s1uSocket),
99 packet->PeekHeader(header);
133 packet->RemoveHeader(gtpu);
148 packet->PeekHeader(header);
178 packet->RemoveHeader(gtpu);
194 packet->AddHeader(gtpu);
208 packet->AddHeader(gtpu);
222 packet->RemoveHeader(msg);
241 sgwS5cFteid.
teid = imsi;
246 std::list<GtpcCreateSessionRequestMessage::BearerContextToBeCreated> bearerContexts =
248 NS_LOG_DEBUG(
"BearerContextToBeCreated size = " << bearerContexts.size());
249 std::list<GtpcCreateSessionRequestMessage::BearerContextToBeCreated> bearerContextsOut;
250 for (
auto& bearerContext : bearerContexts)
265 bearerContextOut.
epsBearerId = bearerContext.epsBearerId;
267 bearerContextOut.
tft = bearerContext.tft;
268 bearerContextsOut.push_back(bearerContextOut);
277 packetOut->AddHeader(msgOut);
288 packet->RemoveHeader(msg);
302 std::list<GtpcModifyBearerRequestMessage::BearerContextToBeModified> bearerContextsOut;
303 std::list<GtpcModifyBearerRequestMessage::BearerContextToBeModified> bearerContexts =
305 NS_LOG_DEBUG(
"BearerContextsToBeModified size = " << bearerContexts.size());
306 for (
auto& bearerContext : bearerContexts)
309 "Wrong FTEID in ModifyBearerRequest msg");
310 uint32_t teid = bearerContext.fteid.teid;
312 NS_LOG_DEBUG(
"bearerId " << (uint16_t)bearerContext.epsBearerId <<
" TEID " << teid);
315 addrit->second = enbAddr;
317 bearerContextOut.
epsBearerId = bearerContext.epsBearerId;
320 bearerContextOut.
fteid.
teid = bearerContext.fteid.teid;
322 bearerContextsOut.push_back(bearerContextOut);
329 packetOut->AddHeader(msgOut);
340 packet->RemoveHeader(msg);
342 std::list<GtpcDeleteBearerCommandMessage::BearerContext> bearerContextsOut;
345 NS_LOG_DEBUG(
"ebid " << (uint16_t)bearerContext.m_epsBearerId);
347 bearerContextOut.
m_epsBearerId = bearerContext.m_epsBearerId;
348 bearerContextsOut.push_back(bearerContextOut);
357 packetOut->AddHeader(msgOut);
368 packet->RemoveHeader(msg);
375 packetOut->AddHeader(msgOut);
390 packet->RemoveHeader(msg);
401 std::list<GtpcCreateSessionResponseMessage::BearerContextCreated> bearerContexts =
403 NS_LOG_DEBUG(
"BearerContextsCreated size = " << bearerContexts.size());
404 std::list<GtpcCreateSessionResponseMessage::BearerContextCreated> bearerContextsOut;
405 for (
auto& bearerContext : bearerContexts)
409 bearerContextOut.
fteid.
teid = bearerContext.fteid.teid;
411 bearerContextOut.
epsBearerId = bearerContext.epsBearerId;
413 bearerContextOut.
tft = bearerContext.tft;
414 bearerContextsOut.push_back(bearerContext);
422 packetOut->AddHeader(msgOut);
433 packet->RemoveHeader(msg);
441 packetOut->AddHeader(msgOut);
452 packet->RemoveHeader(msg);
460 packetOut->AddHeader(msgOut);
Ptr< Socket > m_s5cSocket
UDP socket to send/receive GTP-C packets to/from the S5 interface.
void SendToS1uSocket(Ptr< Packet > packet, Ipv4Address enbS1uAddress, uint32_t teid)
Send a data packet to an eNB via the S1-U interface.
uint16_t m_gtpuUdpPort
UDP port to be used for GTP-U.
std::map< uint32_t, GtpcHeader::Fteid_t > m_mmeS11FteidBySgwS5cTeid
MME S11 FTEID by SGW S5C TEID.
void DoRecvModifyBearerRequest(Ptr< Packet > packet)
Process GTP-C Modify Bearer Request message.
void DoRecvCreateSessionResponse(Ptr< Packet > packet)
Process GTP-C Create Session Response message.
Ipv4Address m_mmeS11Addr
MME address in the S11 interface.
void DoRecvDeleteBearerRequest(Ptr< Packet > packet)
Process GTP-C Delete Bearer Request message.
void AddMme(Ipv4Address mmeS11Addr, Ptr< Socket > s11Socket)
Let the SGW be aware of an MME.
void DoRecvDeleteBearerCommand(Ptr< Packet > packet)
Process GTP-C Delete Bearer Command message.
void RecvFromS5cSocket(Ptr< Socket > socket)
Method to be assigned to the recv callback of the S5-C socket.
~EpcSgwApplication() override
Destructor.
void SendToS5uSocket(Ptr< Packet > packet, Ipv4Address pgwAddr, uint32_t teid)
Send a data packet to the PGW via the S5 interface.
void DoRecvCreateSessionRequest(Ptr< Packet > packet)
Process GTP-C Create Session Request message.
EpcSgwApplication(const Ptr< Socket > s1uSocket, Ipv4Address s5Addr, const Ptr< Socket > s5uSocket, const Ptr< Socket > s5cSocket)
Constructor that binds callback methods of sockets.
void AddPgw(Ipv4Address pgwAddr)
Let the SGW be aware of a PGW.
void RecvFromS5uSocket(Ptr< Socket > socket)
Method to be assigned to the recv callback of the S5-U socket.
std::map< uint32_t, Ipv4Address > m_enbByTeidMap
Map for eNB address by TEID.
Ptr< Socket > m_s1uSocket
UDP socket to send/receive GTP-U packets to/from the S1-U interface.
Ptr< Socket > m_s11Socket
UDP socket to send/receive control messages to/from the S11 interface.
std::map< uint16_t, EnbInfo > m_enbInfoByCellId
Map for eNB info by cell ID.
uint32_t m_teidCount
TEID count.
void RecvFromS11Socket(Ptr< Socket > socket)
Method to be assigned to the recv callback of the S11 socket.
Ipv4Address m_s5Addr
SGW address in the S5 interface.
uint16_t m_gtpcUdpPort
UDP port to be used for GTP-C.
void RecvFromS1uSocket(Ptr< Socket > socket)
Method to be assigned to the recv callback of the S1-U socket.
void DoDispose() override
Destructor implementation.
void DoRecvDeleteBearerResponse(Ptr< Packet > packet)
Process GTP-C Delete Bearer Response message.
Ptr< Socket > m_s5uSocket
UDP socket to send/receive GTP-U packets to/from the S5 interface.
Ipv4Address m_pgwAddr
PGW address in the S5 interface.
void DoRecvModifyBearerResponse(Ptr< Packet > packet)
Process GTP-C Modify Bearer Response message.
void AddEnb(uint16_t cellId, Ipv4Address enbAddr, Ipv4Address sgwAddr)
Let the SGW be aware of a new eNB.
static TypeId GetTypeId()
Get the type ID.
GTP-C Create Session Request Message.
uint64_t GetImsi() const
Get the IMSI.
void SetUliEcgi(uint32_t uliEcgi)
Set the UliEcgi.
GtpcHeader::Fteid_t GetSenderCpFteid() const
Get the Sender CpFteid.
uint32_t GetUliEcgi() const
Get the UliEcgi.
void SetBearerContextsToBeCreated(std::list< BearerContextToBeCreated > bearerContexts)
Set the Bearer Contexts.
std::list< BearerContextToBeCreated > GetBearerContextsToBeCreated() const
Get the Bearer Contexts.
void SetImsi(uint64_t imsi)
Set the IMSI.
void SetSenderCpFteid(GtpcHeader::Fteid_t fteid)
Set the Sender CpFteid.
GTP-C Create Session Response Message.
void SetCause(Cause_t cause)
Set the Cause.
void SetBearerContextsCreated(std::list< BearerContextCreated > bearerContexts)
Set the Bearer Contexts.
std::list< BearerContextCreated > GetBearerContextsCreated() const
Get the Container of Bearer Contexts.
GtpcHeader::Fteid_t GetSenderCpFteid() const
Get the Sender CpFteid.
GTP-C Delete Bearer Command Message.
std::list< BearerContext > GetBearerContexts() const
Get the Bearer contexts.
void SetBearerContexts(std::list< BearerContext > bearerContexts)
Set the Bearer contexts.
GTP-C Delete Bearer Request Message.
std::list< uint8_t > GetEpsBearerIds() const
Get the Bearers IDs.
void SetEpsBearerIds(std::list< uint8_t > epsBearerIds)
Set the Bearers IDs.
GTP-C Delete Bearer Response Message.
std::list< uint8_t > GetEpsBearerIds() const
Get the Bearers IDs.
void SetEpsBearerIds(std::list< uint8_t > epsBearerIds)
Set the Bearers IDs.
GTP-C Modify Bearer Request Message.
uint64_t GetImsi() const
Get the IMSI.
uint32_t GetUliEcgi() const
Get the UliEcgi.
void SetUliEcgi(uint32_t uliEcgi)
Set the UliEcgi.
std::list< BearerContextToBeModified > GetBearerContextsToBeModified() const
Get the Bearer Contexts.
void SetImsi(uint64_t imsi)
Set the IMSI.
GTP-C Modify Bearer Response Message.
void SetCause(Cause_t cause)
Set the Cause.
Ipv4 addresses are stored in host order in this class.
A base class which provides memory management and object aggregation.
Smart pointer class similar to boost::intrusive_ptr.
void SetRecvCallback(Callback< void, Ptr< Socket > > receivedData)
Notify application when new data is available to be read.
virtual int SendTo(Ptr< Packet > p, uint32_t flags, const Address &toAddress)=0
Send data to a specified peer.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Callback< R, Args... > MakeNullCallback()
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_ABORT_IF(cond)
Abnormal program termination if a condition is true.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Ipv4Address enbAddr
eNB address
Ipv4Address sgwAddr
SGW address.
Bearer Context structure.
EpsBearer bearerLevelQos
bearer QOS level
uint8_t epsBearerId
EPS bearer ID.
GtpcHeader::Fteid_t sgwS5uFteid
FTEID.
Ptr< EpcTft > tft
traffic flow template
Bearer Context structure.
GtpcHeader::Fteid_t fteid
FTEID.
uint8_t epsBearerId
EPS bearer ID.
Ptr< EpcTft > tft
Bearer traffic flow template.
EpsBearer bearerLevelQos
Bearer QOS level.
uint8_t m_epsBearerId
EPS bearer ID.
Bearer Context structure.
uint8_t epsBearerId
EPS bearer ID.
GtpcHeader::Fteid_t fteid
FTEID.