RFC 1022

High-level Entity Management Protocol (HEMP)

๐Ÿ“… published October 1987, from ietf

THE HIGH-LEVEL ENTITY MANAGEMENT PROTOCOL (HEMP) ๐Ÿฆ‹

okay bestie, this is RFC 1022 and it's giving networking main character energy ๐Ÿ’… It's from the Network Working Group, written by C. Partridge (BBN/NNSC) and G. Trewitt (Stanford), dated October 1987 ๐Ÿ“… The header doesn't list a category, and it doesn't say what it obsoletes or updates, so we're going off what's actually on the page ๐Ÿซถ


STATUS OF THIS MEMO โœจ

so we're presenting an application protocol for managing network entities like hosts, gateways and front-end machines ๐Ÿ–ฅ๏ธ It's a component of the High-Level Entity Management System (HEMS) described in RFC-1021, so Readers MAY want to consult RFC-1021 while reading this one ๐Ÿ“– This memo also assumes you already know the ISO data encoding standard, ASN.1 ๐Ÿค“ Distribution of this memo is unlimited ๐Ÿ’œ


PROTOCOL OVERVIEW ๐ŸŽ€

the High-Level Entity Management Protocol (HEMP) gives you an encapsulation system and a set of services for communication between applications and managed entities ๐Ÿฆ‹ HEMP is an application protocol that leans on existing transport protocols to deliver HEMP messages to their destination(s) ๐Ÿšš

it's targeted at management interactions between applications and entities, and it's believed to be suitable for both monitoring and control interactions ๐Ÿ‘€

HEMP gives you what the authors believe are the three essential features of a management protocol ๐Ÿ‘‘:

  1. a standard encapsulation scheme for all interactions ๐Ÿ“ฆ
  2. an authentication facility that can be used both to verify messages and limit access to managed systems ๐Ÿ”
  3. the ability to encrypt messages to protect sensitive information ๐Ÿซฃ

we'll get into each of these in the sections below ๐Ÿ’–


PROTOCOL OPERATION ๐ŸŒธ

HEMP is designed to support messages, where a message is an arbitrarily long sequence of octets โœจ

five types of messages are currently defined: request, event, reply, and protocol error, and application error messages. Reply, protocol error and application error messages are only sent in reaction to a request message, and they're collectively called responses ๐Ÿ’…

two types of interaction are envisioned ๐Ÿซถ:

  • a message exchange between an application and an entity managed by that application
  • unsolicited messages from an entity to the management centers responsible for managing it

when an application wants to retrieve information from an entity, or give it instructions, it sends a request message to the entity ๐Ÿ“จ The entity replies with a response: a reply message if the request was valid, or an error message if the request was invalid (e.g., failed authentication) ๐Ÿ™…โ€โ™€๏ธ It's expected there will only be one response to a request message, although the protocol does not preclude multiple responses to a single request ๐Ÿคทโ€โ™€๏ธ

protocol error messages are generated if errors are found while processing the HEMP encapsulation of the message ๐Ÿง The possible protocol error messages are described later in this document. Non-HEMP errors (like errors during processing of the contents of the message) are application errors ๐Ÿง  The existence of application error messages does not preclude the possibility that a reply will have an error message in it ๐Ÿ“ It's expected that the processing agent on the entity MAY have already started sending a reply message before an error in a request message is discovered ๐Ÿ˜ญ So application errors found during processing MAY show up in the reply message instead of a separate application error message ๐Ÿ’€

in certain situations, like on secure networks, returning error messages MAY be considered undesirable ๐Ÿ™ˆ So entities are not REQUIRED to send error messages, although on "friendly" networks, the use of error messages is encouraged ๐ŸŒˆ

event messages are unsolicited notices sent by an entity to an address, which is expected to correspond to one or more management centers. (A single address MAY correspond to a multicast address, and thus reach multiple hosts ๐Ÿฆ‹) Event messages are typically used to let entities alert management centers about important changes in their state, like when an interface goes down or the entity runs out of network buffers ๐Ÿšจ


STANDARD MESSAGE FORMAT ๐Ÿงš

