# 5G Core Network Function Hosts File
# Demonstrates port-level hostname support with hierarchical dot notation
#
# Format:
#   IP hostname          - Standard /etc/hosts format (supported by all OSes)
#   IP:port hostname     - VisualEther extension for port-specific mapping
#   [IPv6]:port hostname - VisualEther extension for IPv6 with port
#
# Hierarchy: NF.Domain or NF.Interface.Domain
#   - 5GC = 5G Core (SBA Network Functions)
#   - RAN = Radio Access Network
#   - UP  = User Plane

# ==============================================================================
# IP-Level Fallback
# ==============================================================================
127.0.0.1 🔗 localhost

# ==============================================================================
# 5G Service-Based Architecture (SBA) - HTTP/2 over TCP
# Standard 3GPP ports per TS 29.510
# ==============================================================================

# --- Server Ports (well-known NF service endpoints) ---

# Session Management Function
127.0.0.1:29502 🌐 SMF.5GC

# Unified Data Management
127.0.0.1:29503 🔐 UDM.5GC

# Unified Data Repository
127.0.0.1:29504 🗄️ UDR.5GC

# Policy Control Function
127.0.0.1:29507 💰 PCF.5GC

# Authentication Server Function
127.0.0.1:29509 🔐 AUSF.5GC

# Network Repository Function
127.0.0.1:29510 📋 NRF.5GC

# Access and Mobility Management Function (SBI)
127.0.0.1:29518 📍 AMF.5GC

# Binding Support Function
127.0.0.1:29521 🔗 BSF.5GC

# Network Slice Selection Function
127.0.0.1:29531 🎯 NSSF.5GC

# SMS Function
127.0.0.1:29540 💬 SMSF.5GC

# Network Exposure Function
127.0.0.1:29551 🔗 NEF.5GC

# --- Client Ports (ephemeral ports mapped to calling NF) ---
# These are the source ports used by NFs when making SBA calls

# SMF client ports (calls to AMF, UDM, PCF)
127.0.0.1:37824 🌐 SMF.5GC
127.0.0.1:37904 🌐 SMF.5GC
127.0.0.1:52836 🌐 SMF.5GC
127.0.0.1:52208 🌐 SMF.5GC

# AMF client ports (calls to AUSF, UDM, SMF, PCF)
127.0.0.1:55922 📍 AMF.5GC
127.0.0.1:55932 📍 AMF.5GC
127.0.0.1:52798 📍 AMF.5GC
127.0.0.1:52804 📍 AMF.5GC
127.0.0.1:52188 📍 AMF.5GC
127.0.0.1:40434 📍 AMF.5GC
127.0.0.1:40452 📍 AMF.5GC

# AUSF client ports (calls to UDM)
127.0.0.1:52784 🔐 AUSF.5GC
127.0.0.1:52792 🔐 AUSF.5GC

# UDM client ports (calls to UDR)
127.0.0.1:52618 🔐 UDM.5GC
127.0.0.1:52624 🔐 UDM.5GC
127.0.0.1:52630 🔐 UDM.5GC
127.0.0.1:52638 🔐 UDM.5GC
127.0.0.1:52642 🔐 UDM.5GC
127.0.0.1:52644 🔐 UDM.5GC
127.0.0.1:52648 🔐 UDM.5GC
127.0.0.1:52668 🔐 UDM.5GC

# PCF client ports (calls to UDR)
127.0.0.1:52654 💰 PCF.5GC
127.0.0.1:52674 💰 PCF.5GC

# ==============================================================================
# N2 Interface - NGAP over SCTP (gNB <-> AMF)
# ==============================================================================

# 5G NR Base Station (SCTP port 9487)
127.0.0.1:9487 📡 gNB.RAN

# AMF NGAP endpoint (N2 interface) - consolidated with AMF SBI
127.0.0.1:38412 📍 AMF.5GC

# ==============================================================================
# N4 Interface - PFCP over UDP (SMF <-> UPF)
# Standard port 8805 per 3GPP TS 29.244
# ==============================================================================

# SMF N4 endpoint - consolidated with SMF SBI
10.200.200.1:8805 🌐 SMF.5GC

# User Plane Function N4 endpoint (receives PFCP from SMF)
10.200.200.101:8805 🌐 UPF.UP

# Fallback for localhost testing
127.0.0.1:8805 🌐 UPF.UP

# ==============================================================================
# N3 Interface - GTP-U over UDP (gNB <-> UPF)
# Standard port 2152 per 3GPP TS 29.281
# ==============================================================================

# gNB/UERANSIM GTP-U endpoint
# In free5gc test setup, UERANSIM runs on 10.200.200.1
# Map to gNB (no port suffix) so GTP-U traffic connects with NGAP signaling
10.200.200.1:2152 📡 gNB.RAN

# UPF GTP-U endpoint (N3 interface)
# In free5gc, UPF N3 is on 10.200.200.102
# Map to UPF (no port suffix) so GTP-U connects with PFCP signaling
10.200.200.102:2152 🌐 UPF.UP

# ==============================================================================
# UE and Data Network (Inner IP in GTP-U tunnel)
# ==============================================================================

# UE IP address (assigned by SMF/UPF during PDU session establishment)
60.60.0.1 📱 UE.Data

# Data Network / External Server (DN)
60.60.0.101 🌐 DN.Data

# ==============================================================================
# IP-Level Fallbacks for User Plane Networks
# ==============================================================================

# free5gc: SMF (N4) + UERANSIM gNB simulator (N3) share this IP
# Falls back to gNB.RAN since gNB is the primary user of this IP
10.200.200.1 📡 gNB.RAN

# free5gc: UPF interfaces (N4 and N3 on different IPs, same logical UPF)
10.200.200.101 🌐 UPF.UP
10.200.200.102 🌐 UPF.UP
