\section{Framing}

% -----------------------------------------------------------------
\begin{slide}{}

   \subsection{Overview}

   Problem: Breaking sequence of bits into a frame
   \begin{sitem}
      \item Must determine first and last bit of the frame
      \item Typically implemented by network adaptor
      \item Adaptor fetches (deposits) frames out of (into) host memory
   \end{sitem}

   \pichere{node_link_2.eps,height=1.5in}
\end{slide}

% -----------------------------------------------------------------
\begin{slide}{}

   \subsection{Byte-Oriented Protocols}

   \begin{sitem}
      \item Sentinel Approach

      \begin{sitem}
         \item BISYNC

         \pichere{bisync.eps,height=0.5in}
 
         \bigskip
         \item IMP-IMP

         \pichere{imp.eps,height=0.5in}

         \item Problem: ETX character might appear in the data portion of 
          the frame.

         \item Solution: Escape the ETX character with a DLE character in 
          BISYNC; escape the DLE character with a DLE character in IMP-IMP.
      \end{sitem}
 
      \item Byte Counting Approach (DDCMP)

      \pichere{ddcmp.eps,height=0.5in}

      \begin{sitem}
         \item Problem: Count field is corrupted (framing error).
         \item Solution: Catch when CRC fails.
      \end{sitem}
   \end{sitem}
\end{slide}

% -----------------------------------------------------------------
\begin{slide}{}

\subsection{Bit-Oriented Protocols}

   HDLC: High-Level Data Link Control (also SDLC and PPP)
   
   \bigskip
   Delineate frame with a special bit-sequence: 01111110

   \pichere{hdlc.eps,height=0.5in}

   Bit Stuffing
   \begin{sitem}
      \item Sender: any time five consecutive 1s have been transmitted
       from the body of the message, insert a 0.
      \item Receiver: should five consecutive 1s arrive, look at next
       bit(s):
      \begin{sitem}
         \item if next bit is a 0: remove it
         \item if next bits are 10: end-of-frame marker
         \item if next bits are 11: error
      \end{sitem}
   \end{sitem}
\end{slide}

% -----------------------------------------------------------------
\begin{slide}{}

   \subsection{Clock-Based Framing}

   \begin{sitem}
      \item SONET: Synchronous Optical Network
      \item ITU standard for transmission over fiber
      \item STS-1 (51.84 Mbps)

      \pichere{sonet_frame.eps,height=2in}

      \item Byte-interleaved multiplexing

      \pichere{sonet1.eps,height=1.5in}

      \item Each frame is 125$\mu$s long.
   \end{sitem}
\end{slide}