every HEMP message is put in the general form shown in Figure 1 ๐ŸŽ€

                     +-------------------------------+
                     :           leader              :
                     +-------------------------------+
                     :       encryption section      :
                     +-------------------------------+
                     :    reply encryption section   :
                     +-------------------------------+
                     :     authentication section    :
                     +-------------------------------+
                     :          common header        :
                     +-------------------------------+
                     :              data             :
                     +-------------------------------+

Figure 1: General Form of HEMP Messages

each message has five components ๐Ÿงฉ (the original spells out six items, so here they are as written):

  1. the leader, which is simply the ASN.1 tag and message length ๐Ÿท๏ธ
  2. the encryption section, which provides whatever information the receiver MAY require to decrypt the message ๐Ÿ”“
  3. the reply encryption section, in which the requesting application MAY specify the type of encryption to use in the reply ๐Ÿช„
  4. the authentication section, which allows the receiver to authenticate the message ๐Ÿ›‚
  5. the common header, which identifies the message type, the HEMP version, and the message id ๐Ÿชช
  6. the data section ๐Ÿ“ฆ

all four sections following the leader are also ASN.1 encoded. The ASN.1 format of the message is shown in Figure 2 ๐Ÿค“

          HempMessage ::= [0] IMPLICIT SEQUENCE {
              [0] IMPLICIT EncryptSection OPTIONAL,
              [1] IMPLICIT ReplyEncryptSection OPTIONAL,
              [2] IMPLICIT AuthenticateSection OPTIONAL,
              [3] IMPLICIT CommonHeader,
              [4] IMPLICIT Data }

Figure 2: ASN.1 Format of HEMP Messages

the ordering of the sections is significant!! ๐Ÿšจ The encryption section comes first so that all succeeding sections (which MAY contain sensitive information) MAY be encrypted ๐Ÿ” The authentication section comes before the header so that messages which fail authentication can be discarded without header processing ๐Ÿ—‘๏ธ It's giving efficiency and security at the same time ๐Ÿ˜ค


THE ENCRYPTION SECTION ๐Ÿ”

Need For Encryption

encryption MUST be supported in any management scheme ๐Ÿซถ A certain amount of monitoring information is potentially sensitive. For example, imagine an entity maintains a traffic matrix, which shows the number of packets it sent to other entities. A traffic matrix like that can reveal communication patterns in an organization (like a corporation or a government agency) ๐Ÿ‘€ Organizations concerned with privacy MAY wish to employ encryption to protect this kind of information ๐Ÿ›ก๏ธ Access control makes sure only people entitled to request the data can retrieve it, but it doesn't protect against eavesdroppers reading the messages. Encryption protects against eavesdropping ๐Ÿ•ต๏ธโ€โ™€๏ธ

encryption in HEMP does not protect against traffic analysis. It's expected that HEMP interactions will have distinct signatures, so a party that can observe traffic patterns MAY guess at the sort of interactions being performed, even if the data being sent is encrypted ๐Ÿ˜ฌ Organizations concerned with security at this level SHOULD additionally consider link-level encryption ๐Ÿ’œ

Format of the Encryption Section

the encryption section contains any data REQUIRED to decrypt the message. The ASN.1 format of this section is shown in Figure 3 ๐Ÿงพ

          EncryptSection :: = IMPLICIT SEQUENCE {
                encryptType INTEGER,
                encryptData ANY
          }

Figure 3: ASN.1 Format of Encryption Section

if the section is omitted, then no decryption is REQUIRED ๐Ÿ™Œ If the section is present, then the encryptType field contains a number defining the encryption method in use, and encryptData contains whatever data (like a key) the receiver MUST have to decrypt the remainder of the message using the type of encryption specified ๐Ÿ”‘

currently no encryption types are assigned ๐Ÿฅฒ

if the message has been encrypted, data is encrypted starting with the first octet after the encryption section ๐ŸŽ€


THE REPLY ENCRYPTION SECTION ๐Ÿฆ‹

Need for Reply Encryption

the reasons for encrypting messages have already been discussed, so we're not going back there ๐Ÿ™ƒ

the reply encryption section lets management agents request that responses be encrypted even though the requests are not encrypted, or that responses be encrypted with a different key, or even a different scheme from the one used to encrypt the request ๐Ÿช„ A good example is a public key encryption system, where the requesting application needs to pass its public key to the processing agent ๐Ÿ—๏ธ

Format of the Reply Encryption Section

the reply encryption section contains any data REQUIRED to encrypt the reply message. The ASN.1 format of this section is shown in Figure 4 ๐Ÿง 

          ReplyEncryptSection :: = IMPLICIT SEQUENCE {
                replyEncryptType INTEGER,
                replyEncryptData ANY
          }

Figure 4: ASN.1 Format of Reply Encryption Section

if the section is omitted, then the reply SHOULD be encrypted in the manner specified by the encryption section โœจ If the section is present, then the replyEncryptType field contains a number defining the encryption method to use, and replyEncryptData contains whatever data (like a key) the receiver MUST have to encrypt the reply message ๐Ÿ”‘

if the reply encryption section is present, then the reply message MUST contain an appropriate encryption section, which indicates that the encryption method requested in the reply encryption section is in use. The reply message SHOULD be encrypted starting with the first octet after the encryption section ๐Ÿ“œ

if the reply encryption method requested is not supported by the entity, the entity MAY not send a reply ๐Ÿ™ˆ It MAY, at the discretion of the implementor, send a protocol error message ๐Ÿง (See below for descriptions of protocol error messages.)

currently no encryption types are assigned ๐Ÿฅฒ


THE AUTHENTICATION SECTION ๐Ÿ›‚

Need for Authentication

Okay so sometimes an app needs to check one of two things, or both: that a message really came from the entity it says it came from, and/or that whoever sent it is allowed to make a monitoring request in the first place ๐Ÿ•ต๏ธ. Picture this: an entity sends an event message to a monitoring center saying a trunk link is unstable. Before the monitoring folks reroute traffic around the bad link (or send someone out for a service call), it would be nice to confirm the event actually came from that entity and not from some prankster ๐Ÿ™ˆ. That's what authentication is for. It lets entities authenticate their event messages, and it's giving security ๐Ÿ”.

Another use of the authentication section is access control ๐Ÿ‘‘. Requests take up processing time on the entity. When the entity is a critical node, like a gateway, we want to limit requests to authorized applications. So we can use the authentication section to make sure only specially authenticated applications get to request processing time.

Also, worth noting: in some cases the encryption method may also implicitly authenticate a message ๐Ÿฆ‹. In those situations, the authentication section SHOULD still be present, but it uses a type code that says authentication was provided by the encryption method.

Format of the Authentication Section

The authentication section holds whatever data the receiver needs to authenticate the message ๐Ÿ’–. The ASN.1 format of this section is shown in Figure 5.

         AuthenticateSection :: = IMPLICIT SEQUENCE {
                authenticateType INTEGER,
                authenticateData ANY
               }

Figure 5: ASN.1 Format of Authentication Section

If the section is omitted, the message is not authenticated. If the section is present, then authenticateType tells you what kind of authentication was used, and authenticateData carries the authenticating data ๐ŸŽ€.

This memo defines two types of authentication: a password scheme, and authentication by encryption method ๐ŸŒธ. For the password scheme, the AuthenticateSection looks like Figure 6.

         AuthenticateSection :: = IMPLICIT SEQUENCE {
                authenticateType INTEGER { password(1) },
                authenticateData OCTETSTRING
          }

Figure 6: ASN.1 Format of Password Authentication Section

For the password scheme, authenticateType is 1, and the password is an octet string of any length ๐Ÿ”‘. This scheme validates requests sent to an entity. When a request comes in, the entity checks the password against the entity-specific password assigned to it. If the passwords match, the request is accepted for processing. Lowkey, it's a slightly more powerful password scheme than the one currently used for monitoring on the Internet โœจ.

For authentication by encryption, the AuthenticateSection has the format shown in Figure 7.

         AuthenticateSection :: = IMPLICIT SEQUENCE {
                authenticateType INTEGER { encryption(2) },
                authenticateData NULL
          }

Figure 7: ASN.1 Format of Encryption Authentication Section

This section just says that authentication was implicit in the encryption method ๐Ÿงš. Recipients of these messages SHOULD confirm that the encryption method really does provide authentication.

No other authentication types are defined right now ๐Ÿ’….

If a message fails authentication, it SHOULD be discarded ๐Ÿšซ. If the authentication type on the message is unknown, or the section is omitted, the message MAY be discarded or processed, at the discretion of the implementation. It is RECOMMENDED that requests with unknown authentication types be logged as potential intrusions, but not processed ๐Ÿ‘€.


THE COMMON HEADER โœจ

The common header holds the generic info about the message, like the protocol version number and the type of request ๐Ÿ“‹. The ASN.1 format of the common header is shown in Figure 8.

           CommonHeader ::= IMPLICIT SEQUENCE {
               link IMPLICIT INTEGER,
               messageType IMPLICIT INTEGER,
               messageId IMPLICIT INTEGER,
               resourceId ANY
           }

Figure 8: ASN.1 Format of Common Header

link tells you which version of HEMS is in use ๐ŸŒˆ.

messageType is a value saying whether the message is a request (0), reply (1), event (2), protocol error (3) or application error (4) message ๐Ÿ’œ.

messageId is a unique bit identifier. It gets set in the request message and echoed back in the response, so applications can match each response to its request ๐ŸŽฏ. Applications SHOULD choose messageIds so that a substantial period of time passes before a messageId gets re-used by a particular application (even across machine crashes) โณ.

Event messages use the messageId field too, to show the number of the current event message ๐Ÿ””. By comparing messageId fields from lost events, event values may be detected. The event messageId SHOULD be reset to 0 on every reboot. By convention, the event message with messageId of 0 SHOULD always be a "reboot" event ๐Ÿ”„. (Facilities SHOULD be provided in the event message definition so that entities able to store messageIds across reboots can send the highest messageId reached before the reboot ๐Ÿ’พ.)

resourceId is defined for ISO compatibility. It matches the resource ID that the Common Management Information Protocol uses to identify the relevant ISO resource ๐Ÿงฉ.

DATA SECTION

The data section holds the message-specific data ๐Ÿ“. The format of the data section is shown in Figure 9.

                   Data ::= ANY

Figure 9: ASN.1 Format of Data Section

The contents of the data section are application specific. Except for protocol error messages, they're outside the scope of this memo ๐Ÿ™ƒ.

TRANSPORT PROTOCOL

There's been a LOT of debate about the right transport protocol to use under HEMP ๐Ÿ˜ญ. Part of the problem is that HEMP is used for two different kinds of interactions: request-response exchanges and event messages. Request-response interactions can involve arbitrary amounts of data going both ways, and they are believed to need a reliable transport mechanism. Event messages are typically small and don't need to be reliably delivered ๐Ÿ“ฆ.

Public opinion seems to lean toward running HEMP over a transaction protocol (see RFC-955 for a general discussion) ๐Ÿ’ญ. The problem is the community is still experimenting with transaction protocols, and lots of groups want to implement HEMP now. So this memo defines two transport protocols for use with HEMP ๐Ÿซถ.

Groups who want to use an implementation of HEMP and the HEMS in the near future SHOULD use a combination of the Transmission Control Protocol (TCP) and the User Datagram Protocol (UDP) under HEMP. TCP SHOULD be used for all request-response interactions, and UDP SHOULD be used to send event messages. Using UDP to support the request-response interactions is strongly discouraged ๐Ÿšจ.

More forward-looking groups are encouraged to implement HEMP over a transaction protocol. In particular, experiments are planned with the Versatile Message Transaction Protocol (VMTP) ๐Ÿ”ฎ.

PROTOCOL ERROR MESSAGES

Protocol error messages are so tightly tied to the definition of HEMP that it made sense to define the contents of the data section for them in this memo, even though the data section is usually considered application specific ๐Ÿ’….

