Giter Site home page Giter Site logo

enb's Introduction

Hi there ๐Ÿ‘‹

  • ๐Ÿ”ญ Iโ€™m currently working on almost everything ...
  • ๐ŸŒฑ Iโ€™m always learning (at least trying to) ...
  • ๐Ÿ’ฌ Ask me about things related to mobile ...
  • ๐Ÿ“ซ How to reach me: [email protected]
  • โšก Fun fact: ...

Next project: gNB application similar to my eNB application, but for 5G.

enb's People

Contributors

avmalavi avatar fabricio-wg2 avatar fasferraz avatar lynxis avatar nickvsnetworking avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

enb's Issues

User plane not working (GTP-U)

Dear @fasferraz

Everything works great up until the point I try to send some IP data across the GTP-U tunnel (towards the SGW).

S1 setup succeeds
Attach succeeds

2022-12-27 18:56:03.207215: S1AP: sending S1SetupRequest                                                    |
2022-12-27 18:56:03.217254: S1AP: S1SetupResponse received                                                  |
2022-12-27 18:56:04.751138: S1AP: sending InitialUEMessage                                                  |
2022-12-27 18:56:04.857392: S1AP: DownlinkNASTransport received                                             |
2022-12-27 18:56:04.860707: NAS: AuthenticatonRequest received                                              |
2022-12-27 18:56:04.865603: S1AP: sending UplinkNASTransport                                                |
2022-12-27 18:56:04.875660: S1AP: DownlinkNASTransport received                                             |
2022-12-27 18:56:04.878713: NAS: SecurityMode received                                                      |
2022-12-27 18:56:04.928814: NAS: sending SecurityModeComplete                                               |
2022-12-27 18:56:04.931396: S1AP: sending UplinkNASTransport                                                |
2022-12-27 18:56:05.039040: S1AP: InitialContextSetupRequest received                                       |
2022-12-27 18:56:05.041977: S1AP: sending InitialContextSetupResponse                                       |
2022-12-27 18:56:05.044763: NAS: AttachAccept received                                                      |
2022-12-27 18:56:05.047482: [('apn', 'dyn.delta')]                                                          |
2022-12-27 18:56:05.050234: [('pdn type value', 1), ('ipv4', '10.45.0.4')]                                  |
2022-12-27 18:56:05.057832: [('type of identity', 6), ('mcc', 101), ('mnc', 10), ('mme group id', 100), ('m |
2022-12-27 18:56:05.057832: me code', 101), ('m-tmsi', 69), ('s-tmsi', b'e\x00\x00\x00E')]                  |
2022-12-27 18:56:05.060878: NAS: sending AttachComplete                                                     |
2022-12-27 18:56:05.101081: S1AP: sending UplinkNASTransport     

After this, a tun1 named interface is already present with IP 10.45.0.4 set.

I add the proper route back: ip route add 10.45.0.0/24 dev tun1

When I try to ping 10.45.0.1 (the SGW side) no response is coming back, tshark records ICMP requests outside of the tunnel:

Capturing on 'tun1'
    1 0.000000000    10.45.0.4 โ†’ 10.45.0.1    ICMP 84 Echo (ping) request  id=0x0004, seq=122/31232, ttl=64
    2 1.023971084    10.45.0.4 โ†’ 10.45.0.1    ICMP 84 Echo (ping) request  id=0x0004, seq=123/31488, ttl=64
    3 2.047980988    10.45.0.4 โ†’ 10.45.0.1    ICMP 84 Echo (ping) request  id=0x0004, seq=124/31744, ttl=64
    4 3.071968997    10.45.0.4 โ†’ 10.45.0.1    ICMP 84 Echo (ping) request  id=0x0004, seq=125/32000, ttl=64
    5 4.095967761    10.45.0.4 โ†’ 10.45.0.1    ICMP 84 Echo (ping) request  id=0x0004, seq=126/32256, ttl=64

When I try to ping 10.45.0.4 from the SGW, the GTP-U encapsulated packets are arriving correctly, but no response:

Capturing on 'ens18'
    1 0.000000000 10.253.250.51 โ†’ 10.253.250.221 GTP 54 Echo request
    2 0.000388885 10.253.250.221 โ†’ 10.253.250.51 GTP 56 Echo response
    3 0.577967074    10.45.0.1 โ†’ 10.45.0.4    GTP <ICMP> 134 Echo (ping) request  id=0x1a28, seq=1/256, ttl=64
    4 1.579006583    10.45.0.1 โ†’ 10.45.0.4    GTP <ICMP> 134 Echo (ping) request  id=0x1a28, seq=2/512, ttl=64
    5 2.579048708    10.45.0.1 โ†’ 10.45.0.4    GTP <ICMP> 134 Echo (ping) request  id=0x1a28, seq=3/768, ttl=64
    6 3.580070569    10.45.0.1 โ†’ 10.45.0.4    GTP <ICMP> 134 Echo (ping) request  id=0x1a28, seq=4/1024, ttl=64
    7 4.580065463    10.45.0.1 โ†’ 10.45.0.4    GTP <ICMP> 134 Echo (ping) request  id=0x1a28, seq=5/1280, ttl=64

Seemingly every works a it should, the routes are correct, IPs are correct, yet the userplane part is not passing.

Firewall is disabled on both sides, IP_forwarding is enabled on both sides.

erroring out with plmn 001001 or 00101

when using with plmn 001001 or with plmn 00101 i get following error:

Returning PLMN from: 001001
Traceback (most recent call last):
  File "/home/admin/eNB/eNB_LOCAL.py", line 2704, in <module>
    main()
  File "/home/admin/eNB/eNB_LOCAL.py", line 2630, in main
    session_dict = session_dict_initialization(session_dict)
  File "/home/admin/eNB/eNB_LOCAL.py", line 188, in session_dict_initialization
    session_dict['ENCODED-GUTI'] = eNAS.encode_guti(int(session_dict['PLMN']),32769,1,12345678)
  File "/home/admin/eNB/eNAS.py", line 1156, in encode_guti
    guti += unhexlify(mcc_mnc[1] + mcc_mnc[0] + mcc_mnc[5] +mcc_mnc[2]+ mcc_mnc[4]+ mcc_mnc[3])
IndexError: string index out of range

to resolve it i added before line 1155:
if len(mcc_mnc) == 3: mcc_mnc += 'f'
if len(mcc_mnc) == 4: mcc_mnc += 'f'

diff:

index 05fe379..221742d 100644
--- a/eNAS.py
+++ b/eNAS.py
@@ -1152,6 +1152,8 @@ def encode_guti(mcc_mnc, mme_group_id, mme_code, m_tmsi):
     guti = b'\xf6'
     mcc_mnc = str(mcc_mnc)

+    if len(mcc_mnc) == 3: mcc_mnc += 'f'
+    if len(mcc_mnc) == 4: mcc_mnc += 'f'
     if len(mcc_mnc) == 5: mcc_mnc += 'f'
     guti += unhexlify(mcc_mnc[1] + mcc_mnc[0] + mcc_mnc[5] +mcc_mnc[2]+ mcc_mnc[4]+ mcc_mnc[3])
     guti += struct.pack("!H", mme_group_id)

PS thank you for your awesome code

PLMN Encoding Fix

Hey @fasferraz ,

Here is what the code was before:
return bcd(mccmnc[0] + mccmnc[1] + mccmnc[2] + mccmnc[3] + mccmnc[4] + mccmnc[5])

With that when I input 315123 (MCC 315 MNC 123) the pLMNidentity: comes back as 133521 which is MCC 315 / MNC 312
image

With the change I made yesterday, when I input 315123 (MCC 315 MNC 123) I get back 313532 which is MCC 315 MNC 123.
image

And here's the change:
return bcd(mccmnc[0] + mccmnc[1] + mccmnc[2] + mccmnc[3] + mccmnc[4] + mccmnc[5])

Let me know if I've missed something or if you think the encoding I've got is invalid,

YAML config file support

YAML file with default values and include support for multiple:
IMSI

  • IMEI
  • OPc / OP / Ki

eNodeB

  • TAC List
  • eNB ID
  • PCI

With the view of having support for multiple eNodeBs and UEs, so you can test connecting multiple UEs to an eNodeB, and handing over between eNodeBs in a future release.

Will start working on this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.