]> rtime.felk.cvut.cz Git - can-eth-gw.git/blob - doc/can-eth-gw.tex
Merge branch 'master' of ssh://rtime.felk.cvut.cz/can-eth-gw
[can-eth-gw.git] / doc / can-eth-gw.tex
1 %
2 % Typographic conventions (already applied)
3 % * Each \caption{} should end with a dot
4 % * "Linux traffic control" will be written with lowercase T and C
5 %
6 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7
8 \documentclass[11pt,abstract]{scrreprt}
9 \usepackage[utf8]{inputenc}
10 % \usepackage[T1]{fontenc}
11 \usepackage[right]{lineno}
12 \usepackage{fixltx2e}
13 \usepackage{graphicx}
14 \usepackage{longtable}
15 \usepackage{tabularx}
16 \usepackage{float}
17 \usepackage{wrapfig}
18 \usepackage{soul}
19 % \usepackage{t1enc}
20 \usepackage{textcomp}
21 \usepackage{marvosym}
22 \usepackage{wasysym}
23 \usepackage{latexsym}
24 \usepackage{amssymb}
25 \usepackage{hyperref}
26 \usepackage{multirow}
27 \usepackage{tikz}
28 \usepackage[draft]{fixme}
29 \usepackage{vertbars} 
30 \usepackage{fancyvrb}
31 \usepackage{appendix}
32 \usepackage{listings}
33 \usepackage{color}
34 \usepackage{caption}
35
36 %\usepackage{multicol}
37 \hypersetup{
38         breaklinks = true, %allow links to break over lines
39         pdffitwindow = true, %resize document window to fit document size
40         colorlinks = true,
41 %       linkcolor = darkblue,
42 %       citecolor = darkblue,
43 %       urlcolor = darkblue,
44         linkcolor = black,
45         citecolor = black,
46         urlcolor = black,
47         plainpages=false,
48         }
49 %\urlstyle{same}
50
51 \RecustomVerbatimEnvironment{Verbatim}{Verbatim}{frame=single,framesep=4pt}
52
53
54 \setlength{\columnsep}{8mm}
55 \providecommand{\alert}[1]{\textbf{#1}}
56
57 \title{Linux-Based CAN-Ethernet Gateway}
58 \author{R. Matějka, M. Sojka\\
59 Czech Technical University in Prague}
60 \providecommand{\version}{???}
61 \date{\today\\Version \version}
62
63 \newcommand{\superscript}[1]{\ensuremath{^{\mathrm{#1}}}}
64 \newcommand{\subscript}[1]{\ensuremath{_{\mathrm{#1}}}}
65 \renewcommand{\th}[0]{\superscript{th}}
66 \renewcommand{\st}[0]{\superscript{st}}
67 \newcommand{\nd}[0]{\superscript{nd}}
68 \newcommand{\rd}[0]{\superscript{rd}}
69
70 \newenvironment{todo}
71 {\begin{vertbar}\begin{itshape}}
72     {\end{itshape}\end{vertbar}}
73 \pagestyle{headings}
74 \begin{document}
75 \lstset{language=sh,frame=single,basicstyle=\tt,commentstyle=\itshape\color{gray},columns=flexible}
76 %\linenumbers
77 %\onecolumn
78 \maketitle
79
80 % \begin{abstract}
81 % \end{abstract}
82
83 \tableofcontents
84
85 \chapter{Assignment}
86 \label{cha:assignment}
87
88 The goal is to implement CAN-Ethernet gateway based on Linux's AF\_CAN
89 subsystem with the following features:
90 \begin{enumerate}
91 \item Both user- and kernel-space implementations will be developed.
92   User-space one will contain only the most basic functionality.
93 \item Ethernet side will use UDP datagrams to carry the CAN messages.
94   Later it will be extended to support also TCP.
95 \item Initial version will route all CAN frames to Ethernet side and
96   all received UDP datagrams to CAN messages. Later, filtering
97   capabilities will be added.
98 \item UDP frames will contain timestamps of the time when the CAN
99   message was received.
100 \item For kernel-based gateway, implement a user-space configuration
101   tool, similar to \texttt{cangw} tool from \texttt{can-utils}.
102 \end{enumerate}
103
104 \chapter{Solution design}
105 \label{cha:design}
106 The canethgw is comprised of CAN and Ethernet interfaces. Both of these
107 interfaces allow to read and write to realize the gateway functionality.
108 But there is a difference in these interfaces from kernel point of view.
109 \section{CAN part}
110 The CAN part of the gateway is build on can\_rx\_register(...) function, 
111 therefore it is receiving events from kernel whenever CAN frame is
112 received on desired netdevice. Sending frames to CAN is implemented
113 through can\_send.
114 \section{Ethernet part}
115 The Ethernet side of the gateway is however implemented using kernel sockets.
116 Kernel thread is created to listen for UDP/TCP messages. The socket interface
117 is also used for sending.
118 \section{Ethernet message format}
119 As there is no standard on how to carry CAN messages over TCP or UDP,
120 the UDP/TCP message format has to be defined.
121 \begin{center}
122 \includegraphics[scale=0.5]{img/eth_msg.pdf}
123 \captionof{figure}{UDP/TCP message.}\label{fig:eth_msg}
124 \end{center}
125 % \bibliography{can-eth-gw}
126 % \bibliographystyle{IEEEtran}
127
128 \end{document}
129
130 %%% Local Variables:
131 %%% mode: latex
132 %%% TeX-master: t
133 %%% ispell-local-dictionary: american
134 %%% End: