Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions Makefile

This file was deleted.

131 changes: 131 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# My5GCore Compose

Esse repositório é uma versão do my5gCore executada através de containers e automatizada via compose. Esse projeto é baseado no [Free5gC Compose](https://github.com/free5gc/free5gc-compose).



## Prerequisitos

Certifique-se de estar utilizando o kernel 5.0.0-23-generic ou superior. Você pode verificar com:

```bash
$ uname -r
```

### 1. GTP5G Kernel Module

Por conta das exigências do UPF faz-se necessário a instalação do gtp5g:

```bash
$ git clone https://github.com/PrinzOwO/gtp5g.git
$ cd gtp5g
$ make
$ sudo make install
```

### 2. Docker

Instalação de pacotes pré-requisitos

```bash
$ sudo apt install apt-transport-https ca-certificates curl software-properties-common
```

Adição da chave para o repositório oficial

```bash
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
```

Adição do repositório Docker

```bash
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
```

Atualização do bando de pacotes

```bash
$ sudo apt update
```

Instalação do Docker

```bash
$ sudo apt install docker-ce
```

Para verificar o status

```
$ sudo systemctl status docker
```

### 3. Docker Compose

O docker compose permite gerir a inicialização e finalização de diversos containers simultaneamente. Seu funcionamento se dá através de arquivos YAML que guardam as definições dos containers.

Baixando a release `1.28.2` do binário de instalação e salvar em `/usr/local/bin/docker-compose`, que tornará este software globalmente acessível como `docker-compose`.

```bash
$ sudo curl -L "https://github.com/docker/compose/releases/download/1.28.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
```

Definição das permissões para execução

```bash
$ sudo chmod +x /usr/local/bin/docker-compose
```

Para verificar se tudo ocorreu bem execute

```bash
$ docker-compose --version
```



## Iniciando My5g Core

Como precisamos criar uma interface de tunel, necessitamos criar um containger com permissões de root.

Dowload dos arquivos do núcleo:

```bash
$ git clone https://github.com/my5G/my5Gcore-compose.git
```

Compilando os arquivos

```bash
$ cd my5Gcore-compose
$ sudo make base
```

Construção dos serviços

```bash
$ sudo docker-compose build
```

Executando os containers através do docker-compose

```bash
$ sudo docker-compose up
```

ou

```bash
$ sudo docker-compose up -d # Para execução em segundo plano
```

Para verificar as imagens disponíveis em nosso containers execute:

```bash
$ sudo docker images
```

![my5gcore-compose](img/my5gcore.jpg)

Figura 1: Funções do My5GCore
57 changes: 12 additions & 45 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
version: '3.8'
version: '3.0'

services:
my5gcore-upf1:
container_name: upf
build:
context: ./nf_upf
args:
DEBUG_TOOLS: "true"
image: thiagogmta/nf_upf
command: bash -c "./router-upf.sh && ./free5gc-upfd -f ../config/upfcfg.yaml"
volumes:
- "${CONFIG}/upfcfg.yaml:/my5Gcore/config/upfcfg.yaml"
Expand Down Expand Up @@ -41,10 +38,7 @@ services:

my5gcore-nrf:
container_name: nrf
build:
context: ./nf_nrf
args:
DEBUG_TOOLS: "false"
image: thiagogmta/nf_nrf
command: ./nrf -nrfcfg ../config/nrfcfg.conf
expose:
- "29510"
Expand All @@ -63,10 +57,7 @@ services:

my5gcore-amf:
container_name: amf
build:
context: ./nf_amf
args:
DEBUG_TOOLS: "false"
image: thiagogmta/nf_amf
command: ./amf -amfcfg ../config/amfcfg.conf
expose:
- "29518"
Expand All @@ -84,10 +75,7 @@ services:

my5gcore-ausf:
container_name: ausf
build:
context: ./nf_ausf
args:
DEBUG_TOOLS: "false"
image: thiagogmta/nf_ausf
command: ./ausf -ausfcfg ../config/ausfcfg.conf
expose:
- "29509"
Expand All @@ -105,10 +93,7 @@ services:

my5gcore-nssf:
container_name: nssf
build:
context: ./nf_nssf
args:
DEBUG_TOOLS: "false"
image: thiagogmta/nf_nssf
command: ./nssf -nssfcfg ../config/nssfcfg.conf
expose:
- "29531"
Expand All @@ -126,10 +111,7 @@ services:

my5gcore-pcf:
container_name: pcf
build:
context: ./nf_pcf
args:
DEBUG_TOOLS: "false"
image: thiagogmta/nf_pcf
command: ./pcf -pcfcfg ../config/pcfcfg.conf
expose:
- "29507"
Expand All @@ -147,10 +129,7 @@ services:

my5gcore-smf:
container_name: smf
build:
context: ./nf_smf
args:
DEBUG_TOOLS: "false"
image: thiagogmta/nf_smf
command: ./smf -smfcfg ../config/smfcfg.conf -uerouting ../config/uerouting.yaml
expose:
- "29502"
Expand All @@ -172,10 +151,7 @@ services:

my5gcore-udm:
container_name: udm
build:
context: ./nf_udm
args:
DEBUG_TOOLS: "false"
image: thiagogmta/nf_udm
command: ./udm -udmcfg ../config/udmcfg.conf
expose:
- "29503"
Expand All @@ -194,10 +170,7 @@ services:

my5gcore-udr:
container_name: udr
build:
context: ./nf_udr
args:
DEBUG_TOOLS: "false"
image: thiagogmta/nf_udr
command: ./udr -udrcfg ../config/udrcfg.conf
expose:
- "29504"
Expand All @@ -219,10 +192,7 @@ services:

my5gcore-n3iwf:
container_name: n3iwf
build:
context: ./nf_n3iwf
args:
DEBUG_TOOLS: "true"
image: thiagogmta/nf_n3iwf
command: sh -c "./n3iwf-ipsec.sh && ./n3iwf -n3iwfcfg ../config/n3iwfcfg.conf"
ports:
- "20000:20000"
Expand All @@ -247,10 +217,7 @@ services:

my5gcore-webui:
container_name: webui
build:
context: ./webui
args:
DEBUG_TOOLS: "false"
image: thiagogmta/webui
command: ./webui -free5gccfg ../config/free5GC.conf --webuicfg ../config/webuicfg.conf
volumes:
- ${CONFIG}/webuicfg.conf:/my5Gcore/config/webuicfg.conf
Expand Down
Binary file added img/my5gcore.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 0 additions & 32 deletions nf_amf/Dockerfile

This file was deleted.

32 changes: 0 additions & 32 deletions nf_ausf/Dockerfile

This file was deleted.

32 changes: 0 additions & 32 deletions nf_n3iwf/Dockerfile

This file was deleted.

Loading