Skip to content

Commit bbc7829

Browse files
committed
Add project
1 parent a6bdc25 commit bbc7829

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+6146
-1
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 Felipe Grings
3+
Copyright (c) 2021 Felipe Grings
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+147
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
2+
3+
# 5G Core Network Slicing
4+
5+
## Description
6+
7+
This project is an easy to use infrastructure and monitoring implementation of the [free5GC](www.free5gc.org)+[free5gc-helm](https://github.com/Orange-OpenSource/towards5gs-helm) project. Running on AWS or Proxmox environment using Terraform and Ansible as IaC. This project focus on observability to visualize core communication and implement Network Slicing in the future
8+
9+
10+
## Requirements
11+
12+
AWS Account **or** ProxMox Hypervisor
13+
14+
For one-step deploy Linux is required Or
15+
16+
Terraform;
17+
18+
Ansible.
19+
20+
21+
## Architecture
22+
23+
High Level architecture is based in Proxmox Hypervisor (AWS compatible) using 3 virtual machines, 2 Kuberentes Worker and 1 Kubernetes Master. The projetct uses observability principles described on "Production-Ready Microsservices", by O"Reilly. The project load metrics from hosts using Prometheus and send to grafana. The applications send tracing logs, and metrics via PinPoint Goland Agent to PinPoint APM. Jaeger was tested but the technology is not matture to easy-to-use on this project.
24+
25+
![](./imgs/proxmox-architecture.png)
26+
27+
28+
29+
The AWS architecture was designed to provide the entire AWS VPC and security resources. Terraform with AWS provider build the entire infrastructure that corresponds to:
30+
31+
* 1x Global VPC - Cloud network and security configurations;
32+
* 2x Subnets (Public and Private) - Separate Master and Nodes Public access;
33+
* 2x Routers (Public and Private) - Co ingress and outgress trafic;
34+
* 1x Gateway to expose public Router to internet;
35+
* 1x NAT to private Subnet;
36+
* 2x Security Groups with same configuration to implements in the future port restrictions.
37+
38+
![](./imgs/aws-architecture.png)
39+
40+
41+
42+
Kubernetes cluster is configured by Ansible Playbook. Follow free5GC Helm especifications.
43+
44+
* GTP5G Kernel Module - For UPF tunneling communication;
45+
* Helm 3+ - For Free5GC Cluster Deploy;
46+
* Simple CNI (Flannel) - Main Cluster CNI;
47+
* Multus CNI - For UPF seccundary interface configuration;
48+
* Free5GC Namespace;
49+
* free5gc-local-pv - For Mongo Volume;
50+
* MongoDB.
51+
52+
After configuring Free5GC Helm especifications the playbook add Prometheus, Nginx Ingress Controller, Fluend and run Helm Install.
53+
54+
![](./imgs/cluster-architecture.png)
55+
56+
### Network Slicing Controller Communications
57+
![](./imgs/nsc-architecture.png)
58+
59+
## Installation and Getting Started
60+
61+
To run AWS configuration remember to add [AWS Credentials](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/getting-your-credentials.html)
62+
63+
To install run the commands:
64+
65+
```bash
66+
git clone https://github.com/fhgrings/5g-core-network-slicing.git
67+
cd 5g-core-network-slicing.git/infra/aws-tform-e2e
68+
./run.sh
69+
```
70+
71+
After Installed enter on [AWS Console](https://us-east-2.console.aws.amazon.com/console/home) and connect to K8S-DEMO-EC2-MASTER-pub;
72+
73+
Run the commands:
74+
75+
```bash
76+
export KUBECONFIG=/etc/kubernetes/adming.config
77+
kubectl get pods -A
78+
```
79+
80+
![](./imgs/cluster.jpeg)
81+
82+
83+
84+
For a better cluster overview I recommend to install Lens IDE and connect to Kubernetes Cluster:
85+
86+
87+
![](./imgs/cluster-map.jpeg)
88+
89+
### Monitoring
90+
91+
- [x] **PinPoint**
92+
- [x] **Elastic APM**
93+
- [x] ~~NewRelic~~ (Not Working - Go Agent needs Go 1.17+)
94+
- [x] ~~OpenTelemtry~~ (No Agent for gin/gonic)
95+
- [x] ~~Datadog~~ (No Agent for gin/gonic)
96+
97+
#### Why did not work?
98+
99+
Observability is based on instrumentation, hard coded or agents. It's necessary to change the HTTP call methods to log the inputs and outputs with monitoring headers.
100+
101+
Go does not natively support sidecars to change compiled code, so changes need to be made inside the code and compiled.
102+
103+
Gin/gonic is not a widely used framework, so not all APM tools provide agents to monitor the requests.
104+
105+
To monitor a request you need to create a tracer between Request and Response, but the project uses OpenAPI. All important requests are already mapped by Yaml files and are compiled when running the tool, blocking access to the methods that perform the requests, making it necessary to change compiled packages to add the monitoring tools (Not possible for this scope).
106+
107+
As the scope of the project is limited to the slicing of the network and monitoring would be a plus to help understanding, it ends here the monitoring advances.
108+
109+
It was possible to group all the requests made in the applications, but without tracking the senders, only the receivers.
110+
111+
![](./imgs/pinpoint-service-map.png)
112+
113+
114+
115+
116+
117+
![](./imgs/pinpoint-tracing.png)
118+
119+
Fonts:
120+
121+
https://opentelemetry.io/docs/instrumentation/go/getting-started/
122+
123+
https://github.com/pinpoint-apm/pinpoint-go-agent/tree/main/plugin/gin
124+
125+
https://pkg.go.dev/net/http
126+
127+
https://pkg.go.dev/golang.org/x/net/http2/h2c
128+
129+
https://github.com/free5gc/amf/blob/e857bcd091ec69e66a2d390345fb4faf5c5d89e2/consumer/nf_mangement.go (Exemplo de classe: Nnrf_NFManagement)
130+
131+
132+
133+
## Fonts
134+
135+
https://github.com/pinpoint-apm/pinpoint-go-agent/tree/main/plugin/gin
136+
137+
https://pkg.go.dev/net/http
138+
139+
https://pkg.go.dev/golang.org/x/net/http2/h2c
140+
141+
https://docs.aws.amazon.com/
142+
143+
https://www.free5gc.org/
144+
145+
https://github.com/ciromacedo/5GCore-easy-install
146+
147+
https://github.com/Orange-OpenSource/towards5gs-helm

0 commit comments

Comments
 (0)