latex模板

\documentclass[10pt,a4paper]{report}
\usepackage[utf8]{inputenc}%[]和{}的作用都忘了待学习
\usepackage{listings}%代码支持插入
\usepackage{color}

\definecolor{mygreen}{rgb}{0,0.6,0}
\definecolor{mygray}{rgb}{0.5,0.5,0.5}
\definecolor{mymauve}{rgb}{0.58,0,0.82}

\lstset{ %
  backgroundcolor=\color{white},   % choose the background color; you must add \usepackage{color} or \usepackage{xcolor}; should come as last argument
  basicstyle=\footnotesize,        % the size of the fonts that are used for the code
  breakatwhitespace=false,         % sets if automatic breaks should only happen at whitespace
  breaklines=true,                 % sets automatic line breaking
  captionpos=b,                    % sets the caption-position to bottom
  commentstyle=\color{mygreen},    % comment style
  deletekeywords={...},            % if you want to delete keywords from the given language
  escapeinside={\%*}{*)},          % if you want to add LaTeX within your code
  extendedchars=true,              % lets you use non-ASCII characters; for 8-bits encodings only, does not work with UTF-8
  frame=single,                    % adds a frame around the code
  keepspaces=true,                 % keeps spaces in text, useful for keeping indentation of code (possibly needs columns=flexible)
  keywordstyle=\color{blue},       % keyword style
  language=Python,                 % the language of the code
  morekeywords={*,...},           % if you want to add more keywords to the set
  numbers=left,                    % where to put the line-numbers; possible values are (none, left, right)
  numbersep=5pt,                   % how far the line-numbers are from the code
  numberstyle=\tiny\color{mygray}, % the style that is used for the line-numbers
  rulecolor=\color{black},         % if not set, the frame-color may be changed on line-breaks within not-black text (e.g. comments (green here))
  showspaces=false,                % show spaces everywhere adding particular underscores; it overrides 'showstringspaces'
  showstringspaces=false,          % underline spaces within strings only
  showtabs=false,                  % show tabs within strings adding particular underscores
  stepnumber=2,                    % the step between two line-numbers. If it's 1, each line will be numbered
  stringstyle=\color{mymauve},     % string literal style
  tabsize=2,                       % sets default tabsize to 2 spaces
  title=\lstname                   % show the filename of files included with \lstinputlisting; also try caption instead of title
}
\usepackage{xeCJK}%中文支持
\setCJKmainfont{AR PL UKai CN}%中文字体
\begin{document}
%\tableofcontents
\title{Project2}
\author{SA16011096周明松}
\maketitle


\section{实验题目}
\textbf{Experiment1(with controller):}\\
The physical topology has loops, you need to first build a logical spanning tree (hint: use the existing component)\\
Figure out and draw the logical spamming tree topology\\
Make OpenFlow switches to behave like address learning switches\\
Using pingall to testify, examine the flow tables on switches\\
Introduce link failure events with at least three simultaneously failed links.However, the physical network shouldn’t be partitioned. \\
Reconstruct the spamming tree and re-populate the flow tables with pingall.\\
Topology, pingall result, flows table on switches.\\
\\
\textbf{Experiment2(without controller):}\\
Do not use any controller\\
In simulation script, insert appropriate flow table entries in OpenFlow switches to make the network behaves like FatTree.\\
Test the routing rules with pingall\\
Prove that the traffic is evenly distributed on FatTree with flow table entry statistics.

\begin{center}
\includegraphics[scale=0.4]{topo.eps} 
\end{center}

\section{实验环境}
mininet-2.2.2-170321-ubuntu-14.04.4-server-amd64

\section{实验过程}
\begin{enumerate}
\item 连接VM 
\
\end{enumerate}
\section{实验代码详解}
\begin{lstlisting}
#构造网络实例
net = Mininet( topo=None,build=False,ipBase='10.0.0.0/8')

info( '*** Adding controller\n' )

#添加控制器
c0=net.addController('c0',controller=Controller,
protocol='tcp',port=6633)

info( '*** Add switches\n')
#添加交换机     
s1 = net.addSwitch('s1', cls=OVSKernelSwitch)
s2 = net.addSwitch('s2', cls=OVSKernelSwitch)
s3 = net.addSwitch('s3', cls=OVSKernelSwitch)
s4 = net.addSwitch('s4', cls=OVSKernelSwitch)
s5 = net.addSwitch('s5', cls=OVSKernelSwitch)
s6 = net.addSwitch('s6', cls=OVSKernelSwitch)
s7 = net.addSwitch('s7', cls=OVSKernelSwitch)
s8 = net.addSwitch('s8', cls=OVSKernelSwitch)
s9 = net.addSwitch('s9', cls=OVSKernelSwitch)
s10 = net.addSwitch('s10', cls=OVSKernelSwitch)
s11 = net.addSwitch('s11', cls=OVSKernelSwitch)
s12 = net.addSwitch('s12', cls=OVSKernelSwitch)
s13 = net.addSwitch('s13', cls=OVSKernelSwitch)
s14 = net.addSwitch('s14', cls=OVSKernelSwitch)
s15 = net.addSwitch('s15', cls=OVSKernelSwitch)
s16 = net.addSwitch('s16', cls=OVSKernelSwitch)
s17 = net.addSwitch('s17', cls=OVSKernelSwitch)    
s18 = net.addSwitch('s18', cls=OVSKernelSwitch)
s19 = net.addSwitch('s19', cls=OVSKernelSwitch)
s20 = net.addSwitch('s20', cls=OVSKernelSwitch)
\end{lstlisting}


\begin{lstlisting}[language=c++]
#include <iostream>
int main()
{
    std::cout << "Hello, World!" << std::endl;
}  
\end{lstlisting}
\end{document}


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值