Commits

Bendik R. Opstad  committed 8076e47

Converted som images from PDF to tikz format and added new images

  • Participants
  • Parent commits f38a1e2

Comments (0)

Files changed (14)

File oppgave/chapter2.tex

  ssthresh = max (FlightSize / 2,\hspace{1mm} 2*SMSS)
 \end{equation}
 
+
+\begin{figure}
+\centering
+\begin{subfigure}[b]{\textwidth}
+\centering
+\input{images/latex/tcp_cong_RTO_slow_start} % Include image code
+\caption{RTO triggers a \gls{CWND} reduction}
+\label{figure:backoff-rtt-pif}
+\end{subfigure}%
+\\[1cm]
+\begin{subfigure}[b]{\textwidth}
+\centering
+\input{images/latex/tcp_cong_dupacks_fast_recovery} % Include image code
+\caption{Three dupacks triggers fast retransmit and fast recovery}
+\label{figure:backoff-rtt-pif}
+\end{subfigure}%
+\caption[AIMD: With RTO and 3 dupacks causing a fast retransmit]%
+{\gls{AIMD}: With RTO and 3 dupacks causing a fast retransmit}
+\end{figure}
+
 \subsubsection{TCPs Exponential Backoff}
 
 With no packet loss, \gls{TCP} will not have any major drawbacks compared to
 (\cref{eqn:jains-fairness-index}). The fairness index is calculated by using the
 end-to-end throughput for streams that share a path, or parts of a path, through
 the network, for all the streams. The fairness index ranges from 0 to 1, where 1
-when all streams are allocated an equals share.
+when all streams are allocated an equal share.
 
 \begin{equation}
  \label{eqn:jains-fairness-index}
 the traffic from the clients would not. The traffic sent from the clients would
 not contain redundant data and would behave normally.
 
+\begin{figure}%[H]
+\begin{figurebox}[label={figure:ethernet-frame}]
+\centering
+\resizebox{\textwidth}{!}{\input{images/latex/ethernet_frame} }
+\end{figurebox}
+\caption{Example of an Ethernet frame}
+\end{figure}
+
 
 \section[Tests of thin-stream modifications]
 {Tests of thin dupACK and Linear Retransmission Timeout options}
 \begin{subfigure}[b]{0.9\textwidth}
 \label{figure:thin-loss-3dupacks}
 \includegraphics[width=\textwidth]{thin_loss_timeline}
-\caption{Thin stream timeline with \gls{fast-retransmit} after 3 \glspl{dupACK}}
+\caption{\Gls{fast-retransmit} triggered after 3 \glspl{dupACK}}
 \end{subfigure}%
 \\[1cm]
 \begin{subfigure}[b]{0.9\textwidth}
 \label{figure:thin-loss-thin-dupack1-itt100}
 \includegraphics[width=\textwidth]{thin_loss_timeline_thin_dupack1_itt100}
-\caption{Thin stream timeline with \gls{fast-retransmit} after 1 \gls{dupACK}}
+\caption{\Gls{fast-retransmit} triggered after 1 \gls{dupACK}}
 \end{subfigure}%
 \end{figurebox}
 \caption{Timelines showing when \gls{fast-retransmit} is triggered}

File oppgave/chapter3.tex

 version 2.6.15 they were working on, the function
 \code{tcp_retrans_try_collapse} was only called once to merge two adjacent
 \glspl{SKB}, so the idea was to modify this to do this multiple times, as the
-current kernel (3.13) code does.
+current \gls{linux-kernel} code does.
 
 Building upon this idea, \citen{evensen-2008} implemented a more aggressive
 bundling mechanism which also bundled old data when transmitting packets with
 \begin{figure}%[H]
 \begin{figurebox}[label={figure:tcp-output-queue}]
 \centering
-\includegraphics[scale=0.5]{TCP_output_queue}
+%\includegraphics[scale=0.5]{TCP_output_queue}
+\resizebox{0.8\textwidth}{!}{\input{images/latex/tcp_output_queue} }
 \end{figurebox}
 \caption{The TCP output queue}
 \end{figure}
 \begin{figure}%[H]
 \begin{figurebox}[label={figure:tcp-output-callgraph}]
 \centering
