Subject: [AVT] SSRC in SRTP

From: Victor Semanic <[email-masked]>
Date: Mon, 15 Jun 2009 07:03:12 -0700 (PDT)

Hello:

SRTP says that a cryptographic context is uniquely
identified by the tuple
{SSRC, destination network address, destination port}.

Given this, assume that an SRTP stack has been primed
with the master key, salt, and other parameters except
SSRC through the key management protocol, and the
sender is ready to send the very first SRTP packet.

When a sender sends the very first packet, RFC 3711 says
that the sender determines which cryptographic context
to use.  Since this is the first packet, the sender
uses *it's* SSRC, destination network address and
destination port and creates a cryptographic context.
Let's assume that the sender's SSRC is 0x2ab6,
destination address is IP-B and destination port is
PORT-B.  So, the cryptographic context for the
sender is:

  {0x2ab6, IP-B, PORT-B}

The packet is then encrypted and transmitted to the
recipient.  Do I have it right so far?

When the recipient receives the SRTP packet, it proceeds
to decrypt it.  RFC 3711 says that the receipient shall
first determine which cryptographic context is to be
used.  As before, the cryptographic context is:

{SSRC, destination network address, destination port}

But here's where I have a doubt: I presume that the
destination network address and destination port are
retrieved from the IP header (i.e., they correspond to
the receiving host IP address and receiving host port -- IP-B
and PORT-B, respectively.)  And the SSRC is obtained
from the SRTP header (is that right?)  So, the cryptographic 
context for the recipient is the same as that of the 
sender, namely:

   {0x2ab6, IP-B, PORT-B}

Am I correct?  Can someone please confirm this.
Assuming this is so, then when the recipient prepares to
send the first SRTP packet to its peer (IP-A, PORT-A),
it will create a new cryptographic context by deriving a
SSRC (0x67af) and using IP-A, PORT-A in the tuple:

   {0x67af, IP-A, PORT-A}

Similarly, when the peer receives the SRTP packet, it will
create a new cryptographic context consisting of the same
tuple.

So for each participant, there are two cryptographic contexts:
one to send and one to receive.  Am I correct?  I will
appreciate if someone can confirm this or help me understand
where I am in error.

Thank you.