Article delegate-en/4416 of [1-5169] on the server localhost:119
  upper oldest olders older1 this newer1 newers latest
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
Newsgroups: mail-lists.delegate-en

[DeleGate-En] Re: File Size depended routing. Is it possible?
17 Mar 2009 06:50:35 GMT (Yutaka Sato)
The DeleGate Project


In message <_A4415@delegate-en.ML_> on 03/16/09(22:08:44)
you Alex B <> wrote:
 |> DeleGate can control routing based on protocol, destination (server host
 |> and port), and source (client host, authentication).  It might be extended
 |> to map application level intelligence like the size of data to one of them
 |> as a pseudo one.
 |> In the case a connection can be established after the size is got, as in
 |> HTTP or FTP data, it might be easily realized.
 |> So I wish to know more about your case.
 |Very, very near, may be here. The main my "headache" is big files over 
 |http and ftp. And i'd like to route them (big files) to the slow link 
 |with big latency, whereas "reading" people will be able work through the 
 |fast link.
 |My network is simple: I have two gateways with two links to ISP 
 |connected together by private network. Both gateways have two 
 |interfaces: one to ISP and one to internal network. I thought to start 
 |two MASTER-DeleGates on the gateways and one specialist DeleGate as 
 |proxy for clients. But i couldn't find appropriate configs from the 
 |dalegate's manual.

I'm not sure what does "reading" people means, but if you can distinguish
them with IP-address or domain or proxy authentication, you can select
a route for them with the FORWARD parameter (generalized parameter to
select upstream proxies as MASTER, PROXY and SOCKS) as follows for example:


Or DeleGate can filter a routes based on the method too (with the enclosed
patch).  For example, only POST over HTTP can be forwarded to the slow link
as follows:


To realize routing based on the size of data, there are diverse difficulties
for each case:
- uploading via HTTP
 easiest. the size of data is given in the request-header before
 establishing the connection to a server (via a selected upstream proxy)
- downloading via HTTP
 1) get the size with HEAD and 2) do GET or POST via a selected proxy
- downloading via FTP
 1) get the size with SIZE command and 2) do PORT + RETR
  (but PORT might not be selectable for security reason)
- uploading via FTP
 difficult to get the size of data. possibly with timeout and retry

A possible universal solution is to use timeout as "try the fast link
first and if the transfer is not completed in xx seconds, then retry
it over the slow link".  This seems applicable to any case but it might
be bad for HTTP request with side-effect.

  9 9   Yutaka Sato <>
 ( ~ )  National Institute of Advanced Industrial Science and Technology
_<   >_ 1-1-4 Umezono, Tsukuba, Ibaraki, 305-8568 Japan
Do the more with the less -- B. Fuller

*** dist/src/delegate9.9.2/src/master.c	Sun Feb 22 13:26:04 2009
--- ./src/master.c	Tue Mar 17 14:48:33 2009
*** 1969,1974 ****
--- 1969,1987 ----
  	  if( (pl = protoMatch1(Rp->m_protoV,proto,dstport)) == NULL ){
+ 	  else{
+ 		/*
+ 		 * 9.9.3 filtering route by request method as
+ 		 * FORWARD="delegate://Host:Port-_-http//POST"
+ 		 */
+ 		if( Rp->m_protoV[0].p_methods ){
+ 			if( RequestMethod[0] ){
+ 				if( methodMatch(Conn,pl,RequestMethod) == 0 ){
+ 					continue;
+ 				}
+ 			}
+ 		}
+ 	  }
  	  if( !nd || hostIsinList(&Rp->m_dsts,proto,dsthost,dstport,NULL) )
  	  if( !ns || hostIsinList(&Rp->m_srcs,ANYP,srchost,0,Ident()) )

  admin search upper oldest olders older1 this newer1 newers latest
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]