ADC Home > Reference Library > Technical Q&As > Carbon > Networking >

TCP/IP Option Sizes


Q: I'm confused by the size of various TCP/IP options. For example, the documentation says that IP_MULTICAST_LOOP is a 4-byte option, but the IPMulticastPitch sample negotiates a size of 1 byte. What's the scoop?

A: In this case, the documentation is wrong. The following table enumerates all the TCP/IP options and their sizes.

XTI Level XTI Name Size
INET_IP IP_ADD_MEMBERSHIP sizeof(struct ip_mreq)
INET_IP IP_BROADCAST 4
INET_IP IP_BROADCAST_IFADDR 4
INET_IP IP_DONTROUTE 4
INET_IP IP_DROP_MEMBERSHIP sizeof(struct ip_mreq)
INET_IP IP_HDRINCL 4
INET_IP IP_MULTICAST_IF 4
INET_IP IP_MULTICAST_LOOP 1 *
INET_IP IP_MULTICAST_TTL 1
INET_IP IP_OPTIONS <= 40
INET_IP IP_RECVDSTADDR 4
INET_IP IP_RECVIFADDR 4
INET_IP IP_RECVOPTS 4
INET_IP IP_REUSEADDR 4
INET_IP IP_REUSEPORT 4
INET_IP IP_TOS 1
INET_IP IP_TTL 1
INET_TCP TCP_ABORT_THRESHOLD 4
INET_TCP TCP_CONN_ABORT_THRESHOLD 4
INET_TCP TCP_CONN_NOTIFY_THRESHOLD 4
INET_TCP TCP_KEEPALIVE sizeof(struct t_kpalive) *
INET_TCP TCP_MAXSEG 4
INET_TCP TCP_NODELAY 4
INET_TCP TCP_NOTIFY_THRESHOLD 4
INET_TCP TCP_OOBINLINE 4
INET_TCP TCP_URGENT_PTR_TYPE 4
INET_UDP UDP_CHECKSUM 4
INET_UDP UDP_RX_ICMP 1 *
XTI_GENERIC XTI_DEBUG 4
XTI_GENERIC XTI_LINGER sizeof(struct t_linger)
XTI_GENERIC XTI_PROTOTYPE 4
XTI_GENERIC XTI_RCVBUF 4
XTI_GENERIC XTI_RCVLOWAT 4
XTI_GENERIC XTI_SNDBUF 4
XTI_GENERIC XTI_SNDLOWAT 4


Warning:
Inside Macintosh: Networking with Open Transport gives either incorrect or ambiguous values for the options tagged with an asterisk (*) in the above table.



Note:
The IP_REUSEPORT and IP_BROADCAST_IFADDR are not currently supported by Open Transport (as of version 2.0.3). They will be available in a future release of Open Transport.


[Apr 26 1999]


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.