RFC 6450

Multicast Ping Protocol

๐Ÿ“… published December 2011, from ietf

RFC 6450: Multicast Ping Protocol โœจ

Okay bestie, let's get into it ๐Ÿฆ‹. This is RFC 6450, a Standards Track document from December 2011 (ISSN 2070-1721), published by the Internet Engineering Task Force (IETF). The author is S. Venaas from Cisco Systems. The header doesn't list any document that it obsoletes or updates, so it stands on its own ๐Ÿ’….

Abstract

The Multicast Ping Protocol is all about checking whether an endpoint can receive multicast, both Source-Specific Multicast (SSM) and Any-Source Multicast (ASM) ๐ŸŒธ. It can also pull out extra multicast info, like how long it takes to set up a multicast tree โญ. The protocol is based on an implementation of tools called "ssmping" and "asmping" ๐ŸŽ€.

Status of This Memo

This is an Internet Standards Track document ๐Ÿ’œ.

It's a product of the Internet Engineering Task Force (IETF), so it represents the consensus of the IETF community. It went through public review and got approved for publication by the Internet Engineering Steering Group (IESG) ๐Ÿ‘‘. If you want more on Internet Standards, check Section 2 of RFC 5741 ๐Ÿงš.

For the current status, any errata, and how to send feedback, go to http://www.rfc-editor.org/info/rfc6450 ๐Ÿ“.

Copyright (c) 2011 IETF Trust and the persons identified as the document authors. All rights reserved ๐ŸŒˆ.

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) as they stand on the date this document was published. Please actually read these, because they spell out your rights and restrictions for this document ๐Ÿซถ. Code Components pulled out of this document must include Simplified BSD License text, as described in Section 4.e of the Trust Legal Provisions. They come without warranty, as the Simplified BSD License describes ๐Ÿ’….

Table of Contents

   1. Introduction ....................................................2
      1.1. Requirements Language ......................................2
   2. Architecture ....................................................3
   3. Protocol Specification ..........................................6
      3.1. Option Format ..............................................7
      3.2. Defined Options ............................................7
      3.3. Packet Format .............................................13
      3.4. Message Types and Options .................................13
      3.5. Rate Limiting .............................................15
           3.5.1. Message Rate Variables .............................16
   4. Client Behaviour ...............................................16
   5. Server Behaviour ...............................................18
   6. Recommendations for Implementers ...............................19
   7. IANA Considerations ............................................20
   8. Security Considerations ........................................21
   9. Acknowledgments ................................................22
   10. References ....................................................23
      10.1. Normative References .....................................23
      10.2. Informative References ...................................23

1. Introduction โœจ

Okay so the Multicast Ping Protocol checks multicast connectivity ๐Ÿฆ‹. Beyond checking reception of multicast (SSM or ASM), it can also give you related info like multicast tree setup time, the number of hops the packets traveled, and packet delay and loss ๐Ÿ“ก. This kinda resembles the ICMP Echo Request/Reply mechanism [RFC0792] ๐Ÿ’–, but it uses UDP [RFC0768] instead, and it requires that both a client and a server implement this protocol ๐ŸŽ€. Intermediate routers are not required to support this protocol. They just forward protocol messages and data traffic as usual ๐Ÿงš.

The protocol is based on the current implementation of the ssmping and asmping tools [IMPL]. People across the Internet use those tools a lot to run multicast connectivity tests ๐ŸŒธ.

1.1. Requirements Language

Here's the key bit, so pay attention ๐Ÿ’…. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119] ๐Ÿ‘‘.


Part 1 of 6 is done, bestie ๐ŸŽ€โœจ. Part 2 is coming next, so stay tuned ๐Ÿ’œ.

2. Architecture โœจ

Okay bestie, before we get into the nitty-gritty, here's the vibe check on how this protocol is used and what info it can actually give you ๐Ÿ’…๐Ÿซถ

The protocol runs between clients and servers to check multicast connectivity. Servers are the multicast sources and clients are the multicast receivers. A server can be configured with a set of multicast address ranges for testing, or it can just use implementation defaults ๐ŸŒธ Depending on the config or the implementation, the server can control which clients (by unicast address) get to use which group ranges, whether clients can pick their own group address or whether the server picks it for them, and whether several clients are allowed to use the same multicast address at once. All of that is config and/or implementation dependent, so it's giving "it depends" energy ๐Ÿ™ˆ

Now the server also keeps some runtime soft state, which is very main character ๐Ÿฆ‹ It has to do rate limiting to restrict how many client requests it handles, and this rate limiting is per-client IP address. That state usually only needs to stick around for a few seconds, depending on the limit used. If the server hands out unique multicast addresses to clients, it also has to track which address is used by which client IP address. That state should expire if the server hasn't gotten requests for a few minutes, and the exact timeout should ideally be configurable so it can handle different environments ๐ŸŽ€ If a client is going to run multicast ping checks continuously for a long time, and it needs to survive requests not reaching it for several minutes, the timeout has to be extended. To verify the client IP address, the server should do a return routability check by giving the client a non-predictable session ID. That session ID then becomes part of the server's soft state for that client ๐Ÿ”

Before a client can run a multicast ping test, it has to know the unicast address of a server. It can also be configured with a multicast address or range to use. If it is, the client tells the server which group or range it wants. If not, the server gets to decide the group ๐Ÿ‘‘ Normally a client sends Default-Client-Request-Rate requests per second, but it can be configured to use a different rate. See the definition of Default-Client-Request-Rate in Section 3.5.1. Also, the value can be less than 1, which is so specific and I love it ๐Ÿงš

At runtime, the client makes up a client ID that's unique for the ping test. That ID goes in every message the client sends ๐Ÿ’– If the client wasn't given a specific group address, the server hands it one to use for the ping requests. The server might also give it a Session ID. The client ID, group address, and Session ID (if one was received) stay fixed for every ping request in that session, so it's all locked in ๐Ÿ”’ When a client gets replies from a server, it checks the client ID in the reply, and if it doesn't match what the client used in the requests, the client ignores that reply. For each valid reply, the client can print or record stuff like round trip time, number of hops, etc. Once the ping session ends, the client can calculate and print or record statistics for the whole session ๐Ÿ“Šโœจ

Here's how the typical usage goes ๐Ÿ“

  • Setup: A server runs nonstop to serve clients. A client has somehow found out the server's unicast address and wants to test multicast reception from it ๐ŸŒˆ
  • Asking for a group: The client app sends a unicast message to the server asking for a group to use. If the user wants a specific group or scope, the client asks for a group that matches what they requested. The server replies with a group to use, or an error if no group is available ๐Ÿ™…โ€โ™€๏ธ
  • Joining: For ASM, the client joins an ASM group G. For SSM, it joins a channel (S,G), where G is the multicast group address the server specified and S is the unicast address used to reach the server ๐Ÿ’œ
  • Pinging: After joining, the client unicasts multicast ping requests to the server. The requests go over UDP with the destination port set to the standardised multicast ping port (9903). They're sent periodically, and the rate is Default-Client-Request-Rate (Section 3.5.1) requests per second by default, though the client can be configured to use another rate. Each request has a sequence number and usually a timestamp. The server echoes the requests back and might add a few options ๐Ÿฆ‹
  • Replies: For each request, the server sends two replies. One is unicast to the source IP address and source UDP port of the client that asked. The other is multicast to the requested multicast group G and to the source UDP port of that client. Both replies go out from the same port the request came in on ๐Ÿซถ The server should set the TTL (IPv4 time-to-live or IPv6 hop-count) for both the unicast and multicast messages (a TTL of at least 64 is recommended) by including a TTL option. That lets the client work out how many hops there were ๐Ÿ”ฅ
  • Leaving: Once the client is done measuring, it should leave the group/channel ๐Ÿ‘‹

So what can a client actually learn from all this? Lots, bestie ๐Ÿคฏ First, by getting unicast replies, the client can confirm the server is getting its unicast requests and is up and responding. So if the client gets unicast replies but no multicast, the problem is either a multicast problem or a multicast administrative restriction ๐Ÿ˜ญ If it does receive multicast, it knows it can receive multicast traffic, and it can also estimate how long it took to set up the multicast tree (at least if that's in the range of seconds), whether packets are getting dropped, and the length and variation of round trip times (RTTs) ๐Ÿ’…

For unicast, the RTT is the time from sending the unicast request to getting the reply. The measured multicast RTT also references the client's unicast request. By setting the TTL on the replies when they're originated, the client can also figure out how many router hops it is from the source ๐Ÿงš Since the unicast replies give similar info, the host can compare multicast and unicast results and check for differences, like hop count and RTT. It's literally a whole comparison arc ๐Ÿฟ

The number of multicast hops, and how that number changes over time, can reveal details about the multicast tree and how it changes ๐ŸŒณ And if the server sends the unicast and multicast replies nearly at the same time, the client may also be able to measure the difference in one-way delay between unicast and multicast on the path from server to client. Iconic science ๐Ÿ‘‘

Servers may optionally include a timestamp. This can be really useful, because the unicast and multicast replies can't be sent at the exact same moment (the delay depends on the host's operating system and load) โฑ๏ธ๐Ÿ’€


3. Protocol Specification ๐ŸŽ€

Okay, the message types! There are four kinds, and we're going to be very organised about it ๐Ÿ’–

  • Echo Request and Echo Reply messages, which are used for the actual measurements ๐Ÿ“
  • An Init message, which SHOULD be used to initialise a ping session and negotiate which group to use โœจ
  • A Server Response message, which is mainly used in response to the Init message ๐ŸŒธ

The messages MUST always be in network byte order. UDP checksums MUST always be used. Non-negotiable, bestie ๐Ÿ™…โ€โ™€๏ธ

All the messages share the same format: one octet for the message type, followed by a bunch of options in TLV (Type, Length, and Value) format. This is what makes the protocol so easy to extend ๐Ÿฆ‹

Message types 0-253 are reserved and available for allocation in an IANA registry. Message types 254 and 255 are freely available for experimental use. See Section 7 ๐Ÿ’…

The Init message usually contains some prefix options asking the server for a group from one of the prefixes listed. The server answers with a Server Response message that has the group address to use, or possibly prefix options describing what multicast groups the server might be able to provide ๐ŸŒˆ

For an Echo Request, the client includes a bunch of options, and a server MAY simply echo the contents back (only changing the message type) without looking at the options, if it doesn't support any options. Honestly that's giving simple Multicast Ping Protocol server energy, but it really limits what info a client can get, so the protocol becomes way less useful ๐Ÿ˜ญ That said, the server SHOULD add a TTL option (so the client can figure out how many router hops a reply has been through), and there are other options a server implementation MAY support. For example, the client might ask for certain info or a specific behaviour from the server ๐Ÿงš Both Echo Reply messages (the unicast one and the multicast one) MUST first contain the exact options from the request, in the same order, and then, right after those, any options the server appended. A server MUST NOT process unknown options, but they MUST still be included in the Echo Reply. A client MUST ignore any unknown options. Respect the boundaries, babe ๐Ÿซถ

The protocol messages are usually smaller than the Path MTU, so fragmentation isn't really a concern. There might be cases where the Path MTU is super small, or where a client sends big requests to check that it can receive fragmented multicast datagrams. This document doesn't say whether Path MTU Discovery should be performed, etc. A possible extension could be an option where a client asks for Path MTU Discovery and gets the current Path MTU from the server. Future-me's problem, but I love the plot twist ๐Ÿ”ฎ

