ABSTRACT

A non-small program is usually divided into several files, so tasks like development, testing, maintenance, and upgrade become easier to perform. Because in the working experience, people were deeply involved with the development of network protocols, this chapter focuses on implemention of a simple protocol. A protocol may be implemented in hardware, software, or both. The heart of a protocol standard is the information exchanged between systems, the format of the exchanging messages, their significance, and the message handling procedures. The chapter presents a brief discussion about how to write a larger program. It defines the interactions between modules, their dependencies, and how these modules communicate with each other. The usual choice for the name of the file that contains main() is the name of the application. The common practice is to put function definitions and declarations of external variables into source files, while function declarations, type definitions, constants, and macros are put into header files.