Feature #3648

persistent VLR (across re-starts of osmo-msc / across power outage)

Added by laforge over 2 years ago. Updated over 1 year ago.

Target version:
Start date:
Due date:
% Done:


Spec Reference:


As per 3GPP spec, all VLR state inside OsmoMSC is volatile, i.e. if the MSC is restarted, all state is lost.

This may be the classic view from the GSM spec side, but in th Osmocom context, OsmoMSC may not be as reliable as other implementations are assumed to be, and crashes may be more likely to happen. Having the VLR state persist across such crashes would be a useful feature to have.

There has been some earlier brainstorming on simply putting all the VLR data structures into a SysV shared memory segment, which survives osmo-msc process termination and could hence be used here.

See for a recent thrad about this, and the issues that would need to be resolved.

There also were some suggestions to look at LMDB as a solution to the probem.

LMDB does catually call blocking file I/O when writing/updating the data, which is not something we like to see in the Osmocom universe, as it will severely affect performance of our single-threaded event loop driven approach.

However, it has some advantages, too:
  • proven code-base, used extensively in OpenLDAP and other projects for many years
  • very unlikely chance of corrupting the database, as the mmap() is normally read-only and the only way to write data is by using explicit file I/O.
  • running the backing file storage on tmpfs should mitigate the blocking file I/O
  • running the backing file storage on a real SSD or flash file system would give us state that persists even across power outages or reboots, which is an issue with distributed GSM networks such as those of Rhizomatica, where OsmoMSC is in some remote village with unreliable AC power.

one of the issues with LMDB is that it's a pure key-value store without any anciliar indexes. The VLR entries are primarily looked up by IMSI, but they equally need toe be looked up by TMSI or even by MSISDN. See the following link for a pointer on how OpenLDAP slapd is implementing indexes on top of LMDB (back-lmdb)

Related issues

Related to OsmoHLR - Feature #3649: Investigate LMDB as HLR data storageNew10/12/2018


#1 Updated by laforge over 2 years ago

  • Description updated (diff)

#2 Updated by laforge over 2 years ago

  • Related to Feature #3649: Investigate LMDB as HLR data storage added

#3 Updated by laforge over 1 year ago

  • Priority changed from Normal to Low

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)