Subject: [Sip] To-tag in CANCEL response

From: Tonny Kung <[email-masked]>
Date: Tue, 11 Dec 2007 00:24:13 +0800 (CST)

Hi,

I'm a bit confused about which is the correct behavior for the CANCEL response handling with regard to the To-tag. There seems to be contradiction between RFC3261 and RFC3665. 

Here's the scenario: (as stated in RFC3665, section: 3.8)

   Alice           Proxy 1          Proxy 2            Bob
     |                |                |                |
     |   INVITE F1    |                |                |
     |--------------->|   INVITE F2    |                |
     |     100  F3    |--------------->|   INVITE F4    |
     |<---------------|     100  F5    |--------------->|
     |                |<---------------|                |
     |                |                |      180 F6    |
     |                |     180 F7     |<---------------|
     |     180 F8     |<---------------|                |
     |<---------------|                |                |
     |   CANCEL F9    |                |                |
     |--------------->|                |                |
     |     200 F10    |                |                |
     |<---------------|   CANCEL F11   |                |
     |                |--------------->|                |
     |                |     200 F12    |                |
     |                |<---------------|                |
     |                |                |   CANCEL F13   |
     |                |                |--------------->|
     |                |                |     200 F14    |
     |                |                |<---------------|
     |                |                |     487 F15    |
     |                |                |<---------------|
     |                |                |     ACK F16    |
     |                |     487 F17    |--------------->|
     |                |<---------------|                |
     |                |     ACK F18    |                |
     |     487 F19    |--------------->|                |
     |<---------------|                |                |
     |     ACK F20    |                |                |
     |--------------->|                |                |
     |                |                |                |

Questions:

1) All the 200 OK for the CANCEL responses do not contain any To-tags. But according to RFC3261 section 16.10, a stateful proxy should act as a UAS, which then require the response to have a To-tag. Isn't it?

2) Assume that CANCEL response should contain a To-tag, then what tag should it use? The same one as in the 180 response, which then should match the 487 response for INVITE as well?

3) If the proxy never received any provisional response, except for 100 trying, meaning it has not received any To-tag, then when it received the CANCEL request, should it generate a local To-tag in the response? 

4) And since RFC3261 only stated that the To-tag in the CANCEL response SHOULD, not MUST, matches the one in the 487 response, I suppose it is OK to pass the 487 response from the UAS (Bob) towards the UAC (Alice) without changing the To-tag to match the one in the CANCEL response?

Hope someone could clarify it. Thanks for your time.

Best Regards,
Tonny

---------------------------------
Yahoo! 網上安全攻略，教你如何防範黑客! 了解更多

_______________________________________________
Sip mailing list  https://www1.ietf.org/mailman/listinfo/sip
This list is for NEW development of the core SIP Protocol
Use [email-masked] for questions on current sip
Use [email-masked] for new developments on the application of sip

---

From: Bob Penfield <[email-masked]>
Date: Tue, 11 Dec 2007 08:23:43 -0500

> 1) All the 200 OK for the CANCEL responses do not contain
> any To-tags. But according to RFC3261 section 16.10, a
> stateful proxy should act as a UAS, which then require
> the response to have a To-tag. Isn't it?

This is an error in RFC 3665. All final responses must have to-tag.

> 2) Assume that CANCEL response should contain a To-tag, then
> what tag should it use? The same one as in the 180 response,
> which then should match the 487 response for INVITE as well?

The UAS should use the same to-tag for the 200-OK to the CANCEL that it used in the 180, and that same to-tag should be used in the 487 response for the INVITE. As it says in section 9.2 of RFC 3261 :

   ....the UAS answers the CANCEL
   request itself with a 200 (OK) response.  This response is
   constructed following the procedures described in Section 8.2.6
   noting that the To tag of the response to the CANCEL and the To tag
   in the response to the original request SHOULD be the same.

>3) If the proxy never received any provisional response,
> except for 100 trying, meaning it has not received any To-tag,
> then when it received the CANCEL request, should it generate
> a local To-tag in the response?

Yes. The CANCEL is hop-by-hop and each proxy is responding as a UAS, so it generates its own to-tag. If it previously forwarded a 1xx response with a to-tag, it may use that to-tag.

> 4) And since RFC3261 only stated that the To-tag in the CANCEL
> response SHOULD,  not MUST, matches the one in the 487 response,
> I suppose it is OK to pass the 487 response from the UAS (Bob)
> towards the UAC (Alice) without changing the To-tag to match
> the one in the CANCEL response?

Yes. Proxies should not change the to-tag in a response it is proxies back toward the UAC (see page 110 of RFC 3261).