Last active
February 26, 2023 19:06
-
-
Save 0x2f0713/7c2ec1e30e256a45db6d168ec56cb41b to your computer and use it in GitHub Desktop.
Revisions
-
0x2f0713 revised this gist
May 19, 2022 . No changes.There are no files selected for viewing
-
0x2f0713 revised this gist
May 18, 2022 . 1 changed file with 1 addition and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -138,12 +138,8 @@ Giao diện quản lý sau khi đăng nhập như sau: ##### Sửa thông tin subscriber  <figcaption>Sửa thông tin xác thực của subscriber</figcaption>  <figcaption>Sửa config APN/DNN của subscriber</figcaption> -
0x2f0713 revised this gist
May 18, 2022 . 1 changed file with 22 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,12 +7,13 @@ Repo có 2 image là `open5gs` (core network) và `openairinterface5g` (RAN). So 4. Sửa mã nguồn và triển khai ## I. Giới thiệu chung Sơ đồ mạng  ## II. Cài đặt ### II.1. Open5GS Để gNB và AMF thông được với nhau, cần tạo network mới với IP Gateway 10.0.0.1 và dải subnet 10.0.0.0/16 ``` docker network create --gateway 10.0.0.1 --subnet 10.0.0.0/16 5g ``` @@ -45,12 +46,15 @@ docker run --name openairinterface5g -d -t --privileged --net 5g --ip 10.0.0.3 ``` docker exec -it openairinterface5g bash ``` ##### II.2.3.1 Run gNB **Lưu ý:** Phải chạy gNB và nrUE trên 2 terminal riêng biệt. ``` cd cmake_targets/ran_build/build/ ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.24PRB.usrpb210.conf --rfsim --sa ``` ##### II.2.3.2 Run nrUE ``` cd cmake_targets/ran_build/build/ ./nr-uesoftmodem -r 24 --numerology 1 --band 78 -C 3604320000 -s 24 --sa --rfsim -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf @@ -113,7 +117,10 @@ cd cmake_targets/ran_build/build/ #### II.3.1. Capture traffic with Wireshark **Lưu ý:** Cần sử dụng Wireshark phiên bản 3.0.0 trở lên để xem được traffic NGAP. [Cách cài Wireshark phiên bản 3.0.0 trở lên](https://itsfoss.com/install-wireshark-ubuntu/) Có thể bắt gói tin NGAP ngay trên interface `any` của Wireshark hoặc bắt trên interface của docker network như dưới đây: 1. Lấy network ID bằng lệnh `docker network ls`: <pre> ox2fo713@ox2fo713:~$ docker network ls NETWORK ID NAME DRIVER SCOPE @@ -129,9 +136,14 @@ Password: 1423 Giao diện quản lý sau khi đăng nhập như sau:  ##### Sửa thông tin subscriber <figure> <p><img src="https://user-images.githubusercontent.com/34441920/168579275-53e079d3-48a3-41b0-898e-bec386556f39.png" alt="Eiffel tower"> <!-- ![screenshot_1]() --> <figcaption>Sửa thông tin xác thực của subscriber</figcaption> </figure>  <figcaption>Sửa config APN/DNN của subscriber</figcaption> -
0x2f0713 revised this gist
May 16, 2022 . 1 changed file with 5 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,12 +7,12 @@ Repo có 2 image là `open5gs` (core network) và `openairinterface5g` (RAN). So 4. Sửa mã nguồn và triển khai ## I. Giới thiệu chung Sơ đồ mạng  ## II. Cài đặt ### II.1. Open5GS Để gNB và AMF, cần tạo network mới với IP Gateway 10.0.0.1 và dải subnet 10.0.0.0/16 ``` docker network create --gateway 10.0.0.1 --subnet 10.0.0.0/16 5g ``` @@ -129,9 +129,9 @@ Password: 1423 Giao diện quản lý sau khi đăng nhập như sau:  ###### Sửa thông tin subscriber  Sửa thông tin xác thực của subscriber  Sửa config APN/DNN của subscriber -
0x2f0713 revised this gist
May 16, 2022 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,14 +12,16 @@ So do mang ## II. Cài đặt ### II.1. Open5GS De gNB va AMF thong duoc voi nhau, can tao network moi voi IP Gateway 10.0.0.1 va dai subnet 10.0.0.0/16 ``` docker network create --gateway 10.0.0.1 --subnet 10.0.0.0/16 5g ``` ##### II.1.1. Pull stable docker image ``` docker pull 0x2f0713/open5gs:v1.0.3 ``` ##### II.1.2. Run Docker container ``` docker run --name open5gs -d -t --cap-add=NET_ADMIN --cap-add=NET_RAW --net 5g -p 127.0.0.1:3001:3000 --ip 10.0.0.2 --device /dev/net/tun 0x2f0713/open5gs:v1.0.3 ``` ##### II.1.3. Run core network in containter -
0x2f0713 revised this gist
May 16, 2022 . 1 changed file with 0 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -132,10 +132,4 @@ Giao diện quản lý sau khi đăng nhập như sau: Sua thong tin xac thuc cua subscriber  Sua config APN/DNN cua subscriber -
0x2f0713 revised this gist
May 16, 2022 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -132,4 +132,10 @@ Giao diện quản lý sau khi đăng nhập như sau: Sua thong tin xac thuc cua subscriber  Sua config APN/DNN cua subscriber Sau khi thay doi, click Save de luu thong tin hoac Cancel de huy bo ###### Them subscriber Giao dien them subscriber tuong doi giong sua thong tin subscriber, tuy nhien can dien IMSI.  -
0x2f0713 revised this gist
May 16, 2022 . 1 changed file with 8 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -125,4 +125,11 @@ Username: admin Password: 1423 ``` Giao diện quản lý sau khi đăng nhập như sau:  ###### Sua thong tin subscriber  Sua thong tin xac thuc cua subscriber  Sua config APN/DNN cua subscriber -
0x2f0713 revised this gist
May 16, 2022 . 1 changed file with 4 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # 5G Standalone Deployment Repo có 2 image là `open5gs` (core network) và `openairinterface5g` (RAN). Source code đã được đóng trong images, là thư mục `/open5gs` và `/oai-ran`. Không sử dụng câu lệnh pull ~~`docker pull 0x2f0713/5g-sa`~~ bên phải tài liệu này, pull images theo phần cài đặt phía dưới ## Nội dung 1. Giới thiệu chung @@ -19,8 +19,8 @@ docker pull 0x2f0713/open5gs:v1.0.3 ``` ##### II.1.2. Run Docker container ``` docker network create --gateway 10.0.0.1 --subnet 10.0.0.0/16 5g docker run --name open5gs -d -t --cap-add=NET_ADMIN --cap-add=NET_RAW --net 5g -p 127.0.0.1:3001:3000 --ip 10.0.0.2 --device /dev/net/tun 0x2f0713/open5gs:v1.0.3 ``` ##### II.1.3. Run core network in containter ``` @@ -37,8 +37,7 @@ docker pull 0x2f0713/openairinterface5g:v1.0.0 ``` #### II.2.2. Run Docker container ``` docker run --name openairinterface5g -d -t --privileged --net 5g --ip 10.0.0.3 openairinterface5g ``` #### II.2.3. Run bash in containter ``` -
0x2f0713 revised this gist
May 16, 2022 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,8 @@ Repo có 2 image là `open5gs` (core network) và `openairinterface5g` (RAN). So 4. Sửa mã nguồn và triển khai ## I. Giới thiệu chung So do mang  ## II. Cài đặt ### II.1. Open5GS @@ -125,4 +126,4 @@ Username: admin Password: 1423 ``` Giao diện quản lý sau khi đăng nhập như sau:  -
0x2f0713 created this gist
May 16, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,128 @@ # 5G Standalone Images Repo có 2 image là `open5gs` (core network) và `openairinterface5g` (RAN). Source code đã được đóng trong images, là thư mục `/open5gs` và `/oai-ran`. Không sử dụng câu lệnh pull ~~`docker pull 0x2f0713/5g-sa`~~ bên phải tài liệu này, pull images theo phần cài đặt phía dưới ## Nội dung 1. Giới thiệu chung 2. Cài đặt 3. Cấu hình 4. Sửa mã nguồn và triển khai ## I. Giới thiệu chung  ## II. Cài đặt ### II.1. Open5GS ##### II.1.1. Pull stable docker image ``` docker pull 0x2f0713/open5gs:v1.0.3 ``` ##### II.1.2. Run Docker container ``` docker network create --gateway 10.0.0.1 --subnet 10.0.0.0/16 5g # Create network bridge name "5g" docker run --name open5gs -d -t --cap-add=NET_ADMIN --cap-add=NET_RAW --net 5g -p 127.0.0.1:3001:3000 --ip 10.0.0.2 --device /dev/net/tun 0x2f0713/open5gs:v1.0.3 # Run Docker container with name "open5gs" ``` ##### II.1.3. Run core network in containter ``` docker exec -it open5gs bash cd /open5gs ./run.sh ``` ### II.2. OpenAirInterface5G #### II.2.1. Pull stable docker image ``` docker pull 0x2f0713/openairinterface5g:v1.0.0 ``` #### II.2.2. Run Docker container ``` docker network create --gateway 10.0.0.3 --subnet 10.0.0.0/16 5g # Create network bridge name "5g" docker run --name openairinterface5g -d -t --privileged --net 5g --ip 10.0.0.3 openairinterface5g # Run Docker container with name "openairinterface5g" ``` #### II.2.3. Run bash in containter ``` docker exec -it openairinterface5g bash ``` ###### II.2.3.1 Run gNB ``` cd cmake_targets/ran_build/build/ ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.24PRB.usrpb210.conf --rfsim --sa ``` ###### II.2.3.2 Run nrUE ``` cd cmake_targets/ran_build/build/ ./nr-uesoftmodem -r 24 --numerology 1 --band 78 -C 3604320000 -s 24 --sa --rfsim -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf ``` ## III. Cấu hình ### III.1. Cấu hình `open5gs`: 1. Addresses: - MongoDB = 127.0.0.1:27017 - WebUI = 10.0.0.2:3000 - SMF-gtpc = 127.0.0.4 :2123 for S5c, N11 - SMF-gtpu = 127.0.0.4 :2152 for N4u (Sxu) - SMF-pfcp = 127.0.0.4 :8805 for N4 (Sxb) - SMF-frDi = 127.0.0.4 :3868 for Gx auth - SMF-sbi = 127.0.0.4 :7777 for 5G SBI (N7,N10,N11) - AMF-ngap = 127.0.0.5 :38412 for N2 - AMF-sbi = 127.0.0.5 :7777 for 5G SBI (N8,N12,N11) - UPF-pfcp = 127.0.0.7 :8805 for N4 (Sxb) - UPF-gtpu = 10.0.0.2:2152 for S5u, N3, N4u (Sxu) - PCRF-frDi = 127.0.0.9 :3868 for Gx - NRF-sbi = 127.0.0.10:7777 for 5G SBI - AUSF-sbi = 127.0.0.11:7777 for 5G SBI - UDM-sbi = 127.0.0.12:7777 for 5G SBI - PCF-sbi = 127.0.0.13:7777 for 5G SBI - NSSF-sbi = 127.0.0.14:7777 for 5G SBI - BSF-sbi = 127.0.0.15:7777 for 5G SBI - UDR-sbi = 127.0.0.20:7777 for 5G SBI 2. PLMN, TAC,... - MCC: 208 - MNC: 99 - TAC: 1 - s_nssai - sst: 1 - sd: 000001 3. Subscribers (quan ly qua WebUI) - IMSI: 2089900007487 - Key: fec86ba6eb707ed08905757b1bb44b8f - OPc: C42449363BBAD02B66D16BC975D77CC1 - DNN: internet - nssai_sst: 1 - nssai_sd: 1 ### III.2. Cấu hình `openairinterface5g`: - PCI: 0 - Bandwidth: 24PRB - Band: 78 - Subcribers: giống như info trên core network ### III.3. Cấu hình mạng - Network name: 5g - Gateway: 10.0.0.1 - Open5Gs IP: 10.0.0.2 - OpenAirInterface5G IP: 10.0.0.3 ### II.3. Advanced #### II.3.1. Capture traffic with Wireshark **Lưu ý:** Cần sử dụng Wireshark phiên bản 3.0.0 trở lên để xem được traffic NGAP. [Cách cài Wireshark phiên bản 3.0.0 trở lên](https://itsfoss.com/install-wireshark-ubuntu/) 1. Lấy network ID của docker: <pre> ox2fo713@ox2fo713:~$ docker network ls NETWORK ID NAME DRIVER SCOPE <b>801ee26c775f</b> 5g bridge local </pre> 2. Capture interface có dạng `br-${network-id}` (ví dụ: br-<b>801ee26c775f</b>) #### II.3.2. Quản lý thông tin subscribers qua WebUI Đăng nhập trên trang `http://localhost:3001` ở máy host với thông tin đăng nhập ``` Username: admin Password: 1423 ``` Giao diện quản lý sau khi đăng nhập như sau: 