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"
51 m_teidByBearerIdMap[bearerId] = teid;
52 return m_tftClassifier.Add (tft, teid);
140 pCopy->RemoveHeader (ipv4Header);
145 std::map<Ipv4Address, Ptr<UeInfo> >::iterator it =
m_ueInfoByAddrMap.find (ueAddr);
153 uint32_t teid = it->second->Classify (packet);
156 NS_LOG_WARN (
"no matching bearer for this packet");
166 const bool succeeded =
true;
178 uint32_t teid = gtpu.
GetTeid ();
249 ueit->second->SetUeAddr (ueAddr);
258 uint16_t cellId = req.
uli.
gci;
262 ueit->second->SetEnbAddr (enbAddr);
276 ueit->second->AddBearer (bit->tft, bit->epsBearerId, teid);
283 bearerContext.
tft = bit->tft;
294 uint64_t imsi = req.
teid;
297 uint16_t cellId = req.
uli.gci;
301 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)
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.
NS_LOG_COMPONENT_DEFINE("GrantedTimeWindowMpiInterface")
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)
uint32_t GetSize(void) const
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)
#define NS_ABORT_IF(cond)
Abnormal program termination if cond is true.
Modify Bearer Request message, see 3GPP TS 29.274 7.2.7.
Ptr< Packet > Copy(void) const
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)
Ptr< Socket > m_s1uSocket
UDP socket to send and receive GTP-U packets to and from the S1-U interface.
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
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.