Go Back   SharingDVB All Tutorials sharing > Emulator Tutorials > CardSharing Tutorials

Reply
 
Thread Tools Display Modes
Old 12-23-2014, 09:45 PM   #1
admin
Administrator
 
admin's Avatar
 
Join Date: Dec 2014
Posts: 219
New How to setup OSCAM CACHE-EX Feature with a peer



OSCAM Cache-EX Tutorial

OSCAM Cache-EX Tutorial
I was asked to write a little tutorial on howto setup Oscam's CACHE-EX Feature...

What is Cache-EX ?
The Cache-EX feature makes it possible to exchange Oscam's caches from server to server.


Why is Cache useful in general ?
Quite simple. Even without Cache-EX enabled, Oscam builds a cache by default. Every requested ECM by a client is forwarded to an available card or proxy reader. This ECM will stay in Oscam's memory (cache), until its validity expire. On a busy server, you can imagine that there are quite a lot of valid ECM's in memory.

When a second client requests an ECM for the same channel, it will automatically forward the available ECM from local cache, without requesting a reader or proxy, resulting on less load on your cards. Obviously, when its not available from local cache, the request is forwarded to a proxy or card.

You can see answers from Oscam's local cache in your logs.
The reader-name mentioned, is the reader where the ECM originally came from

HTML Code:
2012/03/12 13:06:18 1412EAF0 c USER_A (0100&00006A/5212/64:4A32): cache1 (4 ms) by READER1 (13 of 26) - RTL7 HD
2012/03/12 13:08:50 1412EAF0 c USER_B (0100&00006A/51BD/64:0C7D): cache2 (22 ms) by READER2 (14 of 26) - Sport1 Tennis
2012/03/12 13:08:51 140E5170 c USER_C (0100&00006A/17CC/64:6172): cache2 (133 ms) by READER3 (14 of 26) - EredivisieLive1 HD
2012/03/12 13:08:52 141226A0 c USER_D (0100&00006A/17CC/64:6172): cache2 (190 ms) by READER3 (14 of 26) - EredivisieLive1 HD
OK, so why use Cache-EX on top of the normal cache ?
Cache-EX can be enabled by adding a special user to the server, and a special reader to the client with corresponding Cache-EX parameters. This reader and user is only capable of transporting cached-ecm's. When no valid cached-ecm is found on the server, the request is 'rejected'.

The benefit of this method, is that every ECM request on your server will be tried against the cache of your Cache-EX-enabled readers first. The answer on such requests is given very fast, since a server is able to check this in no-time. When no Cache-EX-enabled reader is able to answer the ECM request, the request is forwarded to- and answered by a 'normal' reader.

How-To setup CACHE-EX
Like stated above, Cache-EX can be configured with the 'cacheex' parameter on your user or reader.
To use it, Oscam has to be compiled with CACHE-EX support set to ON.

The Cache-EX-user must have always the same mode configured as the connecting Cache-EX-reader.

There are 4 modes you can setup:
cacheex = 1 - cachepull
HTML Code:
OSCam A reader1 has cacheex = 1
OSCam B account1 has cacheex = 1

OSCam A gets a ECM request, reader1 send this request to OSCam B,
OSCam B checks his cache:

Not found in cache: return NOK (shows as 'rejected' in logs)
Found in cache: return OK+CW
Not found in cache, but found pending request: wait cacheexwaittime in oscam.conf [global] and check again. 

OSCam B never requests new ECMs.
CW-flow = B ---> A
cacheex = 2 - cachepush

HTML Code:
OSCam A reader1 has cacheex = 2
OSCam B account1 hastcacheex = 2

If OSCam B gets a CW, its pushed to OSCam A, reader has normal functionality and can request ECMs.

Problem: OSCAM can only push CW's if OSCam A is connected
Problem or feature?: OSCam A reader can request ECMs from OSCam B
CW-flow = B ---> A
cacheex = 3 - reversecachepush

HTML Code:
OSCam A reader 1 has cacheex = 3

If OSCam A gets a CW, its pushed to OSCam B. OSCam A never requests new ECMs.
CW-flow = A ---> B

To make a long story short, i tested all modes extensively, and found out that mode 1 is working best.
Example of Mode1 Cache-EX(change) in two directions.
This example creates a bi-directional transport of cache between two servers, with mode 1.

oscam.reader on OSCAM-A:
Code:
[reader]
label = OSCAM-B-CACHE
protocol = cccam
device = oscamserverB.com,12000
user = OSCAM-A-CACHE
password = password
inactivitytimeout = 0
cacheex = 1
group = 1
dropbadcws = 1
cccversion = 2.3.0
ccckeepalive = 1
cccreshare = 3
oscam.user on OSCAM-B:

Code:
[account]
user = OSCAM-A-CACHE
pwd = password
group = 1
cacheex = 1
cccmaxhops = 10
cccreshare = 1
oscam.reader on OSCAM-B:

Code:
[reader]
label = OSCAM-A-CACHE
protocol = cccam
device = oscamserverA.com,12000
user = OSCAM-B-CACHE
password = password
inactivitytimeout = 0
cacheex = 1
group = 1
dropbadcws = 1
cccversion = 2.3.0
ccckeepalive = 1
cccreshare = 3

oscam.user on OSCAM-A:

Code:
Code:
[account]
user = OSCAM-B-CACHE
pwd = password
group = 1
cacheex = 1
cccmaxhops = 10
cccreshare = 1
Logging and monitoring
You can see traffic flowing from Oscam's log.

For example:

When a cache-ex-request is NOT found in cache, or an invalid SID is requested:
2012/03/12 13:51:13 1412EAF0 c OSCAM-A-CACHE (0100&00006A/51E0/64:C1C8): rejected peer (55 ms) (13 of 25) - Sport1 HD


When a cache-ex-request IS found in cache:
2012/03/12 13:51:07 144716B0 c OSCAM-A-CACHE (0100&00006A/17CC/64:B81C): found (32 ms) by OSCAM-B-CACHE (7 of 16) - EredivisieLive1 HD

Also, you can check an overview of the cache thru the WEB GUI -> http://<oscamserverURL>/cacheex.html

The efficiency of your cache can be measured with the totals displayed on the bottom of Oscam's Users page in the GUI.

admin is offline   Reply With Quote
Reply

« Previous Thread | Next Thread »
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:50 PM.
SharingDVB@
A vBSkinworks Design