BroadbandForum / obuspa

OB-USP-AGENT is a system daemon providing a User Services Platform (USP) Agent. https://github.com/BroadbandForum/obuspa/wiki
BSD 3-Clause "New" or "Revised" License
93 stars 62 forks source link

Error while creating sessions #58

Closed iamrenny closed 2 years ago

iamrenny commented 2 years ago

Hello team,

I started doing some tests creating with E2E Experimental Sessions feature sending a get device operation from the controller to the obuspa agent and I'm getting the following error message:

ValidateSessionContextHandling: E2E USP Record containing wrong identifiers (sess: 1661285390, seq: 1, exp: 0). Ignoring USP Record content
E2E_CONTEXT_E2eSessionEvent: Event Termination received on Controller instance 1
ClearE2eSessionState: The E2E Session is reset.
MSG_HANDLER_QueueUspDisconnectRecord: USP Disconnect to send with reason 7105
E2E_CONTEXT_E2eSessionEvent: Event Termination completed on Controller instance 1

E2E_DISCONNECT_RECORD sending at time 2022-08-20T22:58:28Z, to host mosquitto over MQTT
version: "1.2"
to_id: "proto::controller_id"
from_id: "proto::agent_id"
payload_security: PLAINTEXT
mac_signature[0]
sender_cert[0]
disconnect {
  reason: "ValidateSessionContextHandling: E2E USP Record containing wrong identifiers (sess: 1661285390, seq: 1, exp: 0). Ignoring USP Record content."
  reason_code: 7105
}

The header received in the agent is:

version: ""
to_id: "proto::agent_id"
from_id: "proto::controller_id"
payload_security: PLAINTEXT
mac_signature[0]
sender_cert[0]
session_context {
  session_id: 1661285390
  sequence_id: 1
  expected_id: 0
  retransmit_id: 0
  payload_sar_state: NONE
  payloadrec_sar_state: NONE
  payload[79]
}

Any help is appreciated.

holme-r commented 2 years ago

The error is correct. Your USP controller is sending a USP Record with expected_id=0, when it should be sending it with expected_id=1. This is because expected_id is the next sequence_id that your controller expects to receive and sequence_id counts from 1. Which USP Controller do you see this behaviour with ?

iamrenny commented 2 years ago

The error is correct. Your USP controller is sending a USP Record with expected_id=0, when it should be sending it with expected_id=1. This is because expected_id is the next sequence_id that your controller expects to receive and sequence_id counts from 1. Which USP Controller do you see this behaviour with ?

@holme-r Thanks for your response, it now works.