Steve Jacobson's "sock" Page


W. Richard Stevens' sock program plus IPv6 and SCTP

This is a version of W. Richard Stevens' "sock" program, based on the code available for the UNIX Network Programming book.

It is an enhanced version of sock-0.3.2.tar.gz, available from Christian Kreibich's sock Web Page

Version 0.4.1 of sock adds SCTP and IPv6 support:

The sock program can generate various UDP, TCP or SCTP packets with various options. It can also be run as a client or as a server.

In addition to the previously existing capabilities of "sock," this version has new IPv6 and SCTP options that allows TCP, UDP or SCTP packets to be sent over IPv6, or over the default IPv4.

This port also fixes a couple of bugs in version 0.3.2; fixes are documented in the source code. Also, all of the compile warnings in that version have been cleaned up.

Version 0.4.2 of sock adds various socket options:

  • Added IPv6 socket options: Set hop limit; set multicast hop limit; disable/enable header flow label; set header traffic class; set don't fragment option.
  • Added IPv4 socket option: Set DF (don't fragment) header bit.

    Version 0.4.3.1 of sock adds certain IPv6 extension headers:

  • Added IPv6 extension header options. It is now possible to add IPv6 hop-by-hop options and/or destination options extension headers to transmitted IPv6 packets.

    To download a tarball of the updated sock program:

  • Download sock version 0.4.1

  • Download sock version 0.4.2

  • Download sock version 0.4.3.1

    A github repository has been created that contains the same code as the most recent tarball, above. The repository can be found at:

  • sock plus IPv6 and SCTP github repository

    A version of the updated sock program can also be found in the FreeBSD ports collection, in:

  • ports/net/sock