|
Net::Layers::Physical::Unreliable - Perl extension for testing network layer protocols on an unreliable physical layer. |
Net::Layers::Physical::Unreliable - Perl extension for testing network layer protocols on an unreliable physical layer.
use Net::Layers::Physical::Unreliable;
my $obj = Net::Layers::Physical::Unreliable->new();
$obj->attempt("Message");
Perl extension for testing network layer protocols (TCP|UDP|etc) on an unreliable physical layer.
The attempt method will returned a dropped (null) string, a garbled string (a string replaced with a non-sensical characters), or the orignal string.
Statistics are generated and can be called as shown bellow.
Creates a new unreliable object. Optional parameters drop_percentage and garble_percentage are the percentages of a message being droped or garbled respectivly, in the range of 0 to 100 percent.
Returns the orignal string, if the packet is not dropped or grabled. The following things happen: 1) The message is accepted. The number of attempted messages is incremented by 1. 2) A random number is generated in the range of 0..100. 3) If the random number is less than the drop_percentage, the message is ``dropped'' (an undef is returned), and the drop counter is incremented by one. If the random number is less than the drop_percentage plus the garble_percentage, the message is garbled, and is returned. 4) Else, the orignal message is returned and the orignal counter is incremented by one.
Returns the number of attempted messages.
Returns the number of messages that were returned in the orignal form.
Returns the number of messages that were garbled.
Returns the number of messsages that were dropped.
Returns what happened last to the packet. Code Description -1 Packet returned was dropped 0 Packet returned was a garbled 1 Packet returned was the orignal packet
Zachary Zebrowski, zak@freeshell.org
Effective Perl Programming by Joseph N. Hall with Randl L. Schwartz
Computer Networks by Andrew Anenbaum
|
Net::Layers::Physical::Unreliable - Perl extension for testing network layer protocols on an unreliable physical layer. |