\section{IP Addresses}

\begin{frame}
   {IP Addresses}

   \begin{multicols}{2}
      \begin{itemize}
         \item IP addresses are  used to uniquely
         identify nodes across the internet.
         \item IP addresses are registered through \textbf{ISP}s
         \item An \textbf{IPv4} 32 bit address is
         composed of 4 \textbf{octets}
         \begin{kcode}
148.114.252.10
         \end{kcode}
         (An octet is just a byte, 8 bits.)
         \item An \textbf{IPv6} 128 bit address is
         composed of 8 16-bit octet pairs
         \begin{kcode}
2003:0db5:6123:0000:1f4f:0000:5529:fe23
         \end{kcode}
         \item There is a set of reserved addresses
         \item We will focus on \textbf{IPv4}, still most common in use
      \end{itemize}
      \begin{figure}[H]
         \includegraphics[height=1.29in]{IMAGES/IP_addresses}
         \caption{IP Addresses}
      \end{figure}
   \end{multicols}

\end{frame}

\cprotect\note{

}

\section{IPv4 Address Types}
\begin{frame}
   {IPv4 Address Types}

   \begin{itemize}
      \item Unicast
      \item Network
      \item Broadcast
      \item Multicast
   \end{itemize}

\end{frame}

\cprotect\note{

   \textbf{IPv4} address types include:
   \begin{itemize}
      \item \textbf{Unicast}:

      An address associated with a specific host.  It might
      be something like \texttt{140.211.169.4} or
      \texttt{64.254.248.193}.

      \item \textbf{Network}:

      An address whose \textbf{host} portion is set to all
      binary zeroes.  Ex. \texttt{192.168.1.0}. (The host
      portion can be the last 1-3 octets as discussed
      later; here it is just the last octet.)

      \item \textbf{Broadcast}:

      An address to which each member of a particular
      network will listen.  It will have the host portion
      set to all 1 bits, such as in \texttt{172.16.255.255}
      or \texttt{148.114.255.255} or
      \texttt{192.168.1.255}.  (The host portion is the
      last two octets in the first two cases, just the last
      one in the third case.)

      \item \textbf{Multicast}:

      An address to which appropriately configured nodes
      will listen.  The address \texttt{224.0.0.2} is an
      example of a multicast address.  Only nodes
      specifically configured to pay attention to a
      specific multicast address will interpret packets for
      that multicast group.
   \end{itemize}
}

\begin{frame}
   {Reserved Addresses}
   \begin{itemize}
      \item
      Loopback interfaces:
      \begin{kcode}
127.x.x.x
      \end{kcode}
      \item
      Address not given yet:
      \begin{kcode}
0.0.0.0
      \end{kcode}
      \item
      Generic Broadcast Private Address
      \begin{kcode}
255.255.255.255
      \end{kcode}
      \item
      Others
      \begin{kcode}
10.0.0.0 - 10.255.255.255
172.16.0.0 - 172.31.255.255
192.168.0.0 - 192.168.255.255
      \end{kcode}

   \end{itemize}
\end{frame}

\cprotect\note{

   Certain addresses and address ranges are reserved for
   special purposes:

   \begin{itemize}
      \item
      \begin{kcode}
127.x.x.x
      \end{kcode}
      Reserved for the loopback (local system) interface,
      where \texttt{0 <= x <= 254}. Generally,
      \texttt{127.0.0.1}.
      \item
      \begin{kcode}
0.0.0.0
      \end{kcode}
      Used by systems that do not yet know their own
      address. Protocols like \textbf{DHCP} and
      \textbf{BOOTP} use this address when attempting to
      communicate with a server.
      \item
      \begin{kcode}
255.255.255.255
      \end{kcode}
      Generic broadcast private address, reserved for
      internal use. These addresses are never assigned or
      registered to anyone.  They are generally not
      routable.
      \item
      Other examples of reserved address ranges include:
      \begin{kcode}
10.0.0.0 - 10.255.255.255
172.16.0.0 - 172.31.255.255
192.168.0.0 - 192.168.255.255
      \end{kcode}
      Each of these has a purpose. For example, the
      familiar address range, \texttt{192.168.x.x} is used
      only for local communications within a private
      network.
   \end{itemize}
   You can see a long list of reserved addresses for both
   \textbf{IPv4} and \textbf{IPv6} at
   \url{https://en.wikipedia.org/wiki/Reserved_IP_addresses}.

}

\section{IPv6 Address Types}
\begin{frame}
   {IPv6 Address Types}

   \begin{itemize}
      \item Unicast
      \item Multicast
      \item Anycast
      \item IPv4-mapped
   \end{itemize}

\end{frame}

\cprotect\note{

   \textbf{IPv6} address types include:
   \begin{itemize}
      \item
      \textbf{Unicast}:

      A packet is delivered to one interface.
      \begin{itemize}
         \item \textbf{Link-local}: Autoconfigured for every
         interface to have one. Non-routable.
         \item \textbf{Global}: Dynamically or manually
         assigned. Routable.
         \item Reserved for documentation.
      \end{itemize}

      \item \textbf{Multicast}:

      A packet is delivered to multiple interfaces.

      \item \textbf{Anycast}:

      A packet is delivered to the nearest of multiple
      interfaces (in terms of routing distance).

      \item \textbf{IPv4-mapped}:

      An \textbf{IPv4} address mapped to \textbf{IPv6}. For
      example, \texttt{::FFFF:a.b.c.d/96}
   \end{itemize}

   In addition, \textbf{IPv6} has some special types of
   addresses such as loopback, which is assigned to the
   \texttt{lo} interface, as \texttt{::1/128}

}

\section{IP Address Classes}
\begin{frame}
   {IPv4 Address Classes}

   \begin{itemize}
      \item Class A -- Highest order octet range 1-127
      \begin{itemize}
         \item 128 networks, 16,772,214 hosts per
         network, 127.x.x.x reserved for loopback
      \end{itemize}
      \item Class B -- Highest order octet range 128-191
      \begin{itemize}
         \item 16,384 networks, 65,534 hosts per network
      \end{itemize}
      \item Class C -- Highest order octet range 192-223
      \begin{itemize}
         \item 2,097,152 networks, 254 hosts per network
      \end{itemize}
      \item Class D -- Highest order octet range 224-239
      \begin{itemize}
         \item Multicast addresses
      \end{itemize}
      \item Class E -- Highest order octet range 240-254
      \begin{itemize}
         \item reserved address range
      \end{itemize}
   \end{itemize}

\end{frame}

\cprotect\note{

   Historically, IP addresses are based on defined
   classes.  Classes A, B, and C are used to distinguish
   a network portion of the address from a host portion
   of the address.  This is used for routing purposes.

   The Class A addresses use 8 bits for the network
   portion of the address and 24 bits for the host
   portion of the address.  The Class B addresses use 16
   and 16 bits respectively while the Class C addresses
   use 24 bits for the network portion and 8 bits for the
   host portion.

   Class D addresses are used for multicasting.  Class E
   addresses are currently not used.
}

\section{Netmasks}
\begin{frame}
   {Netmasks}

   \begin{itemize}
      \item Class A netmask
      \begin{itemize}
         \item \verb?255.0.0.0? in decimal
         \item \verb?ff:00:00:00? in hex
         \item \verb?11111111 00000000 00000000 00000000? in
         binary
      \end{itemize}
      \item Class B netmask
      \begin{itemize}
         \item \verb?255.255.0.0? in decimal
         \item \verb?ff:ff:00:00? in hex
         \item \verb?11111111 11111111 00000000 00000000? in
         binary
      \end{itemize}
      \item Class C netmask
      \begin{itemize}
         \item \verb?255.255.255.0? in decimal
         \item \verb?ff:ff:ff:00? in hex
         \item \verb?11111111 11111111 11111111 00000000? in
         binary
      \end{itemize}
   \end{itemize}

\end{frame}

\cprotect\note{

   The \textbf{netmask} is used to determine how much of the
   address is used for the network portion and how much
   for the host portion as we have seen.  It is also used
   to determine network and broadcast addresses.
   \begin{itemize}
      \item
      Class A addresses use 8 bits for the network portion of the
      address and 24 bits for the host portion of the address.
      \item
      Class B addresses use 16 for the network and 16 for the host.
      \item
      Class C addresses use 24 for the network and 8 for the host.
      \item
      Class D addresses are used for multicasting.
      \item
      Class E addresses are currently not used.
   \end{itemize}
   We can calculate the network address by anding
   (logical and - \&) the ip address and the netmask.  We
   are interested in the network address because they
   define a local network which consists of a collection
   of nodes connected via the same media and sharing the
   same network address.  All nodes on the same network
   can directly see each other.

   \begin{kcode}
ex.  172.16.2.17  ip address
    &255.255.0.0  netmask
   -----------------
     172.16.0.0   network address
   \end{kcode}
}

