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 apply​(UpfEntity entity)
      Applies the given UPF entity to the UPF-programmable device.
      void cleanUp()
      Removes any state previously created by this API.
      void delete​(UpfEntity entity)
      Deletes the given UPF entity from the UPF-programmable device.
      void deleteAll​(UpfEntityType entityType)
      Deletes the given UPF entity from the UPF-programmable device.
      void disablePscEncap()
      Disable PSC encap previously enabled with enablePscEncap().
      void enablePscEncap()
      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).
      Collection<? extends UpfEntity> readAll​(UpfEntityType entityType)
      Reads all the UPF entities of the given type from the UPF-programmable device.
      UpfCounter readCounter​(int counterId)
      Reads the given UPF counter ID from the UPF-programmable device.
      Collection<UpfCounter> readCounters​(long maxCounterId)
      Reads the UPF counter contents for all indices that are valid on the UPF-programmable device.
      void sendPacketOut​(ByteBuffer data)
      Sends the given data as a data plane packet-out through this device.
      long tableSize​(UpfEntityType entityType)
      Returns the total number of UPF entities of the given type supported by the UPF-programmable device.
    • Method Detail

      • cleanUp

        void cleanUp()
        Removes any state previously created by this API.
      • apply

        void apply​(UpfEntity entity)
            throws UpfProgrammableException
        Applies the given UPF entity to the UPF-programmable device.
        Parameters:
        entity - The UPF entity to be applied.
        Throws:
        UpfProgrammableException - if the given UPF entity can not be applied or the operation is not supported on the given UPF entity.
      • readAll

        Collection<? extends UpfEntity> readAll​(UpfEntityType entityType)
                                         throws UpfProgrammableException
        Reads all the UPF entities of the given type from the UPF-programmable device.
        Parameters:
        entityType - The type of entities to read.
        Returns:
        A collection of installed UPF entities.
        Throws:
        UpfProgrammableException - if UPF entity type is not available to be read or the operation is not supported on the given UPF entity type.
      • readCounter

        UpfCounter readCounter​(int counterId)
                        throws UpfProgrammableException
        Reads the given UPF counter ID from the UPF-programmable device.
        Parameters:
        counterId - The counter ID from which to read.
        Returns:
        The content of the UPF counter.
        Throws:
        UpfProgrammableException - if the counter ID is out of bounds.
      • readCounters

        Collection<UpfCounter> readCounters​(long maxCounterId)
                                     throws UpfProgrammableException
        Reads the UPF counter contents for all indices that are valid on the UPF-programmable device. maxCounterId parameter is used to limit the number of counters retrieved from the UPF. If the limit given is larger than the physical limit, the physical limit will be used. A limit of -1 removes limitations, and it is equivalent of calling readAll(UpfEntityType) passing the COUNTER UpfEntityType.
        Parameters:
        maxCounterId - Maximum counter ID to retrieve from the UPF device.
        Returns:
        A collection of UPF counters for all valid hardware counter cells.
        Throws:
        UpfProgrammableException - if the counters are unable to be read.
      • delete

        void delete​(UpfEntity entity)
             throws UpfProgrammableException
        Deletes the given UPF entity from the UPF-programmable device.
        Parameters:
        entity - The UPF entity to be removed.
        Throws:
        UpfProgrammableException - if the given UPF entity is not found or the operation is not supported on the given UPF entity.
      • deleteAll

        void deleteAll​(UpfEntityType entityType)
                throws UpfProgrammableException
        Deletes the given UPF entity from the UPF-programmable device.
        Parameters:
        entityType - The UPF entity type to be removed.
        Throws:
        UpfProgrammableException - if the given UPF entity is not found or the operation is not supported on the given UPF entity.
      • tableSize

        long tableSize​(UpfEntityType entityType)
                throws UpfProgrammableException
        Returns the total number of UPF entities of the given type supported by the UPF-programmable device. For entities that have a direction,returns the total amount of entities including both the downlink and the uplink directions.
        Parameters:
        entityType - The type of UPF programmable entities to retrieve the size from.
        Returns:
        The total number of supported UPF entities.
        Throws:
        UpfProgrammableException - if the operation is not supported on the given UPF entity.
      • enablePscEncap

        void enablePscEncap()
                     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).
        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