Forum Discussion

kuhn_52743's avatar
kuhn_52743
Icon for Nimbostratus rankNimbostratus
Jul 21, 2009

RTSP/TCP connection merging

Hello,

 

 

I am new to iRules and want to know if it is possible to do something like this:

 

 

 

I have a pool member that is a media streaming server, so clients usually connect to it using RTSP over TCP to establish streaming sessions.

 

 

What I want to do is have a client connect as usual, but have a separate client (which may or may not be on the same host) connect on a separate TCP connection. This second client wants to issue commands to control the RTSP session that was opened by the first client. The server doesn't support this - it needs to view everything over a single RTSP/TCP connection.

 

 

Wondering if I can write an iRule to "merge" the two client side RTSP/TCP connections, into a single server side connection. So if either client sends an RTSP command, it would get forwarded on to the server using a shared server side TCP connection. When the server responded, the iRule would have to "route" the response to the correct client side connection.

 

 

The two clients could be assumed to use a common session id in the RTSP urls, so the iRule would be able to parse the URL to make the association between the two clients (in other words, to know that those two client connections need to get merged to the same server side connection.)

 

 

Anybody ever do anything similar to this?

2 Replies

  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    That sounds pretty complex, more on sorting out the logic of when to actually forward all information to one connection vs. only forwarding some information than on actually executing on that logic.

     

     

    So it would look something like:

     

     

     

    client1 opens connection1 with server1 and waits (or begins streaming data)

     

     

    client2 opens connection2 and sends commands to the server client1 is already connected to (server1).

     

     

    server1 responds to client2 with the appropriate data (new streaming content, listings, whatever)

     

     

    Here you want to send the data from server1 bound for client2 to client1 via connection1, as well.

     

     

    Does that sound vaguely correct?

     

     

    Colin
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    If all you're looking for is to multiplex to the back end, then all you'd really need to do is turn on OneConnect. OneConnect holds open and re-uses connections made to the back end servers while managing new connections to the clients as they connect, to cut down on TCP overhead for the servers.

     

     

    Combine that with some persistence based on the session id that's being passed, so you make sure you have the right client going to the right server, and you'd be most of the way there, I think.

     

     

    It would warrant some testing, for sure, because you're not forcing a single connection via coded in logic. With the way oneconnect works though, I think you'd be able to come pretty close to achieving what you're looking for with almost no crazy iRules coding at all, just a simple persist rule.

     

     

    Colin