herlesupreeth / docker_open5gs

Docker files to run open5gs + IMS + eNB + gNB + NR-UE in a docker
BSD 2-Clause "Simplified" License
311 stars 169 forks source link

srsGNB ERROR: Failed to create SCTP gateway. #242

Closed r00tb33 closed 11 months ago

r00tb33 commented 11 months ago

Hello,

I've installed the following components to run a 5G-SA USRP based network.

git clone https://github.com/herlesupreeth/docker_open5gs
cd docker_open5gs/base

docker build --no-cache --force-rm -t docker_open5gs .

cd ../ims_base
docker build --no-cache --force-rm -t docker_kamailio .

cd ../srsran
docker build --no-cache --force-rm -t docker_srsran 

then I setup the following containers...

5G Core Network
docker-compose -f sa-deploy.yaml up

srsRAN gNB using SDR (OTA)
docker-compose -f srsgnb.yaml up -d && docker container attach srsgnb

After connecting the USRP...

$ uhd_find_devices 
linux; GNU C++ version 7.3.0; Boost_106501; UHD_003.010.003.000-0-unknown

--------------------------------------------------
-- UHD Device 0
--------------------------------------------------
Device Address:
    type: b200
    name: MyB210
    serial: 316x2x9
    product: B210

When I run the CORE network everything runs fine...

$ docker compose -f sa-deploy.yaml up                                                                                                                                         
[+] Building 0.0s (0/0)                                                                                                                                                                                      
WARN[0000] Found orphan containers ([srsgnb]) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.         
[+] Running 14/14                                                                                                                                                                                            
 ✔ Container scp      Recreated                                                                                                                                                                         0.1s 
 ✔ Container mongo    Recreated                                                                                                                                                                         0.1s 
 ✔ Container metrics  Recreated                                                                                                                                                                         0.1s  ✔ Container nrf      Recreated                                                                                                                                                                         0.1s  ✔ Container webui    Recreated                                                                                                                                                                         0.1s 
 ✔ Container udm      Recreated                                                                                                                                                                         0.1s  ✔ Container ausf     Recreated                                                                                                                                                                         0.1s 
 ✔ Container nssf     Recreated                                                                                                                                                                         0.1s  ✔ Container bsf      Recreated                                                                                                                                                                         0.1s  ✔ Container pcf      Recreated                                                                                                                                                                         0.1s 
 ✔ Container udr      Recreated                                                                                                                                                                         0.1s  ✔ Container amf      Recreated                                                                                                                                                                         0.0s 
 ✔ Container smf      Recreated                                                                                                                                                                         0.0s  ✔ Container upf      Recreated                                                                                                                                                                         0.0s 
Attaching to amf, ausf, bsf, metrics, mongo, nrf, nssf, pcf, scp, smf, udm, udr, upf, webui                                                                                                            
scp      | Deploying component: 'scp-1'                                                                                                                                                                      
scp      | Open5GS daemon v2.6.4-105-g0abfb20                                                                                                                                                          
scp      |                                                                                                                                                                                                   
scp      | 10/13 14:09:44.618: [app] INFO: Configuration: '/open5gs/install/etc/open5gs/scp.yaml' (../lib/app/ogs-init.c:126)      
scp      | 10/13 14:09:44.618: [app] INFO: File Logging: '/open5gs/install/var/log/open5gs/scp.log' (../lib/app/ogs-init.c:129)                                                                              scp      | 10/13 14:09:44.620: [sbi] INFO: nghttp2_server() [http://172.22.0.35]:7777 (../lib/sbi/nghttp2-server.c:395)                                                                                
scp      | 10/13 14:09:44.620: [app] INFO: SCP initialize...done (../src/scp/app.c:31)                                                                
.
.
.
.
webui      | Mongoose: accounts.findOne({ '$or': [ { username: 'admin' } ] }, { projection: { hash: 0, salt: 0 } })                                                                                          
mongo      | {"t":{"$date":"2023-10-13T13:28:14.906+02:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn11","msg":"client metadata","attr":{"remote":"172.22.0.26:34248","client":"conn11","doc":{"dri
ver":{"name":"nodejs","version":"5.8.0"},"platform":"Node.js v20.8.0, LE","os":{"name":"linux","architecture":"x64","version":"5.4.0-150-lowlatency","type":"Linux"}}}}

But, the moment I fire up gNB I face the following error...

$ docker compose -f srsgnb.yaml up
WARN[0000] network default: network.external.name is deprecated. Please set network.name with external: true 
[+] Building 0.0s (0/0)                                                                                                                                                                                      
WARN[0000] Found orphan containers ([upf smf amf udr pcf nssf udm ausf bsf webui mongo nrf scp metrics]) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up. 
[+] Running 1/0
 ✔ Container srsgnb  Recreated                                                                                                                                                                          0.1s 
Attaching to srsgnb
srsgnb  | Configuring component: 'gnb'
srsgnb  |  * Starting system message bus dbus                            [ OK ] 
srsgnb  | avahi-daemon: unrecognized service
srsgnb  | Lower PHY in quad executor mode.
srsgnb  | 
srsgnb  | --== srsRAN gNB (commit 5e6f50a20) ==--
srsgnb  | 
srsgnb  | Failed to bind SCTP socket to 172.22.0.37:0. Success
srsgnb  | srsGNB ERROR: Failed to create SCTP gateway.
srsgnb  | 
srsgnb  | /mnt/srsran/srsran_init.sh: line 53:    37 Aborted                 gnb -c /etc/srsran/gnb.yml
srsgnb exited with code 134

I've looked up previous issues but the solutions didn't seem to work!!

Can anyone guide me where am I going wrong here?

Thanks!!

herlesupreeth commented 11 months ago

Hmm, I guess you did not perform docker compose -f sa-deploy.yaml down before bringing it back up again. I would suggest to do the following

  1. Bring all the containers down
  2. Wait for all the containers to go down
  3. Execute docker system prune -f . This should remove containers which are down and redundant docker images
  4. Bring the 5GC up docker compose -f sa-deploy.yaml up
  5. Then, bring up gNB docker compose -f srsgnb.yaml up
r00tb33 commented 11 months ago

Hmm, I guess you did not perform docker compose -f sa-deploy.yaml down before bringing it back up again. I would suggest to do the following

  1. Bring all the containers down
  2. Wait for all the containers to go down
  3. Execute docker system prune -f . This should remove containers which are down and redundant docker images
  4. Bring the 5GC up docker compose -f sa-deploy.yaml up
  5. Then, bring up gNB docker compose -f srsgnb.yaml up

Hi @herlesupreeth ,

I tried the steps mentioned above but I am still stuck at the same error.

What could be other solutions for the same problem?

Thanks!!

herlesupreeth commented 11 months ago

Can you please describe your setup?? Are you running in a VM or bare machine?? or on WIndows?

Also, can provide complete logs when you run docker compose -f sa-deploy.yaml up and a pcap trace??

r00tb33 commented 11 months ago

Can you please describe your setup?? Are you running in a VM or bare machine?? or on WIndows?

Also, can provide complete logs when you run docker compose -f sa-deploy.yaml up and a pcap trace??

Hi @herlesupreeth ,

I'm running on top of a bare machine over Ubuntu 18.04.1 the machine is remote(within my apartment) I am ssh'd into the same.

Here are the logs!!!

Also, I don't see any activity on the "docker0" interface over wireshark... am I looking at the wrong place for captures?

Thanks!!

herlesupreeth commented 11 months ago

Also, I don't see any activity on the "docker0" interface over wireshark... am I looking at the wrong place for captures?

Since we are creating another network (not using the default docker network), it will create a interface with name "br-xyz" once you do docker compose -f sa-deploy.yaml up so probably you would have to capture the trace on "any" interface

herlesupreeth commented 11 months ago

ah, can you install the following library on host machine??

sudo apt update && sudo apt install libsctp-dev

Also, please send me the version of docker-ce and docker-compose you are using

r00tb33 commented 11 months ago

ah, can you install the following library on host machine??

sudo apt update && sudo apt install libsctp-dev

Also, please send me the version of docker-ce and docker-compose you are using

Hi,

libsctp-dev is pre-installed.

Docker version 24.0.6, build ed223bc

Docker Compose version v2.21.0

Thanks for the response!!

r00tb33 commented 11 months ago

Also, I don't see any activity on the "docker0" interface over wireshark... am I looking at the wrong place for captures?

Since we are creating another network (not using the default docker network), it will create a interface with name "br-xyz" once you do docker compose -f sa-deploy.yaml up so probably you would have to capture the trace on "any" interface

I've captured the packets from any interface but, I don't see any 5G/GTP traffic over it.

Still I am attaching the pcap file.

Awaiting to hear from you!!

Thanks.

herlesupreeth commented 11 months ago

Sorry to ask you this again. Can follow the steps here - https://github.com/herlesupreeth/docker_open5gs/issues/242#issuecomment-1762041113 and start the wireshark trace on 'any' interface after step 3 and send me that trace captured until step 5 (inclusive)?? Thanks again

r00tb33 commented 11 months ago

Sorry to ask you this again. Can follow the steps here - #242 (comment) and start the wireshark trace on 'any' interface after step 3 and send me that trace captured until step 5 (inclusive)?? Thanks again

Hi @herlesupreeth ,

I am herewith attaching the new pcap file.

I think since I am SSH'ing to the machine which is running the core network and has USRP connected I cannot really capture the traffic of that machine remotely(from current machine) I am actually capturing the traffic of my local machine(which is not running the core network).

I'll get the pcaps form the machine running core network physically and share with you!!

Thanks!!

herlesupreeth commented 11 months ago

I am actually capturing the traffic of my local machine(which is not running the core network).

Ah, that explains why I dont see any traffic (not even the SBI traffic among 5GC elements)

r00tb33 commented 11 months ago

I am actually capturing the traffic of my local machine(which is not running the core network).

Ah, that explains why I dont see any traffic (not even the SBI traffic among 5GC elements)

Hey,

Here you go with the pcap.

All I see is PFCP packets and rest is TCP comms between the components.

Thanks!!

herlesupreeth commented 11 months ago

Thanks. I dont see any SCTP attempt as well. Did you start the gNB while you were capturing the trace? If not, do so and send me the trace

r00tb33 commented 11 months ago

Thanks. I dont see any SCTP attempt as well. Did you start the gNB while you were capturing the trace? If not, do so and send me the trace

Yes I did start the gNB thrice and it failed all the times.

I am not able to figure out whats going wrong!!

Sivanesh1992 commented 11 months ago

I am also getting same error, you need to run below command before stating enb/gnb .

  1. start core network
  2. sudo ufw disable

3.then start gnb and see sctp is established or not

let me know if you get any response

r00tb33 commented 11 months ago

I am also getting same error, you need to run below command before stating enb/gnb .

  1. start core network
  2. sudo ufw disable

3.then start gnb and see sctp is established or not

let me know if you get any response

No success same problem.

Very weird dunno whats wrong!!

r00tb33 commented 11 months ago

I've moved the setup on a different machine and it works perfecly!!