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

Connection issues between gnb hosts and core network hosts #172

Closed
baolindong opened this issue Aug 16, 2023 · 12 comments
Closed

Connection issues between gnb hosts and core network hosts #172

baolindong opened this issue Aug 16, 2023 · 12 comments

Comments

@baolindong
Copy link

baolindong commented Aug 16, 2023

Issue Description

Hello!
I have deployed the Open5GS core network and SRS gnb according to the tutorial on the official website. When the gnb and core network are deployed on the same server, they can be used normally; When the core network and gnb are deployed on different servers, there may be problems in transmitting data between the base station and the core network. Here are my configuration files for amf, upf, and gnb, as well as the log files for the runtime gnb.

Setup Details

amf.yaml :

amf:
    sbi:
      - addr: 127.0.0.5
        port: 7777
    ngap:
      - addr: 10.128.181.23 #127.0.0.5
    metrics:
      - addr: 127.0.0.5
        port: 9090
    guami:
      - plmn_id:
          mcc: 001 #999
          mnc: 01 #70
        amf_id:
          region: 2
          set: 1
    tai:
      - plmn_id:
          mcc: 001 #999
          mnc: 01 #70
        tac: 7
    plmn_support:
      - plmn_id:
          mcc: 001 #999
          mnc: 01 #70
        s_nssai:
          - sst: 1
    security:
        integrity_order : [ NIA2, NIA1, NIA0 ]
        ciphering_order : [ NEA0, NEA1, NEA2 ]
    network_name:
        full: Open5GS
    amf_name: open5gs-amf0

upf.yaml :

    pfcp:
      - addr: 127.0.0.7
    gtpu:
      - addr: 10.128.181.23 #127.0.0.7
    subnet:
      - addr: 10.45.0.1/16
      - addr: 2001:db8:cafe::1/48
    metrics:
      - addr: 127.0.0.7
        port: 9090

gnb_rf_b200_tdd_n78_20mhz.yml:

amf:
  addr: 10.128.181.23 # 10.128.191.80  #10.128.181.23 #127.0.1.100                                               # The address or hostname of the AMF.
  bind_addr: 127.0.0.1                                            # A local IP that the gNB binds to for traffic from the AMF.

ru_sdr:
  device_driver: uhd                                              # The RF driver name.
  device_args: type=b200,num_recv_frames=64,num_send_frames=64    # Optionally pass arguments to the selected RF driver.
  srate: 23.04                                                    # RF sample rate might need to be adjusted according to selected bandwidth.
  otw_format: sc12
  tx_gain: 76 #50                                                     # Transmit gain of the RF might need to adjusted to the given situation.
  rx_gain: 76 #60                                                     # Receive gain of the RF might need to adjusted to the given situation.

cell_cfg:
  dl_arfcn: 632628                                                # ARFCN of the downlink carrier (center frequency).
  band: 78                                                        # The NR band.
  channel_bandwidth_MHz: 20                                       # Bandwith in MHz. Number of PRBs will be automatically derived.
  common_scs: 30                                                  # Subcarrier spacing in kHz used for data.
  plmn: "00101"                                                   # PLMN broadcasted by the gNB.
  tac: 7                                                          # Tracking area code (needs to match the core configuration).
  pci: 1                                                          # Physical cell ID.

log:
  filename: /tmp/gnb.log                                          # Path of the log file.
  all_level: info #debug #warning                                                 # Logging level applied to all layers.

pcap:
  mac_enable: false                                               # Set to true to enable MAC-layer PCAPs.
  mac_filename: /tmp/gnb_mac.pcap                                 # Path where the MAC PCAP is stored.
  ngap_enable: true #false                                              # Set to true to enable NGAP PCAPs.
  ngap_filename: /tmp/gnb_ngap.pcap                               # Path where the NGAP PCAP is stored.

gnb.log:

