Re: setting the other end's TCP segment size

2008-08-05 Thread perryh
 1) create a static ARP entry, this will create an entry to
   the routing table i.e. arp -S IPADDR MACADDR
 2) modify the mtu for that destination
   i.e. route change IPADDR -mtu MTU

Seems to work fine :)

One problem with this approach is that a hard-coded MAC address
would break if the destination's MAC address changed :( but this
can be scripted around by pinging the destination (to ensure that
it's up, and get an arp entry the usual way), then reading the
MAC address from the arp table.

d=192.168.200.3
ping -c 1 $d  \
arp -S $d ` arp -n $d | sed -e 's/^.* at //' -e 's/ on .*$//' `  \
route change $d -mtu 640
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: setting the other end's TCP segment size

2008-08-04 Thread Nikos Vassiliadis
On Monday 04 August 2008 00:16:54 [EMAIL PROTECTED] wrote:
Is there a simple way for a FreeBSD system to cause its
peer to use a transmit segment size of, say, 640 bytes --
so that the peer will never try to send a packet larger
than that?
   
I'm trying to get around a network packet-size problem.
In case it matters, the other end is SunOS 4.1.1 on a
sun3, and I've been unable to find a way to limit its
packet size directly.

 ...

Each tcp conversation can have it's own size set along
with a bunch of other params.
  
   Good point.  The TCP_MAXSEG can reduce the maximum segment
   size for a single TCP connection to something smaller than
   the interface MTU :)

 That would be OK, provided I could somehow arrange for it to apply
 to all conversations with this particular destination (which is
 what the next item seems to do :)

  Just adding that MTU can be set per destination with the help
  of route(8) and the -mtu modifier.

 That would be better than setting the local mtu -- which has been
 causing other problems although it takes care of the original --
 and it is a better match to the physical situation.  (The culprit
 is neither the Sun nor the FreeBSD system, but the physical link
 between the Sun and the hub.)

 What I haven't been able to come up with is a way of making such
 a setting permanent.  If I've communicated with the Sun recently
 enough, netstat -r -W reports a line like this (some spaces
 removed, for length, and I've no longer got xl0's mtu set low)

 Destination   Gateway   Flags Refs Use  Mtu Netif Expire
 192.168.200.3 08:00:20:00:a7:a6 UHLW 1  34 1500   xl0   1184

 Now if I do

 # route change 192.168.200.3 -lock -mtu 640

 the mtu column changes to 640 and it works fine, but only until
 the routing entry expires.  Adding -static makes no difference
 -- the entry still expires and loses the mtu specification.

 I've been unable to come up with a route command that will *create*
 an entry like that (vs modifying an existing one), nor that will
 transform a transient entry into a permanent one.

Yes, it's the interaction of ARP and the routing subsystem.
I am sure there is a shorter way for doing this, but it
escapes my knowledge:
1) create a static ARP entry, this will create an entry to
  the routing table i.e. arp -S IPADDR MACADDR
2) modify the mtu for that destination
  i.e. route change IPADDR -mtu MTU

HTH, Nikos
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: setting the other end's TCP segment size

2008-08-03 Thread perryh
   Is there a simple way for a FreeBSD system to cause its
   peer to use a transmit segment size of, say, 640 bytes --
   so that the peer will never try to send a packet larger
   than that?
  
   I'm trying to get around a network packet-size problem. 
   In case it matters, the other end is SunOS 4.1.1 on a
   sun3, and I've been unable to find a way to limit its
   packet size directly.
...
   Each tcp conversation can have it's own size set along
   with a bunch of other params.
 
  Good point.  The TCP_MAXSEG can reduce the maximum segment
  size for a single TCP connection to something smaller than
  the interface MTU :)

That would be OK, provided I could somehow arrange for it to apply
to all conversations with this particular destination (which is
what the next item seems to do :)

 Just adding that MTU can be set per destination with the help
 of route(8) and the -mtu modifier.

That would be better than setting the local mtu -- which has been
causing other problems although it takes care of the original --
and it is a better match to the physical situation.  (The culprit
is neither the Sun nor the FreeBSD system, but the physical link
between the Sun and the hub.)

What I haven't been able to come up with is a way of making such
a setting permanent.  If I've communicated with the Sun recently
enough, netstat -r -W reports a line like this (some spaces
removed, for length, and I've no longer got xl0's mtu set low)

Destination   Gateway   Flags Refs Use  Mtu Netif Expire
192.168.200.3 08:00:20:00:a7:a6 UHLW 1  34 1500   xl0   1184

Now if I do

# route change 192.168.200.3 -lock -mtu 640

the mtu column changes to 640 and it works fine, but only until
the routing entry expires.  Adding -static makes no difference
-- the entry still expires and loses the mtu specification.

I've been unable to come up with a route command that will *create*
an entry like that (vs modifying an existing one), nor that will
transform a transient entry into a permanent one.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: setting the other end's TCP segment size

2008-07-31 Thread Nikos Vassiliadis
On Thursday 31 July 2008 01:21:25 Giorgos Keramidas wrote:
 On Wed, 30 Jul 2008 16:20:06 -0500, Derek Ragona 
[EMAIL PROTECTED] wrote:
  At 11:04 PM 7/29/2008, [EMAIL PROTECTED] wrote:
   [TCP] splits traffic to 'segments' using its own logic ...
 
  Is there a simple way for a FreeBSD system to cause its peer to use a
  transmit segment size of, say, 640 bytes -- so that the peer will
  never try to send a packet larger than that?
 
  I'm trying to get around a network packet-size problem.  In case it
  matters, the other end is SunOS 4.1.1 on a sun3, and I've been unable
  to find a way to limit its packet size directly.
 
  Just as an FYI, you might want to do:
  man setsockopt
  ro
  man getsockopt
 
  Each tcp conversation can have it's own size set along with a bunch of
  other params.

 Good point.  The TCP_MAXSEG can reduce the maximum segment size for a
 single TCP connection to something smaller than the interface MTU :)

Just adding that MTU can be set per destination with the help of
route(8) and the -mtu modifier.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: setting the other end's TCP segment size

2008-07-31 Thread perryh
 You can edit `/etc/hostname.foo0' in the Sun too, and add
 something like:

 192.168.1.10/24 mtu 640

[getting OT for FreeBSD]

Are you sure that works as far back as SunOS 4.1.1?

/etc/hostname.le0 currently consists of the single word

  pluto

and it looks as if this causes /etc/rc.boot to do

  ifconfig le0 pluto netmask + -trailers up

(where the name pluto resolves to 192.168.200.1 via /etc/hosts).
If I were to change /etc/hostname.le0 to

  pluto mtu 640

I think the ifconfig command would become

  ifconfig le0 pluto mtu 640 netmask + -trailers up

and it doesn't look as if ifconfig recognizes mtu as a keyword
(at least while running -- granted I haven't tried actually
editing /etc/hostname.le0 and rebooting):

  # ifconfig le0 pluto mtu 640
  ifconfig: mtu: bad address
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: setting the other end's TCP segment size

2008-07-31 Thread Giorgos Keramidas
On Thu, 31 Jul 2008 01:43:11 -0700, [EMAIL PROTECTED] wrote:
 You can edit `/etc/hostname.foo0' in the Sun too, and add
 something like:

 192.168.1.10/24 mtu 640

 [getting OT for FreeBSD]

 Are you sure that works as far back as SunOS 4.1.1?

Ah!  That will not work, you are right.  When I saw 'Sun' I assumed a
relatively recent Solaris version.  I didn't know you had SunOS 4.1.1
still around! :)

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: setting the other end's TCP segment size

2008-07-30 Thread perryh
  Is there a simple way for a FreeBSD system to cause its peer
  to use a transmit segment size of, say, 640 bytes -- so that
  the peer will never try to send a packet larger than that?
 
  I'm trying to get around a network packet-size problem.  In
  case it matters, the other end is SunOS 4.1.1 on a sun3, and
  I've been unable to find a way to limit its packet size
  directly.
 
  Setting the interface MTU should do it, i.e.:
 
  ifconfig re0 mtu 640
 
  Not all interfaces support setting the MTU and some may have
  range restrictions though.

 In particular, this seems to work with my wlan0 interface, but
 not with my re0 interface ...

That's certainly simple enough, and xl0 apparently supports the
reduced mtu setting.  It seems to be working just fine.  Thanks!

I'd thought of trying to set the sun's MTU, but hadn't been able
to find a way to do it.  It had never occurred to me that setting
the *recipient's* MTU would limit the *sender's* packet size.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: setting the other end's TCP segment size

2008-07-30 Thread Giorgos Keramidas
On Wed, 30 Jul 2008 00:09:45 -0700, [EMAIL PROTECTED] wrote:
 Is there a simple way for a FreeBSD system to cause its peer to
 use a transmit segment size of, say, 640 bytes -- so that the peer
 will never try to send a packet larger than that?

 I'm trying to get around a network packet-size problem.  In case
 it matters, the other end is SunOS 4.1.1 on a sun3, and I've been
 unable to find a way to limit its packet size directly.

 Setting the interface MTU should do it, i.e.:

 ifconfig re0 mtu 640

 Not all interfaces support setting the MTU and some may have range
 restrictions though.

 In particular, this seems to work with my wlan0 interface, but not
 with my re0 interface ...

 That's certainly simple enough, and xl0 apparently supports the
 reduced mtu setting.  It seems to be working just fine.  Thanks!

 I'd thought of trying to set the sun's MTU, but hadn't been able
 to find a way to do it.  It had never occurred to me that setting
 the *recipient's* MTU would limit the *sender's* packet size.

You can edit `/etc/hostname.foo0' in the Sun too, and add something
like:

192.168.1.10/24 mtu 640

but since now you are happy with the new setup, that's fine :)
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: setting the other end's TCP segment size

2008-07-30 Thread Derek Ragona

At 11:04 PM 7/29/2008, [EMAIL PROTECTED] wrote:

 [TCP] splits traffic to 'segments' using its own logic ...

Is there a simple way for a FreeBSD system to cause its peer
to use a transmit segment size of, say, 640 bytes -- so that
the peer will never try to send a packet larger than that?

I'm trying to get around a network packet-size problem.
In case it matters, the other end is SunOS 4.1.1 on a sun3, and
I've been unable to find a way to limit its packet size directly.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]

--


Just as an FYI, you might want to do:
man setsockopt
ro
man getsockopt

Each tcp conversation can have it's own size set along with a bunch of 
other params.


-Derek


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: setting the other end's TCP segment size

2008-07-30 Thread Giorgos Keramidas
On Wed, 30 Jul 2008 16:20:06 -0500, Derek Ragona [EMAIL PROTECTED] wrote:
 At 11:04 PM 7/29/2008, [EMAIL PROTECTED] wrote:
  [TCP] splits traffic to 'segments' using its own logic ...

 Is there a simple way for a FreeBSD system to cause its peer to use a
 transmit segment size of, say, 640 bytes -- so that the peer will
 never try to send a packet larger than that?

 I'm trying to get around a network packet-size problem.  In case it
 matters, the other end is SunOS 4.1.1 on a sun3, and I've been unable
 to find a way to limit its packet size directly.

 Just as an FYI, you might want to do:
 man setsockopt
 ro
 man getsockopt

 Each tcp conversation can have it's own size set along with a bunch of
 other params.

Good point.  The TCP_MAXSEG can reduce the maximum segment size for a
single TCP connection to something smaller than the interface MTU :)

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


setting the other end's TCP segment size

2008-07-29 Thread perryh
 [TCP] splits traffic to 'segments' using its own logic ...

Is there a simple way for a FreeBSD system to cause its peer
to use a transmit segment size of, say, 640 bytes -- so that
the peer will never try to send a packet larger than that?

I'm trying to get around a network packet-size problem.
In case it matters, the other end is SunOS 4.1.1 on a sun3, and
I've been unable to find a way to limit its packet size directly.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: setting the other end's TCP segment size

2008-07-29 Thread Giorgos Keramidas
On Wed, 30 Jul 2008 07:36:34 +0300, Giorgos Keramidas [EMAIL PROTECTED] wrote:
 On Tue, 29 Jul 2008 21:04:53 -0700, [EMAIL PROTECTED] wrote:
 [TCP] splits traffic to 'segments' using its own logic ...

 Is there a simple way for a FreeBSD system to cause its peer
 to use a transmit segment size of, say, 640 bytes -- so that
 the peer will never try to send a packet larger than that?

 I'm trying to get around a network packet-size problem.  In
 case it matters, the other end is SunOS 4.1.1 on a sun3, and
 I've been unable to find a way to limit its packet size
 directly.

 Setting the interface MTU should do it, i.e.:

 ifconfig re0 mtu 640

 Not all interfaces support setting the MTU and some may have
 range restrictions though.

In particular, this seems to work with my wlan0 interface, but not with
my re0 interface.  The wlan0 interface correctly limits the maximum TCP
segment size to 500 bytes when I set the MTU:

# ifconfig wlan0 | fgrep mtu
wlan0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST metric 0 mtu 1500
# ifconfig wlan0 down; ifconfig wlan0 mtu 50 up

Then a tcpdump to save SSH traffic to a particular host, and a dump of
the resulting pcap shows:

# tcpdump -s 2000 -l -vvv -w save.pcap 'host a.b.c.d port 22'
Got 42^C
# echo ` tcpdump -n -l -vvv -r save.pcap 2/dev/null | \
 sed -e 's/.* length //' -e 's/).*//' ` | fmt
60 60 52 91 52 91 500 500 340 356 52 52 76 204 196 500 260 52 68
52 100 100 116 116 500 132 52 500 84 52 500 196 52 84 116 100 164
436 52 100 132 52

This should work for *both* sides of the connection because of the
initial maximum segment size negotiation between the two TCP hosts.
See for example the two first packets of the capture I mentioned above,
and look for the 'mss' option:

07:38:19.554338 IP (tos 0x0, ttl 64, id 44805, offset 0, flags [DF],
  proto TCP (6), length 60) 192.168.1.???.53468  X.Y.Z.W.22:
  S, cksum 0x20d6 (correct), 4195632487:4195632487(0) win 65535
  mss 460,nop,wscale 3,sackOK,timestamp 62534308 0
07:38:19.591065 IP (tos 0x0, ttl 54, id 39804, offset 0, flags [DF],
  proto TCP (6), length 60) X.Y.Z.W.22  192.168.1.???.53468:
  S, cksum 0x7f2f (correct), 901580944:901580944(0) ack 4195632488 win 65535
  mss 460,nop,wscale 3,sackOK,timestamp 3188303166 62534308

The MSS advertised is less than 500 to leave some space for the IP and
TCP headers, but the full IP datagram _length_ that I displayed in the
fmt(1) output above shows that the full MTU is used some times for the
IP datagrams sent or received.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: setting the other end's TCP segment size

2008-07-29 Thread Giorgos Keramidas
On Tue, 29 Jul 2008 21:04:53 -0700, [EMAIL PROTECTED] wrote:
 [TCP] splits traffic to 'segments' using its own logic ...

 Is there a simple way for a FreeBSD system to cause its peer
 to use a transmit segment size of, say, 640 bytes -- so that
 the peer will never try to send a packet larger than that?

 I'm trying to get around a network packet-size problem.  In
 case it matters, the other end is SunOS 4.1.1 on a sun3, and
 I've been unable to find a way to limit its packet size
 directly.

Setting the interface MTU should do it, i.e.:

ifconfig re0 mtu 640

Not all interfaces support setting the MTU and some may have
range restrictions though.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]