\section{Internetworking}

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

   \pichere{inet.eps,height=3in}
   \pichere{ip_graph.eps,height=1.75in}
   Service Model
   \begin{sitem}
      \item Packet Delivery Model
      \item Global Addressing Scheme
   \end{sitem}
\end{slide}

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

   \subsection{Packet Delivery Model}

   \begin{sitem}
      \item Connectionless (datagram-based)
      \item Best-effort delivery (unreliable service)
      \begin{sitem}
         \item packets are lost
         \item packets are delivered out of order
         \item duplicate copies of a packet are delivered
         \item packets can be delayed for a long time
      \end{sitem}
      \item Datagram format
      \begin{sitem}
         \item Version (4): currently 4
         \item Hlen (4): number of 32-bit words in header
         \item TOS (8): type of service (not widely used)
         \item Length (16): number of bytes in this datagram
         \item Ident (16): used by fragmentation
         \item Flags/Offset (16): used by fragmentation
         \item TTL (8): number of hops this datagram has travelled
         \item Protocol (8): demux key (TCP=6, UDP=17)
         \item Checksum (16): of the header only
         \item DestAddr \& SrcAddr (32)
      \end{sitem}
   \end{sitem}
\end{slide}

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

   \subsection{Fragmentation and Reassembly}

   \begin{sitem}
      \item Each network has some MTU
      \item Strategy
      \begin{sitem}
         \item fragment when necessary (MTU $<$ Datagram)
         \item try to avoid fragmentation at source host
         \item refragmentation is possible
         \item fragments are self-contained datagrams
         \item use CS-PDU (not cells) for ATM
         \item delay reassembly until destination host
         \item do not recover from lost fragments
      \end{sitem}
      \item Example
   \end{sitem}
 
  \pichere{frag.eps,height=2.25in}

\end{slide}

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

   \pichere{fragment.eps,height=5in}

\end{slide}

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

   \subsection{Global Addresses}

   \begin{sitem}
      \item Properties
      \begin{sitem}
         \item globally unique
         \item hierarchical: network + host
      \end{sitem}

      \item Format
      \pichere{class.eps,height=2in}

      \item Dot notation
      \begin{sitem}
         \item 10.3.2.4
         \item 128.96.33.81
         \item 192.12.69.77
      \end{sitem}
   \end{sitem}
\end{slide}

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

   \subsection{Datagram Forwarding}

   \begin{sitem}
      \item Strategy
      \begin{sitem}
         \item every datagram contains destination's address
         \item if directly connected to destination network,
               then forward to host
         \item if not directly connected to destination network,
               then forward to some router
         \item forwarding table maps network number into next hop
         \item each host has a default router
         \item each router maintains a forwarding table
      \end{sitem}
      \item Example (router R2)

\begin{center}
\begin{tabular}{l|l}
\hline
Network Number & Next Hop \\
\hline
1 & R3\\
2 & R1\\
3 & interface 1\\
4 & interface 0
\end{tabular}
\end{center}

   \end{sitem}
\end{slide}

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

   \subsection{Address Translation}

   \begin{sitem}
      \item Map IP addresses into physical addresses
      \begin{sitem}
         \item destination host
         \item next hop router
      \end{sitem}

      \item Techniques
      \begin{sitem}
         \item encode physical address in host part of IP address
         \item table-based
      \end{sitem}

      \item ARP
      \begin{sitem}
         \item table of IP to physical address bindings
         \item broadcast request if IP address not in table
         \item target machine responds with its physical address
         \item table entries are discarded if not refreshed
      \end{sitem}
   \end{sitem}
\end{slide}

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

   \begin{sitem}
      \item Request format

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

      \begin{sitem}
         \item HardwareType: type of physical network (e.g., Ethernet)
         \item ProtocolType: type of higher layer protocol (e.g., IP)
         \item HLEN \& PLEN: length of physical and protocol addresses
         \item Operation: request or response
         \item Source/Target Physical/Protocol addresses
      \end{sitem}

      \item Notes
      \begin{sitem}
         \item table entries timeout in about 10 minutes
         \item update table with source when you are the target
         \item update table table if already have an entry
         \item do not refresh table entries upon reference
      \end{sitem}
   \end{sitem}
\end{slide}

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

   \subsection{Internet Control Message Protocol}

   \begin{sitem}
      \item Echo (ping)
      \item Redirect (from router to source host)
      \item Destination unreachable (protocol, port, or host)
      \item TTL exceeded (so datagrams don't cycle forever)
      \item Checksum failed
      \item Reassembly failed
      \item Cannot fragment
   \end{sitem}
\end{slide}      

