In the past two months, this column has introduced some of the functions necessary for writing networked programs. We’ve been throwing around terms like TCP, UDP, IP, and others without any real description of what they mean. This month, you should gain a better understanding of these abbreviations and exactly what is going on when they are used to communicate between machines. With this knowledge, you will be better equipped to determine exactly which protocol is appropriate for your applications — for instance, why UDP is often used for broadcast-style transmissions, while TCP is used for transactions.
Before jumping into the different protocols that make up network communication, let’s take a look at how a protocol actually becomes a standard. The documents describing the various network protocols are called RFCs (Request for Comments). RFCs were started in 1969 as a set of documents to describe the various protocols pertaining to the Internet. It is easy to find RFCs for different protocols online at http://www.rfc-editor.org/.
RFC 791 describes the Internet Protocol (IP), RFC 768 describes the User Datagram Protocol (UDP), and RFC 793 describes the Transmission Control Protocol (TCP). RFCs are used to describe many higher-level protocols that you are probably more familiar with. For example, FTP is described in RFC 959, HTTP 1.0 is described in RFC 1945, and the telnet protocol is described in RFC 854.
When writing an application like an FTP client or server, the RFC describing the protocol should be the first place you look. It outlines exactly what each side of the communication channel expects to see from the other channel and the format of all communication.
RFCs are great for gaining a general understanding of protocols like the ones we are looking at in this article. One thing that RFCs don’t do is describe how to implement TCP/IP in a specific operating system. However, they can definitely help you gain further understanding of the protocols themselves.
It would be hard to use Linux and not be familiar with the term TCP/IP. But what exactly is TCP/IP, and why is it so important to networking? TCP/IP actually refers to a whole suite of communication protocols, including, but not limited to, TCP and IP. In this article, we will look at IP, TCP, and UDP.
Let’s start by examining the Internet Protocol (IP) (ftp://ftp.isi.edu/in-notes/rfc791.txt). This is the basic protocol used to communicate information between two different nodes on a network. As you probably know, each node on the network is required to have an “IP address” that allows other nodes to communicate with it.
The Internet Protocol RFC describes exactly how these addresses should be assigned and formed. It also describes exactly how data should be packaged and sent to another host on the network.
Information is transferred between two nodes in a network in blocks of data that are called packets. However, packets contain more information than just the data you wish to communicate with another machine. They also contain information indicating from where the data is coming, to where the data is going, as well as other identifying information. This is used by routers, which transfer the data on its route from the source machine to the destination machine. It is this additional information that is described in the various protocols in this column.
Linux Magazine /
December 2001 / COMPILE TIME
The Insides of Networking