40 m_s5uSocket(s5uSocket),
41 m_s5cSocket(s5cSocket),
42 m_s1uSocket(s1uSocket),
145 uint32_t teid = gtpu.
GetTeid();
190 uint32_t teid = gtpu.
GetTeid();
252 sgwS5cFteid.
teid = imsi;
257 std::list<GtpcCreateSessionRequestMessage::BearerContextToBeCreated> bearerContexts =
259 NS_LOG_DEBUG(
"BearerContextToBeCreated size = " << bearerContexts.size());
260 std::list<GtpcCreateSessionRequestMessage::BearerContextToBeCreated> bearerContextsOut;
261 for (
auto& bearerContext : bearerContexts)
276 bearerContextOut.
epsBearerId = bearerContext.epsBearerId;
278 bearerContextOut.
tft = bearerContext.tft;
279 bearerContextsOut.push_back(bearerContextOut);
313 std::list<GtpcModifyBearerRequestMessage::BearerContextToBeModified> bearerContextsOut;
314 std::list<GtpcModifyBearerRequestMessage::BearerContextToBeModified> bearerContexts =
316 NS_LOG_DEBUG(
"BearerContextsToBeModified size = " << bearerContexts.size());
317 for (
auto& bearerContext : bearerContexts)
320 "Wrong FTEID in ModifyBearerRequest msg");
321 uint32_t teid = bearerContext.fteid.teid;
323 NS_LOG_DEBUG(
"bearerId " << (uint16_t)bearerContext.epsBearerId <<
" TEID " << teid);
326 addrit->second = enbAddr;
328 bearerContextOut.
epsBearerId = bearerContext.epsBearerId;
331 bearerContextOut.
fteid.
teid = bearerContext.fteid.teid;
333 bearerContextsOut.push_back(bearerContextOut);
353 std::list<GtpcDeleteBearerCommandMessage::BearerContext> bearerContextsOut;
356 NS_LOG_DEBUG(
"ebid " << (uint16_t)bearerContext.m_epsBearerId);
358 bearerContextOut.
m_epsBearerId = bearerContext.m_epsBearerId;
359 bearerContextsOut.push_back(bearerContextOut);
412 std::list<GtpcCreateSessionResponseMessage::BearerContextCreated> bearerContexts =
414 NS_LOG_DEBUG(
"BearerContextsCreated size = " << bearerContexts.size());
415 std::list<GtpcCreateSessionResponseMessage::BearerContextCreated> bearerContextsOut;
416 for (
auto& bearerContext : bearerContexts)
420 bearerContextOut.
fteid.
teid = bearerContext.fteid.teid;
422 bearerContextOut.
epsBearerId = bearerContext.epsBearerId;
424 bearerContextOut.
tft = bearerContext.tft;
425 bearerContextsOut.push_back(bearerContext);
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.
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
void AddHeader(const Header &header)
Add header to this packet.
uint32_t GetSize() const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
uint32_t PeekHeader(Header &header) const
Deserialize but does not remove the header from the internal buffer.
void SetRecvCallback(Callback< void, Ptr< Socket >> receivedData)
Notify application when new data is available to be read.
virtual Ptr< Packet > Recv(uint32_t maxSize, uint32_t flags)=0
Read data from the socket.
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.
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.