Handling DLMS Push Setup (Class 40) DataNotification APDU with TCP Wrapper on Port 4059
-
Architecture & Implementation
In modern smart metering deployments, meters autonomously push alarm events and hourly load readings using COSEM Class 40 (Push Setup) and Class 41 (Data Notification), instead of relying on round-robin polling from the Head-End System.
Push APDU Format over TCP Wrapper (Port 4059)
00 01 00 01 00 01 00 28 0F 00 00 00 01 00 00 01 02 02 09 0C 07 EA 08 16 ...Wrapper Header Analysis (8 bytes)
00 01: Protocol Version (0x0001for DLMS TCP Wrapper)00 01: Source WPort (Meter Logical Client ID)00 01: Destination WPort (HES Receiver Server ID)00 28: PDU Length (40 bytes)0F: APDU Tag ->Data-Notification(Tag0x0F/ 15)
Key Considerations
- Unsolicited Connection Management: The HES TCP server must maintain asynchronous socket listeners capable of handling thousands of simultaneous incoming TCP connections without blocking.
- Association Context: Push notifications are often sent without full AARQ authentication handshake. The meter uses predefined ciphering parameters (General-Ciphering
0xDBor General-Signing0xDF) with Dedicated Encryption Key (DEK).
-
When parsing the
push_object_listin Attribute 2 of the Push Setup object, ensure your server dynamically deserializes the structure array. Typical push payload includes:- Logical Device Name (
0.0.42.0.0.255) - Timestamp (
0.0.1.0.0.255) - Active Energy Import (+A) (
1.0.1.8.0.255) - Active Power (+P) (
1.0.21.7.0.255)
If the meter firmware adds an alarm code into the push list, dynamic schema decoding prevents parsing crashes.
- Logical Device Name (
-
For encrypted Push notifications (
0xDBtag), the HES receiver must extract the System Title and Invocation Counter from the ciphered APDU header, lookup the corresponding Global Unicast Encryption Key (GUEK) in the HSM / Key Vault, and decrypt using AES-GCM-128.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login