NR Software N3IWF version 2025-12-12*This document is based on the latest test release.
Features may not be present in your current installed software. You may check their availability in change history or in your release documentation.
If you require an up to date release, ask for it in a ticket.
Features may not be present in your current installed software. You may check their availability in change history or in your release documentation.
If you require an up to date release, ask for it in a ticket.
Table of Contents
- 1 Introduction
- 2 Installation
- 3 Command line monitor reference
- 4 Configuration reference
- 5 Remote API
- 6 Log file format
- 7 Change history
- 7.1 Version 2025-12-12
- 7.2 Version 2025-09-19
- 7.3 Version 2025-06-13
- 7.4 Version 2025-03-14
- 7.5 Version 2024-12-13
- 7.6 Version 2024-09-13
- 7.7 Version 2024-06-14
- 7.8 Version 2024-03-15
- 7.9 Version 2023-12-15
- 7.10 Version 2023-09-08
- 7.11 Version 2023-06-10
- 7.12 Version 2023-03-17
- 7.13 Version 2022-12-16
- 7.14 Version 2022-09-16
- 7.15 Version 2022-06-17
- 7.16 Version 2022-03-18
- 7.17 Version 2021-12-17
- 7.18 Version 2021-09-17
- 8 License
1 Introduction
LTEN3IWF is a N3IWF (Non-3GPP Interworking element) implementation.
LTEN3IWF interfaces with a 5GS Core Network thru the standard NG interface whilst supporting IPsec connectivity towards the UE.
2 Installation
2.1 Linux setup
2.1.1 Packages
LTEN3IWF uses the SCTP protocol for which the necessary packages are not usually installed. In order to install them, do as root user:
- Fedora
dnf install lksctp-tools kernel-modules-extra
- Ubuntu
sudo apt-get install lksctp-tools linux-image-extra-3.13.0-24-generic
Note that linux-image-extra package name may differ depending on your kernel version.
To verify that SCTP kernel module is running, do as root user:
checksctp
If it reports that the protocol is not supported,
- check if you have a /etc/modprobe.d/sctp-blacklist.conf file
- edit it to comment the ’blacklist sctp’ line
Then reboot the PC in case the Linux kernel was upgraded too.
2.1.2 OpenSSL
LTEN3IWF has been compiled against openssl version 3.5.4.
If your system does not have compatible version installed you may have this error message at startup:
error while loading shared libraries: libssl.so.3: cannot open shared object file: No such file or directory
To overcome this problem, you may:
- Copy libssl.so.3 and libcrypto.so.3 from
libssubdirectory of your release tarball.
If you have installed software with automatic install script, this should have been done automatically. - Compile and install proper openssl version yourself
In case of persisting issue, raise a ticket from our support site at https://support.amarisoft.com/ with the information provided by below commands executed in LTEN3IWF directory:
uname -a ls -l ldd ./lten3iwf openssl version
2.1.3 License key installation
LTEN3IWF needs a license key file to run. It is associated to your PC, so if you replace it or change its hardware configuration you must contact Amarisoft to get a new license key.
The following steps are needed to get this license file:
- Run LTEN3IWF:
./lten3iwf config/n3iwf.cfg
It says that the license key is not present and prints a 16 digit hexadecimal code.
- Send by mail to
delivery@amarisoft.comthis hexadecimal code to your contact at Amarisoft. You will get back the lten3iwf.key license key file. - Copy the lten3iwf.key file to the ${HOME}/.amarisoft/ directory (
${HOME}is the home directory of therootuser). You can use the shell variableAMARISOFT_PATHto change this path.
Once the license key is installed, lten3iwf should start normally.
2.2 LTEN3IWF installation
Decompress the LTEN3IWF archive to a convenient place. The executable
lten3iwf can be launched from this directory.
2.2.1 Basic LTEN3IWF configuration
The main configuration file is config/n3iwf.cfg. It uses a superset of the JSON syntax.
2.3 Initial testing
Customize and start the lte_init.sh script as root user to
configure the network and CPU governors.
Start the LTEMME software as root user. root priviledges
are needed to set up the virtual network interface.
./ltemme config/mme.cfg
In another terminal, start the LTEN3IWF software as root user.
root priviledges are needed to use real time scheduling
priority.
./lten3iwf config/n3iwf.cfg
The N3IWF is now running. Type ng in the command line
monitor of LTEN3IWF to verify that it is connected to LTEMME.
3 Command line monitor reference
The following commands are available:
helpDisplay the help. Use
help commandto have a more detailed help about a command.ueList connected UEs.
ngDump the NG connection state. It is useful to see if the N3IWF is connected to the AMF.
ngconnect [amf_addr]Force a NG (re)connection to the AMF. The AMF IP address and optional port can be given as an optional parameter.
ngdisconnectForce a NG disconnect from the AMF.
ngaddAdds a new AMF to the list of NGAP connections.
Message definition
The message must contain the same parameters as one of the object defined in amf_list array. See amf_list.ngdeleteRemoves a AMF address from the list of NGAP connections.
Message definitionaddrngdelete addrString. AMF address to be removed from the list.
4 Configuration reference
4.1 Configuration file syntax
The main configuration file uses a syntax very similar to the Javascript Object Notation (JSON) with few extensions.
- Supported types:
- - Numbers (64 bit floating point). Notation:
13.4 - - Complex numbers. Notation:
1.2+3*I - - Strings. Notation:
"string" - - Booleans. Notation:
trueorfalse. - - Objects. Notation:
{ field1: value1, field2: value2, .... } - - Arrays. Notation:
[ value1, value2, .... ]
- - Numbers (64 bit floating point). Notation:
- The basic operations
+,-,*and/are supported with numbers and complex numbers.+also concatenates strings. The operators!,||,&&,==,!=,<,<=,>=,>are supported too. - The numbers
0and1are accepted as synonyms for the boolean valuesfalseandtrue. - {} at top level are optional.
- " for property names are optional, unless the name starts with a number.
- Properties can be duplicated.
If properties are duplicated, they will be merged following JSON merge rules with overriding occuring in reading direction (last overrides previous).
Ex:{ value: "foo", value: "bar", sub: { value: "foo" }, sub: { value: "bar" } }Will be equivalent to:
{ value: "bar", sub: { value: "bar" } } - Files can be included using include keyword (must not be quoted) followed by a string (without :) representing the file to include (path is relative to current file) and terminating by a comma.
Arrays can’t be included.
Merge will be done as for duplicate properties.
If file1.cfg is:value: "foo", include "file2.cfg", foo: "foo"And file2.cfg is:
value: "bar", foo: "bar"Final config will be:
{ value: "bar", foo: "foo" } - A C like preprocessor is supported. The following preprocessor commands are available:
#define var exprDefine a new variable with value expr. expr must be a valid JSON expression. Note that unlike the standard C preprocessor, expr is evaluated by the preprocessor.
#undef varUndefine the variable var.
#include exprInclude the file whose filename is the evaluation of the string expression expr.
#if exprConsider the following text if expr is true.
#elseAlternative of
#ifblock.#elifComposition of
#elseand#if.#endifEnd of
#ifblock.#ifdef varShortcut for
#if defined(var)#ifndef varShortcut for
#if !defined(var)
In the JSON source, every occurrence of a defined preprocessor variable is replaced by its value.
- Backquote strings: JSON expression can be inserted in backquote delimited strings with the
${expr}syntax. Example:`abc${1+2}d`is evaluated as the string"abc3d". Preprocessor variables can be used inside the expression. Backquote strings may span several lines.
4.1.1 JSON merge rules
Merge overriding direction depends on context, i.e source may override destination or the opposite.
JSON merge is recursive for Objects and Arrays.
Example, merging
{
foo: { value: "bar" },
same: "one",
one: 1
}
with
{
foo: { value: "none", second: true },
same: "two",
two: 1
}
Will become:
{
foo: { value: "bar", second: true },
same: "one",
one: 1
two: 1
}
assuming first object overrides second one.
In case of Array merging, the final array length will be the maximum length of all merged arrays.
For each element of the final array, merge will be done considering defined elements only.
Ex:
{
array: [0, 1, 2, { foo: "bar" } ],
array: [3, 4],
array: [5, 6, 7, { bar: "foo" }, 8 ]
}
Will be merged to:
{
array: [5, 6, 7, { foo: "bar", bar: "foo" }, 8 ],
}
4.2 Properties
log_filenamelog_filename-
String. Set the log filename. If no leading
/, it is relative to the configuration file path. See Log file format. log_optionslog_options-
String. Set the logging options as a comma separated list of assignments.
- layer.level=verbosity. For each layer, the log verbosity can be set
to
none,error,infoordebug. In debug level, the content of the transmitted data is logged. - layer.max_size=n. When dumping data content, at
most
nbytes are shown in hexa. For ASN.1, NAS or Diameter content, show the full content of the message ifn > 0. - layer.payload=[0|1]. Dump ASN.1, NAS, SGsAP or Diameter payload in hexadecimal.
- layer.key=[0|1]. Dump security keys (NAS and RRC layers).
- layer.crypto=[0|1]. Dump plain and ciphered data (NAS and PCDP layers).
- layer.verbose=[0|1]. If
layerisipsec, dump all packets filtering informations. - time=[sec|short|full]. Display the time as seconds, time only or full date and time (default = time only).
- time.us=[0|1]. Dump time with microseconds precision.
- file=cut. Close current file log and open a new one.
- file.rotate=now. Move and rename to the same directory or to the directory pointed by
file.pathand open a new log file (Headers are kept). - file.rotate=size. Every time log file size reaches size bytes,
move and rename to the same directory or to the directory pointed by
file.path, and open a new log file (Headers are kept).
Size is an integer and can be followed by K, M or G. - file.rotate=#count. Everytime number of logs in log file reaches count,
move and rename to the same directory or to the directory pointed by
file.path, and open a new log file (Headers are kept).
Size is an integer and can be followed by K, M or G. - file.path=path. When log rotation is enabled (
file.rotateset), rename and move current log to this path instead of initial log path. - append=[0|1]. (default=0). If 0, truncate the log file when opening it. Otherwise, append to it.
Available layers are:
nas,ip,gtpu,ngap,n3iwf,ikev2,ipsec - layer.level=verbosity. For each layer, the log verbosity can be set
to
log_synclog_syncOptional boolean (default = false). If true, logs will be synchronously dumped to file.
Warning, this may lead to performances decrease.com_addrcom_addrOptional string. Address of the WebSocket server remote API. See Remote API.
If set, the WebSocket server for remote API will be enabled and bound to this address.
Default port is 9011.
Setting IP address to [::] will make remote API reachable through all network interfaces.com_namecom_nameOptional string. Sets server name. N3IWF by default
com_ssl_certificatecom_ssl_certificateOptional string. If set, forces SSL for WebSockets. Defines CA certificate filename.
com_ssl_keycom_ssl_keyOptional string. Mandatory if com_ssl_certificate is set. Defines CA private key filename.
com_ssl_peer_verifycom_ssl_peer_verifyOptional boolean (default is false). If true, server will check client certificate.
com_ssl_cacom_ssl_caOptional string. Set CA certificate. In case of peer verification with self signed certificate, you should use the client certificate.
com_log_lockcom_log_lockOptional boolean (default is false). If true, logs configuration can’t be changed via
config_setremote API.com_log_uscom_log_usOptional boolean (default is false). If true, logs sent by
log_getremote API response will have atimestamp_usparameters instead oftimestampcom_authcom_authOptional object. If set, remote API access will require authentication.
Authentication mechanism is describe in Remote API Startup section.
passfilecom_auth.passfileOptional string. Defines filename where password is stored (plaintext).
If not set,passwordmust be setpasswordcom_auth.passwordOptional string. Defines password.
If not set,passfilemust be set.unsecurecom_auth.unsecureOptional boolean (default false). If set, allow password to be sent plaintext.
NB: you should set it to true if you access it from a Web Browser (Ex: Amarisoft GUI) without SSL (https) as your Web Browser may prevent secure access to work.
com_log_countcom_log_countOptional number (Default = 8192). Defines number of logs to keep in memory before dropping them.
Must be between 4096 and 2097152).sim_eventssim_eventsArray of object. Each element defines a remote API request (Remote API) except that
messagefield is replaced byevent.
sim_events_loop_countsim_events_loop_countIf set, will define
loop_countfor each event ofsim_events, See loop_count.sim_events_loop_delaysim_events_loop_delayIf set, will define
loop_delayfor each event ofsim_events, See loop_delay.gtp_addrgtp_addr-
String. Set the IP address (and optional port) on which the GTP-U packets are received. The default port is 2152. It is normally the IP address of the network interface connected to the core network.
gtp_payload_mtugtp_payload_mtuOptional integer (range 68 to 16384, default = 1500). MTU in bytes for the GTP-U payload. Do not forget to update the network interface MTU accordingly for optimal performance. For example with a GTP MTU of 1500 bytes, interface should have a MTU of at least 1564 bytes.
gtp_use_packet_bundlinggtp_use_packet_bundlingOptional boolean (default = false). Concatenate multiple GTP-U PDUs within a single UDP datagram. Be careful, this is a non-standard option that must not be activated if the peer is not an Amarisoft AMF with this option activated.
amf_listamf_listArray of objects. List of AMF to which the N3IWF is connected. Each object contains the following properties:
amf_addramf_list.amf_addr-
String. Set the IP address (and optional port) of NGAP SCTP connection to the AMF. The default port is 38412.
gtp_ext_addramf_list.gtp_ext_addr-
Optional string. Set the IP address on which the Core Network should transmit the GTP-U packets. It is the same as gtp_addr by default. It can be different if the N3IWF is behind a NAT.
ngap_bind_addramf_list.ngap_bind_addrOptional string. IP address and optional port on which the NGAP SCTP connection is bound.
5qi_dscp_mappingamf_list.5qi_dscp_mappingOptional array of objects. Allows to define a specific IP differentiated services code point for a given 5QI. 5QI not explicitly configured use the default DSCP value 0.
Each object must contain the following properties:5qiamf_list.5qi_dscp_mapping.5qiInteger (range 1 to 254). 5QI value.
dscpamf_list.5qi_dscp_mapping.dscpInteger (range 0 to 63). DSCP value.
backup_amf_addramf_list.backup_amf_addrOptional string. Defines the IP address (and optional port) of the backup AMF to be used if the NG connection is not established with the current AMF. If the NG connection is established, the backup AMF will not be used. There must be a corresponding object for the backup AMF in the
amf_listarray.priorityamf_list.priorityOptional integer (range 0 to 1, default 0). Defines the priority of a given AMF. When performing AMF selection, if no candidate is found with priority n, the candidates with priority n+1 are tested.
n3iwf_idn3iwf_idInteger in range 0-0xFFFF. The N3IWF global identifier.
n3iwf_namen3iwf_nameOptional string. Set N3IWF name used in NG connection setup request.
plmn_listplmn_listList of objects. List of PLMNs and NPNs supported. The total number of PLMNs (identified by a PLMN identity in plmn) and SNPNs (identified by a PLMN identity and a NID in snpn) shall not exceed 12. Each object contains the following properties:
plmnplmn_list.plmnString or array of strings. PLMN (5 or 6 digits). The array can contain up to 12 PLMNs.
snpnplmn_list.snpnOptional array of 1 to 12 objects. List of Stand-Alone Non-Public Network.
Each element contains the following parameters:plmnplmn_list.snpn.plmnPLMN string (5 or 6 digits).
nid_listplmn_list.snpn.nid_listArray of NID as defined in 23.003 12.7 Stand-Alone Non-Public Network Identifier an contains the following parameters. Each element contains the following parameters:
nid_valueplmn_list.snpn.nid_list.nid_valueString (10 hexadecimal digits). NID value.
assignment_modeplmn_list.snpn.nid_list.assignment_modeOptional enumeration ("self", "coordinated_1", "coordinated_2"). Default value is "self". Each combination of a PLMN and NID identifies a Stand-Alone Non-Public Network.
tacplmn_list.tacInteger (range 1 to 0xFFFFFF, except 0xFFFFFE). Tracking Area Code of the cell.
nssaiplmn_list.nssaiOptional array. List of supported S-NSSAIs.
Default content is sst: 1 (eMBB).
Each entry will set a S-NSSAI value as defined below:sstplmn_list.nssai.sstInteger (range 0-255). Slice Service Type.
sdplmn_list.nssai.sdOptional integer (range 0-0xFFFFFE). Slice Differentiator.
remote_ip_configremote_ip_configObject describing the IP allocation of the UE inner address as defined in 3GPP TS 23.502. Contains the following properties:
first_ip_addrremote_ip_config.first_ip_addrString. First available IPv4 address.
last_ip_addrremote_ip_config.last_ip_addrString. Last available IPv4 address.
ipv4_auto_incrementremote_ip_config.ipv4_auto_incrementOptional boolean (default = false). If set to false, the same IPv4 address is allocated for successive UE connection/disconnection. If set to true, the IPv4 address is incremented for UE connection/disconnection.
ip_addr_shiftremote_ip_config.ip_addr_shiftOptional integer (default = 0). The allocated IPv4 addresses are allocated starting from
first_ip_addrwith a difference of2^ip_addr_shift. Hencelast_ip_addr - first_ip_addrmust be a multiple of2^ip_addr_shift. This option can be useful in case of inter-UE communication to ensure that the IPv4 address of a given UE is the only one in its netmask.
local_ip_configlocal_ip_configObject describing the IP allocation of the UP_IP_ADDRESS associated with a child Sa as defined in 3GPP TS 23.502. Contains the following properties:
first_ip_addrlocal_ip_config.first_ip_addrString. First available IPv4 address.
last_ip_addrlocal_ip_config.last_ip_addrString. Last available IPv4 address.
ipv4_auto_incrementlocal_ip_config.ipv4_auto_incrementOptional boolean (default = false). If set to false, the same IPv4 address is allocated for successive UE connection/disconnection. If set to true, the IPv4 address is incremented for UE connection/disconnection.
ip_addr_shiftlocal_ip_config.ip_addr_shiftOptional integer (default = 0). The allocated IPv4 addresses are allocated starting from
first_ip_addrwith a difference of2^ip_addr_shift. Hencelast_ip_addr - first_ip_addrmust be a multiple of2^ip_addr_shift. This option can be useful in case of inter-UE communication to ensure that the IPv4 address of a given UE is the only one in its netmask.nas_ip_addrlocal_ip_config.nas_ip_addrOptional string. Address of the local TCP server for NAS signalling. If not present, the first IP of the subnet (See local_ip_config) will be used.
nwunwuConfiguration of the NWu connection. This object contains the following properties:
bind_addrnwu.bind_addrIP address on which the NWu connection is bound.
private_keynwu.private_keyString. Defines the N3IWF private key filename.
certificatenwu.certificateString. Defines the N3IWF certificate filename. The default files n3iwf_private_key.pem and n3iwf_cert.pem are built for N3IWF FQDN "n3iwf.5gc.mnc001.mcc001.pub.3gppnetwork.org" following the procedure decribed below. For another N3IWF FQDN, these files shall be re-built by setting the FQDN in subjectAltName field. Procedure to generate and check the private key file n3iwf_private_key.pem and the certificate file n3iwf_cert.pem:
openssl genrsa -out ca.key 2048 openssl req -new -x509 -days 365 -key ca.key -out ca.crt openssl req -newkey rsa:2048 -nodes -keyout n3iwf_private_key.pem -out n3iwf_cert.pem openssl x509 -req -extfile <(printf "subjectAltName=DNS:n3iwf.5gc.mnc001.mcc001.pub.3gppnetwork.org") -days 365 -in n3iwf_cert.pem -CA ca.crt -CAkey ca.key -CAcreateserial -out n3iwf_cert.pem openssl x509 -in n3iwf_cert.pem -text openssl rsa -in n3iwf_private_key.pem -textesp_durationnwu.esp_durationOptional integer in range 10 to 5*3600 (default = 300). Gives the duration in seconds of the ESP-Sa.
ike_durationnwu.ike_durationOptional integer in range 20 to 48*3600 (default = 24*3600). Gives the duration in seconds of the IKE-Sa.
omit_auth_in_first_auth_rspnwu.omit_auth_in_first_auth_rspOptional boolean (default = false). If set, configures the N3IWF to not send the AUTH payload in the first IKE_AUTH exchange.
ike_encryption_algo_listnwu.ike_encryption_algo_listOptional list of IKE-Sa supported encryption algorithms "aes-cbc-128" (AES CBC 128 bits key length), "aes-cbc-192" (AES CBC 192 bits key length), "aes-cbc-256" (AES CBC 256 bits key length), "aes-gcm-128-16" (AES GCM 128 bits key length and 16 bytes ICV), "aes-gcm-256-16" (AES GCM 256 bits key length and 16 bytes ICV), "3des", "blowfish", "aes-ctr-128" (AES CTR 128 bits key length), "aes-ctr-192" (AES CTR 192 bits key length), and aes-ctr-256 (AES CTR 256 bits key length) ordered from most preferred to least preferred.
Default value is ["aes-cbc-128", "aes-cbc-192", "aes-cbc-256", "aes-gcm-128-16", "aes-gcm-256-16", "3des", "blowfish", "aes-ctr-128", "aes-ctr-192", "aes-ctr-256"].ike_integrity_algo_listnwu.ike_integrity_algo_listOptional list of IKE-Sa supported integrity algorithms "hmac-sha-1-96", "hmac-sha-1-160", "hmac-sha-256-128", "hmac-sha-384-192", "hmac-sha-512-256", "hmac-md5-96", "hmac-md5-128" and "aes-cmac-96" ordered from most preferred to least preferred.
Default value is ["hmac-sha-1-96", "hmac-sha-1-160", "hmac-sha-256-128", "hmac-sha-384-192", "hmac-sha-512-256", "hmac-md5-96", "hmac-md5-128", "aes-cmac-96"];ike_prf_listnwu.ike_prf_listOptional list of IKE-Sa supported pseudo-random functions "prf-hmac-sha1", "prf-hmac-sha2-256", "prf-hmac-sha2-384", "prf-hmac-sha2-512" and "prf-hmac-md5" ordered from most preferred to least preferred.
Default value is ["prf-hmac-sha1", "prf-hmac-sha2-256", "prf-hmac-sha2-384, "prf-hmac-sha2-512", "prf-hmac-md5"].ike_dh_group_listnwu.ike_dh_group_listOptional list of IKE-Sa supported Diffie-Hellman groups "group_1", "group_2", "group_5", "group_14", "group_15", "group_16", "group_17", "group_18", "group_19", "group_22", "group_23" and "group_24" ordered from most preferred to least preferred.
Default value is ["group_5", "group_14", "group_15", "group_16", "group_17", "group_18", "group_19", "group_22", "group_23", "group_24"].esp_encryption_algo_listnwu.esp_encryption_algo_listOptional list of ESP-Sa supported encryption algorithms "null", "aes-cbc-128" (AES CBC 128 bits key length), "aes-cbc-192" (AES CBC 192 bits key length), "aes-cbc-256" (AES CBC 256 bits key length), "3des", "blowfish", "aes-ctr-128" (AES CTR 128 bits key length), "aes-ctr-192" (AES CTR 192 bits key length), and aes-ctr-256 (AES CTR 256 bits key length) ordered from most preferred to least preferred.
Default value is ["null", "aes-cbc-128", "aes-cbc-192", "aes-cbc-256", "3des", "blowfish", "aes-ctr-128", "aes-ctr-192", "aes-ctr-256"].esp_integrity_algo_listnwu.esp_integrity_algo_listOptional list of ESP-Sa supported integrity algorithms "null", "hmac-sha-1-96", "hmac-sha-1-160", "hmac-sha-256-128", "hmac-sha-384-192", "hmac-sha-512-256", "hmac-md5-96", "hmac-md5-128" and "aes-cmac-96" ordered from most preferred to least preferred.
Default value is ["null", "hmac-sha-1-96", "hmac-sha-1-160", "hmac-sha-256-128", "hmac-sha-384-192", "hmac-sha-512-256", "hmac-md5-96", "hmac-md5-128", "aes-cmac-96"].esp_dh_group_listnwu.esp_dh_group_listOptional list of ESP-Sa supported Diffie-Hellman groups "none", "group_1", "group_2", "group_5", "group_14", "group_15", "group_16", "group_17", "group_18", "group_19", "group_22", "group_23" and "group_24" ordered from most preferred to least preferred.
This list is used for rekeying ESP-Sa. Default value is ["none", "group_5", "group_14", "group_15", "group_16", "group_17", "group_18", "group_19", "group_22", "group_23", "group_24"].dpd_timer_valuenwu.dpd_timer_valueOptional integer in range 5 to 300 (default = 300). Gives the "dead peer detection" timer value in seconds.
mobikenwu.mobikeOptional boolean (default = true). Indicates MOBIKE support.
dont_fragmentnwu.dont_fragmentOptional boolean (default = true) used to enable/disable the fragmentation of the ESP packets.
ike_generate_errornwu.ike_generate_errorOptional object. Allows to ignore a message or generate an error during an IKE exchange.
It contains the following objects:exchangenwu.ike_generate_error.exchangeString. Gives the exchange to ignore or on which the error must be sent. Possible values are "none", "ike_sa_init", "ike_auth_step1", "ike_auth_step2", "ike_auth_step3", "dpd", "mobike".
reject_notify_listnwu.ike_generate_error.reject_notify_listOptional array. If absent, the message received during the exchange will be ignored.
If present, the message received during the exchange will be rejected, and each element of the array describes a Notify payload to insert in the response. Each element of the array contains:errornwu.ike_generate_error.reject_notify_list.errorOptional integer. Gives the value of ’Notify Message Type’ to send in the Notify payload rejecting the exchange.
datanwu.ike_generate_error.reject_notify_list.dataOptional hexadecimal string. May be present if error is present.
Gives the Notification Data to send in the Notify payload.
ttlnwu.ike_generate_error.ttlOptional integer. If set,
ike_generate_erroris appliedttltimes. If not set,ike_generate_erroris applied until it is modified.
Example:
ike_generate_error: { exchange: "ike_auth_step1", reject_notify_list: [ { error: 9002, data: "1234", }, { error: 9003, data: "5678", }], ttl: 1 }
5 Remote API
You can access LTEN3IWF via a remote API.
Protocol used is WebSocket as defined in RFC 6455
(https://tools.ietf.org/html/rfc6455).
Note that Origin header is mandatory for the server to accept connections.
This behavior is determined by the use of nopoll library.
Any value will be accepted.
To learn how to use it, you can refer to our the following tutorial.
5.1 Messages
Messages exchanged between client and LTEN3IWF server are in strict JSON
format.
Each message is represented by an object. Multiple message can be sent to
server using an array of message objects.
Time and delay values are floating number in seconds.
There are 4 types of messages:
- Request
Message sent by client.
Common definition:messagerequest.messageString. Represent type of message. This parameter is mandatory and depending on its value, other parameters will apply.
message_idrequest.message_idOptional any type. If set, response sent by the server to this message will have same message_id. This is used to identify response as WebSocket does not provide such a concept.
start_timerequest.start_timeOptional float. Represent the delay before executing the message.
If not set, the message is executed when received.
absolute_timerequest.absolute_timeOptional boolean (default = false). If set,
start_timeis interpreted as absolute.
You can get current clock of system usingtimemember of any response.standalonerequest.standaloneOptional boolean (default = false). If set, message will survive WebSocket disconnection, else, if socket is disconnected before end of processing, the message will be cancelled.
loop_countrequest.loop_countOptional integer (default = 0, max = 1000000). If set, message will be repeated
loop_counttime(s) afterloop_delay(From message beginning of event).
Response will have aloop_indexto indicate iteration number.loop_delayrequest.loop_delayOptional number (min = 0.1, max = 86400). Delay in seconds to repeat message from its
start_time. Mandatory whenloop_countis set > 0.
- Notification
For some API, intermediate message may be sent by server before reception of response.
Common definition:messagenotification.messageString. Same as request.
message_idnotification.message_idOptional any type. Same as in request.
timenotification.timeNumber representing time in seconds of the message start, relative to the beginning of the process.
Useful to send command with absolute time.notificationnotification.notificationString. Notification purpose
utcnotification.utcNumber representing UTC seconds (local clock) when the response has been generated.
- Response
Message sent by server after any request message has been processed.
Common definition:messageresponse.messageString. Same as request.
message_idresponse.message_idOptional any type. Same as in request.
timeresponse.timeNumber representing time in seconds of the message start, relative to the beginning of the process.
Useful to send command with absolute time.utcresponse.utcNumber representing UTC seconds (local clock) when the response has been generated.
absolute_timeresponse.absolute_timeOptional string. If
absolute_timehas been set and message is reaching LTEN3IWF too late, this field is present and set tolate.
- Events
Message sent by server on its own initiative.
Common definition:messageevent.messageString. Event name.
timeevent.timeNumber representing time in seconds.
Useful to send command with absolute time.
5.2 Startup
When WebSocket connections is setup, LTEN3IWF will send a first message with
name set to com_name and type set to N3IWF.
If authentication is not set, message will be ready:
{
"message": "ready",
"type": "N3IWF",
"name": <com_name>,
"version": <software version>,
"product": <Amarisoft product name (optional)>
}
If authentication is set, message will be authenticate :
{
"message": "authenticate",
"type": "N3IWF",
"name": <com_name>,
"challenge": <random challenge>
}
To authenticate, the client must answer with a authenticate message
and a res parameter where:
res = HMAC-SHA256( "<type>:<password>:<name>", "<challenge>" )
res is a string and HMAC-SHA256 refers to the standard algorithm
(https://en.wikipedia.org/wiki/HMAC)
If the authentication succeeds, the response will have a ready field
set to true.
{
"message": "authenticate",
"message_id": <message id>,
"ready": true
}
If authentication fails, the response will have an error field and will
provide a new challenge.
{
"message": "authenticate",
"message_id": <message id>,
"error": <error message>,
"type": "N3IWF",
"name: <name>,
"challenge": <new random challenge>
}
If any other message is sent before authentication succeeds,
the error "Authentication not done" will be sent as a response.
5.3 Errors
If a message produces an error, response will have an error string field representing the error.
5.4 Sample nodejs program
You will find in this documentation a sample program: ws.js.
It is located in doc subdirectory.
This is a nodejs program that allow to send message to LTEN3IWF.
It requires nodejs to be installed:
dnf install nodejs npm npm install nodejs-websocket
Use relevant package manager instead of NPM depending on your Linux distribution.
Then simply start it with server name and message you want to send:
./ws.js 127.0.0.1:9011 '{"message": "config_get"}'
5.5 Common messages
config_getRetrieve current config.
Response definition:
typeconfig_get.typeAlways "N3IWF"
nameconfig_get.nameString representing server name.
logsconfig_get.logsObject representing log configuration.
With following elements:layersconfig_get.logs.layersObject. Each member of the object represent a log layer configuration:
layer nameObject. The member name represent log layer name and parameters are:
levelconfig_get.logs.layers.root.levelSee log_options
max_sizeconfig_get.logs.layers.root.max_sizeSee log_options
keyconfig_get.logs.layers.root.keySee log_options
cryptoconfig_get.logs.layers.root.cryptoSee log_options
payloadconfig_get.logs.layers.root.payloadSee log_options
verboseconfig_get.logs.layers.root.verboseOptional boolean. See log_options
countconfig_get.logs.countNumber. Number of bufferizer logs.
rotateconfig_get.logs.rotateOptional number. Max log file size before rotation.
rotate_countconfig_get.logs.rotate_countOptional number. Max log count before rotation.
pathconfig_get.logs.pathOptional string. Log rotation path.
bcchconfig_get.logs.bcchBoolean. True if BCCH dump is enabled (eNB only).
mibconfig_get.logs.mibBoolean. True if MIB dump is enabled (eNB only).
lockedconfig_get.lockedOptional boolean. If
true, logs configuration can’t be changed withconfig_setAPI.
config_setChange current config.
Each member is optional.
Message definition:logsconfig_set.logsOptional object. Represent logs configuration. Same structure as config_get (See config_get logs member).
All elements are optional.
Layer name can be set toallto set same configuration for all layers.
If set and logs are locked, response will havelogsproperty set tolocked.nwuconfig_set.nwuOptional object allowing to configure N3IWF options. It may contain the following object:
esp_durationconfig_set.nwu.esp_durationOptional integer in range 10 to 5*3600 (default = 300). Gives the duration in seconds of the ESP-Sa.
ike_durationconfig_set.nwu.ike_durationOptional integer in range 20 to 48*3600 (default = 24*3600). Gives the duration in seconds of the IKE-Sa.
mobikeconfig_set.nwu.mobikeOptional boolean. Indicates MOBIKE support.
dont_fragmentconfig_set.nwu.dont_fragmentOptional boolean used to enable/disable the fragmentation of the ESP packets.
ike_generate_errorconfig_set.nwu.ike_generate_errorOptional object. Allows to ignore a message or generate an error during the initial exchanges.
It contains the following objects:exchangeconfig_set.nwu.ike_generate_error.exchangeString. Gives the exchange to ignore or on which the error must be sent. Possible values are "none", "ike_sa_init", "ike_auth_step1", "ike_auth_step2", "ike_auth_step3".
errorconfig_set.nwu.ike_generate_error.errorOptional integer. Gives the value of ’Notify Message Type’ to send in the Notify payload rejecting the exchange.
It present, the message received during the exchange will be rejected.
If absent, the message received during the exchange will be ignored.
log_getGet logs.
This API has a per connection behavior. This means that the response will depend on previous calls to this API within the same WebSocket connection.
In practice, logs that have been provided in a response won’t be part of subsequent request unless connection is reestablished. To keep on receiving logs, client should send a newlog_getrequest as soon as the previous response has been received.
If a request is sent before previous request has been replied, previous request will be replied right now without considering specific min/max/timeout conditions.Message definition:
minlog_get.minOptional number (default = 1). Minimum amount of logs to retrieve.
Response won’t be sent until this limit is reached (Unless timeout occurs).maxlog_get.maxOptional number (default = 4096). Maximum logs sent in a response.
timeoutlog_get.timeoutOptional number (default = 1). If at least 1 log is available and no more logs have been generated for this time, response will be sent.
allow_emptylog_get.allow_emptyOptional boolean (default = false). If set, response will be sent after timeout, event if no logs are available.
rntilog_get.rntiOptional number. If set, send only logs matching rnti.
ue_idlog_get.ue_idOptional number. If set, send only logs with matching ue_id.
layerslog_get.layersOptional Object. Each member name represents a log layer and values must be string representing maximum level. See log_options.
If layers is not set, all layers level will be set to debug, else it will be set to none.
Note also the logs is also limited by general log level. See log_options.
shortlog_get.shortOptional boolean (default = false). If set, only first line of logs will be dumped.
headerslog_get.headersOptional boolean. If set, send log file headers.
start_timestamplog_get.start_timestampOptional number. Is set, filter logs older than this value in milliseconds.
end_timestamplog_get.end_timestampOptional number. Is set, filter logs more recent than this value in milliseconds.
max_sizelog_get.max_sizeOptional number (default = 1048576, i.e. 1MB). Maximum size in bytes of the generated JSON message. If the response exceeds this size, the sending of logs will be forced independently from other parameters.
Response definition:
logslog_get.logsArray. List of logs. Each item is a an object with following members:
datalog_get.logs.dataArray. Each item is a string representing a line of log.
timestamplog_get.logs.timestampNumber. Milliseconds since January 1st 1970. Not present if
com_log_usis set in configuration.
timestamp_uslog_get.logs.timestamp_usNumber. Microseconds since January 1st 1970. Only present if
com_log_usis set in configuration.
layerlog_get.logs.layerString. Log layer.
levellog_get.logs.levelString. Log level: error, warn, info or debug.
dirlog_get.logs.dirOptional string. Log direction: UL, DL, FROM or TO.
ue_idlog_get.logs.ue_idOptional number. UE_ID.
celllog_get.logs.cellOptional number (only for PHY layer logs). Cell ID.
rntilog_get.logs.rntiOptional number (only for PHY layer logs). RNTI.
framelog_get.logs.frameOptional number (only for PHY layer logs). Frame number (Subframe is decimal part).
channellog_get.logs.channelOptional string (only for PHY layer logs). Channel name.
srclog_get.logs.srcString. Server name.
idxlog_get.logs.idxInteger. Log index.
headerslog_get.logs.headersOptional array. Array of strings.
discontinuitylog_get.discontinuityOptional number. If set, this means some logs have been discarded due to log buffer overflow.
microsecondslog_get.microsecondsOptional boolean. Present and set to true if
com_log_usis set in configuration file.
log_setAdd log.
Message definition:loglog_set.logOptional string. Log message to add. If set, layer and level are mandatory.
layerlog_set.layerString. Layer name. Only mandatory if log is set.
levellog_set.levelString. Log level: error, warn, info or debug. Only mandatory if log is set.
dirlog_set.dirOptional string. Log direction: UL, DL, FROM or TO.
ue_idlog_set.ue_idOptional number. UE_ID.
flushlog_set.flushOptional boolean (default = false). If set, flushes fog file.
rotatelog_set.rotateOptional boolean (default = false). If set, forces log file rotation.
cutlog_set.cutOptional boolean (default = false). If set, forces log file reset.
log_resetResets logs buffer.
licenseRetrieves license file information.
Response definition:
productslicense.productsString. List of products, separated by commas.
userlicense.userString. License username.
validitylicense.validityString. License end of validity date.
idlicense.idOptional string. License ID.
id_typelicense.id_typeOptional string. License ID type. Can be
host_idordongle_iduidlicense.uidOptional string. License unique ID.
filenamelicense.filenameOptional string. License filename.
serverlicense.serverOptional string. License server URL.
server_idlicense.server_idOptional string. License server ID.
quitTerminates lten3iwf.
helpProvides list of available messages in messages array of strings and events to register in events array of strings.
statsReport statistics for LTEN3IWF.
Every time this message is received by server, statistics are reset.
Warning, calling this message from multiple connections simultaneously will modify the statistics sampling time.Response definition:
cpustats.cpuObject. Each member name defines a type and its value cpu load in % of one core.
instance_idstats.instance_idNumber. Constant over process lifetime. Changes on process restart.
ipsecReport ipsec SAs.
Response definition:
SAsipsec.SAsArray. List of object representing a security association witth following definition:
typeipsec.SAs.typeString. IP version, can be
IPv4orIPv6.diripsec.SAs.dirString. Direction, can be
inorout.spiipsec.SAs.spiNumber. SPI.
ue_idipsec.SAs.ue_idNumber. Associated
ue_id.modeipsec.SAs.modeString. ESP type, can be
tunnelortransportsrcipsec.SAs.srcString. Source IP address.
dstipsec.SAs.dstString. Destination IP address.
tun_srcipsec.SAs.tun_srcOptional string. Tunnel source IP address.
tun_dstipsec.SAs.tun_dstOptional string. Tunnel destination IP address.
src_prefixipsec.SAs.src_prefixNumber. Source network prefix.
dst_prefixipsec.SAs.dst_prefixNumber. Destination network prefix.
authent_keyipsec.SAs.authent_keyString. Authentication key in hexadecimal form (Empty string authentication is disabled).
cipher_keyipsec.SAs.cipher_keyString. Ciphering key in hexadecimal form (Empty string ciphering is disabled).
5.6 N3IWF messages
ngGet AMF link state.
Response definition:ng_listng.ng_listArray of object. One for each AMF connection defined as follow:
stateng.ng_list.stateLink state: disconnected, connecting, connected, inactive or setup_done.
addressng.ng_list.addressAMF address.
nameng.ng_list.nameAMF name.
PLMNng.ng_list.PLMNIf connection complete, PLMN.
ngconnectForces connection to an AMF.
Message definitionaddressngconnect.addressOptional string. If not set, will try to connect to all registered AMF, else will try with the specified address.
ngdisconnectForces disconnection from an AMF.
Message definitionaddressngdisconnect.addressOptional string. If not set, will to disconnect from all registered AMF, else will try with the specified address.
ngaddAdds a new AMF to the list of NGAP connections.
Message definition
The message must contain the same parameters as one of the object defined in amf_list array. See amf_list.ngdeleteRemoves a AMF address from the list of NGAP connections.
Message definitionaddrngdelete.addrString. AMF address to be removed from the list.
ue_ctx_relForces a UE context release.
Message definition:ran_ue_idue_ctx_rel.ran_ue_idInteger. RAN UE id.
6 Log file format
6.1 NAS layer
When a NAS message is dumped, the format is:
time layer - message
When a NAS data PDU is dumped (debug level), the format is:
time layer dir MME_UE_ID message_type
long_content
timeTime using the selected format
layerIndicate the layer (
[NAS]here).dirUL (uplink) or DL (downlink).
MME_UE_IDMME S1AP UE identifier (hexadecimal).
message_typeNAS message type.
long_contentFull content of the NAS message if
nas.max_size > 0.
6.2 IP layer
When a IP data PDU is dumped (debug level), the format is:
time layer dir short_content
long_content
timeTime using the selected format
layerIndicate the layer (
[IP]here).dirUL (uplink) or DL (downlink).
short_contentSingle line content (at least the IP protocol and the source and destination address).
long_contentOptional hexadecimal dump of the PDU if
ip.max_size > 0.
6.3 NGAP and GTP-U layers
When a message is dumped, the format is:
time layer - message
When a data PDU is dumped (debug level), the format is:
time layer dir ip_address short_content
long_content
timeTime using the selected format.
layerIndicate the layer (
[NGAP]or[GTPU]here).dirDirection:
TOorFROM.ip_addresssource or destination IP address, depending on the
dirfield.short_contentSingle line content.
long_content- NGAP: full ASN.1 content of the message if
layer.max_size > 0. - GTPU: hexadecimal dump of the message if
layer.max_size > 0.
- NGAP: full ASN.1 content of the message if
7 Change history
7.1 Version 2025-12-12
- OpenSSL library is upgraded to 3.5.4
- removed deprecated DES-CBC IKE and IPsec encryption algorithm
7.2 Version 2025-09-19
-
tacparameter range is updated to forbid reserved values specified in 3GPP 23.003 - DCSP values for GTP-U tunnels are set to Expedited Forwarding for 5QI 1 and 65 in the configuration files delivered
7.3 Version 2025-06-13
-
erroranddataobjects inike_generate_errorobject are replaced byreject_notify_listobject. The old syntax is still supported for backward compatibility
7.4 Version 2025-03-14
- NGAP ASN.1 is updated to v18.4.0
- added NGAP overload support
7.5 Version 2024-12-13
- NGAP ASN.1 is updated to v18.3.0
7.6 Version 2024-09-13
- added
licenseremote API -
mobikeparameter is added innwuobject andconfig_setremote API -
dont_fragmentparameter is added tonwuconfiguration object andconfig_setremote API -
encr-null-auth-aes-gmac-128,encr-null-auth-aes-gmac-192andencr-null-auth-aes-gmac-256values are added toesp_encryption_algo_list -
com_logs_lockparameter is renamed tocom_log_lock.com_logs_lockis still supported for backward compatibility - added
com_log_usparameter
7.7 Version 2024-06-14
- OpenSSL library is upgraded to 1.1.1w
- added
backup_amf_addrandpriorityparameters toamf_listobject
7.8 Version 2024-03-15
- added MOBIKE support
- added more remote APIs documentation
- added AMF name to
ngmonitor command
7.9 Version 2023-12-15
- added
loop_countandloop_delayto remote API messages - added
sim_events,sim_events_loop_countandsim_events_loop_delay - added
com_ssl_caparameter for SSL verification
7.10 Version 2023-09-08
- NGAP ASN.1 is updated to v17.5.0
-
gtp_use_packet_bundlingparameter is added for GTP-U PDUs bundling support -
ipsecremote API added
7.11 Version 2023-06-10
- NGAP ASN.1 is updated to v17.4.0
-
com_logs_lockparameter added to disable logs configuration change via remote API
7.12 Version 2023-03-17
-
com_addrparameter now uses [::] address instead of 0.0.0.0 in the delivered configuration file to allow IPv6 connection
7.13 Version 2022-12-16
- NGAP ASN.1 is updated to v17.2.0
- added new IKE-Sa and ESP-Sa algorithms
- added
snpnparameter toplmn_listobject for NPN support - added
dpdvalue toexchangeparameter - added
utcparameter to remote API response messages
7.14 Version 2022-09-16
- "ipsec debug" monitor is now deprecated. Set ipsec.verbose to 1 in log configuration
- added
dpd_timer_valueparameter
7.15 Version 2022-06-17
- OpenSSL library is upgraded to 1.1.1n
- added new IKE-Sa and ESP-Sa algorithms and groups
- added
start_timestampandend_timestamptolog_getAPI - added
ike_durationparameter -
esp_durationandike_durationparameters can be changed withconfig_setAPI
7.16 Version 2022-03-18
-
ike_generate_errorconfiguration object is added - added NAT traversal support
7.17 Version 2021-12-17
-
ike_encryption_algo_list,ike_integrity_algo_list,ike_prf_list,ike_dh_group_list,esp_encryption_algo_list,esp_integrity_algo_listandesp_dh_group_listparameters are added to make the list of N3IWF supported algorithms configurable -
licensemonitor command is added
7.18 Version 2021-09-17
- Initial release
8 License
lten3iwf is copyright (C) 2012-2025 Amarisoft. Its redistribution
without authorization is prohibited.
lten3iwf is available without any express or implied warranty. In
no event will Amarisoft be held liable for any damages arising from
the use of this software.
For more information on licensing, please refer to license terms.