2023-08-16T02:30:24.241210 [SCHED   ] [I] [   449.5] Slot decisions cell=0 t=14us: DL: ue=0 c-rnti=0x4601 rb=[0..1) h_id=0 ss_id=2 k1=4 rv=0 tbs=66
2023-08-16T02:30:24.241225 [RLC     ] [I] ue=0 DRB1 DL: TX status PDU. pdu_len=3 grant_len=3
2023-08-16T02:30:24.241227 [MAC     ] [I] [   449.5] DL PDU: ue=0 rnti=0x4601 size=66: SDU: lcid=4 size=5
2023-08-16T02:30:24.241325 [DL-PHY9 ] [I] [   449.5] PDCCH: rnti=0x4601 ss_id=2 format=1_1 cce=0 al=4 t=91.1us
2023-08-16T02:30:24.241409 [DL-PHY9 ] [I] [   449.5] PDSCH: rnti=0x4601 h_id=0 k1=4 prb=[0, 1) symb=[2, 14) mod=64QAM rv=0 tbs=66 t=78.6us
2023-08-16T02:30:24.246235 [UL-PHY2 ] [I] [   449.9] PUCCH: rnti=0x4601 format=1 prb1=0 prb2=na symb=[0, 14) cs=0 occ=0 ack=0 t=107.7us
2023-08-16T02:30:24.248635 [SCHED   ] [I] [   450.0] Slot decisions cell=0 t=12us: DL: ue=0 c-rnti=0x4601 rb=[0..1) h_id=0 ss_id=2 k1=7 rv=2 tbs=66
2023-08-16T02:30:24.248909 [DL-PHY8 ] [I] [   450.0] PDCCH: rnti=0x4601 ss_id=2 format=1_1 cce=8 al=4 t=86.7us
2023-08-16T02:30:24.248981 [DL-PHY8 ] [I] [   450.0] PDSCH: rnti=0x4601 h_id=0 k1=7 prb=[0, 1) symb=[2, 14) mod=64QAM rv=2 tbs=66 t=67.3us
2023-08-16T02:30:24.255240 [UL-PHY3 ] [I] [   450.7] PUCCH: rnti=0x4601 format=1 prb1=0 prb2=na symb=[0, 14) cs=0 occ=0 ack=1 t=137.2us
2023-08-16T02:30:24.271273 [UL-PHY4 ] [I] [  451.19] PUCCH: rnti=0x4601 format=1 prb1=49 prb2=na symb=[0, 14) cs=0 occ=0 sr=no t=115.0us
2023-08-16T02:30:24.310649 [UL-PHY1 ] [I] [  455.18] PUCCH: rnti=0x4601 format=2 prb=[3, 4) prb2=na symb=[12, 14) csi1=1100 t=51.8us
2023-08-16T02:30:24.311193 [UL-PHY2 ] [I] [  455.19] PUCCH: rnti=0x4601 format=1 prb1=49 prb2=na symb=[0, 14) cs=0 occ=0 sr=no t=127.9us
2023-08-16T02:30:24.351215 [UL-PHY3 ] [I] [  459.19] PUCCH: rnti=0x4601 format=1 prb1=49 prb2=na symb=[0, 14) cs=0 occ=0 sr=no t=132.5us
2023-08-16T02:30:24.390710 [UL-PHY4 ] [I] [  463.18] PUCCH: rnti=0x4601 format=2 prb=[3, 4) prb2=na symb=[12, 14) csi1=1100 t=74.2us
2023-08-16T02:30:24.391188 [UL-PHY1 ] [I] [  463.19] PUCCH: rnti=0x4601 format=1 prb1=49 prb2=na symb=[0, 14) cs=0 occ=0 sr=no t=84.0us
2023-08-16T02:30:24.431246 [UL-PHY2 ] [I] [  467.19] PUCCH: rnti=0x4601 format=1 prb1=49 prb2=na symb=[0, 14) cs=0 occ=0 sr=no t=124.9us
2023-08-16T02:30:24.470775 [UL-PHY3 ] [I] [  471.18] PUCCH: rnti=0x4601 format=2 prb=[3, 4) prb2=na symb=[12, 14) csi1=1100 t=106.5us
2023-08-16T02:30:24.471254 [UL-PHY4 ] [I] [  471.19] PUCCH: rnti=0x4601 format=1 prb1=49 prb2=na symb=[0, 14) cs=0 occ=0 sr=no t=111.5us
2023-08-16T02:30:24.511241 [UL-PHY1 ] [I] [  475.19] PUCCH: rnti=0x4601 format=1 prb1=49 prb2=na symb=[0, 14) cs=0 occ=0 sr=no t=83.3us
2023-08-16T02:30:24.550668 [UL-PHY2 ] [I] [  479.18] PUCCH: rnti=0x4601 format=2 prb=[3, 4) prb2=na symb=[12, 14) csi1=1100 t=68.5us
2023-08-16T02:30:24.551237 [UL-PHY3 ] [I] [  479.19] PUCCH: rnti=0x4601 format=1 prb1=49 prb2=na symb=[0, 14) cs=0 occ=0 sr=no t=130.7us
2023-08-16T02:30:24.591203 [UL-PHY4 ] [I] [  483.19] PUCCH: rnti=0x4601 format=1 prb1=49 prb2=na symb=[0, 14) cs=0 occ=0 sr=no t=108.0us
2023-08-16T02:30:24.630687 [UL-PHY1 ] [I] [  487.18] PUCCH: rnti=0x4601 format=2 prb=[3, 4) prb2=na symb=[12, 14) csi1=1100 t=53.5us
2023-08-16T02:30:24.631231 [UL-PHY2 ] [I] [  487.19] PUCCH: rnti=0x4601 format=1 prb1=49 prb2=na symb=[0, 14) cs=0 occ=0 sr=no t=127.5us
2023-08-16T02:30:24.671260 [UL-PHY3 ] [I] [  491.19] PUCCH: rnti=0x4601 format=1 prb1=49 prb2=na symb=[0, 14) cs=0 occ=0 sr=no t=136.2us
2023-08-16T02:30:24.710644 [UL-PHY4 ] [I] [  495.18] PUCCH: rnti=0x4601 format=2 prb=[3, 4) prb2=na symb=[12, 14) csi1=1100 t=71.3us
2023-08-16T02:30:24.711224 [UL-PHY1 ] [I] [  495.19] PUCCH: rnti=0x4601 format=1 prb1=49 prb2=na symb=[0, 14) cs=0 occ=0 sr=no t=81.8us
2023-08-16T02:30:24.751286 [UL-PHY2 ] [I] [  499.19] PUCCH: rnti=0x4601 format=1 prb1=49 prb2=na symb=[0, 14) cs=0 occ=0 sr=no t=124.9us
2023-08-16T02:30:24.790705 [UL-PHY3 ] [I] [  503.18] PUCCH: rnti=0x4601 format=2 prb=[3, 4) prb2=na symb=[12, 14) csi1=1100 t=104.4us
2023-08-16T02:30:24.791190 [UL-PHY4 ] [I] [  503.19] PUCCH: rnti=0x4601 format=1 prb1=49 prb2=na symb=[0, 14) cs=0 occ=0 sr=no t=112.5us
2023-08-16T02:30:24.831171 [UL-PHY1 ] [I] [  507.19] PUCCH: rnti=0x4601 format=1 prb1=49 prb2=na symb=[0, 14) cs=0 occ=0 sr=yes t=76.5us
2023-08-16T02:30:24.835258 [DL-PHY13] [I] [  508.13] PDCCH: rnti=0x4601 ss_id=2 format=0_1 cce=8 al=4 t=97.9us
2023-08-16T02:30:24.837128 [SCHED   ] [I] [  508.17] Slot decisions cell=0 t=2us: UL: ue=0 rnti=0x4601 h_id=0 ss_id=2 rb=[4..10) k2=4 rv=0 tbs=544
2023-08-16T02:30:24.840396 [UL-PHY2 ] [I] [  508.17] PUSCH: rnti=0x4601 h_id=0 prb=[4, 10) symb=[0, 14) mod=64QAM rv=0 tbs=544 crc=OK iter=2.0 snr=22.2dB t=327.8us
2023-08-16T02:30:24.840416 [MAC     ] [I] [   509.3] UL PDU rnti=0x4601 ue=0 subPDUs: [lcid=4: len=88, SBSR: lcg=0 bs=0, SE_PHR: total_len=3, PAD: len=448]
2023-08-16T02:30:24.840425 [RLC     ] [I] ue=0 DRB1 UL: RX PDU. pdu_len=88 dc=data p=1 si=full sn=28 so=0
2023-08-16T02:30:24.840447 [RLC     ] [I] ue=0 DRB1 UL: RX SDU. sn=28 sdu_len=86
2023-08-16T02:30:24.840458 [PDCP    ] [I] ue=0 DRB1 UL: RX PDU. type=data pdu_len=86 sn=28 count=28
2023-08-16T02:30:24.840463 [PDCP    ] [I] ue=0 DRB1 UL: RX SDU. count=28
2023-08-16T02:30:24.840471 [GTPU    ] [I] ue=0 UL teid=0x7eb4: TX PDU. pdu_len=92 teid=0x7eb4
# 传输数据报错
2023-08-16T02:30:24.840494 [UDP-GW  ] [E] Couldn't send 92 B of data on UDP socket: local_ip=127.0.0.1 dest_ip=10.128.181.23 error="Invalid argument"

Expected Behavior

[What you expect to happen]
When the gnb and core network are deployed on different servers, the cost UE can connect to the internet after connecting.

Actual Behaviour

[What happens instead e.g. error message]
When the gnb and core network are deployed on a server, the cost UE can be connected to the internet; When deployed on different servers, cost UE can connect to the core network, but due to data transmission issues, cost UE cannot connect to the internet.

Steps to reproduce the problem

[Tell us how to reproduce this issue e.g. RF setup, application config files]

Additional Information

[Any additional information, configuration or data that might be necessary to reproduce the issue]

@ngovanmao
Copy link

ngovanmao commented Aug 17, 2023

I faced the same issue a few days ago. Do you have any updates on this?
Noted that I tested with USRP X310 rather than B210. I think this issue is not related to which USRP was used, it is a N2 link between CU-CP and AMF.
I observed the SCTP connection first Established, but the heartbeat between Open5GS core and SRS-5G gNB could not maintain after that. Eventually, the SCTP connection between gNB and AMF is closed.

The same issue was observed when testing SRS-5G gNB with Free5GC core as well. So it is definitely the issue of the gNB side, not the core.

@pgawlowicz
Copy link
Collaborator

Hi, could you try with this patch: 0001-sctp-create-socket-only-once.txt

cd ./srsRAN_Project
git apply 0001-sctp-create-socket-only-once.txt

@s5uishida
Copy link

Hi @pgawlowicz

Your patch seems to solve this as well.

Thank you very much!

@baolindong
Copy link
Author

Hi @pgawlowicz
Thank you very much for your answer!Unfortunately, the issue was not resolved after I applied the patch. I see that this patch is modifying the creation of SCTP socket, but the error in gnb.log is related to UDP socket.

@s5uishida
Copy link

Hi @baolindong

Isn't it necessary to change the bind_addr as follows to the binding address of the OS that gnb is running instead of the loopback address?

gnb_rf_b200_tdd_n78_20mhz.yml

amf:
  addr: 10.128.181.23 # 10.128.191.80  #10.128.181.23 #127.0.1.100                                               # The address or hostname of the AMF.
  bind_addr: 127.0.0.1 <--
...

@baolindong
Copy link
Author

Hi @s5uishida
Thank you very much for your answer!After change the bind_addr to the IP address of gnb host, the problem was resolved.

@pgawlowicz
Copy link
Collaborator

nice, could you try to remove the patch and see whether the problem was only related to the bind_addr ?

@ngovanmao
Copy link

Thanks @pgawlowicz . Patch works well.

@baolindong
Copy link
Author

Hi @pgawlowicz
After change the bind_addr, I have try to use and remove patches, and cost UE can be used normally.

@s5uishida
Copy link

Hi @pgawlowicz

I'm looking forward to your patch being merged into the srsRAN_Project.

Thanks again!

@Torris-Yin
Copy link

This patch is perfect. Thanks.

@andrepuschmann
Copy link
Collaborator

This issue seems to have been a configuration problem afterall. Closing this therefore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants