Subject: [sipcore] 4244bis time-ordering

From: [email-masked] (Dale R. Worley)
Date: Thu, 29 Nov 2012 15:59:10 -0500 (EST)

After discussing 4244bis with Mary Barnes at the IETF, I now know that
the intention of draft-ietf-sipcore-rfc4244bis is that History-Info
entries are to be accumulated in a proxy's cache more-or-less in the
*time* order that they are received from downstream, not in the tree
order based on their index values.  I'm now working out the
consequences of this.

In a previous message
(http://www.ietf.org/mail-archive/web/sipcore/current/msg05220.html) I
considered the case of a proxy ("atlanta") that supports History-Info
sending an INVITE to a proxy ("biloxi") that does not support
History-Info, but biloxi forks the INVITE to two targets which both
support History-Info.  This is to correct that example according to
the time-order principle (and fix some minor problems).

   This is an example where a proxy/registrar forks the call to
   several alternative destinations.  The proxy/registrar does not
   support History-Info but the destinations do.

   Alice   atlanta.example.com  biloxi.example.com   Bob    Office
   |                |                |                |        |
   |   INVITE F1    |                |                |        |
   |--------------->|                |                |        |
   |                |                |                |        |
   |                |   INVITE F2    |                |        |
   |                |--------------->|                |        |
   |                |                |                |        |
   |                |                | INVITE F3      |        |
   |                |                |--------------->|        |
   |                |                |                |        |
   |                |                | 180 Ringing F4 |        |
   |                |                |<---------------|        |
   |                |                |                |        |
   |                |   180 Ringing F5                |        |
   |                |<---------------|                |        |
   |                |                |                |        |
   |   180 Ringing F6                |                |        |
   |<---------------|                |                |        |
   |                |                |                |        |
   |                |                | 408 Timeout F7 |        |
   |                |                |<---------------|        |
   |                |                |                |        |
   |                |                | INVITE F8      |        |
   |                |                |------------------------>|
   |                |                |                |        |
   |                |                | 180 Ringing F9 |        |
   |                |                |<------------------------|
   |                |                |                |        |
   |                |   180 Ringing F10               |        |
   |                |<---------------|                |        |
   |                |                |                |        |
   |   180 Ringing F11               |                |        |
   |<---------------|                |                |        |
   |                |                |                |        |
   |                |                | 200 OK F12     |        |
   |                |                |<------------------------|
   |                |                |                |        |
   |                |   200 OK F13   |                |        |
   |                |<---------------|                |        |
   |                |                |                |        |
   |    200 OK F14  |                |                |        |
   |<---------------|                |                |        |
   |                |                |                |        |
   |     ACK        |                |                |        |
   |--------------->|    ACK         |                |        |
   |                |--------------->|     ACK        |        |
   |                |                |------------------------>|

	     Example with forking by non-supporting proxy

   Note that atlanta.example.com and all the UAs support History-Info;
   biloxi.example.com does not.

   F1 INVITE alice -> atlanta.example.com

   INVITE sip:[email-masked] SIP/2.0
   Via: SIP/2.0/TCP 192.0.2.3:5060;branch=z9hG4bK4321
   From: Alice <sip:[email-masked]>;tag=22
   To: Bob <sip:[email-masked]>
   Supported: histinfo
   Call-Id: [email-masked]
   CSeq: 1 INVITE
   History-Info: <sip:[email-masked]>;index=1
   Contact: Alice <sip:[email-masked]>
   Content-Type: application/sdp
   Content-Length: <appropriate value>
   <!-- SDP Not Shown -->

   F2 INVITE  atlanta.example.com -> biloxi.example.com

   INVITE sip:[email-masked] SIP/2.0
   Via: SIP/2.0/TCP proxy.atlanta.example.com:5060;branch=z9hG4bKbst2
   Via: SIP/2.0/TCP 192.0.2.3:5060;branch=z9hG4bK4321
   From: Alice <sip:[email-masked]>;tag=22
   To: Bob <sip:[email-masked]>
   Supported: histinfo
   Call-Id: [email-masked]
   CSeq: 1 INVITE
   History-Info: <sip:[email-masked]>;index=1
   History-Info: <sip:[email-masked]>;index=1.1;rc=1
   Contact: Alice <sip:[email-masked]>
   Content-Type: application/sdp
   Content-Length: <appropriate value>
   <!-- SDP Not Shown -->

   F3 INVITE  biloxi.example.com -> Bob

   INVITE sip:[email-masked] SIP/2.0
   Via: SIP/2.0/TCP proxy.biloxi.example.com:5060;branch=z9hG4bK
   Via: SIP/2.0/TCP proxy.atlanta.example.com:5060;branch=z9hG4bKbst2
   Via: SIP/2.0/TCP 192.0.2.3:5060;branch=z9hG4bK4321
   From: Alice <sip:[email-masked]>;tag=22
   To: Bob <sip:[email-masked]>
   Supported: histinfo
   Call-Id: [email-masked]
   CSeq: 1 INVITE
   Expires: 30
   History-Info: <sip:[email-masked]>;index=1
   History-Info: <sip:[email-masked]>;index=1.1;rc=1
   Contact: Alice <sip:[email-masked]>
   Content-Type: application/sdp
   Content-Length: <appropriate value>
   <!-- SDP Not Shown -->

Response F4 contains an hi-entry with index 1.1.0.1 because UI Bob
detects a gap in the hi-entries.

   F4 180 Ringing  bob -> biloxi.example.com

   SIP/2.0 180 Ringing
   Via: SIP/2.0/TCP proxy.biloxi.example.com:5060;branch=z9hG4bK
   Via: SIP/2.0/TCP proxy.atlanta.example.com:5060;branch=z9hG4bKbst2
   Via: SIP/2.0/TCP 192.0.2.3:5060;branch=z9hG4bK4321
   From: Alice <sip:[email-masked]>;tag=22
   To: Bob <sip:[email-masked]>;tag=33
   Supported: histinfo
   Call-Id: [email-masked]
   CSeq: 1 INVITE
   History-Info: <sip:[email-masked]>;index=1
   History-Info: <sip:[email-masked]>;index=1.1;rc=1
   History-Info: <sip:[email-masked]>;index=1.1.0.1
   Contact: Bob <sip:[email-masked]>
   Content-Type: application/sdp
   Content-Length: <appropriate value>
   <!-- SDP Not Shown -->

atlanta adds the hi-entry 1.1.0.1 to its cache *at the end*:  It is
added because atlanta hasn't seen that entry before, and new entries
are always added at the end.

   F5 180 Ringing  biloxi.example.com -> atlanta.example.com

   SIP/2.0 180 Ringing
   Via: SIP/2.0/TCP proxy.atlanta.example.com:5060;branch=z9hG4bKbst2
   Via: SIP/2.0/TCP 192.0.2.3:5060;branch=z9hG4bK4321
   From: Alice <sip:[email-masked]>;tag=22
   To: Bob <sip:[email-masked]>;tag=33
   Supported: histinfo
   Call-Id: [email-masked]
   CSeq: 1 INVITE
   History-Info: <sip:[email-masked]>;index=1
   History-Info: <sip:[email-masked]>;index=1.1;rc=1
   History-Info: <sip:[email-masked]>;index=1.1.0.1
   Contact: Bob <sip:[email-masked]>
   Content-Type: application/sdp
   Content-Length: <appropriate value>
   <!-- SDP Not Shown -->

atlanta adds a Reason parameter to entry 1.1, due to receiving a 180
from that branch of the call.

[Is this what we intend?  The text in section 9.3 is clear that 1xx
responses cause "Reason" header values, but examples in
draft-ietf-sipcore-rfc4244bis-callflows-01 show that not being done
(e.g., F8 in 3.1), and it's not clear how useful it would be.]

   F6 180 Ringing  atlanta.example.com -> alice

   SIP/2.0 180 Ringing
   Via: SIP/2.0/TCP 192.0.2.3:5060;branch=z9hG4bK4321
   From: Alice <sip:[email-masked]>;tag=22
   To: Bob <sip:[email-masked]>;tag=33
   Supported: histinfo
   Call-Id: [email-masked]
   CSeq: 1 INVITE
   History-Info: <sip:[email-masked]>;index=1
   History-Info: <sip:[email-masked]?Reason=SIP%3Bcause%3D180>;index=1.1;rc=1
   History-Info: <sip:[email-masked]>;index=1.1.0.1
   Contact: Bob <sip:[email-masked]>
   Content-Type: application/sdp
   Content-Length: <appropriate value>
   <!-- SDP Not Shown -->

   F7 408 Timeout  bob -> biloxi.example.com

   SIP/2.0 408 Timeout
   Via: SIP/2.0/TCP proxy.biloxi.example.com:5060;branch=z9hG4bK
   Via: SIP/2.0/TCP proxy.atlanta.example.com:5060;branch=z9hG4bKbst2
   Via: SIP/2.0/TCP 192.0.2.3:5060;branch=z9hG4bK4321
   From: Alice <sip:[email-masked]>;tag=22
   To: Bob <sip:[email-masked]>;tag=33
   Supported: histinfo
   Call-Id: [email-masked]
   CSeq: 1 INVITE
   History-Info: <sip:[email-masked]>;index=1
   History-Info: <sip:[email-masked]>;index=1.1;rc=1
   History-Info: <sip:[email-masked]>;index=1.1.0.1
   Contact: Bob <sip:[email-masked]>
   Content-Type: application/sdp
   Content-Length: <appropriate value>
   <!-- SDP Not Shown -->

   F8 INVITE  biloxi.example.com -> office

   INVITE sip:[email-masked] SIP/2.0
   Via: SIP/2.0/TCP proxy.biloxi.example.com:5060;branch=z9hG4bKxyz
   Via: SIP/2.0/TCP proxy.atlanta.example.com:5060;branch=z9hG4bKbst2
   Via: SIP/2.0/TCP 192.0.2.3:5060;branch=z9hG4bK4321
   From: Alice <sip:[email-masked]>;tag=22
   To: Bob <sip:[email-masked]>
   Supported: histinfo
   Call-Id: [email-masked]
   CSeq: 1 INVITE
   Expires: 30
   History-Info: <sip:[email-masked]>;index=1
   History-Info: <sip:[email-masked]>;index=1.1;rc=1
   Contact: Alice <sip:[email-masked]>
   Content-Type: application/sdp
   Content-Length: <appropriate value>
   <!-- SDP Not Shown -->

Response F9 contains an hi-entry with index 1.1.0.1 because UI Office
detects a gap in the hi-entries.

   F9 180 Ringing  office -> biloxi.example.com

   SIP/2.0 180 Ringing
   Via: SIP/2.0/TCP proxy.biloxi.example.com:5060;branch=z9hG4bKxyz
   Via: SIP/2.0/TCP proxy.atlanta.example.com:5060;branch=z9hG4bKbst2
   Via: SIP/2.0/TCP 192.0.2.3:5060;branch=z9hG4bK4321
   From: Alice <sip:[email-masked]>;tag=22
   To: Bob <sip:[email-masked]>;tag=44
   Supported: histinfo
   Call-Id: [email-masked]
   CSeq: 1 INVITE
   History-Info: <sip:[email-masked]>;index=1
   History-Info: <sip:[email-masked]>;index=1.1;rc=1
   History-Info: <sip:[email-masked]>;index=1.1.0.1
   Contact: Office <sip:[email-masked]>
   Content-Type: application/sdp
   Content-Length: <appropriate value>
   <!-- SDP Not Shown -->

   F10 180 Ringing  biloxi.example.com -> atlanta.example.com

   SIP/2.0 180 Ringing
   Via: SIP/2.0/TCP proxy.atlanta.example.com:5060;branch=z9hG4bKbst2
   Via: SIP/2.0/TCP 192.0.2.3:5060;branch=z9hG4bK4321
   From: Alice <sip:[email-masked]>;tag=22
   To: Bob <sip:[email-masked]>;tag=44
   Supported: histinfo
   Call-Id: [email-masked]
   CSeq: 1 INVITE
   History-Info: <sip:[email-masked]>;index=1
   History-Info: <sip:[email-masked]>;index=1.1;rc=1
   History-Info: <sip:[email-masked]>;index=1.1.0.1
   Contact: Office <sip:[email-masked]>
   Content-Type: application/sdp
   Content-Length: <appropriate value>
   <!-- SDP Not Shown -->

atlanta adds the second hi-entry with index 1.1.0.1 to its cache *at
the end*:  It is added because atlanta hasn't seen that entry before,
and new entries are always added at the end.

atlanta needs to record a Reason specifying response 180 in index
1.1.  It presumably replaces the previous Reason 180 in that entry.

   F11 180 Ringing  atlanta.example.com -> alice

   SIP/2.0 180 Ringing
   Via: SIP/2.0/TCP 192.0.2.3:5060;branch=z9hG4bK4321
   From: Alice <sip:[email-masked]>;tag=22
   To: Bob <sip:[email-masked]>;tag=44
   Supported: histinfo
   Call-Id: [email-masked]
   CSeq: 1 INVITE
   History-Info: <sip:[email-masked]>;index=1
   History-Info: <sip:[email-masked]?Reason=SIP%3Bcause%3D180>;index=1.1;rc=1
   History-Info: <sip:[email-masked]>;index=1.1.0.1
   History-Info: <sip:[email-masked]>;index=1.1.0.1
   Contact: Office <sip:[email-masked]>
   Content-Type: application/sdp
   Content-Length: <appropriate value>
   <!-- SDP Not Shown -->

Under the principle that hi-entries are accumulated in the cache in
time order, there are two hi-entries with index 1.1.0.1, recorded in
the order in which they were received by atlanta.  In this case, the
UAC can connect the hi-entries correctly, since it knows that the
parent of 1.1.0.1 is always 1.1.

Dale