【5G核心网】5GC核心网之网元AMF

AMF: 接入及移动性管理功能 Access and Mobility Management Function

【5G核心网】5GC核心网之网元AMF_第1张图片 5G 核心网架构

     N1 UE <--> AMF  NAS

     N2 AN  <--> AMF  NGAP  TS 38.413 [34]  AN 节点和 AMF 之间的应用层协议

 

Service Name

Service Operations

Operation

Semantic

Known Consumer(s)

Namf_Communication

UEContextTransfer

Request/ Response

Peer AMF

 

CreateUEContext

Request/ Response

Peer AMF

 

ReleaseUEContext

Request/ Response

Peer AMF

 

RegistrationStatusUpdate

Request/ Response

Peer AMF

 

N1MessageNotify

Subscribe / Notify

SMF, SMSF, PCF, LMF, Peer AMF

 

N1MessageSubscribe

 

SMF, SMSF, PCF

 

N1MessageUnSubscribe

 

SMF, SMSF, PCF

 

N1N2MessageTransfer

Request/ Response

SMF, SMSF, PCF, LMF

 

N1N2TransferFailureNotification

Subscribe / Notify

SMF, SMSF, PCF, LMF

 

N2InfoSubscribe

Subscribe / Notify

NOTE 1

 

N2InfoUnSubscribe

 

NOTE 1

 

N2InfoNotify

 

AMF, LMF

 

EBIAssignment

Request/Response

SMF

 

AMFStatusChangeSubscribe

Subscribe / Notify

SMF, PCF, NEF, SMSF, UDM

 

AMFStatusChangeUnSubscribe

Subscribe / Notify

SMF, PCF, NEF, SMSF, UDM

 

AMFStatusChangeNotify

Subscribe / Notify

SMF, PCF, NEF, SMSF, UDM

 

NonUeN2MessageTransfer

Request/Response

Peer AMF, CBCF, PWS-IWF, LMF

 

NonUeN2InfoSubscribe

Subscribe / Notify

CBCF, PWS-IWF

 

NonUeN2InfoUnSubscribe

 

CBCF, PWS-IWF

 

NonUeN2InfoNotify

 

CBCF, PWS-IWF, LMF

Namf_EventExposure

Subscribe

Subscribe / Notify

NEF, SMF, UDM, NWDAF

 

Unsubscribe

Subscribe / Notify

NEF, SMF, UDM, NWDAF

 

Notify

Subscribe / Notify

NEF, SMF, UDM, NWDAF

Namf_MT

EnableUEReachability

Request/Response

SMSF

 

ProvideDomainSelectionInfo

Request/Response

UDM

Namf_Location

ProvidePositioningInfo

Request/Response

GMLC

 

EventNotify

Subscribe / Notify

GMLC

 

ProvideLocationInfo

Request/Response

UDM

 

CancelLocation

Request/Response

GMLC

NOTE 1: In this Release of the specification no known consumer is identified to use this service operation.

                                                         Table 5.2.2.1-1: List of AMF Services TS 23502

 

1. AMF 程序初始化以及启动

   1.1 启动 httpcallback 服务

     httpcallback.AddService(router),实现在 afm/httpcallback 中,URL 以及 handler 如下所示:

Name

Pattern

HandlerFunc

Index
/
Index
SmContextStatusNotify
/smContextStatus/:guti/:pduSessionId
SmContextStatusNotify
AmPolicyControlUpdateNotifyUpdate
/am-policy/:polAssoId/update
AmPolicyControlUpdateNotifyUpdate
AmPolicyControlUpdateNotifyTerminate
/am-policy/:polAssoId/terminate
AmPolicyControlUpdateNotifyTerminate
N1MessageNotify
/n1-message-notify
N1MessageNotify

    1.2 根据配置文件中的服务列表启动服务

       serviceNameList: - namf-comm - namf-evts - namf-mt - namf-loc - namf-oam

for _, serviceName := range factory.AmfConfig.Configuration.ServiceNameList {
	switch models.ServiceName(serviceName) {
	case models.ServiceName_NAMF_COMM:
		communication.AddService(router)
	case models.ServiceName_NAMF_EVTS:
		eventexposure.AddService(router)
	case models.ServiceName_NAMF_MT:
		mt.AddService(router)
	case models.ServiceName_NAMF_LOC:
		location.AddService(router)
	}
}

    1.3 初始化 amf 上下文

     通过配置文件,较简单,amf 监听端口为 29518

	self := context.AMF_Self()
	util.InitAmfContext(self)

	addr := fmt.Sprintf("%s:%d", self.HttpIPv4Address, self.HttpIpv4Port)

    1.4 根据 ngap IP 列表建立 SCTP 服务

      TCP是以字节为单位传输的,SCTP是以数据块为单位传输的

      TCP通常是单路径传输,SCTP可以多路径传输

	for _, ngapAddr := range self.NgapIpList {
		sctpListener = sctp.Server(ngapAddr)
	}

     1.5 核心处理流程

      实现在 amf/handler/hander.go

go handler.Handle()

    1.6 注册到 NRF

      amf id 组成 regionId: 16bits, setId: 10bits, ptrId: 6bits     =

      调用 NRF Nnrf_NFManagement,注册

// Register to NRF
profile, err := consumer.BuildNFInstance(self)
if err != nil {
	initLog.Error("Build AMF Profile Error")
}

_, self.NfId, _ = consumer.SendRegisterNFInstance(self.NrfUri, self.NfId, profile)

 

名词解释:

    SCTP,Stream Control Transmission Protocol

    PLMN,Public Land Mobile Network  公共陆地移动网 ,一般特指某个运营商的网络覆盖区域

    MCC,Mobile Country Code

    MNC,Mobile Network Code

    GUAMI,全球唯一的  AMF 标识符    =

    TAI,Tracking Area Identity    跟踪区域标识

    GUTI,Globally Unique Temporary UE Identity  全局唯一的临时UE标识,目的减少在通信中显示使用UE的永久性标识,提升安全性

    SUPI,用户的唯一永久身份标志

 

   配置文件:

info:
  version: 1.0.0
  description: AMF initial local configuration

configuration:
  amfName: AMF
  ngapIpList:
    - 127.0.0.10
  sbi:
    scheme: http
    ipv4Addr: 127.0.0.1
    port: 29518
  serviceNameList:
    - namf-comm
    - namf-evts
    - namf-mt
    - namf-loc
    - namf-oam
  servedGuamiList:
    - plmnId:
        mcc: 208
        mnc: 93
      amfId: cafe00
  supportTaiList:
    - plmnId:
        mcc: 208
        mnc: 93
      tac: 1
  plmnSupportList:
    - plmnId:
        mcc: 208
        mnc: 93
      snssaiList:
        - sst: 1
          sd: 010203
        - sst: 1
          sd: 112233
  supportDnnList:
    - internet
  nrfUri: http://localhost:29510
  security:
    integrityOrder:
      - NIA2
      - NIA0
    cipheringOrder:
      - NEA2
      - NEA0
  networkName:
    full: free5GC
    short: free
  t3502: 720
  t3512: 3600
  non3gppDeregistrationTimer: 3240

 

你可能感兴趣的:(5G)