Interface UpfDevice
-
- All Known Subinterfaces:
UpfProgrammable
@Beta public interface UpfDevice
Provides means to update forwarding state to implement a 3GPP User Plane Function.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addFar(ForwardingActionRule far)
Add a Forwarding Action Rule (FAR) to the given device.void
addInterface(UpfInterface upfInterface)
Install a new interface on the UPF device's interface lookup tables.void
addPdr(PacketDetectionRule pdr)
Add a Packet Detection Rule (PDR) to the given device.void
cleanUp()
Remove any state previously created by this API.void
clearFlows()
Remove all UE flows (PDRs, FARs) currently installed on the UPF-programmable device.void
clearInterfaces()
Remove all interfaces currently installed on the UPF-programmable device.void
disablePscEncap()
Disable PSC encap previously enabled withenablePscEncap(int)
.void
enablePscEncap(int defaultQfi)
Instructs the UPF-programmable device to use GTP-U extension PDU Session Container (PSC) when doing encap of downlink packets, with the given QoS Flow Identifier (QFI).long
farTableSize()
Return the number of maximum number of table entries the FAR table supports.Collection<ForwardingActionRule>
getFars()
Get all ForwardingActionRules currently installed on the UPF-programmable device.Collection<UpfInterface>
getInterfaces()
Get all UPF interface lookup entries currently installed on the UPF-programmable device.Collection<PacketDetectionRule>
getPdrs()
Get all PacketDetectionRules currently installed on the UPF-programmable device.long
pdrCounterSize()
Return the number of PDR counter cells available.long
pdrTableSize()
Return the total number of table entries the downlink and uplink PDR tables support.Collection<PdrStats>
readAllCounters(long maxCounterId)
Read the counter contents for all cell indices that are valid on the hardware switch.PdrStats
readCounter(int counterIdx)
Read the the given cell (Counter index) of the PDR counters from the given device.void
removeFar(ForwardingActionRule far)
Remove a previously installed Forwarding Action Rule (FAR) from the target device.void
removeInterface(UpfInterface upfInterface)
Remove a previously installed UPF interface from the target device.void
removePdr(PacketDetectionRule pdr)
Remove a previously installed Packet Detection Rule (PDR) from the target device.void
sendPacketOut(ByteBuffer data)
Sends the given data as a data plane packet-out through this device.
-
-
-
Method Detail
-
cleanUp
void cleanUp()
Remove any state previously created by this API.
-
clearInterfaces
void clearInterfaces()
Remove all interfaces currently installed on the UPF-programmable device.
-
clearFlows
void clearFlows()
Remove all UE flows (PDRs, FARs) currently installed on the UPF-programmable device.
-
getFars
Collection<ForwardingActionRule> getFars() throws UpfProgrammableException
Get all ForwardingActionRules currently installed on the UPF-programmable device.- Returns:
- a collection of installed FARs
- Throws:
UpfProgrammableException
- if FARs are unable to be read
-
getPdrs
Collection<PacketDetectionRule> getPdrs() throws UpfProgrammableException
Get all PacketDetectionRules currently installed on the UPF-programmable device.- Returns:
- a collection of installed PDRs
- Throws:
UpfProgrammableException
- if PDRs are unable to be read
-
getInterfaces
Collection<UpfInterface> getInterfaces() throws UpfProgrammableException
Get all UPF interface lookup entries currently installed on the UPF-programmable device.- Returns:
- a collection of installed interfaces
- Throws:
UpfProgrammableException
- if interfaces are unable to be read
-
addPdr
void addPdr(PacketDetectionRule pdr) throws UpfProgrammableException
Add a Packet Detection Rule (PDR) to the given device.- Parameters:
pdr
- The PDR to be added- Throws:
UpfProgrammableException
- if the PDR cannot be installed, or the counter index is out of bounds
-
removePdr
void removePdr(PacketDetectionRule pdr) throws UpfProgrammableException
Remove a previously installed Packet Detection Rule (PDR) from the target device.- Parameters:
pdr
- The PDR to be removed- Throws:
UpfProgrammableException
- if the PDR cannot be found
-
addFar
void addFar(ForwardingActionRule far) throws UpfProgrammableException
Add a Forwarding Action Rule (FAR) to the given device.- Parameters:
far
- The FAR to be added- Throws:
UpfProgrammableException
- if the FAR cannot be installed
-
removeFar
void removeFar(ForwardingActionRule far) throws UpfProgrammableException
Remove a previously installed Forwarding Action Rule (FAR) from the target device.- Parameters:
far
- The FAR to be removed- Throws:
UpfProgrammableException
- if the FAR cannot be found
-
addInterface
void addInterface(UpfInterface upfInterface) throws UpfProgrammableException
Install a new interface on the UPF device's interface lookup tables.- Parameters:
upfInterface
- the interface to install- Throws:
UpfProgrammableException
- if the interface cannot be installed
-
removeInterface
void removeInterface(UpfInterface upfInterface) throws UpfProgrammableException
Remove a previously installed UPF interface from the target device.- Parameters:
upfInterface
- the interface to be removed- Throws:
UpfProgrammableException
- if the interface cannot be found
-
readCounter
PdrStats readCounter(int counterIdx) throws UpfProgrammableException
Read the the given cell (Counter index) of the PDR counters from the given device.- Parameters:
counterIdx
- The counter cell index from which to read- Returns:
- A structure containing ingress and egress packet and byte counts for the given cellId.
- Throws:
UpfProgrammableException
- if the cell ID is out of bounds
-
pdrCounterSize
long pdrCounterSize()
Return the number of PDR counter cells available. The number of cells in the ingress and egress PDR counters are equivalent.- Returns:
- PDR counter size
-
farTableSize
long farTableSize()
Return the number of maximum number of table entries the FAR table supports.- Returns:
- the number of FARs that can be installed
-
pdrTableSize
long pdrTableSize()
Return the total number of table entries the downlink and uplink PDR tables support. Both tables support an equal number of entries, so the total is twice the size of either.- Returns:
- the total number of PDRs that can be installed
-
readAllCounters
Collection<PdrStats> readAllCounters(long maxCounterId) throws UpfProgrammableException
Read the counter contents for all cell indices that are valid on the hardware switch.maxCounterId
parameter is used to limit the number of counters retrieved from the UPF device. If the limit given is larger than the physical limit, the physical limit will be used. A limit of -1 removes limitations.- Parameters:
maxCounterId
- Maximum counter ID to retrieve from the UPF device.- Returns:
- A collection of counter values for all valid hardware counter cells
- Throws:
UpfProgrammableException
- if the counters are unable to be read
-
enablePscEncap
void enablePscEncap(int defaultQfi) throws UpfProgrammableException
Instructs the UPF-programmable device to use GTP-U extension PDU Session Container (PSC) when doing encap of downlink packets, with the given QoS Flow Identifier (QFI).- Parameters:
defaultQfi
- QFI to be used by default for all encapped packets.- Throws:
UpfProgrammableException
- if operation is not available
-
disablePscEncap
void disablePscEncap() throws UpfProgrammableException
Disable PSC encap previously enabled withenablePscEncap(int)
.- Throws:
UpfProgrammableException
- if operation is not available
-
sendPacketOut
void sendPacketOut(ByteBuffer data) throws UpfProgrammableException
Sends the given data as a data plane packet-out through this device. Data is expected to contain an Ethernet frame.The device should process the packet through the pipeline tables to select an output port and to apply eventual modifications (e.g., MAC rewrite for routing, pushing a VLAN tag, etc.).
- Parameters:
data
- Ethernet frame bytes- Throws:
UpfProgrammableException
- if operation is not available
-
-