Universal COSEM simulator (UCS1)

UCS1 is Windows application that behaves like a COSEM server. It listens to a client, waiting for COSEM requests and sends the corresponding responses. A COSEM client connects to UCS1 using the TCP, UDP (both IpV4 or ipV6)  or the HDLC communication profile. It establishes an application association, exchanges requests/responses and finally releases the application association.

UCS1 supports associations within all defined application-contexts, i.e. LN, SN, LN_WITH_CIPHERING and SN_WITH_CIPHERING.

It supports security suites 0, 1 and 2 with service specific global and dedicated services, general global and dedicated services as well as the GeneralCiphering service.

It supports service specific block-transfers (LN and SN) as well as General-Block-Transfer.

It supports all the security mechanisms, LOW_LEVEL as well as HIGH_LEVEL (with MD5, SHA1, GMAC, SHA256 and ECDSA).

UCS1 implements the ACCESS service, it generates DataNotifications, (push) and also simulates the DataProtection class.

The ''personality'' of the simulated device is defined by a device-description xml file with the following simple structure:

<LogicalDevice>
  <Name Value = "\Logical device name" >
  <ServerSAP Value = "0001" >
  <COSEMObjectList Qty = "AUTO">
    // many objects
    //...
  <COSEMObjectList>
<LogicalDevice>
 

COSEMObjectList is a list of xml-elements, each defining an instance of a COSEM object.

The list can have any number of elements of any COSEM class. Therefore, a wide range of servers can be simulated.

For example, a COSEM register object is declared using a RegisterObject element as shown below:

<RegisterObject>
  <Name Value="0100020806FF" >
  <Value>
    <DoubleLongUnsigned Value="00000000" >
  <Value>
  <ScalerUnit>
    <Scaler Value="00" >
    <PhysUnit Value="UnitWattHour" >
  <ScalerUnit>
<RegisterObject>

A RegisterObject defines one instance of the (COSEM) class Register. A value is defined for each attribute of the object.

The simulator supports all classes defined (so far) in Blue Book 12.1. The syntax of the device-description xml file (and the syntax of the possible objects, of all COSEM classes) is described in this simplified ASN.1 syntax document.

An example of a device-description file is available here.

The COSEMObjectList holds one or several LNAssociationObject (and/or SNAssociationObject). According to the Blue Book, an AssociationObject has several attributes that define the properties of the related association like object_list, associated_partners_ids, application_context_name, mechanism_name, etc...:

<LNAssociationObject>
  <Name Value="0000280008FF" >
  <ObjectList Qty="AUTO" >
    // can be left empty
  <ObjectList>
  <AssociatedPartnersId>
    <ClientSAP Value="08" >
    <ServerSAP Value="0001" >
  <AssociatedPartnersId>
  <ApplicationContextName Value="LN_WITH_CIPHERING" >
  <xDLMSContextInfo>
    <Conformance>
      <ConformanceBit Name="Action" >
      <ConformanceBit Name="SelectiveAccess" >
      <ConformanceBit Name="Set" >
      <ConformanceBit Name="Get" >
      <ConformanceBit Name="DataNotification" >
      <ConformanceBit Name="MultipleReferences" >
      <ConformanceBit Name="Attribute0SupportedWithGet" >
      <ConformanceBit Name="BlockTransferWithSetOrWrite" >
      <ConformanceBit Name="BlockTransferWithGetOrRead" >
      <ConformanceBit Name="GeneralBlockTransfer" >
      <ConformanceBit Name="GeneralProtection" >
      <ConformanceBit Name="Access" >
    <Conformance>
    <MaxRecPduSize Value="0200" >
    <MaxSendPduSize Value="0200" >
    <DLMSVersionNr Value="06" >
    <QualityOfService Value="00" >
    <CypheringInfo Value="000000000000000000000000000000000000" >
  <xDLMSContextInfo>
  <AuthenticationMechanismName Value="HIGH_SECURITY_ECDSA" >
  <Secret Value="\12345678" >
  <AssociationStatus Value="NonAssociated" >
  <SecuritySetupReference Value="00002B0001FF" >
  <UserList Qty="0000" >
  <UserList>
  <CurrentUser>
    <UserId Value="00" >
    <UserName Value="" >
  <CurrentUser>
<LNAssociationObject>

When a client wants to establish an association with UCS1, it sends an AssociationRequest. Then, the simulator locates in its LogicalDevice.COSEMObjectList an association object (called the current association) that matches the request  (same partners_id, same application_context_name and same authentication_mechanism_name.

If found, then it fills the ObjectList of the current association (if empty) with references to all the objects declared in the LogicalDevice.COSEMObjectList.

The user interface of UCS1 displays two tabs: Device that shows the device-description xml file, and LOG that shows a detailed log of the activity:

The user interface of the simulator with the device-description tab
The user interface of the simulator with the log tab.

UCS1 hosts one COSEM logical device, but with possibly several AssociationObjects each with different partners-id, application-contexts, mechanism-names.

To download and setup the free demo version see this page.

The demo version supports the TCP (ipV4) and HDLC profiles, LN and SN application contexts , NO_SECURITY and LOW_SECURITY mechanisms and classes with class_id up do 29.