<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc='yes'?>
<?rfc tocdepth='4'?>
<?rfc compact="yes"?>
<rfc category="info" ipr="trust200902" docName='draft-kyzivat-clue-telemedical-callflow-02'>
	<front>
		<title abbrev="CLUE Telemedical Use Case Callflow">
		    CLUE Telemedical Use Case Callflow
		</title>
		<author initials="P." surname="Kyzivat" fullname="Paul H. Kyzivat">
			<organization>Huawei</organization>
			<address>
				<email>pkyzivat@alum.mit.edu</email>
			</address>
		</author>
		<date/>
		<area>RAI</area>
		<workgroup>CLUE</workgroup>
		<abstract>
			<t>
This is the beginning of an example call flow for an instantiation of the use case 
described in <xref target="I-D.xiao-clue-telemedical-use-case">the telemedical use case</xref>.
More detail will be added later.
			</t>
		</abstract>
	</front>

	<middle>
		<section title="Introduction">
			<t>
This is a first cut at the call flow. So far it only includes the ladder diagram showing the exchange of SIP and CLUE messages.
The content of those messages will be added later. 
Before doing that it will be useful to agree on at least one acceptable sequence of messages to realize this use case.
			</t>
			<t>
			</t>
			<t>
			</t>
			<t>
			</t>
		</section>

		<section title="Scenario being illustrated">
			<t>
The case considered here consists of one surgery room, one remote expert, and one remote classroom, connected by an MCU.
The classroom connects first and waits until the surgery begins. 
The surgery room connects second. At that point the classroom and surgery are joined by the MCU.
The expert joins last.
			</t>
		</section>

		<section title="Proposed Relationship of O/A to CLUE messages">
		    <t>
The call flow is constructed in accord with this proposed approach for ordering messages.
		    </t>
                    <t><list style='symbols'>
			<t>
What media is sent at any time is determined by the most recently received valid config message, constrained by most recent O/A.
                      <list style='symbols'>
			<t>
When constraint is bandwidth, sender decides what to drop.
			</t>
			<t>
A new O/A can make it possible to send more (or less) of the current config.
			</t>
                      </list>
			</t>
			<t>
An O/A should be consistent with the most recent advertisement in each direction. 
                      <list style='symbols'>
			<t>
This gives context to understand why to accept what is offered.
(The answerer has no motivation to accept things that aren’t.)
			</t>
                      </list>
			</t>
			<t>
A config message always explicitly refers to an advertisement.
                      <list style='symbols'>
			<t>
It is invalid, and will be rejected, if it doesn't refer to the most recently sent advertisement.
(This implies there is a message to NACK a config msg.)
			</t>
                      </list>
			</t>
			<t>
Typically the endpoint that sends the config message makes an offer to enable it.
                      <list style='symbols'>
			<t>
This end is the first to know what is needed to support the config.
			</t>
			<t>
It is also the end that cares.
			</t>
			<t>
Can be before or after the config, or both.
			</t>
			<t>
Must accommodate the most recent config received from the other side.
			</t>
			<t>
But either side may send an O/A at any time for whatever reason, 
or may send an offerless INVITE to solicit an offer. (This is basic SIP.)
			</t>
                      </list>
			</t>
			<t>
Require a config message in response to each advertisement.
                      <list style='symbols'>
			<t>
Ensures no need for continued support of old advertisement.
			</t>
			<t>
Until a new config is received, sender of the advertisement may 
cease sending media that aren’t consistent with the new advertisement.
			</t>
                      </list>
			</t>
			<t>
During call major changes requiring O/A will typically happen independently at each endpoint.
                      <list style='symbols'>
			<t>
But at start of call there will be an exchange of advertisements and configs. 
			</t>
			<t>
We want to avoid unnecessary O/As in this case.
			</t>
                      </list>
			</t>
			<t>
If receive an advertisement after sending one, before receiving a config:
                      <list style='symbols'>
			<t>
Should send config before initiating O/A.
			</t>
			<t>
If receive offer before sending one, it will typically be sufficient to accommodate your config. 
			</t>
			<t>
If so, won’t need to initiate another O/A.
			</t>
			<t>
There may still be glare at SIP level. Use standard SIP remedies for that. 
			</t>
			<t>
If so, the O/A that glared may not need to be retried.
			</t>
                      </list>
			</t>
			<t>
First O/A of session occurs before any advertisements or configurations.
                      <list style='symbols'>
			<t>
Must include the CLUE channel.
			</t>
			<t>
Everything else is speculative until advertisements are exchanged.
			</t>
			<t>
May be best guess at what is needed, or placeholder intended to maximize interop with arbitrary devices.
			</t>
			<t>
Before the first config is received,  there should be at most a single capture, chosen by sender, per RTP session.
			</t>
                      </list>
			</t>
                    </list></t>
		</section>

		<section title="Ladder Diagram">
