From 6c4e07e2efba8a51f3089184c5c2aac93a71a277 Mon Sep 17 00:00:00 2001 From: Adam Megacz Date: Wed, 5 May 2010 15:10:09 -0700 Subject: [PATCH] initial commit --- src/edu/berkeley/cs/jrx/RxConnection.java | 69 +++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 src/edu/berkeley/cs/jrx/RxConnection.java diff --git a/src/edu/berkeley/cs/jrx/RxConnection.java b/src/edu/berkeley/cs/jrx/RxConnection.java new file mode 100644 index 0000000..cea9b85 --- /dev/null +++ b/src/edu/berkeley/cs/jrx/RxConnection.java @@ -0,0 +1,69 @@ +// http://openafs.sinenomine.net/~mmeffie/rfc/draft-zeldovich-rx-spec-00.txt +// prounounced "jerks" + +// typo: "contees" => "contents" + +/* + Ambiguities: + - so, unlimited channels per connection, one call per channel, but only + four calls per connection? + - who picks the epoch, client or server? + */ + +public class RxConnection { + + // I think this is per-host + private static final int epoch; + + /* + An Rx connection between two + hosts is identified by: + + { Epoch, Connection ID, Peer IP, Peer Port }, + if the high bit of the epoch (+) is not set + { Epoch, Connection ID }, + if the high bit of the epoch (+) is set + +if the high epoch bit is set, the recipient of a + packet should accept packets for this Rx connection from any IP + address and port number + */ + + InetAddress host; + int port; + short serviceid; + + public RxConnection(InetAddress host, int port, short serviceid) { + this.host = host; + this.port = port; + this.serviceId = serviceId; + } + + + // one outstanding call per channel at a time + // I think there can only be four active calls per connection + public class RxChannel { + private int connectionId; // chosen by the client that establishes the + connection The last two bits of the same 32-bit field are used by + Rx to multiplex between 4 parallel calls on the same connection. + Each one of them is called an Rx channel, and therefore the field is + denoted "Channel ID". (?!?!) + + public class RxCall { + private int callNumber; // initial call number must be nonzero + // chosen by the peer that initiates the call + + private int sequenceNumber; // counts packets not bytes, starts at 1 + private int serialNumber; // starts at one, inc with each transmission + + public class RxPacket { + public final int sequenceNumber; + // zero checksum means it is not being computed + // status field is optional + } + + } + } + + +} \ No newline at end of file -- 1.7.10.4