25 #include "ns3/mac48-address.h"
27 #include "ns3/inet-socket-address.h"
28 #include "ns3/uinteger.h"
145 uint16_t enbUeS1Id = params.
rnti;
147 uint64_t imsi = mmeUeS1Id;
151 uint16_t gci = params.
cellId;
152 std::list<EpcS1apSapMme::ErabSwitchedInDownlinkItem> erabToBeSwitchedInDownlinkList;
153 for (std::list<EpcEnbS1SapProvider::BearerToBeSwitched>::iterator bit = params.
bearersToBeSwitched.begin ();
159 flowId.
m_bid = bit->epsBearerId;
160 uint32_t teid = bit->teid;
168 erab.
erabId = bit->epsBearerId;
172 erabToBeSwitchedInDownlinkList.push_back (erab);
181 std::map<uint16_t, std::map<uint8_t, uint32_t> >::iterator rntiIt =
m_rbidTeidMap.find (rnti);
184 for (std::map<uint8_t, uint32_t>::iterator bidIt = rntiIt->second.begin ();
185 bidIt != rntiIt->second.end ();
188 uint32_t teid = bidIt->second;
200 for (std::list<EpcS1apSapEnb::ErabToBeSetupItem>::iterator erabIt = erabToBeSetupList.begin ();
201 erabIt != erabToBeSetupList.end ();
206 uint64_t imsi = mmeUeS1Id;
207 std::map<uint64_t, uint16_t>::iterator imsiIt =
m_imsiRntiMap.find (imsi);
209 uint16_t rnti = imsiIt->second;
213 params.
bearer = erabIt->erabLevelQosParameters;
215 params.
gtpTeid = erabIt->sgwTeid;
231 uint64_t imsi = mmeUeS1Id;
232 std::map<uint64_t, uint16_t>::iterator imsiIt =
m_imsiRntiMap.find (imsi);
234 uint16_t rnti = imsiIt->second;
255 uint16_t rnti = tag.
GetRnti ();
256 uint8_t bid = tag.
GetBid ();
257 NS_LOG_LOGIC (
"received packet with RNTI=" << (uint32_t) rnti <<
", BID=" << (uint32_t) bid);
258 std::map<uint16_t, std::map<uint8_t, uint32_t> >::iterator rntiIt =
m_rbidTeidMap.find (rnti);
261 NS_LOG_WARN (
"UE context not found, discarding packet");
265 std::map<uint8_t, uint32_t>::iterator bidIt = rntiIt->second.find (bid);
266 NS_ASSERT (bidIt != rntiIt->second.end ());
267 uint32_t teid = bidIt->second;
280 uint32_t teid = gtpu.
GetTeid ();
281 std::map<uint32_t, EpsFlowId_t>::iterator it =
m_teidRbidMap.find (teid);
311 gtpu.SetLength (packet->
GetSize () + gtpu.GetSerializedSize () - 8);
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
Parameters passed to DataRadioBearerSetupRequest ()
This class implements the Service Access Point (SAP) between the LteEnbRrc and the EpcEnbApplication...
#define NS_LOG_FUNCTION(parameters)
MME side of the S1-AP Service Access Point (SAP), provides the MME methods to be called when an S1-AP...
EpcEnbApplication(Ptr< Socket > lteSocket, Ptr< Socket > s1uSocket, Ipv4Address enbS1uAddress, Ipv4Address sgwS1uAddress, uint16_t cellId)
Constructor.
This class implements the Service Access Point (SAP) between the LteEnbRrc and the EpcEnbApplication...
NS_LOG_COMPONENT_DEFINE("GrantedTimeWindowMpiInterface")
void DoPathSwitchRequest(EpcEnbS1SapProvider::PathSwitchRequestParameters params)
uint8_t bearerId
the EPS Bearer Identifier
virtual void DataRadioBearerSetupRequest(DataRadioBearerSetupRequestParameters params)=0
request the setup of a DataRadioBearer
Ipv4Address m_enbS1uAddress
address of the eNB for S1-U communications
uint16_t rnti
the RNTI identifying the UE for which the DataRadioBearer is to be created
void AddPacketTag(const Tag &tag) const
Add a packet tag.
#define NS_ASSERT(condition)
void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
Ipv4Address m_sgwS1uAddress
address of the SGW which terminates all S1-U tunnels
std::list< BearerToBeSwitched > bearersToBeSwitched
uint32_t GetSize(void) const
Tag used to define the RNTI and EPS bearer ID for packets interchanged between the EpcEnbApplication ...
bool operator<(const Room &a, const Room &b)
EpsBearer bearer
the characteristics of the bearer to be set up
Ptr< Socket > m_lteSocket
raw packet socket to send and receive the packets to and from the LTE radio interface ...
uint8_t GetBid(void) const
uint16_t GetRnti(void) const
void SendToLteSocket(Ptr< Packet > packet, uint16_t rnti, uint8_t bid)
Send a packet to the UE via the LTE radio interface of the eNB.
EpcS1apSapEnb * GetS1apSapEnb()
void SendToS1uSocket(Ptr< Packet > packet, uint32_t teid)
Send a packet to the SGW via the S1-U interface.
void SetS1SapUser(EpcEnbS1SapUser *s)
Set the S1 SAP User.
Ipv4Address enbTransportLayerAddress
eNB side of the S1-AP Service Access Point (SAP), provides the eNB methods to be called when an S1-AP...
uint16_t m_gtpuUdpPort
UDP port to be used for GTP.
EpcS1apSapMme * m_s1apSapMme
MME side of the S1-AP SAP.
void DoInitialUeMessage(uint64_t imsi, uint16_t rnti)
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)
virtual void PathSwitchRequest(uint64_t enbUeS1Id, uint64_t mmeUeS1Id, uint16_t gci, std::list< ErabSwitchedInDownlinkItem > erabToBeSwitchedInDownlinkList)=0
PATH SWITCH REQUEST message, see 3GPP TS 36.413 9.1.5.8.
uint32_t gtpTeid
S1-bearer GTP tunnel endpoint identifier, see 36.423 9.2.1.
void SetRecvCallback(Callback< void, Ptr< Socket > >)
Notify application when new data is available to be read.
#define NS_LOG_LOGIC(msg)
virtual ~EpcEnbApplication(void)
Destructor.
void RecvFromLteSocket(Ptr< Socket > socket)
Method to be assigned to the recv callback of the LTE socket.
void DoInitialContextSetupRequest(uint64_t mmeUeS1Id, uint16_t enbUeS1Id, std::list< EpcS1apSapEnb::ErabToBeSetupItem > erabToBeSetupList)
static TypeId GetTypeId(void)
virtual Ptr< Packet > Recv(uint32_t maxSize, uint32_t flags)=0
Read data from the socket.
Template for the implementation of the EpcEnbS1SapProvider as a member of an owner class of type C to...
EpcEnbS1SapProvider * GetS1SapProvider()
void RecvFromS1uSocket(Ptr< Socket > socket)
Method to be assigned to the recv callback of the S1-U socket.
EpcEnbS1SapUser * m_s1SapUser
User for the S1 SAP.
void DoUeContextRelease(uint16_t rnti)
std::map< uint32_t, EpsFlowId_t > m_teidRbidMap
map telling for each S1-U TEID the corresponding RNTI,BID
#define NS_ASSERT_MSG(condition, message)
Ipv4 addresses are stored in host order in this class.
virtual void PathSwitchRequestAcknowledge(PathSwitchRequestAcknowledgeParameters params)=0
bool RemovePacketTag(Tag &tag)
Remove a packet tag.
void DoPathSwitchRequestAcknowledge(uint64_t enbUeS1Id, uint64_t mmeUeS1Id, uint16_t cgi, std::list< EpcS1apSapEnb::ErabSwitchedInUplinkItem > erabToBeSwitchedInUplinkList)
bool operator==(const EventId &a, const EventId &b)
virtual int SendTo(Ptr< Packet > p, uint32_t flags, const Address &toAddress)=0
Send data to a specified peer.
virtual void InitialUeMessage(uint64_t mmeUeS1Id, uint16_t enbUeS1Id, uint64_t stmsi, uint16_t ecgi)=0
a base class which provides memory management and object aggregation
EpcS1apSapEnb * m_s1apSapEnb
ENB side of the S1-AP SAP.
void SetS1apSapMme(EpcS1apSapMme *s)
Set the MME side of the S1-AP SAP.
virtual int Send(Ptr< Packet > p, uint32_t flags)=0
Send data (or dummy data) to the remote host.
std::map< uint16_t, std::map< uint8_t, uint32_t > > m_rbidTeidMap
map of maps telling for each RNTI and BID the corresponding S1-U TEID
E-RABs Switched in Downlink Item IE, see 3GPP TS 36.413 9.1.5.8.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
std::map< uint64_t, uint16_t > m_imsiRntiMap
UE context info.
Ptr< Socket > m_s1uSocket
UDP socket to send and receive GTP-U the packets to and from the S1-U interface.
void AddHeader(const Header &header)
Add header to this packet.
Template for the implementation of the EpcS1apSapEnb as a member of an owner class of type C to which...
EpcEnbS1SapProvider * m_s1SapProvider
Provider for the S1 SAP.