On 18 Aug 2010, b...@wasp.net.au wrote:

> Is there a way to force gtkg to always make connections *from* a
> specified port in addition to listening on the configured port? (or
> 2 ports, or whatever).

> I'm playing with some funky traffic shaping rules, and I'd like to
> be able to guarantee gtkg a minimum download bandwidth. Problem is I
> can only mark packets from remote initiated connections as all the
> locally initiated ones come from random source ports.

See: 
http://gtk-gnutella.sourceforge.net/manual/traffic_shaping.html

for some ideas on traffic shaping with different goals than what you
have.  Mainly, there is an option to set the TOS bit in gtkg.  The
problem with what you are proposing is there can no longer be multiple
outbound connections to the same ip address.

For example consider talking to some NAT peers,

  192.168.0.10 -\
  6346           \
                 +-->  GW   <--~~ ~~-->  Your IP:port
                /
  192.68.0.11 -/
  6346

The GW (gateway) uses your random (often call 'emphemeral' in
literature) port to distinguish a connection to the different hosts on
the local network.  The same can be said if you start two downloads to
the same host.  The NAT case could be common if you are downloading
from a University or other institution.  A 'socket' is uniquely
identified by four numbers.

   Source IP:Port, Destination IP:Port

The only way to have multiple communications with a remote host is for
the source port to be random/unique...

So I doubt this would make it to the UI as it is really not a good
Internet practice.  Also, if some other program takes the source port
you have assigned to listen on, no remote communication will work.
The 'ephemeral' ports are typically high numbers which aren't suppose
to be server ports.  An OS can keep track of what ports are listen and
assign connect ports from outside the in-use pool, so they can be
lower port numbers.

Those are the strange things that could happen that I know of.  There
might be more... but maybe that solution works for you.

Regards,
Bill Pringlemeir.

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
gtk-gnutella-devel mailing list
gtk-gnutella-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtk-gnutella-devel

Reply via email to