<!-- source for ladder diagram
# 
opt/columnPitch/15
opt/linePitch/3
opt/picXsize/5
opt/picYSize/5

guy/s/Surgery
guy/m/MCU
guy/e/Expert
guy/c/Classroom

# Surgery connect
#
note/c/(1)
s->m/INVITE^(offer basic^ audio&video&clue channels)
m->s/200 OK
s..m/basic audio
s..m/basic video
s..m/CLUE channel
s->m/Advertisement
m->s/Advertisement^(Startup capture)
m->s/Configure^("empty" - request nothing)
s->m/Configure
s->m/INVITE^(to cover both configurations)
m->s/200 OK
s..m/startup audio
s..m/startup video
s..m/CLUE channel

# Expert connect
#
note/c/(2)
e->m/INVITE^(offer basic^ audio&video&clue channels)
m->e/200 OK
e..m/basic audio
e..m/basic video
e..m/CLUE channel
e->m/Advertisement
# (forward adv to surgery)
m->s/Advertisement^(from expert)
m->e/Advertisement^(from surgery)
s->m/INVITE^(prep for config)
e->m/INVITE^(prep for config)
m->s/200 OK
m->e/200 OK
s->m/Configure^(accept^ expert input)
e->m/Configure^(accept input^ from surgery)
s..m/video from expert
s..m/audio from expert
e..m/video from surgery
e..m/audio from surgery
note/s/(with luck maybe we don't need^ another OA for the reverse flow)
m->e/Configure^(from surgery)
m->s/Configure^(from expert)
s..m/2-way video
s..m/2-way audio
e..m/2-way video
e..m/2-way audio

# Classroom connect
#
note/c/(3)
c->m/INVITE^(offer basic^ audio&video&clue channels)
m->c/200 OK
c..m/basic audio
c..m/basic video
c..m/CLUE channel
c->m/Advertisement
m->c/Advertisement^(surgery+expert)
m->c/Configure^("empty" - request nothing)
c->m/INVITE^(prep for config)
m->c/200 OK
c->m/Configure^(accept surgery+expert)
c..m/video from surgery & expert
c..m/audio from surgery & expert
note/c/(4)
note/s/Surgery & expert don't see classroom^for now assume MCU enforces this by^not advertising classroom to them.
-->
			<figure>
				<artwork><![CDATA[
       Surgery          MCU          Expert        Classroom
          |              |              |              |
          |              |              |              |
          |              |              |              |
          |              |              |              |(1)
          |              |              |              |
          |INVITE        |              |              |
          |(offer basic  |              |              |
          | audio&video&clue channels)  |              |
          |------------->|              |              |
          |              |              |              |
          |200 OK        |              |              |
          |<-------------|              |              |
          |              |              |              |
          |basic audio   |              |              |
          |..............|              |              |
          |              |              |              |
          |basic video   |              |              |
          |..............|              |              |
          |              |              |              |
          |CLUE channel  |              |              |
          |..............|              |              |
          |              |              |              |
          |Advertisement |              |              |
          |------------->|              |              |
          |Advertisement |              |              |
          |(Startup capture)            |              |
          |<-------------|              |              |
          |Configure     |              |              |
          |("empty" - request nothing)  |              |
          |<-------------|              |              |
          |              |              |              |
          |Configure     |              |              |
          |------------->|              |              |
          |INVITE        |              |              |
          |(to cover both configurations)              |
          |------------->|              |              |
          |              |              |              |
          |200 OK        |              |              |
          |<-------------|              |              |
          |              |              |              |
          |startup audio |              |              |
          |..............|              |              |
          |              |              |              |
          |startup video |              |              |
          |..............|              |              |
          |              |              |              |
          |CLUE channel  |              |              |
          |..............|              |              |
          |              |              |              |
          |              |              |              |(2)
          |              |              |              |
          |              |INVITE        |              |
          |              |(offer basic  |              |
          |              | audio&video&clue channels)  |
          |              |<-------------|              |
          |              |              |              |
          |              |200 OK        |              |
          |              |------------->|              |
          |              |              |              |
          |              |basic audio   |              |
          |              |..............|              |
          |              |              |              |
          |              |basic video   |              |
          |              |..............|              |
          |              |              |              |
          |              |CLUE channel  |              |
          |              |..............|              |
          |              |              |              |
          |              |Advertisement |              |
          |              |<-------------|              |
          |Advertisement |              |              |
          |(from expert) |              |              |
          |<-------------|              |              |
          |              |Advertisement |              |
          |              |(from surgery)|              |
          |              |------------->|              |
          |INVITE        |              |              |
          |(prep for config)            |              |
          |------------->|              |              |
          |              |INVITE        |              |
          |              |(prep for config)            |
          |              |<-------------|              |
          |              |              |              |
          |200 OK        |              |              |
          |<-------------|              |              |
          |              |              |              |
          |              |200 OK        |              |
          |              |------------->|              |
          |Configure     |              |              |
          |(accept       |              |              |
          | expert input)|              |              |
          |------------->|              |              |
          |              |Configure     |              |
          |              |(accept input |              |
          |              | from surgery)|              |
          |              |<-------------|              |
          |              |              |              |
          |video from expert            |              |
          |..............|              |              |
          |              |              |              |
          |audio from expert            |              |
          |..............|              |              |
          |              |              |              |
          |              |video from surgery           |
          |              |..............|              |
          |              |              |              |
          |              |audio from surgery           |
          |              |..............|              |
          |(with luck maybe we don't need              |
          | another OA for the reverse flow)           |
          |              |              |              |
          |              |Configure     |              |
          |              |(from surgery)|              |
          |              |------------->|              |
          |Configure     |              |              |
          |(from expert) |              |              |
          |<-------------|              |              |
          |              |              |              |
          |2-way video   |              |              |
          |..............|              |              |
          |              |              |              |
          |2-way audio   |              |              |
          |..............|              |              |
          |              |              |              |
          |              |2-way video   |              |
          |              |..............|              |
          |              |              |              |
          |              |2-way audio   |              |
          |              |..............|              |
          |              |              |              |
          |              |              |              |(3)
          |              |              |              |
          |              |INVITE        |              |
          |              |(offer basic  |              |
          |              | audio&video&clue channels)  |
          |              |<----------------------------|
          |              |              |              |
          |              |200 OK        |              |
          |              |---------------------------->|
          |              |              |              |
          |              |basic audio   |              |
          |              |.............................|
          |              |              |              |
          |              |basic video   |              |
          |              |.............................|
          |              |              |              |
          |              |CLUE channel  |              |
          |              |.............................|
          |              |              |              |
          |              |Advertisement |              |
          |              |<----------------------------|
          |              |Advertisement |              |
          |              |(surgery+expert)             |
          |              |---------------------------->|
          |              |Configure     |              |
          |              |("empty" - request nothing)  |
          |              |---------------------------->|
          |              |INVITE        |              |
          |              |(prep for config)            |
          |              |<----------------------------|
          |              |              |              |
          |              |200 OK        |              |
          |              |---------------------------->|
          |              |Configure     |              |
          |              |(accept surgery+expert)      |
          |              |<----------------------------|
          |              |              |              |
          |              |video from surgery & expert  |
          |              |.............................|
          |              |              |              |
          |              |audio from surgery & expert  |
          |              |.............................|
          |              |              |              |
          |              |              |              |(4)
          |              |              |              |
          |Surgery & expert don't see classroom        |
          |for now assume MCU enforces this by         |
          |not advertising classroom to them.          |
          |              |              |              |
          |              |              |              |
          |              |              |              |
          |              |              |              |
				]]></artwork>
			</figure>
			<section title="Comments">
				<t>
There are some issues with the ladder diagram above due to the tool I've used to generate it.
The CLUE messages are shown with "--->" rather than "...>" because the tool can't do the latter.
				</t>
			</section>

		</section>
		<section title="Message Bodies">
<t>TBS</t>
		</section>

		<section title="TO-DO list">
			<t><list style='symbols'>
				<t>
Reference <xref target="I-D.westerlund-avtcore-max-ssrc"/> in the
initial offer proposing how many RTP streams can be sent and received
simultaneously in the offered RTP session.
<vspace blankLines='1' />
For example the offerer can send up to 6 RTP streams and receive up to 4.
This will help with providing a better advertisements from both sides:
<figure><artwork>
     m=video 49200 RTP/AVP 99
     a=rtpmap:99 H264/90000
     a=max-send-ssrc:{*:6}
     a=max-recv-ssrc:{*:4}
</artwork></figure>
				</t>
			</list></t>
		</section>

		<section title="Change Log">
			<t><list style='numbers'>
				<t>
Captured suggestion from Roni in a TODO list for later.
And made a number of adjustments/cleanups to the diagram.
Incorporated a comment from Espen for the
MCU to send "empty" configuration initially, and about a missing config message.
	<vspace blankLines='1' />
Reworked to incorporate and follow the approach I proposed on the first day of the interim.
				</t>
			</list></t>
		</section>

		<section title="Security Considerations" anchor="security_considerations">
			<t>
TBS
			</t>
		</section>
		<section title="IANA Considerations" anchor="iana_considerations">
			<t>
This specification ha no IANA considerations
			</t>
		</section>
	</middle>
	<back>
		<references title="Normative References">
                   <?rfc include="reference.RFC.3261"?>
                   <?rfc include="reference.I-D.xiao-clue-telemedical-use-case"?>
                   <?rfc include="reference.I-D.westerlund-avtcore-max-ssrc"?>
		</references>
<!--
		<references title="Informative References">
		</references>
-->
	</back>
</rfc>
