![]() |
5G-LENA nr-v3.3-159-ga6832aa7
The 5G/NR module for the ns-3 simulator
|
#include "nr-epc-pgw-application.h"
Public Types | |
typedef void(* | RxTracedCallback) (Ptr< Packet > packet) |
Public Member Functions | |
NrEpcPgwApplication (const Ptr< VirtualNetDevice > tunDevice, Ipv4Address s5Addr, const Ptr< Socket > s5uSocket, const Ptr< Socket > s5cSocket) | |
~NrEpcPgwApplication () override | |
void | AddSgw (Ipv4Address sgwS5Addr) |
void | AddUe (uint64_t imsi) |
void | DoDispose () override |
void | RecvFromS5cSocket (Ptr< Socket > socket) |
void | RecvFromS5uSocket (Ptr< Socket > socket) |
bool | RecvFromTunDevice (Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber) |
void | SendToS5uSocket (Ptr< Packet > packet, Ipv4Address sgwS5uAddress, uint32_t teid) |
void | SendToTunDevice (Ptr< Packet > packet, uint32_t teid) |
void | SetUeAddress (uint64_t imsi, Ipv4Address ueAddr) |
void | SetUeAddress6 (uint64_t imsi, Ipv6Address ueAddr) |
Static Public Member Functions | |
static TypeId | GetTypeId () |
Get the type ID. | |
This application implements the Packet Data Network (PDN) Gateway Entity (PGW) according to the 3GPP TS 23.401 document.
This Application implements the PGW side of the S5 interface between the PGW node and the SGW nodes and the PGW side of the SGi interface between the PGW node and the internet hosts. It supports the following functions and messages:
Others functions enumerated in section 4.4.3.3 of 3GPP TS 23.401 are not supported.
Definition at line 39 of file nr-epc-pgw-application.h.
typedef void(* ns3::NrEpcPgwApplication::RxTracedCallback) (Ptr< Packet > packet) |
TracedCallback signature for data Packet reception event.
[in] | packet | The data packet sent from the internet. |
Definition at line 153 of file nr-epc-pgw-application.h.
ns3::NrEpcPgwApplication::NrEpcPgwApplication | ( | const Ptr< VirtualNetDevice > | tunDevice, |
Ipv4Address | s5Addr, | ||
const Ptr< Socket > | s5uSocket, | ||
const Ptr< Socket > | s5cSocket | ||
) |
Constructor that binds the tap device to the callback methods.
tunDevice | TUN VirtualNetDevice used to tunnel IP packets from the SGi interface of the PGW in the internet over GTP-U/UDP/IP on the S5 interface |
s5Addr | IP address of the PGW S5 interface |
s5uSocket | socket used to send GTP-U packets to the peer SGW |
s5cSocket | socket used to send GTP-C packets to the peer SGW |
Definition at line 131 of file nr-epc-pgw-application.cc.
References RecvFromS5cSocket(), and RecvFromS5uSocket().
|
override |
Destructor
Definition at line 147 of file nr-epc-pgw-application.cc.
void ns3::NrEpcPgwApplication::AddSgw | ( | Ipv4Address | sgwS5Addr | ) |
Let the PGW be aware of a new SGW
sgwS5Addr | the address of the SGW S5 interface |
Definition at line 470 of file nr-epc-pgw-application.cc.
void ns3::NrEpcPgwApplication::AddUe | ( | uint64_t | imsi | ) |
Let the PGW be aware of a new UE
imsi | the unique identifier of the UE |
Definition at line 477 of file nr-epc-pgw-application.cc.
|
override |
Definition at line 122 of file nr-epc-pgw-application.cc.
|
static |
void ns3::NrEpcPgwApplication::RecvFromS5cSocket | ( | Ptr< Socket > | socket | ) |
Method to be assigned to the receiver callback of the S5-C socket. It is called when the PGW receives a control packet from the SGW.
socket | pointer to the S5-C socket |
Definition at line 244 of file nr-epc-pgw-application.cc.
References ns3::NrGtpcHeader::GetMessageType().
Referenced by NrEpcPgwApplication().
void ns3::NrEpcPgwApplication::RecvFromS5uSocket | ( | Ptr< Socket > | socket | ) |
Method to be assigned to the receiver callback of the S5-U socket. It is called when the PGW receives a data packet from the SGW that is to be forwarded to the internet.
socket | pointer to the S5-U socket |
Definition at line 229 of file nr-epc-pgw-application.cc.
References ns3::NrGtpuHeader::GetTeid(), and SendToTunDevice().
Referenced by NrEpcPgwApplication().
bool ns3::NrEpcPgwApplication::RecvFromTunDevice | ( | Ptr< Packet > | packet, |
const Address & | source, | ||
const Address & | dest, | ||
uint16_t | protocolNumber | ||
) |
Method to be assigned to the callback of the SGi TUN VirtualNetDevice. It is called when the PGW receives a data packet from the internet (including IP headers) that is to be sent to the UE via its associated SGW and gNB, tunneling IP over GTP-U/UDP/IP.
packet | |
source | |
dest | |
protocolNumber |
Definition at line 153 of file nr-epc-pgw-application.cc.
References SendToS5uSocket().
Referenced by ns3::NrNoBackhaulEpcHelper::NrNoBackhaulEpcHelper().
void ns3::NrEpcPgwApplication::SendToS5uSocket | ( | Ptr< Packet > | packet, |
Ipv4Address | sgwS5uAddress, | ||
uint32_t | teid | ||
) |
Send a data packet to the SGW via the S5-U interface
packet | packet to be sent |
sgwS5uAddress | the address of the SGW |
teid | the Tunnel Endpoint Identifier |
Definition at line 455 of file nr-epc-pgw-application.cc.
References ns3::NrGtpuHeader::SetLength(), and ns3::NrGtpuHeader::SetTeid().
Referenced by RecvFromTunDevice().
void ns3::NrEpcPgwApplication::SendToTunDevice | ( | Ptr< Packet > | packet, |
uint32_t | teid | ||
) |
Send a data packet to the internet via the SGi interface of the PGW
packet | packet to be sent |
teid | the Tunnel Endpoint Identifier |
Definition at line 424 of file nr-epc-pgw-application.cc.
Referenced by RecvFromS5uSocket().
void ns3::NrEpcPgwApplication::SetUeAddress | ( | uint64_t | imsi, |
Ipv4Address | ueAddr | ||
) |
Set the address of a previously added UE
imsi | the unique identifier of the UE |
ueAddr | the IPv4 address of the UE |
Definition at line 485 of file nr-epc-pgw-application.cc.
void ns3::NrEpcPgwApplication::SetUeAddress6 | ( | uint64_t | imsi, |
Ipv6Address | ueAddr | ||
) |
set the address of a previously added UE
imsi | the unique identifier of the UE |
ueAddr | the IPv6 address of the UE |
Definition at line 495 of file nr-epc-pgw-application.cc.