\documentclass{ictlab}
%\documentclass[solutions]{ictlab}

% Copyright (c) 2003 by Nick Urbanik <nicku(at)nicku.org>.
% This material may be distributed only subject to the terms and
% conditions set forth in the Open Publication License, v1.0 or later
% (the latest version is presently available at
% http://www.opencontent.org/openpub/).

\RCS $Revision: 1.3 $

\usepackage{verbatim,key,alltt,amstext,answer2}
\usepackage[hang,bf,nooneline]{caption2}
\ifx\pdftexversion\undefined \else
  \usepackage[pdfpagemode=None,pdfauthor={Nick Urbanik}]{hyperref}
\fi

\newcommand*{\labTitle}{Revision Exercises with Perl, routing,
  switching and LDAP}
\renewcommand*{\floatpagefraction}{0.75} % default is .5, to increase
% density.
\renewcommand*{\bottomfraction}{0.6} % default is 0.3
\renewcommand*{\topfraction}{0.85} % default is 0.7
\renewcommand*{\textfraction}{0.1} % default is 0.2

\providecommand*{\IP}{\acro{IP}\xspace}
\providecommand*{\PDU}{\acro{PDU}\xspace}
\providecommand*{\IETF}{\acro{IETF}\xspace}

\begin{document}

%% \section{Background}
%% \label{sec:background}


%% \subsection{Perl}
%% \label{sec:perl}

%% Refer to the summary of Perl, from the subject web site.  I will not
%% repeat that here.


%% \subsection{Routing}
%% \label{sec:routing}


%% \begin{itemize*}
%% \item 
%% \end{itemize*}


%% \section{Questions}
%% \label{sec:questions}

\section{Perl}
\label{sec:perl}

\begin{enumerate}
\item Write a regular expression to match two or more ``\texttt{x}''s
  followed by one or more ``\texttt{y}''s followed by any number of
  ``\texttt{z}''s.

\item Write a regular expression to match any number of backslashes
  ``\bs'' followed by any number of asterisks ``\texttt{*}''.  Note
  that ``any number'' might be zero.

  \begin{figure}[htb]
\begin{verbatim}
MSRP6604R1    Student Progression Rank Details                Page 1 of 4
Academic Year : 2002/03          Course Board Control No.          APS1238

Progression Course : 95551/2    in HW
                          95570/2    in LW
                          95573/2    in LW
                          95731/2    in LW
Code        Student No.    Name                 Attained  Loc Course/YearClass
95551/2     987654321      WAN Siu Ming (970)       41.0   TY      41230/1G
95551/2     976543210      FUNG Siu Ming (618)      42.1   TY      41456/2B
95551/2     965432109      YUET Siu Ming (639)      43.2   TY      41789/3B
95551/2     954321098      WONG Siu Ming, Joe (571) 44.3   TY      41012/1G
95551/2     943210987      KLIE Siu Ming (486)      45.4   TY      41345/2G
95551/2     932109876      WANG Siu Hing (370)      46.5   TY      41678/3G
95551/2     921098765      WONG Siu Ming (436)      47.6   TY      41901/1G
95551/2     910987654      FONG Siu Ming (359)             TY      41234/3G
95570/2     909876543      HO Siu Ming (133)        49.8   TY      41567/2B
\end{verbatim}
    \caption{A text file containing data}
    \label{fig:data}
  \end{figure}
\item Figure~\vref{fig:data} shows a text file containing data.  Write
  a Perl program to print all student numbers.
\item Write a perl program to print the course, year and class, each
  in a separate column, separated by a tab character.
\item Write a perl program to generate a password for each student
  according to the following algorithm:
  \begin{itemize}
  \item Take the student's name (but without the number in brackets);
  \item Remove all spaces and non-alphabetical characters from the
    name;
  \item Use the first eight characters left, append them to the last
    four digits of the student number.
  \end{itemize}
  Your program should print:
  \begin{itemize}
  \item the student number;
  \item the full name of the student;
  \item the student's generated password
  \end{itemize}
  all separated by a single tab character.  There should be one line
  of output per student.
\end{enumerate}

\section{Routing and Switching}
\label{sec:routing-and-switching}

\begin{enumerate}
\item Before a set of candidate network routes can be aggregated, they
  must be in the \underline{\mbox{\hspace*{30mm}}}, and the routes in
  binary format must have the \underline{\mbox{\hspace*{30mm}}}.

  \begin{figure}[htb]
    \centering%
    \includegraphics[width=0.8\linewidth]{routing-question-1}
    \caption{A network with five routers and ten subnets.}
    \label{fig:routing-question-1}
  \end{figure}
\item Figure~\vref{fig:routing-question-1} shows a network with 5
  routers and 10 subnets.  You may select \IP addresses from the block
  of addresses 172.12.0.0/19.  You must leave at least one quarter of
  these addresses available for other purposes.  The requirements are
  that each of subnets 1, 2,\ldots, 8 must support up to 130
  computers, while subnets 9 and 10 must each support up to 600
  computers.
  \begin{enumerate}
  \item Allocate a suitable block of addresses to each of the ten
    subnets that will allow maximum route aggregation.
  \item \label{que:no-summarisation}Given your selection in the
    previous part, with \emph{no} route summarisation active on the
    routers, list the routes that would be advertised by router A at
    X, by router B at W, by router C at V, by router D at Y, and by
    router E at Z\@.
  \item What would be a necessary requirement for the routers to
    support route aggregation?
  \item Repeat part~\ref{que:no-summarisation}, but for the case where
    the routers all support route summarisation.
  \end{enumerate}
  
%% \item Distinguish between a \emph{broadcast domain} and a
%%   \emph{collision domain}.
  
%% \item For each of the following, list at least two network devices
%%   that can separate a single network into:
%%   \begin{enumerate}
%%   \item two collision domains
%%   \item two broadcast domains
%%   \end{enumerate}

\item When using portable notebook computers that should remain on one
  subnet, what type of \VLAN should be employed?  Are there any
  difficulties in supporting such a \VLAN arrangement?

%% \item List two advantages of using switches in a large network, and
%%   one important limitation.

  \begin{figure}[htb]
    \centering%
    \includegraphics[width=0.3\linewidth]{switches-q1}
    \caption{Two switches, each with five ports.}
    \label{fig:switches-q1}
  \end{figure}
\item Two switches each have five ports, as shown in
  figure~\vref{fig:switches-q1}.  Both switches are to support three
  \VLAN{}s, \VLAN{}1, \VLAN{}2 and \VLAN{}3.  Computers will be connected to
  each of these three \VLAN{}s on each of the two switches.
  \begin{enumerate}
  \item Each \VLAN is to support a separate subnet.  How would you
  connect the switches so that computers on each \VLAN can communicate
  with each other?

  Support your answer with a diagram showing the connection of the
  switches.  Label the \VLAN{}s.  Indicate whether each port is a
  trunk port or an access port.
  
\item One additional port is added to each switch.  Now two users with
  portable computers, one belonging to \VLAN{}2 and the other
  belonging to \VLAN{}3 want to be able to plug into the newly added
  port on either switch and remain in their respective \VLAN without
  any manual configuration.  How should you configure the new ports in
  each switch to facilitate this?
  \end{enumerate}
\end{enumerate}


\section{Directories and LDAP}
\label{sec:ldap}

Many of you have not completed the tutorial sheet ``\LDAP Filters and
Searching \LDAP directories.''  I suggest that you complete it.

\end{document}
