Forum Discussion

Democritus_Per1's avatar
Democritus_Per1
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://10.11.1.20:1344/df ICAP/1.0

 

 

Allow: 204

 

 

Host: 10.11.1.20

 

 

X-SESSION_ID: 10.20.44.245:1340175464

 

 

Preview:64

 

 

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

 

 

 

 

GET http://o-o.preferred.oteglobe-ath1.v17.lscache7.c.youtube.com/videoplayback?id=e79e4c664668a8b5&itag=22&source=youtube&uaopt=no-save&upn=1ndeeUZUw9c&el=related&client=ytapi-apple-iphone&devKey=AdW2Kh1KB1Jkhso4mAT4nHgO88HsQjpE1a8d1GxQnGDm&app=youtube_gdata&ip=0.0.0.0&ipbits=0&expire=1340205026&sparams=id,itag,source,uaopt,upn,ip,ipbits,expire&signature=3A6F6EE214D5863B816C3F72F106D4CA3EEFA2CD.4157E77D898CA2BEB684C2C1A1C129D41DA77D31&key=yta1&ms=au&mt=1340176212&cms_redirect=yes HTTP/1.1

 

 

Host: o-o.preferred.oteglobe-ath1.v17.lscache7.c.youtube.com

 

 

User-Agent: AppleCoreMedia/1.0.0.9B206 (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

 

 

 

 

2

 

 

..

 

 

0; ieof

 

 

 

Thanks in advence

 

  • 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
       destination 172.28.19.79:80
       ip protocol 6
       rules myrule
       profiles {
          http {}
          tcp {}
       }
    }
    [root@ve10:Active] config  b pool foo list
    pool foo {
       members 200.200.200.101:80 {}
    }
    [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: 172.28.19.251(37119) <-> 172.28.19.79(80)
    1342082781.0825 (0.0017)  C>S
    ---------------------------------------------------------------
    REQMOD icap://172.28.19.79/echo ICAP/1.0
    Host: 172.28.19.79
    User-Agent: C-ICAP-Client-Library/0.01
    X-SESSION_ID: 10.20.44.245:1340175464
    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
    PERSISTENT CONNECTIONS
    |     Mode hash   Value 2790347781
    |        virtual 172.28.19.79:80   node 200.200.200.101:80   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]: 10.20.44.245:1340175464
    
  • 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://10.11.1.20:1344/df ICAP/1.0

     

     

    Allow: 204

     

     

    Host: 10.11.1.20

     

     

    X-SESSION_ID: 10.20.44.246:1343123074

     

     

    Preview:64

     

     

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

     

     

     

     

    GET http://o-o---preferred---fra02s07---v15---nonxt5.c.youtube.com/videoplayback?algorithm=throttle-factor&burst=40&cp=U0hTSFFPVV9GUENOM19JSVlDOk8yVi1DTVF4NjhL&expire=1343147216&factor=1.25&fexp=908920%2C914021%2C910006%2C915507%2C907217%2C907335%2C921602%2C922600%2C919804%2C920704%2C924500%2C906831%2C924700%2C913547%2C920706%2C924402%2C907344%2C912706%2C902518&id=f515af198b140de7&ip=94.143.176.171&ipbits=8&itag=34&keepalive=yes&key=yt1&ms=nxu&mt=1343123705&mv=m&range=28508160-30289919&signature=04D92E3034C125DEF38291D9CD616073B3C3DD1C.BBAD00D6C78231975972E7BF2A1B6AD8ED15FA16&source=youtube&sparams=algorithm%2Cburst%2Ccp%2Cfactor%2Cid%2Cip%2Cipbits%2Citag%2Csource%2Cupn%2Cexpire&sver=3&upn=HMWsWx6E_iU&redirect_counter=1&cms_redirect=yes HTTP/1.1

     

     

    Host: o-o---preferred---fra02s07---v15---nonxt5.c.youtube.com

     

     

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

     

     

    Accept: */*

     

     

    Referer: http://s.ytimg.com/yt/swfbin/watch_as3-vflohUKhE.swf

     

     

    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://10.11.1.20:1344/df ICAP/1.0

     

     

    Allow: 204

     

     

    Host: 10.11.1.20

     

     

    X-SESSION_ID: 10.20.44.246:1343123074

     

     

    Preview:64

     

     

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