test_harness.tex

来自「BCAST Implementation for NS2」· TEX 代码 · 共 491 行 · 第 1/2 页

TEX
491
字号
  argument is create then the test\_peer is started (not currently  supported).\end{itemize}\subsubsection{Peer specific commands}\begin{itemize}\item connect  Connect to the BGP target under test.\item disconnect  Disconnect from the BGP target under test.\item listen   Listen for a connection from the BGP test target.\item {\sf establish  active $<$true/false$>$  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$>$  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.\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.\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.\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 established}  Verify that a 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 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}\section{\label{NYI} Not yet implemented or TODO list}\begin{itemize}\item Constructing corrupted packets.\end{itemize}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     BIBLIOGRAPHY%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\bibliography{../tex/xorp}\bibliographystyle{plain}\end{document}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?