Documentation
¶
Index ¶
- Constants
- func AddRouting_Element(origin int64, ueID int64, destination int64, destType int, ue_State int, ...)
- func ForwardToAmf(message *ngapType.NGAPPDU, ue *LB_UE, startTime int64)
- func ForwardToGnb(message *ngapType.NGAPPDU, ue *LB_UE, startTime int64)
- func GenSCTPAddr(ip string, port int) (lbAddr *sctp.SCTPAddr, err error)
- func Print(gnbs *sync.Map)
- func PrintPerGNB(gnb *MetricsGNB)
- func SendByteToConn(conn *sctp.SCTPConn, message []byte)
- type LB_AMF
- type LB_Conn
- type LB_Context
- type LB_GNB
- type LB_UE
- func (ue *LB_UE) AddUeToAmf(next *LB_AMF)
- func (ue *LB_UE) CopyDataFromUeContextModel(ueContext models.UeContext)
- func (ue *LB_UE) DerivateAlgKey()
- func (ue *LB_UE) DerivateAnKey(anType models.AccessType)
- func (ue *LB_UE) DerivateKamf()
- func (ue *LB_UE) RegistrationComplete()
- func (ue *LB_UE) RemoveUeEntirely()
- func (ue *LB_UE) RemoveUeFromAMF()
- func (ue *LB_UE) RemoveUeFromGNB()
- func (ue *LB_UE) SelectSecurityAlg(intOrder, encOrder []uint8)
- type MetricsGNB
- type UniqueNumberGen
Constants ¶
const TypeAmf int = 0
const TypeGnb int = 1
const TypeIdAMFConn int = 1
const TypeIdDeregist int = 2
const TypeIdGNBConn int = 2
const TypeIdNotThere int = 0
const TypeIdRegist int = 0
const TypeIdRegular int = 1
Variables ¶
This section is empty.
Functions ¶
func AddRouting_Element ¶
func AddRouting_Element(origin int64, ueID int64, destination int64, destType int, ue_State int, startTime int64, endTime int64)
adds if needed a metricsUE to the MetricsGNB and a trace to the metricsUE
func ForwardToAmf ¶
Used to forward registered UE's messages to an AMF
func ForwardToGnb ¶
Used to forward registered UE's messages to an GNB
func GenSCTPAddr ¶
Use IP and port to generate *sctp.SCTPAddr
func PrintPerGNB ¶
func PrintPerGNB(gnb *MetricsGNB)
print for one GNB output depending on metricsLevel in the config file
func SendByteToConn ¶
Writing a slice of bytes to a sctp.SCTPConn
Types ¶
type LB_AMF ¶
type LB_AMF struct {
AmfID int64 // INTERNAL ID for this AMF
AmfTypeIdent int // Identifies the type of AMF
LB_Conn *LB_Conn // Stores all the connection related information
RelativeCapacity int64 // AMFs Relative Cap. -> extracted out of NGSetup
NumberOfConnectedUEs int64 // Amount of UEs that are connected to this AMF
Ues sync.Map // "List" of all UE that are processed by this AMF
/* logger */
Log *logrus.Entry
}
Type, that stores all relevant information of connected AMFs
func CreateAndAddAmfToLB ¶
Creates and adds an Amf to the LB_Context
func (*LB_AMF) ContainsUE ¶
takes UeID and returns true if UE exists in the AMFs list
func (*LB_AMF) FindUeByAMF_UE_ID ¶
Use a UEAMF-ID to find UE context, return *LbUe and true if found TODO
func (*LB_AMF) FindUeByRAN_UE_ID ¶
Use a UELB-ID to find UE context, return *LbUe and true if found
func (*LB_AMF) RemoveAmfContext ¶
func (amf *LB_AMF) RemoveAmfContext()
Removes AMF-Context and closes the Connection
type LB_Conn ¶
type LB_Conn struct {
ID int64 // internal AMF/GNB ID that is connected with Conn
TypeID int // type identifier of the connected AMF/GNB
Conn *sctp.SCTPConn // actual connection to AMF/GNB
Closed bool // determines whether the connection is closed
GnbPointer *LB_GNB
AmfPointer *LB_AMF
/* logger */
Log *logrus.Entry
}
universal type for all connections of the LB
type LB_Context ¶
type LB_Context struct {
Name string
NfId string
LbIP string // IPv4 adress of the LB
LbToAmfPort int // inital prot to connect to the first AMF
LbToAmfAddr *sctp.SCTPAddr // SCTP adress generated for AMFs
LbListenPort int // port to listen for GNBs
LbListenAddr *sctp.SCTPAddr // SCTP adress generated for GNBs
Running bool // true while the LB is not beeing terminated
NewAmf bool // indicates that a new AMF IP+Port have been added so that the LB can connect to it
NewRegistAmfIpList []string // Registration AMFs that have to be registred
NewRegularAmfIpList []string // Regular AMFs that have to be registred
NewDeregistAmfIpList []string // Deregistration AMFs that have to be registred
DifferentAmfTypes int // amount of different AMF types used
ContinuesAmfRegistration bool // true for continues accepting AMFs for registration
LB_GNBPool sync.Map // GNBs connected to the LB
RegistAMFPool sync.Map // AMFs connected to LB
RegularAMFPool sync.Map // AMFs connected to LB
DeregistAMFPool sync.Map // AMFs connected to LB
Next_Regist_Amf *LB_AMF // AMF that is used for the next UE entering registration
Next_Regular_Amf *LB_AMF // if 3 AMF types: AMF that is used for the next UE finishing registration
Next_Deregist_Amf *LB_AMF // if > 2 AMF types: AMF that is used for the next UE starting deregistration
IDGen *UniqueNumberGen
RelativeCapacity int64 // To build setup response
/* temp */
PlmnSupportList []factory.PlmnSupportItem
ServedGuamiList []models.Guami
/* logger */
Log *logrus.Entry
/* metrics */
MetricsLevel int
MetricsGNBs sync.Map
}
The LB's main context
func (*LB_Context) SelectNextDeregistAmf ¶
func (context *LB_Context) SelectNextDeregistAmf() bool
TODO:
func (*LB_Context) SelectNextRegistAmf ¶
func (context *LB_Context) SelectNextRegistAmf() bool
TODO:
func (*LB_Context) SelectNextRegularAmf ¶
func (context *LB_Context) SelectNextRegularAmf() bool
TODO:
type LB_GNB ¶
type LB_GNB struct {
GnbID int64 // INTERNAL ID for this GNB
LB_Conn *LB_Conn // stores all the connection related information
Ues sync.Map // "list" of all UE that are processed by this GNB
/* logger */
Log *logrus.Entry
}
Type, that stores all relevant information of connected GNBs
func CreateAndAddNewGnbToLB ¶
use sctp.SCTPConn to find RAN context, return *AmfRan and true if found
func (*LB_GNB) ContainsUE ¶
takes UeID and returns true if UE exists in the GNBs list
func (*LB_GNB) FindUeByRAN_UE_ID ¶
Use a UE-ID to find UE context, return *LbUe and true if found
func (*LB_GNB) RemoveGnbContext ¶
func (gnb *LB_GNB) RemoveGnbContext()
Removes GNB-Context and closes the Connection
type LB_UE ¶
type LB_UE struct {
UeStateIdent int // Identifies the state of the UE
GNB_UE_ID int64 // ID given to the UE by GNB/RAN
LB_UE_ID int64 // ID given to the UE by LB
AMF_UE_ID int64 // ID given to the UE by AMF
GnbID int64 // LB-internal ID of GNB that issued the UE
GnbPointer *LB_GNB // ponter to the connected GNB
AmfID int64 // LB-internal ID of AMF that processes the UE
AmfPointer *LB_AMF // ponter to the connected AMF
UplinkFlag bool // set true when Uplink-NAS-RegistrationComplete is done
ResponseFlag bool // set true when InitialContextSetupResponse is done
DeregFlag bool // set true when Uplink-NAS-Deregistration-Accept is done
/* nas decrypt */ // TODO
RRCECause string
ULCount security.Count //TODO amf_ue L728 | gmm HandleRegist HandleServiceRequest (only get())
DLCount security.Count // TODO set in CopyDataFromUeContextModel | .AddOne() in nas Encode()
Kamf string
Kgnb []uint8 // 32 byte
Kn3iwf []uint8 // 32 byte
CipheringAlg uint8
IntegrityAlg uint8
KnasInt [16]uint8 // 16 byte
KnasEnc [16]uint8 // 16 byte
Supi string
ABBA []uint8
Kseaf string
UESecurityCapability nasType.UESecurityCapability // for security command
// TODO set in NGAP HandlePathSwitchRequest
MacFailed bool // set to true if the integrity check of current NAS message is failed
/* logger */
Log *logrus.Entry
}
Type, that stores all relevant information of UEs
func (*LB_UE) AddUeToAmf ¶
Sets UEs values and adds it to the Amfs UE-Map
func (*LB_UE) CopyDataFromUeContextModel ¶
TODO
func (*LB_UE) DerivateAlgKey ¶
func (ue *LB_UE) DerivateAlgKey()
TODO Algorithm key Derivation function defined in TS 33.501 Annex A.9
func (*LB_UE) DerivateAnKey ¶
func (ue *LB_UE) DerivateAnKey(anType models.AccessType)
TODO Access Network key Derivation function defined in TS 33.501 Annex A.9
func (*LB_UE) DerivateKamf ¶
func (ue *LB_UE) DerivateKamf()
TODO Kamf Derivation function defined in TS 33.501 Annex A.7 gmm handler HandleAuthenticationResponse L1943 + 1978
func (*LB_UE) RegistrationComplete ¶
func (ue *LB_UE) RegistrationComplete()
func (*LB_UE) RemoveUeEntirely ¶
func (ue *LB_UE) RemoveUeEntirely()
Removes LbUe from AMF and RAN Context withing LB
func (*LB_UE) RemoveUeFromAMF ¶
func (ue *LB_UE) RemoveUeFromAMF()
Removes LbUe from AMF Context withing LB
func (*LB_UE) RemoveUeFromGNB ¶
func (ue *LB_UE) RemoveUeFromGNB()
Removes LbUe from RAN Context withing LB
func (*LB_UE) SelectSecurityAlg ¶
TODO
type MetricsGNB ¶
one for each registred GNB
type UniqueNumberGen ¶
Generator for UE-IDs
func NewUniqueNumberGen ¶
func NewUniqueNumberGen(StartNumber int64) *UniqueNumberGen
Creates, initializes and returns a new *UeIdGen
func (*UniqueNumberGen) NextNumber ¶
func (gen *UniqueNumberGen) NextNumber() int64
Selects the next available LB-internal ID for a UE
func (*UniqueNumberGen) RecycleNumber ¶
func (gen *UniqueNumberGen) RecycleNumber(id int64)
not used at the moment Takes unused IDs and makes them available for reuse