The data section of every protocol error message has the same format, shown in Figure 10. That format was picked to agree with the error message format and ASN.1 type used for language processing errors in RFC-1024. The error codes were chosen so they don't overlap ๐ŸŒท.

           ProtocolError ::= [APPLICATION 0] implicit sequence {
               protoErrorCode INTEGER,
               protoErrorOffset INTEGER,
               protoErrorDescribed IA5String,
           }

Figure 10: Data Section For Protocol Error Messages

protoErrorCode is a number that specifies the particular type of error encountered. The defined codes are:

  • 0 - reserved <not used>
  • 1 - ASN.1 format error. Some error has been encountered in parsing the message. Examples are an unknown type or a violation of the ASN.1 syntax.
  • 2 - Wrong HEMP version number. The version number in the common header is invalid. This may be an indication of possible network intrusion, and it SHOULD be logged at sites concerned with security ๐Ÿ•ต๏ธโ€โ™€๏ธ.
  • 3 - Authentication error. Authentication has failed. This error code is defined for completeness, but implementations are strongly discouraged from using it ๐Ÿ™…โ€โ™€๏ธ. Returning authentication failure information may aid intruders in cracking the authentication system. It is RECOMMENDED that authentication errors be logged as possible security problems ๐Ÿ”’.
  • 4 - ReplyEncryption type not supported. The entity does not support the encryption method requested in the ReplyEncryption section.
  • 5 - Decryption failed. The entity could not decrypt the encrypted message. This means the entity could not read the CommonHeader to find the messageId for the reply. In this case, the messageId field SHOULD be set to 0 ๐Ÿซ .
  • 6 - Application Failed. Some application failure made it impossible to process the message ๐Ÿ’€.

The protoErrorOffset is the number of the octet where the error was discovered. The first octet in the message is octet number 0 ๐Ÿ”ข.

The protoErrorDescribed field is a string that describes the particular error. It's expected to give a more detailed description of the error encountered ๐Ÿ“.

APPENDIX OF TYPES

This section lists all the ASN.1 types defined in this document ๐Ÿ“š.

HEMP Types

          HempMessage ::= [0] IMPLICIT SEQUENCE {
              [0] IMPLICIT EncryptSection OPTIONAL,
              [1] IMPLICIT ReplyEncryptSection OPTIONAL,
              [2] IMPLICIT AuthenticateSection OPTIONAL,
              [3] IMPLICIT CommonHeader,
              [4] IMPLICIT Data }

       EncryptSection :: = IMPLICIT SEQUENCE {
           encryptType INTEGER,
           encryptData ANY
       }

       ReplyEncryptSection :: = IMPLICIT SEQUENCE {
           replyEncryptType INTEGER,
           replyEncryptData ANY
       }


       AuthenticateSection :: = IMPLICIT SEQUENCE {
           authenticateType INTEGER,
           authenticateData ANY
       }


       CommonHeader ::= IMPLICIT SEQUENCE {
           link IMPLICIT INTEGER,
           messageType IMPLICIT INTEGER {
               request(0), reply(1), event(2),
               protocol error (3), application error(4)
           }
           messageId IMPLICIT INTEGER,
           resourceId ANY
       }

       Data ::= ANY

Protocol Error Types

       ProtocolError ::= [APPLICATION 0] implicit sequence {
           protoErrorCode INTEGER,
           protoErrorOffset INTEGER,
           protoErrorDescribed OCTETSTRING
       }

References โœจ

okay so this one's short but lowkey important ๐Ÿ’… the big reference is ISO Standard ASN.1 (Abstract Syntax Notation 1), and it's split into two parts:

  • International Standard 8824 -- Specification (meaning, notation) ๐Ÿ“œ
  • International Standard 8825 -- Encoding Rules (representation) ๐ŸŽ€

the other one is the current VMTP specification, which you can get from David Cheriton of Stanford University ๐Ÿฆ‹ that's the whole reference list, bestie, no cap ๐Ÿซถ

๐Ÿ“ฆ where this page comes from