/** @file ip_udp_cip_hdrs.page */


/**  @addtogroup mod_junogse */
/*@{*/

/** @page ip_udp_cip_hdrs IP,UDP,CIP Headers
 *
 * Definition of the IP, UDP, and CIP headers with are placed on
 * communications between Waves and the Juno Flight Data Systems.
 *
 * @section ip_header IP Header
 *
 * This is a standard internet protocol header.  Some of the fields always 
 * have the same value and thus may be used as sync patterns incase a length
 * is incorrect.  All values in an IP header are MSB first byte order.
 * 
 * <table cellspacing=0 border=1>
 *
 * <tr> <td>Bytes</td> <td>Item</td> <td>Notes</td>
 *
 * <tr>
 *  <td>0</td><td nowrap > Version & IHL</td>
 *  <td>
 *     This byte contains two items, which are fixed and may be used for
 *     sync.<br>
 *    <ul>
 *      <li><b>bits 7-4</b> The IP version, contains the value 0x4</li>
 *      <li><b>bits 3-0</b> Number of 32bit words in the IP header, called the
 *          the internet header length (IHL).  Contains the value 0x5.</li>
 *    </ul>
 *    Taken together this field always has the value <b>0x45</b>.
 *  </td>
 * </tr>
 *
 * <tr>
 * <td>1</td> <td nowrap >Type Of Service (TOS)</td>
 * <td>Always has the value <b>0x00</b> for our purposes.</td>
 * </tr>
 *
 * <tr>
 *  <td>2-3</td> <td>Total Length</td>
 *  <td>Size of the IP header plus data.  A 16-bit unsigned integer
 *    in MSB first byte order.  If no errors have occured this is an MSB
 *    version of the Packet Data Length in the Spacecraft Emulator Reader
 *    header.
 *  </td>
 * </tr>
 *
 * <tr>
 *   <td>4-5</td> <td>Identification</td>
 *   <td>Used for on the internet for packet fragmentation and reassembly.
 *   Always has the value <b>0x0000</b> for our purposes.
 *   </td>
 * </tr>
 *
 * <tr>
 *   <td>6-7</td> <td>Flags & Frag. Offset</td>
 *   <td>These fields are used for packet fragmentation control.  Our IP
 *   headers state that packets should not be fragmented, other values are
 *   zero.  Always has the value <b>0x4000</b>.
 *   </td>
 * </tr>
 *
 * <tr>
 *  <td>8</td> <td>Time To Live</td>
 *  <td>How long is the packet allowed to "live" on the network.  Always set
 *  to the maximum value of <b>0xFF</b> for waves packets.
 *  </td>
 * </tr>
 *
 * <tr>
 *  <td>9</td> <td>Protocol</td>
 *  <td>Always has the value <b>0x11</b> for UDP over IP.</td>
 * </tr>
 *
 *
 * <tr>
 *   <td>10-11</td> <td>Header Checksum</td>
 *   <td>A checksum computed over the IP header. (How does one do this
 *   when this field is not know at the time? Curious.)</td>
 * </tr>
 *
 * <tr>
 *   <td>12-15</td> <td>Source Address</td>
 *   <td>The 32-bit IP address of the packet source.  Waves has been 
 *   assigned the address, 192.168.1.11, which is <b>0xC0A8010b</b> hex.
 *   </td>
 * </tr>
 *
 * <tr>
 *   <td>16-19</td> <td>Destination Address</td>
 *   <td>The 32-bit IP address of the packet destination.  The Juno spacecraft
 *   command data systems has been assigned the address 192.168.0.1, which is
 *   <b>0xC0A80101</b> in hex.
 *   </td>
 * </tr>
 *
 * </table>
 *
 * All together the 20 byte sync pattern for an IP header is: <br> <br>
 * <b>
 * 0x45 0x00   ?    ?  0x00 0x00 0x40 0x00 0xFF 0x11
 *   ?    ?  0xC0 0xA8 0x01 0x0B 0xC0 0xA8 0x01 0x01
 * </b>
 * <br> <br>
 * Where "?" represetents any byte.
 *
 *
 * @section udp_header UDP Header
 *
 * This is a standard UPD header.  The total packet length and the checksum may
 * be of interest.
 *
 * <table cellspacing=0 border=1>
 *
 * <tr> <td>Bytes</td> <td>Item</td> <td>Notes</td> </tr>
 * 
 * <tr> <td>0-4</td> <td>Unknown</td> <td>-</td> </tr>
 *
 * <tr> <td>4-5</td> <td>UPD Length (MSB) </td>
 * <td>16-bit unsinged integer containing the total length in bytes comprising
 * the UDP header as well as the data</td>
 * </tr>
 *
 * <tr> <td>6-7</td> <td> UDP Checksum (MSB)</td> 
 *   <td>16-bit unsigned integer.  Value is computed by adding all 16-bit chucks
 *   of the UDP payload plus some additional bytes in the UDP and IP headers. If
 *   the resulting value is all zeros, it is set to all ones.
 *   </td>
 * </tr>
 *
 * </table>
 *
 *
 *
 *
 * @section cip_header CIP Header
 *
 * This protocol, riding on UPD is specific to Juno.
 * 
 * <table cellspacing=0 border=1>
 *
 * <tr> <td>Bytes</td> <td>Item</td> <td>Notes</td> </tr>
 *
 * <tr> <td>0-4</td> <td> CIP Protocol</td> 
 *      <td>an MSB 1st, unsigned 32bit integer</td> </tr>
 *
 * <tr> <td>5-6</td> <td> CIP Length (MSB)</td>
 *  <td>16-bit unsigned integer.  Unknown if length is just data section
 *   or both the data and this header.
 *  </td>
 * </tr>
 * 
 * <tr> <td>7</td> <td> CIP Data Type</td>
 *      <td>unsigned byte, 8 = Science, 7 = Burst, 6 = Housekeeping</td> </tr>
 * 
 * <tr> <td>8</td> <td> CIP ID</td> <td>TBD</td> </tr>
 *
 * </table>
 */
 
 /*@}*/
