Internet-Draft NCBP December 2026
Abdelazim Expires 5 June 2027 [Page]
Workgroup:
Network Working Group
Internet-Draft:
draft-azima-ncbp-00
Published:
Intended Status:
Experimental
Expires:
Author:
Z. Abdelazim

Network ClipBoard Protocol (NCBP)

Abstract

The Network ClipBoard Protocol (NCBP) enables real-time clipboard synchronization across devices on a shared local network. NCBP defines a client-server architecture where a central relay server accepts clipboard content from connected clients and broadcasts updates to all other authenticated peers. The protocol operates over TCP with mandatory TLS 1.3 encryption and Pre-Shared Key (PSK) authentication derived via PBKDF2-HMAC-SHA256. This document specifies the binary message format, connection lifecycle, keepalive mechanism, service discovery via mDNS/DNS-SD, targeted delivery, and security considerations for NCBP version 1.0.

Status of This Memo

This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.

Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.

Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."

This Internet-Draft will expire on 4 June 2027.

▲

Table of Contents

1. Introduction

Modern workflows span multiple devices -- laptops, desktops, phones, and tablets. Copying text on one device and pasting it on another currently requires third-party cloud services, which introduce latency, privacy concerns, and internet dependency.

NCBP solves this by providing a lightweight, LAN-optimized protocol for clipboard synchronization that:

1.1. Scope

This specification (version 1.0) covers plain text clipboard content only. Future versions MAY extend the protocol to support images, rich text, files, and other MIME types via the content type registry defined in Appendix B.

1.2. Design Goals

  • Sub-100ms clipboard propagation on a LAN
  • Zero-configuration discovery
  • End-to-end encryption of clipboard content
  • Support for heterogeneous device networks
  • Graceful handling of device join/leave events

1.3. Non-Goals

  • Internet/WAN clipboard sync (out of scope for version 1)
  • Conflict resolution for simultaneous edits
  • Clipboard history or versioning at the protocol level
  • File transfer beyond text content

2. Terminology

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.

NCBP Server
The central relay node that accepts client connections and broadcasts clipboard updates.
NCBP Client
A device that connects to the server, sends clipboard updates, and receives broadcasts.
Peer
Any NCBP client connected to the same server.
PSK
Pre-Shared Key -- a secret passphrase known to all authorized devices in a clipboard group.
Clip
A unit of clipboard content transmitted via the protocol.
Device ID
A 128-bit (16-byte) randomly generated unique identifier assigned to each client instance.
Session
The period from a successful HELLO/WELCOME exchange to disconnection.

3. Protocol Overview

+----------+          +-------------+          +----------+
| Client A | -------> | NCBP Server | -------> | Client B |
| (copy)   |  CLIP    |   (relay)   | CLIP_    | (paste)  |
|          |          |             | NOTIFY   |          |
+----------+          +-------------+          +----------+
                            |
                            +-----> +----------+
                            |       | Client C |
                            +-----> | (paste)  |
                                    +----------+
Figure 1
  1. All clients establish persistent TCP+TLS connections to the server.
  2. When a user copies text on Client A, the client sends a CLIP message to the server.
  3. The server broadcasts a CLIP_NOTIFY to all other connected clients (or a targeted subset).
  4. Each receiving client updates its local clipboard.

4. Transport Layer

4.1. TCP

NCBP operates over TCP [RFC9293]. Implementations MUST use TCP as the transport protocol.

4.2. Default Port

The default port for NCBP is 31337/tcp. Implementations SHOULD allow configuration of an alternate port.

4.3. TLS

All NCBP connections MUST be encrypted using TLS 1.3 [RFC8446] or later. Implementations MUST NOT fall back to unencrypted TCP in production use.

The TLS layer MUST be established before any NCBP messages are exchanged. The NCBP handshake (HELLO/WELCOME) occurs within the encrypted TLS channel.

4.3.1. PSK Authentication

NCBP uses a Pre-Shared Key model for authentication:

  1. All devices in a clipboard group share a common passphrase.
  2. The passphrase is used to derive a 256-bit key using PBKDF2-HMAC-SHA256 [RFC8018] with a minimum of 100,000 iterations.
  3. During the NCBP HELLO, the client proves knowledge of the PSK by sending HMAC-SHA256(PSK, nonce).
  4. The server verifies the HMAC before granting session access.

The PSK derivation parameters:

salt       = "NCBP-v1-salt"  (12 bytes, ASCII)
iterations = 100000
dklen      = 32 bytes (256 bits)
psk        = PBKDF2-HMAC-SHA256(passphrase, salt, iterations, dklen)

4.4. Connection Parameters

  • TCP Keepalive: Implementations SHOULD enable TCP-level keepalive.
  • TCP_NODELAY: Implementations SHOULD set TCP_NODELAY to minimize clipboard propagation latency.
  • Maximum Message Size: 1,048,576 bytes (1 MiB). Messages exceeding this size MUST be rejected with error code PAYLOAD_TOO_LARGE (0x0003).

5. Message Format

All NCBP messages use a fixed-size binary header followed by a variable-length payload.

5.1. Header Format

The header is 36 bytes:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|         Magic (0x4E42)        |   Version     |     Type      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Flags             |          Message ID           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       Payload Length                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                     Timestamp (64-bit)                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                                                               |
|                     Device ID (128-bit)                       |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Table 1
Field Offset Size Description
Magic 0 2 bytes Protocol identifier: 0x4E42 ("NB" in ASCII)
Version 2 1 byte Protocol version (0x01 for NCBP/1.0)
Type 3 1 byte Message type (see Section 6)
Flags 4 2 bytes Bitfield flags (see Section 5.2)
Message ID 6 2 bytes Sequence number, wraps at 65535
Payload Length 8 4 bytes Length of payload in bytes (big-endian)
Timestamp 12 8 bytes Unix epoch milliseconds (big-endian)
Device ID 20 16 bytes UUID of the sending device

All multi-byte integer fields are in network byte order (big-endian).

5.2. Flags

 0                   1
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|A|R|E|          Reserved       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Table 2
Bit Name Description
0 ACK_REQ Sender requests acknowledgment
1 ACK_RSP This message is an acknowledgment
2 ENCRYPT Payload is additionally encrypted (reserved for future use)
3-15 Reserved MUST be zero

6. Message Types

Table 3
Value Name Direction Description
0x01 HELLO Client -> Server Authentication request
0x02 WELCOME Server -> Client Authentication accepted
0x03 CLIP Client -> Server Clipboard content update
0x04 CLIP_NOTIFY Server -> Client Broadcast clipboard to peers
0x05 PING Bidirectional Keepalive request
0x06 PONG Bidirectional Keepalive response
0x07 PEER_JOIN Server -> Client New peer connected notification
0x08 PEER_LEAVE Server -> Client Peer disconnected notification
0x09 ERROR Server -> Client Error notification
0x0A BYE Bidirectional Graceful disconnect
0x0B SECURE_SEND Client -> Server E2E encrypted direct message
0x0C SECURE_RECV Server -> Client Forwarded encrypted direct message
0x0D SECURE_ACK Bidirectional Delivery/read receipt for secure message

Values 0x00 and 0x0E-0xFF are reserved for future use.

7. Payload Structures

7.1. HELLO (0x01)

Sent by the client immediately after TLS handshake.

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                   PSK Auth Hash (32 bytes)                    |
|                            ...                                |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                      Nonce (16 bytes)                         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      Device Name Length       |    Device Name (UTF-8) ...    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Table 4
Field Size Description
PSK Auth Hash 32 bytes HMAC-SHA256(PSK, nonce)
Nonce 16 bytes Cryptographically random nonce
Device Name Length 2 bytes Length of device name in bytes
Device Name Variable UTF-8 encoded device name (max 255 bytes)

7.2. WELCOME (0x02)

Sent by the server upon successful authentication.

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       Session ID                              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|         Peer Count            |        Peer List ...          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Each peer entry in the peer list:

