1、GSM/GPRS Protocol Stack ArchitectureVito TaiOutlinenGSM/GPRS Protocol Stack ArchitecturenIntroduce the architecture and all modules of Protocol stacknCommon ProceduresnIncludes general procedures,like LU,MO call,GPRS ATTACH,and etc.,for illustration of the functionality and interaction of modules of
2、 Protocol stack.OutlinenGSM/GPRS Protocol Stack ArchitecturenIntroductionnL4nNASnASnDatanSIMnCommon ProceduresIntroduction:Task v.s.ModulenOne Module implements one layer or groups of functionalities.nTask is the unit of OS schedulingnThe communication between Modules is by Primitives(Messages)nMore
3、 overhead in inter-task communication nPut modules into one tasknShare common memorynLousy communicationsnShare the same prioritynOther considerationnGeneral priority arrangement:lower layer higher priorityTask1KALModule1Task2Module3Module2SAPMCDTSTSAPIntroduction:Task main while(1)receive_msg_ext_q
4、(task_ext_qid,¤t_ilm);process_ilm(¤t_ilm);/*process external ILM*/while(receive_msg_int_q(task_entry_ptr-task_indx,¤t_ilm)process_ilm(¤t_ilm);/*process internal ILM*/void process_ilm(ilm_struct*current_ilm)switch(current_ilm-dest_mod_id)case MOD_CSM:csm_main(current_ilm);brea
5、k;/while(1)receive_msg_ext_q(task_ext_qid,¤t_ilm);/*process external ILM*/mm_main(¤t_ilm);free_ilm(¤t_ilm);FMIATCIL4CCSMSMSALRACTCMMM/GMMSMSCCSSL2RRLPTDTDataSMSNDCPL4LLCRRRRMMPALL1NVRAMDriversPPPUARTSIMRMPCLAPDMRLCMACSMUPHBUEML4ARMIKAL OS adaptationREASMSAP headers:define message i
6、dsDriver interfaceASN file of CCHeader file of CCSource file of CCMcd_parser Generated header fileHeaders of common local structureHeaders of structures for primitivesHeaders of common used enumsASNs of common used and SS ACT FilesIntroduction:Directory StructureLayer 4nThe interface between PS and
7、MMI/ATL4-L4C(1/9)nL4CnLayer 4 controllernCo-ordinate all L4 modules to perform the requests from AT or MMInInterfaces nThere are interfaces between all modules in L4nPPP_L4C_SAP -PPPnL4C_ABM_SAP-ABMnSourcenmcu/ps/l4/l4cL4-L4A&ATCI(2/9)nL4AnLayer 4 adaptationnTranslate function calls to primitives be
8、tween MMI and L4C.nCode generated by tool base on an Excel filenSourcenmcu/ps/l4/l4anATCInSub-module of L4CnAT command InterpreternSourcenmcu/ps/l4/l4cL4 RAC(3/9)nRegistration Access ControlnGSM/GPRS registration managementnPLMN List/SelectionnCell power level reportnInterfacenL4C_RAC_SAP L4CnGMMREG
9、_SAP MMnMMIAS_SAP-RMPCnSourcenmcu/ps/l4/racL4 TCM(4/9)nTerminal Context ManagementnHandle PDP context profilesnQoS,PDP address,PDP typesnRequest to activate PDP contextsnRelay of Data transfernInterfacesnTCM_L4C_SAP L4CnSMREG_SAP SMnSNDCP_REG_SAP-SNDCPnTCM_PPP_SAP PPPnTCM_TCPIP_SAP-TCPIPnSourcenmcup
10、sl4tcmL4 SMSAL(5/9)nSMS Application LayernMessage box of ME&SIMnTransmitting and receiving SMSnCell Broadcast managementnInterfacesnSMSAL_L4C_SAP L4CnSMSAL_SOC_SAP SOCnMNSMS_SAP SMSnSMSAL_AS_SAP-RMPCnSourcenmcu/ps/l4/smsalL4 TCM/SMSAL in WAP/GPRS(6/9)nTCM will relay IP packets to SNDCP,and vice vers
11、a.nSMSAL forwards PUSH message to SocketTCMW APTCP/IP/UDPSOCL4CSNDCPABMLLCSMSMSALSM SL4 CSM(7/9)nCall Service ManagementnBearer Capability HandlingnCODEC attachment managementnCSD/Fax activation/deactivationnCall information maintainingnCall related SS handlingnInterfacesnCSM_L4C_SAP L4CnMNCC_SAP CC
12、nCSM_TDT_SAP TDT of DatanCSM_L2R_SAP L2R of DatanMNSS_SAP-CISSnSourcenmcu/ps/l4/csmL4 SMU(8/9)nSecurity Management UnitnSecurity CheckingnPhone locknCHV1/CHV2nPersonalization(ETSI 02.22)nAutolocknInterfacesnSMU_L4C_SAP L4CnPS_SIM_SAP-SIMnSourcenmcu/ps/l4/smuL4-PHB&UEM(9/9)nPhonebooknIdentify Emergen
13、cy callnPhonebook managementnUser Equipment ManagementnPeripheral managementNASnNon Access StratumNAS CISS(1/12)nCall Independent Supplemental Servicen3GPP/ETSI specifications:n22.08122.088,22.091,22.091,22.093,22.072nSAPsnMM_SS_SAP-MMnMNSS_SAP -CSM of L4nSourcenmcu/ps/cc-ss/ssNAS CC(2/12)nCall Cont
14、roln3GPP/ETSI specificationsn24.008(Clause 5)nSAPsnMM_CC_SAP MMnMNCC_SAP -CSM of L4nSourcenmcu/ps/cc-ss/ccNAS SMS(3/12)nShort Message Servicen3GPP/ETSI specification:n23.040nSAPsnMM_SMS_SAP -MMnMNSMS_SAP -SMSAL of L4nLLC_SMS_SAP -LLC(GPRS-only)nSourcenmcu/ps/smsNAS-MM/GMM(4/12)nMobility Managementn3
15、GPP/ETSI specificationn24.008(Clause 4)nSAPsnMM_CC_SAP -CCnMM_SS_SAP -CISSnMM_SMS_SAP-SMSnGMMREG_SAP RAC of L4nMM_AS_SAP -RRnGMM_SM_SAP-SMnLLC_GMM_SAP-LLCNAS-MM/GMM(5/12)nSourcenmcu/ps/mm/cmm -CS domainnmcu/ps/mm/pmm -PS domainnmcu/ps/mm/common -commonnSingle task,single Module,Two FSMsNAS SM(6/12)n
16、Session Managementn3GPP/ETSI specification:n24.008(Clause 6)nSAPsnGMM_SM_SAP MMnSMREG_SAP -TCM of L4nSM_DATA_PLANE_SAP SNDCPnSourcenmcu/ps/smNAS SNDCP(7/12)nSubNetwork Dependency Convergence Protocoln3GPP/ETSI specificationn04.65nRFC1144(for TCP/IP header compression)nSAPsnSM_DATA_PLANE_SAP -SMnSM_R
17、EG_SAP -TCMnLLC_SNDCP_SAP -LLCnSourcenmcu/ps/sndcpNAS LLC(8/12)nLogical Link Controln3GPP/ETSI specificationn04.64nSAPsnLLC_GMM_SAP -GMMnLLC_SNDCP_SAP-SNDCPnLLC_SMS_SAP -SMSnLLC_RLC_SAP -RLCnSourcenmcu/ps/llcNAS PPP(9/12)nPoint to Point ProtocolnRFC specificationn1661,1662,1332,1877,1334,1994nTwo Ro
18、lesnServer in GPRS dial-upnClient in WAP over CSDnSAPs(for GPRS dialup)nPPP_L4C_SAP -L4C of L4nPPP_TCM_SAP -TCM of L4nUart driver interfacenSourcenmcu/ps/pppNAS PPP in GPRS dial-up(10/12)nReference model in ETSI 07.60NAS-PPP in WAP/CSD(11/12)nSAPsnPPP_TCPIP_SAP -TCPIPnPPP_TDT_SAP -TDTnL2R_PPP_SAP -L
19、2RNAS PPP of Two roles(12/12)nWhy not two tasks?nSave stack,Task control block,etc.nPriority of PPP TasknPPP is in lower layer than WAP and TCP/IP in WAP/CSD,WAP is the same position as MMIn In GPRS Dial-up PPP has nothing to do with MMI,but busty GPRS data may affect MMI if PPP has higher priority
20、than MMInSolution:make PPP lower priority,and rise it when needed.nIs it possible that two modes of it are active at the same time?nYesData TaskData RLP(1/3)nRadio Link Protocoln3GPP/ETSI specificationn24.022nSAPsnL2R_RLP_SAP -L2RnRLP_RA_SAP -L1(callback)nSourcenmcu/ps/data/rlpData-L2R(2/3)nLayer 2
21、Relayn3GPP/ETSI specificationn27.001,27.002nSAPsnCSM_L2R_SAP CSM of L4nL2R_RLP_SAP -L2RnPPP_L2R_SAP -PPPnUART drivernSourcenmcu/ps/data/l2rData TDT(3/3)nTransparent Data Transfern3GPP/ETSI specificationn27.001,27.002nSAPsnCSM_TDT_SAP CSM of L4nPPP_TDT_SAP -PPPnLayer1nSourcenmcu/ps/data/tdtSIMnSIM ma
22、nagernSIM Application Toolkitn3GPP/ETSI Specificationsn11.11,11.14nSAPsnSIM_PS_SAP -to all modulesnFunction interface with SIM drivernSourcenmcu/ps/simAS(RR)nAccess StratumRRnRadio ResourcenMost modules are in RR taskn3GPP/ETSI Specificationsn03.22,04.18,04.60,05.02,05.08RR-RRM(1/10)nRadio Resource
23、Management InitnPower on PLMN SelectionnCell selectionnManual PLMN SelectionnHome PLMN SearchnRecovery to normal servicenSAPsnRRM_RMPC_SAP RMPCnMM_AS_SAP MMnSourcenmcu/ps/rr/rrmRR-RMPC(2/10)nRadio Resource Management on CCCH or PCCCHnDecision rule:SI13 will indicate if P channel is supported in the
24、cellnIdle ModenMonitor(packet)system information on BCCH or PBCCHnPerform cell reselectionnPerform(packet)channel access on CCCH or PCCCHnResponse to(packet)paging messages on CCCH or PCCCHRR-RMPC(3/10)nDedicated modenMeasurements on SDCCH/TCHnMonitoring neighboring cellsnMonitor System Information
25、on SACCHnPerform cell reselection(NW initiated)nDedicated mode proceduresnSAPsnMMI_AS_SAP MMInSMSAL_AS_SAP SMSALnMM_AS_SAP MMnRRM_RMPC_SAP RRMnRMC_LAPDM_SAP RMCRR-RMPC(4/10)nRLC_RMPC_SAP RLCnMAC_RMPC_SAP MACnRMPC_MPAL_SAP-MPALnSourcenmcu/ps/rr/rmpnmcu/ps/rr/rmcnmcu/ps/rr/srcRR-LAPDm(5/10)nLayer 2nPr
26、ovide SAPI0/SAPI3 connectionsnTransfer layer 3 messagenSequence controlnSegmentation and re-assembly of framesnSAPsnRMC_LAPDM_SAP RMCnLAPDM_MPAL_SAP MPALnSourcenmcu/ps/rr/lapdm Mobile Physical Abstraction Layer Adaptation to L1 SAPs RRM_MPAL_SAP RRM RMPC_MPAL_SAP RMPC MAC_MPAL_SAP MAC Source mcu/ps/
27、rr/mpalRR-MPAL(6/10)RR-RLC(7/10)nRadio Link ControlnRequest TBF establishment or releasenSegmentation of LLC PDUsnAcknowledged/Unacknowledged data transfernSAPsnLLC_RLC_SAP LLCnRLC_REASM_SAP REASMnRLC_MAC_SAP MACnRLC_RMPC_SAP RMPCnSourcenmcu/ps/rr/rlc Reassemble To put non realtime constraint task i
28、nto another Task Re-assemble Downlink RLC/MAC blocks SAPs LLC_RLC_SAP LLC RLC_REASM_SAP REASM Source mcu/ps/rr/rlcReasm(8/10)RR-MAC(9/10)nMedium Access ControlnHandling TBF establishment and releasenTransfer or receive RLC data blocksnHandling control messages received on PACCHnPacket Resource Reque
29、st,Packet PDCH release and etcnForward PMO or PCCO to RMPCnHandling PSI messages received on PACCHnSending Packet Measurement Report on PACCH SAPs RLC_MAC_SAP RLC MAC_RMPC_SAP RMPC MAC_MPAL_SAP MPAL Source mcu/ps/rr/macRR-MAC(10/10)OutlinenGSM/GPRS Protocol Stack ArchitecturenCommon ProceduresnPower
30、 OnnLocation UpdatenMO callnGPRS AttachnPDP context ActivationnTBF OperationPower On ProcedurenConditionnPower on by long press Power keynAll tasks are created and initialized when the target is powered,but only if“long”press was detected,power on procedure will beginnPlayersnSIM,L4nNVRAM,MM,RRPower
31、 On-1Read all necessary EFs Power On-2Read NVRAM via L4CIf Not Flight ModePower On-3Read IMEI,MSCAP,etc.Read from NVRAMSearch Any CellPower On-4Read all security record from NVRAMCheck Phone LockStart SIM Driver Power On-5Input PIN Personalization Lock Handling Power On-6Initialize SMS Service Param
32、eter Read LDNPower On-7Read all EFs for MM/RRSearch Normal ServicePower On-8Read SMSLocation UpdatenConditionnA suitable cell was found when power on PLMN selectionnPlayersnMM,RRnL4C,RACLocation Update-1Location Update-2Location Update-3MO callnConditionnA normal service cell is camped-onnPlayersnL4
33、C,CSM,CC,MM,RRnMMI,UEM,PHBMO call-1Check ECC&PHBMO Call-2MO call-3TCH Assigned MO call-4Attach User SpeechGPRS AttachnConditionnMS is idle in a cell that supports GPRSnMS is requested for GPRS Attach by AT commandnPlayersnL4C,RAC,MM,LLC,RRGPRS Attach 1Read SI13/PSI1GPRS Attach-2PDP Context Activatio
34、nnConditionnGPRS AttachednPDP Context activation is triggered by dial-up from PCnPlayersnL4C,TCM,PPP,SMnLLC,MM,RRPDP Context Activation 1Atd*99#(UART)LCP/PAP/IPCPPDP Context Activation 2(UART)IPCP ACKPDP Context Activation 3Read PPP frame from UARTWrite PPP frame from UARTUplink TBF OperationnConditionnIdle state,GPRS service is availablenOne uplink LL-PDUnOne-phase accessnPlayersnRLC,MAC,RMC,MPAL,REASMnLLC,L1UL TBF 1UL TBF 2UL TBF 3 Condition Idle state.GPRS service is available.One downlink LL-PDU Players RLC,MAC,RMC,MPAL,REASM,LLC,L1Downlink TBF OperationDL TBF 1DL TBF 2Q&A