DTLS 1.2 (RFC 6347) secures a UDP link the same way TLS secures TCP: before any application data can move, client and server run a multi-flight handshake — ClientHello, a stateless HelloVerifyRequest cookie round trip, ServerHello + certificate chain + key exchange, then ClientKeyExchange + Finished on both sides. A full certificate-based handshake costs ~3 round trips and roughly 1.4 KB of certificate/key material, plus two expensive asymmetric-crypto operations (ECDHE key agreement, certificate signature verify). Session resumption with a cached session ID skips the certificate exchange and needs only ~1 round trip.
OSCORE (RFC 8613) takes a different approach: it protects the CoAP message itself with COSE/AEAD (AES-CCM-16-64-128) using a Security Context that both sides already share (provisioned out of band, e.g. via EDHOC). There is no on-path handshake at all — the very first CoAP request is already end-to-end encrypted and authenticated. Per-message overhead is just a Partial IV (sequence number) plus an 8-byte authentication tag, ≈13–19 bytes, versus a DTLS record's ≈29-byte header+IV+MAC overhead once a session exists.
Energy model used here (typical LPWAN radio, illustrative):
E_radio = bytes_over_air × 0.4 µJ/byte
E_sym = 15 µJ per AES-CCM seal/open (every secured message, both protocols)
E_asym = 3000 µJ per ECDHE/certificate operation (DTLS full handshake only)
Battery = 1,000,000 µJ budget, drains by E_radio + E_sym + E_asym
Anti-replay sliding window (RFC 8613 §7.4 / RFC 6347 §4.1.2.6): the receiver tracks the highest sequence number seen, hi, and a bitmap of the last W = 32 sequence numbers. An incoming message with sequence seq is accepted only if seq > hi − W and seq is not already marked received; otherwise it is a replay and is silently dropped. "Inject replay attack" re-transmits a previously captured packet's exact sequence number to show the window rejecting it.
Real-world relevance: this is why CoAP/OSCORE is favoured over DTLS for battery-powered sensors on 6LoWPAN/802.15.4 links — it removes the handshake's round trips and asymmetric crypto entirely, and its protection survives being relayed through untrusted CoAP proxies since the security lives in the message, not the transport session.