Table 5
Field Size Description
Device ID 16 bytes Peer's UUID
Device Name Length 2 bytes Length of device name
Device Name Variable UTF-8 device name

7.3. CLIP (0x03)

Sent by a client when its clipboard content changes.

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Content Type  |                                               |
+-+-+-+-+-+-+-+-+                                               |
|                   Content Hash (32 bytes)                     |
|                            ...                                |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       Content Length                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       Content (UTF-8) ...                     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  Target Count |   Target Device IDs (16 bytes each) ...      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Table 6
Field Size Description
Content Type 1 byte 0x01 = text/plain (version 1.0 only)
Content Hash 32 bytes SHA-256 of the content bytes
Content Length 4 bytes Length of content in bytes
Content Variable The clipboard text (UTF-8 encoded)
Target Count 1 byte Number of target devices (0 = broadcast to all)
Target Device IDs 16 bytes each Device IDs of intended recipients

When Target Count is 0 or the field is absent, the server broadcasts the clip to all connected peers except the sender. Clients that do not understand targeting stop reading after Content Length bytes and ignore trailing data, providing backward compatibility.

7.4. CLIP_NOTIFY (0x04)

Server broadcasts to all peers except the sender (or targeted subset). The payload format is identical to CLIP (Section 7.3). The header's Device ID field contains the originating device's ID.

7.5. PING (0x05)

Table 7
Field Size Description
Ping Data 8 bytes Opaque data to be echoed in PONG

7.6. PONG (0x06)

Table 8
Field Size Description
Pong Data 8 bytes Echoed data from PING

7.7. PEER_JOIN (0x07)

Broadcast when a new peer joins.

Table 9
Field Size Description
Device ID 16 bytes New peer's UUID
Device Name Length 2 bytes Length of device name
Device Name Variable UTF-8 device name

7.8. PEER_LEAVE (0x08)

Broadcast when a peer disconnects.

Table 10
Field Size Description
Device ID 16 bytes Departed peer's UUID

7.9. ERROR (0x09)

Table 11
Field Size Description
Error Code 2 bytes Numeric error code
Message Length 2 bytes Length of error message
Error Message Variable UTF-8 error description

7.10. BYE (0x0A)

No payload. The header alone signals graceful disconnect. After sending BYE, the sender MUST NOT send further messages and SHOULD close the connection after a reasonable timeout (5 seconds).

7.11. SECURE_SEND (0x0B)

Sent by a client to deliver end-to-end encrypted content to a specific target peer. The server routes it to the target without being able to decrypt the payload.

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                 Target Device ID (16 bytes)                   |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    Flags      |                 TTL (seconds)                 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|            Ephemeral Public Key (32 bytes, X25519)            |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       Nonce (12 bytes)                        |
|                                               +-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+               |
|                   Ciphertext Length                            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                 Ciphertext (AES-256-GCM) ...                  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                   Auth Tag (16 bytes)                         |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Table 12
Field Size Description
Target Device ID 16 bytes Recipient's UUID
Flags 1 byte Bit 0: BURN_AFTER_READ; Bit 1: REQUIRE_ACK; Bit 2: HIGH_SENSITIVITY
TTL 4 bytes Seconds until undelivered message expires (0 = never)
Ephemeral Public Key 32 bytes Sender's per-message X25519 public key
Nonce 12 bytes AES-256-GCM nonce (unique per message)
Ciphertext Length 4 bytes Length of encrypted content
Ciphertext Variable AES-256-GCM encrypted plaintext
Auth Tag 16 bytes GCM authentication tag

Key derivation:

shared_secret  = X25519(ephemeral_private, recipient_public_key)
encryption_key = HKDF-SHA256(
    ikm   = shared_secret,
    salt  = "NCBP-secret-send",
    info  = sender_device_id || target_device_id,
    dklen = 32
)

The server reads ONLY the Target Device ID. If the target is connected, the server wraps the payload unchanged into a SECURE_RECV and forwards it. If the target is not connected, the server queues the message until the TTL expires, then drops it. The server MUST NOT log, inspect, or modify the ciphertext.

7.12. SECURE_RECV (0x0C)

The server forwards SECURE_SEND payloads to the target peer using this message type. The payload is identical to SECURE_SEND. The header's Device ID field contains the original sender's Device ID.

7.13. SECURE_ACK (0x0D)

Table 13
Field Size Description
Original Sender Device ID 16 bytes Who sent the SECURE_SEND
Original Message ID 2 bytes Message ID of the SECURE_SEND
Status 1 byte 0x01=DELIVERED, 0x02=READ, 0x03=EXPIRED, 0x04=REJECTED

8. Connection Lifecycle

8.1. Connection Establishment

  1. Client resolves server address (via mDNS or configuration).
  2. Client opens TCP connection to server on port 31337.
  3. TLS 1.3 handshake completes.
  4. Client sends HELLO with PSK authentication material.
  5. Server validates the PSK hash. If valid: sends WELCOME with session info and peer list. If invalid: sends ERROR (AUTH_FAILED) and closes connection.
  6. Server broadcasts PEER_JOIN to all existing peers.
  7. Session is now ACTIVE.

8.2. Clipboard Exchange

  1. Client detects local clipboard change.
  2. Client computes SHA-256 hash of new content.
  3. If hash differs from last sent hash, client sends CLIP.
  4. Server receives CLIP, validates payload.
  5. Server broadcasts CLIP_NOTIFY to all peers except sender (or targeted subset).
  6. Receiving clients update their local clipboard.

8.3. Graceful Disconnect

  1. Client sends BYE message.
  2. Server removes client from peer list.
  3. Server broadcasts PEER_LEAVE to remaining peers.
  4. Both sides close the TLS/TCP connection.

8.4. Ungraceful Disconnect

If a client disconnects without BYE (crash, network failure):

  1. Server detects via TCP keepalive or PING timeout.
  2. Server removes client from peer list.
  3. Server broadcasts PEER_LEAVE to remaining peers.

9. State Machine

9.1. Client States

                +---------------+
                | DISCONNECTED  |
                +-------+-------+
                        |
                  [TCP connect]
                        |
                +-------v-------+
                |   CONNECTED   |
                +-------+-------+
                        |
                  [send HELLO]
                        |
                +-------v-------+
                | AUTHENTICATING|
                +-------+-------+
                       / \
            [WELCOME] /   \ [ERROR]
                     /     \
            +-------v--+ +--v-----------+
            |  ACTIVE   | | DISCONNECTED |
            +-------+---+ +--------------+
                    |
          [BYE / error / timeout]
                    |
            +-------v-------+
            | DISCONNECTED  |
            +---------------+

9.2. Server States (per client)

                +---------------+
                |   LISTENING   |
                +-------+-------+
                        |
                  [TCP accept]
                        |
                +-------v-------+
                |   CONNECTED   |
                +-------+-------+
                        |
                  [recv HELLO]
                        |
                +-------v-------+
                | AUTHENTICATING|
                +-------+-------+
                       / \
            [PSK OK]  /   \ [PSK FAIL]
                     /     \
            +-------v--+ +--v--------+
            |  ACTIVE   | |  CLOSED   |
            +-------+---+ +----------+
                    |
          [BYE / error / timeout]
                    |
            +-------v-------+
            |    CLOSED     |
            +---------------+

10. Keepalive Mechanism

The server SHOULD send PING to each client every 30 seconds. Clients MUST respond to PING with PONG within 10 seconds. If no PONG is received within 10 seconds, the server SHOULD consider the client disconnected. Clients MAY also send PING to the server to verify connectivity.

Table 14
Parameter Value Description
PING Interval 30 sec Time between server PINGs
PONG Timeout 10 sec Max wait for PONG response
HELLO Timeout 5 sec Max wait for HELLO after connect
BYE Timeout 5 sec Max wait after BYE before close

11. Error Handling

11.1. Error Codes

Table 15
Code Name Description
0x0001 AUTH_FAILED PSK authentication failed
0x0002 VERSION_MISMATCH Unsupported protocol version
0x0003 PAYLOAD_TOO_LARGE Message exceeds maximum size
0x0004 INVALID_MESSAGE Malformed or unexpected message
0x0005 SERVER_FULL Server at maximum client capacity
0x0006 INTERNAL_ERROR Server internal error

11.2. Error Recovery

  • AUTH_FAILED: Client MUST NOT retry with the same PSK without user intervention. Rate limiting of 3 attempts per minute SHOULD be enforced.
  • VERSION_MISMATCH: Client MAY downgrade if it supports the server's version.
  • PAYLOAD_TOO_LARGE: Client SHOULD truncate or skip the content.
  • INVALID_MESSAGE: Receiver SHOULD log and ignore the message.
  • SERVER_FULL: Client SHOULD retry with exponential backoff.

12. Service Discovery

12.1. mDNS/DNS-SD

NCBP servers SHOULD announce their presence using DNS-SD [RFC6763] over mDNS [RFC6762].

Service Type: _ncbp._tcp.local.

TXT Record Fields:

Table 16
Key Description Example
version NCBP protocol version "1"
name Human-readable server name "HomeNet"
psk Whether PSK is required "true"

12.2. Discovery Flow

  1. Client sends mDNS query for _ncbp._tcp.local.
  2. Server responds with SRV record (hostname + port) and TXT record.
  3. Client resolves hostname to IP via mDNS A/AAAA record.
  4. Client connects to resolved address and port.

Example mDNS records:

_ncbp._tcp.local.   SRV  0 0 31337 ncbp-server.local.
_ncbp._tcp.local.   TXT  "version=1" "name=HomeNet" "psk=true"
ncbp-server.local.  A    192.168.1.100

13. Security Considerations

13.1. Threat Model

NCBP assumes a local network environment with the following threats:

  • Eavesdropping: Mitigated by mandatory TLS 1.3 [RFC8446].
  • Impersonation: Mitigated by PSK authentication via HMAC-SHA256.
  • Replay attacks: Mitigated by cryptographic nonce in HELLO and TLS replay protection.
  • Clipboard exfiltration: Mitigated by PSK -- only devices with the shared secret can join.

13.2. PSK Management

  • PSKs SHOULD be at least 8 characters with mixed case, digits, and symbols.
  • PSKs MUST be transmitted out-of-band (not over NCBP itself).
  • Implementations SHOULD store PSKs in OS-level secure storage (keychain, credential manager).
  • PSKs SHOULD be rotatable without restarting the server.

13.3. Content Security

  • Clipboard content is transmitted within the TLS tunnel. No additional application-layer encryption is applied in version 1.0. The SECURE_SEND extension (Section 7.11) provides end-to-end encryption for sensitive content using X25519 [RFC7748] key agreement and HKDF [RFC5869] key derivation.
  • Implementations SHOULD NOT log clipboard content to disk.
  • Implementations SHOULD clear sensitive clipboard content from memory after a configurable timeout.

13.4. Rate Limiting

  • Servers SHOULD rate-limit CLIP messages to prevent flooding (RECOMMENDED: 10 messages per second per client).
  • Servers SHOULD rate-limit failed authentication attempts (RECOMMENDED: 3 per minute per IP).

13.5. Denial of Service

  • Servers SHOULD enforce a maximum number of concurrent clients (RECOMMENDED default: 50).
  • Servers MUST reject payloads exceeding 1 MiB.

14. IANA Considerations

14.1. Port Number

This document requests registration of the following port:

  • Service Name: ncbp
  • Transport Protocol: TCP
  • Port Number: 31337
  • Description: Network ClipBoard Protocol
  • Reference: This document

14.2. Service Name for DNS-SD

  • Service Type: _ncbp._tcp
  • Description: Network ClipBoard Protocol service discovery

14.3. Message Type Registry

A new registry "NCBP Message Types" is requested with the initial values from Section 6. Values 0x00 and 0x0E-0xFF are reserved for future use. New assignments require Specification Required policy.

15. References

15.1. Normative References

