Skip to content
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.

yeastengine/pfcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PFCP

GoDoc

A Go library for using the PFCP protocol in 5G networks as defined in the ETSI TS 29.244 specification.

Usage

Client

package main

import (
	"log"
	"time"

	"github.com/dot-5g/pfcp/client"
	"github.com/dot-5g/pfcp/ie"
	"github.com/dot-5g/pfcp/messages"
)

func main() {
	pfcpClient := client.New("1.2.3.4:8805")
	recoveryTimeStamp, err := ie.NewRecoveryTimeStamp(time.Now())
	if err != nil {
		log.Fatalf("Error creating Recovery TimeStamp: %v", err)
	}
	sequenceNumber := uint32(21)
	heartbeatRequestMsg := messages.HeartbeatRequest{
		RecoveryTimeStamp: recoveryTimeStamp,
	}
	pfcpClient.SendHeartbeatRequest(heartbeatRequestMsg, sequenceNumber)
}

Server

package main

import (
	"fmt"

	"github.com/dot-5g/pfcp/messages"
	"github.com/dot-5g/pfcp/server"
)

func main() {
	pfcpServer := server.New("localhost:8805")
	pfcpServer.HeartbeatRequest(HandleHeartbeatRequest)
	go pfcpServer.Run()
}

func HandleHeartbeatRequest(sequenceNumber uint32, msg messages.HeartbeatRequest) {
	fmt.Printf("Received Heartbeat Request - Recovery TimeStamp: %v", msg.RecoveryTimeStamp)
}

Procedures

Node

  • Heartbeat
  • Load Control (Optional)
  • Overload Control (Optional)
  • PFCP PFD Management (Optional)
  • PFCP Association Setup
  • PFCP Association Update
  • PFCP Association Release
  • PFCP Node Report

Session

  • PFCP Session Establishment
  • PFCP Session Modification
  • PFCP Session Deletion
  • PFCP Session Report