Difference between revisions of "SOE Protocol Breakdown"

From SWGANH Wiki
Jump to: navigation, search
(Packet Type -- '''00 03''')
 
(32 intermediate revisions by 8 users not shown)
Line 1: Line 1:
__NOTOC__
+
{{PageHeader|Guides|SOE Protocol Breakdown}}
 
+
 
SOE's Protocol is a systematic way to enhance the UDP protocol to make it more reliable, and also save bandwidth by merging and grouping packets. It can be combined in various ways, or not be used at all.
 
SOE's Protocol is a systematic way to enhance the UDP protocol to make it more reliable, and also save bandwidth by merging and grouping packets. It can be combined in various ways, or not be used at all.
  
Line 94: Line 93:
 
==Packet Type -- '''00 02'''==
 
==Packet Type -- '''00 02'''==
  
{{InfoboxPacketDetail|Packet Type 00 02  -  Session Response(Server -> Client)|
+
{{InfoboxPacketDetail|Packet Type 00 02  -  Session Response (Server -> Client)|
 
<pre>
 
<pre>
SOE Opcode - Net Byte SHORT
+
SOE Opcode - Net Byte SHORT
Connection ID - Net Byte INT
+
Connection ID - Net Byte INT
CRCSeed - Net Byte INT
+
CRCSeed - Net Byte INT
CRCLength - BYTE
+
CRCLength - BYTE
UNKNOWN - SHORT
+
UseCompression  - BYTE
ServerUDPSize - Net Byte INT
+
SeedSize        - BYTE
 +
ServerUDPSize - Net Byte INT
 
</pre>
 
</pre>
 
}}
 
}}
Line 108: Line 108:
 
* '''CRCSeed''' is a seed value used for the calculation of the CRC32 Checksum.
 
* '''CRCSeed''' is a seed value used for the calculation of the CRC32 Checksum.
 
* '''CRCLength'''
 
* '''CRCLength'''
* '''UNKNOWN''' is an unknown value that is constant and equal to 0x0104 (260).
+
* '''UseCompression''' 0/1 Compression on/off
 +
* '''SeedSize''' Size in bytes for the XOR encryption key. Strange that this appears after the CRCSeed. Seed seems to have a max value of 5bytes. Standard is 4
 
* '''ServerUDPSize''' is the maximum size allocated for the server's UDP packet buffer. No packet is allowed to exceed this size. So far the client has not sent anything large enough to fill this, or be fragmented. This size is equal to 496 bytes.
 
* '''ServerUDPSize''' is the maximum size allocated for the server's UDP packet buffer. No packet is allowed to exceed this size. So far the client has not sent anything large enough to fill this, or be fragmented. This size is equal to 496 bytes.
  
Line 161: Line 162:
 
</pre>
 
</pre>
  
In the case where the size exceeds 0xFF (255) bytes, the following sytem is used for the "Data Size" component.
+
* '''NOTE''': ''The Size field will never exceed 255.
 
+
The first byte will be 0xFF. The next byte will be 0x01. The following byte will be how much to add to 255. Because no packet can exceed 496 bytes, The 3rd bye will never exceed 0xFF. We believe the 0x01 is the amount of following bytes to add to 255, but that cannot be determined.
+
 
+
<pre>
+
(0XFF 0X01 0X01) = 255 + 1 = 256 bytes
+
(0xFF 0X01 0X0A) = 255 + 10 = 265 bytes
+
(0xFF 0x01 0x25) = 255 + 37 = 292 bytes
+
</pre>
+
 
+
* '''NOTE''': ''Because 255 may be done in a few ways, the following way is how we have seen it. (0xFF 0x00 0xFF) or 255 + 0 (do not add the following byte) = 255.''
+
  
 
===Packet Sample -- '''00 03'''===
 
===Packet Sample -- '''00 03'''===
Line 223: Line 214:
 
}}
 
}}
  
==Packet Type -- '''00 04'''==
+
{{InfoboxPacketSample|Server MIN MultiPacket 0x0003|
 +
<pre>0x0003</pre>
 +
|<pre>04 00 11 01 8E 04 00 11 01 8F</pre>
 +
|<pre>..........</pre>
 +
}}
 +
 
 +
{{InfoboxPacketSample|Client MAX MultiPacket 0x0003|
 +
<pre>0x0003</pre>
 +
|<pre>04 00 15 0B 1E 9E 00 09 07 9E 00 19 2E 05 00 46
 +
5E CE 80 23 00 00 00 16 01 00 00 13 6C 35 E3 16
 +
00 00 00 00 00 00 00 80 00 00 00 02 B7 A8 D6 9B
 +
FC 19 AE 1A 00 00 00 00 00 00 00 22 05 00 46 5E
 +
CE 80 83 00 00 00 26 01 00 00 13 6C 35 E3 16 00
 +
00 00 00 00 00 00 00 00 00 00 00 00 00 00 22 05
 +
00 46 5E CE 80 83 00 00 00 26 01 00 00 13 6C 35
 +
E3 16 00 00 00 00 00 00 00 DF B5 1A AE 1A 00 00
 +
00 22 05 00 46 5E CE 80 83 00 00 00 26 01 00 00
 +
13 6C 35 E3 16 00 00 00 00 00 00 00 9B FC 19 AE
 +
1A 00 00 00 4F 05 00 46 5E CE 80 21 00 00 00 F1
 +
00 00 00 13 6C 35 E3 16 00 00 00 00 00 00 00 81
 +
49 E9 85 A2 01 00 00 EF B4 1A AE 1A 00 00 00 00
 +
00 00 00 33 FD 68 BD 00 00 00 00 E5 95 7F 3F D8
 +
AE 3E 3F 33 33 33 3F CA 56 49 40 00 00 00 41 00
 +
00 00 00 00 F0 00 09 07 9F 00 19 2E 05 00 46 5E
 +
CE 80 23 00 00 00 16 01 00 00 13 6C 35 E3 16 00
 +
00 00 00 00 00 00 80 00 00 00 02 B7 A8 D6 9B FC
 +
19 AE 1A 00 00 00 00 00 00 00 22 05 00 46 5E CE
 +
80 83 00 00 00 26 01 00 00 13 6C 35 E3 16 00 00
 +
00 00 00 00 00 00 00 00 00 00 00 00 00 22 05 00
 +
46 5E CE 80 83 00 00 00 26 01 00 00 13 6C 35 E3
 +
16 00 00 00 00 00 00 00 9B FC 19 AE 1A 00 00 00
 +
2E 05 00 46 5E CE 80 23 00 00 00 16 01 00 00 13
 +
6C 35 E3 16 00 00 00 00 00 00 00 80 00 00 00 02
 +
B7 A8 D6 9B FC 19 AE 1A 00 00 00 00 00 00 00 22
 +
05 00 46 5E CE 80 83 00 00 00 26 01 00 00 13 6C
 +
35 E3 16 00 00 00 00 00 00 00 00 00 00 00 00 00
 +
00 00 22 05 00 46 5E CE 80 83 00 00 00 26 01 00
 +
00 13 6C 35 E3 16 00 00 00 00 00 00 00 9B FC 19
 +
AE 1A 00 00 00</pre>
 +
|<pre>...............F^..#........l5..........
 +
..................."..F^......&....l5...
 +
.............."..F^......&....l5........
 +
........."..F^......&....l5.............
 +
....O..F^..!........l5..........I.......
 +
...........3.h.......?..>[email protected].
 +
..............F^..#........l5...........
 +
.................."..F^......&....l5....
 +
............."..F^......&....l5.........
 +
...........F^..#........l5..............
 +
..............."..F^......&....l5.......
 +
.........."..F^......&....l5............
 +
.....</pre>
 +
}}
 +
 
 +
{{InfoboxPacketSample|Client MIN MultiPacket 0x0003|
 +
<pre>0x0003</pre>
 +
|<pre>04 00 15 02 0B 04 00 15 02 0F</pre>
 +
|<pre>..........</pre>
 +
}}
 +
 
 +
==Packet Type -- '''00 05'''==
  
{{InfoboxPacketDetail|Packet Type 00 05  -  Disconnect(VARIOUS)|
+
{{InfoboxPacketDetail|Packet Type 00 05  -  Disconnect (VARIOUS)|
 
<pre>
 
<pre>
 
SOE Opcode - Net Byte SHORT
 
SOE Opcode - Net Byte SHORT
Line 235: Line 286:
 
* '''Connection ID''' is the ID number assigned during the session request. Each client sends its own Connection ID. Reason ID is an ID number that corresponds for a reason for the disconnection.
 
* '''Connection ID''' is the ID number assigned during the session request. Each client sends its own Connection ID. Reason ID is an ID number that corresponds for a reason for the disconnection.
  
This packet is sent whenever one side wants to disconnect. It resends the clients specific Connection ID established during the session handshake, and then a reason for disconnection. So far the standard reason ID seen has been 6. Others have been tested and do not have any different effect.
+
This packet is sent whenever one side wants to disconnect. It resends the clients specific Connection ID established during the session handshake, and then a reason for disconnection. The possible disconnect reasons and the associated ID seen in the packet are in the table below.
  
<font color=red>'''No table correspnding IDs to reasons has been located.'''</font>
+
{| class="wikitable"
 +
|-
 +
||'''ID'''||'''String'''
 +
|-
 +
|align="center"|0||None
 +
|-
 +
|align="center"|1||ICMP Error
 +
|-
 +
|align="center"|2||Timeout
 +
|-
 +
|align="center"|3||Other side terminated
 +
|-
 +
|align="center"|4||Manager deleted
 +
|-
 +
|align="center"|5||Connect fail
 +
|-
 +
|align="center"|6||Application
 +
|-
 +
|align="center"|7||Unreachable connection
 +
|-
 +
|align="center"|8||Unacknowledged timeout
 +
|-
 +
|align="center"|9||New connection attempt
 +
|-
 +
|align="center"|10||Connection refused
 +
|-
 +
|align="center"|11||Mutual connect error
 +
|-
 +
|align="center"|12||Connecting to self
 +
|-
 +
|align="center"|13||Reliable overflow
 +
|}
  
 
==Packet Type -- '''00 06'''==
 
==Packet Type -- '''00 06'''==
Line 243: Line 325:
 
{{InfoboxPacketDetail|00 06  -  Keep Alive(VARIOUS)|
 
{{InfoboxPacketDetail|00 06  -  Keep Alive(VARIOUS)|
 
<pre>
 
<pre>
SOE Opcode - Net Byte SHORT
+
SOE Opcode - Comp / CRC
 
</pre>
 
</pre>
 
}}
 
}}
  
This packet is simply a keep alive to tell the other side that is still connected, but idle. It only consists of the opcode and a footer.  
+
This packet is simply a keep alive to tell the other side that is still connected, but idle. It only consists of the opcode and a footer.
 +
 
 +
===Packet Samples -- '''00 06'''===
 +
 
 +
{{InfoboxPacketSample|Server MAX Ping 0x0006|
 +
<pre>0x0006</pre>
 +
|<pre>CB 3A 78</pre>
 +
|<pre>.:x</pre>
 +
}}
 +
 
 +
{{InfoboxPacketSample|Server MIN Ping 0x0006|
 +
<pre>0x0006</pre>
 +
|<pre>16 01 A7</pre>
 +
|<pre>...</pre>
 +
}}
 +
 
 +
{{InfoboxPacketSample|Client MAX Ping 0x0006|
 +
<pre>0x0006</pre>
 +
|<pre>C7 23 8F</pre>
 +
|<pre>.#.</pre>
 +
}}
 +
 
 +
{{InfoboxPacketSample|Client MIN Ping 0x0006|
 +
<pre>0x0006</pre>
 +
|<pre>CB 3A 78</pre>
 +
|<pre>.:x</pre>
 +
}}
  
 
==Packet Type -- '''00 07'''==
 
==Packet Type -- '''00 07'''==
Line 253: Line 361:
 
{{InfoboxPacketDetail|00 07  -  Client Network Status Update|
 
{{InfoboxPacketDetail|00 07  -  Client Network Status Update|
 
<pre>
 
<pre>
SOE Opcode - Net Byte SHORT
+
SOE Opcode - Net Byte SHORT
Data..
+
Client TickCount - Net Byte SHORT
 +
Last update - Net Byte INT
 +
Average update - Net Byte INT
 +
Shortest update - Net Byte INT
 +
Longest update - Net Byte INT
 +
Last Server update - Net Byte INT
 +
Packets sent - Net Byte LONG
 +
Packets received - Net Byte LONG
 
</pre>
 
</pre>
 
}}
 
}}
Line 261: Line 376:
  
 
'''Note''': <font color=orange>''This packet is usually compressed but is optional.''</font>
 
'''Note''': <font color=orange>''This packet is usually compressed but is optional.''</font>
 +
 +
===Packet Samples -- '''00 07'''===
 +
 +
{{InfoboxPacketSample|Client MAX NetStatRequest 0x0007|
 +
<pre>0x0007</pre>
 +
|<pre>CA 3A 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 +
00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 00
 +
00 00 00 00 00 01</pre>
 +
|<pre>.:....................................</pre>
 +
}}
 +
 +
 +
{{InfoboxPacketSample|Client MIN NetStatRequest 0x0007|
 +
<pre>0x0007</pre>
 +
|<pre>D2 C7 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 +
00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 00
 +
00 00 00 00 00 01 </pre>
 +
|<pre>......................................</pre>
 +
}}
  
 
==Packet Type -- '''00 08'''==
 
==Packet Type -- '''00 08'''==
Line 266: Line 400:
 
{{InfoboxPacketDetail|00 08  -  Server Network Status Update|
 
{{InfoboxPacketDetail|00 08  -  Server Network Status Update|
 
<pre>
 
<pre>
SOE Opcode - Net Byte SHORT
+
SOE Opcode - Net Byte SHORT
Data..
+
Client TickCount - Net Byte SHORT (As in request)
 +
Server TickCount - Net Byte INT (I think this should be old server tickcount + client tickcount)
 +
client packets sent - Net Byte LONG
 +
client packets received - Net Byte LONG
 +
server packets sent - Net Byte LONG
 +
server packets received - Net Byte LONG
 
</pre>
 
</pre>
 +
}}
 +
===Packet Samples -- '''00 08'''===
 +
{{InfoboxPacketSample|Server MIN NetStatResponse 0x0008|
 +
<pre>0x0008</pre>
 +
|<pre>D2 C7 90 96 3F 20 00 00 00 00 00 00 00 02 00 00
 +
00 00 00 00 00 01 00 00 00 00 00 00 00 02 00 00
 +
00 00 00 00 00 02 </pre>
 +
|<pre>....?.................................</pre>
 
}}
 
}}
  
 +
{{InfoboxPacketSample|Server MAX NetStatResponse 0x0008|
 +
<pre>0x0008</pre>
 +
|<pre>CA 3A 63 75 DB 1D 00 00 00 00 00 00 00 02 00 00
 +
00 00 00 00 00 01 00 00 00 00 00 00 00 02 00 00
 +
00 00 00 00 00 02 </pre>
 +
|<pre>.:cu..................................</pre>
 +
}}
 +
 +
{{InfoboxPacketSample|Client MIN NetStatResponse 0x0008|
 +
<pre>0x0008</pre>
 +
|<pre>00 B9 6F 02 76 00 00 30 00 75 00 FE 7F 5F A8 2B
 +
CF 00 00 00 00 07 08 00 C6 27 F7 90 </pre>
 +
|<pre>..o.v..0.u.._.+.........'..</pre>
 +
}}
 +
 +
{{InfoboxPacketSample|Client MAX NetStatResponse 0x0008|
 +
<pre>0x0008</pre>
 +
|<pre>00 B9 6F 02 76 00 00 31 00 75 00 FE 7F 5F A8 2B
 +
CF 00 00 00 00 00 00 00 D3 03 F7 90 </pre>
 +
|<pre>..o.v..1.u.._.+............</pre>
 +
}}
  
 
This packet is supposed to contain the Servers network statistics, however we felt it was a waste of time to reverse
 
This packet is supposed to contain the Servers network statistics, however we felt it was a waste of time to reverse
Line 287: Line 455:
 
SWG PACKET..
 
SWG PACKET..
 
</pre>
 
</pre>
 +
}}
 +
 +
===Packet Samples -- '''00 09'''===
 +
 +
{{InfoboxPacketSample|Server MIN DataChannel 0x0009|
 +
<pre>0x0009</pre>
 +
|<pre>00 03 01 00 BE E9 2F D7 </pre>
 +
|<pre>....../.</pre>
 +
}}
 +
 +
{{InfoboxPacketSample|Server MAX DataChannel 0x0009|
 +
<pre>0x0009</pre>
 +
|<pre>54 06 00 19 A4 05 00 2A 2F F1 F3 F2 BB 21 B6 1E
 +
00 00 00 00 00 04 00 00 00 09 00 63 6F 6E 64 69
 +
74 69 6F 6E 07 00 00 00 31 00 30 00 30 00 2F 00
 +
31 00 30 00 30 00 06 00 76 6F 6C 75 6D 65 01 00
 +
00 00 31 00 2D 00 63 61 74 5F 73 6B 69 6C 6C 5F
 +
6D 6F 64 5F 62 6F 6E 75 73 2E 40 73 74 61 74 5F
 +
6E 3A 73 74 72 65 6E 67 74 68 5F 6D 6F 64 69 66
 +
69 65 64 02 00 00 00 31 00 37 00 20 00 40 70 72
 +
6F 63 2F 70 72 6F 63 3A 72 65 71 75 69 72 65 64
 +
5F 63 6F 6D 62 61 74 5F 6C 65 76 65 6C 02 00 00
 +
00 38 00 35 00 FF FF FF FF 26 05 00 2A 2F F1 F3
 +
D5 C5 21 B6 1E 00 00 00 00 00 01 00 00 00 06 00
 +
76 6F 6C 75 6D 65 01 00 00 00 31 00 FF FF FF FF
 +
FF 01 18 05 00 2A 2F F1 F3 D6 C5 21 B6 1E 00 00
 +
00 00 00 08 00 00 00 06 00 76 6F 6C 75 6D 65 01
 +
00 00 00 31 00 20 00 40 70 72 6F 63 2F 70 72 6F
 +
63 3A 72 65 71 75 69 72 65 64 5F 63 6F 6D 62 61
 +
74 5F 6C 65 76 65 6C 02 00 00 00 32 00 30 00 15
 +
00 40 70 72 6F 63 2F 70 72 6F 63 3A 72 65 75 73
 +
65 5F 74 69 6D 65 07 00 00 00 35 00 20 00 2F 00
 +
20 00 73 00 65 00 63 00 17 00 40 70 72 6F 63 2F
 +
70 72 6F 63 3A 65 66 66 65 63 74 5F 6C 65 76 65
 +
6C 02 00 00 00 32 00 30 00 14 00 40 70 72 6F 63
 +
2F 70 72 6F 63 3A 70 72 6F 63 5F 6E 61 6D 65 18
 +
00 00 00 40 00 75 00 69 00 5F 00 62 00 75 00 66
 +
00 66 00 3A 00 61 00 67 00 69 00 63 00 6F 00 6E
 +
00 73 00 75 00 6D 00 61 00 62 00 6C 00 65 00 31
 +
00 35 00 04 00 74 69 65 72 01 00 00 00 32 00 0C
 +
00 74 6F 6F 6C 74 69 70 2E 74 69 65 72 01 00 00
 +
00 32 00 0C 00 6E 75 6D 5F 69 6E 5F 73 74 61 63
 +
6B 01 00 00 00 36 00 FF FF FF FF </pre>
 +
|<pre>T......*/....!.............condition....
 +
1.0.0./.1.0.0...volume....1.-.cat_skill_
 +
mod_bonus.@stat_n:strength_modified....1
 +
.7...@proc/proc:required_combat_level...
 +
.8.5.....&..*/....!.............volume..
 +
..1..........*/....!.............volume.
 +
...1...@proc/proc:required_combat_level.
 +
...2.0...@proc/proc:reuse_time....5.../.
 +
..s.e.c...@proc/proc:effect_level....2.0
 +
...@proc/proc:[email protected]._.b.u.f
 +
.f.:.a.g.i.c.o.n.s.u.m.a.b.l.e.1.5...tie
 +
r....2...tooltip.tier....2...num_in_stac
 +
k....6.....</pre>
 +
}}
 +
 +
{{InfoboxPacketSample|Client MIN DataChannel 0x0009|
 +
<pre>0x0009</pre>
 +
|<pre>01 F5 01 00 E0 5E 80 31 </pre>
 +
|<pre>.....^.1</pre>
 +
}}
 +
 +
{{InfoboxPacketSample|Client MAX DataChannel 0x0009|
 +
<pre>0x0009</pre>
 +
|<pre>20 46 05 00 46 5E CE 80 23 00 00 00 16 01 00 00
 +
48 12 06 E1 01 00 00 00 00 00 00 00 80 0D 00 00
 +
EF 50 45 16 00 00 00 00 00 00 00 00 DD 00 00 00
 +
36 00 37 00 32 00 37 00 33 00 37 00 31 00 34 00
 +
33 00 30 00 36 00 20 00 30 00 20 00 31 00 30 00
 +
38 00 37 00 38 00 36 00 38 00 39 00 30 00 33 00
 +
39 00 37 00 20 00 2D 00 31 00 20 00 31 00 30 00
 +
38 00 37 00 38 00 36 00 39 00 31 00 39 00 39 00
 +
30 00 33 00 20 00 2D 00 31 00 20 00 31 00 30 00
 +
38 00 37 00 38 00 37 00 30 00 39 00 30 00 37 00
 +
32 00 34 00 20 00 2D 00 31 00 20 00 31 00 30 00
 +
38 00 37 00 38 00 37 00 31 00 31 00 37 00 37 00
 +
33 00 31 00 20 00 2D 00 31 00 20 00 31 00 30 00
 +
38 00 37 00 39 00 35 00 31 00 36 00 33 00 36 00
 +
34 00 37 00 20 00 2D 00 31 00 20 00 31 00 30 00
 +
38 00 37 00 39 00 35 00 31 00 36 00 38 00 32 00
 +
32 00 34 00 20 00 2D 00 31 00 20 00 31 00 30 00
 +
38 00 37 00 39 00 35 00 31 00 39 00 30 00 37 00
 +
33 00 30 00 20 00 2D 00 31 00 20 00 31 00 30 00
 +
38 00 37 00 39 00 35 00 32 00 31 00 34 00 35 00
 +
31 00 30 00 20 00 2D 00 31 00 20 00 31 00 30 00
 +
38 00 37 00 39 00 35 00 32 00 34 00 33 00 39 00
 +
34 00 38 00 20 00 2D 00 31 00 20 00 31 00 30 00
 +
38 00 37 00 39 00 35 00 32 00 39 00 30 00 38 00
 +
31 00 39 00 20 00 2D 00 31 00 20 00 31 00 30 00
 +
38 00 37 00 39 00 35 00 32 00 39 00 35 00 30 00
 +
39 00 37 00 20 00 2D 00 31 00 20 00 31 00 31 00
 +
30 00 36 00 30 00 36 00 34 00 34 00 32 00 35 00
 +
37 00 36 00 20 00 30 00 20 00 31 00 31 00 30 00
 +
36 00 37 00 39 00 33 00 38 00 33 00 35 00 31 00
 +
36 00 20 00 2D 00 31 00 20 00 </pre>
 +
|<pre>.F..F^..#.......H................PE.....
 +
........6.7.2.7.3.7.1.4.3.0.6...0...1.0.
 +
8.7.8.6.8.9.0.3.9.7...-.1...1.0.8.7.8.6.
 +
9.1.9.9.0.3...-.1...1.0.8.7.8.7.0.9.0.7.
 +
2.4...-.1...1.0.8.7.8.7.1.1.7.7.3.1...-.
 +
1...1.0.8.7.9.5.1.6.3.6.4.7...-.1...1.0.
 +
8.7.9.5.1.6.8.2.2.4...-.1...1.0.8.7.9.5.
 +
1.9.0.7.3.0...-.1...1.0.8.7.9.5.2.1.4.5.
 +
1.0...-.1...1.0.8.7.9.5.2.4.3.9.4.8...-.
 +
1...1.0.8.7.9.5.2.9.0.8.1.9...-.1...1.0.
 +
8.7.9.5.2.9.5.0.9.7...-.1...1.1.0.6.0.6.
 +
4.4.2.5.7.6...0...1.1.0.6.7.9.3.8.3.5.1.
 +
6...-.1...</pre>
 
}}
 
}}
  
Line 297: Line 575:
  
 
Note* it is possible to combine multiple SWG PACKETs into a single 09.  
 
Note* it is possible to combine multiple SWG PACKETs into a single 09.  
This is done similar to the 03 system with the sizes (1 byte, or the 0xFF 0x01 0xXX which is 255 + XX)
+
This is done similar to the 0x0003 packet, a multi data example:
but there are 2 bytes after the sequence that flag a multiple SWG packet. It looks something like this:
+
 
+
 
<pre>
 
<pre>
 
(00 09) (sequence) (00 19) (Size1) (SWG PACKET) (Size2) (SWG PACKET)
 
(00 09) (sequence) (00 19) (Size1) (SWG PACKET) (Size2) (SWG PACKET)
 
SOE op.  sequence  multi  size      data      size      data
 
SOE op.  sequence  multi  size      data      size      data
 
</pre>
 
</pre>
 +
if the Size byte is FF the following 2 bytes are the size Word Little ended (16bit).
 +
Example:
 +
<pre>
 +
(00 09) (sequence) (00 19) (size byte) (size word) (SWG PACKET) (size byte) (SWG PACKET)
 +
SOE op.  sequence  multi    FF          01 99        data        33          data
 +
</pre>
 +
In the above the first packet size is 409 Dec.
 +
 +
Use these to combine SWG PACKETs together into 1 data packet/sequence number.
  
Use these to combine SWG PACKETs together into 1 data packet/sequence number.
 
 
 
==Packet Type -- '''00 0D'''==
 
==Packet Type -- '''00 0D'''==
  
Line 316: Line 599:
 
SWG Packet...
 
SWG Packet...
 
</pre>
 
</pre>
 +
}}
 +
===Packet Samples -- '''00 0D'''===
 +
{{InfoboxPacketSample|Client MIN DataFrag 0x000D|
 +
<pre>0x000D</pre>
 +
|<pre>04 CC 00</pre>
 +
|<pre>...</pre>
 +
}}
 +
 +
{{InfoboxPacketSample|Client MAX DataFrag 0x000D|
 +
<pre>0x000D</pre>
 +
|<pre>00 02 00 00 02 00 03 00 B9 63 1C C1 1B 00 00 00
 +
02 00 00 00 04 00 42 72 69 61 80 8F FF FF 03 00
 +
00 00 05 00 41 68 61 7A 69 80 8F FF FF 0C 00 00
 +
00 06 00 46 6C 75 72 72 79 80 8F FF FF 0D 00 00
 +
00 08 00 49 6E 74 72 65 70 69 64 80 8F FF FF 0E
 +
00 00 00 09 00 4B 65 74 74 65 6D 6F 6F 72 80 8F
 +
FF FF 0F 00 00 00 07 00 4E 61 72 69 74 75 73 80
 +
8F FF FF 10 00 00 00 06 00 53 63 79 6C 6C 61 80
 +
8F FF FF 11 00 00 00 09 00 53 75 6E 72 75 6E 6E
 +
65 72 80 8F FF FF 12 00 00 00 06 00 56 61 6C 63
 +
79 6E 80 8F FF FF 13 00 00 00 07 00 54 65 6D 70
 +
65 73 74 80 8F FF FF 28 00 00 00 0C 00 4A 61 70
 +
61 6E 2D 4B 61 74 61 6E 61 00 00 00 00 29 00 00
 +
00 0B 00 4A 61 70 61 6E 2D 48 61 72 6C 61 00 00
 +
00 00 19 00 00 00 09 00 53 74 61 72 73 69 64 65
 +
72 80 8F FF FF 1A 00 00 00 09 00 54 61 72 71 75
 +
69 6E 61 73 80 8F FF FF 1B 00 00 00 0A 00 57 61
 +
6E 64 65 72 68 6F 6D 65 80 8F FF FF 1C 00 00 00
 +
0A 00 53 68 61 64 6F 77 66 69 72 65 80 8F FF FF
 +
05 00 00 00 08 00 42 6C 6F 6F 64 66 69 6E 80 8F
 +
FF FF 06 00 00 00 09 00 43 68 69 6C 61 73 74 72
 +
61 80 8F FF FF 07 00 00 00 07 00 45 63 6C 69 70
 +
73 65 80 8F FF FF 08 00 00 00 06 00 47 6F 72 61
 +
74 68 80 8F FF FF 09 00 00 00 05 00 4B 61 75 72
 +
69 80 8F FF FF 0A 00 00 00 05 00 4C 6F 77 63 61
 +
80 8F FF FF 0B 00 00 00 07 00 52 61 64 69 61 6E
 +
74 80 8F FF FF 04 00 00 00 09 00 43 6F 72 62 61
 +
6E 74 69 73 80 8F FF FF 22 00 00 00 0F 00 45 75
 +
72 6F 70 65 2D 43 68 69 6D 61 65 72 61 80 8F FF
 +
FF 23 00 00 00 0E 00 45 75 72 6F 70 65 2D 46 61
 +
72 53 74 61 72 80 8F FF FF 24 00 </pre>
 +
|<pre>.........c............Bria..........Ahaz
 +
i..........Flurry..........Intrepid.....
 +
.....Kettemoor..........Naritus.........
 +
.Scylla..........Sunrunner..........Valc
 +
yn..........Tempest....(.....Japan-Katan
 +
a....).....Japan-Harla..........Starside
 +
r..........Tarquinas..........Wanderhome
 +
..........Shadowfire..........Bloodfin..
 +
........Chilastra..........Eclipse......
 +
....Gorath..........Kauri..........Lowca
 +
..........Radiant..........Corbantis....
 +
".....Europe-Chimaera....#.....Europe-Fa
 +
rStar....$.</pre>
 
}}
 
}}
  
Line 332: Line 669:
 
</pre>
 
</pre>
 
}}
 
}}
 +
===Packet Samples -- '''00 11'''===
 +
{{InfoboxPacketSample|Server MIN DataOrder 0x0011|
 +
<pre>0x0011</pre>
 +
|<pre>0B A0 </pre>
 +
|<pre>..</pre>
 +
}}
 +
 +
{{InfoboxPacketSample|Server MAX DataOrder 0x0011|
 +
<pre>0x0011</pre>
 +
|<pre>0B 87 </pre>
 +
|<pre>..</pre>
 +
}}
 +
 +
{{InfoboxPacketSample|Client MIN DataOrder 0x0011|
 +
<pre>0x0011</pre>
 +
|<pre>20 C8 </pre>
 +
|<pre>..</pre>
 +
}}
 +
 +
{{InfoboxPacketSample|Client MAX DataOrder 0x0011|
 +
<pre>0x0011</pre>
 +
|<pre>20 C7 </pre>
 +
|<pre>..</pre>
 +
}}
 +
  
 
Sequence # is the sequence number of the out of order packet recieved.  
 
Sequence # is the sequence number of the out of order packet recieved.  
Line 374: Line 736:
 
Sequence # - Net Byte SHORT
 
Sequence # - Net Byte SHORT
 
</pre>
 
</pre>
 +
}}
 +
===Packet Samples -- '''00 15'''===
 +
{{InfoboxPacketSample|Server MIN DataAck 0x0015|
 +
<pre>0x0015</pre>
 +
|<pre>00 00 </pre>
 +
|<pre>..</pre>
 +
}}
 +
 +
{{InfoboxPacketSample|Server MAX DataAck 0x0015|
 +
<pre>0x0015</pre>
 +
|<pre>00 00 </pre>
 +
|<pre>..</pre>
 +
}}
 +
 +
{{InfoboxPacketSample|Client MIN DataAck 0x0015|
 +
<pre>0x0015</pre>
 +
|<pre>00 00 </pre>
 +
|<pre>..</pre>
 +
}}
 +
 +
{{InfoboxPacketSample|Client MAX DataAck 0x0015|
 +
<pre>0x0015</pre>
 +
|<pre>00 00 </pre>
 +
|<pre>..</pre>
 
}}
 
}}
  
Line 389: Line 775:
 
The client will stop processing packets after about 4 unacknowledeged packets so frequent acknowledges are needed.
 
The client will stop processing packets after about 4 unacknowledeged packets so frequent acknowledges are needed.
  
 +
==Appendix==
 +
 +
[[SWGPacketExamples|SWG Packet Examples used in this document]]
  
 
<font color=blue>'''Thanks to Acid1789 for the abundant information on the SOE Protocol!'''</font>
 
<font color=blue>'''Thanks to Acid1789 for the abundant information on the SOE Protocol!'''</font>

Latest revision as of 10:40, 21 September 2013

Guides - SOE Protocol Breakdown

SWGANH Wiki is a repository of Star Wars Galaxies Developer information. This site is only meant to be used by SWGANH Developer team.

SOE's Protocol is a systematic way to enhance the UDP protocol to make it more reliable, and also save bandwidth by merging and grouping packets. It can be combined in various ways, or not be used at all.

The format of the SOE Protocol varies depending on what type of operation it is. SOE Protocol can function as a stand alone packet, or as a Header to SWG Packets. What is true about all of the SOE Protocol is that the beginning contains 2 bytes known as the SOE Opcode. Majority also contain a footer. Assume all packets have footers unless otherwise mentioned. The table of opcodes are as follows:

Note An SOE Opcode is stored as an unsigned short (uint16), and is in net byte order.


SOE OpCodes
(SOE Opcode)"in hex"	(Meaning) 		(       (ENUM_NAME) "used in code"

00 01		Session Request				(SOE_SESSION_REQUEST)
00 02		Session Response			(SOE_SESSION_REPLY)
00 03		Multiple SOE Protocols			(SOE_MULTI_SOE)
00 04		Not Used				(SOE_NOT_USED)
00 05		Disconnect				(SOE_DISCONNECT)
00 06		Keep Alive				(SOE_PING)
00 07 		Client Network Status Update		(SOE_NET_STATUS_REQ)
00 08 		Server Network Status Update		(SOE_NET_STATUS_RES)

00 09 		Channel 0 - Data Packet			(SOE_CHL_DATA_A)
00 0A		Channel 1 - Data Packet			(SOE_CHL_DATA_B)
00 0B		Channel 2 - Data Packet			(SOE_CHL_DATA_C)
00 0C		Channel 3 - Data Packet			(SOE_CHL_DATA_D)

00 0D		Channel 0 - Fragmented Data Packet	(SOE_DATA_FRAG_A)
00 0E		Channel 1 - Fragmented Data Packet	(SOE_DATA_FRAG_B)
00 0F		Channel 2 - Fragmented Data Packet	(SOE_DATA_FRAG_C)
00 10		Channel 3 - Fragmented Data Packet	(SOE_DATA_FRAG_D)

00 11		Channel 0 - Out of Order Packet		(SOE_OUT_ORDER_PKT_A)
00 12		Channel 1 - Out of Order Packet		(SOE_OUT_ORDER_PKT_B)
00 13		Channel 2 - Out of Order Packet		(SOE_OUT_ORDER_PKT_C)
00 14		Channel 3 - Out of Order Packet		(SOE_OUT_ORDER_PKT_D)

00 15		Channel 0 - Acknowledge Packet		(SOE_ACK_A)
00 16		Channel 1 - Acknowledge Packet		(SOE_ACK_B)
00 17		Channel 2 - Acknowledge Packet		(SOE_ACK_C)
00 18		Channel 3 - Acknowledge Packet		(SOE_ACK_D)

00 19		Channel 0 - Multi SWG Packets		(SOE_MULTI_SWG_A)
00 1A		Channel 1 - Multi SWG Packets		(SOE_MULTI_SWG_B)
00 1B		Channel 2 - Multi SWG Packets		(SOE_MULTI_SWG_C)
00 1C		Channel 3 - Multi SWG Packets		(SOE_MULTI_SWG_D)

00 1D		*Serious Error Acknowledge		(SOE_FATAL_ERR)
00 1E		*Serious Error Reply			(SOE_FATAL_ERR_REP)

Note These functions are seen on very malformed packets. Very rare occurance and the client will usually disconnect. It's inclusion in the documentation is for completion ONLY. SWGEmu will disconnect automatically when reciving a Error Acknowledge, and it will NOT send any, rather just disconnect itself.


SOE has their protocol premade to allow various channels of data transmission. However, no game to this date utilizes the multiple channels. SWG will only be using channel 0 and it will be assumed throughout the rest of the packet documentation.


The following data is of packet breakdowns and explainations on each type. See the article "Packet Breakdown Format" for information on the specific used for documentation.

Packet Type -- 00 01

Packet Type 00 01
00 01  -  Session Request (Client -> Server)
SOE Opcode	- Net Byte SHORT	
CRC Length	- Net BYte INT
Connection ID	- Net Byte INT
ClientUDPSize	- Net Byte INT	
  • SOE Opcode is just the opcode number to identify the packet.
  • CRC Length is the amount of length of the CRC checksum to append at the end of a packet. SWG uses 2 bytes.
  • Note CRC32 checksums are 32bit, making them 4 bytes, but only 2 are appended.
  • Connection ID is some type of identification used for the connection. Only other time seen is during a disconnect.
  • ClientUDPSize is the maximum size allocated for the client's UDP packet buffer. No packet is allowed to exceed this size. If it is larger, it must be fragmented. This size is equal to 496 bytes.

Note This opcode DOES NOT have a footer.

Packet Samples -- 00 01

Client MAX Session Request 0x0001
Def HEX ASCII
0x0001
00 00 00 02 27 38 24 61 00 00 01 F0
....'8$a....


Client MIN Session Request 0x0001
Def HEX ASCII
0x0001
00 00 00 02 3C D6 0F BF 00 00 01 F0
....<.......

Packet Type -- 00 02

Packet Type 00 02 - Session Response (Server -> Client)
SOE Opcode	 - Net Byte SHORT
Connection ID	 - Net Byte INT
CRCSeed		 - Net Byte INT
CRCLength	 - BYTE
UseCompression   - BYTE
SeedSize         - BYTE
ServerUDPSize	 - Net Byte INT
  • Connection ID is replied using the same ID sent by the Session Request.
  • CRCSeed is a seed value used for the calculation of the CRC32 Checksum.
  • CRCLength
  • UseCompression 0/1 Compression on/off
  • SeedSize Size in bytes for the XOR encryption key. Strange that this appears after the CRCSeed. Seed seems to have a max value of 5bytes. Standard is 4
  • ServerUDPSize is the maximum size allocated for the server's UDP packet buffer. No packet is allowed to exceed this size. So far the client has not sent anything large enough to fill this, or be fragmented. This size is equal to 496 bytes.

Note This opcode DOES NOT have a footer.

Packet Sample -- 00 02

Server MAX SessionResponse 0x0002
Def HEX ASCII
0x0002
27 38 24 61 37 E4 BF 63 02 01 04 00 00 01 F0
'8$a7..c.......


Server MIN SessionResponse 0x0002
Def HEX ASCII
0x0002
3C D6 0F BF 3B BF 9B D5 02 01 04 00 00 01 F0
<...;..........

Packet Type -- 00 03

Packet Type 00 03 - Multiple SOE Protocols(Various)
SOE Opcode	- Net Byte SHORT
Data Size	- (VARIOUS)
DATA		- (VARIOUS)
Data Size	- (VARIOUS)
DATA		- (VARIOUS)
...

These packets allow the combination of 2 or more SOE Protocol packets or stand alone SWG Packets with SOE Protocol packets.

(SOE Protocol)((SOE Protocol)(SWG Packet)) or (SOE Protocol)(SWG Packet)

or as a better example:

(Multiple SOE Proto)(Ackowledge)(Data) or (Multiple SOE Proto)(Acknowledge)(SWG Packet) or (Multiple SOE Proto)(Acknowledge)(Acknowledge)

Each seperate packet is preceded by it's size. So a better example would be: (Multiple SOE Proto)(size1)(Acknowlede)(size2)(Data)

so a very basic hexadecimal version would be:

(00 03)  (04)  (00 15 00 00)  (0A)  (00 09 00 01 01 00 FF FF FF FF)
 multi   size   acknowledge   size              data
  • NOTE: The Size field will never exceed 255.

Packet Sample -- 00 03

Server MAX MultiPacket 0x0003
Def HEX ASCII
0x0003
06 01 00 AF F9 6C A1 1C 0A 00 08 F8 24 1B A8 1C 
95 AF 22 00 00 00 A2 54 40 01 2D 55 45 02 00 00 
00 D1 00 00 1C 0A 00 08 F8 24 1B A2 04 95 AF 22 
00 00 00 70 54 40 01 47 55 55 02 00 00 09 EB 00 
00 1C 0A 00 08 F8 24 1B AC 04 95 AF 22 00 00 00 
4E 54 40 01 5A 55 2D 01 00 00 0A EF 00 00 1C 0A 
00 08 F8 24 1B 70 04 95 AF 22 00 00 00 48 54 40 
01 16 55 17 02 00 00 0A 15 00 00 1C 0A 00 08 F8 
24 1B DB FA 94 AF 22 00 00 00 72 54 40 01 5E 55 
06 02 00 00 0A 30 00 00 1C 0A 00 08 F8 24 1B CA 
FD 94 AF 22 00 00 00 13 54 40 01 86 56 C3 06 00 
00 00 FC 00 00 1C 0A 00 08 F8 24 1B C0 FD 94 AF 
22 00 00 00 11 54 40 01 87 56 96 06 00 00 00 FD 
00 00 1C 0A 00 08 F8 24 1B 8E FD 94 AF 22 00 00 
00 55 53 40 01 8C 57 FC 06 00 00 02 D2 00 00 1C 
0A 00 08 F8 24 1B 70 FD 94 AF 22 00 00 00 61 53 
40 01 BF 57 26 07 00 00 02 D2 00 00 1C 0A 00 08 
F8 24 1B AC FD 94 AF 22 00 00 00 0F 54 40 01 86 
56 AE 06 00 00 00 FD 00 00 C1 00 09 19 64 00 19 
1C 0A 00 08 F8 24 1B 7A 04 95 AF 22 00 00 00 8D 
54 41 01 B8 54 EA 04 00 00 00 02 00 00 1C 05 00 
46 5E CE 80 1B 00 00 00 31 01 00 00 C9 1C 95 AF 
22 00 00 00 00 00 00 00 0E 01 46 05 00 46 5E CE 
80 1B 00 00 00 CC 00 00 00 AC 04 95 AF 22 00 00 
00 00 00 00 00 C0 B1 16 F3 AC 04 95 AF 22 00 00 
00 B2 04 95 AF 22 00 00 00 00 10 00 B7 2C 10 73 
00 01 00 C9 1C 95 AF 22 00 00 00 0E 01 00 00 4D 
0A 1C 0A 00 08 F8 24 1B B6 FD 94 AF 22 00 00 00 
11 54 40 01 86 56 92 06 00 00 00 FD 00 00 1C 0A 
00 08 F8 24 1B 0F F7 94 AF 22 00 00 00 C7 53 40 
01 0E 56 5A 08 00 00 02 29 00 00
.....l......$....."[email protected]...........
.$....."[email protected]............$....."...
[email protected]............$.p..."[email protected].....
........$....."...rT@.^U.....0.......$..
..."[email protected].............$....."....T@.
.V.............$....."[email protected].........
....$.p..."[email protected]&............$....."
[email protected].......$.z..."....
TA..T...........F^......1.......".......
..F..F^.............."..............."..
.....".......,.s.......".......M......$.
...."[email protected].............$....."....S@
..VZ....)..


Server MIN MultiPacket 0x0003
Def HEX ASCII
0x0003
04 00 11 01 8E 04 00 11 01 8F
..........


Client MAX MultiPacket 0x0003
Def HEX ASCII
0x0003
04 00 15 0B 1E 9E 00 09 07 9E 00 19 2E 05 00 46 
5E CE 80 23 00 00 00 16 01 00 00 13 6C 35 E3 16 
00 00 00 00 00 00 00 80 00 00 00 02 B7 A8 D6 9B 
FC 19 AE 1A 00 00 00 00 00 00 00 22 05 00 46 5E 
CE 80 83 00 00 00 26 01 00 00 13 6C 35 E3 16 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 22 05 
00 46 5E CE 80 83 00 00 00 26 01 00 00 13 6C 35 
E3 16 00 00 00 00 00 00 00 DF B5 1A AE 1A 00 00 
00 22 05 00 46 5E CE 80 83 00 00 00 26 01 00 00 
13 6C 35 E3 16 00 00 00 00 00 00 00 9B FC 19 AE 
1A 00 00 00 4F 05 00 46 5E CE 80 21 00 00 00 F1 
00 00 00 13 6C 35 E3 16 00 00 00 00 00 00 00 81 
49 E9 85 A2 01 00 00 EF B4 1A AE 1A 00 00 00 00 
00 00 00 33 FD 68 BD 00 00 00 00 E5 95 7F 3F D8 
AE 3E 3F 33 33 33 3F CA 56 49 40 00 00 00 41 00 
00 00 00 00 F0 00 09 07 9F 00 19 2E 05 00 46 5E 
CE 80 23 00 00 00 16 01 00 00 13 6C 35 E3 16 00 
00 00 00 00 00 00 80 00 00 00 02 B7 A8 D6 9B FC 
19 AE 1A 00 00 00 00 00 00 00 22 05 00 46 5E CE 
80 83 00 00 00 26 01 00 00 13 6C 35 E3 16 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 22 05 00 
46 5E CE 80 83 00 00 00 26 01 00 00 13 6C 35 E3 
16 00 00 00 00 00 00 00 9B FC 19 AE 1A 00 00 00 
2E 05 00 46 5E CE 80 23 00 00 00 16 01 00 00 13 
6C 35 E3 16 00 00 00 00 00 00 00 80 00 00 00 02 
B7 A8 D6 9B FC 19 AE 1A 00 00 00 00 00 00 00 22 
05 00 46 5E CE 80 83 00 00 00 26 01 00 00 13 6C 
35 E3 16 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 22 05 00 46 5E CE 80 83 00 00 00 26 01 00 
00 13 6C 35 E3 16 00 00 00 00 00 00 00 9B FC 19 
AE 1A 00 00 00
...............F^..#........l5..........
..................."..F^......&....l5...
.............."..F^......&....l5........
........."..F^......&....l5.............
....O..F^..!........l5..........I.......
...........3.h.......??..>[email protected].
..............F^..#........l5...........
.................."..F^......&....l5....
............."..F^......&....l5.........
...........F^..#........l5..............
..............."..F^......&....l5.......
.........."..F^......&....l5............
.....


Client MIN MultiPacket 0x0003
Def HEX ASCII
0x0003
04 00 15 02 0B 04 00 15 02 0F
..........

Packet Type -- 00 05

Packet Type 00 05 - Disconnect (VARIOUS)
SOE Opcode	- Net Byte SHORT
Connection ID	- Net Byte INT
Reason ID	- Net Byte SHORT
  • Connection ID is the ID number assigned during the session request. Each client sends its own Connection ID. Reason ID is an ID number that corresponds for a reason for the disconnection.

This packet is sent whenever one side wants to disconnect. It resends the clients specific Connection ID established during the session handshake, and then a reason for disconnection. The possible disconnect reasons and the associated ID seen in the packet are in the table below.

ID String
0 None
1 ICMP Error
2 Timeout
3 Other side terminated
4 Manager deleted
5 Connect fail
6 Application
7 Unreachable connection
8 Unacknowledged timeout
9 New connection attempt
10 Connection refused
11 Mutual connect error
12 Connecting to self
13 Reliable overflow

Packet Type -- 00 06

00 06 - Keep Alive(VARIOUS)
SOE Opcode	- Comp / CRC

This packet is simply a keep alive to tell the other side that is still connected, but idle. It only consists of the opcode and a footer.

Packet Samples -- 00 06

Server MAX Ping 0x0006
Def HEX ASCII
0x0006
CB 3A 78
.:x


Server MIN Ping 0x0006
Def HEX ASCII
0x0006
16 01 A7
...


Client MAX Ping 0x0006
Def HEX ASCII
0x0006
C7 23 8F
.#.


Client MIN Ping 0x0006
Def HEX ASCII
0x0006
CB 3A 78
.:x

Packet Type -- 00 07

00 07 - Client Network Status Update
SOE Opcode		- Net Byte SHORT
Client TickCount	- Net Byte SHORT
Last update		- Net Byte INT
Average update		- Net Byte INT
Shortest update		- Net Byte INT
Longest update		- Net Byte INT
Last Server update	- Net Byte INT
Packets sent		- Net Byte LONG
Packets received	- Net Byte LONG

These packets consist of various data and network statistics. Because we do not care about network statistics, we will ignore these. To ignore these we send a special malformed Server Network Status Update.

Note: This packet is usually compressed but is optional.

Packet Samples -- 00 07

Client MAX NetStatRequest 0x0007
Def HEX ASCII
0x0007
CA 3A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 00 
00 00 00 00 00 01
.:....................................



Client MIN NetStatRequest 0x0007
Def HEX ASCII
0x0007
D2 C7 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 00 
00 00 00 00 00 01 
......................................

Packet Type -- 00 08

00 08 - Server Network Status Update
SOE Opcode		- Net Byte SHORT
Client TickCount	- Net Byte SHORT (As in request)
Server TickCount	- Net Byte INT (I think this should be old server tickcount + client tickcount)
client packets sent	- Net Byte LONG
client packets received	- Net Byte LONG
server packets sent	- Net Byte LONG
server packets received - Net Byte LONG

Packet Samples -- 00 08

Server MIN NetStatResponse 0x0008
Def HEX ASCII
0x0008
D2 C7 90 96 3F 20 00 00 00 00 00 00 00 02 00 00 
00 00 00 00 00 01 00 00 00 00 00 00 00 02 00 00 
00 00 00 00 00 02 
....?.................................


Server MAX NetStatResponse 0x0008
Def HEX ASCII
0x0008
CA 3A 63 75 DB 1D 00 00 00 00 00 00 00 02 00 00 
00 00 00 00 00 01 00 00 00 00 00 00 00 02 00 00 
00 00 00 00 00 02 
.:cu..................................


Client MIN NetStatResponse 0x0008
Def HEX ASCII
0x0008
00 B9 6F 02 76 00 00 30 00 75 00 FE 7F 5F A8 2B 
CF 00 00 00 00 07 08 00 C6 27 F7 90 
..o.v..0.u..?_.+.........'..


Client MAX NetStatResponse 0x0008
Def HEX ASCII
0x0008
00 B9 6F 02 76 00 00 31 00 75 00 FE 7F 5F A8 2B 
CF 00 00 00 00 00 00 00 D3 03 F7 90 
..o.v..1.u..?_.+............

This packet is supposed to contain the Servers network statistics, however we felt it was a waste of time to reverse these as we do not care about the statistics. Instead we send 38 bytes of 0x00, and then compress the packet, but skip appending a CRC. The client seems to register that it recieved the servers statistics, but notices a bad CRC (or none in our case), and tosses out the packet as malformed. Because it recieved the packet it continues on without erroring.

Note: This packet is usually compressed but is optional.

Packet Type -- 00 09

00 09 - Channel 0 Data
SOE Opcode	- Net Byte SHORT
Sequence #	- Net Byte SHORT
SWG PACKET..

Packet Samples -- 00 09

Server MIN DataChannel 0x0009
Def HEX ASCII
0x0009
00 03 01 00 BE E9 2F D7 
....../.


Server MAX DataChannel 0x0009
Def HEX ASCII
0x0009
54 06 00 19 A4 05 00 2A 2F F1 F3 F2 BB 21 B6 1E 
00 00 00 00 00 04 00 00 00 09 00 63 6F 6E 64 69 
74 69 6F 6E 07 00 00 00 31 00 30 00 30 00 2F 00 
31 00 30 00 30 00 06 00 76 6F 6C 75 6D 65 01 00 
00 00 31 00 2D 00 63 61 74 5F 73 6B 69 6C 6C 5F 
6D 6F 64 5F 62 6F 6E 75 73 2E 40 73 74 61 74 5F 
6E 3A 73 74 72 65 6E 67 74 68 5F 6D 6F 64 69 66 
69 65 64 02 00 00 00 31 00 37 00 20 00 40 70 72 
6F 63 2F 70 72 6F 63 3A 72 65 71 75 69 72 65 64 
5F 63 6F 6D 62 61 74 5F 6C 65 76 65 6C 02 00 00 
00 38 00 35 00 FF FF FF FF 26 05 00 2A 2F F1 F3 
D5 C5 21 B6 1E 00 00 00 00 00 01 00 00 00 06 00 
76 6F 6C 75 6D 65 01 00 00 00 31 00 FF FF FF FF 
FF 01 18 05 00 2A 2F F1 F3 D6 C5 21 B6 1E 00 00 
00 00 00 08 00 00 00 06 00 76 6F 6C 75 6D 65 01 
00 00 00 31 00 20 00 40 70 72 6F 63 2F 70 72 6F 
63 3A 72 65 71 75 69 72 65 64 5F 63 6F 6D 62 61 
74 5F 6C 65 76 65 6C 02 00 00 00 32 00 30 00 15 
00 40 70 72 6F 63 2F 70 72 6F 63 3A 72 65 75 73 
65 5F 74 69 6D 65 07 00 00 00 35 00 20 00 2F 00 
20 00 73 00 65 00 63 00 17 00 40 70 72 6F 63 2F 
70 72 6F 63 3A 65 66 66 65 63 74 5F 6C 65 76 65 
6C 02 00 00 00 32 00 30 00 14 00 40 70 72 6F 63 
2F 70 72 6F 63 3A 70 72 6F 63 5F 6E 61 6D 65 18 
00 00 00 40 00 75 00 69 00 5F 00 62 00 75 00 66 
00 66 00 3A 00 61 00 67 00 69 00 63 00 6F 00 6E 
00 73 00 75 00 6D 00 61 00 62 00 6C 00 65 00 31 
00 35 00 04 00 74 69 65 72 01 00 00 00 32 00 0C 
00 74 6F 6F 6C 74 69 70 2E 74 69 65 72 01 00 00 
00 32 00 0C 00 6E 75 6D 5F 69 6E 5F 73 74 61 63 
6B 01 00 00 00 36 00 FF FF FF FF 
T......*/....!.............condition....
1.0.0./.1.0.0...volume....1.-.cat_skill_
mod_bonus.@stat_n:strength_modified....1
.7...@proc/proc:required_combat_level...
.8.5.....&..*/....!.............volume..
..1..........*/....!.............volume.
...1...@proc/proc:required_combat_level.
...2.0...@proc/proc:reuse_time....5.../.
..s.e.c...@proc/proc:effect_level....2.0
...@proc/proc:[email protected]._.b.u.f
.f.:.a.g.i.c.o.n.s.u.m.a.b.l.e.1.5...tie
r....2...tooltip.tier....2...num_in_stac
k....6.....


Client MIN DataChannel 0x0009
Def HEX ASCII
0x0009
01 F5 01 00 E0 5E 80 31 
.....^.1


Client MAX DataChannel 0x0009
Def HEX ASCII
0x0009
20 46 05 00 46 5E CE 80 23 00 00 00 16 01 00 00 
48 12 06 E1 01 00 00 00 00 00 00 00 80 0D 00 00 
EF 50 45 16 00 00 00 00 00 00 00 00 DD 00 00 00 
36 00 37 00 32 00 37 00 33 00 37 00 31 00 34 00 
33 00 30 00 36 00 20 00 30 00 20 00 31 00 30 00 
38 00 37 00 38 00 36 00 38 00 39 00 30 00 33 00 
39 00 37 00 20 00 2D 00 31 00 20 00 31 00 30 00 
38 00 37 00 38 00 36 00 39 00 31 00 39 00 39 00 
30 00 33 00 20 00 2D 00 31 00 20 00 31 00 30 00 
38 00 37 00 38 00 37 00 30 00 39 00 30 00 37 00 
32 00 34 00 20 00 2D 00 31 00 20 00 31 00 30 00 
38 00 37 00 38 00 37 00 31 00 31 00 37 00 37 00 
33 00 31 00 20 00 2D 00 31 00 20 00 31 00 30 00 
38 00 37 00 39 00 35 00 31 00 36 00 33 00 36 00 
34 00 37 00 20 00 2D 00 31 00 20 00 31 00 30 00 
38 00 37 00 39 00 35 00 31 00 36 00 38 00 32 00 
32 00 34 00 20 00 2D 00 31 00 20 00 31 00 30 00 
38 00 37 00 39 00 35 00 31 00 39 00 30 00 37 00 
33 00 30 00 20 00 2D 00 31 00 20 00 31 00 30 00 
38 00 37 00 39 00 35 00 32 00 31 00 34 00 35 00 
31 00 30 00 20 00 2D 00 31 00 20 00 31 00 30 00 
38 00 37 00 39 00 35 00 32 00 34 00 33 00 39 00 
34 00 38 00 20 00 2D 00 31 00 20 00 31 00 30 00 
38 00 37 00 39 00 35 00 32 00 39 00 30 00 38 00 
31 00 39 00 20 00 2D 00 31 00 20 00 31 00 30 00 
38 00 37 00 39 00 35 00 32 00 39 00 35 00 30 00 
39 00 37 00 20 00 2D 00 31 00 20 00 31 00 31 00 
30 00 36 00 30 00 36 00 34 00 34 00 32 00 35 00 
37 00 36 00 20 00 30 00 20 00 31 00 31 00 30 00 
36 00 37 00 39 00 33 00 38 00 33 00 35 00 31 00 
36 00 20 00 2D 00 31 00 20 00 
.F..F^..#.......H................PE.....
........6.7.2.7.3.7.1.4.3.0.6...0...1.0.
8.7.8.6.8.9.0.3.9.7...-.1...1.0.8.7.8.6.
9.1.9.9.0.3...-.1...1.0.8.7.8.7.0.9.0.7.
2.4...-.1...1.0.8.7.8.7.1.1.7.7.3.1...-.
1...1.0.8.7.9.5.1.6.3.6.4.7...-.1...1.0.
8.7.9.5.1.6.8.2.2.4...-.1...1.0.8.7.9.5.
1.9.0.7.3.0...-.1...1.0.8.7.9.5.2.1.4.5.
1.0...-.1...1.0.8.7.9.5.2.4.3.9.4.8...-.
1...1.0.8.7.9.5.2.9.0.8.1.9...-.1...1.0.
8.7.9.5.2.9.5.0.9.7...-.1...1.1.0.6.0.6.
4.4.2.5.7.6...0...1.1.0.6.7.9.3.8.3.5.1.
6...-.1...

Sequence # is a sequence number applied to every data packet. It increments in order for each packet and is used to help determine out of order packets. This protocol is used to send an SWG Packet that NEEDS to be recieved by the other end. The reciver is then supposed to respond with a an ACKNOWLEDGE packet that contains the same sequence so the sender knows it has been recieved. This system ensures packets not only get sent correctly, but also stay in order.

After the sequence # comes the encapsulated SWG Packet.

Note* it is possible to combine multiple SWG PACKETs into a single 09. This is done similar to the 0x0003 packet, a multi data example:

(00 09) (sequence) (00 19) (Size1) (SWG PACKET) (Size2) (SWG PACKET)
SOE op.  sequence   multi   size       data       size      data

if the Size byte is FF the following 2 bytes are the size Word Little ended (16bit). Example:

(00 09) (sequence) (00 19) (size byte) (size word) (SWG PACKET) (size byte) (SWG PACKET)
SOE op.  sequence   multi    FF          01 99        data         33          data

In the above the first packet size is 409 Dec.

Use these to combine SWG PACKETs together into 1 data packet/sequence number.

Packet Type -- 00 0D

00 0D - Fragmented Data Packet
SOE Opcode	- Net Byte SHORT
Sequence #	- Net Byte SHORT
*FragmentSize	- Net Byte INT
SWG Packet...

Packet Samples -- 00 0D

Client MIN DataFrag 0x000D
Def HEX ASCII
0x000D
04 CC 00
...


Client MAX DataFrag 0x000D
Def HEX ASCII
0x000D
00 02 00 00 02 00 03 00 B9 63 1C C1 1B 00 00 00 
02 00 00 00 04 00 42 72 69 61 80 8F FF FF 03 00 
00 00 05 00 41 68 61 7A 69 80 8F FF FF 0C 00 00 
00 06 00 46 6C 75 72 72 79 80 8F FF FF 0D 00 00 
00 08 00 49 6E 74 72 65 70 69 64 80 8F FF FF 0E 
00 00 00 09 00 4B 65 74 74 65 6D 6F 6F 72 80 8F 
FF FF 0F 00 00 00 07 00 4E 61 72 69 74 75 73 80 
8F FF FF 10 00 00 00 06 00 53 63 79 6C 6C 61 80 
8F FF FF 11 00 00 00 09 00 53 75 6E 72 75 6E 6E 
65 72 80 8F FF FF 12 00 00 00 06 00 56 61 6C 63 
79 6E 80 8F FF FF 13 00 00 00 07 00 54 65 6D 70 
65 73 74 80 8F FF FF 28 00 00 00 0C 00 4A 61 70 
61 6E 2D 4B 61 74 61 6E 61 00 00 00 00 29 00 00 
00 0B 00 4A 61 70 61 6E 2D 48 61 72 6C 61 00 00 
00 00 19 00 00 00 09 00 53 74 61 72 73 69 64 65 
72 80 8F FF FF 1A 00 00 00 09 00 54 61 72 71 75 
69 6E 61 73 80 8F FF FF 1B 00 00 00 0A 00 57 61 
6E 64 65 72 68 6F 6D 65 80 8F FF FF 1C 00 00 00 
0A 00 53 68 61 64 6F 77 66 69 72 65 80 8F FF FF 
05 00 00 00 08 00 42 6C 6F 6F 64 66 69 6E 80 8F 
FF FF 06 00 00 00 09 00 43 68 69 6C 61 73 74 72 
61 80 8F FF FF 07 00 00 00 07 00 45 63 6C 69 70 
73 65 80 8F FF FF 08 00 00 00 06 00 47 6F 72 61 
74 68 80 8F FF FF 09 00 00 00 05 00 4B 61 75 72 
69 80 8F FF FF 0A 00 00 00 05 00 4C 6F 77 63 61 
80 8F FF FF 0B 00 00 00 07 00 52 61 64 69 61 6E 
74 80 8F FF FF 04 00 00 00 09 00 43 6F 72 62 61 
6E 74 69 73 80 8F FF FF 22 00 00 00 0F 00 45 75 
72 6F 70 65 2D 43 68 69 6D 61 65 72 61 80 8F FF 
FF 23 00 00 00 0E 00 45 75 72 6F 70 65 2D 46 61 
72 53 74 61 72 80 8F FF FF 24 00 
.........c............Bria..........Ahaz
i..........Flurry..........Intrepid.....
.....Kettemoor..........Naritus.........
.Scylla..........Sunrunner..........Valc
yn..........Tempest....(.....Japan-Katan
a....).....Japan-Harla..........Starside
r..........Tarquinas..........Wanderhome
..........Shadowfire..........Bloodfin..
........Chilastra..........Eclipse......
....Gorath..........Kauri..........Lowca
..........Radiant..........Corbantis....
".....Europe-Chimaera....#.....Europe-Fa
rStar....$.
  • Sequence # is the same type of sequence number described in the "00 09 - Channel 0 Data" section. All the same rules apply.
  • FragmentSize is the total size of the combined fragments. This only appears in the FIRST packet of a group of fragmented packets.

Next is just the piece data of the large SWG Packet. Fragments are made when the total UNCOMPRESSED packet exceeds the packet buffer size, which is 496 bytes.

Packet Type -- 00 11

Packet Type 00 11 - Out of Order Packet
SOE Opcode	- Net Byte SHORT
Sequence #	- Net Byte SHORT

Packet Samples -- 00 11

Server MIN DataOrder 0x0011
Def HEX ASCII
0x0011
0B A0 
..


Server MAX DataOrder 0x0011
Def HEX ASCII
0x0011
0B 87 
..


Client MIN DataOrder 0x0011
Def HEX ASCII
0x0011
20 C8 
..


Client MAX DataOrder 0x0011
Def HEX ASCII
0x0011
20 C7 
..


Sequence # is the sequence number of the out of order packet recieved. It will send one for every packet that is out of order, and the ones following.

So if packet sequences recieved are:

00 00
00 01

And then:

00 03

an out of order will be sent for the packet with sequence 00 03.

If the packet sequences recieved are:

00 00
00 01

And then:

00 03
00 04
00 05

An out of order packet will be sent for all 3 of the out of order sequences.

Packet Type -- 00 15

Packet Type 00 15 - Acknowledge
SOE Opcode	- Net Byte SHORT
Sequence #	- Net Byte SHORT

Packet Samples -- 00 15

Server MIN DataAck 0x0015
Def HEX ASCII
0x0015
00 00 
..


Server MAX DataAck 0x0015
Def HEX ASCII
0x0015
00 00 
..


Client MIN DataAck 0x0015
Def HEX ASCII
0x0015
00 00 
..


Client MAX DataAck 0x0015
Def HEX ASCII
0x0015
00 00 
..
  • Sequence # is the sequence number of the packet to acknowledge to the sender that it was recieved correctly.

Every packet sent with a sequence number MUST be acknowledeged.

They do not neccesarily need to be Acknowledeged 1 by 1. For example: If packet sequences recieved are: 00 00 00 01 00 02

An Acknowledge of 00 15 00 02 will cover all the packets up to the sequence 00 02.

The client will stop processing packets after about 4 unacknowledeged packets so frequent acknowledges are needed.

Appendix

SWG Packet Examples used in this document

Thanks to Acid1789 for the abundant information on the SOE Protocol!