📄 test_harness.tex
字号:
AS $<$value$>$ keepalive $<$true/false$>$ holdtime $<$value$>$ id $<$ipv4$>$} ipv6 $<$true/false$>$ The active, AS, keepalive, holdtime, id and ipv6 arguments are optional. Active defaults to being true and actively makes a connection, setting active to false sets up a listener. The AS value is recommended if a connection is wanted. The ipv6 argument defaults to false. \item {\sf send packet update origin $<$num$>$ aspath $<$path$>$ nexthop $<$ipv4$>$ nexthop6 $<$ipv6$>$ localpref $<$num$>$ nlri $<$net4$>$ nlri6 $<$net6$>$ withdraw $<$net4$>$ withdraw6 $<$net6$>$ med $<$value$>$ originatorid $<$ipv4$>$ clusterlist $<$ipv4$>$ community $<$community$>$ pathattr $<$num,num,num,...$>$} Send a BGP update packet to the BGP test target with the specified withdrawn routes, NLRI, and path attributes. The ``pathattr'' argument takes a list of commma separated byte values in decimal or hex. The ``patthattr'' exists to test optional path attributes. It should be noted that at this time it is not possible to create an illegal path attribute. The aspath can take the argument ``empty'' denoting and empty aspath. The community can take either a number (in octal, decimal or hex) or the well known name ``NO\_EXPORT'', ``NO\_ADVERTISE'' or ``NO\_EXPORT\_SUBCONFED'', multiple communities can be added using multiple community statements. \item {\sf send packet notify $<$error code$>$ $<$sub error code$>$} Send a notification packet. The $<$error code$>$ is mandatory. The $<$sub error code$>$ is optional. \item {\sf send packet keepalive} Send a keepalive packet. \item {\sf send packet open asnum $<$value$>$ bgpid $<$ipv4$>$ holdtime $<$value$>$ afi $<$value$>$ safi $<$value$>$} Send an open packet. All fields apart from afi and safi are mandatory. \item {\sf send packet corrupt $<$offset$>$ $<$value$>$ ... } Any of the packets listed above can be corrupted by preceeding with the corrupt keyword followed by an offset and value. The offset must fall within the packet, the offset starts from zero. Multiple offset value pairs may be used. An example of corrupting a keepalive can be seen in Figure \ref{prog:corrupt}.\begin{figure}[htbp]\small\begin{verbatim}...peer1 send packet corrupt 0 0 keepalive...\end{verbatim}\vspace{-0.1in}\caption{\label{prog:corrupt}Corrupt a keepalive}\end{figure} \item {\sf send dump mrtd update filename $<$packet count$>$} Given a file in mrtd dump format send the update packets in this file. Optionally supply a packet count for the number of update packets that should be sent. \item {\sf trie $<$recv/sent$>$ lookup $<$net$>$} Test to see if this net is in the test peer's send or receive trie. \item {\sf trie $<$recv/sent$>$ lookup $<$net$>$ not} Test to see if this net is not in the trie. \item {\sf trie $<$recv/sent$>$ lookup $<$net$>$ aspath $<$path$>$} Test to see if this net is in the trie and associated with the provided AS path. The AS path can be to the value ``empty'' if a check for an empty AS path is required. \item {\sf expect packet notify $<$error code$>$ $<$sub error code$>$} Place a notification packet on the expect queue. The $<$error code$>$ is mandatory. The $<$sub error code$>$ is optional. \item {\sf expect packet update origin $<$num$>$ aspath $<$path$>$ nexthop $<$ip$>$ localpref $<$num$>$ nlri $<$net$>$ withdraw $<$net$>$} Place an update packet on the expect queue. The aspath can take the argument ``empty'' denoting and empty aspath. \item {\sf expect packet open asnum $<$value$>$ bgpid $<$ipv4$>$ holdtime $<$value$>$} Place an open packet on the expect queue. All fields shown are mandatory. \item {\sf expect packet notify} Place a notify packet on the expect queue. \item {\sf assert queue $<$queue length$>$} Check the queue length of the expect queue. Every message that matches removes an entry from the queue. If an error has previously occurred then this call will return the error. The length of the queue check is optional. \item {\sf assert connected} Verify that a TCP session exists. \item {\sf assert established} Verify that a BGP session has actually been established. Some tests can pass without a BGP process being present. These tests require this interface. \item {\sf assert idle} Verify that no session is currently established. Useful for verifying that after an error the session has actually been torn down. \item {\sf dump $<$recv/sent$>$ $<$mtrd/text$>$ $<$ipv4/ipv6$>$ $<$traffic/routeview/replay/debug$>$ $<$filename$>$} A mechanism for saving conversations or dumping routing tables. The received and sent cases can be dealt with independently. Four types of dumps are supported: \begin{enumerate} \item Traffic. The is basically all the traffic which is sent and received. The dumping can be disabled by making a call with the $<$filename$>$ argument removed. \item Routeview. The current state of the routing table. \item Replay Trawls through the routing table and dumps all the update packets that have caused entries in the routing table. The packets are dumped in the order in which they arrived. \item Debug. Visit all nodes in the trie and dump the update packet that was responsible for this entry. Update packets can have multiple NLRI's associated with them so a packet can be in the dump many times. \end{enumerate} The save file can be either in mtrd dump format or in xorp text format.\end{itemize}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\subsection{TEST PEER XRLs}Commands that are accepted by the test peer. This interface isused by the coordinating process to control the test peers. It shouldnever be used directly and is documented here for completeness.\begin{itemize} \item Register("coord") This is an external registration to the test peer. All packets received by the test peer are sent to the "coord". \item Packetisation("bgp") Tell the test peer to treat incoming packets as BGP packets packetise them accordingly. Otherwise just packetise the the packets the way they appear from the connection. \item Connect("host", "port") Connect to the named host and port. \item Listen("address", "port") Listen for connections on this address and port. \item Bind("address", "port") Bind on this address and port. This command exists solely to test that the entity under test does not block in connect. It is not a requirement to make a call to ``bind'' before the ``connect'' or ``listen'' commands. \item Send("Data") Send data on the TCP connection. \item Disconnect() Drop the current TCP connection. \item Terminate() Terminate the process.\end{itemize}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\subsection{TEST PEER CLIENT XRLs}This interface is implemented by the coordinator which is a client ofthe test peer.\begin{itemize} \item Packet("peer", "status", "time", "data") \begin{itemize} \item "peer" The peer that the packet came from. \item "status" If the remote peer had been asked to perform packetisation. Then if a bad message is received signify this. Also after a bad is received packetisation is disabled. \item "time" The time when the packet was received in micro seconds since \mbox{1970-1-1}. \item "data" The raw data that was read on the connection. \end{itemize}\end{itemize}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\section{Outstanding Issues}\begin{itemize} \item At the time of writing the harness has only been used against the XORP BGP process. There is no reason to believe that it could not be used against implementations.\end{itemize}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% APPENDIX%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\appendix\section{Modification History}\begin{itemize} \item December 11, 2002: Initial version 0.1 completed. \item March 10, 2003: Updated to match XORP release 0.2: the ``med'' argument is supported for building packets. \item June 9, 2003: Updated the version to 0.3, and the date. \item August 28, 2003: Updated to match XORP release 0.4. \item November 6, 2003: Updated to match XORP release 0.5. \item July 8, 2004: Updated to match XORP release 1.0. \item April 13, 2005: Updated to match XORP release 1.1: the ``afi'' and ``safi'' arguments are supported for building packets. \item March 8, 2006: Updated to match XORP release 1.2. \item August 2, 2006: Updated to match XORP release 1.3: added support for setting the community attribute in BGP update packets. \item March 20, 2007: Updated the version to 1.4, and the date.\end{itemize}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% BIBLIOGRAPHY%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\bibliography{../tex/xorp}\bibliographystyle{plain}\end{document}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -