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

ZMQ ue-gnb connection validation #593

Closed
hududed opened this issue May 1, 2024 · 21 comments
Closed

ZMQ ue-gnb connection validation #593

hududed opened this issue May 1, 2024 · 21 comments

Comments

@hududed
Copy link

hududed commented May 1, 2024

I successfully connected srsue to srsgnb via zmq

Attaching UE...
Random Access Transmission: prach_occasion=0, preamble_index=0, ra-rnti=0x39, tti=814
Random Access Complete.     c-rnti=0x4601, ta=0
RRC Connected
PDU Session Establishment successful. IP: 10.45.1.2
RRC NR reconfiguration successful.

For validation, I ping but see nothing transmitted

❯ sudo ip netns exec ue1 ping 10.45.1.1 -c4
PING 10.45.1.1 (10.45.1.1) 56(84) bytes of data.
^C
--- 10.45.1.1 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3050ms

However, there was gnb traffic:

          |--------------------DL---------------------|-------------------UL------------------------------
 pci rnti | cqi  ri  mcs  brate   ok  nok  (%)  dl_bs | pusch  mcs  brate   ok  nok  (%)    bsr    ta  phr
   1 4601 |  15   1   26    608    1    0   0%      0 |  65.5   28   7.2k    3    0   0%      0   0us  n/a
   1 4601 |  15   1   26    608    1    0   0%      0 |  65.5   28   5.8k    2    0   0%      0   0us  n/a
   1 4601 |  15   1   26    608    1    0   0%      0 |  65.5   28   7.2k    3    0   0%      0   0us  n/a
   1 4601 |  15   1   26    608    1    0   0%      0 |  65.5   28   7.2k    3    0   0%      0   0us  n/a
   1 4601 |  15   1    0      0    0    0   0%      0 |   n/a    0      0    0    0   0%      0   0us  n/a
   1 4601 |  15   1    0      0    0    0   0%      0 |   n/a    0      0    0    0   0%      0   0us  n/a
   1 4601 |  15   1    0      0    0    0   0%      0 |   n/a    0      0    0    0   0%      0   0us  n/a
   1 4601 |  15   1    0      0    0    0   0%      0 |   n/a    0      0    0    0   0%      0   0us  n/a
   1 4601 |  15   1    0      0    0    0   0%      0 |   n/a    0      0    0    0   0%      0   0us  n/a
   1 4601 |  15   1    0      0    0    0   0%      0 |   n/a    0      0    0    0   0%      0   0us  n/a
   1 4601 |  15   1    0      0    0    0   0%      0 |   n/a    0      0    0    0   0%      0   0us  n/a

and ue traffic:

---------Signal-----------|-----------------DL-----------------|-----------UL-----------
rat  pci  rsrp   pl   cfo | mcs  snr  iter  brate  bler  ta_us | mcs   buff  brate  bler
 nr    1    44    0 -393n |   0  118   0.0    0.0    0%    0.0 |   0    0.0    0.0    0%
 nr    1    44    0 -1.5u |   0   67   0.0    0.0    0%    0.0 |   0    0.0    0.0    0%
 nr    1    44    0  7.5u |   0  n/a   0.0    0.0    0%    0.0 |   0    0.0    0.0    0%
 nr    1    44    0  3.2u |  26  n/a   1.0    645    0%    0.0 |  27    0.0   7.7k    0%
 nr    1    44    0  4.4u |  26   70   1.0    639    0%    0.0 |  27    0.0   6.1k    0%
 nr    1    44    0  7.2u |  26  118   1.0    639    0%    0.0 |  27    0.0   7.6k    0%
 nr    1    44    0  6.7u |  26  n/a   1.0    639    0%    0.0 |  27    0.0   7.6k    0%
 nr    1    44    0  2.1u |   0   67   0.0    0.0    0%    0.0 |   0    0.0    0.0    0%
 nr    1    44    0  1.3u |   0  n/a   0.0    0.0    0%    0.0 |   0    0.0    0.0    0%
 nr    1    44    0  4.4u |   0   70   0.0    0.0    0%    0.0 |   0    0.0    0.0    0%
 nr    1    44    0  1.2u |   0  118   0.0    0.0    0%    0.0 |   0    0.0    0.0    0%

Is this expected?

@pgawlowicz
Copy link
Collaborator

ping should work. Could you check UE routing table?

sudo ip netns exec ue1 route -n

Do you have another instance of open5gs (installed manually) running on the PC?

@hududed
Copy link
Author

hududed commented May 2, 2024

