TechWindo

Sharing insights on technology and innovation

gNB‑ID ↔ NCI Calculator

Notes
  • NCI is a 36-bit value: [gNB-ID (L bits)] || [Cell ID (36 − L) bits].
  • Valid L: 22 to 32. The Cell ID range is 0 … 2^(36−L) − 1.
  • Supports decimal and hex (prefix 0x optional).
  • All calculations are client-side; no data leaves your browser.

 

gNB‑ID & NCI: Concepts, Logic & Calculation Method (3GPP‑Aligned Notes)

These notes are aligned with:

  • 3GPP TS 38.300 (NR Overall Architecture)
  • 3GPP TS 38.413 (NGAP)
  • 3GPP TS 38.331 (RRC)

You may cite those standards in your blog.

1. What is gNB‑ID?

The gNB-ID (gNodeB Identifier) uniquely identifies a gNB within a PLMN.

  • It is a fixed-length binary identifier, where the length L is operator-configurable.
  • Valid lengths according to 3GPP:
22 bits ≤ L ≤ 32 bits

The gNB‑ID is part of the NR Cell Identity (NCI) and therefore becomes part of NR‑CGI.

Purpose of gNB‑ID:

  • Uniquely identify a gNB.
  • Used in NGAP messages between gNB and 5GC.
  • Part of NR‑CGI → used by UE during measurements and handovers.

2. What is NR Cell Identity (NCI)?

The NCI (NR Cell ID) is a 36‑bit globally unique cell identity.

NCI = 36 bits always, fixed by 3GPP.

The NCI is composed as:

[gNB-ID (L bits)] || [Cell ID (36 − L bits)]

Where:

  • L = gNB‑ID length (22 to 32)
  • Remaining bits = Cell ID

3. Why is NCI always 36 bits?

3GPP standardized 36 bits so that:

  • The cell identity fits into RRC, NGAP, and OAM messages uniformly.
  • Large deployments (dense NR networks) can allocate thousands of cells per gNB.

NCI Bit Structure:

Bit 35 -------------------------------- Bit 0
[ gNB-ID (L bits) | Local Cell ID (36-L bits) ]

Where Bit 35 is MSB (Most Significant Bit).

4. How many cells can a single gNB have?

Since the Cell ID portion = (36 − L) bits:

Number of local cells = 2^(36 − L)

Examples:

 
gNB‑ID Length (L) Cell ID Bits Max Cells per gNB
22 14 16,384
24 12 4,096
28 8 256
32 4 16

5. Forward Calculation: (gNB‑ID + Cell ID → NCI)

This is simply bit concatenation.

Formula:

NCI = (gNB_ID << (36 − L)) | CELL_ID

Where:

  • << = Left Shift
  • | = Bitwise OR

Example:

If:

  • L = 28 bits
  • gNB‑ID = 51234
  • Cell ID = 15

Then:

cell_bits = 36 − 28 = 8
NCI = (51234 << 8) | 15

The shift moves the gNB‑ID into the upper 28 bits.
OR-ing places the Cell ID in the lower bits.

6. Reverse Calculation: (NCI → gNB‑ID + Cell ID)

This is the inverse of concatenation.

Formulas:

gNB_ID = NCI >> (36 − L)
CELL_ID = NCI & (2^(36 − L) − 1)

Where:

  • >> = Right Shift
  • & = Bitwise AND

Explanation:

  1. Right shift drops lower bits → gives gNB‑ID.
  2. Masking extracts only the lower (36 − L) bits → gives Cell ID.

7. Why shifting & masking works?

Because binary concatenation works as:

A || B  ===  (A << length(B)) | B

So the reverse operations naturally retrieve:

  • Upper bits → A (gNB-ID)
  • Lower bits → B (Cell ID)

This method is 100% bit-accurate and matches how signaling messages pack the identifiers.

8. Where are these identifiers used in 3GPP?

 RRC (TS 38.331)

  • ServingCellConfigCommon includes NR‑CGI.
  • UE uses NR‑CGI for measurements and reporting (e.g., MeasResult).

 NGAP (TS 38.413)

  • NCI appears in messages like:
    • NG Setup
    • UE Context Setup Request
    • Handover Request

 OAM / O-RAN Management

  • NCI is logged for:
    • Performance metrics
    • Fault logs
    • PCI/RSRP Coverage analysis

9. Example Bit-Level Construction

Let’s assume:

  • gNB‑ID = 0xC85A → binary: 1100100001011010 (16 bits, but suppose padded to 28 bits)
  • L = 28
  • Cell ID = 0x0F (8 bits)

Final 36-bit NCI:

[ gNB-ID (28 bits) ][ Cell ID (8 bits) ]

Binary example:

1100100001011010 00000000 00001111

Hex packed:

0xC85A00F

Your plugin will output the exact decimal and hexadecimal form.

10. Why flexible gNB-ID length (22–32 bits)?

Operators need:

  • Freedom to plan numbering for thousands of sites.
  • Support for hierarchical cell identity structures.
  • Efficient NMS/OAM identity mapping.

If an operator has:

  • Few gNBs → larger Cell ID bits.
  • Many gNBs → smaller Cell ID bits.

This flexibility is crucial for large nationwide deployments.

11. Summary (Perfect for blog conclusion)

 
Concept Definition
gNB‑ID 22–32‑bit identifier for the gNB
NCI Always 36 bits = gNB‑ID (L bits) + Cell ID (36−L bits)
Forward Calc `NCI = (gNB_ID << (36 − L))
Reverse Calc gNB_ID = NCI >> (36 − L) + CELL_ID = NCI & ((1<<(36−L))-1)
Why it matters Used in NR‑CGI, RRC, NGAP signaling, handovers, measurements

January 31, 2026

Leave a Reply

Your email address will not be published. Required fields are marked *

Post View

Total Visitors: 21485