=== Gb/NS maintenance

This section describes common maintenance procedures.

[[ns2-nse-states]]
==== NSE states

A NSE can have the following states:

.NSE states
* ALIVE
* DEAD

For FR, IPA: The NSE is ALIVE if there is at least one NSVC in state UNBLOCKED.
For IP-SNS/UDP: The NSE is ALIVE if there is at least one NSVC ALIVE and the sum of all ALIVE NSVCs signalling weights > 0 and data weights > 0.

The state of the NSE is shown by vty.

.show ns
----
GbProxy# show ns nsei 1234
NSEI 01234: UDP, DEAD <1>
 FSM Instance Name: 'GPRS-NS2-SNS-BSS(NSE01234-SNS)[0x6120000012a0]', ID: 'NSE01234-SNS'
  Log-Level: 'DEBUG', State: 'BSS_SIZE'
  Timer: 1
 Maximum number of remote  NS-VCs: 8192, IPv4 Endpoints: 8192, IPv6 Endpoints: 8192
  1 NS-VC:
   NSVCI none: DISABLED DYNAMIC data_weight=1 sig_weight=1 udp)[127.0.0.1]:23000<>[127.0.0.1]:22000
----
<1> NSE state

==== NSVC states

A NSVC can have the following states:

.nsvc states
[options="header"]
|=========================================================
| State | transport UNITDATA | Description

| DISABLED	   | No   | Either the transport layer is unavailable (FR) or this NSVC is currently used by IP-SNS dynamic configuration.
| RESET	           | No   | Sending out RESET PDU and awaiting data.
| BLOCKED          | No*  | The NSVC has been BLOCKED. * see 3GPP TS 48.016 § 7.2 exception
| UNBLOCKED/ALIVE  | Yes  | The NSVC transport UNITDATA.
| RECOVERING       | No   | The NSVC test procedure timed out. NSVC type is a IP-SNS which don't use RESET/BLOCK/UNBLOCK.

|=========================================================

[[fig-nsvc-states-reset-block]]
.Simplified state diagram for RESET BLOCK UNBLOCK NSVCs
[graphviz]
----
include::gb-ns2-nsvc-states-reset-block.dot[]
----

[[fig-nsvc-states-alive]]
.Simplified state diagram for IP-SNS/UDP
[graphviz]
----
include::gb-ns2-nsvc-states-alive.dot[]
----

==== Show information of a specific NSE

The NSE 1234 has been configured for as BSS with IP-SNS configuration.

.show ns on a dynamic configured IP-SNS NSE
----
GbProxy# show ns nsei 1234
NSEI 01234: UDP, DEAD <1>
 FSM Instance Name: 'GPRS-NS2-SNS-BSS(NSE01234-SNS)[0x6120000012a0]', ID: 'NSE01234-SNS'
  Log-Level: 'DEBUG', State: 'BSS_SIZE' <2>
  Timer: 1
 Maximum number of remote  NS-VCs: 8192, IPv4 Endpoints: 8192, IPv6 Endpoints: 8192
  1 NS-VC:
   NSVCI none: DISABLED DYNAMIC data_weight=1 sig_weight=1 udp)[127.0.0.1]:23000<>[127.0.0.1]:22000
----
<1> A UDP NSE. A NSE can be ALIVE or DEAD
<2> The SNS state. CONFIGURED and LOCAL_PROCEDURE are ALIVE states

For description of NSE states see <<ns2-nse-states>>.

.show ns on a frame relay NSE
----
OsmoNSdummy# show ns nsei 02001
NSEI 02001: FR, ALIVE <1>
  4 NS-VC:
   NSVCI 00001: DISABLED PERSIST data_weight=1 sig_weight=1 fr)netif: hdlcnet1 dlci: 16 <2>
   NSVCI 00002: DISABLED PERSIST data_weight=1 sig_weight=1 fr)netif: hdlcnet2 dlci: 17 <3>
   NSVCI 00003: DISABLED PERSIST <4> data_weight=1 sig_weight=1 fr)netif: hdlcnet3 dlci: 18
   NSVCI 00004: DISABLED PERSIST data_weight=1 sig_weight=1 fr)netif: hdlcnet4 dlci: 19
----
<1> A FR NSE. A NSE can be ALIVE or DEAD
<2> An unblocked NS-VC will be used for data and signalling. data and signalling weight are only relevant for UDP NSVC.
<3> NSVC is still blocked.
<4> A PERSIST NSVC is a configured via VTY.

==== Blocking a NSVC

.how to block a single NSVC
----
OsmoNSdummy# show ns nsei 01234
NSEI 01234: UDP, ALIVE since 0d 0h 41m 6s
  2 NS-VC:
   NSVCI 01234: UNBLOCKED PERSIST udp)[127.0.0.1]:23000\<1234>[127.0.0.1]:22000 ALIVE since 0d 0h 2m 36s
   NSVCI 01235: UNBLOCKED PERSIST udp)[127.0.0.1]:23001\<1235>[127.0.0.1]:22001 ALIVE since 0d 0h 41m 6s

OsmoNSdummy# nsvc 1234 block
The NS-VC 01234 will be blocked.
OsmoNSdummy# show ns nsei 01234
NSEI 01234: UDP, ALIVE since 0d 0h 42m 7s
  2 NS-VC:
   NSVCI 01234: BLOCKED PERSIST udp)[127.0.0.1]:23000\<1234>[127.0.0.1]:22000 DEAD since 0d 0h 3m 37s
   NSVCI 01235: UNBLOCKED PERSIST udp)[127.0.0.1]:23001\<1235>[127.0.0.1]:22001 ALIVE since 0d 0h 42m 7s
----