-\includegraphics[scale=0.4]{TCP_output_callgraph}
+%\includegraphics[scale=0.4]{TCP_output_callgraph}
+\resizebox{\textwidth}{!}{\input{images/latex/tcp_linux_callgraph} }
 \end{figurebox}
 \caption{Call graph of TCP in Linux}
 \end{figure}
 
 \citen{TCP-friendly-Congestion-Control-for-Real-time-Streaming-Applications-2006}
 
-% \psset{xunit=7cm,yunit=0.6cm}
-% \def\xlim{1}
-% \def\ylim{16}
-% \begin{pspicture*}(-\xlim,-\ylim)(\xlim,\ylim)
-% \psaxes[Dx=0.5,Dy=5]{<->}(0,0)(-\xlim,-\ylim)(\xlim,\ylim)
-% \psplot[plotpoints=500,showpoints=false,algebraic]{-1}{1}{sin(1/x)/x}
-% \end{pspicture*}
-%\pgfplotsset{samples y={0,5,10,...,20}}
-
-
 \begin{figure}
-	\centering
-	\begin{tikzpicture}
-	\begin{axis}[
-			xlabel=RTTs to wait,
-			ylabel=CWND,
-            ytick={1,3,5,7,10,20}]
-		\addplot coordinates {
-			(0,20)
-			(0,11)
-			(1,10)
-			(1,8)
-			(1,7)
-			(1.5,6)
-			(2,5)
-			(2.5,4)
-			(3,3)
-			(4,2)
-			(5,1)
-		};
-        \addplot[domain=0:5](x,{((x-6)/2)^2});
-        table[x=x,y=y]{datafile.dat};
-
-	\legend{Manual,$y = ((x-6)/2)^2$}
-	\end{axis}
-	\end{tikzpicture}
-	\caption{X Axis is RTTs to wait before deciding wether to reduce}
+\input{images/latex/rdb_cong_rtt_backoff} % Include image code
+
+\subcaptionbox{RTTs to wait for vs PIF}{
+  \rdbBackoffPlot
+}
+~~~~
+%\\[1cm] \cref{figure:backoff-rtt-pif}
+\subcaptionbox{The table data in }{
+  % \label{figure:thin-loss-thin-dupack1-itt100}
+  \rdbBackoffTable
+}
+\caption{Shows the RTTs to wait vs packets in flight for a stream}
 \end{figure}
 
+
 \subsubsection{TCP Friendly Rate Control (TFRC)}
 \gls{TFRC} defined in \citerfc{rfc5348}. \atodo[inline]{Check if this is relevant?}
 
     struct module   *owner;
 };
 \end{ccode}
-\boxcaption{codelisting}{Entry points for tcp congestion control module in the Linux kernel}
+\boxcaption{codelisting}{Entry points for tcp congestion control module in the \gls{linux-kernel}}
 
 
 
 retransmitted. When a \gls{SKB} is to be retransmitted, \code{tcp_retrans_collapse}
 will be called with the \gls{SKB} as argument.
 
+
 \begin{figure}%[H]
 \begin{figurebox}[label={figure:tcp-retrans-collapse}]
 \centering
-\includegraphics[scale=0.4]{TCP_retrans_collapse_callgraph}
+\resizebox{0.5\textwidth}{!}{\input{images/latex/tcp_retrans_callgraph} }
 \end{figurebox}
 \caption{Call graph for retrans collapse}
 \end{figure}
 
+
 While \code{tcp_can_collapse} returns True for the following \gls{SKB}, \code{tcp_collapse_retrans}
 is called to move the data into the \gls{SKB} to be sent.
 

File oppgave/chapter4.tex

 Detecting when losses occur to know when it is useful to bundle is an important
 one.
 
-The Linux kernel (3.12) defines a \gls{thin-stream} as a stream with a maximum
+The \gls{linux-kernel} defines a \gls{thin-stream} as a stream with a maximum
 of 3 packets in flight. Using \gls{RDB} with this definition would certainly
 make it less aggressive than the original implementation, but it would not be
 enabled in many circumstances where it could be beneficial, e.g. when the
 
 \subsection{tcpproberdb}
 \gls{tcpproberdb} is a kernel module we have written which is based on the
-\gls{tcpprobe} module available in the Linux kernel. This tool uses kprobes to
+\gls{tcpprobe} module available in the \gls{linux-kernel}. This tool uses kprobes to
 initiate a callback for each received ack to print different properties of the
 socket, most importantly the \gls{CWND} used to make the \gls{CWND} plots.
 
 \boxcaption{commandlisting}{Example output from tcpproberdb}
 
 \subsection{ftrace}
-\gls{Ftrace} is the internal tracer in the Linux kernel. We have used this to profile
+\gls{Ftrace} is the internal tracer in the \gls{linux-kernel}. We have used this to profile
 the RDB code.
 
 \commandbox{%

File oppgave/colorbox.tex

   colback=lightgray!20!white,
   colbackmiddlefirst=!88!black,
   colbackmiddlelast=!93!black,
+  %colback=lightgray!40!white,
+  %colbackmiddlefirst=!40!white,
+  %colbackmiddlelast=!40!white,
+  %colback=white,
+  %colbackmiddlefirst=!40!white,
+  %colbackmiddlelast=!40!white,
   colbacklower=white,
   fontlower=\small,
 %  listing remove caption=true,
 %  enlarge top by=0.5cm,         % Floats have a default spacing, so no need to set this for figures
   top=5mm,                       % Add space between title and content in the box
   toptitle=1pt,
-  boxrule=0.7pt,        % The border width
+%  boxrule=0.7pt,        % The border width
+  boxrule=0.0pt,        % The border width
   colback=white,                 % Background color
   colframe=Firebrick4!60!white,
 %  colframe=white,

File oppgave/glossaries.tex

 
 \newacronym{SKB}{SKB}{socket buffer}
 
+
+
+\newglossaryentry{linux-kernel} {%
+  name={Linux kernel (3.13)},%
+  description={is ts the kernel version which the RDB module is based on},%
+}
+
+
 \newglossaryentry{tcp-output-queue} {%
   name={TCP output queue},%
   description={is a linked list of \glspl{SKB} that keeps track of the data that

File oppgave/images/latex/ethernet_frame.tex

+\tikzset{font=\sffamily}
+\definecolor{tcp}{RGB}{51, 122, 153}
+\definecolor{ip}{RGB}{102, 153, 102}
+\definecolor{free}{RGB}{150, 150, 150}
+\definecolor{eth}{RGB}{204, 152, 0}
+\colorlet{payload}{blue!20!white}
+
+\begin{tikzpicture}[auto, on grid, node distance=0cm,
+   decision/.style={diamond, draw=blue, thick, fill=blue!20,
+                    text width=4.5em,align=flush center,
+                    inner sep=1pt},
+   block/.style   ={rectangle, draw=blue, thin, fill=blue!10!white,
+                   align=center, 
+                  inner sep=2mm,
+                    minimum height=2.2em},
+   line/.style    ={draw, thick, ->,shorten >=2pt},
+   cloud/.style   ={draw=red, thick, ellipse,fill=red!20,
+                    minimum height=2em},
+% every node/.style={rectangle split, rectangle split parts=5,     draw, rectangle split horizontal}
+ %every node/.style={draw,fill=blue!10!white,outer sep=0pt},
+comeback/.style={
+  minimum height=1cm,
+  minimum width=6mm,
+  draw=black,
+  text centered,
+  anchor=west,
+  outer sep=0pt,
+  %text height=1.5ex,
+  text depth=.0ex, % Necessary to align the text in the nodes...why?
+%    text width=11em,
+  },
+  ]
+
+\begin{scope}%[yshift=0.15cm,xshift=-150]
+\node[comeback,fill=eth]  (W0) at (2.75,2) {ETH};
+\node[comeback,fill=ip]  (W1) at (W0.east) {IP};
+\node[comeback,fill=tcp]  (W2) at (W1.east) {TCP};
+\node[comeback,text width=2.9cm,fill=payload]  (W3) at (W2.east) {Payload (TCP)};
+\node[comeback,text width=6cm,fill=free]  (W4) at (W3.east) {Free Space};
+\end{scope}
+
+\coordinate (header1) at ([shift={(.1,.1)}] W0.north west);
+\coordinate (header2) at ([shift={(-.1,.1)}] W2.north east);
+
+\coordinate (eth1) at ([shift={(.1,.1)}] W0.north west);
+\coordinate (eth2) at ([shift={(-.1,.1)}] W0.north east);
+\coordinate (ip1) at ([shift={(.1,.1)}] W1.north west);
+\coordinate (ip2) at ([shift={(-.1,.1)}] W1.north east);
+\coordinate (tcp1) at ([shift={(.1,.1)}] W2.north west);
+\coordinate (tcp2) at ([shift={(-.1,.1)}] W2.north east);
+
+\coordinate (headersize1) at ([shift={(.1,.1)}] W0.north west);
+\coordinate (headersize2) at ([shift={(-.1,.1)}] W2.north east);
+
+\coordinate (payload1) at ([shift={(.1,.1)}] W3.north west);
+\coordinate (payload2) at ([shift={(-.1,.1)}] W3.north east);
+
+\coordinate (freespace1) at ([shift={(.1,.1)}] W4.north west);
+\coordinate (freespace2) at ([shift={(-1,.1)}] W4.north);
+\coordinate (freespace3) at ([shift={(-.1,.1)}] W4.north east);
+
+\coordinate (ethernetmin1) at ([shift={(.1,-.1)}] W0.south west);
+\coordinate (ethernetmin2) at ([shift={(-1,-.1)}] W4.south);
+
+\coordinate (ethernetminfree1) at ([shift={(.1,-.1)}] W0.south west);
+\coordinate (ethernetminfree2) at ([shift={(-1,-.1)}] W4.south);
+
+\coordinate (ethernetmax1) at ([shift={(.1,-1.5)}] W0.south west);
+\coordinate (ethernetmax2) at ([shift={(-.1,-1.5)}] W4.south east);
+
+\begin{scope}
+\draw [decorate,decoration={brace,amplitude=4pt},rotate=270] (eth1) -- (eth2) node [midway,yshift=1mm] {\footnotesize  20};;
+\draw [decorate,decoration={brace,amplitude=4pt},rotate=270] (ip1) -- (ip2) node [midway,yshift=1mm] {\footnotesize  20};;
+\draw [decorate,decoration={brace,amplitude=4pt},rotate=270] (tcp1) -- (tcp2) node [midway,yshift=1mm] {\footnotesize  20};;
+\draw [decorate,decoration={brace,amplitude=8pt},rotate=270] ([shift={(-.7,0)}]header1) -- ([shift={(-.7,0)}]header2) node [midway,yshift=2.5mm] {\footnotesize  Headers (66 bytes)};;
+\draw [decorate,decoration={brace,amplitude=8pt},rotate=270] (payload1) -- (payload2) node [midway,yshift=2.5mm] {\footnotesize  100 bytes};;
+\draw [decorate,decoration={brace,amplitude=8pt},rotate=270] ([shift={(-.7,0)}]freespace1) -- ([shift={(-.7,0)}]freespace3) node [midway,yshift=2.5mm] {\footnotesize  1348 bytes};;
+\draw [decorate,decoration={brace,amplitude=8pt},rotate=270] (freespace1) -- (freespace2) node [midway,yshift=2.5mm] {\footnotesize  348 bytes};;
+\draw [decorate,decoration={brace,amplitude=8pt}] (ethernetmin2) -- (ethernetmin1) node [midway,yshift=-4mm,align=center] {\footnotesize  512 bytes\\\footnotesize(Minimum Gigabit ethernet frame size)};;
+\draw [decorate,decoration={brace,amplitude=8pt}] (ethernetmax2) -- (ethernetmax1) node [midway,yshift=-4mm,align=center] {\footnotesize 1514 bytes\\\footnotesize(Maximum ethernet frame size)};;
+\end{scope}
+
+\end{tikzpicture}

File oppgave/images/latex/ktikz.template.pgs

+% Load this template in KTikZ. Add packages here if necessary
+\documentclass{article}
+\usepackage{mathptmx}
+\usepackage{tikz}
+\usetikzlibrary{shapes.callouts}
+\usetikzlibrary{shapes.geometric}
+\usetikzlibrary{shapes.multipart}
+%\usetikzlibrary{shapes,arrows}
+%\usetikzlibrary{arrows.meta}
+\usetikzlibrary{arrows}
+\usetikzlibrary{arrows.spaced}
+\usetikzlibrary{fit,matrix}
+\usetikzlibrary{automata,positioning}
+\usetikzlibrary{positioning} % on grid
+%\usetikzlibrary{calc}
+\usepackage{subcaption} % Adds subfigure command to have multiple figures grouped together
+\usepackage{booktabs}
+%\usepackage{color}
+\usepackage{pgfplots}
+\usepackage{pgfplotstable}
+\usepackage[active,pdftex,tightpage]{preview}
+\PreviewEnvironment[]{tikzpicture}
+\PreviewEnvironment[]{pgfpicture}
+\DeclareSymbolFont{symbolsb}{OMS}{cmsy}{m}{n}
+\SetSymbolFont{symbolsb}{bold}{OMS}{cmsy}{b}{n}
+\DeclareSymbolFontAlphabet{\mathcal}{symbolsb}
+\begin{document}
+<>
+\end{document}

File oppgave/images/latex/rdb_cong_rtt_backoff.tex

+\pgfplotstableread[format=inline]{
+x  y
+10 0
+9  0
+8  0.5
+7  1
+6  1.5
+5  2
+4  2.5
+3  3
+2  4
+1  5
+}\loadedtable
+
+\newcommand{\rdbBackoffPlot}{
+\begin{tikzpicture}
+\begin{axis}[
+		ylabel=RTTs to wait,
+		xlabel=CWND,
+        xtick={0,...,10},
+        ytick={0,...,5},
+        ymax=6]
+    \addplot table[x=x,y=y] {\loadedtable};
+    \addplot table[y expr={((\thisrow{x}-12)/5)^2}, x={x}]  {\loadedtable};
+    \addplot table[y expr={((\thisrow{x}-10)/4)^2}, x={x}]  {\loadedtable};
+    \legend{$y = $Table\hspace{6pt}column, $y = ((x-12)/5)^2$, $y = ((x-10)/4)^2$}
+\end{axis}
+\label{figure:backoff-rtt-pif}
+\end{tikzpicture}
+}
+~~~~
+%\\[1cm]
+%\subcaptionbox{The table data in \cref{figure:backoff-rtt-pif}}{
+%\label{figure:thin-loss-thin-dupack1-itt100}
+
+
+\newcommand{\rdbBackoffTable}{
+\pgfplotstabletypeset[%
+    %columns/paradigm/.style={
+    %               column name={Paradigm},
+    %               string type,
+    %               postproc cell content/.style={@cell content/.add={\scriptsize}{}}
+    %              },
+    %columns/position/.style={column name={Position}},
+    %columns/x/.style={column name={RTT to wait}}
+    columns={x,y},
+    every head row/.style={
+      before row={\toprule}, % have a rule at top
+      after row={CWND & RTTs\\ % the units seperated by &
+        \midrule} % rule under units
+      },
+      every last row/.style={after row=\bottomrule}, % rule at bottom
+    ]{\loadedtable}
+}
+
+%\begin{figure} \subcaptionbox{T} { \rdbBackoffPlot } \\ \subcaptionbox{U}{ \rdbBackoffTable } \end{figure}

File oppgave/images/latex/tcp_cong_RTO_slow_start.tex

+
+\pgfplotstableread[format=inline]{
+x  y
+0  1
+1  2
+2  4
+3  8
+4  16
+5  32
+6  33
+7  34
+8  35
+9  36
+10 37
+11 38
+12 39
+13 40
+14 1
+15 2
+16 4
+17 8
+18 16
+19 20
+20 21
+21 22
+22 23
+23 24
+24 25
+25 26
+}\congwinslowstarttable
+
+\begin{tikzpicture}[scale=1.5, transform shape]
+\scriptsize
+  \tikzset{
+  every pin/.style={fill=red!50!white,rectangle,rounded corners=3pt},
+   small dot/.style={fill=black,circle,scale=0.3},
+   note/.style={rectangle callout, fill=#1},
+  precise pin/.style args={[#1]#2:#3}{pin={[#1,inner sep=0pt, label={[append after command={
+                node [inner sep=0pt, at=(\tikzlastnode.#2), anchor=#2+180] {#3}}
+        ]center:{}}]#2:{}}}
+}
+\begin{axis}[
+		ylabel=Congestion Window (MSS),
+		xlabel=Round trip time,
+        xtick={0,2,...,25},
+        ytick={0,4,8,...,40},
+        ymax=46,ymin=-2,xmin=-2, xmax=27]
+    \addplot table[x=x,y=y] {\congwinslowstarttable};
+   \addplot[lime!90!black,smooth] coordinates {(0,0)}; % Add  one coord value to show ssthresh in legend
+
+% SSTHRESH
+\draw[lime!90!black,line width=0.68pt] (axis cs:-5,32) -- (axis cs:13,32);
+\draw[lime!90!black,line width=0.7pt] (axis cs:13,20) -- (axis cs:27,20);
+
+\node [precise pin={[pin distance=5mm]0:Slow Start}] at (axis cs:0,1) {};
+\node [precise pin={[pin distance=6mm]90:Congestion Avoidance}] at (axis cs:5,31.2) {};
+\node [precise pin={[pin distance=3mm]0:RTO}] at (axis cs:13,40) {};
+\node [precise pin={[pin distance=5mm]0:Slow Start}] at (axis cs:14,1) {};
+ \legend{CWND, ssthresh}
+\end{axis}
+\end{tikzpicture}

File oppgave/images/latex/tcp_cong_dupacks_fast_recovery.tex

+\pgfplotstableread[format=inline]{
+x  y
+0  1
+1  2
+2  4
+3  8
+4  16
+5  32
+6  33
+7  34
+8  35
+9  36
+10 37
+11 38
+11 18
+12 18
+13 19
+14 20
+15 21
+16 22
+17 23
+}\tcpcongDupackFastrecoveryTable
+%\subcaptionbox{RTTs to wait for vs PIF}{
+\begin{tikzpicture}[scale=1.5, transform shape]
+\scriptsize
+  \tikzset{
+  every pin/.style={fill=red!50!white,rectangle,rounded corners=3pt},
+   small dot/.style={fill=black,circle,scale=0.3},
+   note/.style={rectangle callout, fill=#1},
+  precise pin/.style args={[#1]#2:#3}{pin={[#1,inner sep=0pt, label={[append after command={
+                node [inner sep=0pt, at=(\tikzlastnode.#2), anchor=#2+180] {#3}}]right:{}}]#2:{}}}
+}
+\begin{axis}[
+		ylabel=Congestion Window (MSS),
+		xlabel=Round trip time,
+        xtick={0,2,...,25},
+        ytick={0,4,8,...,40},
+        ymax=46,ymin=-2,xmin=-2, xmax=27]
+    \addplot table[x=x,y=y] {\tcpcongDupackFastrecoveryTable};
+   \addplot[lime!90!black,smooth] coordinates {(0,0)};  % Add one coord value to show ssthresh in legend
+% SSTHRESH
+\draw[lime!90!black,line width=0.68pt] (axis cs:-5,32) -- (axis cs:13,32);
+\draw[lime!90!black,line width=0.7pt] (axis cs:13,18) -- (axis cs:27,18);
+\node [precise pin={[pin distance=5mm]0:Slow Start}] at (axis cs:0,1) {};
+\node [precise pin={[pin distance=5mm]95:Congestion Avoidance}] at (axis cs:5,31.2) {};
+\node [precise pin={[pin distance=5mm]30 :Three Dupacks}] at (axis cs:10,37) {};
+\node [precise pin={[pin distance=6mm]270:New data ACKed}] at (axis cs:12,19) {};
+\node [precise pin={[pin distance=13mm]37:CWND reset to ssthresh}] at (axis cs:11,18) {};
+\legend{CWND, ssthresh}
+\end{axis}
+\end{tikzpicture}

File oppgave/images/latex/tcp_linux_callgraph.tex

+\begin{tikzpicture}
+  [auto,
+   decision/.style={diamond, draw=blue, thick, fill=blue!20,
+                    text width=4.5em,align=flush center,
+                    inner sep=1pt},
+   block/.style   ={rectangle, draw=blue, thick, fill=blue!10!white,
+                   align=center, rounded corners,
+                  inner sep=2mm,
+                    minimum height=2.2em},
+   line/.style    ={draw, thick, ->,shorten >=2pt},
+   cloud/.style   ={draw=red, thick, ellipse,fill=red!20,
+                    minimum height=2em}]
+  \matrix [column sep=0mm,row sep=5mm]
+  {
+    % row 1
+     \node [block] (tcpsendmsg)   {tcp\_sendmsg}; & & 
+      \node [block] (tcpsendpage)   {tcp\_sendpage}; \\
+    % row 2
+      & \node [block] (tcppush) {tcp\_push}; &
+     \node [block] (dotcpsendpages) {do\_tcp\_sendpages}; & 
+      \node [block] (tcpxmitretransmitqueue) {tcp\_xmit\_retransmit\_queue}; & \\
+    % row 3
+      \node [block] (tcppushone)   {tcp\_push\_one}; & &
+      \node [block] (tcppushpendingframes) {\_tcp\_push\_pending\_frames}; &
+     \node [block] (tcpretransmitskb1) {tcp\_retransmit\_skb}; & \\ 
+    % row 4
+     \node [block] (tcpmtuprobe) {tcp\_mtu\_probe}; & &
+     \node [block] (tcpwritexmit) {tcp\_write\_xmit}; &  
+     \node [block] (tcpretransmitskb2) {\_tcp\_retransmit\_skb}; & \\ 
+    % row 5
+      & &  \node [block] (tcptransmitskb)      {tcp\_transmit\_skb}; & \\
+  };
+  \begin{scope}[every path/.style=line]
+  % Row 1
+    \path          (tcpsendmsg) -- (tcppushone);
+   \path          (tcpsendmsg) -- (tcppush);
+    \path          (tcpsendpage) -- (dotcpsendpages);
+  % Row 2
+  \path          (tcppush) -- (tcppushpendingframes);
+  \path          (dotcpsendpages) -- (tcppush);
+  \path          (dotcpsendpages) -- (tcppushpendingframes);
+  \path          (tcpxmitretransmitqueue) -- (tcpretransmitskb1);
+  % Row 3
+  \path          (tcppushone) -- (tcpwritexmit);
+  \path          (tcppushpendingframes) -- (tcpwritexmit);
+  \path          (tcpretransmitskb1) -- (tcpretransmitskb2);
+  % Row 4
+  \path     (tcpwritexmit)   --  (tcptransmitskb);
+  \path     (tcpmtuprobe)   -- (tcptransmitskb);
+  \path     (tcpretransmitskb2) -- (tcptransmitskb);
+  \end{scope}
+\end{tikzpicture}

File oppgave/images/latex/tcp_output_queue.tex

+\begin{tikzpicture}
+  [auto,
+   decision/.style={diamond, draw=blue, thick, fill=blue!20,
+                    text width=4.5em,align=flush center,
+                    inner sep=1pt},
+   block/.style   ={rectangle, draw=blue, thick, fill=blue!10!white,
+                   align=center, rounded corners,
+                  inner sep=2mm,
+                    minimum height=2.2em},
+   line/.style    ={draw, thick, ->,shorten >=2pt},
+   cloud/.style   ={draw=red, thick, ellipse,fill=red!20,
+                    minimum height=2em}]
+  \matrix [column sep=0mm,row sep=5mm]
+  {
+    % row 1
+    \node [block] (tcposcket)   {TCP socket};  \\[2mm] 
+    % row 2
+  \node [block] (sksendhead)   {sk\_send\_head}; & &
+  \node [block] (skwritequeue) {sk\_write\_queue}; \\[5mm] 
+    % row 3
+  & \node [cloud] (skb3) {SKB3}; & &
+   \node [cloud] (skb1) {SKB1}; \\
+   % row 4
+    & &\node [cloud] (skb2) {SKB2}; \\ 
+  };
+  \begin{scope}[every path/.style=line]%
+  % Row 1
+    \path          (tcposcket) -- (sksendhead);
+    \path          (tcposcket) -- (skwritequeue);
+  % Row 2
+ \path[->]     (skwritequeue)  edge  [bend left] node [midway] {head} (skb1);
+ % \path          (skwritequeue) -- (skb1);
+  % Row 3
+  \path          (sksendhead) -- (skb3);
+ 
+  % Row 4
+%  \path     (skb3)   --  (skwritequeue);
+  \path[->]     (skb3)  edge   [bend left] node [midway] {tail} (skwritequeue);
+  \path[->]     (skb1)  edge   [bend left]  (skb2);
+ % Row 4
+  \path[->]     (skb2)  edge   [bend left]  (skb3);
+  \end{scope}
+\end{tikzpicture}

File oppgave/images/latex/tcp_retrans_callgraph.tex

+\begin{tikzpicture}
+  [auto,
+   block/.style   ={rectangle, draw=blue, thick, fill=blue!10!white,
+       align=center, rounded corners, inner sep=2mm,  minimum height=2.2em},
+   line/.style    ={draw, thick, ->,shorten >=2pt}
+]
+  \matrix [column sep=0mm,row sep=5mm]
+  {
+    % row 1
+      \node [block] (tcpretransmitskb)   {\_tcp\_retransmit\_skb}; \\
+    % row 2
+      \node [block] (tcpretranstrycollapse) {tcp\_retrans\_try\_collapse}; \\[7mm]
+    % row 3
+    \node [block] (tcpcancollapse) {tcp\_can\_collapse}; \\[1mm]
+    % row 4
+     \node [block] (tcpcollapseretrans) {tcp\_collapse\_retrans}; \\ 
+    % row 5
+  };
+  \begin{scope}[every path/.style=line]
+  % Row 1
+   \path       (tcpretransmitskb) -- (tcpretranstrycollapse);
+  % Row 2
+  \%path     (tcpretranstrycollapse) -- (tcpcancollapse);
+\path[->]    (tcpretranstrycollapse)  edge  node [midway,align=center] {While can collapse with\\ next skb in queue} (tcpcancollapse);
+  % Row 3
+\path[->]   (tcpcancollapse)  edge  node [midway] {Yes} (tcpcollapseretrans);
+  \end{scope}
+\end{tikzpicture}

File oppgave/main.tex

 \usepackage[abbreviations=true]{siunitx}
 \newcommand{\ms}{\hspace{2pt}\si{\milli\second}} % Command for milliseconds
 
-
-\usepackage{filecontents}
 \usepackage{pgfplots}
+\usepackage{pgfplotstable}
+\usetikzlibrary{shapes.geometric}
 %\usepgfplotslibrary{external}
 %\tikzexternalize% activate externalization!
 
 \epstopdfsetup{outdir=build/}
 \graphicspath{{images/}{include/}{build/}}  % Search for figures in these directories
 
-\pgfplotstableread{
-x,y
-0,20
-0,11
-1,10
-1,8
-1,7
-1.5,6
-2,5
-2.5,4
-3,3
-4,2
-5,1
-}\datafile
-
-\begin{filecontents*}{datafile.dat}
-x,y
-0,20
-0,11
-1,10
-1,8
-1,7
-1.5,6
-2,5
-2.5,4
-3,3
-4,2
-5,1
-\end{filecontents*}
-
-
 % ##################################
 % ########### Front page ###########
 %\usepackage{include/uiosloforside}