Re: Setting the mss for socket

2009-04-03 Thread Julian Elischer

Luiz Otavio O Souza wrote:

Is there a way to set the mss for a socket ? Like you can do
in linux with setsockopt(TCP_MAXSEG) ?

So i can set the maximum size of packets (or sort of) from a
simple userland program.


Depending on exactly what you need to accomplish, you may
find something useful in this thread from last August in
freebsd-questions@

 setting the other end's TCP segment size


Very informative thread, thanks.

This thread show me that TCP_MAXSEG is implemented in freebsd but don't
work. You can set the setsockopt(IPPROTO_TCP, TCP_MAXSEG), wich will set 
the

tp->t_maxseg, but this value is recalculated at tcp_input, so in short, you
cannot set the max segment size for a socket.

I've posted a completly wrong patch (from style point-of-view - and using
SOL_SOCKET instead of IPPROTO_TCP), but with that patch i'm able to set the
mss in iperf.


this thread shoud be in FreeBSD-net@ so tha the right people see it
many developers do not read hackers every day as it tends to overload 
them.




Many thanks,
Luiz

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


Re: Setting the mss for socket

2009-04-03 Thread Luiz Otavio O Souza

Is there a way to set the mss for a socket ? Like you can do
in linux with setsockopt(TCP_MAXSEG) ?

So i can set the maximum size of packets (or sort of) from a
simple userland program.


Depending on exactly what you need to accomplish, you may
find something useful in this thread from last August in
freebsd-questions@

 setting the other end's TCP segment size


Very informative thread, thanks.

This thread show me that TCP_MAXSEG is implemented in freebsd but don't
work. You can set the setsockopt(IPPROTO_TCP, TCP_MAXSEG), wich will set the
tp->t_maxseg, but this value is recalculated at tcp_input, so in short, you
cannot set the max segment size for a socket.

I've posted a completly wrong patch (from style point-of-view - and using
SOL_SOCKET instead of IPPROTO_TCP), but with that patch i'm able to set the
mss in iperf.

Many thanks,
Luiz

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


Re: Setting the mss for socket

2009-04-03 Thread perryh
"Luiz Otavio O Souza"  wrote:
> Is there a way to set the mss for a socket ? Like you can do
> in linux with setsockopt(TCP_MAXSEG) ?
>
> So i can set the maximum size of packets (or sort of) from a
> simple userland program.

Depending on exactly what you need to accomplish, you may
find something useful in this thread from last August in
freebsd-questions@

  setting the other end's TCP segment size
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


Re: Setting the mss for socket

2009-04-02 Thread Thomas Wahyudi

Patrick Tracanelli wrote:

Luiz Otavio O Souza escreveu:

Hello hackers,

Is there a way to set the mss for a socket ? Like you can do in linux 
with setsockopt(TCP_MAXSEG) ?


So i can set the maximum size of packets (or sort of) from a simple 
userland program.



you mean sysctl -w net.inet.tcp.mssdflt=512 ?
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


Re: Setting the mss for socket

2009-04-02 Thread Patrick Tracanelli

Luiz Otavio O Souza escreveu:

Hello hackers,

Is there a way to set the mss for a socket ? Like you can do in linux 
with setsockopt(TCP_MAXSEG) ?


So i can set the maximum size of packets (or sort of) from a simple 
userland program.


I've read the code and i cannot find by myself (at least from a 30minute 
reading) a single point to change this. It looks like it is dynamic 
calculated with interface/path mtu. Someone has a simple approach to 
deal with this ? Any ideas ?


Thanks in advance,
Luiz


Good point. With something like that it could be possible to make --mss 
switch from iperf work properly on FreeBSD.


--
Patrick Tracanelli

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


Setting the mss for socket

2009-04-02 Thread Luiz Otavio O Souza

Hello hackers,

Is there a way to set the mss for a socket ? Like you can do in linux with 
setsockopt(TCP_MAXSEG) ?


So i can set the maximum size of packets (or sort of) from a simple userland 
program.


I've read the code and i cannot find by myself (at least from a 30minute 
reading) a single point to change this. It looks like it is dynamic 
calculated with interface/path mtu. Someone has a simple approach to deal 
with this ? Any ideas ?


Thanks in advance,
Luiz 


___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"