pfcp

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RECEIVE_CHANNEL_LEN       = 512
	REPORT_CHANNEL_LEN        = 128
	TRANS_TIMEOUT_CHANNEL_LEN = 64
	MAX_PFCP_MSG_LEN          = 65536
)
View Source
const (
	BUFFQ_LEN = 512
)
View Source
const (
	Number_of_simultaneous_workers = 15 //fine tune through testing (until the actual delay stabalizes and this measuring is not delaying it!)
)

Variables

View Source
var (
	//upLink only
	Time_of_last_arrived_packet_per_UE_destination_combo = make(map[string]time.Time)
	Start_time_per_UE_destination_combo                  = make(map[string]time.Time)
	Latest_latency_measured_per_UE_destination_combo     = make(map[string]uint32)
	Time_of_last_issued_report_per_UE_destination_combo  = make(map[string]time.Time)
	SRRFound                                             = false
	Mu1                                                  sync.Mutex
)
View Source
var (
	SotredSrrsToBeUsedByUpf = make(map[uint8][]*QoSControlInfo)
	SrrMapLock              = sync.RWMutex{}
)
View Source
var QoSflow_DownlinkPacketDelayThresholds sync.Map
View Source
var QoSflow_MeasurementPeriod sync.Map
View Source
var QoSflow_MinimumWaitTime sync.Map
View Source
var QoSflow_PacketDelayThresholds sync.Map
View Source
var QoSflow_ReportedFrequency sync.Map
View Source
var QoSflow_RequestedMonitoring sync.Map

QoS flows are based on destination IPs in our case

View Source
var QoSflow_RoundTripPacketDelayThresholds sync.Map
View Source
var QoSflow_UplinkPacketDelayThresholds sync.Map

Functions

func CapturePackets

func CapturePackets(interface_name string, file_to_save_captured_packets string)

func GetQoSFlowMonitoringContent

func GetQoSFlowMonitoringContent() error

will be used by capturePackets to retrieve all required QoSFlow for monitoring

func GetValuesToBeReported_Chan

func GetValuesToBeReported_Chan() <-chan ToBeReported

func New_values_listener

func New_values_listener()

func StartPacketCapture

func StartPacketCapture(interface_name string, file_to_save_captured_packets string)

Types

type LocalNode

type LocalNode struct {
	// contains filtered or unexported fields
}

func (*LocalNode) DeleteSess

func (n *LocalNode) DeleteSess(lSeid uint64) ([]report.USAReport, error)

func (*LocalNode) NewSess

func (n *LocalNode) NewSess(rSeid uint64, qlen int) *Sess

func (*LocalNode) RemoteSess

func (n *LocalNode) RemoteSess(rSeid uint64, addr net.Addr) (*Sess, error)

func (*LocalNode) Reset

func (n *LocalNode) Reset()

func (*LocalNode) Sess

func (n *LocalNode) Sess(lSeid uint64) (*Sess, error)

type PDRInfo

type PDRInfo struct {
	RelatedURRIDs map[uint32]struct{}
}

type PfcpServer

type PfcpServer struct {
	// contains filtered or unexported fields
}

func NewPfcpServer

func NewPfcpServer(cfg *factory.Config, driver forwarder.Driver) *PfcpServer

func (*PfcpServer) NewNode

func (s *PfcpServer) NewNode(id string, addr net.Addr, driver forwarder.Driver) *RemoteNode

func (*PfcpServer) NewValuesListener

func (s *PfcpServer) NewValuesListener(addr net.Addr, lSeid uint64)

func (*PfcpServer) NotifySessReport

func (s *PfcpServer) NotifySessReport(sr report.SessReport)

func (*PfcpServer) NotifyTransTimeout

func (s *PfcpServer) NotifyTransTimeout(trType TransType, trID string)

func (*PfcpServer) PopBufPkt

func (s *PfcpServer) PopBufPkt(seid uint64, pdrid uint16) ([]byte, bool)

func (*PfcpServer) ServeReport

func (s *PfcpServer) ServeReport(sr *report.SessReport)

func (*PfcpServer) Start

func (s *PfcpServer) Start(wg *sync.WaitGroup)

func (*PfcpServer) Stop

func (s *PfcpServer) Stop()

func (*PfcpServer) UpdateNodeID

func (s *PfcpServer) UpdateNodeID(n *RemoteNode, newId string)

type QoSControlInfo

type QoSControlInfo struct {
	QFI                            uint8
	RequestedQoSMonitoring         uint8
	ReportingFrequency             uint8
	PacketDelayThresholds          uint8
	DownlinkPacketDelayThresholds  uint32
	UplinkPacketDelayThresholds    uint32
	RoundTripPacketDelayThresholds uint32
	MinimumWaitTime                time.Duration
	MeasurementPeriod              time.Duration
}

func GetSRRContent

