<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Configuring cookie based sticky on ACE in Application Networking</title>
    <link>https://community.cisco.com/t5/application-networking/configuring-cookie-based-sticky-on-ace/m-p/1117686#M22902</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cookie values are learned dynamically by ACE and sticky entries are created.So you do not need to match cookie values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With Sticky group configuration you tell ACE which Cookie-name to look for in the HTTP traffic passing through ACE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So following should  be sufficient&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sticky http-cookie MYCOOKIE STICKYGroup&lt;/P&gt;&lt;P&gt;timeout 4&lt;/P&gt;&lt;P&gt;serverfarm SFARM1 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;policy-map type loadbalance first-match L7POLICY6&lt;/P&gt;&lt;P&gt;class class-default&lt;/P&gt;&lt;P&gt;sticky-serverfarm STICKYGroup &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lets assume your Server1 is setting cookie value 123456 by using "SET-Cookie:MYCOOKIE=123456" &amp;amp; Server2 is sending ""SET-Cookie:MYCOOKIE=56789" the flow will be as follows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. If a new client hits the VIP on ACE with no cookie set then ACE will select a Sever from the server farm as per the LB algo and forward the HTTP request to the selected server. Lets suppose ACE selects Server1.&lt;/P&gt;&lt;P&gt;3. Server1 will send "SET-Cookie:MYCOOKIE=123456" in the HTTP response to the client.&lt;/P&gt;&lt;P&gt;4. ACE on getting this response from Server1 will dynamically learn that Server1 is setting up cookie value 123456 and will create a sticky entry in the database.&lt;/P&gt;&lt;P&gt;(Due to this sticky db entry any subsequent http requests with "Cookie:MYCOOKIE=123456" will be directly forwarded to Server1.&lt;/P&gt;&lt;P&gt;5. This sticky entry in ACE sticky DB will only time out if "timeout in minutes" configured under sticky group elapses and no active conns are using this entry.With every new http request matching the sticky entry this timeout is initialized.&lt;/P&gt;&lt;P&gt;6. If a new client come with no cookie set in the Http request then ACE will select a server using LB logic and will learn the cookie value  &amp;amp; will create appropriate sticky entry.&lt;/P&gt;&lt;P&gt;7. If a client sends a request with cookie value present then ACE will simply look into the sticky db and forward the request to the appropriate server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Syed Iftekhar Ahmed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Oct 2008 05:51:32 GMT</pubDate>
    <dc:creator>Syed Iftekhar Ahmed</dc:creator>
    <dc:date>2008-10-21T05:51:32Z</dc:date>
    <item>
      <title>Configuring cookie based sticky on ACE</title>
      <link>https://community.cisco.com/t5/application-networking/configuring-cookie-based-sticky-on-ace/m-p/1117683#M22899</link>
      <description>&lt;P&gt;I have an ACE and I am trying to setup stickiness based on HTTP cookies. My objective is to stick a client to one of the real servers in the server farm until the the cookie expires. I am using the same COOKIE name for all three servers but using different values that are unique to each server. On testing I discovered that each client request when stuck to the same real server always uses the same sticky database entry and a browser refresh updates the same entry...what am I doing wrong? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My config is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;context Admin&lt;/P&gt;&lt;P&gt;  member STICKY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;access-list ALL line 8 extended permit ip any any&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rserver host SERVER1&lt;/P&gt;&lt;P&gt;  description  content server 1&lt;/P&gt;&lt;P&gt;  ip address 134.178.51.17&lt;/P&gt;&lt;P&gt;  inservice&lt;/P&gt;&lt;P&gt;rserver host SERVER2&lt;/P&gt;&lt;P&gt;  description content server 2&lt;/P&gt;&lt;P&gt;  ip address 134.178.51.18&lt;/P&gt;&lt;P&gt;  inservice&lt;/P&gt;&lt;P&gt;rserver host SERVER3&lt;/P&gt;&lt;P&gt;  description content server 3&lt;/P&gt;&lt;P&gt;  ip address 134.178.51.19&lt;/P&gt;&lt;P&gt;  inservice&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;serverfarm host SFARM1&lt;/P&gt;&lt;P&gt;  predictor leastconns&lt;/P&gt;&lt;P&gt;  rserver SERVER1&lt;/P&gt;&lt;P&gt;    inservice&lt;/P&gt;&lt;P&gt;  rserver SERVER2&lt;/P&gt;&lt;P&gt;    inservice&lt;/P&gt;&lt;P&gt;  rserver SERVER3&lt;/P&gt;&lt;P&gt;    inservice&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sticky http-cookie MYCOOKIE STICKYGroup&lt;/P&gt;&lt;P&gt;  timeout 4&lt;/P&gt;&lt;P&gt;  serverfarm SFARM1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class-map type http loadbalance match-any L7CLASS6&lt;/P&gt;&lt;P&gt;  2 match http cookie MYCOOKIE cookie-value "123456"&lt;/P&gt;&lt;P&gt;  3 match http cookie MYCOOKIE cookie-value "56789"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;policy-map type loadbalance first-match L7POLICY6&lt;/P&gt;&lt;P&gt;  class L7CLASS6&lt;/P&gt;&lt;P&gt;    sticky-serverfarm STICKYGroup&lt;/P&gt;&lt;P&gt;  class class-default&lt;/P&gt;&lt;P&gt;    serverfarm SFARM1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class-map match-all V1L4VIPCLASS&lt;/P&gt;&lt;P&gt;  2 match virtual-address 134.178.51.10 tcp eq www&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;policy-map multi-match V1L4SLBPOLICY&lt;/P&gt;&lt;P&gt;  class V1L4VIPCLASS&lt;/P&gt;&lt;P&gt;    loadbalance vip inservice&lt;/P&gt;&lt;P&gt;    loadbalance policy L7POLICY6&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Oct 2008 03:50:36 GMT</pubDate>
      <guid>https://community.cisco.com/t5/application-networking/configuring-cookie-based-sticky-on-ace/m-p/1117683#M22899</guid>
      <dc:creator>b.athanasiadis</dc:creator>
      <dc:date>2008-10-21T03:50:36Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring cookie based sticky on ACE</title>
      <link>https://community.cisco.com/t5/application-networking/configuring-cookie-based-sticky-on-ace/m-p/1117684#M22900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I dont understand the reason for class-map L7CLASS6. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you are looking for can be achieved by Changing &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;policy-map type loadbalance first-match L7POLICY6&lt;/P&gt;&lt;P&gt;class L7CLASS6&lt;/P&gt;&lt;P&gt;sticky-serverfarm STICKYGroup&lt;/P&gt;&lt;P&gt;class class-default&lt;/P&gt;&lt;P&gt;serverfarm SFARM1 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;policy-map type loadbalance first-match L7POLICY6&lt;/P&gt;&lt;P&gt;class class-default&lt;/P&gt;&lt;P&gt;sticky-serverfarm STICKYGroup&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By default, the ACE ages out a sticky table entry when the timeout (In your case 4 minutes) for that entry expires and no active connections matching that entry exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; To specify that the ACE times out sticky table entries even if active connections exist after the sticky timer expires use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;timeout activeconns&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;command under sticky group definition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syed Iftekhar Ahmed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2008 04:32:53 GMT</pubDate>
      <guid>https://community.cisco.com/t5/application-networking/configuring-cookie-based-sticky-on-ace/m-p/1117684#M22900</guid>
      <dc:creator>Syed Iftekhar Ahmed</dc:creator>
      <dc:date>2008-10-21T04:32:53Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring cookie based sticky on ACE</title>
      <link>https://community.cisco.com/t5/application-networking/configuring-cookie-based-sticky-on-ace/m-p/1117685#M22901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Iftekhar, thanks for the response. What I am trying to do with the class map L7CLASS6 is to define a unique cookie value that is set by each of the servers - only two inservice at the moment. The cookie value "123456" is sent in the Set-Cookie message by server 2 for every client request and similarly "56789" is being sent by server 3. By doing this I thought that the ACE upon reading any subsequent requests from the client would forward the request to the server that set this value. Is my logic correct or should the cookie be unique for each and every request in which case how is each session tracked by the ACE?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2008 05:11:40 GMT</pubDate>
      <guid>https://community.cisco.com/t5/application-networking/configuring-cookie-based-sticky-on-ace/m-p/1117685#M22901</guid>
      <dc:creator>b.athanasiadis</dc:creator>
      <dc:date>2008-10-21T05:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring cookie based sticky on ACE</title>
      <link>https://community.cisco.com/t5/application-networking/configuring-cookie-based-sticky-on-ace/m-p/1117686#M22902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cookie values are learned dynamically by ACE and sticky entries are created.So you do not need to match cookie values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With Sticky group configuration you tell ACE which Cookie-name to look for in the HTTP traffic passing through ACE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So following should  be sufficient&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sticky http-cookie MYCOOKIE STICKYGroup&lt;/P&gt;&lt;P&gt;timeout 4&lt;/P&gt;&lt;P&gt;serverfarm SFARM1 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;policy-map type loadbalance first-match L7POLICY6&lt;/P&gt;&lt;P&gt;class class-default&lt;/P&gt;&lt;P&gt;sticky-serverfarm STICKYGroup &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lets assume your Server1 is setting cookie value 123456 by using "SET-Cookie:MYCOOKIE=123456" &amp;amp; Server2 is sending ""SET-Cookie:MYCOOKIE=56789" the flow will be as follows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. If a new client hits the VIP on ACE with no cookie set then ACE will select a Sever from the server farm as per the LB algo and forward the HTTP request to the selected server. Lets suppose ACE selects Server1.&lt;/P&gt;&lt;P&gt;3. Server1 will send "SET-Cookie:MYCOOKIE=123456" in the HTTP response to the client.&lt;/P&gt;&lt;P&gt;4. ACE on getting this response from Server1 will dynamically learn that Server1 is setting up cookie value 123456 and will create a sticky entry in the database.&lt;/P&gt;&lt;P&gt;(Due to this sticky db entry any subsequent http requests with "Cookie:MYCOOKIE=123456" will be directly forwarded to Server1.&lt;/P&gt;&lt;P&gt;5. This sticky entry in ACE sticky DB will only time out if "timeout in minutes" configured under sticky group elapses and no active conns are using this entry.With every new http request matching the sticky entry this timeout is initialized.&lt;/P&gt;&lt;P&gt;6. If a new client come with no cookie set in the Http request then ACE will select a server using LB logic and will learn the cookie value  &amp;amp; will create appropriate sticky entry.&lt;/P&gt;&lt;P&gt;7. If a client sends a request with cookie value present then ACE will simply look into the sticky db and forward the request to the appropriate server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Syed Iftekhar Ahmed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2008 05:51:32 GMT</pubDate>
      <guid>https://community.cisco.com/t5/application-networking/configuring-cookie-based-sticky-on-ace/m-p/1117686#M22902</guid>
      <dc:creator>Syed Iftekhar Ahmed</dc:creator>
      <dc:date>2008-10-21T05:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring cookie based sticky on ACE</title>
      <link>https://community.cisco.com/t5/application-networking/configuring-cookie-based-sticky-on-ace/m-p/1117687#M22903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I really appreciate your explanation. Your first suggestion was enough to steer me in the right direction and I was able to figure out what I was doing wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thankyou for your effort!&lt;/P&gt;&lt;P&gt;Bill&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2008 07:40:51 GMT</pubDate>
      <guid>https://community.cisco.com/t5/application-networking/configuring-cookie-based-sticky-on-ace/m-p/1117687#M22903</guid>
      <dc:creator>b.athanasiadis</dc:creator>
      <dc:date>2008-10-21T07:40:51Z</dc:date>
    </item>
  </channel>
</rss>

