0. Agenda

This design is dedicated for the purpose of 2Q2019 Recovery epic (in "R2"): RICPLT-1850

1. RNibWriter

1.1. Currently

These are the current keys we save in RNib when triggering SaveNodeb:

KEY

VALUE

RAN:<INVENTORY_NAME>

<NodebInfo>

<NODE_TYPE>:<PLMN_ID>:<NB_ID>

<NodebInfo>

CELL:<CELL_ID> OR NRCELL:<NRCELL_ID>

<Cell>

PCI:<INVENTORY_NAME]:<PCI>

<Cell>

ENB

[<NbIdentity>]

GNB

[<NbIdentity>]

UNKNOWN

[<NbIdentity>]

1.2. Changes

2. Lost Connection flow

2.1. Currently

Current State

Next State

CONNECTED || CONNECTING || CONNECTED_SETUP_FAILED

DISCONNECTED

SHUTTING DOWN || SHUT DOWN

SHUT DOWN

2.2. New Proposed Flow

2.3. Sequence Diagram


3. E2Terminator Init flow

We shall add a new RMR message code in the routing table, as well as attach a dedicated E2TerminatorInitHandler.

3.1. E2TerminatorInitHandler Algorithm

3.2. Sequence Diagram


4. Zeroing Connection Attempts

We shall reset nodebInfo.ConnectionAttempts in all of the following code zones:

5. RanConnectionManager

5.1. ReconnectRan(ranName)

5.2. ExecuteSetup

For current implementation, please review 6.2.

func ExecuteSetup(rnibWriterProvider func() rNibWriter.RNibWriter, nodebInfo *entities.NodebInfo, rmrService *services.RmrService, startTime time.Time) error

Algorithm:

  1. Pack (RanIp,RanPort,RanName are derived from NodebInfo)

  2. Update NodebInfo ConnectionStatus to CONNECTING ,increment ConnectionAttempts and Save to RNIB

    nodebInfo.ConnectionStatus = CONNECTING
    nodebInfo.ConnectionAttempts++
    UpdateNodebInfo(nodebInfo)


  3. Send to RMR using rmrService.SendMessage

3.1.  Update NodebInfo ConnectionStatus to DISCONNECTED, decrease ConnectionAttempts and Save to RNIB

nodebInfo.ConnectionStatus = DISCONNECTED
nodeBinfo.ConnectionAttempts--
UpdateNodebInfo(nodebInfo)

3.2.  DONE

* Notice: At the next phase, we won’t send startTime as a parameter, we will take it from NodebInfo.

6. Appendix

6.1. ValidateRanConnectionForRecoverySetup implementation suggestion


isValid, nextConnectionStatus := ValidateRanConnectionForRecoverySetup(connectionStatus, connectionAttempts)

if !isValid {
 if nextConnectionStatus != nil {
	UpdateNodebInfo(nextConnectionStatus)
 }
 return
}	

ValidateRanConnectionForRecoverySetup(*ConnectionStatus, ConnectionAttempts) (bool, *ConnectionStatus) {
 	if connectionStatus == SHUTTING_DOWN {
		return false, ConnectionStatus.SHUT_DOWN
	}

	if connectionStatus == SHUT_DOWN {
		return false, nil
    }

    if connectionAttempts > MaxNoOfRanConnectionAttempts {
      	return false, ConnectionStatus.DISCONNECTED
    }
    
    return true, nil
}

6.2. Current Setup implementation (triggered from HTTP flow)


var wg sync.WaitGroup

go handler.CreateMessage(rc.Logger, &requestDetails, messageChannel, E2Sessions, startTime, wg)

go rc.rmrService.SendMessage(handler.GetMessageType(), messageChannel, errorChannel, wg)

wg.Wait()

err = <-errorChannel

if err != nil {
    handleErrorResponse(rc.Logger, http.StatusInternalServerError, internalErrorCode, sendMessageErrorMessage, writer, startTime)
	return
}

func (SetupRequestHandler) CreateMessage(logger *logger.Logger, requestDetails *models.RequestDetails, messageChannel chan *models.E2RequestMessage, e2sessions sessions.E2Sessions, startTime time.Time, wg sync.WaitGroup)