initial commit master
authorAdam Megacz <adam@megacz.com>
Wed, 5 May 2010 22:10:09 +0000 (15:10 -0700)
committerAdam Megacz <adam@megacz.com>
Wed, 5 May 2010 22:10:09 +0000 (15:10 -0700)
src/edu/berkeley/cs/jrx/RxConnection.java [new file with mode: 0644]

diff --git a/src/edu/berkeley/cs/jrx/RxConnection.java b/src/edu/berkeley/cs/jrx/RxConnection.java
new file mode 100644 (file)
index 0000000..cea9b85
--- /dev/null
@@ -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