\magnification=\magstep1
{

\hoffset=1truein
\hsize=5.25truein
\vsize=10.25truein
\font\small=cmssbx10 at 14.4truept
\font\medium=cmssbx10 at 17.28truept
\font\large=cmssbx10 at 20.74truept
\nopagenumbers
\hrule height 0pt
\parindent=0pt
%\parskip=0pt
\hskip 3.9truein
\large
EDOC017\par
\vskip .5truein
\large
EUROGAM PROJECT\par
\vskip 1.5truein
\hrule height 2pt
\vskip 20pt
\large
NSF DATA ACQUISITION SYSTEM\par
\vskip .5truein
Ethernet Communications\par
\vskip 20pt
\hrule height 2pt
\vskip 1truein
\medium
Edition 2.0\par
\vskip 5pt
August 1990\par
\vfill
\medium
NSF Software Systems Group\par
\vskip 5pt
UK Science and Engineering Research Council\par
\vskip 5pt
Daresbury Laboratory\par
\vskip .5truein

\eject
}
\parindent=0pt\hsize=6.25truein\vsize=9.75truein
\def\section#1{\bigbreak{\bf #1}\par\nobreak\medskip}
\def\blob{$\bullet$}
\parskip=.5\baselineskip
\def\list{\parindent=2em\parskip=0pt\smallskip}
\def\endlist{\par\parindent=0pt\parskip=.5\baselineskip}
\def\tabrule{\noalign{\hrule\vskip-0.4pt}}
\newbox\tab
\newdimen\tabht\newcount\tablines
\newdimen\savepagetotal\newcount\savepageno
\newcount\label
\newdimen\pagesum
\newtoks\stuff
\newtoks\heading

\def\lb{\hfil\break}
\def\Group#1. #2\par{
\heading={\bf Order Group    #1.\quad #2} 
\hbox{\the\heading}\nobreak}

\def\endGroup{\vfill\eject}

\def\order#1. #2\par{
\heading={\bf Order #1.\quad #2}}

\def\table{
   \label=0
   \setbox\tab=
   \vbox\bgroup\offinterlineskip
   \tabskip=0pt
   \halign to 2.0 truein \bgroup
   \vrule##\tabskip=0in plus1in\strut&
   \hbox to 0.99truein{\hfil##\hfil}&
   \vrule##&
   \hbox to 0.99truein{\hfil##\hfil}&
   \vrule##\cr
}
\def\byte#1#2{
   \tabrule
   \global\advance\label by 2\relax
   &\sl #1&&\sl #2&\cr
   }
\def\half#1{
   \tabrule
   \global\advance\label by 2\relax
   &\multispan3\hbox to 1.99truein{\hfil\sl #1\hfil}&\cr
   }
\def\full#1{
   \tabrule
   \global\advance\label by 4\relax
   &\multispan3\hbox to 1.99truein{\vrule height14.5pt depth9.5pt width0pt
   \hfil\sl #1\hfil}&\cr
   }
\def\data#1{
   \tabrule
   \global\advance\label by 4\relax
   &\multispan3\hbox to 1.99truein{\vrule height20.5pt depth15.5pt width0pt
   \hfil\sl #1\hfil}&\cr
   }
\def\endtable{\tabrule\egroup\egroup}



\def\desc{
   \tabht=\ht\tab
   \vskip24pt plus 3in\penalty-200\vskip0pt plus -3in
   \hbox{\the\heading}\nobreak\medskip
   \moveright 4.5truein \box\tab
   \savepagetotal=\pagetotal\savepageno=\pageno
   \vskip-\tabht\prevdepth=0pt
   \tablines=\tabht
%  \advance\tablines by \baselineskip
   \divide\tablines by \baselineskip
   \hangindent=-2.0truein \hangafter=-\tablines
   \vskip-\parskip
   \noindent\tolerance=2000
   }
\def\enddesc{
   \par 
   \ifnum\prevgraf<\tablines
      \advance\tablines by -\prevgraf
      \savepagetotal=\baselineskip
      \multiply\savepagetotal by\tablines
     \vskip\savepagetotal\fi}     
   

\def\block{
   \vbox\bgroup\offinterlineskip
   \tabskip=0pt
   \halign to 2.0 truein \bgroup
   \vrule              ##\tabskip=0in plus2in\strut&
                       \hfil##\hfil &
   \vrule              ##\tabskip=0pt         \cr
}

\def\entry#1{
   \tabrule
   &\sl #1 &\cr
   }

\def\fullentry#1{
   \tabrule
   &\vrule height14.5pt depth9.5pt width0pt
   \hfil\sl #1\hfil&\cr
   }

\def\endblock{\tabrule\egroup\egroup}
\tolerance=1000\hfuzz=5pt\raggedbottom
\hyphenation{key-slot}
\section{Introduction}
 This document describes the basic protocols
used within the NSF Data Acquisition System for 
communications over Ethernet.
 
 There are two basic types of network protocol - connection
orientated and connectionless.
 
 Connection orientated - Networking started using telephone
lines and other point to point links for long 
distance communications and the protocols reflected the
connection nature of a telephone call.
Familar protocols are X25 and TCP/IP.
 
 Connectionless - Initially not favoured on wide area 
networks for practical reasons. Now very much preferred
for local area use. Each frame of data contains all the
information necessary for delivery without reference 
to any previous information. 
Protocols are LLC1 and UDP/IP. These are datagram protocols.
 
 Connectionless protocols are very much simplier
than connection orientated protocols and leave most
error detection and recovery to the application levels.
Since there are no fixed software connections in this 
mode of operation any number of requestors can 
communicate with a given service without the complications
which can arise in a connection orientated environment.
 
 Connectionless protocols are hence the most
appropiate for communications between components 
of a data acquisition system such as that planned for Eurogam.
 
 As support for this case it is noted that new 
applications protocols for use on local area networks 
tend to be connectionless - eg NFS.
 
 Since it is expected that the UNIX operating system and 
UNIX workstations will be the primary computing base in the
future it is appropiate to adopt at this time solutions
based on the use of the Internet Protocol (IP) which is currently 
the network standard used by UNIX. This implies that
applications within the Data Acquisition System will be based
on use of the datagram protocol UDP/IP.
 
 It is expected that eventually UNIX and Internet will 
adopt ISO protocols and at that time it will be necessary to 
change the protocols defined in this document to the 
corresponding ISO protocols.
\eject
 
\section{Ethernet Header}
 The format of data in the Ethernet header is as follows.
\table
\data{destination address}
\data{source address}
\half{protocol id}
\endtable
\desc
{\sl Destination address} is a 6 byte field containing the
destination station ethernet MAC address.       \lb
{\sl Source address} is a 6 byte field containing the source
station ethernet MAC address.  \lb
{\sl Procotol id} identifies the communications protocol 
used in the following data - eg Internet (IP) is @0800.
\enddesc
It should be noted that the ethernet standard places a limit on 
the data portion of a data frame of 1500 bytes. \lb
For further information on the Ethernet standard see the 
ISO Standards document ISO 8802/3.
\section{Internet Protocol (IP)}
The Internet Protocol provides for transmitting blocks of
data called datagrams from sources to destinations, where
sources and destinations are identified by fixed length
addresses. The Internet Protocol also provides for 
fragmentation and reassembly of long datagrams as required
for transmission across networks which place a  
limitation on the size of an individual datagram.
There are no facilities to augment end-to-end data 
reliability, flow control or sequencing which are left
to be the responsibility of other software levels.

 The Internet protocol contains a number of optional 
features which are of no interest within a data acquisition
system and so this document describes only the neccessary 
subset required.
 
 Internet Protocol header

\vskip .2in
\newdimen\bitwidth
\bitwidth=10pt
\def\tablerule{\noalign{\hrule}}
\def\field#1#2{\dimen0=\bitwidth\multiply\dimen0 by #1
\hbox to \dimen0{\hss #2\hss}}
\def\lbar{\setbox0=\hbox{\strut\vrule}\hbox to 0pt {\hss\box0}}
\def\rbar{\setbox0=\hbox{\strut\vrule}\hbox to 0pt {\box0\hss}}
\def\cbar{\setbox0=\hbox{\strut\vrule}\hbox to 0pt {\hss\box0\hss}}

\vbox{\tabskip=0pt\offinterlineskip
\hrule
\halign {\rbar\strut#\lbar\cr
\field{4}{version}\cbar\field{4}{IHL}\cbar\field{8}{0}\cbar%
\field{16}{total length}\cr
\tablerule
\field{16}{ID}\cbar\field{4}{flags}\cbar\field{12}{offset}\cr
\tablerule
\field{8}{TTL}\cbar\field{8}{Protocol}\cbar\field{16}{checksum}\cr
\tablerule
\field{32}{source address}\cr
\tablerule
\field{32}{destination address}\cr
\tablerule}}
 
 {\bf VERSION}:  4 bits - IP header version number - currently =4

 {\bf IHL}:  4 bits - Internet header length in unit of 32 bits. 
The subset uses the minimum header for which IHL = 5

 {\bf TOTAL LENGTH}: 16 bits - The length of the datagram 
, in bytes, including internet header and data. 

 {\bf ID}: 16 bits - An identifying field assigned by the sender
to aid in assembling the fragments of a datagram. Only needs
to be unique for as long as the datagram exists.

 IP allows for a datagram which is too big for the network 
to be fragmented, the fragments transmitted, and the result
reassembled at the destination.         \lb
 {\bf FLAGS}: 3 bits - value = 0 for the only or last fragment in
a datagram : value = 1 if more fragments are to follow for this
datagram.
 
 {\bf OFFSET}: 13 bits - this field indicates where in the 
datagram this fragment belongs. The fragment offset is measured 
in units of 8 bytes (64 bits). The first or only fragment 
of a datagram has offset zero.

 {\bf TTL}: 8 bits - Time to Live - indicates the maximum time in
seconds the datagram may exist in the network. Only of 
use within a switched network. Should be set to a small number -
say 2.

 {\bf PROTOCOL}: 8 bits - indicates the next level protocol used in
the data portion of the Internet datagram. eg UDP = 17.
 
 {\bf CHECKSUM}: 16 bits - A checksum on the header only. This is
the 16 bit one's complement of the one's complement sum
of all 16 bit words in the header. For the purpose of 
computing the checksum the value of the checksum field itself 
is taken to be zero.
 
 The checksum can be ignored  by setting this field to zero,
however this feature is not available on all hosts. 

 {\bf SOURCE ADDRESS}: 32 bits - The source Internet address

 {\bf DESTINATION ADDRESS}: 32 bits - The destination Internet address
 
 For further information on the IP standard see the Internet
document RFC 791.
 
\section{User Datagram Protocol (UDP)}
This is Internet Protocol 17.  \lb
 The User Datagram Protocol assumes that the Internet Protocol (IP)
is used as the underlying protocol. This protocol provides a
means by which a number of applications programs can
communicate with other programs by sending datagrams 
via a single Internet port. 
 
 User Datagram Protocol header

\vskip .2in
\newdimen\bitwidth
\bitwidth=10pt
\def\tablerule{\noalign{\hrule}}
\def\field#1#2{\dimen0=\bitwidth\multiply\dimen0 by #1
\hbox to \dimen0{\hss #2\hss}}
\def\lbar{\setbox0=\hbox{\strut\vrule}\hbox to 0pt {\hss\box0}}
\def\rbar{\setbox0=\hbox{\strut\vrule}\hbox to 0pt {\box0\hss}}
\def\cbar{\setbox0=\hbox{\strut\vrule}\hbox to 0pt {\hss\box0\hss}}

\vbox{\tabskip=0pt\offinterlineskip
\hrule
\halign  {\rbar\strut#\lbar\cr
\field{16}{source port}\cbar\field{16}{destination port}\cr
\tablerule
\field{16}{length}\cbar\field{16}{checksum}\cr
\tablerule}}
 
{\bf SOURCE PORT}: 16 bits - indicates the port of the sending
process and may be assumed to be the port to which a 
reply should be addressed in the absence of any other 
information.
 
{\bf DESTINATION PORT}: 16 bits - indicates the destination 
application to which this datagram should be sent.
 
{\bf LENGTH}: 16 bits - is the length, in bytes, of this user 
datagram including this header and the data.
 
{\bf CHECKSUM}: 16 bits - may be transmitted as all zeros 
indicating that the transmitter generated no checksum.
 
 For further information on the UDP standard see the
Internet document RFC 768.
 
 It should be noted that since UDP uses IP the maximum 
length of a UDP datagram is 64 Kbytes (minus 28 bytes of a 
minimum length IP header + UDP header). However the Sun
implementation of UDP/IP allows only slightly 
more than 8 Kbytes (just enough for NFS to perform
8 Kbyte data reads and writes!). This restriction will have 
to be adopted by uses of UDP/IP within the Data Acquisition 
System.
 
\section {Other Protocols}
 The Internet defines may other protocols most of which 
will not be of interest within the Data Acquistion System. 
Some such as NFS for file access and Telnet for terminal access
will be used by the support environment but will not be a
used within the Data Acquisition System environment.
 
 The Address Resolution Protocol (ARP) which provides a means
by which given a hosts Internet address one can broadcast to
determine its ethernet address is widely used and 
will have to be supported within the Data Acquisition System.
Full details of the ARP can be found in the Internet 
document RFC 826.
\endGroup
\end
