Forum Discussion

Democritus_Per1's avatar
Icon for Nimbostratus rankNimbostratus
Jul 12, 2012

hash persistence on an irule manipulating ICAP headers

Hello all,



I have a Virtual server managing ICAP traffic and I need to set up hash persistence profile using an irule that it would examine the ICAP header .



I found some references that the plain HTTP request handling in irules can also handle ICAP requests , so I wonder is this indeed the case ?




irule proposed





rule VO_persist_irule {


when HTTP_REQUEST { persist hash [HTTP::header X-SESSION_ID] }







ICAP request send to the VS





RESPMOD icap:// ICAP/1.0



Allow: 204












Encapsulated: req-hdr=0, res-hdr=922, res-body=1297





GET,itag,source,uaopt,upn,ip,ipbits,expire&signature=3A6F6EE214D5863B816C3F72F106D4CA3EEFA2CD.4157E77D898CA2BEB684C2C1A1C129D41DA77D31&key=yta1&ms=au&mt=1340176212&cms_redirect=yes HTTP/1.1






User-Agent: AppleCoreMedia/ (iPhone; U; CPU OS 5_1_1 like Mac OS X; en_us)



Accept: */*



Range: bytes=0-1



Accept-Encoding: identity



X-Playback-Session-Id: 49DDB675-70DE-4EEA-A01D-E0B891DD4509



Cookie: PREF=f1=50000000&fms2=10000&fms1=210000;VISITOR_INFO1_LIVE=rOudgJlgDno;network-access-type=GPRS;Bearer-Type=w-TCP



WAP-Connection: Stack-Type=HTTP





HTTP/1.1 206 Partial Content



Last-Modified: Thu, 19 Jan 2012 10:12:32 GMT



Content-Type: video/mp4



Date: Wed, 20 Jun 2012 07:13:39 GMT



Expires: Wed, 20 Jun 2012 15:05:26 GMT



Cache-Control: public, max-age=28307



Content-Range: bytes 0-1/76737203



Accept-Ranges: bytes



Content-Length: 2



X-User-Agent-Options: no-save



X-Content-Type-Options: nosniff



Server: gvs 1.0











0; ieof




Thanks in advence


2 Replies

  • i am not much familiar with icap. anyway, i think it looks okay to me.

    this is my testing.

    [root@ve10:Active] config  b virtual bar list
    virtual bar {
       snat automap
       pool foo
       ip protocol 6
       rules myrule
       profiles {
          http {}
          tcp {}
    [root@ve10:Active] config  b pool foo list
    pool foo {
       members {}
    [root@ve10:Active] config  b rule myrule list
    rule myrule {
       when HTTP_REQUEST {
       log local0. "\[HTTP::header X-SESSION_ID\]: [HTTP::header X-SESSION_ID]"
       persist hash [HTTP::header X-SESSION_ID]
    [root@ve10:Active] config  ssldump -Aed -nni 0.0 port 80
    New TCP connection 1: <->
    1342082781.0825 (0.0017)  C>S
    REQMOD icap:// ICAP/1.0
    User-Agent: C-ICAP-Client-Library/0.01
    Encapsulated: req-hdr=0, null-body=91
    1342082781.0825 (0.0000)  C>S
    GET /something HTTP/1.0
    Date: Thu Jul 12 16:49:06 2012
    User-Agent: C-ICAP-Client/x.xx
    [root@ve10:Active] config  b persist show all
    |     Mode hash   Value 2790347781
    |        virtual   node   age 19sec
    [root@ve10:Active] config  tail /var/log/ltm
    Jul 12 16:46:21 local/tmm info tmm[5111]: Rule myrule : [HTTP::header X-SESSION_ID]:
  • Hello ,



    Thanks for your response!!!!



    I had the chance today to apply the persistency onsite . Unfortunatelly this does not work , and the reason is the HTTP profile that the hash persistency requires.



    What I noticed in traces is that when I set HTTP profile in the Virtual server then the VS does not forward the full ICAP request in the pool member as seen bellow .



    Any idea how we can overcome that ? any other type of persistency that might be more appropriate fro ICAP VS?





    Request to the virtual server:




    RESPMOD icap:// ICAP/1.0



    Allow: 204












    Encapsulated: req-hdr=0, res-hdr=1542, res-body=1847





    GET HTTP/1.1






    User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11



    Accept: */*






    Accept-Encoding: gzip,deflate,sdch



    Accept-Language: el-GR,el;q=0.8



    Accept-Charset: ISO-8859-7,utf-8;q=0.7,*;q=0.3



    Cookie: use_hitbox=d5c5516c3379125f43aa0d495d100d6ddAEAAAAw;VISITOR_INFO1_LIVE=M3W-DPQu69I;s_gl=cdd678c14681ca9039b4afb15fd9b89ecwIAAABHUg==;recently_watched_video_id_list=23d8d946c93920f301a6aa6887c3c313WwMAAABzCwAAADlSV3ZHWXNVRGVjcwsAAAB6UFktRW8yWE1qc3MLAAAAYzJnXzB3aF9SdUE=;PREF=f1=50000000&gl=GR&fv=11.3.300;ACTIVITY=1343123534220;network-access-type=GPRS;Bearer-Type=w-TCP



    WAP-Connection: Stack-Type=HTTP



    Request to the pool member:





    RESPMOD icap:// ICAP/1.0



    Allow: 204












    Encapsulated: req-hdr=0, res-hdr=1542, res-body=1847