next up previous contents
Next: Difference between NNTP and Up: No Title Previous: Finite State Machine

 NNTP and NNRP
The Network News Reader and Transport Protocols (NNTP & NNRP)

  NNTP was specified in 1986 in RFC 977 [KL86]. It is a protocol for the distribution, inquiry, retrieval, and posting of news articles using a reliable stream-based transmission mechanism. NNTP uses a stream connection (such as TCP) and SMTP-like commands and responses (SMTP is the ``Simple Mail Transfer Protocol'' which is specified in [Pos82]). The commands and responses are in human readable ASCII format. This means that it is possible to manually connect to the nntp port of a machine, e.g. using telnet, issue NNTP commands and receive readable answers as shown in figure B.1.


  
Abbildung B.1: Telnet session to a news server's NNTP port
\begin{figure}
 \begin{center}
 \leavevmode
 \begin{tabular}
{p{14cm}}
 \hline
 ...
 ...y comes here...}\\  \texttt{.}\\  \hline
 \end{tabular} \end{center}\end{figure}

The client (e.g., a news reader) issues a command and gets a numeric reply with an optional textual argument. The textual argument is a human readable explanation of the numeric reply and may usually be ignored. The numeric response indicates the success of the command and whether additional data follows. If the command has to supply additional data, then this is indicated within the numeric reply code. The additional data follows the numeric reply line and is terminated by a single dot on a line. Tables B.1 and B.2 show the meaning of the first two digits in the numeric reply code. The third digit is command dependent. These codes are described in detail in [KL86].

Figure B.1 shows the GROUP and ARTICLE commands. The first command (GROUP) selects the newsgroup comp.os.linux.admin. The news server's reply (211) indicates that the newsgroup was selected successfully. Now it is possible to retrieve an article from this newsgroup using the ARTICLE command. In the example above article 870 is requested. The news server indicates that the command completed successfully (using reply code 220) and supplies the article header and body as additional data. The end of the article is marked by a single dot on a line.


 
Tabelle B.1: Meaning of the first digit of an NNTP/NNRP reply
Code Description
1yz This is only an information message and may be ignored
2yz Command completed successfully
3yz Command ok so far, send the rest of it
4yz Command was correct, but couldn't be performed for some reason
5yz Command unimplemented, or incorrect, or a serious program error occurred



 
Tabelle B.2: Meaning of the second digit of an NNTP/NNRP reply
Code Description
x0z Connection, setup, and miscellaneous messages
x1z Newsgroup selection
x2z Article selection
x3z Distribution functions
x4z Posting
x8z Nonstandard (private implementation) extensions
x9z Debugging output




 
next up previous contents
Next: Difference between NNTP and Up: No Title Previous: Finite State Machine
gschwind@infosys.tuwien.ac.at