%% LyX 1.1 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[twocolumn]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\setlength\parskip{\medskipamount}
\setlength\parindent{0pt}

\makeatletter


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\providecommand{\LyX}{L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\setlength\parskip{\medskipamount}
\setlength\parindent{0pt}

\makeatletter


\usepackage[T1]{fontenc}
\setlength\parskip{\medskipamount}
\setlength\parindent{0pt}

\makeatletter


\usepackage[T1]{fontenc}
\setlength\parskip{\medskipamount}
\setlength\parindent{0pt}

\makeatletter


\setlength{\oddsidemargin}{-0.5in}
\setlength{\evensidemargin}{-0.5in}
\setlength{\topmargin}{0.0in}
\setlength{\headheight}{0in}
\setlength{\headsep}{0in}
\setlength{\textwidth}{7.0in}
\setlength{\textheight}{9.5in}
\setlength{\parindent}{0in}
\setlength{\parskip}{0.1in}
\setlength{\columnseprule}{0.4pt}

\makeatother

\makeatother

\makeatother


\makeatother

\begin{document}

Name: \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

\textbf{Directions: Work only on this sheet (on both sides, if needed); do not
turn in any supplementary sheets of paper. There is actually plenty of room
for your answers, as long as you organize yourself BEFORE starting writing.
In order to get full credit, SHOW YOUR WORK. Earlier problems tend to be easier.}

\textbf{1.} (10) What does the `d' in {}``fiveinarowd{}'' stand for?

\textbf{2.} (10) Show how line 36 of the source code for our \textbf{wps} program
would change if we were to use UDP instead of TCP.

\textbf{3.} (15) On p.6 of the printed lecture notes unit on the physical layer,
we reported that \( a_{1}=\frac{4}{\pi } \). Set up an expression involving
integrals which gave this result. (Don't evaluate the integrals, but your expression
must be evaluatable to \( \frac{4}{\pi } \)by anyone who knows calculus.)

\textbf{4.} (10) It was stated in class that transmission errors usually don't
matter much for some kinds of data, say audio or video. Cite a specific sentence
in Leon-Garcia which describes an exception to this.

\textbf{5.} This question is about Table 2.2 in Leon-Garcia.

\begin{itemize}
\item (a) (10) State the specific system call which will be used in Event 1. 
\item (b) (10) In Event 3, from which UNIX file will the resolver get the destination
address? 
\end{itemize}
\textbf{6.} (10) Suppose we have a frame of bits to send, and have a choice
of copper wire and optical fiber, for the same distance to the destination.
We want the final bit to reach the destination as early as possible. State which
of the following would be true: (i) Copper would be better for both very short
and very long frames. (ii) Copper would be better for very short frames but
optical fiber would be better for the very long ones. (iii) Copper would be
better for the very long frames but optical fiber would be better for the very
short ones. (iv) Optical fiber would be better for both the very short and very
long frames.

\textbf{7.} (15) Consider an asynchronous transmission line which uses k = 8
and even parity. Suppose each of the 9 bits, including the Parity bit, has probability
p of being corrupted. Find the probability that the receiver will declare that
an error has occurred in this character.

\textbf{8.} (10) State in detail how we would use \textbf{telnet} to send an
e-mail message to abc@xyz.com, with the message consisting of just \char`\"{}Hello!\char`\"{}
We are def@uvw.org.

\textbf{Solutions:}

\textbf{1.} {}``Daemon.{}''

\textbf{2.} Change SOCK\_STREAM to SOCK\_DGRAM.

\textbf{3. \( 2\left( \int ^{0.25}_{0}cos(2\pi t)dt+\int ^{0.75}_{0.25}(-1)cos(2\pi t)dt+\int ^{1}_{0.75}cos(2\pi t)dt\right)  \).}
Many other forms are possible, e.g. \( 2\left( \int ^{0.5}_{0}cos(2\pi t)dt_{}+\int ^{1}_{0.5}(-1)cos(2\pi t)dt\right)  \).

\textbf{4.} P.102, sentence about linear predictive coding.

\textbf{5.(a)} gethostbyname().

\textbf{5.(b)} /etc/resolv.conf.

\textbf{6.} (ii). The textbook noted that the signal travels faster in copper.
(The problem with optical fiber is that the light travels a crooked path as
it bounces between the walls of the fiber, thus traveling a longer distance.)
Thus copper has lower latency. But optical fiber has higher bandwidth.

\textbf{7.} An error will be reported if either the parity bit is uncorrupted
and there are an odd number of errors in the character itself, or if the parity
bit is corrupted and there are an even number of errors in the character. Thus
the probability of an error report is

\[
(1-p)\sum _{k=1,3,5,7}\left( \begin{array}{c}
8\\
k
\end{array}\right) p^{k}(1-p)^{8-k}+p\sum _{k=0,2,4,6,8}\left( \begin{array}{c}
8\\
k
\end{array}\right) p^{k}(1-p)^{8-k}\]


8. The key point is to note that you can telnet into port 25 of the destination
machine. You then use the SMTP steps.

\begin{verbatim}

telnet xyz.com 25
HELO uvw.org
MAIL FROM: def@uvw.org
RCPT TO: abc@xyz.com
DATA
Hello!
.
QUIT
\end{verbatim}


\end{document}

