Forum Discussion
albert_forster_
Nimbostratus
Feb 02, 2005persistence with rtsp
we are trying to enable persistence based on a universal persistence profile using an irule for rtsp connections.
we have multiple helix servers installed and when accessing video streams via the real player we want connections to persist to one of the helix servers as long as the chanel-set-id specified in the rtsp uri stays the same.
in the real player we are using for instance this uri:
rtsp://158.226.219.222:554/africag2/giraffe-2sm.jpg?CHSETID=45&xyz=martin
... and the irule we defined looks like this:
when HTTP_REQUEST {
set rtsp_chsid [findstr [HTTP::query] "CHSETID=" 0 "&"]
set rtsp_uri [HTTP::uri]
log "Found ChanelSetID $rtsp_chsid in request!!!"
log "Found RTSP uri from query = $rtsp_uri"
findstr [HTTP::query] "CHSETID=" 0 "&"
}
the log entries show, that the irule sometimes finds the chanel-set-id in the rtsp-request, but that there are also rtsp-requests belonging to this session, which do not include the chanel-set-id:
die durch diese irule erzeugten log-einträge:
ltm:Feb 1 17:27:46 tmm tmm[357]: 01220002:6: Rule _rtsp_persist_on_chanel_set_id : Found ChanelSetID in request!!!
ltm:Feb 1 17:27:47 tmm tmm[357]: 01220002:6: Rule _rtsp_persist_on_chanel_set_id : Found RTSP uri from query = /SmpDsBhgRl
ltm:Feb 1 17:27:47 tmm tmm[357]: 01220002:6: Rule _rtsp_persist_on_chanel_set_id : Found ChanelSetID CHSETID=45 in request!!!
ltm:Feb 1 17:27:47 tmm tmm[357]: 01220002:6: Rule _rtsp_persist_on_chanel_set_id : Found RTSP uri from query = /SmpDsBhgRlce6cdda9-8a50-4c26-a2f3-83b059a0fcde
ltm:Feb 1 17:28:06 tmm tmm[357]: 01220002:6: Rule _rtsp_persist_on_chanel_set_id : Found ChanelSetID in request!!!
ltm:Feb 1 17:28:06 tmm tmm[357]: 01220002:6: Rule _rtsp_persist_on_chanel_set_id : Found RTSP uri from query = rtsp://158.226.219.222:554
ltm:Feb 1 17:31:04 tmm tmm[357]: 01220002:6: Rule _rtsp_persist_on_chanel_set_id : Found ChanelSetID in request!!!
ltm:Feb 1 17:31:04 tmm tmm[357]: 01220002:6: Rule _rtsp_persist_on_chanel_set_id : Found RTSP uri from query = rtsp://158.226.219.222:554
ltm:Feb 1 17:31:24 tmm tmm[357]: 01220002:6: Rule _rtsp_persist_on_chanel_set_id : Found ChanelSetID in request!!!
ltm:Feb 1 17:31:24 tmm tmm[357]: 01220002:6: Rule _rtsp_persist_on_chanel_set_id : Found RTSP uri from query = /SmpDsBhgRl
ltm:Feb 1 17:31:24 tmm tmm[357]: 01220002:6: Rule _rtsp_persist_on_chanel_set_id : Found ChanelSetID CHSETID=45 in request!!!
ltm:Feb 1 17:31:24 tmm tmm[357]: 01220002:6: Rule _rtsp_persist_on_chanel_set_id : Found RTSP uri from query = /SmpDsBhgRl1ff70c47-f05c-4c83-b73f-fd914257b080
... therefore requests from this single rtsp session are distributed to multiple helix servers (as seen in the pool statistics), and the real player fails to play the video stream.
so finally our question is: is this kind of rtsp-session-persistence possible with irules and how can it be configured?
additional info: we traced the rtsp stream on the helix server with and without the loadbalancer and the rtsp packages seem to be modified by the loadbalancer (no rtsp methods are visible and the video stream file which should be played is not contained in the rtsp uri, but in an rtsp continuation package).
is there any possibility to disable this modification of the rtsp packages by the loadbalancer?
kind regards,
albert
- Mark_Crosland_1Historic F5 AccountReal-Networks can tunnel RTSP through HTTP. They use the URI /SmpDsBhgRl to
when HTTP_REQUEST { set decode_rtsp 0 if { [HTTP::method] eq "POST" && [HTTP::uri] eq "/SmpDsBhgRl" } { if { [HTTP::header exists "Content-Length"] } { set clen [HTTP::header value "Content-Length"] if { $clen == 32767 } { force multi-post mode, 32767 bytes are never sent HTTP::collect $clen or just collect the session ID, however, the player may choose to go into multi-post mode anyway HTTP::collect 36 } else { set decode_rtsp 1 HTTP::collect $clen } } } elseif { [HTTP::method] eq "GET" } { set uri [HTTP::uri] if { [string compare -length 11 "/SmpDsBhgRl" $uri] == 0 } { set session_id [string range $uri 11 end] persist universal $session_id } } } when HTTP_REQUEST_DATA { set content [HTTP::payload] set session_id [string range $content 0 35] set decode_idx [expr $clen - 2] persist universal $session_id if { $decode_rtsp } { set rtsp_request [b64decode [string range $content 38 $decode_idx]] if { [string compare -length 8 $rtsp_request "DESCRIBE"] == 0 } { set end_of_uri [string first " RTSP/1.0" $rtsp_request] set uri [string range $rtsp_request 9 $end_of_uri] now you can dig into the "real" URI to load balance to specific nodes based on the presentation or to persist } set decode_rtsp 0 } HTTP::release }
- albert_forster_
Nimbostratus
hello, - Mark_Crosland_1Historic F5 AccountIdeally you would like the transport to be UDP based. The client advertises one or more ports to the server and the server selects its own port set. The RTSP control channel remains for the duration of the presentation, but the audio/video is streamed over UDP using the ports selected by the client and server. Port holes need to be opened in the BigIP for this to work. Depending on where you clients are you may encounter firewall issues with this configuration. The BigIP does not currently support this. Native support for RTSP was completed recently but has not been released yet.
- marlon_Gino-gi1
Nimbostratus
thanks for the info
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects