summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--assignment3.tex26
1 files changed, 16 insertions, 10 deletions
diff --git a/assignment3.tex b/assignment3.tex
index b779e7e..c50e5c2 100644
--- a/assignment3.tex
+++ b/assignment3.tex
@@ -47,33 +47,33 @@
\section{Design a protocol}
See \autoref{fig:3-fsm}.
-\section{Analyse protocols}
-\def\trans#1#2{\footnotesize{\texttt{\uline{#1\hfill\mbox{}}\\#2}}}
+\def\trans#1#2{\footnotesize{\texttt{\uline{#1\hfill\mbox{}}\\[2pt]#2}}}
\tikzstyle{trans}=[every trans]
\begin{figure}[h]
+ \def\nl{\\[-3pt]}
\centering
\begin{subfigure}{\textwidth}
\centering
\begin{tikzpicture}[node distance=35mm,->,>=stealth',every trans/.style={text width=4cm},every state/.style={ellipse}]
\node[initial,state] (a1) {Wait/Send};
- \node[state,right of=a1] (a2) {Retry/Wait};
+ \node[state,right of=a1] (a2) {Wait/Receive};
- \path (a1) edge[bend left] node[trans,above] {\trans{rdt\_send(data)}{packet=make\_pkt(data)\\udt\_send(packet)}} (a2)
- (a2) edge[loop right,looseness=4.5] node[trans,right] {\trans{rdt\_unable\_to\_send(data)}{packet=make\_pkt(data)\\udt\_send(data)}} (a2)
- edge[bend left] node[trans,below] {\trans{rdt\_rcv(packet)}{extract(packet,data)\\deliver\_data(data)}} (a1);
+ \path (a1) edge[bend left] node[trans,above] {\trans{rdt\_send(data)}{packet=make\_pkt(data)\nl udt\_send(packet)}} (a2)
+ (a2) edge[loop right,looseness=4.5] node[trans,right] {\trans{rdt\_send(data)}{rdt\_unable\_to\_send(data)}} (a2)
+ edge[bend left] node[trans,below] {\trans{rdt\_rcv(packet)}{extract(packet,data)\nl deliver\_data(data)}} (a1);
\end{tikzpicture}
\caption{Entity A}
\end{subfigure}
\begin{subfigure}{\textwidth}
\centering
\begin{tikzpicture}[node distance=35mm,->,>=stealth',every trans/.style={text width=4cm},every state/.style={ellipse}]
- \node[state] (b1) {Retry/Wait};
+ \node[state] (b1) {Wait/Receive};
\node[state,right of=b1] (b2) {Wait/Send};
\draw[<-] (b1) -- ++(-7mm,7mm) node[above left] {start};
- \path (b2) edge[bend left] node[trans,below] {\trans{rdt\_send(data)}{packet=make\_pkt(data)\\udt\_send(packet)}} (b1)
- (b1) edge[loop left,looseness=4.5] node[trans,left] {\trans{rdt\_unable\_to\_send(data)}{packet=make\_pkt(data)\\udt\_send(data)}} (b1)
- edge[bend left] node[trans,above] {\trans{rdt\_rcv(packet)}{extract(packet,data)\\deliver\_data(data)}} (b2);
+ \path (b2) edge[bend left] node[trans,below] {\trans{rdt\_send(data)}{packet=make\_pkt(data)\nl udt\_send(packet)}} (b1)
+ (b1) edge[loop left,looseness=4.5] node[trans,left] {\trans{rdt\_send(data)}{rdt\_unable\_to\_send(data)}} (b1)
+ edge[bend left] node[trans,above] {\trans{rdt\_rcv(packet)}{extract(packet,data)\nl deliver\_data(data)}} (b2);
\end{tikzpicture}
\caption{Entity B}
\end{subfigure}
@@ -81,5 +81,11 @@ See \autoref{fig:3-fsm}.
\label{fig:3-fsm}
\end{figure}
+\section{Analyse protocols}
+\begin{description}
+ \item[GBN] As long as we cannot send two packets with the same sequence number at the same time, we're fine. A GBN receiver discards all packets but the packet it expects. Therefore, the largest allowable sender window is $k$.
+ \item[SR] It should not be the case that the receiver \emph{expects} a packet with sequence number $N$ \emph{and} finds another packet with sequence number $N$ \emph{acceptable}. Therefore, the largest allowable sender window (which equals the largest allowable receiver window) is $k$ for this protocol as well.
+\end{description}
+
\end{document}