25.02.2013 Views

TCP/IP Tutorial and Technical Overview - IBM Redbooks

TCP/IP Tutorial and Technical Overview - IBM Redbooks

TCP/IP Tutorial and Technical Overview - IBM Redbooks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

► TIME-WAIT: FINs have been received <strong>and</strong> ACK’d, <strong>and</strong> <strong>TCP</strong> is waiting two<br />

MSLs to remove the connection from the table.<br />

► CLOSED: Imaginary, this indicates that a connection has been removed from<br />

the connection table.<br />

4.3.2 <strong>TCP</strong> application programming interface<br />

The <strong>TCP</strong> application programming interface is not fully defined. Only some base<br />

functions it should provide are described in RFC 793 – Transmission Control<br />

Protocol. As is the case with most RFCs in the <strong>TCP</strong>/<strong>IP</strong> protocol suite, a great<br />

degree of freedom is left to the implementers, thereby allowing for optimal<br />

operating system-dependent implementations, resulting in better efficiency <strong>and</strong><br />

greater throughput.<br />

The following function calls are described in the RFC:<br />

► Open: To establish a connection takes several parameters, such as:<br />

– Active/Passive<br />

– Foreign socket<br />

– Local port number<br />

– Timeout value (optional)<br />

This returns a local connection name, which is used to reference this<br />

particular connection in all other functions.<br />

► Send: Causes data in a referenced user buffer to be sent over the connection.<br />

Can optionally set the URGENT flag or the PUSH flag.<br />

► Receive: Copies incoming <strong>TCP</strong> data to a user buffer.<br />

► Close: Closes the connection; causes a push of all remaining data <strong>and</strong> a <strong>TCP</strong><br />

segment with FIN flag set.<br />

► Status: An implementation-dependent call that can return information, such<br />

as:<br />

– Local <strong>and</strong> foreign socket<br />

– Send <strong>and</strong> receive window sizes<br />

– Connection state<br />

– Local connection name<br />

► Abort: Causes all pending Send <strong>and</strong> Receive operations to be aborted, <strong>and</strong> a<br />

RESET to be sent to the foreign <strong>TCP</strong>.<br />

For full details, see RFC 793 – Transmission Control Protocol.<br />

164 <strong>TCP</strong>/<strong>IP</strong> <strong>Tutorial</strong> <strong>and</strong> <strong>Technical</strong> <strong>Overview</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!