func GetSRRContent(srrID uint8) ([]*QoSControlInfo, error)

type ReceivePacket

type ReceivePacket struct {
	RemoteAddr net.Addr
	Buf        []byte
}

type RemoteNode

type RemoteNode struct {
	ID string
	// contains filtered or unexported fields
}

func NewRemoteNode

func NewRemoteNode(
	id string,
	addr net.Addr,
	local *LocalNode,
	driver forwarder.Driver,
	log *logrus.Entry,
) *RemoteNode

func (*RemoteNode) DeleteSess

func (n *RemoteNode) DeleteSess(lSeid uint64) []report.USAReport

func (*RemoteNode) NewSess

func (n *RemoteNode) NewSess(rSeid uint64) *Sess

func (*RemoteNode) Reset

func (n *RemoteNode) Reset()

func (*RemoteNode) Sess

func (n *RemoteNode) Sess(lSeid uint64) (*Sess, error)

type RxTransaction

type RxTransaction struct {
	// contains filtered or unexported fields
}

func NewRxTransaction

func NewRxTransaction(
	server *PfcpServer,
	raddr net.Addr,
	seq uint32,
) *RxTransaction

type Sess

type Sess struct {
	LocalID  uint64
	RemoteID uint64
	PDRIDs   map[uint16]*PDRInfo         // key: PDR_ID
	FARIDs   map[uint32]struct{}         // key: FAR_ID
	QERIDs   map[uint32]struct{}         // key: QER_ID
	URRIDs   map[uint32]*URRInfo         // key: URR_ID
	BARIDs   map[uint8]struct{}          // key: BAR_ID
	SRRIDs   map[uint8][]*QoSControlInfo // key: SRR_ID | for each SRRID there can be multiple QoSControlblabla
	// contains filtered or unexported fields
}

func (*Sess) Close

func (s *Sess) Close() []report.USAReport

func (*Sess) CreateBAR

func (s *Sess) CreateBAR(req *ie.IE) error

func (*Sess) CreateFAR

func (s *Sess) CreateFAR(req *ie.IE) error

func (*Sess) CreatePDR

func (s *Sess) CreatePDR(req *ie.IE) error

func (*Sess) CreateQER

func (s *Sess) CreateQER(req *ie.IE) error

func (*Sess) CreateSRR

func (s *Sess) CreateSRR(req *ie.IE) error

func (*Sess) CreateURR

func (s *Sess) CreateURR(req *ie.IE) error

func (*Sess) Len

func (s *Sess) Len(pdrid uint16) int

func (*Sess) Pop

func (s *Sess) Pop(pdrid uint16) ([]byte, bool)

func (*Sess) Push

func (s *Sess) Push(pdrid uint16, p []byte)

func (*Sess) QueryURR

func (s *Sess) QueryURR(req *ie.IE) ([]report.USAReport, error)

func (*Sess) RemoveBAR

func (s *Sess) RemoveBAR(req *ie.IE) error

func (*Sess) RemoveFAR

func (s *Sess) RemoveFAR(req *ie.IE) error

func (*Sess) RemovePDR

func (s *Sess) RemovePDR(req *ie.IE) ([]report.USAReport, error)

func (*Sess) RemoveQER

func (s *Sess) RemoveQER(req *ie.IE) error

func (*Sess) RemoveURR

func (s *Sess) RemoveURR(req *ie.IE) ([]report.USAReport, error)

func (*Sess) URRSeq

func (s *Sess) URRSeq(urrid uint32) uint32

func (*Sess) UpdateBAR

func (s *Sess) UpdateBAR(req *ie.IE) error

func (*Sess) UpdateFAR

func (s *Sess) UpdateFAR(req *ie.IE) error

func (*Sess) UpdatePDR

func (s *Sess) UpdatePDR(req *ie.IE) ([]report.USAReport, error)

func (*Sess) UpdateQER

func (s *Sess) UpdateQER(req *ie.IE) error

func (*Sess) UpdateURR

func (s *Sess) UpdateURR(req *ie.IE) ([]report.USAReport, error)

type ToBeReported

type ToBeReported struct {
	QFI                      uint8
	QoSMonitoringMeasurement uint32
	EventTimeStamp           time.Time //change to uint32 later NOT PRESSING
	StartTime                time.Time //change to uint32
}

type TransType

type TransType int
const (
	TX TransType = iota
	RX
)

type TransactionTimeout

type TransactionTimeout struct {
	TrType TransType
	TrID   string
}

type TxTransaction

type TxTransaction struct {
	// contains filtered or unexported fields
}

func NewTxTransaction

func NewTxTransaction(
	server *PfcpServer,
	raddr net.Addr,
	seq uint32,
) *TxTransaction

type URRInfo

type URRInfo struct {
	SEQN uint32
	report.MeasureMethod
	report.MeasureInformation
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL