RFC 7355
Indicating WebSocket Protocol as a Transport in the Session Initiation Protocol (SIP) Common Log Format (CLF)
Indicating WebSocket Protocol as a Transport in the Session Initiation Protocol (SIP) Common Log Format (CLF) π¦
bestie, okay so this is RFC 7355 π It's an Informational doc from the IETF, published September 2014 and tagged ISSN 2070-1721. It was written by G. Salgueiro from Cisco, and V. Pascual, A. Roman, and S. Garcia from Quobis. It updates RFC 6873 β¨ and it doesn't obsolete anything. Its whole job is teaching SIP logs how to say "this message came over WebSocket" π§
Abstract π
okay so RFC 7118 gives us a WebSocket subprotocol for SIP entities to talk over a reliable, real-time transport, which is how SIP ends up working in web-style deployments πΈ This doc updates the SIP Common Log Format (CLF) from RFC 6873 by adding a brand-new "Transport Flag" for SIP over WebSocket π
Status of This Memo π
quick reality check: this is not an Internet Standards Track spec. It's just published for info π€
It's still an IETF product, so it reflects the consensus of the IETF community. It got public review and was approved by the Internet Engineering Steering Group (IESG). Not every IESG-approved doc is a candidate for any level of Internet Standard, so see Section 2 of RFC 5741 for that π«Ά
Want the current status, errata, or a way to send feedback? Check http://www.rfc-editor.org/info/rfc7355 π
Copyright Notice π
Copyright (c) 2014 IETF Trust and the persons identified as the document authors. All rights reserved. π
This doc is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) as they stood on the publication date. Read them, because they spell out your rights and restrictions. If you pull Code Components out of this doc, they need Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions, and they come with no warranty, same as that license says βοΈ
Table of Contents ποΈ
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3
3. Document Conventions . . . . . . . . . . . . . . . . . . . . 3
4. Usage of the WebSocket Transport Flag . . . . . . . . . . . . 3
5. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 4
5.1. SIP over WebSocket (WS) . . . . . . . . . . . . . . . . . 4
5.2. SIP over Secure WebSocket (WSS) . . . . . . . . . . . . . 6
6. Security Considerations . . . . . . . . . . . . . . . . . . . 7
7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 7
8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 7
9. References . . . . . . . . . . . . . . . . . . . . . . . . . 8
9.1. Normative References . . . . . . . . . . . . . . . . . . 8
9.2. Informative References . . . . . . . . . . . . . . . . . 8
1. Introduction β¨
okay so the WebSocket protocol [RFC6455] lets clients and servers swap bidirectional messages over a persistent TCP connection, and you can optionally wrap that in TLS [RFC5246] π The opening handshake uses HTTP [RFC7230] semantics, which is the trick that lets WebSocket piggyback on transport connections that already exist π¦
RFC 7118 [RFC7118] defines a WebSocket subprotocol for carrying SIP messages between a WebSocket client and server π
SIP messages can be logged with the Common Log Format from RFC 6873 [RFC6873] π To make that logging work for SIP messages sent over WebSocket, a new WebSocket "Transport Flag" ('W') must be added to the "Transport Flags" RFC 6873 [RFC6873] already defines (that's UDP, TCP, and SCTP) π₯
So this doc updates RFC 6873 [RFC6873] by defining a new SIP CLF "Transport Flag" value for WebSocket π
2. Terminology π
Here are the BCP 14 key words, the ones that carry the real requirement weight in this doc: "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL". They're meant to be read as described in [RFC2119] π«Ά
3. Document Conventions π
This doc has a bunch of examples of SIP CLF records showing messages over plain and secure WebSocket connections π§ The thing is, RFC formatting rules make it impossible to render those examples unambiguously, so this doc uses the <allOneLine/> markup convention from [RFC4475] to keep everything clean π
That markup is explained in detail in Section 3 of RFC 6873 [RFC6873], and that doc uses it all over the place for SIP CLF syntax β¨
4. Usage of the WebSocket Transport Flag π¦
okay so Section 4.2 of RFC6873 [RFC6873] lists the mandatory fields in a SIP CLF record π The fourth and fifth bytes of the five-byte "Flags Field" are the "Transport Flag" and the "Encryption Flag", in that order π Set those two flag fields correctly and SIP messages over plain and secure WebSocket can be told apart, no cap π
The "Transport Flag" values registered right now (Section 9.2 of RFC 6873) are UDP ('U'), TCP ('T'), and SCTP ('S') πΈ This doc defines and registers a new "Transport Flag" value, 'W', for SIP messages sent over WebSocket. That means it updates RFC 6873 [RFC6873] and the IANA "SIP CLF Transport Flag Values" registry π
Here's the rule, bestie π SIP CLF records for messages sent over a plain WebSocket connection (WS) MUST set the "Transport Flag" to the new 'W' value and the "Encryption Flag" to 'U' (Unencrypted). SIP CLF records for messages sent over a secure WebSocket connection (WSS), which is WS over TLS, MUST set the "Transport Flag" to that same 'W' value and the "Encryption Flag" to 'E' (Encrypted) π
5. Examples π
The examples below show sample SIP CLF records logged for SIP messages sent over both plain and secure WebSocket connections β¨
5.1. SIP over WebSocket (WS) π·
This one is a SIP INVITE request sent over a plain WebSocket connection π The Session Description Protocol (SDP) [RFC4566] body is left out to keep things short π
INVITE sip:bob@example.com SIP/2.0
Via: SIP/2.0/WS df7jal23ls0d.invalid;branch=z9hG4bK56sdasks
From: sip:alice@example.com;tag=asdyka899
To: sip:bob@example.com
Call-ID: asidkj3ss
CSeq: 1 INVITE
Max-Forwards: 70
Date: Thu, 6 Feb 2014 15:02:03 GMT
Supported: path, outbound, gruu
Route: <sip:proxy.example.com:80;transport=ws;lr>
Contact: <sip:alice@example.com;gr=urn:uuid:f81-7dec-14a06cf1;ob>
Content-Type: application/sdp
Content-Length: 418
Here's roughly how that message shows up as one record in a SIP CLF logging file, following the syntax from [RFC6873]. RFC layout rules make us split it into five lines, but a real log file has it on two lines. The tabs are also swapped for spaces so it looks right in a terminal π
A0000E7,0053005C005E00720080009200A600A800BE00C800D200DE00E7
<allOneLine>
1328821153.010 RORWU 1 INVITE - sip:bob@example.com
192.0.2.10:80 192.0.2.200:56485 sip:bob@example.com -
sip:alice@example.com asdyka899 asidkj3ss S1781761-88
C67651-11
</allOneLine>
Want the bit-exact version? It's the actual log entry, Base64 encoded [RFC4648] using the uuencode utility π§
begin-base64 644 clf_ws_record
QTAwMDBFNywwMDUzMDA1QzAwNUUwMDcyMDA4MDAwOTIwMEE2MDBBODAwQkUwMEM4MDBE
MjAwREUwMEU3CjEzMjg4MjExNTMuMDEwCVJPUldVCTEgSU5WSVRFCS0Jc2lwOmJvYkBl
eGFtcGxlLmNvbQkxOTIuMC4yLjEwOjgwCTE5Mi4wLjIuMjAwOjU2NDg1CXNpcDpib2JA
ZXhhbXBsZS5jb20JLQlzaXA6YWxpY2VAZXhhbXBsZS5jb20JYXNkeWthODk5CWFzaWRr
ajNzcwlTMTc4MTc2MS04OAlDNjc2NTEtMTEKCg==
====
The original SIP CLF format comes back if you undo uuencode by running the uudecode transform on it π If you'd rather recover the unencoded file, you can pass the Base64 text above into this perl script, and redirect the output to a file π
<CODE BEGINS>
#!/usr/bin/perl
use strict;
my $bdata = "";
use MIME::Base64;
while(<>)
{
if (/begin-base64 644 clf_ws_record/ .. /-- ==== --/)
{
if ( m/^\s*[^\s]+\s*$/)
{
$bdata = $bdata . $_;
}
}
}
print decode_base64($bdata);
<CODE ENDS>
5.2. SIP over Secure WebSocket (WSS) π
Next up is a SIP INVITE sent over a secure WebSocket connection, which is WebSocket over TLS [RFC5246] π§ The SDP body is cut again for brevity π
INVITE sip:bob@example.com SIP/2.0
Via: SIP/2.0/WSS df7jal23ls0d.invalid;branch=z9hG4bK56sdasks
From: sip:alice@example.com;tag=asdyka899
To: sip:bob@example.com
Call-ID: asidkj3ss
CSeq: 1 INVITE
Max-Forwards: 70
Date: Thu, 6 Feb 2014 15:02:03 GMT
Supported: path, outbound, gruu
Route: <sip:proxy.example.com:443;transport=ws;lr>
Contact: <sip:alice@example.com;gr=urn:uuid:f81-7dec-14a06cf1;ob>
Content-Type: application/sdp
Content-Length: 439
Same deal as before: this is roughly how the message looks as one record in a SIP CLF logging file, syntax from [RFC6873]. It's split into five lines for the RFC layout, and the tabs are spaces πΈ
A0000E8,0053005C005E00720081009300A700A900BF00C900D300DF00E8
<allOneLine>
1328821153.010 RORWE 1 INVITE - sip:bob@example.com
192.0.2.10:443 192.0.2.200:56485 sip:bob@example.com -
sip:alice@example.com:5060 asdyka899 asidkj3ss S1781761-88
C67651-11
</allOneLine>
And the bit-exact, Base64 encoded version π
begin-base64 644 clf_ws_record
QTAwMDBFOCwwMDUzMDA1QzAwNUUwMDcyMDA4MTAwOTMwMEE3MDBBOTAwQkYwMEM5MDBE
MzAwREYwMEU4CjEzMjg4MjExNTMuMDEwCVJPUldVCTEgSU5WSVRFCS0Jc2lwOmJvYkBl
eGFtcGxlLmNvbQkxOTIuMC4yLjEwOjQ0MwkxOTIuMC4yLjIwMDo1NjQ4NQlzaXA6Ym9i
QGV4YW1wbGUuY29tCS0Jc2lwOmFsaWNlQGV4YW1wbGUuY29tCWFzZHlrYTg5OQlhc2lk
a2ozc3MJUzE3ODE3NjEtODgJQzY3NjUxLTExCgo=
====
7. IANA Considerations π
okay so this bit is where IANA comes in and does the paperwork π
this doc defines a new value, W, for the SIP CLF "Transport Flag" π¦ IANA registered it in the "SIP CLF Transport Flag Values" registry, and it looks like this:
+-------+--------------------+--------------------+
| Value | Transport Protocol | Reference |
+-------+--------------------+--------------------+
| W | WebSocket | RFC 7118, RFC 7355 |
+-------+--------------------+--------------------+
Table 1: IANA-Registered SIP CLF Transport Flag
so the W flag means WebSocket and it's referenced by both RFC 7118 and RFC 7355 πΈ iconic registration energy β¨
8. Acknowledgements π«Ά
the authors wanna thank Vijay Gurbani for shepherding this document π and Area Director Richard Barnes for sponsoring it π this work also got a super thorough review and constructive comments from Richard Barnes, Barry Leiba, Benoit Claise, Pete Resnick, Stephen Farrel, and Vijay Gurbani π₯Ή the whole squad showed up for this one π
9. References π
9.1. Normative References π₯
these are the ones you really need to read to get the spec right:
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC6455] Fette, I. and A. Melnikov, "The WebSocket Protocol", RFC
6455, December 2011.
[RFC6872] Gurbani, V., Burger, E., Anjali, T., Abdelnur, H., and O.
Festor, "The Common Log Format (CLF) for the Session
Initiation Protocol (SIP): Framework and Information
Model", RFC 6872, February 2013.
[RFC6873] Salgueiro, G., Gurbani, V., and A. Roach, "Format for the
Session Initiation Protocol (SIP) Common Log Format
(CLF)", RFC 6873, February 2013.
[RFC7118] Baz Castillo, I., Millan Villegas, J., and V. Pascual,
"The WebSocket Protocol as a Transport for the Session
Initiation Protocol (SIP)", RFC 7118, January 2014.
9.2. Informative References πΈ
these ones are good background reading but not required:
[RFC4475] Sparks, R., Hawrylyshen, A., Johnston, A., Rosenberg, J.,
and H. Schulzrinne, "Session Initiation Protocol (SIP)
Torture Test Messages", RFC 4475, May 2006.
[RFC4566] Handley, M., Jacobson, V., and C. Perkins, "SDP: Session
Description Protocol", RFC 4566, July 2006.
[RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data
Encodings", RFC 4648, October 2006.
[RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security
(TLS) Protocol Version 1.2", RFC 5246, August 2008.
[RFC7230] Fielding, R. and J. Reschke, "Hypertext Transfer Protocol
(HTTP/1.1): Message Syntax and Routing", RFC 7230, June
2014.
Authors' Addresses π
here's who wrote it, bestie π§
Gonzalo Salgueiro
Cisco Systems, Inc.
7200-12 Kit Creek Road
Research Triangle Park, NC 27709
US
EMail: gsalguei@cisco.com
Victor Pascual
Quobis
EMail: victor.pascual@quobis.com
Anton Roman
Quobis
EMail: anton.roman@quobis.com
Sergio Garcia Ramos
Quobis
EMail: sergio.garcia@quobis.com
and that's the whole RFC!! π¦β¨ the authors really built a whole vibe here, periodt π π
π¦ where this page comes from
- ietf: rfc7355 2014-09
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms