Discussion:
FIN segment with piggybacked data
Vladimir Kotal
2011-05-12 13:53:26 UTC
Permalink
Hi all,

I'd like to test a path in Solaris TCP stack where FIN segment with
piggybacked data is processed (server side).

My first issue is how to effectively/easily generate such connection
(3WHS + optionally some data segments + FIN with data) on the client
side. Is there easier way than using raw sockets ?

Secondly, and this is tied to the first question, is what can make TCP
stack (primarily interested in client side) to emit FIN+data segment,
both on Solaris and other systems.

Any insights will be appreciated,


v.
Brian Utterback
2011-05-12 15:00:58 UTC
Permalink
Post by Vladimir Kotal
Secondly, and this is tied to the first question, is what can make TCP
stack (primarily interested in client side) to emit FIN+data segment,
both on Solaris and other systems.
I don't know off hand about your first question. You should try using
packet shell, as my first thought.

As to the second, two ideas come to mind. First, if the data packet was
delayed due to congestion or Nagle, so that the close syscall was
processed before the data was sent. The second, if the data was sent but
the packet was lost, the retransmission could combine the data and FIN.
--
blu

Always code as if the guy who ends up maintaining your code will be a
violent psychopath who knows where you live. - Martin Golding
-----------------------------------------------------------------------|
Brian Utterback - Solaris RPE, Oracle Corporation.
Ph:603-262-3916, Em:brian.utterback-QHcLZuEGTsvQT0dZR+***@public.gmane.org
Nico Williams
2011-05-12 15:31:58 UTC
Permalink
Post by Brian Utterback
As to the second, two ideas come to mind. First, if the data packet was
delayed due to congestion or Nagle, so that the close syscall was
processed before the data was sent. The second, if the data was sent but
the packet was lost, the retransmission could combine the data and FIN.
So pause the app after connecting, add a -blackhole route for the peer, have
the app send data and close the socket, then remove the blackhole route.
Hopefully TCP won't just retransmit but send a FIN+data.

Nico
--
Kacheong Poon
2011-05-12 16:31:51 UTC
Permalink
Post by Vladimir Kotal
I'd like to test a path in Solaris TCP stack where FIN segment with
piggybacked data is processed (server side).
My first issue is how to effectively/easily generate such connection
(3WHS + optionally some data segments + FIN with data) on the client
side. Is there easier way than using raw sockets ?
If you use Solaris 11, you can try the TCP_CORK option. Do
something like

1. Set up the connection.
2. Use setsockopt() to turn on TCP_CORK.
3. Send some data with length less than 1 MSS, say 100 bytes.
4. Call close().

TCP should send out the 100 bytes of data with FIN set.
Post by Vladimir Kotal
Secondly, and this is tied to the first question, is what can make TCP
stack (primarily interested in client side) to emit FIN+data segment,
both on Solaris and other systems.
The above should also work in Linux.
--
K. Poon.
ka-cheong.poon-QHcLZuEGTsvQT0dZR+***@public.gmane.org
Vladimir Kotal
2011-05-13 10:26:49 UTC
Permalink
Post by Vladimir Kotal
I'd like to test a path in Solaris TCP stack where FIN segment with
piggybacked data is processed (server side).
My first issue is how to effectively/easily generate such connection
(3WHS + optionally some data segments + FIN with data) on the client
side. Is there easier way than using raw sockets ?
If you use Solaris 11, you can try the TCP_CORK option. Do
something like
1. Set up the connection.
2. Use setsockopt() to turn on TCP_CORK.
3. Send some data with length less than 1 MSS, say 100 bytes.
4. Call close().
TCP should send out the 100 bytes of data with FIN set.
Thanks, on Solaris 11 express this works fine (with slightly modified
netcat).


v.

Loading...