Skip to content
Snippets Groups Projects
Commit 489f1596 authored by Rohan's avatar Rohan
Browse files

instructions added to undeploy services

parent 7a8d9c15
No related branches found
No related tags found
1 merge request!6Gnbsim
...@@ -21,7 +21,7 @@ if [[ $1 == 'start' ]]; then ...@@ -21,7 +21,7 @@ if [[ $1 == 'start' ]]; then
echo -e "${BLUE}Starting 5gcn components in the order nrf, mysql, amf, smf, spgwu${NC}..." echo -e "${BLUE}Starting 5gcn components in the order nrf, mysql, amf, smf, spgwu${NC}..."
docker-compose -f docker-compose.yaml -p 5gcn up -d docker-compose -f docker-compose.yaml -p 5gcn up -d
elif [[ $2 == 'gnbsim' ]]; then elif [[ $2 == 'gnbsim' ]]; then
echo -e "${BLUE}Starting 5gcn components in the order nrf, mysql, amf, smf, spgwu${NC}..." echo -e "${BLUE}Starting gnbsim ${NC}..."
docker-compose -f docker-compose-gnbsim.yaml up -d gnbsim$3 docker-compose -f docker-compose-gnbsim.yaml up -d gnbsim$3
else else
echo -e "${BLUE}Starting 5gcn components in the order mysql, amf, smf, spgwu${NC}..." echo -e "${BLUE}Starting 5gcn components in the order mysql, amf, smf, spgwu${NC}..."
...@@ -32,20 +32,29 @@ if [[ $1 == 'start' ]]; then ...@@ -32,20 +32,29 @@ if [[ $1 == 'start' ]]; then
mysql_health=$(docker inspect --format='{{json .State.Health.Status}}' mysql) mysql_health=$(docker inspect --format='{{json .State.Health.Status}}' mysql)
if [[ $2 == 'nrf' ]]; then if [[ $2 == 'nrf' ]]; then
nrf_health=$(docker inspect --format='{{json .State.Health.Status}}' oai-nrf) nrf_health=$(docker inspect --format='{{json .State.Health.Status}}' oai-nrf)
elif [[ $2 == 'gnbsim' ]]; then
gnbsim_health=$(docker inspect --format='{{json .State.Health.Status}}' gnbsim)
fi fi
amf_health=$(docker inspect --format='{{json .State.Health.Status}}' oai-amf) amf_health=$(docker inspect --format='{{json .State.Health.Status}}' oai-amf)
smf_health=$(docker inspect --format='{{json .State.Health.Status}}' oai-smf) smf_health=$(docker inspect --format='{{json .State.Health.Status}}' oai-smf)
spgwu_health=$(docker inspect --format='{{json .State.Health.Status}}' oai-spgwu) spgwu_health=$(docker inspect --format='{{json .State.Health.Status}}' oai-spgwu)
if [[ ${mysql_health} == '"healthy"' && ${amf_health} == '"healthy"' && ${smf_health} == '"healthy"' && ${spgwu_health} == '"healthy"' && $2 != 'nrf' ]]; then if [[ ${mysql_health} == '"healthy"' && ${amf_health} == '"healthy"' && ${smf_health} == '"healthy"' && ${spgwu_health} == '"healthy"' && $2 != 'nrf' && $2 != 'gnbsim' ]]; then
echo -e "\n${GREEN}All components are healthy${NC}..." echo -e "\n${GREEN}All components are healthy${NC}..."
STATUS=0 STATUS=0
break break
elif [[ $2 == 'gnbsim' ]]; then
echo -ne "gnbsim : $gnbsim_health\033[0K\r"
if [[ ${gnbsim_health} == '"healthy"' ]]; then
STATUS=0
break
fi
sleep 2
elif [[ ${mysql_health} == '"healthy"' && ${amf_health} == '"healthy"' && ${smf_health} == '"healthy"' && ${spgwu_health} == '"healthy"' && ${nrf_health} == '"healthy"' && $2 == 'nrf' ]]; then elif [[ ${mysql_health} == '"healthy"' && ${amf_health} == '"healthy"' && ${smf_health} == '"healthy"' && ${spgwu_health} == '"healthy"' && ${nrf_health} == '"healthy"' && $2 == 'nrf' ]]; then
echo -e "\n${GREEN}All components are healthy${NC}..." echo -e "\n${GREEN}All components are healthy${NC}..."
STATUS=0 STATUS=0
break break
elif [[ $2 != 'nrf' ]]; then elif [[ $2 != 'nrf' ]]; then
echo -ne "mysql : $mysql_health, oai-amf : $amf_health, oai-smf : $smf_health, oai-spgwu : $spgwu_health\033[0K\r" echo -ne "here mysql : $mysql_health, oai-amf : $amf_health, oai-smf : $smf_health, oai-spgwu : $spgwu_health\033[0K\r"
STATUS=1 STATUS=1
sleep 2 sleep 2
else else
...@@ -66,6 +75,8 @@ if [[ $1 == 'start' ]]; then ...@@ -66,6 +75,8 @@ if [[ $1 == 'start' ]]; then
else else
echo -e "${GREEN}SMF and UPF are registered to NRF${NC}..." echo -e "${GREEN}SMF and UPF are registered to NRF${NC}..."
fi fi
elif [[ $2 == 'gnbsim' && $STATUS == 0 ]]; then
echo -e "${GREEN}#### gnbsim is healthy - gnb & ue is conncted to core network now !! #####${NC}"
else else
echo -e "${BLUE}Checking if SMF is able to connect with UPF${NC}" echo -e "${BLUE}Checking if SMF is able to connect with UPF${NC}"
upf_logs=$(docker logs oai-spgwu | grep 'Received SX HEARTBEAT RESPONSE') upf_logs=$(docker logs oai-spgwu | grep 'Received SX HEARTBEAT RESPONSE')
...@@ -87,7 +98,7 @@ if [[ $1 == 'start' ]]; then ...@@ -87,7 +98,7 @@ if [[ $1 == 'start' ]]; then
fi fi
elif [[ $1 == 'stop' ]]; then elif [[ $1 == 'stop' ]]; then
echo -e "${BLUE}Stopping the core network${NC}..." echo -e "${RED}Stopping service $2 ${NC}..."
if [[ $2 == 'nrf' ]]; then if [[ $2 == 'nrf' ]]; then
docker-compose -f docker-compose.yaml -p 5gcn down docker-compose -f docker-compose.yaml -p 5gcn down
elif [[ $2 == 'gnbsim' ]]; then elif [[ $2 == 'gnbsim' ]]; then
...@@ -95,7 +106,7 @@ elif [[ $1 == 'stop' ]]; then ...@@ -95,7 +106,7 @@ elif [[ $1 == 'stop' ]]; then
else else
docker-compose -f docker-compose-no-nrf.yaml -p 5gcn down docker-compose -f docker-compose-no-nrf.yaml -p 5gcn down
fi fi
echo -e "${GREEN}Core network stopped${NC}" echo -e "${GREEN}Service $2 is stopped${NC}"
else else
echo -e "Only use the following options\n\n${RED}start${NC}: start the 5gCN\n${RED}stop${NC}: stops the 5gCN\n${RED}nrf${NC}: nrf should be used\n${RED}no-nrf${NC}: nrf should not be used\nExample: ./core-network.sh start nrf" echo -e "Only use the following options\n\n${RED}start${NC}: start the 5gCN\n${RED}stop${NC}: stops the 5gCN\n${RED}nrf${NC}: nrf should be used\n${RED}no-nrf${NC}: nrf should not be used\nExample: ./core-network.sh start nrf"
fi fi
...@@ -39,6 +39,10 @@ ...@@ -39,6 +39,10 @@
This tutorial is a extension of previous tutorial of [testing with dsTester](./docs/DEPLOY_SA5G_WITH_DS_TESTER.md). In previous tutorial we have seen the advanced testing tool dsTester, which is useful for validating even more complex scenarios. Moreover, there are various other opensource gnb/ue simulator tools are available for SA5G test. In this tutorial we use opensource simulator tool called gnbsim. With the help of gnbsim tool, we can perform very basic SA5G test by simulating one gnb and one ue. This tutorial is a extension of previous tutorial of [testing with dsTester](./docs/DEPLOY_SA5G_WITH_DS_TESTER.md). In previous tutorial we have seen the advanced testing tool dsTester, which is useful for validating even more complex scenarios. Moreover, there are various other opensource gnb/ue simulator tools are available for SA5G test. In this tutorial we use opensource simulator tool called gnbsim. With the help of gnbsim tool, we can perform very basic SA5G test by simulating one gnb and one ue.
##### About gnbsim -
[Gnbsim](https://github.com/hhorai/gnbsim) is a 5G SA gNB/UE (Rel. 16) simulator for testing 5G System. It 3rd party opensource tool written in golang and more information can be found [here.](https://github.com/hhorai/gnbsim) Gnbsim simulates NGAP, NAS and GTPU protocols. Current version of gnbsim simulates one gnb and one ue.
Let's begin !!
* Steps 1 to 5 are similar as previous tutorial. Please follow these steps to deploy OAI 5G core network components. * Steps 1 to 5 are similar as previous tutorial. Please follow these steps to deploy OAI 5G core network components.
* We depoloy gnbsim docker service on same host as of core network, so there is no need to create additional route as * We depoloy gnbsim docker service on same host as of core network, so there is no need to create additional route as
we did for dsTest-host. we did for dsTest-host.
...@@ -263,3 +267,36 @@ PING 12.1.1.5 (12.1.1.5) 56(84) bytes of data. ...@@ -263,3 +267,36 @@ PING 12.1.1.5 (12.1.1.5) 56(84) bytes of data.
2 packets transmitted, 2 received, 0% packet loss, time 1004ms 2 packets transmitted, 2 received, 0% packet loss, time 1004ms
rtt min/avg/max/mdev = 0.233/0.261/0.289/0.028 ms rtt min/avg/max/mdev = 0.233/0.261/0.289/0.028 ms
``` ```
Last thing is to remove all services - <br/>
* Undeploy the gnbsim
```bash
/oai-cn5g-fed/docker-compose$ ./core-network.sh stop gnbsim
Stopping service gnbsim ...
Stopping gnbsim ... done
Removing gnbsim ... done
Network demo-oai-public-net is external, skipping
Service gnbsim is stopped
```
* Undeploy the core network
```bash
/oai-cn5g-fed/docker-compose$ ./core-network.sh stop nrf
Stopping service nrf ...
Stopping oai-amf ... done
Stopping oai-ext-dn ... done
Stopping oai-smf ... done
Stopping oai-spgwu ... done
Stopping oai-nrf ... done
Stopping mysql ... done
Removing oai-amf ... done
Removing oai-ext-dn ... done
Removing oai-smf ... done
Removing oai-spgwu ... done
Removing oai-nrf ... done
Removing mysql ... done
Network demo-oai-public-net is external, skipping
Service nrf is stopped
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment