summaryrefslogtreecommitdiff
path: root/assignment7.tex
blob: fc55fe4f2d94dd8b1c54f66175450be9cd33a739 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
\documentclass[a4paper,9pt]{article}

\author{Camil Staps\\\small{s4498062}}
\title{Networking\\\large{Assignment 7}}
\date{May 22, 2016}

\usepackage{polyglossia}
\setmainlanguage{english}
\usepackage{geometry}
\usepackage[hidelinks]{hyperref}
\usepackage{amsmath}
\usepackage{enumitem}
\usepackage{subcaption}
\usepackage{verbatimbox}

\begin{document}

\maketitle

\section{Cyclic Redundancy Checks}
\begin{enumerate}[label=\alph*)]
	\item It computes the remainder of $(D\cdot2^r\oplus R) \div G$, and checks
		that it equals $0$.
	\item See \autoref{fig:longdiv:b}. The answer is \texttt{111}.
	\item See \autoref{fig:longdiv:c}. The answer is \texttt{010}.
	\item See \autoref{fig:longdiv:d}. The answer is \texttt{111}.
\end{enumerate}

\begin{figure}[h]
	\small
	\begin{subfigure}[b]{.32\linewidth}
		\centering
		\begin{verbbox}
			1001010101 000
			1001
			0000010101 000
			     1001
			0000000111 000
			       100 1
			0000000011 100
			        10 01
			0000000001 110
			         1 001
			0000000000 111
		\end{verbbox}
		\theverbbox%
		\caption{\label{fig:longdiv:b}}
	\end{subfigure}
	\begin{subfigure}[b]{.32\linewidth}
		\centering
		\begin{verbbox}
			0101101010 000
			 1001
			0001001010 000
			   1001
			0000000010 000
			        10 01
			0000000000 010
		\end{verbbox}
		\theverbbox%
		\caption{\label{fig:longdiv:c}}
	\end{subfigure}
	\begin{subfigure}[b]{.32\linewidth}
		\centering
		\begin{verbbox}
			1010100000 000
			1001
			0011100000 000
			  1001
			0001110000 000
			   1001
			0000111000 000
			    1001
			0000011100 000
			     1001
			0000001110 000
			      1001
			0000000111 000
			       100 1
			0000000011 100
			        10 01
			0000000001 110
			         1 001
			0000000000 111
		\end{verbbox}
		\theverbbox%
		\caption{\label{fig:longdiv:d}}
	\end{subfigure}
	\caption{Computing CRC using long division\label{fig:longdiv}}
\end{figure}

\section{Address Resolution Protocol}
\begin{enumerate}
	\item We call the left router R and the right router S. Let $R_i$ be the
		interface of router $R$ for subnet $i$. Then:

			A --- 192.168.1.100; B --- 192.168.1.200;\\
			C --- 192.168.2.100; D --- 192.168.2.200;\\
			E --- 192.168.3.100; F --- 192.168.3.200;\\
			R$_1$ --- 192.168.1.1; R$_2$ --- 192.168.2.1;\\
			S$_2$ --- 192.168.2.2; S$_3$ --- 192.168.3.2;\\

	\item
		A --- 00.00.00.00.00.A0; B --- 00.00.00.00.00.B0;\\
		C --- 00.00.00.00.00.C0; D --- 00.00.00.00.00.D0;\\
		E --- 00.00.00.00.00.E0; F --- 00.00.00.00.00.F0;\\
		R$_1$ --- 88.88.88.00.00.00; R$_2$ --- 88.88.88.00.88.00;\\
		S$_2$ --- 88.88.88.88.00.00; S$_3$ --- 88.88.88.88.88.00.

	\item Host E looks up the MAC address of the first hop router (S$_3$), and
		sends the datagram there. Router S receives the datagram, figures out that
		the next hop is router R, looks up the MAC address of R$_2$ and sends the
		datagram there. Router R then forwards the datagram in a frame to host B on
		interface R$_1$. Concretely, the following frames are sent:

		\begin{table}[h]
			\centering
			\begin{tabular}{l l l l}
				Src. IP       & Src. MAC          & Dest. IP      & Dest. MAC \\\hline
				192.168.3.100 & 00.00.00.00.00.E0 & 192.168.3.2   & 88.88.88.88.88.00\\
				192.168.2.2   & 88.88.88.88.88.00 & 192.168.2.1   & 88.88.88.00.88.00\\
				192.168.1.1   & 88.88.88.00.88.00 & 192.168.1.200 & 00.00.00.00.00.B0\\
			\end{tabular}
		\end{table}

	\item The same happens, but before E can send the frame to S$_3$, it has to
		get to know its address. It sends an ARP request to the broadcast address
		with the request for 192.168.3.2's (that is, S$_3$'s) MAC address. The
		router replies with an ARP packet. After this, E has all the addresses it
		needs (and all other nodes as well), so the same as above happens.

		\begin{table}[h]
			\centering
			\begin{tabular}{l l l l l}
				Src. IP       & Src. MAC          & Dest. IP      & Dest. MAC         & Protocol\\\hline
				192.168.3.100 & 00.00.00.00.00.E0 & 192.168.3.2   & FF.FF.FF.FF.FF.FF & ARP\\
				192.168.3.2   & 88.88.88.88.88.00 & 192.168.3.100 & 00.00.00.00.00.E0 & ARP\\
				192.168.3.100 & 00.00.00.00.00.E0 & 192.168.3.2   & 88.88.88.88.88.00 & IP\\
				192.168.2.2   & 88.88.88.88.88.00 & 192.168.2.1   & 88.88.88.00.88.00 & IP\\
				192.168.1.1   & 88.88.88.00.88.00 & 192.168.1.200 & 00.00.00.00.00.B0 & IP\\
			\end{tabular}
		\end{table}
\end{enumerate}

\section{Self-learning}
\begin{enumerate}[label=(\roman*)]
	\item The switch learns the MAC address of host B. Since it doesn't know
		where host E is, it forwards the frame to all links (except the one of B).
	\item The switch learns the MAC address of host E. Since it knows where host
		B is, it forwards the frame only to that host.
	\item The switch learns the MAC address of host A. Since it knows where host
		B is, it forwards the frame only to that host.
	\item The switch knows where host A is, it forwards the frame only to that
		host.
\end{enumerate}

\section{All things learned put together}
%todo

\end{document}