<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\documentclass[a4paper,9pt]{article}

\author{Camil Staps\\\small{s4498062}}
\title{Networking\\\large{Assignment 5}}
\date{April 27, 2016}

\usepackage{polyglossia}
\setmainlanguage{english}
\usepackage{geometry}
\usepackage{enumitem}
\setenumerate{label=\alph*)}
\usepackage{amsmath}
\usepackage{minted}

\begin{document}

\maketitle

\section{Packet forwarding}
\begin{enumerate}
	\item
		\begin{tabular}{l | l}
			Dest. addr. &amp; Interface \\\hline
			H1          &amp; 1         \\
			H2          &amp; 2         \\
			H3          &amp; 3         \\
		\end{tabular}

	\item No: in a datagram network, the forwarding table entries are tuples of
		destination address prefixes and link interfaces. There is no way to
		distinguish packets coming from host H1 from packets coming from host H2.

	\item
		\begin{tabular}{l | l | l | l}
			\multicolumn{2}{c|}{Incoming} &amp; \multicolumn{2}{c}{Outgoing} \\\hline
			Interface &amp; VC\# &amp; Interface &amp; VC\# \\\hline
			1         &amp; 13   &amp; 3         &amp; 23   \\
			2         &amp; 37   &amp; 4         &amp; 47   \\
		\end{tabular}

	\item
		\begin{enumerate}[label=\Alph*.]
			\setcounter{enumii}{1}
			\item
				\begin{tabular}{l | l | l | l}
					\multicolumn{2}{c|}{Incoming} &amp; \multicolumn{2}{c}{Outgoing} \\\hline
					Interface &amp; VC\# &amp; Interface &amp; VC\# \\\hline
					1         &amp; 23   &amp; 2         &amp; 33   \\
				\end{tabular}

			\item
				\begin{tabular}{l | l | l | l}
					\multicolumn{2}{c|}{Incoming} &amp; \multicolumn{2}{c}{Outgoing} \\\hline
					Interface &amp; VC\# &amp; Interface &amp; VC\# \\\hline
					1         &amp; 47   &amp; 2         &amp; 57   \\
				\end{tabular}

			\item
				\begin{tabular}{l | l | l | l}
					\multicolumn{2}{c|}{Incoming} &amp; \multicolumn{2}{c}{Outgoing} \\\hline
					Interface &amp; VC\# &amp; Interface &amp; VC\# \\\hline
					1         &amp; 33   &amp; 3         &amp; 43   \\
					2         &amp; 57   &amp; 3         &amp; 67   \\
				\end{tabular}
		\end{enumerate}
\end{enumerate}

\section{Switching}
\begin{enumerate}[label=\arabic*.]
	\item Only one packet can be handled at the same time, so we may have to wait
		for $n-1$ packets. That gives a delay of $(n-1)\cdot D$.
	\item Every packet goes to a different output port, so we will never go over
		the bus bandwidth (which is at least 1). Therefore, there is no queuing
		delay in this case.
	\item Every packet goes to a different output port and therefore uses a
		different vertical bar in the interconnection network. Queuing can only
		occur when two packets need the same vertical line, but as explained this
		cannot happen. Therefore, there is no queuing delay in this case either.
\end{enumerate}

\section{Subnets}
223.1.17.128/26 can support up to 64 addresses (so also 60).\\
223.1.17.0/25 can support up to 128 addresses (so also 90).\\
223.1.17.192/26 can support up to 64 addresses (so also 12).

The subnets do not conflict; their binary prefixes in the last byte are
\texttt{10}, \texttt{0} and \texttt{11} respectively.

\section{ICMP Traceroute}
\texttt{do\_one\_ping} and the underlying functions have been adapted to return
a tuple \texttt{(address, icmp\_type)} (or \texttt{(None, None)} in case of a
timeout).

The function \texttt{ping} has been replaced by \texttt{traceroute}. This uses
a counter \texttt{i} to increase the TTL of the echo requests we send. For each
TTL we call \texttt{do\_one\_ping} which gives us either \texttt{(None, None)}
if no server responded, or \texttt{(address, icmp\_type)}, where
\texttt{icmp\_type} is either \texttt{ICMP\_ECHO\_REPLY} or
\texttt{ICMP\_TIME\_EXCEEDED}. We can use this to stop (in case of a reply) or
continue (in case of a TTL excess).

The logic may be found in \texttt{traceroute}:

\inputminted[linenos,xleftmargin=1cm,firstline=102,lastline=118]{python}%
	{assignment5/traceroute.py}

\end{document}

</pre></body></html>