[RFC2119]
Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, , <https://www.rfc-editor.org/info/rfc2119>.
[RFC8174]
Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, , <https://www.rfc-editor.org/info/rfc8174>.
[RFC8446]
Rescorla, E., "The Transport Layer Security (TLS) Protocol Version 1.3", RFC 8446, DOI 10.17487/RFC8446, , <https://www.rfc-editor.org/info/rfc8446>.
[RFC9293]
Eddy, W., "Transmission Control Protocol (TCP)", STD 7, RFC 9293, DOI 10.17487/RFC9293, , <https://www.rfc-editor.org/info/rfc9293>.
[RFC8018]
Moriarty, K., Kaliski, B., and A. Rusch, "PKCS #5: Password-Based Cryptography Specification Version 2.1", RFC 8018, DOI 10.17487/RFC8018, , <https://www.rfc-editor.org/info/rfc8018>.
[RFC6762]
Cheshire, S. and M. Krochmal, "Multicast DNS", RFC 6762, DOI 10.17487/RFC6762, , <https://www.rfc-editor.org/info/rfc6762>.
[RFC6763]
Cheshire, S. and M. Krochmal, "DNS-Based Service Discovery", RFC 6763, DOI 10.17487/RFC6763, , <https://www.rfc-editor.org/info/rfc6763>.

15.2. Informative References

[RFC7322]
Flanagan, H. and S. Ginoza, "RFC Style Guide", RFC 7322, DOI 10.17487/RFC7322, , <https://www.rfc-editor.org/info/rfc7322>.
[RFC7748]
Langley, A., Hamburg, M., and S. Turner, "Elliptic Curves for Security", RFC 7748, DOI 10.17487/RFC7748, , <https://www.rfc-editor.org/info/rfc7748>.
[RFC5869]
Krawczyk, H. and P. Eronen, "HMAC-based Extract-and-Expand Key Derivation Function (HKDF)", RFC 5869, DOI 10.17487/RFC5869, , <https://www.rfc-editor.org/info/rfc5869>.

Appendix A. Protocol Constants

MAGIC           = 0x4E42
VERSION         = 0x01
HEADER_SIZE     = 36 bytes
MAX_PAYLOAD     = 1,048,576 bytes (1 MiB)
MAX_DEVICE_NAME = 255 bytes
DEFAULT_PORT    = 31337
PING_INTERVAL   = 30 seconds
PONG_TIMEOUT    = 10 seconds
HELLO_TIMEOUT   = 5 seconds
BYE_TIMEOUT     = 5 seconds
MAX_CLIENTS     = 50
PSK_ITERATIONS  = 100,000
PSK_SALT        = "NCBP-v1-salt"
PSK_DKLEN       = 32 bytes

Appendix B. Content Type Registry

Table 17
Value MIME Type Status
0x01 text/plain Required
0x02 image/png Reserved
0x03 image/jpeg Reserved
0x04 text/html Reserved
0x05 text/uri-list Reserved
0x06-0xFE - Reserved
0xFF - Custom/Extension

Appendix C. Example Message Exchange

Client A                    Server                     Client B
   |                          |                           |
   |--- [TLS Handshake] ---->|                           |
   |<-- [TLS Established] ---|                           |
   |                          |                           |
   |--- HELLO --------------->|                           |
   |<-- WELCOME --------------|                           |
   |                          |                           |
   |                          |<-- [TLS Handshake] ------|
   |                          |--- [TLS Established] --->|
   |                          |                           |
   |                          |<-- HELLO ----------------|
   |<-- PEER_JOIN ------------|--- WELCOME ------------->|
   |                          |                           |
   |--- CLIP ---------------->|                           |
   |                          |--- CLIP_NOTIFY --------->|
   |                          |                           |
   |                          |<-- CLIP -----------------|
   |<-- CLIP_NOTIFY ----------|                           |
   |                          |                           |
   |--- BYE ----------------->|                           |
   |                          |--- PEER_LEAVE ---------->|
   |                          |                           |

Appendix D. Acknowledgments

The author wishes to thank the contributors to the NCBP reference implementation for their testing and feedback. This document follows the guidance in [RFC7322].

Author's Address

Zeyad Abdelazim