Documentation
¶
Index ¶
- Variables
- func DisplayConfig() func(c *gin.Context)
- func DisplayPacketStats(forwardPlaneStats ebpf.UpfXdpActionStatistic) func(c *gin.Context)
- func DisplayXdpStatistics(forwardPlaneStats ebpf.UpfXdpActionStatistic) func(c *gin.Context)
- func EditConfig(c *gin.Context)
- func GetFarValue(bpfObjects *ebpf.BpfObjects) func(c *gin.Context)
- func GetQerValue(bpfObjects *ebpf.BpfObjects) func(c *gin.Context)
- func GetTransportLevelMarking(far *ie.IE) (uint16, error)
- func GetUplinkPdrValue(bpfObjects *ebpf.BpfObjects) func(c *gin.Context)
- func HandlePfcpAssociationSetupRequest(conn *PfcpConnection, msg message.Message, addr string) (message.Message, error)
- func HandlePfcpHeartbeatRequest(conn *PfcpConnection, msg message.Message, addr string) (message.Message, error)
- func HandlePfcpHeartbeatResponse(conn *PfcpConnection, msg message.Message, addr string) (message.Message, error)
- func HandlePfcpSessionDeletionRequest(conn *PfcpConnection, msg message.Message, addr string) (message.Message, error)
- func HandlePfcpSessionEstablishmentRequest(conn *PfcpConnection, msg message.Message, addr string) (message.Message, error)
- func HandlePfcpSessionModificationRequest(conn *PfcpConnection, msg message.Message, addr string) (message.Message, error)
- func InitLogger()
- func ListPfcpAssociations(pfcpSrv *PfcpConnection) func(c *gin.Context)
- func ListPfcpAssociationsFull(pfcpSrv *PfcpConnection) func(c *gin.Context)
- func ListPfcpSessionsFiltered(pfcpSrv *PfcpConnection) func(c *gin.Context)
- func ListQerMapContent(bpfObjects *ebpf.BpfObjects) func(c *gin.Context)
- func ListUpfPipeline(bpfObjects *ebpf.BpfObjects) func(c *gin.Context)
- func ParseCidrIp(ipStr, maskStr string) (ebpf.IpWMask, error)
- func ParsePort(str string) (uint16, error)
- func ParsePortRange(str string) (ebpf.PortRange, error)
- func ParseProtocol(protocol string) (uint8, error)
- func ParseSdfFilter(flowDescription string) (ebpf.SdfFilter, error)
- func RegisterMetrics(stats ebpf.UpfXdpActionStatistic, conn *PfcpConnection)
- func SendHeartbeatRequest(conn *PfcpConnection, sequenceID uint32, associationAddr string)
- func SetConfig(conf config.UpfConfig) error
- func SetFarValue(bpfObjects *ebpf.BpfObjects) func(c *gin.Context)
- func SetLoggerLevel(loggingLevel string) error
- func SetQerValue(bpfObjects *ebpf.BpfObjects) func(c *gin.Context)
- func SetUplinkPdrValue(bpfObjects *ebpf.BpfObjects) func(c *gin.Context)
- func StartMetrics(addr string) error
- type ApiServer
- type FarMapElement
- type GtpPathManager
- type NodeAssociation
- func (association *NodeAssociation) IsExpired() bool
- func (association *NodeAssociation) IsHeartbeatScheduled() bool
- func (association *NodeAssociation) NewLocalSEID() uint64
- func (association *NodeAssociation) NewSequenceID() uint32
- func (association *NodeAssociation) RefreshRetries()
- func (association *NodeAssociation) ScheduleHeartbeatRequest(duration time.Duration, conn *PfcpConnection) context.CancelFunc
- type NodeAssociationMapNoSession
- type NodeAssociationNoSession
- type PDRCreationContext
- type PacketStats
- type PdrElement
- type PfcpConnection
- func (connection *PfcpConnection) Close()
- func (connection *PfcpConnection) DeleteAssociation(assocAddr string)
- func (connection *PfcpConnection) DeleteSession(session *Session)
- func (connection *PfcpConnection) GetAssiciationCount() int
- func (connection *PfcpConnection) GetAssociation(assocAddr string) *NodeAssociation
- func (connection *PfcpConnection) GetSessionCount() int
- func (connection *PfcpConnection) Handle(b []byte, addr *net.UDPAddr)
- func (connection *PfcpConnection) Receive(b []byte) (n int, addr *net.UDPAddr, err error)
- func (connection *PfcpConnection) RefreshAssociations()
- func (connection *PfcpConnection) ReleaseResources(seID uint64)
- func (connection *PfcpConnection) Run()
- func (connection *PfcpConnection) Send(b []byte, addr *net.UDPAddr) (int, error)
- func (connection *PfcpConnection) SendMessage(msg message.Message, addr *net.UDPAddr) error
- type PfcpFunc
- type PfcpHandlerMap
- type SFarInfo
- type SPDRInfo
- type SQerInfo
- type Session
- func FilterSessionsByIP(nodeMap *map[string]*NodeAssociation, filterByIP net.IP) *Session
- func FilterSessionsByTeid(nodeMap *map[string]*NodeAssociation, filterByTeid uint32) *Session
- func GetAllSessions(nodeMap *map[string]*NodeAssociation) (sessions []Session)
- func NewSession(localSEID uint64, remoteSEID uint64) *Session
- func (s *Session) GetFar(id uint32) SFarInfo
- func (s *Session) GetPDR(id uint16) SPDRInfo
- func (s *Session) GetQer(id uint32) SQerInfo
- func (s *Session) NewFar(id uint32, internalId uint32, farInfo ebpf.FarInfo)
- func (s *Session) NewQer(id uint32, internalId uint32, qerInfo ebpf.QerInfo)
- func (s *Session) PutPDR(id uint32, info SPDRInfo)
- func (s *Session) RemoveFar(id uint32) SFarInfo
- func (s *Session) RemovePDR(id uint32) SPDRInfo
- func (s *Session) RemoveQer(id uint32) SQerInfo
- func (s *Session) UpdateFar(id uint32, farInfo ebpf.FarInfo)
- func (s *Session) UpdateQer(id uint32, qerInfo ebpf.QerInfo)
- type XdpStats
Constants ¶
This section is empty.
Variables ¶
var ( PfcpMessageRx = promauto.NewCounterVec(prometheus.CounterOpts{ Name: "upf_pfcp_rx", Help: "The total number of received PFCP messages", }, []string{"message_name"}) PfcpMessageTx = promauto.NewCounterVec(prometheus.CounterOpts{ Name: "upf_pfcp_tx", Help: "The total number of transmitted PFCP messages", }, []string{"message_name"}) PfcpMessageRxErrors = promauto.NewCounterVec(prometheus.CounterOpts{ Name: "upf_pfcp_rx_errors", Help: "The total number of received PFCP messages with cause code", }, []string{"message_name", "cause_code"}) UpfXdpAborted prometheus.CounterFunc UpfXdpDrop prometheus.CounterFunc UpfXdpPass prometheus.CounterFunc UpfXdpTx prometheus.CounterFunc UpfXdpRedirect prometheus.CounterFunc UpfPfcpSessions prometheus.GaugeFunc UpfPfcpAssociations prometheus.GaugeFunc UpfRx = promauto.NewCounterVec(prometheus.CounterOpts{ Name: "upf_rx", Help: "The total number of received packets", }, []string{"packet_type"}) UpfMessageRxLatency = promauto.NewSummaryVec(prometheus.SummaryOpts{ Name: "upf_pfcp_rx_latency", Subsystem: "pfcp", Help: "Duration of the PFCP message processing", Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001}, }, []string{"message_type"}) )
Functions ¶
func DisplayConfig ¶
DisplayConfig godoc @Summary Display configuration @Description Display configuration @Tags Configuration @Produce json @Success 200 {object} config.UpfConfig @Router /config [get]
func DisplayPacketStats ¶ added in v0.4.1
func DisplayPacketStats(forwardPlaneStats ebpf.UpfXdpActionStatistic) func(c *gin.Context)
DisplayPacketStats godoc @Summary Display packet statistics @Description Display packet statistics @Tags Packet @Produce json @Success 200 {object} PacketStats @Router /packet_stats [get]
func DisplayXdpStatistics ¶
func DisplayXdpStatistics(forwardPlaneStats ebpf.UpfXdpActionStatistic) func(c *gin.Context)
DisplayXdpStatistics godoc @Summary Display XDP statistics @Description Display XDP statistics @Tags XDP @Produce json @Success 200 {object} XdpStats @Router /xdp_stats [get]
func EditConfig ¶ added in v0.5.0
func GetFarValue ¶ added in v0.5.0
func GetFarValue(bpfObjects *ebpf.BpfObjects) func(c *gin.Context)
func GetQerValue ¶ added in v0.5.0
func GetQerValue(bpfObjects *ebpf.BpfObjects) func(c *gin.Context)
GetQerValue godoc @Summary List QER map content @Description List QER map content @Tags QER @Produce json @Param id path int true "Qer ID" @Success 200 {object} []ebpf.QerMapElement @Router /qer_map/{id} [get]
func GetTransportLevelMarking ¶ added in v0.3.4
func GetUplinkPdrValue ¶ added in v0.5.0
func GetUplinkPdrValue(bpfObjects *ebpf.BpfObjects) func(c *gin.Context)
func HandlePfcpAssociationSetupRequest ¶
func HandlePfcpAssociationSetupRequest(conn *PfcpConnection, msg message.Message, addr string) (message.Message, error)
https://www.etsi.org/deliver/etsi_ts/129200_129299/129244/16.04.00_60/ts_129244v160400p.pdf page 95
func HandlePfcpHeartbeatResponse ¶ added in v0.3.3
func InitLogger ¶ added in v0.5.0
func InitLogger()
func ListPfcpAssociations ¶
func ListPfcpAssociations(pfcpSrv *PfcpConnection) func(c *gin.Context)
ListPfcpAssociations godoc @Summary List PFCP associations @Description List PFCP associations @Tags PFCP @Produce json @Success 200 {object} NodeAssociationMapNoSession @Router /pfcp_associations [get]
func ListPfcpAssociationsFull ¶
func ListPfcpAssociationsFull(pfcpSrv *PfcpConnection) func(c *gin.Context)
ListPfcpAssociationsFull godoc @Summary List PFCP associations @Description List PFCP associations @Tags PFCP @Produce json @Success 200 {object} map[string]core.NodeAssociation @Router /pfcp_associations/full [get]
func ListPfcpSessionsFiltered ¶
func ListPfcpSessionsFiltered(pfcpSrv *PfcpConnection) func(c *gin.Context)
ListPfcpSessionsFiltered godoc @Summary If no parameters are given, list all PFCP sessions. If ip or teid is given, single session will be returned. If both ip and teid are given, it is possible to return two sessions. @Tags PFCP @Produce json @Param ip query string false "ip" @Param teid query int false "teid" @Success 200 {object} []core.Session @Router /pfcp_sessions [get]
func ListQerMapContent ¶
func ListQerMapContent(bpfObjects *ebpf.BpfObjects) func(c *gin.Context)
ListQerMapContent godoc @Summary List QER map content @Description List QER map content @Tags QER @Produce json @Success 200 {object} []ebpf.QerMapElement @Router /qer_map [get]
func ListUpfPipeline ¶
func ListUpfPipeline(bpfObjects *ebpf.BpfObjects) func(c *gin.Context)
ListUpfPipeline godoc @Summary List UPF pipeline @Description List UPF pipeline @Tags UPF @Produce json @Success 200 {object} []ebpf.BpfMapProgArrayMember @Router /upf_pipeline [get]
func ParseProtocol ¶ added in v0.5.0
func ParseSdfFilter ¶ added in v0.5.0
func RegisterMetrics ¶
func RegisterMetrics(stats ebpf.UpfXdpActionStatistic, conn *PfcpConnection)
func SendHeartbeatRequest ¶ added in v0.3.3
func SendHeartbeatRequest(conn *PfcpConnection, sequenceID uint32, associationAddr string)
func SetFarValue ¶ added in v0.5.0
func SetFarValue(bpfObjects *ebpf.BpfObjects) func(c *gin.Context)
func SetLoggerLevel ¶ added in v0.5.0
func SetQerValue ¶ added in v0.5.0
func SetQerValue(bpfObjects *ebpf.BpfObjects) func(c *gin.Context)
func SetUplinkPdrValue ¶ added in v0.5.0
func SetUplinkPdrValue(bpfObjects *ebpf.BpfObjects) func(c *gin.Context)
func StartMetrics ¶
Types ¶
type ApiServer ¶
type ApiServer struct {
// contains filtered or unexported fields
}
func CreateApiServer ¶
func CreateApiServer(bpfObjects *ebpf.BpfObjects, pfcpSrv *PfcpConnection, forwardPlaneStats ebpf.UpfXdpActionStatistic) *ApiServer
type FarMapElement ¶ added in v0.5.0
type GtpPathManager ¶ added in v0.6.0
type GtpPathManager struct {
// contains filtered or unexported fields
}
func NewGtpPathManager ¶ added in v0.6.0
func NewGtpPathManager(localAddress string, interval time.Duration) *GtpPathManager
func (*GtpPathManager) AddGtpPath ¶ added in v0.6.0
func (gtpPathManager *GtpPathManager) AddGtpPath(gtpPeerAddress string)
func (*GtpPathManager) Run ¶ added in v0.6.0
func (gtpPathManager *GtpPathManager) Run()
func (*GtpPathManager) Stop ¶ added in v0.6.0
func (gtpPathManager *GtpPathManager) Stop()
type NodeAssociation ¶
type NodeAssociation struct { ID string Addr string NextSessionID uint64 NextSequenceID uint32 Sessions map[uint64]*Session HeartbeatRetries uint32 // contains filtered or unexported fields }
func NewNodeAssociation ¶ added in v0.3.3
func NewNodeAssociation(remoteNodeID string, addr string) *NodeAssociation
func (*NodeAssociation) IsExpired ¶ added in v0.3.3
func (association *NodeAssociation) IsExpired() bool
func (*NodeAssociation) IsHeartbeatScheduled ¶ added in v0.3.3
func (association *NodeAssociation) IsHeartbeatScheduled() bool
func (*NodeAssociation) NewLocalSEID ¶
func (association *NodeAssociation) NewLocalSEID() uint64
func (*NodeAssociation) NewSequenceID ¶ added in v0.3.5
func (association *NodeAssociation) NewSequenceID() uint32
func (*NodeAssociation) RefreshRetries ¶ added in v0.3.3
func (association *NodeAssociation) RefreshRetries()
func (*NodeAssociation) ScheduleHeartbeatRequest ¶ added in v0.3.3
func (association *NodeAssociation) ScheduleHeartbeatRequest(duration time.Duration, conn *PfcpConnection) context.CancelFunc
ScheduleHeartbeatRequest schedules a series of heartbeat requests to be sent to the remote node. Return a cancellation function to stop the scheduled requests.
type NodeAssociationMapNoSession ¶
type NodeAssociationMapNoSession map[string]NodeAssociationNoSession
type PDRCreationContext ¶ added in v0.6.0
type PDRCreationContext struct { Session *Session ResourceManager *service.ResourceManager TEIDCache map[uint8]uint32 }
func NewPDRCreationContext ¶ added in v0.6.0
func NewPDRCreationContext(session *Session, resourceManager *service.ResourceManager) *PDRCreationContext
type PacketStats ¶ added in v0.4.1
type PacketStats struct { RxArp uint64 `json:"rx_arp"` RxIcmp uint64 `json:"rx_icmp"` RxIcmp6 uint64 `json:"rx_icmp6"` RxIp4 uint64 `json:"rx_ip4"` RxIp6 uint64 `json:"rx_ip6"` RxTcp uint64 `json:"rx_tcp"` RxUdp uint64 `json:"rx_udp"` RxOther uint64 `json:"rx_other"` RxGtpEcho uint64 `json:"rx_gtp_echo"` RxGtpPdu uint64 `json:"rx_gtp_pdu"` RxGtpOther uint64 `json:"rx_gtp_other"` RxGtpUnexp uint64 `json:"rx_gtp_unexp"` }
type PdrElement ¶ added in v0.5.0
type PfcpConnection ¶
type PfcpConnection struct { NodeAssociations map[string]*NodeAssociation RecoveryTimestamp time.Time ResourceManager *service.ResourceManager // contains filtered or unexported fields }
func CreatePfcpConnection ¶
func CreatePfcpConnection(addr string, pfcpHandlerMap PfcpHandlerMap, nodeId string, n3Ip string, mapOperations ebpf.ForwardingPlaneController, resourceManager *service.ResourceManager) (*PfcpConnection, error)
func (*PfcpConnection) Close ¶
func (connection *PfcpConnection) Close()
func (*PfcpConnection) DeleteAssociation ¶ added in v0.3.3
func (connection *PfcpConnection) DeleteAssociation(assocAddr string)
DeleteAssociation deletes an association and all sessions associated with it.
func (*PfcpConnection) DeleteSession ¶ added in v0.3.3
func (connection *PfcpConnection) DeleteSession(session *Session)
DeleteSession deletes a session and all PDRs, FARs and QERs associated with it.
func (*PfcpConnection) GetAssiciationCount ¶ added in v0.3.6
func (connection *PfcpConnection) GetAssiciationCount() int
func (*PfcpConnection) GetAssociation ¶ added in v0.3.3
func (connection *PfcpConnection) GetAssociation(assocAddr string) *NodeAssociation
func (*PfcpConnection) GetSessionCount ¶ added in v0.3.6
func (connection *PfcpConnection) GetSessionCount() int
func (*PfcpConnection) Handle ¶
func (connection *PfcpConnection) Handle(b []byte, addr *net.UDPAddr)
func (*PfcpConnection) RefreshAssociations ¶ added in v0.3.3
func (connection *PfcpConnection) RefreshAssociations()
RefreshAssociations checks for expired associations and schedules heartbeats for those that are not expired.
func (*PfcpConnection) ReleaseResources ¶ added in v0.6.0
func (connection *PfcpConnection) ReleaseResources(seID uint64)
func (*PfcpConnection) Run ¶
func (connection *PfcpConnection) Run()
func (*PfcpConnection) SendMessage ¶
type PfcpHandlerMap ¶
func (PfcpHandlerMap) Handle ¶
func (handlerMap PfcpHandlerMap) Handle(conn *PfcpConnection, buf []byte, addr *net.UDPAddr) error
type Session ¶
type Session struct { LocalSEID uint64 RemoteSEID uint64 PDRs map[uint32]SPDRInfo FARs map[uint32]SFarInfo QERs map[uint32]SQerInfo }
func FilterSessionsByIP ¶
func FilterSessionsByIP(nodeMap *map[string]*NodeAssociation, filterByIP net.IP) *Session
func FilterSessionsByTeid ¶
func FilterSessionsByTeid(nodeMap *map[string]*NodeAssociation, filterByTeid uint32) *Session
func GetAllSessions ¶
func GetAllSessions(nodeMap *map[string]*NodeAssociation) (sessions []Session)