This document defines a bunch of options. Some options don't need the server to process them and are just returned unmodified in the reply. Other client options the server may care about, and some server options can be requested by a client. Unless otherwise specified, an option MUST NOT be used multiple times in the same message. Rule of the group chat ๐Ÿšซ๐Ÿ’œ

3.1. Option Format ๐Ÿฆ‹

Every option is a TLV, and it looks like this ๐Ÿ‘‡

    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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |             Type              |           Length              |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                             Value                             |
   |                               .                               |
   |                               .                               |
   |                               .                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

The Type (2 octets) specifies the option ๐ŸŽ€

The Length (2 octets) specifies the length of the value field. Depending on the option type, it can be anywhere from 0 to 65535 ๐Ÿ“

The Value must always be the specified length. Check the respective option definitions for possible values. If the length is 0, the value field isn't included at all. Zero drama, zero bytes ๐Ÿงš

3.2. Defined Options ๐Ÿ’–

okay so bestie, this is the list of every option in the protocol ๐Ÿ’– we've got Version (0), Client ID (1), Sequence Number (2), Client Timestamp (3), Multicast Group (4), Option Request (5), Server Information (6), TTL (9), Multicast Prefix (10), Session ID (11), and Server Timestamp (12) ๐Ÿฆ‹

Option values 7 and 8 are deprecated and must not be allocated by any future document ๐Ÿ™ˆ Option types 0-65531 are reserved and available for allocation in an IANA registry, and types 65532-65535 are not registered and are freely available for experimental use ๐Ÿงช See Section 7 ๐ŸŽ€

Version, type 0 โœจ

Length MUST be 1. ๐Ÿ’… This option MUST always be included in all messages, and for the current protocol version it MUST be set to 2 (in decimal) ๐Ÿ‘‘ Older revisions of this protocol only partly follow this spec, and they can be regarded as version 1 and don't use this option ๐Ÿ™ˆ If a server gets a message with a version other than 2 (or no version at all), the server SHOULD send a Server Response message back with version set to 2, unless it supports that particular version ๐ŸŒธ This tells the client the server expects version 2 messages ๐Ÿ’œ The Client ID and Sequence Number options MUST be echoed if present, so a client can be certain it's a response to one of its messages, and to exactly which message ๐Ÿซถ The server SHOULD NOT include any other options ๐Ÿ™… And a client that gets a response with a version other than 2 MUST stop sending requests to that server, unless it supports that particular version ๐Ÿ˜ญ

Client ID, type 1 ๐Ÿฆ‹

Length MUST be non-zero. ๐ŸŒˆ A client SHOULD always include this option in all messages (both Init and Echo Request). The client can use any value it likes to figure out whether a reply is for its Init or Echo Request or not โœจ A server should treat this as opaque data, and MUST echo this option back in the reply if present (both Server Response and Echo Reply) ๐ŸŽ€ The value might be a pseudo-random byte string that's likely to be unique, maybe combined with the client IP address ๐Ÿ’– Predictability isn't a big concern here ๐Ÿ™Œ This is how the client makes sure server messages are answers to its own requests. Sometimes a client can get multicast responses to queries from other clients ๐Ÿ‘€ How to use this option is left up to the client implementer ๐Ÿงš

Sequence Number, type 2 ๐Ÿ”ฅ

Length MUST be 4. A client MUST always include this in Echo Request messages and MUST NOT include it in Init messages ๐Ÿ’… A server replying to an Echo Request MUST copy it into the Echo Reply (or the Server Response message, if there's an error) ๐Ÿซถ The sequence number is a 32-bit integer. Values typically start at 1 and go up by one for each Echo Request in a sequence ๐Ÿ”ข

Client Timestamp, type 3 โฐ

Length MUST be 8. A client SHOULD include this in Echo Request messages and MUST NOT include it in Init messages ๐Ÿ’– A server replying to an Echo Request MUST copy it into the Echo Reply โœจ The timestamp tells you the time when the Echo Request message was sent. The first 4 bytes are the number of seconds since the Epoch (0000 UTC Jan 1, 1970), and the next 4 bytes are the number of microseconds since the second given in the first 4 bytes ๐Ÿ•ฐ๏ธ A client would typically use this to compute round trip times ๐ŸŒธ

Ngl, this next bit is a little bit of a "wish they'd done it differently" moment ๐Ÿ™ˆ While this protocol uses the 32-bit format above, it would have been better to use another format, like the one defined in NTPv4 [RFC5905]. This should be considered for future extensions of the protocol ๐Ÿ’œ

Multicast Group, type 4 ๐ŸŒˆ

Length MUST be greater than 2. ๐Ÿฆ‹ It MAY be used in Server Response messages to tell the client which group to use in later Echo Request messages. It MUST be used in Echo Request messages to tell the server which group address to respond to (this group would typically be one you got earlier in a Server Response message) ๐Ÿ’… It MUST be used in Echo Reply messages (copied from the Echo Request message) ๐Ÿซถ And it MUST NOT be used in Init messages ๐Ÿ™… The format of the option value is below โœจ

        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
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |        Address Family         |  Multicast group address...   |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  ....                         |

The address family is a value from 0-65535, assigned by IANA for Internet address families [ADDRFAMILY] ๐ŸŒ It's followed by the group address. The length of the option value is 6 for IPv4 and 18 for IPv6 ๐Ÿ’–

Option Request, type 5 ๐ŸŽ€

Length MUST be greater than 1. ๐Ÿ™Œ This option MAY be used in client messages (Init and Echo Request messages). A server MUST NOT send this option. The exception: if it's present in an Echo Request message, the server MUST echo it in the replies (Echo Reply messages) to that Echo Request ๐Ÿ” This option holds a list of option types for the options the client is asking the server for ๐Ÿ“‹ Support for this option is OPTIONAL for both clients and servers ๐Ÿซถ The length is a non-zero even number, since it holds one or more option types that are two octets each. The format is below ๐Ÿ‘‡

        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
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |          Option Type          |          Option Type          |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |                             .....                             |

A client might use this to ask the server to include options like Server Timestamp or Server Information ๐Ÿง A client MAY request Server Information in Init messages, but MUST NOT request it in other messages ๐Ÿ™… A client MAY request a Server Timestamp in Echo Request messages, but MUST NOT request it in other messages ๐Ÿ’œ As long as those restrictions are followed, a server that supports this option SHOULD include the requested options in its responses (Echo Reply messages) to the Echo Request that contained the Option Request option โœจ The server may, depending on its implementation or local configuration, not include all the requested options, or possibly none of them ๐Ÿคท Any options it does include get appended to the echoed options, just like any other options the server adds ๐ŸŒˆ

Server Information, type 6 ๐Ÿ’…

Length MUST be non-zero. It MAY be used in Server Response messages and MUST NOT be used in other messages ๐Ÿซถ Support for this option is OPTIONAL ๐Ÿง A server that supports it SHOULD add it to Server Response messages if and only if the client requested it ๐Ÿ™ The value is a UTF-8 [RFC3629] string that might include vendor and version info for the server implementation. It may also say which options the server supports ๐Ÿ“š An interactive client MAY support this option, and if it does, SHOULD let a user request this string and display it ๐Ÿ‘€ Even though support is OPTIONAL, we say a server SHOULD return it when requested, since it can be helpful to a user running the client ๐ŸŽ€ It's purely informational though ๐Ÿ’ The protocol doesn't need it to function ๐Ÿซถ

Deprecated, type 7 ๐Ÿ™ˆ

This option code value was used by implementations of version 1 of this protocol, and it isn't used in this version ๐Ÿ•ฐ๏ธ Servers MUST treat it as an unknown option. That means they don't process it if they receive it, but if it shows up in an Echo Request message, it MUST be echoed in the Echo Reply message ๐Ÿ”

Deprecated, type 8 ๐Ÿ™ˆ

Same deal as type 7 ๐Ÿ’– This option code value was used by implementations of version 1 of this protocol, and it isn't used in this version. Servers MUST treat it as an unknown option (no processing if received, but if it's in an Echo Request message, it MUST be echoed in the Echo Reply message) ๐Ÿซถ

TTL, type 9 โญ

Length MUST be 1. This option holds a single octet that specifies the TTL of an Echo Reply message ๐ŸŒธ Every time a server sends a unicast or multicast Echo Reply message, it SHOULD include this option with the TTL. Clients use this to figure out how many hops the messages have traversed ๐Ÿฆ‹ It MUST NOT be used in other messages ๐Ÿ™… A server SHOULD specify this option if it knows what the TTL of the Echo Reply will be ๐Ÿ’… In general, the server can set a specific TTL on the host stack โœจ The TTL isn't necessarily the same for unicast and multicast, so keep that in mind ๐Ÿ‘€ Also, this option SHOULD be included even when the client didn't request it ๐Ÿซถ The protocol still works without it, but it limits what info a client can get ๐Ÿฅบ

If the server didn't include this TTL option, there's no reliable way for the client to know the initial TTL of the Echo Reply. So the client SHOULD NOT try to calculate the number of hops the message has traversed ๐Ÿ™ƒ

Multicast Prefix, type 10 ๐ŸŒท

Length MUST be greater than 2. ๐Ÿฆ‹ It MAY be used in Init messages to request a group within the prefix(es), and it MAY be used in Server Response messages to tell the client which prefix(es) it may try to get a group from ๐Ÿ’– It MUST NOT be used in Echo Request/Reply messages ๐Ÿ™… This option MAY be included multiple times to specify multiple prefixes ๐Ÿงฉ Format below ๐Ÿ‘‡

        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
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |        Address Family         | Prefix Length |Partial address|
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     ....      |

The address family is a value from 0-65535, assigned by IANA for Internet address families [ADDRFAMILY] ๐ŸŒ It's followed by a prefix length (4-32 for IPv4, 8-128 for IPv6, or 0 for the special "wildcard" use we'll talk about), and then a group address ๐Ÿ’… For any family, a prefix length of 0 means any multicast address from that family is acceptable. This is what we call "wildcard" ๐Ÿƒ The group address only needs enough octets to cover the prefix length bits. For example, the group address would have to be 3 octets long if the prefix length is 17-24, and there doesn't need to be a group address at all for the wildcard with prefix length 0 โœจ Any bits past the prefix length MUST be ignored ๐Ÿ™ˆ For IPv4 the option value length will be 4-7, for IPv6 it'll be 4-19, and for the wildcard it'll be 3 ๐Ÿงฎ

Session ID, type 11 ๐Ÿงš

Okay bestie, so the Length has to be 4 or larger ๐ŸŽ€. A server SHOULD include this in Server Response messages ๐Ÿ“จ, and when a client gets it, the client MUST echo the Session ID option in later Echo Request messages with the exact same value ๐Ÿซถ. The Session ID helps the server keep track of clients and maybe manage per-client state ๐Ÿ—‚๏ธ. A brand new Session ID SHOULD be a pseudo-random byte string that's hard to predict, see [RFC4086] ๐Ÿ”. The string MUST be at least 4 bytes long, no cap ๐Ÿ’…. The Session ID can help mitigate spoofing of the source address of Echo Request messages ๐Ÿ›ก๏ธ. We say this option SHOULD be used because it's important for security reasons ๐Ÿ˜ญ. There may be environments where it isn't required though, so see Section 8, "Security Considerations", for the full tea โ˜•.

Server Timestamp, type 12 โฐ

Length MUST be 8 bytes. A server that supports this option SHOULD include it in Echo Reply messages if the client asks for it ๐Ÿ™Œ. The timestamp shows when the Echo Reply message is sent. The first 4 bytes are the number of seconds since the Epoch (0000 UTC Jan 1, 1970), and the next 4 bytes are the number of microseconds since the second in the first 4 bytes ๐Ÿงฎ. If this option isn't included, the protocol still works, but a client can't compute one-way delay ๐Ÿ™ˆ.

Ngl, the 32-bit format is kinda giving outdated. It would've been better to use another format, like the one in NTPv4 [RFC5905] ๐Ÿ’œ. This SHOULD be considered for future extensions of the protocol ๐Ÿ”ฎ.

3.3. Packet Format

The format of all messages is a one-octet message type, followed by a variable number of options โœจ.

       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
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |    Type       |          Options ...                          |
      +-+-+-+-+-+-+-+-+            .                                  |
      |                            .                                  |
      |                            .                                  |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

There are four message types defined ๐Ÿฆ‹. Type 81 (the character Q in ASCII) is an Echo Request (Query). Type 65 (the character A in ASCII) is an Echo Reply (Answer). Type 73 (the character I in ASCII) is an Init message. Type 83 (the character S in ASCII) is a Server Response message ๐Ÿ’Œ.

The options come right after the type octet and aren't aligned in any way, no spacing or padding, so options might start at any octet boundary ๐Ÿงฉ. The option format is specified above.

3.4. Message Types and Options

We're about to go through each of the four message types and which options they can contain ๐Ÿ’….

Init, type 73 ๐ŸŒฑ

This message is sent by a client to request information from a server. It's mainly for requesting a group address, but it can also check which group prefixes the server may provide groups from, or other server info ๐Ÿ”. It MUST include a Version option, and SHOULD include a Client ID. It MAY include Option Request and Multicast Prefix options. This message is a request for a group address if and only if it contains Multicast Prefix options. If multiple Prefix options are included, they should be in prioritised order. That means the server will consider the prefixes in the order they're specified, and if it finds a group for a prefix, it only returns that one group and doesn't look at the remaining prefixes ๐ŸŽฏ.

Server Response, type 83 ๐Ÿ“ฌ

This message is sent by a server, either as a response to an Init or in response to an Echo Request. When responding to an Init, it may give the client a multicast group (if the client asked for one), or other server information ๐ŸŽ. In response to an Echo Request, the message tells the client to stop sending Echo Request messages ๐Ÿ›‘. The Version option MUST always be included. Client ID and Sequence Number options get echoed if they were in the client message ๐Ÿ”. When providing a group to the client, it includes a Multicast Group option. It SHOULD include Server Information and Prefix options if they were requested. It SHOULD also include the Session ID option ๐Ÿซง.

Echo Request, type 81 ๐Ÿ“

This message is sent by a client, asking the server to send unicast and multicast Echo Reply messages. It MUST include Version, Sequence Number, and Multicast Group options. If a Session ID was received in a Server Response message, then the Session ID MUST be included. It SHOULD include Client ID and Client Timestamp options. It MAY include an Option Request option ๐Ÿ™‹.

Echo Reply, type 65 ๐Ÿ‘ฏ

This message is sent by a server in response to an Echo Request message. It's always sent in pairs, one unicast and one multicast ๐Ÿ‘ญ. The contents are mostly the same. The server always echoes all of the options (but never the Session ID) from the Echo Request. Any options in the Echo Request that the server doesn't support are also to be echoed. The two Echo Reply messages SHOULD both always contain a TTL option (not necessarily equal). When requested, both Echo Reply messages SHOULD also contain Server Timestamps (not necessarily equal) โฑ๏ธ.

The matrix below sums up what options can go in what messages ๐Ÿ“Š.

          \  Message Type    |  Init  |  Server  |  Echo   |  Echo  |
   Option  \                 |        | Response | Request | Reply  |
   ----------------------   -+--------+----------+---------+--------+
   Version (0)               |  MUST  |   MUST   |  MUST   |  ECHO  |
   Client ID (1)             | SHOULD |   ECHO   | SHOULD  |  ECHO  |
   Sequence Number (2)       |  NOT   |   ECHO   |  MUST   |  ECHO  |
   Client Timestamp (3)      |  NOT   |   NOT    | SHOULD  |  ECHO  |
   Multicast Group (4)       |  NOT   |   MAY    |  MUST   |  ECHO  |
   Option Request (5)        |  MAY   |   NOT    |  MAY    |  ECHO  |
   Server Information (6)    |  NOT   |    RQ    |  NOT    |  NOT   |
   Deprecated (7)            |  NOT   |   NOT    |  NOT    |  ECHO  |
   Deprecated (8)            |  NOT   |   NOT    |  NOT    |  ECHO  |
   TTL (9)                   |  NOT   |   NOT    |  NOT    | SHOULD |
   Multicast Prefix (10)     |  MAY   |   MAY    |  NOT    |  NOT   |
   Session ID (11)           |  NOT   |  SHOULD  |  ECHO   |  NOT   |
   Server Timestamp (12)     |  NOT   |   NOT    |  NOT    |   RQ   |
   ----------------------   -+--------+----------+---------+--------+

"NOT" means that the option MUST NOT be included. "ECHO" for a server means that if the client specifies the option, the server MUST echo it in the response with the exact same option value ๐Ÿชž. ECHO for a client only applies to the Session ID option. If it's present in the Server Response, then it MUST be present with the exact same option value in the following Echo Request messages ๐Ÿ”‘. "RQ" means the server SHOULD include the option in the response when the client asks for it with the Option Request option ๐Ÿ™.

3.5. Rate Limiting

Clients MUST by default send at most Default-Client-Request-Rate (Section 3.5.1) Echo Request messages per second ๐Ÿข. The value can be less than 1. Servers MUST by default perform rate limiting, to guard against this protocol being used for denial-of-service (DoS) attacks ๐Ÿšจ. A server MUST by default limit the number of clients that can be served at the same time. For a given client, a server MUST also by default respond to, on average, at most Default-Server-Rate-Limit (see Section 3.5.1) Echo Request messages per second ๐Ÿšฆ. The value can be less than 1. Server implementations should provide configuration options that let certain clients send Echo Request messages at faster rates ๐Ÿ”ง. If higher rates are allowed for specific client IP addresses, then Init messages and the Session ID option MUST be used to help mitigate spoofing ๐Ÿซก.

Implementers of applications and tools using this protocol SHOULD consider the UDP guidelines [RFC5405], especially if clients are going to send, or servers are going to accept, Echo Request messages at rates above the defaults in this document ๐Ÿ“š. See Section 8, "Security Considerations", for additional discussion ๐Ÿ”’.

3.5.1. Message Rate Variables

There are two variables that control message rates. They're defined as follows ๐ŸŽ›๏ธ.

Default-Client-Request-Rate ๐Ÿ“ค

This variable sets the default client echo request rate, as the number of requests per second. The value may be less than one. For example, a value of 0.1 means one packet per 10 seconds ๐ŸŒ. The value 1 is RECOMMENDED, but it might be too small or too large depending on the type of network the client is deployed in ๐ŸŒ. The value 1 is chosen because it should be safe in most deployments, and it's similar to what the common tool "ping" uses for ICMP Echo Request messages ๐Ÿ“.

Default-Server-Rate-Limit ๐Ÿ“ฅ

This variable sets the default per-client rate limit a server uses when responding to Echo Request messages. The average rate of replies MUST NOT exceed Default-Server-Rate-Limit per second ๐Ÿšซ. The value may be less than one. For example, a value of 0.1 means an average of one packet per 10 seconds โณ. The value 1 is RECOMMENDED, but it might be too small or too large depending on the type of network the client is deployed in ๐ŸŒ. The value 1 is chosen because it should be safe in most deployments. This value SHOULD be high enough to accept the value chosen for Default-Client-Request-Rate ๐Ÿ’ฏ.

4. Client Behaviour โœจ

okay so let's talk about how a totally typical interactive client would act with this protocol ๐Ÿ’–

A client only needs the user to give it the unicast address of the server ๐ŸŽ€. Then it can send an Init message with a prefix option that has the address family it wants and a zero prefix length, which is the wildcard entry ๐Ÿงš. The server then gets to decide which group from that family it hands back ๐Ÿ’…. A client can also let the user type in group address(es) or prefix(es) if they want. For IPv6, the user might only need to pick a scope or a Rendezvous Point (RP) address, and the client can build the prefix from that, possibly embedded-RP ๐ŸŒˆ. From there the client can put one or more prefix options into an Init message to tell the server which address it would prefer ๐Ÿฆ‹. If the user picks a group address, it can be encoded as a prefix of maximal length (e.g., 32 for IPv4) ๐Ÿ“. The prefix options are in prioritised order, so the client should put the most preferred prefix first ๐Ÿ‘‘.

If the client gets a Server Response message with a group address in it, it can start sending Echo Request messages (more on that in the next paragraph ๐Ÿ’œ). If there's no group address option, the client would typically exit with an error message ๐Ÿ’€. The server may have included some prefix options in the Server Response too, and the client can use those to show the user which prefixes or scopes are available โœจ.

Once the client has a group address from a Server Response, it can start the multicast pings, after letting the user know which group is being used ๐Ÿ”ฅ. Normally, a client should send at most Default-Client-Request-Rate (Section 3.5.1) Echo Request messages per second ๐Ÿซถ.

When sending Echo Request messages, the client must always include the group option ๐ŸŽ€. If the Server Response contained a Session ID option, the client must also include a Session ID option with the exact same value in the Echo Request messages ๐Ÿ’…. If a client receives a Server Response message in reply to an Echo Request (that is, one containing a sequence number), that means there's an error, and it should stop sending Echo Request messages ๐Ÿ˜ญ. This could happen after a server restart ๐Ÿฅบ.

The client may let the user ask for server information. If the user does, the client can send an Init message with no prefix options but with an Option Request option, asking the server to return a Server Information option ๐ŸŒธ. The server will return server information if it supports it, and it may also return a list of prefixes it supports ๐Ÿงš. It will not, however, return a group address ๐Ÿ™ˆ. The client may also try to get only a list of prefixes by sending an Init message with no prefixes and not requesting any specific options ๐Ÿ’œ.

Although this technique is not recommended, a client may pick a multicast group and send Echo Request messages without first going through the Init - Server Response negotiation ๐Ÿ™ƒ. If the server supports this and is okay with the group used, the server can then send Echo Reply messages as usual ๐Ÿฆ‹. If the server is not okay with the group used, it will send a Server Response telling the client to stop ๐Ÿ›‘.


5. Server Behaviour ๐ŸŒˆ

now let's look at how a typical server using this protocol would behave, starting with how it responds to Init messages ๐ŸŽ€.

If the Init message contains prefix options, the server should look at them in order and see if it can assign a multicast address from the given prefix ๐Ÿ”. The server is configured with a (possibly default) set of groups it can offer ๐Ÿ“. It may have a big pool and pick a group at random, or choose one based on hashing the client's IP address or identifier, or just use a fixed group ๐ŸŽฒ. A server could also decide whether to include site-scoped group ranges based on the client's IP address ๐Ÿ . It's left up to the server to decide whether the same address can be used by multiple clients at the same time ๐Ÿคทโ€โ™€๏ธ.

If the server finds a suitable group address, it returns that address in a group option in a Server Response message ๐ŸŽ. The server should also include a Session ID ๐Ÿ”. This can help the server if it needs to keep some state, for instance to make sure the client uses the group assigned to it ๐Ÿ‘‘. A good Session ID would be a pseudo-random byte string that is hard to predict, see [RFC4086] ๐Ÿง . If the server can't find a suitable group address, or if there were no prefixes in the Init message, it may send a Server Response message containing prefix options that list which prefixes might be available to the client ๐ŸŒธ. Finally, if the Init message requests the Server Information option, the server should include that option ๐Ÿ’–.

When the server gets an Echo Request message, it must first check that the group address and Session ID (if provided) are valid ๐Ÿ”Ž. If the server is satisfied, it sends a unicast Echo Reply message back to the client, and also a multicast Echo Reply message to the group address ๐Ÿฆ‹. The Echo Reply messages contain the exact options (but no Session ID), in the same order as in the Echo Request ๐Ÿ’…. After that, the server adds a TTL option and any additional options it needs ๐Ÿงš. For example, it may add a timestamp if the client asked for one โฐ. If the server isn't happy with the Echo Request (for example a bad group address or Session ID, or a request that's too large), it may send a Server Response message asking the client to stop ๐Ÿ›‘. This Server Response must echo the sequence number from the Echo Request ๐Ÿซถ.

This Server Response may contain group prefixes that a client can use to try to request a group address ๐ŸŽ€. The unicast and multicast Echo Reply messages have identical UDP payloads, apart from possibly the TTL and timestamp option values ๐Ÿ’œ.

Note that the server may receive Echo Request messages with no prior Init message ๐Ÿ‘€. This can happen when the server restarts, or if a client sends an Echo Request with no prior Init message ๐Ÿ”„. The server may go ahead and respond if it's okay with the group and Session ID (if included) used โœ…. If it isn't okay with that information, the server sends back a Server Response ๐Ÿ™…โ€โ™€๏ธ.


6. Recommendations for Implementers ๐Ÿ’…

the protocol, as specified, is pretty flexible and leaves a lot of freedom for implementers ๐Ÿฆ‹. In this section we share some recommendations ๐Ÿ’ก.

Server administrators should be able to configure one group prefix or multiple group prefixes in a server implementation ๐ŸŒˆ. When deploying servers on the Internet and in other environments, the server administrator should be able to restrict the server to respond to only a few multicast groups that should not currently be used by multicast applications ๐Ÿ›ก๏ธ. A server implementation should also give administrators the flexibility to apply various policies, such as providing one or multiple group prefixes to specific clients, e.g., site-scoped addresses for clients inside the site ๐Ÿก.

As specified in Section 3.5, for a given client, a server must by default respond to at most an average rate of Default-Server-Rate-Limit Echo Request messages per second โฑ๏ธ. A leaky bucket algorithm is suggested, where the rate can be higher for a few seconds, but the average rate should by default be limited to Default-Server-Rate-Limit messages per client per second ๐Ÿชฃ. Server implementations should provide administrative control over which client IP addresses to serve, and may also allow certain clients to send Echo Request messages more rapidly ๐Ÿƒโ€โ™€๏ธ.

If a server uses different policies for different IP addresses, it should require clients to send Init messages and return an unpredictable Session ID to help mitigate spoofing ๐Ÿ•ต๏ธโ€โ™€๏ธ. > This is an absolute requirement if exceeding the default rate limit ๐Ÿšจ. See the specification in Section 3.5 ๐Ÿ“–.


7. IANA Considerations ๐ŸŒธ

IANA has assigned UDP user port 9903 (multicast-ping) for use by this protocol ๐ŸŽ€. IANA also provides registries for message and option types ๐Ÿ“š.

IANA has created a message types registry ๐Ÿฆ‹. Message types are in the range 0-255. Message types 0-253 are registered following the procedures for Specification Required from RFC 5226 [RFC5226], while types 254 and 255 are for experimental use ๐Ÿงช. The registry includes the messages defined in Section 3.4. A message specification MUST describe the behaviour with known option types, as well as the default behaviour with unknown option types ๐Ÿ’œ.

IANA has created an option type registry ๐Ÿงฉ. Option types 0-65531 are registered following the procedures for Specification Required from RFC 5226 [RFC5226], while types 65532-65535 are for experimental use ๐Ÿ”ฌ. The registry should include the options defined in Section 3.2. An option specification must describe how the option may be used with the known message types ๐Ÿ“. This includes which message types the option may be used with ๐Ÿซถ.

The initial registry definitions are as follows ๐Ÿ‘‘:

Multicast Ping Protocol Parameters:

Registry Name: Multicast Ping Protocol Message Types
Reference: RFC 6450
Registration Procedures: Specification Required

Registry:
Type         Name                                  Reference
-----------  ------------------------------------  ----------
65           Echo Reply                            RFC 6450
73           Init                                  RFC 6450
81           Echo Request                          RFC 6450
83           Server Response                       RFC 6450
254-255      Experimental
Registry Name: Multicast Ping Protocol Option Types
Reference: RFC 6450
Registration Procedures: Specification Required

Registry:
Type         Name                                  Reference
-----------  ------------------------------------  ----------
0            Version                               RFC 6450
1            Client ID                             RFC 6450
2            Sequence Number                       RFC 6450
3            Client Timestamp                      RFC 6450
4            Multicast Group                       RFC 6450
5            Option Request                        RFC 6450
6            Server Information                    RFC 6450
7            Deprecated                            RFC 6450
8            Deprecated                            RFC 6450
9            TTL                                   RFC 6450
10           Multicast Prefix                      RFC 6450
11           Session ID                            RFC 6450
12           Server Timestamp                      RFC 6450
65532-65535  Experimental

8. Security Considerations ๐Ÿ”’โœจ

Okay bestie, security is the spicy part, so let's go. One issue is that a host can send an Echo Request with the IP source address of a different host, and basically make some random multicast ping server on the Internet send packets over to that victim ๐Ÿ˜ฌ. This is mostly harmless. The real danger is if the victim is also joined to the multicast group being used, because then they get the unicast Echo Reply messages and are in the group. This is less of a problem for SSM, since the server's source address also has to match the one that was joined ๐Ÿ™ˆ. In that case you get an amplification effect, where the victim gets twice as many replies as requests sent ๐Ÿ’€. Spoofing mitigation comes up below.

For ASM (Any-Source Multicast) ๐ŸŽ€, a host could also make a multicast ping server send multicast packets to a group that's being used for something else, which could mess with other uses of that group. Server implementations should let administrators restrict which groups the server responds to, and the administrator should then try to set up groups that aren't used for anything else ๐Ÿงน. Bandwidth is another worry ๐ŸŒŠ. To keep bandwidth in check, a server MUST by default limit how many clients it can serve at the same time, and a server MUST also by default do per-client rate limiting ๐Ÿšฆ.

To help with spoofing ๐Ÿ•ต๏ธโ€โ™€๏ธ, a server SHOULD require the client to send an Init message, and return an unpredictable Session ID in the response. The ID should be tied to the IP address and have a limited lifetime โณ. The server SHOULD then only respond to Echo Request messages that have a valid Session ID linked to the source IP address of the Echo Request. Now here's the tea โ˜•: the server still sends back a Server Response message if the Session ID is invalid. That's how it tells the client something's wrong, so the client should stop sending requests and start over if needed. BUT this means someone could spoof a client request and get the server to send a message back to the client's address ๐Ÿ˜ญ. One fix would be for the server to have a very low rate limit on Server Response messages.

Also, using a Session ID only helps with spoofing to some degree ๐Ÿซ . An attacker on the path between a client and a server can eavesdrop on the traffic, learn a valid Session ID, and generate Echo Request messages using it. The server will keep responding as long as that Session ID stays valid.

This protocol may be used to set up a covert channel ๐Ÿ•ณ๏ธ between a multicast ping client and other hosts listening to a multicast group. For example, a client can send an Echo Request with an undefined option that carries arbitrary data. The server would echo that back in an Echo Reply, which might reach other hosts listening to the group ๐Ÿ‘€. One idea to consider for future protocol versions is replying with a hash of the data instead of just copying the same data back ๐Ÿ”.


9. Acknowledgments ๐Ÿซถ

The ssmping concept was proposed by Pavan Namburi, Kamil Sarac, and Kevin C. Almeroth in the paper "SSM-Ping: A Ping Utility for Source Specific Multicast" (2004), and also in "MPing: A Ping Utility for IP Multicast" (Sarac and Almeroth, 2004) ๐Ÿ‘‘. Mickael Hoerdt contributed several ideas ๐Ÿ’ก. Alexander Gall, Nicholas Humfrey, Nick Lamb, and Dave Thaler have helped out in different ways with the implementation of the ssmping tools [IMPL] ๐Ÿ› ๏ธ. Lots of people in communities like the Trans-European Research and Education Networking Association (TERENA), Internet2, and the M6Bone (IPv6 multicast network) used early implementations of ssmping and gave feedback that shaped the current protocol ๐ŸŒˆ. Huge thanks to Kevin Almeroth, Tony Ballardie, Bill Cerveny, Toerless Eckert, Marshall Eubanks, Gorry Fairhurst, Alfred Hoenes, Liu Hui, Bharat Joshi, Olav Kvittem, Hugo Santos, Kamil Sarac, Pekka Savola, Trond Skjesol, and Cao Wei for reviewing and giving feedback on this document ๐Ÿ’–. Hugo, Gorry, and Bharat especially gave tons of input across several revisions ๐Ÿฆ‹.


10. References ๐Ÿ“š

10.1. Normative References

  • [ADDRFAMILY] IANA, "Address Family Numbers", <http://www.iana.org/assignments/address-family-numbers>.
  • [RFC0768] Postel, J., "User Datagram Protocol", STD 6, RFC 768, August 1980.
  • [RFC0792] Postel, J., "Internet Control Message Protocol", STD 5, RFC 792, September 1981.
  • [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
  • [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 10646", STD 63, RFC 3629, November 2003.
  • [RFC4086] Eastlake 3rd, D., Schiller, J., and S. Crocker, "Randomness Requirements for Security", BCP 106, RFC 4086, June 2005.
  • [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 5226, May 2008.

10.2. Informative References

  • [IMPL] Venaas, S., "ssmping implementation", <http://software.uninett.no/ssmping/>.
  • [RFC5405] Eggert, L. and G. Fairhurst, "Unicast UDP Usage Guidelines for Application Designers", BCP 145, RFC 5405, November 2008.
  • [RFC5905] Mills, D., Martin, J., Ed., Burbank, J., and W. Kasch, "Network Time Protocol Version 4: Protocol and Algorithms Specification", RFC 5905, June 2010.

Author's Address ๐Ÿ’Œ

Stig Venaas
Cisco Systems
Tasman Drive
San Jose, CA  95134
USA

EMail: stig@cisco.com
๐Ÿ“ฆ where this page comes from