## 通訊網路淺淺談
Ian Chen
---
## 關於我
---
- 在交大資工所擔任菸酒生
- 開源社群
- COSCUP 2021 IT Team Lead
- 在 COSCUP, SITCON, DevFest 擔任過講者 Speaker
- Deno Taiwan 社群管理員(雖然有點荒廢)
- Leader @ Google DSC NYCU
- IT 幫鐵人賽老鳥
---
### Outline
- Circuit Switching & Packet Switching
- TCP/IP
- What's Core Network?
- The History of Core Network
- 5GC Introduction
- 5G Core Network 安裝與使用教學!
---
### Circuit Switching
- Dedicated communication path between two stations
- Pros: Low latency, Low error rate
- Cons: bursty traffic
```
1. Circuit establishment
2. Information transfer
3. Circuit disconnect
```
---
### Packet Switching

---
### TCP/IP

<small>Ref: https://yakimhsu.com/project/project_w4_Network_TCP_IP.html</small>
---
### Data Encapsulation

<small>Ref: https://www.ad-net.com.tw/osi-model-tcp-ip-network-models-must-concept-understand-move-deeper-networking-adventures/</small>
---
### What's Core Network?

<small>Ref: https://note-on-clouds.blogspot.com/2020/08/lte-5g-core-network.html</small>
---
### The History of Core Network
<small>
- 1G
- 傳統的語音服務,無法跨電信服務
- 2G
- 標準化的語音通話服務
- 3G
- 涵蓋 Circuit Switching & Packet Switching
- 4G
- LTE (Radio) + EPC = EPS
- Packet Switching only
- 5G
- NSA (5G RAN + EPC)
- SA (5G RAN + 5GC)
</small>
---
### What's 3GPP?
<small>
3rd Generation Partnership Project (3GPP) 的目標是在國際電信聯盟的 IMT-2000 計劃範圍內製訂和實現全球性的(第三代)移動電話系統規範。它致力於 GSM 到 UMTS(W-CDMA)的演化,雖然 GSM 到 W-CDMA 空中介面差別很大,但是其核心網採用了GPRS的框架,因此仍然保持一定的延續性。
Ref: https://en.wikipedia.org/wiki/3GPP
More details: https://www.3gpp.org/specifications/gsm-history
</small>
---
### EPC (Evolved Packet Core network)

- 3GPP Release 8 ~ 14
- The brand new concept: Network Function
---
### 5GC

- 3GPP Release 15 ~
- Redesign the Network Functions
- EPC 的每個 NF 負擔太重
- 更好的功能劃分
- 方便做功能抽換
<small>Ref: https://www.sdnlab.com/24286.html</small>
---
### Network Functions
- AMF
- 負責接入
- SMF
- 負責 Session 管理
- UPF
- 負責 Data Plane 的傳輸
- AUSF
- 負責 Security 相關的 Authentication
---
### Network Functions (Cont'd)
- NEF
- 用來告訴 External APP 核心網路可以提供什麼樣的服務
- NRF
- 查找各個 Network Function 的位置
- UDM
- 負責用戶標識、簽約數據、鑒權數據的管理、用戶的服務網元註冊管理
- UDR
- Database
---
### AMF (Access and Mobility Function)
- 處理與 UE、RAN 之間的 Control Plane message
- 處理 4G-5G or 5G-5G 的 Handover
- UE reachability
- SMF selection(可以基於 TAC、切片或是 DNN)
- 支援網路切片(與 NSSF 互動選擇出最佳的 Slice)
- C-IoT 最佳化
---
### SMF (Session Management Function)
- Session 管理
- 負責計費資訊的**搜集**
- downlink data notification
- QoS enforcement
- 處理與 Session 有關的 NAS message
---
### UPF (User Plane Function)
- DL/UP Data transmission
- 為 UE 分配 IP 位址
- 連結 UE 與 PDN
- QoS
- Downlink Data Buffering
---
### PCF (Policy Control Function)
- Accesses the subscription-related information for the user (from UDR)
- PCF supplies policy rules to the control plane function (CP) to be enforced by them
---
### AUSF (Authentication Server Function)
- implements the EAP authentication server for security procedures with AMF
- stores keys that are retrieved by AMF for security and integrity protection
---
### Service Based Architecture
https://github.com/ianchen0119/Introduce-to-5GC/wiki/Service-Based-Interface
---
### Common Procedures in 5GC
- Registration
- Session Mangement
- Handover
- Paging
---
### Registration
UE 向核心網路註冊身份與服務的流程,以下狀況會觸發 Registration:
- Initial Registration
- Periodic Registration
- Mobility Registration
- Emergency Registraion
---
### Session Management
<small>
1. UE 要跟外部網路建立連線之前必須建立 PDU Session<br>
2. 核心網路提供了一系列與 Session 相關的流程,包含: Establishment、Modification、Release。
</small>

---
### Handover
當 UE 離開了當前 Cell 的服務範圍就會觸發 Handover:

<small>Ref: https://www.techplayon.com/5g-sa-inter-gnb-hanodver-xn-handover/</small>
---
### Paging

- 當 UE 進入 Idle 狀態,但是有 Downlink 封包進來時...
<small>Ref: https://www.lteprotocol.com/2020/02/paging-in-5gnr.html</small>
---
### 通訊網路的發展問題
- Core Network 是門檻非常高的技術
- 目前市場上都是採用華為、Cisco、Ericsson、Nokia 發展的核網
- 具說中華電信建構 5G 網路共花費了 73 億,核心網路花費了其中的 20 億。
- 頻譜要錢
- 部署基地台也要錢
- ~~吃到飽之亂~~
---
### free5GC

- Open source 5G core network base on 3GPP R15
- https://github.com/free5gc/free5gc
- 可商業化使用
---
### 商業化核網的挑戰
- Scalability
- C10K, C10M?
- Functionality
- R15 or R16?
- Availability
- HA
---
### 個人推廣
- [微自幹的作業系統輕旅行](https://github.com/ianchen0119/AwesomeCS/wiki)
- [AwesomeCS](https://www.facebook.com/AwesomeComputerScience/)
- [Introduce to 5GC](https://github.com/ianchen0119/Introduce-to-5GC/wiki)
- [GitHub](https://github.com/ianchen0119)
- [LinkedIn](https://www.linkedin.com/in/ian-chen-88b70b1aa/)
---
### Thanks for your listening!
Q&A
{"metaMigratedAt":"2023-06-17T00:54:21.872Z","metaMigratedFrom":"YAML","title":"六角演講 - 通訊網路 [Slide]","breaks":true,"contributors":"[{\"id\":\"7333ca6e-8194-4198-bafa-dc6af47703ab\",\"add\":5787,\"del\":641}]"}