❯ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.0.0.1        0.0.0.0         UG    20600  0        0 wlp69s0
10.0.0.0        0.0.0.0         255.255.255.0   U     600    0        0 wlp69s0
10.7.0.0        0.0.0.0         255.255.248.0   U     0      0        0 nordtun
10.45.0.0       10.53.1.2       255.255.255.0   UG    0      0        0 nordtun
10.53.1.0       0.0.0.0         255.255.255.0   U     0      0        0 nordtun
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 wlp69s0
❯ sudo ip netns exec ue1 ip route add default via 10.45.1.1 dev tun_srsue
❯ sudo ip netns exec ue1 route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.45.1.1       0.0.0.0         UG    0      0        0 tun_srsue
10.45.1.0       0.0.0.0         255.255.255.0   U     0      0        0 tun_srsue

I am pretty sure I installed and am running just one instance of it. Is there a way to double check?

@pgawlowicz
Copy link
Collaborator

what is this route?

10.7.0.0        0.0.0.0         255.255.248.0   U     0      0        0 nordtun

@hududed
Copy link
Author

hududed commented May 2, 2024

Seems to be specific to my VPN. Unfortunately, I couldn't find a way to get this running without nordtun interface. Not sure how to properly set up ogstun interface

@pgawlowicz
Copy link
Collaborator

then your traffic goes to the VPN interface. Could you disable the VPN and test?
Did you use the dockerized Open5gs versoin? see here: https://docs.srsran.com/projects/project/en/latest/tutorials/source/srsUE/source/index.html#open5gs-core

@hududed
Copy link
Author

hududed commented May 2, 2024

Ok so I was able to run it without the VPN but ping still doesnt work (but with UE gnb traffic)

❯ sudo ip netns exec ue1 route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.45.1.1       0.0.0.0         UG    0      0        0 tun_srsue
10.45.1.0       0.0.0.0         255.255.255.0   U     0      0        0 tun_srsue
❯ sudo ip netns exec ue1 ping 10.45.1.1 -c4
PING 10.45.1.1 (10.45.1.1) 56(84) bytes of data.

--- 10.45.1.1 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3074ms

❯ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.0.0.1        0.0.0.0         UG    600    0        0 wlp69s0
10.0.0.0        0.0.0.0         255.255.255.0   U     600    0        0 wlp69s0
10.45.0.0       10.53.1.2       255.255.255.0   UG    0      0        0 ogstun
10.45.1.1       10.0.0.1        255.255.255.255 UGH   0      0        0 wlp69s0
10.53.1.0       0.0.0.0         255.255.255.0   U     0      0        0 ogstun
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 wlp69s0

I did try the open5gs docker first and we did go at length not being able to reproduce it (see here) - this is why I tried to run it manually instead. I did triple-checked and updated all the default open5gs configs to srsRAN configs open5gs-5gc.yaml

@pgawlowicz
Copy link
Collaborator

Why do you have those two routes?

10.0.0.0        0.0.0.0         255.255.255.0   U     600    0        0 wlp69s0
...
10.45.1.1       10.0.0.1        255.255.255.255 UGH   0      0        0 wlp69s0

Can you remove it?

@hududed
Copy link
Author

hududed commented May 2, 2024

So I restarted so I'll show you what routes are there step by step:

  1. fresh restart
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.0.0.1        0.0.0.0         UG    600    0        0 wlp69s0
10.0.0.0        0.0.0.0         255.255.255.0   U     600    0        0 wlp69s0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 wlp69s0
  1. Run all open5gs components:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.0.0.1        0.0.0.0         UG    600    0        0 wlp69s0
10.0.0.0        0.0.0.0         255.255.255.0   U     600    0        0 wlp69s0
10.45.0.0       0.0.0.0         255.255.0.0     U     0      0        0 ogstun
10.45.0.0       0.0.0.0         255.255.0.0     U     0      0        0 ogstun
10.53.1.0       0.0.0.0         255.255.255.0   U     0      0        0 wlp69s0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 wlp69s0

Not sure why ogstun routes are there, but I assume its from smf and amf:

❯ grep "10.45." /etc/open5gs/*
grep: /etc/open5gs/backup: Is a directory
grep: /etc/open5gs/hnet: Is a directory
/etc/open5gs/smf.yaml:    - subnet: 10.45.0.1/24
/etc/open5gs/smf.yaml:      gateway: 10.45.0.1
grep: /etc/open5gs/tls: Is a directory
/etc/open5gs/upf.yaml:    - subnet: 10.45.0.1/24
/etc/open5gs/upf.yaml:      gateway: 10.45.0.1
  1. After gnb and ue ran:
❯ sudo ip ro add 10.45.0.0/24 via 10.53.1.2
❯ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.0.0.1        0.0.0.0         UG    600    0        0 wlp69s0
10.0.0.0        0.0.0.0         255.255.255.0   U     600    0        0 wlp69s0
10.45.0.0       10.53.1.2       255.255.255.0   UG    0      0        0 wlp69s0
10.45.0.0       0.0.0.0         255.255.0.0     U     0      0        0 ogstun
10.45.0.0       0.0.0.0         255.255.0.0     U     0      0        0 ogstun
10.53.1.0       0.0.0.0         255.255.255.0   U     0      0        0 wlp69s0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 wlp69s0
❯ sudo ip netns exec ue1 ip route add default via 10.45.1.1 dev tun_srsue
❯ sudo ip netns exec ue1 route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.45.1.1       0.0.0.0         UG    0      0        0 tun_srsue
10.45.1.0       0.0.0.0         255.255.255.0   U     0      0        0 tun_srsue
❯ sudo ip netns exec ue1 ping 10.45.1.1 -c4
PING 10.45.1.1 (10.45.1.1) 56(84) bytes of data.

--- 10.45.1.1 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3069ms
  1. Delete some routes:
❯ sudo ip route del 10.0.0.0/24 dev wlp69s0
❯ sudo ip route del 10.45.0.0/16 dev ogstun
❯ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.0.0.1        0.0.0.0         UG    600    0        0 wlp69s0
10.45.0.0       10.53.1.2       255.255.255.0   UG    0      0        0 wlp69s0
10.45.0.0       0.0.0.0         255.255.0.0     U     0      0        0 ogstun
10.53.1.0       0.0.0.0         255.255.255.0   U     0      0        0 wlp69s0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 wlp69s0
❯ sudo ip netns exec ue1 ping 10.45.1.1 -c4
PING 10.45.1.1 (10.45.1.1) 56(84) bytes of data.

--- 10.45.1.1 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3076ms

@pgawlowicz
Copy link
Collaborator

could you try:

sudo ip ro add 10.45.0.0/24 via 10.53.1.2 dev ogstun

instead of

sudo ip ro add 10.45.0.0/24 via 10.53.1.2

@hududed
Copy link
Author

hududed commented May 2, 2024

Sorry, wasn't too sure if it mattered with the /16 or /24 set in open5gs and srsran, so I made them all consistent /16:

❯ sudo ip ro add 10.45.0.0/16 via 10.53.1.2 dev ogstun
Error: Nexthop has invalid gateway.
❯ sudo ip ro add 10.45.0.0/24 via 10.53.1.2 dev ogstun
Error: Nexthop has invalid gateway.

@pgawlowicz
Copy link
Collaborator

indeed it should be:

sudo ip ro add 10.45.0.0/16 via 10.53.1.2 dev ogstun

@pgawlowicz
Copy link
Collaborator

ah wait, do you run the dockerized version of the Open5gs?

@hududed
Copy link
Author

hududed commented May 2, 2024

No its a local instance - the docker didnt work for me

@pgawlowicz
Copy link
Collaborator

ok, then you do not need the sudo ip ro add 10.45.0.0/16 via 10.53.1.2 dev ogstun this route at all.

@hududed
Copy link
Author

hududed commented May 2, 2024

❯ sudo ip netns exec ue1 ip route add default via 10.45.1.1 dev tun_srsue
❯ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.0.0.1        0.0.0.0         UG    600    0        0 wlp69s0
10.0.0.0        0.0.0.0         255.255.255.0   U     600    0        0 wlp69s0
10.45.0.0       0.0.0.0         255.255.0.0     U     0      0        0 ogstun
10.45.0.0       0.0.0.0         255.255.0.0     U     0      0        0 ogstun
10.53.0.0       0.0.0.0         255.255.0.0     U     0      0        0 wlp69s0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 wlp69s0
❯ sudo ip netns exec ue1 route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.45.1.1       0.0.0.0         UG    0      0        0 tun_srsue
10.45.1.0       0.0.0.0         255.255.255.0   U     0      0        0 tun_srsue
❯ sudo ip netns exec ue1 ping 10.45.1.1 -c4
PING 10.45.1.1 (10.45.1.1) 56(84) bytes of data.

--- 10.45.1.1 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3059ms

Got excited there but still the same - could you check if I need to delete some of these routes?

@pgawlowicz
Copy link
Collaborator

why there are two same routes?

10.45.0.0       0.0.0.0         255.255.0.0     U     0      0        0 ogstun
10.45.0.0       0.0.0.0         255.255.0.0     U     0      0        0 ogstun

@hududed
Copy link
Author

hududed commented May 2, 2024

Hm, that was peculiar - so I reran the open5gs component 1 by 1 (in the order given in the open5gs tutorial), and the two ogstun are created when I ran upf:

❯ sudo systemctl start open5gs-sgwud
❯ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.0.0.1        0.0.0.0         UG    600    0        0 wlp69s0
10.0.0.0        0.0.0.0         255.255.255.0   U     600    0        0 wlp69s0
10.53.0.0       0.0.0.0         255.255.0.0     U     0      0        0 wlp69s0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 wlp69s0
❯ sudo systemctl start open5gs-upfd
❯ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.0.0.1        0.0.0.0         UG    600    0        0 wlp69s0
10.0.0.0        0.0.0.0         255.255.255.0   U     600    0        0 wlp69s0
10.45.0.0       0.0.0.0         255.255.0.0     U     0      0        0 ogstun
10.45.0.0       0.0.0.0         255.255.0.0     U     0      0        0 ogstun
10.53.0.0       0.0.0.0         255.255.0.0     U     0      0        0 wlp69s0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 wlp69s0

I am not sure why its creating these. This is the config for upf

❯ sudo vi /etc/open5gs/upf.yaml
logger:
  file:
    path: /var/log/open5gs/all.log

global:
  max:
    ue: 1024 # The number of UE can be increased depending on memory size.

upf:
  pfcp:
    server:
      - address: 127.0.0.7
    client:
      smf: #  UPF PFCP Client try to associate SMF PFCP Server
        - address: 127.0.0.4
  gtpu:
    server:
      - address: 10.53.1.2 #127.0.0.7
        #advertise: 127.0.0.8
  session:
    - subnet: 10.45.0.1/16 #10.45.0.0/16
      gateway: 10.45.0.1
    - subnet: 2001:db8:cafe::/48
      gateway: 2001:db8:cafe::1

  metrics:
    server:
      - address: 127.0.0.7
        port: 9090

Should I delete those?

@pgawlowicz
Copy link
Collaborator

why did you set this:

  gtpu:
    server:
      - address: 10.53.1.2 #127.0.0.7

@hududed
Copy link
Author

hududed commented May 2, 2024

Well I followed everything in srsran config, but I suppose that was meant for docker? Not sure which to include and which not to.

#srsran_Project/docker/open5gs-5gc.yaml

mme:
  s1ap:
    server:
      - address: ${OPEN5GS_IP}
  gtpc:
    server:
      - address: ${OPEN5GS_IP}
      ...
amf:
  ngap:
    server:
      - address: ${OPEN5GS_IP}

upf:
  ...
  gtpu:
    server:
      - address: ${OPEN5GS_IP}
❯ grep "10.53.1." /etc/open5gs/*
/etc/open5gs/amf.yaml:      - address: 10.53.1.2
/etc/open5gs/mme.yaml:      - address: 10.53.1.2
/etc/open5gs/mme.yaml:      - address: 10.53.1.2
/etc/open5gs/upf.yaml:      - address: 10.53.1.2 #127.0.0.7

@pgawlowicz
Copy link
Collaborator

pgawlowicz commented May 2, 2024

yes, this is meant for the docker-based setup. Please just follow this tutorial: https://open5gs.org/open5gs/docs/guide/01-quickstart/

In addition, our Amarisoft UE tutorial uses Open5gs installed manually: https://docs.srsran.com/projects/project/en/latest/tutorials/source/amariUE/source/index.html#id6

@hududed
Copy link
Author

hududed commented May 2, 2024

I think I solved it. So in contrast to the tutorial, I didnt have to change any IP addresses at all (in AMF, UPF etc) (I guess since its a single host machine). I just updated the rest (TAC PLMN etc) following srsran.

❯ sudo ip netns exec ue1 ip route add default via 10.45.1.1 dev tun_srsue
❯ sudo ip addr add 10.45.1.1/24 dev ogstun # this was important
❯ sudo ip netns exec ue1 ping 10.45.1.1 -c4
PING 10.45.1.1 (10.45.1.1) 56(84) bytes of data.
64 bytes from 10.45.1.1: icmp_seq=1 ttl=64 time=32.7 ms
64 bytes from 10.45.1.1: icmp_seq=2 ttl=64 time=25.3 ms
64 bytes from 10.45.1.1: icmp_seq=3 ttl=64 time=35.0 ms
64 bytes from 10.45.1.1: icmp_seq=4 ttl=64 time=24.6 ms

--- 10.45.1.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms

Thanks for the help @pgawlowicz !

@hududed hududed closed this as completed May 2, 2024
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

2 participants