A world of warcraft networking library https://www.leonetienne.de/projects/azernet.html
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

122 lines
3.6 KiB

THE AZERNET SOCKET SPECIFICATION
The azernet socket is a data channel to transmit binary data via pixel information at an uneven frequency.
It consists of a sync lane and data lanes.
It always has one sync lane and 2*4^n data lanes.
===== TOPOLOGY =====
n=0
+------+ +---------------------------------------+
| | | || || || |
| S | | || || || |
| Y | | D1 || D2 || D3 || D4 |
| N | | || || || |
| C | +---------------------------------------+
| | +---------------------------------------+
| | | || || || |
| | | || || || |
| | | D5 || D6 || D7 || D8 |
| | | || || || |
+------+ +---------------------------------------+
Each lane can transmit up to 5 bits per color channel at once, adding up to 15 bits per lane per istance.
===== SYNC LANE =====
The sync lane transmits six simultaniously.
These stand for:
Bit 0: The sync clock signal
=> The sync clock bit flips every time the socket updates. This way the receiver knows when the socket shows new data
Bit 1-2: The bit depth
=> Bit 1&2 represent a 2-bit number, representing the bit-depth of the data lanes.
It is offset by 2, meaning 00 stands for a bit-depth of 2. 11 would be a bit-depth of 5.
The bit-depth has to be adjustable because increasing it increases noise.
Bit 3-4: DLSF (Data Lane Subdivision Factor)
=> Bit 3&4 represent a 2-bit number, that is the input for a function representing the amount of data lanes. Let n=DLSF; numDataLanes = 2*4^n; Basically, how often each "base-lane" (DLSF=0) is subdivided into four more lanes.
Bit 5: Termination sequence
=> Bit5 = 0 indicates that the current frame has finished transmitting.
The receiver will stop polling the data lanes until Bit5 is 1 again.
Bit5 = 0 will also trigger the current bitbuffer on the receiving side to be pushed to the next layer.
===== DATA LANES ====
Each data lane can transmit up to 15 bits in once state.
This is achieved by setting each color channels value to
(255 / (2^m-1)) * k
where m is the bit-depth and k is the bit-sequence in base-10
The bit-depth is transmitted in the sync lane.
==== DATA MODULATION ====
Because of multi-bit-depth per channel, each color channel can transmit multiple bits.
Therefore we can say that a lanes red-channel transmits this sequence all at once: {0,1,0,1,0}
Modulation occurs like this:
modulatedBits = {};
for (i=1, bitDepth * 3)
{
for (j=1, numLanes)
{
modulatedBits[j][i] = bits.popFirst();
}
}
What this means:
The bits to transmit will get striped over the lanes BEFORE being striped over the channels.
Therefore this bit sequence {0,1,1,0 ,0,1,1,1, 0,1,0,0 ,0,1,0,1, 0,0,0,0 0,0,0,0} would be striped like this (assuming m=bitDepth=2)
d1.red = {0,1}
d1.grn = {0,1}
d1.blu = {0,0}
d2.red = {1,0}
d2.grn = {0,0}
d2.blu = {0,0}
d3.red = {0,1}
d3.grn = {0,1}
d3.blu = {0,0}
d4.red = {1,1}
d4.grn = {0,1}
d4.blu = {0,0}
To illustrate, let's replace the bits with letters:
{a,b,c,d ,e,f,g,h, i,j,k,l ,m,n,o,p, q,r,s,t u,v,w,x}
d1.red = {a,b}
d1.grn = {i,j}
d1.blu = {q,r}
d2.red = {c,d}
d2.grn = {k,l}
d2.blu = {s,t}
d3.red = {e,f}
d3.grn = {m,n}
d3.blu = {u,v}
d4.red = {g,h}
d4.grn = {o,p}
d4.blu = {w,x}
Now with m=bitDepth=5. Note how the empty space is padded with 0
d1.red = {a,b,c,d,e}
d1.grn = {k,l,m,n,o}
d1.blu = {u,v,w,x,0}
d2.red = {f,g,h,i,j}
d2.grn = {p,q,r,s,t}
d2.blu = {0,0,0,0,0}
// no d3,d4