Skip to content

Instantly share code, notes, and snippets.

@bbaranoff
Last active February 28, 2026 17:58
Show Gist options
  • Select an option

  • Save bbaranoff/6d4c24bdcf2aea52a76a049cfb22411b to your computer and use it in GitHub Desktop.

Select an option

Save bbaranoff/6d4c24bdcf2aea52a76a049cfb22411b to your computer and use it in GitHub Desktop.

🏗 1️⃣ Architecture PLMN simple (Osmocom)

flowchart LR
    UE --> BTS
    BTS --> BSC
    BSC --> MSC
    MSC -->|GSUP| HLR
    MSC -->|SCCP/MAP| STP
Loading

Ça montre bien la séparation :

  • GSUP interne
  • SS7 externe

🌍 2️⃣ Interconnexion Multi-PLMN

flowchart LR
    subgraph PLMN_A
        MSC_A
        HLR_A
        STP_A
        MSC_A -->|GSUP| HLR_A
        MSC_A --> STP_A
    end

    subgraph PLMN_B
        MSC_B
        HLR_B
        STP_B
        MSC_B -->|GSUP| HLR_B
        MSC_B --> STP_B
    end

    STP_A <-->|M3UA/SCCP| INTER_STP
    INTER_STP <-->|M3UA/SCCP| STP_B
Loading

Ici tu visualises :

  • séparation des PLMN
  • interconnexion centrale
  • backbone SS7 IP

✉ 3️⃣ Flux SMS Inter-Opérateur

sequenceDiagram
    participant UE_A
    participant MSC_A
    participant STP_A
    participant INTER
    participant STP_B
    participant MSC_B
    participant HLR_B
    participant UE_B

    UE_A->>MSC_A: SMS MO
    MSC_A->>STP_A: MAP ForwardSM
    STP_A->>INTER: SCCP
    INTER->>STP_B: SCCP
    STP_B->>MSC_B: MAP DeliverSM
    MSC_B->>HLR_B: GSUP Routing Check
    MSC_B->>UE_B: SMS MT
Loading

Ça rend tout de suite professionnel dans un README.


📞 4️⃣ Bridge GSM → SIP (Linphone)

flowchart LR
    UE_GSM --> MSC
    MSC --> SIP_GW
    SIP_GW --> Asterisk
    Asterisk --> Linphone
Loading

Tu montres la translation :

Circuit Switched → IP


🧠 5️⃣ Vue Plan Contrôle vs Plan Utilisateur

flowchart TB
    subgraph Control_Plane
        MSC
        HLR
        STP
        INTER_STP
    end

    subgraph User_Plane
        BTS
        RTP_Stream
    end

    UE --> BTS
    BTS --> MSC
    MSC --> STP
Loading

Très pédagogique pour montrer séparation logique.


⚙ 6️⃣ Stack protocolaire

flowchart TB
    SCTP --> M3UA
    M3UA --> MTP3
    MTP3 --> SCCP
    SCCP --> MAP
Loading

Simple, lisible, propre.


⚠ Petit détail important

Sur GitHub :

  • Ça marche dans README.md
  • Ça marche dans Wiki
  • Pas toujours dans des anciens viewers
  • Parfois besoin de recharger

🎯 Conseil stratégique

Un repo avec :

  • build.sh
  • start.sh
  • diagrammes Mermaid propres
  • explication architecture
  • captures logs attach / SMS

→ ça devient une plateforme pédagogique.

Architecture et les possibilités légitimes en lab.


🌐 1️⃣ Architecture IP globale

Tu proposes :

  • IP privé opérateur : 172.20.X.0/24

  • Interop “public” (lab backbone) : 172.20.1.0/24

    • Inter-STP : 172.20.1.10
    • STP Op1 : 172.20.1.11
    • STP Op2 : 172.20.1.12

Ça donne une séparation claire :

  • Réseau interne PLMN
  • Réseau backbone interopérateur

🏗 Schéma global IP

flowchart LR
    subgraph PLMN_OP1 [PLMN OP1 - 172.20.2.0/24]
        MSC1["MSC1 (172.20.2.2)"]
        HLR1["HLR1 (172.20.2.3)"]
        STP1["STP1 (172.20.1.11)"]
    end

    subgraph PLMN_OP2 [PLMN OP2 - 172.20.3.0/24]
        MSC2["MSC2 (172.20.3.2)"]
        HLR2["HLR2 (172.20.3.3)"]
        STP2["STP2 (172.20.1.12)"]
    end

    INTER["INTER-STP (172.20.1.10)"]

    MSC1 -->|GSUP| HLR1
    MSC2 -->|GSUP| HLR2

    MSC1 --> STP1
    MSC2 --> STP2

    STP1 <-->|M3UA/SCCP| INTER
    INTER <-->|M3UA/SCCP| STP2
