TCP/IP Lean: Web Servers for Embedded Systems, Second Edition

Chapter 6: Transmission Control Protocol: TCP

Overview

The next step up the TCP/IP stack is TCP (transmission control protocol). This isn't an easy protocol to implement; it has to perform a multitude of tasks in pursuit of its ultimate objective: creating a reliable connection between two points on the network.

This chapter explores the elements of TCP, how they can be translated into software, and how that software can be tested. I'll be creating my own implementation of the general-purpose TCP communications program, TELNET.

Why is TCP so difficult? Fundamentally, it is trying to do several jobs at once.

  1. Initiate a connection between two nodes.

  2. Send data bidirectionally between the nodes.

  3. Handle network datagram loss.

  4. Handle network datagram duplication.

  5. Handle out-of-order arrival of datagrams.

  6. Handle network failure.

  7. Handle all data rates, from occasional single characters to bulk transfer of large files.

  8. Provide flow control to avoid data overload.

  9. Provide the ability to hasten urgent data.

  10. Close the connection between two nodes.

  11. Support "half-closure," in which one participant wants to close, but the other doesn't.

  12. Handle datagram arrival after the connection is closed.

To add to your problems, the situation between any two nodes changes dynamically and very rapidly, so any failure situations can be difficult to reproduce, making bugs hard to find and fix.

The key to creating a solid TCP implementation is to find a clear expression of the underlying concepts and perform exhaustive testing. To help in this, I'll include significant diagnostic capability in the code, with the ability to deliberately generate errors, in...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Domain Registration Services
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.