Simple Reliable MulticastA pair of Pipelines for encoding (and decoding again) a stream of data such that is can be transported over an unreliable connection that may lose, duplicate or reorder data. These components will ensure that data arrives in the right order and that duplicates are removed. However it cannot recover lost data. Example UsageReliably transporting a file over multicast (assuming no packets are lost): Pipeline(RateControlledFileReader("myfile"), SRM_Sender(), Multicast_transceiver("0.0.0.0", 0, "1.2.3.4", 1000), ).activate() On the client: class discardSeqnum(component): def main(self): while 1: if self.dataReady("inbox"): (_, data) = self.recv("inbox") self.send(data,"outbox") Pipeline( Multicast_transceiver("0.0.0.0", 1000, "1.2.3.4", 0) SRM_Receiver(), discardSeqnum(), ConsoleEchoer() ).activate() How does it work?SRM_Sender is a Pipeline of three components:
SRM_Receiver is a Pipeline of three components:
These components will ensure that data arrives in the right order and that duplicates are removed. However it cannot recover lost data. But the final output is (seqnum,data) pairs - so there is enough information for the receiver to know that data has been lost. The Annotator component receives data on its "inbox" inbox, and emits (seqnum, data) tuples on its "outbox" outbox. The sequence numbers start at 1 and increments by 1 for each item. The Annotator component does not terminate and ignores messages arriving on its "control" inbox. See documentation for the other components for details of their design and behaviour. Kamaelia.Protocol.SimpleReliableMulticast.Annotatorclass Annotator(Axon.Component.component)Annotator() -> new Annotator component. Takes incoming data and outputs (n, data) where n is an incrementing sequence number, starting at 1. Methods defined hereWarning! You should be using the inbox/outbox interface, not these methods (except construction). This documentation is designed as a roadmap as to their functionalilty for maintainers and new component developers. main(self)Main loop Kamaelia.Protocol.SimpleReliableMulticast.RecoverOrderclass RecoverOrder(Axon.Component.component)RecoverOrder() -> new RecoverOrder component. Receives and buffers (seqnum, data) pairs, and reorders them by ascending sequence number and emits them (when its internal buffer is full). Methods defined hereWarning! You should be using the inbox/outbox interface, not these methods (except construction). This documentation is designed as a roadmap as to their functionalilty for maintainers and new component developers. main(self)Main loop. Kamaelia.Protocol.SimpleReliableMulticast.SRM_Receiverprefab: SRM_ReceiverSimple Reliable Multicast receiver. Dechunks, deframes and recovers the order of a data stream that has been encoded by SRM_Sender. Final emitted data is (seqnum, data) pairs. This is a Pipeline of components. Kamaelia.Protocol.SimpleReliableMulticast.SRM_Senderprefab: SRM_SenderSimple Reliable Multicast sender. Sequence numbers, frames and chunks a data stream, making it suitable for sending over an unreliable connection that may lose, reorder or duplicate data. Can be decoded by SRM_Receiver. This is a Pipeline of components. FeedbackGot a problem with the documentation? Something unclear that could be clearer? Want to help improve it? Constructive criticism is very welcome - especially if you can suggest a better rewording! Please leave you feedback here in reply to the documentation thread in the Kamaelia blog. -- Automatic documentation generator, 05 Jun 2009 at 03:01:38 UTC/GMT |
Kamaelia
is an open source project originated from and guided by BBC
Research. For more information browse the site or get in
contact.
This is an ongoing community based development site. As a result the contents of this page is the opinions of the contributors of the pages involved not the organisations involved. Specificially, this page may contain personal views which are not the views of the BBC. (the site is powered by a wiki engine)
(C) Copyright 2008 Kamaelia Contributors, including the British Broadcasting Corporation, All Rights Reserved.