您好,我创建了一个表格,但添加标题时出现了如图所示的错误。此外,我需要在每一页重复表格的标题。请帮帮我。
\begin{landscape}
\begin{center}
\caption{\bf Comparison Between the Wormhole Attacks}
\begin{longtable}{|p{2cm}|>{\RaggedRight}p{4cm}|>{\RaggedRight}p{4cm}|>{\RaggedRight}p{4cm}|>{\RaggedRight}p{3.5cm}|>{\RaggedRight}p{3.3cm}|}
\hline
\textbf{Wormhole types} & \textbf{Encapsulation} & \textbf{Out of Band} & \textbf{High Power} & \textbf{Packet Relay} & \textbf{Protocol Deviations} \\\hline
\bf \begin{center}
Attack mode launching method
\end{center}& Node encapsulates the route request and transmits it to colluding node which de-capsulate it and RREQ forwards \citep{khalil2005liteworp} \citep{gupta2014novel} & Nodes send RREQs between them by using a long range directional wireless link or a direct wired link \citep{shah2014responsive} \citep{lee2013passivity} & A node gets a RREQ then transmits at high power level, any node which hears that rebroadcasts it towards the destination \citep{farooq2014recovering} \citep{buch2011prevention} & Nodes relay packets between two distant nodes to convince they are neighbors \citep{khurana2011end} \citep{nouri2011collaborative} & Nodes do not back off to let the request packet, it forwards arrive first at destination \citep{khalil2008mobiworp} \tabularnewline[.5ex] \hline
\bf \begin{center}
Advant- \par ages
\end{center}
& \first there is a smaller probability of RREQ being discarded than other RREQs which are repeatedly received by intermediate nodes.
\following RREQ packet arriving to destination, does not keep middle nodes as hops, and then it appears to have passed through minimum number of hops.
& \first Control packet arrives faster due to no process from middle nodes
\following Less probability of discarding compare to RREQs which are repeatedly received by middle nodes.
\following Control packets arrive at destination, middle nodes not use as hops, pass through less number of hops
& \first Control packets arrive faster
\following Less probability of discarding compare to RREQs which are repeatedly received by middle nodes.
\following Control packets arrive at destination, middle nodes not use as hops, pass through less number of hops
& \first Two nodes think they are neighbors although they are not, and every RREQ to be sent to neighbors will arrive to relay nodes invisibility.
\following Control packet seems to arrive using minimum number of hops
& control packet arrives faster \\\hline
\bf \begin{center}
Disdvant- \par ages
\end{center} & 1- Resources and time consumption in packet encapsulation and de-capsulation & 1- This type of attack is different to lunch than the previous one due to needs specialized hardware capability. \par 2- Also the time difference in control packets arrival could be very remarkable. & 1- Needs high power. 2- Also speed difference could be noticed & 1- Relaying nodes spend resources for processing RREQ packets and hiding their IDs
& 1- Dose not necessarily provide the minimum number of hops, it is not reliable if collisions happen to give minimum speed \tabularnewline[.5ex] \hline
\bf \begin{center}
Suitable cases
\end{center} & Large number of intermediate nodes, need to avoid intermediate processing & Small network size which speed difference would not be remarkable & A network with very middle nodes between source to destination with wide network range & Victim nodes needs at least two hops away & Network with the number of nodes have big difference from small saving \tabularnewline[.5ex] \hline
\bf \begin{center}
Faced challenges
\end{center} & 1- Sends encapsulation packet to the proper colluding node, while having a predetermined path \par 2- if any intermediate node check the contents of the sent packet & 1- Needs of special hardware and arrangements for out of band channels & 1- Not only enough energy needs to have, also power adjustments needed to make the transmitted RREQ go to some suitable neighboring nodes, else RREQ could go out of range of network & 1- Insert malicious nodes at proper positions \par 2- Hide malicious names which does not appear on RREQ packet \par 3- choice of optimum number of relaying nodes depends on victim’s distance \par 4-Communica- tion between relaying nodes & 1- Collision occur between transmissions of malicious nodes \tabularnewline[.5ex] \hline \newpage
\hline \bf \begin{center}
Possible solutions for faced challenges
\end{center}& 1- For the predetermined path to be established, colluding nodes could send RREQ packets to establish paths.
\par 2- For the second challenge of node checking packets, complex attacks will solve it & 1- Add special hardware and arrangements for out of band channels & 1- Sends a RREQ with different power levels, malicious node will have a primary network. Then use the communication ranges, and number of hops to adjust its power according to the location of destination & 1- Start to having large number of relaying nodes and then minimize them to get optimum performance with small number of malicious nodes and traffic conquer. Different relaying nodes distribution should also be tried with optimum number & 1- A priority round robin schema for malicious nodes packets could be used \tabularnewline[.5ex] \hline
\bf \begin{center}
Counter- measures
\end{center} & Use of statical methods to get the IDs of repeated nodes and use packet tracing to get proper network topology, also neighbor monitoring based solutions is helpful to make sure a RREQ forwarded & Time based solution can helps as Countermeasures to measure the difference of time & Power measurement equipments is helpful. Also neighbor monitoring and time based solutions are good & Distance and time based solutions are helpful & A priority schema could be used to accept packets in the medium \tabularnewline[.5ex] \hline
\end{longtable}
\end{center}
\end{landscape}
答案1
桌子有点乱;-)
\caption
必须位于longtable
环境内部,最好在\endfirsthead
语句之前(或之后\endfirstfoot
)
Advant-ages
如果列宽足够大,则有些错误的连字符可能会折断您的脖子,无法正确展开。- 可以将重复列定义打包成
*{number}Q
,其中Q
是相关列类型 - 不要使用
\bf
...它已经被弃用 20 年了 \begin{center} ...\end{center}
板状细胞内部并不健康
然而,这里还有许多其他问题我无法在短时间内解决
也许有更好的桌子(?)
\documentclass{article}
\usepackage{lscape}
\usepackage{longtable}
\usepackage{array}
\usepackage{ragged2e}
\newcommand{\citep}[1]{}
\newcommand{\first}{}
\newcommand{\following}{}
\newcolumntype{R}[1]{>{\RaggedLeft\arraybackslash}p{#1}} % Right justified
\newcolumntype{L}[1]{>{\RaggedRight\arraybackslash}p{#1}} % Left justified
\newcolumntype{B}[1]{>{\bfseries\centering\arraybackslash}p{#1}} % bold and centered
\newlength{\firstcolumnwidth}
\setlength{\firstcolumnwidth}{2cm}
\begin{document}
\begin{landscape}
\begin{center}
\begin{longtable}{|B{\firstcolumnwidth}|*{3}{L{4cm}|}L{3.5cm}|L{3.3cm}|}
\caption{\bfseries Comparison Between the Wormhole Attacks}
\endfirsthead
\hline
\textbf{Wormhole types} & \textbf{Encapsulation} & \textbf{Out of Band} & \textbf{High Power} & \textbf{Packet Relay} & \textbf{Protocol Deviations} \\\hline
\multicolumn{1}{|B{\firstcolumnwidth}|}{ %
Attack mode launching method}
& Node encapsulates the route request and transmits it to colluding node which de-capsulate it and RREQ forwards \citep{khalil2005liteworp} \citep{gupta2014novel} & Nodes send RREQs between them by using a long range directional wireless link or a direct wired link \citep{shah2014responsive} \citep{lee2013passivity} & A node gets a RREQ then transmits at high power level, any node which hears that rebroadcasts it towards the destination \citep{farooq2014recovering} \citep{buch2011prevention} & Nodes relay packets between two distant nodes to convince they are neighbors \citep{khurana2011end} \citep{nouri2011collaborative} & Nodes do not back off to let the request packet, it forwards arrive first at destination \citep{khalil2008mobiworp} \tabularnewline[.5ex] \hline
% Wrong hyphenation, left on purpose
\multicolumn{1}{|B{\firstcolumnwidth}|}{Advant-ages} & \first there is a smaller probability of RREQ being discarded than other RREQs which are repeatedly received by intermediate nodes.
\following RREQ packet arriving to destination, does not keep middle nodes as hops, and then it appears to have passed through minimum number of hops.
& \first Control packet arrives faster due to no process from middle nodes
\following Less probability of discarding compare to RREQs which are repeatedly received by middle nodes.
\following Control packets arrive at destination, middle nodes not use as hops, pass through less number of hops
& \first Control packets arrive faster
\following Less probability of discarding compare to RREQs which are repeatedly received by middle nodes.
\following Control packets arrive at destination, middle nodes not use as hops, pass through less number of hops
& \first Two nodes think they are neighbors although they are not, and every RREQ to be sent to neighbors will arrive to relay nodes invisibility.
\following Control packet seems to arrive using minimum number of hops
& control packet arrives faster \tabularnewline
\hline
\multicolumn{1}{|B{\firstcolumnwidth}|}{Disadvant\-ages} & 1- Resources and time consumption in packet encapsulation and de-capsulation & 1- This type of attack is different to lunch than the previous one due to needs specialized hardware capability. \par 2- Also the time difference in control packets arrival could be very remarkable. & 1- Needs high power. 2- Also speed difference could be noticed & 1- Relaying nodes spend resources for processing RREQ packets and hiding their IDs
& 1- Dose not necessarily provide the minimum number of hops, it is not reliable if collisions happen to give minimum speed \tabularnewline[.5ex] \hline
\multicolumn{1}{|B{\firstcolumnwidth}|}{Suitable cases} & Large number of intermediate nodes, need to avoid intermediate processing & Small network size which speed difference would not be remarkable & A network with very middle nodes between source to destination with wide network range & Victim nodes needs at least two hops away & Network with the number of nodes have big difference from small saving \tabularnewline[.5ex] \hline
\multicolumn{1}{|B{\firstcolumnwidth}|}{Faced challenges} & 1- Sends encapsulation packet to the proper colluding node, while having a predetermined path \par 2- if any intermediate node check the contents of the sent packet & 1- Needs of special hardware and arrangements for out of band channels & 1- Not only enough energy needs to have, also power adjustments needed to make the transmitted RREQ go to some suitable neighboring nodes, else RREQ could go out of range of network & 1- Insert malicious nodes at proper positions \par 2- Hide malicious names which does not appear on RREQ packet \par 3- choice of optimum number of relaying nodes depends on victim’s distance \par 4-Communica- tion between relaying nodes & 1- Collision occur between transmissions of malicious nodes \tabularnewline[.5ex] \hline \newpage %%%????
\hline
\multicolumn{1}{|B{\firstcolumnwidth}|}{%
Possible solutions for faced challenges} & 1- For the predetermined path to be established, colluding nodes could send RREQ packets to establish paths.
\par 2- For the second challenge of node checking packets, complex attacks will solve it & 1- Add special hardware and arrangements for out of band channels & 1- Sends a RREQ with different power levels, malicious node will have a primary network. Then use the communication ranges, and number of hops to adjust its power according to the location of destination & 1- Start to having large number of relaying nodes and then minimize them to get optimum performance with small number of malicious nodes and traffic conquer. Different relaying nodes distribution should also be tried with optimum number & 1- A priority round robin schema for malicious nodes packets could be used \tabularnewline[.5ex] \hline
\multicolumn{1}{|B{\firstcolumnwidth}|}{Counter\-measures}
& Use of statical methods to get the IDs of repeated nodes and use packet tracing to get proper network topology, also neighbor monitoring based solutions is helpful to make sure a RREQ forwarded & Time based solution can helps as Countermeasures to measure the difference of time & Power measurement equipments is helpful. Also neighbor monitoring and time based solutions are good & Distance and time based solutions are helpful & A priority schema could be used to accept packets in the medium \tabularnewline[.5ex] \hline
\end{longtable}
\end{center}
\end{landscape}
\end{document}