25 #include "ns3/mac48-address.h"
27 #include "ns3/inet-socket-address.h"
28 #include "ns3/epc-gtpu-header.h"
29 #include "ns3/abort.h"
50 m_teidByBearerIdMap[bearerId] = teid;
51 return m_tftClassifier.Add (tft, teid);
139 pCopy->RemoveHeader (ipv4Header);
144 std::map<Ipv4Address, Ptr<UeInfo> >::iterator it =
m_ueInfoByAddrMap.find (ueAddr);
152 uint32_t teid = it->second->Classify (packet);
155 NS_LOG_WARN (
"no matching bearer for this packet");
165 const bool succeeded =
true;
177 uint32_t teid = gtpu.
GetTeid ();
248 ueit->second->SetUeAddr (ueAddr);
257 uint16_t cellId = req.
uli.
gci;
261 ueit->second->SetEnbAddr (enbAddr);
275 ueit->second->AddBearer (bit->tft, bit->epsBearerId, teid);
282 bearerContext.
tft = bit->tft;
293 uint64_t imsi = req.
teid;
296 uint16_t cellId = req.
uli.gci;
300 ueit->second->SetEnbAddr (enbAddr);
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
std::map< uint16_t, EnbInfo > m_enbInfoByCellId
enum ns3::EpcS11SapMme::ModifyBearerResponseMessage::Cause cause
smart pointer class similar to boost::intrusive_ptr
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
3GPP TS 29.274 version 8.3.1 Release 8 section 8.28
MME side of the S11 Service Access Point (SAP), provides the MME methods to be called when an S11 mes...
uint16_t m_gtpuUdpPort
UDP port to be used for GTP.
void SetS11SapMme(EpcS11SapMme *s)
Set the MME side of the S11 SAP.
EpcS11SapMme * m_s11SapMme
MME side of the S11 SAP.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
bool Receive(Ptr< Packet > packet, uint16_t protocol, const Address &source, const Address &destination, PacketType packetType)
Callback< R > MakeNullCallback(void)
void SendToTunDevice(Ptr< Packet > packet, uint32_t teid)
Send a packet to the internet via the Gi interface of the SGW/PGW.
a polymophic address class
EpcS11Sap::Fteid sgwFteid
Template for the implementation of the EpcS11SapSgw as a member of an owner class of type C to which ...
virtual Address GetAddress(void) const
bool RecvFromTunDevice(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber)
Method to be assigned to the callback of the Gi TUN VirtualNetDevice.
Ptr< VirtualNetDevice > m_tunDevice
TUN VirtualNetDevice used for tunneling/detunneling IP packets from/to the internet over GTP-U/UDP/IP...
std::map< uint64_t, Ptr< UeInfo > > m_ueInfoByImsiMap
Map telling for each IMSI the corresponding UE info.
void DoCreateSessionRequest(EpcS11SapSgw::CreateSessionRequestMessage msg)
void SetUeAddr(Ipv4Address addr)
set the address of the UE
virtual void ModifyBearerResponse(ModifyBearerResponseMessage msg)=0
send a Modify Bearer Response message
uint32_t Classify(Ptr< Packet > p)
This class implements a tag that carries an address of a packet across the socket interface...
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
void SetRecvCallback(Callback< void, Ptr< Socket > >)
Notify application when new data is available to be read.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Modify Bearer Request message, see 3GPP TS 29.274 7.2.7.
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
void AddBearer(Ptr< EpcTft > tft, uint8_t epsBearerId, uint32_t teid)
virtual Ptr< Packet > Recv(uint32_t maxSize, uint32_t flags)=0
Read data from the socket.
std::list< BearerContextCreated > bearerContextsCreated
void SetUeAddress(uint64_t imsi, Ipv4Address ueAddr)
set the address of a previously added UE
static TypeId GetTypeId(void)
void AddUe(uint64_t imsi)
Let the SGW be aware of a new UE.
void SendToS1uSocket(Ptr< Packet > packet, Ipv4Address enbS1uAddress, uint32_t teid)
Send a packet to the SGW via the S1-U interface.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Ptr< Socket > m_s1uSocket
UDP socket to send and receive GTP-U packets to and from the S1-U interface.
#define NS_ABORT_IF(cond)
Abnormal program termination if cond is true.
std::map< Ipv4Address, Ptr< UeInfo > > m_ueInfoByAddrMap
Map telling for each UE address the corresponding UE info.
Ipv4 addresses are stored in host order in this class.
SGW side of the S11 Service Access Point (SAP), provides the SGW methods to be called when an S11 mes...
std::list< BearerContextToBeCreated > bearerContextsToBeCreated
virtual void CreateSessionResponse(CreateSessionResponseMessage msg)=0
send a Create Session Response message
void SetEnbAddr(Ipv4Address addr)
set the address of the eNB to which the UE is connected
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
bool RemovePacketTag(Tag &tag)
Remove a packet tag.
virtual void DoDispose()
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
EpcS11SapSgw * GetS11SapSgw()
void RecvFromS1uSocket(Ptr< Socket > socket)
Method to be assigned to the recv callback of the S1-U socket.
virtual ~EpcSgwPgwApplication(void)
Destructor.
virtual int SendTo(Ptr< Packet > p, uint32_t flags, const Address &toAddress)=0
Send data to a specified peer.
a base class which provides memory management and object aggregation
Modify Bearer Response message, see 3GPP TS 29.274 7.2.7.
void DoModifyBearerRequest(EpcS11SapSgw::ModifyBearerRequestMessage msg)
EpcS11SapSgw * m_s11SapSgw
SGW side of the S11 SAP.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
void AddEnb(uint16_t cellId, Ipv4Address enbAddr, Ipv4Address sgwAddr)
Let the SGW be aware of a new eNB.
void AddHeader(const Header &header)
Add header to this packet.
Create Session Request message, see 3GPP TS 29.274 7.2.1.
EpcSgwPgwApplication(const Ptr< VirtualNetDevice > tunDevice, const Ptr< Socket > s1uSocket)
Constructor that binds the tap device to the callback methods.
Create Session Response message, see 3GPP TS 29.274 7.2.2.