ns-3
|
#include <epc-sgw-pgw-application.h>
Classes | |
class | UeInfo |
Public Member Functions | |
virtual void | DoDispose () |
EpcSgwPgwApplication (const Ptr< VirtualNetDevice > tunDevice, const Ptr< Socket > s1uSocket) | |
virtual | ~EpcSgwPgwApplication (void) |
uint32_t | ActivateS1Bearer (Ipv4Address ueAddr, Ipv4Address enbAddr, Ptr< EpcTft > tft) |
bool | RecvFromTunDevice (Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber) |
void | RecvFromS1uSocket (Ptr< Socket > socket) |
void | SendToTunDevice (Ptr< Packet > packet, uint32_t teid) |
void | SendToS1uSocket (Ptr< Packet > packet, Ipv4Address enbS1uAddress, uint32_t teid) |
![]() | |
void | SetStartTime (Time start) |
Specify application start time. | |
void | SetStopTime (Time stop) |
Specify application stop time. | |
Ptr< Node > | GetNode () const |
void | SetNode (Ptr< Node > node) |
![]() | |
virtual TypeId | GetInstanceTypeId (void) const |
template<typename T > | |
Ptr< T > | GetObject (void) const |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
void | Dispose (void) |
void | AggregateObject (Ptr< Object > other) |
AggregateIterator | GetAggregateIterator (void) const |
void | Start (void) |
![]() | |
SimpleRefCount (const SimpleRefCount &o) | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
void | Ref (void) const |
void | Unref (void) const |
uint32_t | GetReferenceCount (void) const |
![]() | |
void | SetAttribute (std::string name, const AttributeValue &value) |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
void | GetAttribute (std::string name, AttributeValue &value) const |
bool | GetAttributeFailSafe (std::string name, AttributeValue &attribute) const |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
This method returns the TypeId associated to ns3::Application. |
Additional Inherited Members | |
![]() | |
virtual void | DoStart (void) |
![]() | |
virtual void | NotifyNewAggregate (void) |
Object (const Object &o) | |
![]() | |
Ptr< Node > | m_node |
Time | m_startTime |
Time | m_stopTime |
EventId | m_startEvent |
EventId | m_stopEvent |
This application implements the SGW/PGW functionality.
ns3::EpcSgwPgwApplication::EpcSgwPgwApplication | ( | const Ptr< VirtualNetDevice > | tunDevice, |
const Ptr< Socket > | s1uSocket | ||
) |
Constructor that binds the tap device to the callback methods.
tunDevice | TUN VirtualNetDevice used to tunnel IP packets from the Gi interface of the PGW/SGW over the internet over GTP-U/UDP/IP on the S1-U interface |
s1uSocket | socket used to send GTP-U packets to the eNBs |
References ns3::MakeCallback(), NS_LOG_FUNCTION, RecvFromS1uSocket(), and ns3::Socket::SetRecvCallback().
|
virtual |
Destructor
References NS_LOG_FUNCTION_NOARGS.
uint32_t ns3::EpcSgwPgwApplication::ActivateS1Bearer | ( | Ipv4Address | ueAddr, |
Ipv4Address | enbAddr, | ||
Ptr< EpcTft > | tft | ||
) |
Simulates the reception by the PGW of a GTP-C message of type CreateSessionRequest or BearerResourceCommand coming from the MME. This triggers the creation of a new EPS Bearer.
bearer | the specification of the EPS Bearer to be created |
enbS1uAddress | the IPv4 address at which the SGW can reach the eNB via the S1-U interface |
tft | the Traffic Flow Template related to this bearer |
References NS_ABORT_IF, and NS_LOG_FUNCTION.
Referenced by ns3::EpcHelper::ActivateEpsBearer().
|
virtual |
This method is called by Object::Dispose or by the object's destructor, whichever comes first.
Subclasses are expected to implement their real destruction code in an overriden version of this method and chain up to their parent's implementation once they are done. i.e., for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose method.
It is safe to call GetObject from within this method.
Reimplemented from ns3::Application.
References ns3::MakeNullCallback(), and ns3::Socket::SetRecvCallback().
|
static |
This method returns the TypeId associated to ns3::Application.
This object is accessible through the following paths with Config::Set and Config::Connect:
Attributes defined for this type:
No TraceSources defined for this type.
Reimplemented from ns3::Application.
References ns3::TypeId::SetParent().
Method to be assigned to the recv callback of the S1-U socket. It is called when the SGW/PGW receives a data packet from the eNB that is to be forwarded to the internet.
socket | pointer to the S1-U socket |
References NS_ASSERT, NS_LOG_FUNCTION, ns3::Socket::Recv(), ns3::Packet::RemoveHeader(), ns3::Packet::RemovePacketTag(), and SendToTunDevice().
Referenced by EpcSgwPgwApplication().
bool ns3::EpcSgwPgwApplication::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. It is called when the SGW/PGW receives a data packet from the internet (including IP headers) that is to be sent to the UE via its associated eNB, tunneling IP over GTP-U/UDP/IP.
packet | |
source | |
dest | |
protocolNumber |
References ns3::Packet::Copy(), ns3::Ipv4Header::GetDestination(), ns3::Packet::GetSize(), NS_LOG_FUNCTION, NS_LOG_LOGIC, NS_LOG_WARN, and SendToS1uSocket().
Referenced by ns3::EpcHelper::EpcHelper().
void ns3::EpcSgwPgwApplication::SendToS1uSocket | ( | Ptr< Packet > | packet, |
Ipv4Address | enbS1uAddress, | ||
uint32_t | teid | ||
) |
Send a packet to the SGW via the S1-U interface
packet | packet to be sent |
enbS1uAddress | the address of the eNB |
teid | the Tunnel Enpoint IDentifier |
References ns3::Packet::AddHeader(), ns3::GtpuHeader::GetSerializedSize(), ns3::Packet::GetSize(), NS_LOG_FUNCTION, and ns3::Socket::SendTo().
Referenced by RecvFromTunDevice().
Send a packet to the internet via the Gi interface of the SGW/PGW
packet |
References ns3::VirtualNetDevice::GetAddress(), ns3::Packet::GetSize(), NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::NetDevice::PACKET_HOST, and ns3::VirtualNetDevice::Receive().
Referenced by RecvFromS1uSocket().