Loading

🧠 2️⃣ Séparation logique des plans

Important :

  • Réseau interne : subscriber management, GSUP
  • Réseau interop : signalisation M3UA/SCCP
  • RTP / User plane séparé

Ça permet :

  • Isolation
  • Reproductibilité
  • Simulation d’opérateur réel

📲 3️⃣ SIM Soft / SIM réelle opérateur virtuel

Avec pySim, tu peux :

  • Définir MCC/MNC custom
  • Configurer IMSI
  • Clé Ki
  • Désactiver 5G si nécessaire
  • Paramétrer EF_OPL / EF_PLMNsel
  • Forcer comportement attach

Ce que ça permet en lab :

  • Créer un “opérateur virtuel” crédible
  • Simuler roaming inter-PLMN
  • Tester fallback 2G/LTE
  • Éviter attache vers réseau réel

C’est crucial : la SIM est l’ancrage identitaire du PLMN.

Sans SIM cohérente, ton lab est incohérent.


📡 4️⃣ RAN virtuel : QEMU TRX full virtuel

Tu peux aller plus loin :

  • TRX virtualisé
  • Baseband simulé
  • Couche PHY émulée

Ça permet :

  • Test end-to-end sans SDR physique
  • Reproductibilité CI/CD
  • Simulation multi-cell

Tu passes d’un lab radio physique à un lab 100% virtualisable.


📶 5️⃣ Intégration srsRAN

Avec srsRAN :

  • LTE eNodeB
  • EPC minimal
  • UE soft
  • Intégration possible avec core Osmocom

Architecture mixte :

flowchart LR
    UE_LTE --> eNodeB
    eNodeB --> MME
    MME --> HSS
    MME --> SGW
    SGW --> PGW
Loading

Tu peux faire :

  • 2G GSM legacy
  • LTE moderne
  • Interco SIP

Et observer la transition technologique.


📞 6️⃣ VoWiFi / IMS via Asterisk

La page FOSS IMS Client montre :

UE WiFi → SIP → Asterisk → Core IMS simplifié

Schéma :

flowchart LR
    UE_WiFi --> SIP_Client
    SIP_Client --> Asterisk
    Asterisk --> Core_IMS
    Core_IMS --> MSC
Loading

Ce que ça permet :

  • Voix WiFi simulée
  • Interaction SIP ↔ GSM
  • Bridge entre monde IP pur et circuit switched

Tu obtiens une maquette quasi complète :

2G LTE VoWiFi Inter-PLMN SIP Subscriber management


🔬 7️⃣ Ce qu’on peut faire dessus (légitime)

Sur une telle archi tu peux :

📊 Observer

  • Attach inter-PLMN
  • SMS routing
  • MAP flows
  • GSUP subscriber queries
  • SIP ↔ GSM translation

🔒 Tester

  • Filtrage STP
  • Whitelist Global Title
  • Limitation TCAP rate
  • Séparation réseau interne/externe

📈 Mesurer

  • Latence M3UA
  • Impact congestion
  • CPU sous charge
  • Effets boucle routing-key

🧪 Simuler

  • Roaming
  • Défaillance STP
  • Perte HLR
  • Fallback 2G

🧩 8️⃣ Ce que ton lab devient réellement

Ce n’est plus :

“un hack GSM perso”

C’est :

  • un opérateur miniature virtualisé
  • multi-PLMN
  • multi-technologies
  • reproductible via build.sh / start.sh

Ça devient :

Plateforme pédagogique télécom complète.


🎯 9️⃣ Niveau architecture avancée

Si tu veux pousser encore :

  • Monitoring centralisé (Prometheus)
  • Dashboard MAP rate
  • Visualisation SCCP calls
  • Script failover STP
  • Simulation d’attaque interne (rate anomaly)

Et là tu as un simulateur d’opérateur quasi académique.


Franchement, ce genre d’architecture en lab perso, correctement documentée, c’est du niveau R&D.

Et le plus fort :

Tout est isolé en 172.20.x.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment