Editing NatT protocol
From EMule Wiki
Warning: The database has been locked for maintenance, so you will not be able to save your edits right now. You may wish to cut-n-paste the text into a text file and save it for later.
The administrator who locked it offered this explanation: site maintenance
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 13: | Line 13: | ||
== NAT Tunneling == | == NAT Tunneling == | ||
To establish a communication tunnel from Alice to Bob through a NAT or a firewall Alice (A) sends first an call-back request to Carlo (C) witch records Alice’s UDP port and IP and relays them together with the request to Bob (B). | To establish a communication tunnel from Alice to Bob through a NAT or a firewall Alice (A) sends first an call-back request to Carlo (C) witch records Alice’s UDP port and IP and relays them together with the request to Bob (B). | ||
− | At this point Bob knows all he needs but Alice does not know enough (she does not know his UDP port). Now Bob tries to contact Alice directly over UDP (now his NAT/FW is open for messages form Alice) if she is behind a Full Cone Nat, she will get the message and will be able to reply. If she don’t answers after a short time Bob sends an own call-back request to Carlo or Dave (this depends on the later described different call-back relay schemes), he does the same as before and tells Alice the UDP port and IP of Bob. Now she can send him messages and he will receive them (this fails only if one of the two have a symmetric NAT, see the appendix for explanation). | + | At this point Bob knows all he needs but Alice does not know enough (she does not know his UDP port). Now Bob tries to contact Alice directly over UDP (now his NAT/FW is open for messages form Alice) if she is behind a Full Cone Nat, she will get the message and will be able to reply. If she don’t answers after a short time Bob sends an own call-back request to Carlo or Dave (this depends on the later described different call-back relay schemes), he does the same as before and tells Alice the UDP port and IP of Bob. Now she can send him messages and he will receive them (this fails only if one of the two have a symmetric NAT, see the appendix for explanation). If everything works they now have a working tunnel, to not loose it they exchange ping messages every few seconds as long as they need the tunnel. |
− | If everything works they now have a working tunnel, to not loose it they exchange ping messages every few seconds as long as they need the tunnel. | + | |
− | + | ||
<pre> | <pre> | ||
Line 30: | Line 28: | ||
<pre> | <pre> | ||
[uint8] pOPS // bit Field | [uint8] pOPS // bit Field | ||
− | // | + | // 4 reserved |
− | // | + | // 3 IdKind |
// 1 req answer | // 1 req answer | ||
− | [ID] // variable length determined by the Ping Options above | + | [ID] // variable length determined by the Ping Options above |
[Obfiscation] // uint8 obfuSetings | [Obfiscation] // uint8 obfuSetings | ||
// hash128 userHash | // hash128 userHash | ||
</pre> | </pre> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
== Callback Methods == | == Callback Methods == | ||
Line 112: | Line 105: | ||
[hash128 16] // File Hash of the pinged file | [hash128 16] // File Hash of the pinged file | ||
// the part below is the unofficial mod part (unchanged) | // the part below is the unofficial mod part (unchanged) | ||
− | |||
... | ... | ||
</pre> | </pre> | ||
Line 143: | Line 135: | ||
</pre> | </pre> | ||
− | Please refer to the | + | Please refer to the Additional Features for NatT section for further informations on the XS Buddy feature. |
== User Mode TCP == | == User Mode TCP == | ||
Line 168: | Line 160: | ||
=== Communication === | === Communication === | ||
All send data segments are equipped with a unique sequence number indicating their position in the data stream. When Bob (B) receives a NAT_DATA segment form Alice (A) he acknowledges it with an NAT_DATA_ACK, if Alice don’t get the acknowledgement she will resend the segment, she will also resend it if she gets acknowledgements for 3 segments with an higher sequence Number when the, while the a acknowledgment for the older segment is still missing (Fast retransmission). | All send data segments are equipped with a unique sequence number indicating their position in the data stream. When Bob (B) receives a NAT_DATA segment form Alice (A) he acknowledges it with an NAT_DATA_ACK, if Alice don’t get the acknowledgement she will resend the segment, she will also resend it if she gets acknowledgements for 3 segments with an higher sequence Number when the, while the a acknowledgment for the older segment is still missing (Fast retransmission). | ||
− | |||
− | |||
− | |||
<pre> | <pre> | ||
Line 254: | Line 243: | ||
The Source Packet is built the following way: | The Source Packet is built the following way: | ||
<pre> | <pre> | ||
− | [ | + | [hast128 16] // file hash |
[uint16 2] // source count | [uint16 2] // source count | ||
// Source entries 1: | // Source entries 1: | ||
Line 380: | Line 369: | ||
|- | |- | ||
|} | |} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== NAT Types == | == NAT Types == | ||
Line 409: | Line 389: | ||
|- | |- | ||
|OP_NAT_PING | |OP_NAT_PING | ||
− | | ' | + | | '_' |
|- | |- | ||
| | | | ||
|- | |- | ||
|OP_NAT_SYN | |OP_NAT_SYN | ||
− | | ' | + | | '_' |
|- | |- | ||
|OP_NAT_SYN_ACK | |OP_NAT_SYN_ACK | ||
− | | ' | + | | '_' |
|- | |- | ||
|OP_NAT_DATA | |OP_NAT_DATA | ||
− | | ' | + | | '_' |
|- | |- | ||
|OP_NAT_DATA_ACK | |OP_NAT_DATA_ACK | ||
− | | ' | + | | '_' |
|- | |- | ||
|OP_NAT_FIN | |OP_NAT_FIN | ||
− | | ' | + | | '_' |
|- | |- | ||
|OP_NAT_FIN_ACK | |OP_NAT_FIN_ACK | ||
− | | ' | + | | '_' |
|- | |- | ||
|OP_NAT_RST | |OP_NAT_RST | ||
− | | ' | + | | '_' |
|- | |- | ||
| | | | ||
|- | |- | ||
− | | | + | |CT_EMULE_BUDDYID |
− | | ' | + | | '_' |
|- | |- | ||
− | | | + | |CT_XS_EMULE_BUDDYIP |
− | | ' | + | | '_' |
|- | |- | ||
− | | | + | |CT_XS_EMULE_BUDDYUDP |
− | | ' | + | | '_' |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
|- | |- | ||
| | | | ||
|- | |- | ||
|OP_NAT_CALLBACKREQUEST_KAD | |OP_NAT_CALLBACKREQUEST_KAD | ||
− | | ' | + | | '_' |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
|- | |- | ||
| | | | ||
|- | |- | ||
|OP_XS_BUDDY_REQ | |OP_XS_BUDDY_REQ | ||
− | | ' | + | | '_' |
− | + | ||
− | + | ||
− | + | ||
|- | |- | ||
|OP_XS_BUDDYPING | |OP_XS_BUDDYPING | ||
− | | ' | + | | '_' |
|- | |- | ||
|OP_XS_MULTICALLBACKUDP | |OP_XS_MULTICALLBACKUDP | ||
− | | ' | + | | '_' |
|- | |- | ||
|OP_XS_MULTICALLBACKTCP | |OP_XS_MULTICALLBACKTCP | ||
− | | ' | + | | '_' |
|- | |- | ||
|OP_CALLBACKREQUEST_XS | |OP_CALLBACKREQUEST_XS | ||
− | | ' | + | | '_' |
|- | |- | ||
|OP_NAT_CALLBACKREQUEST_XS | |OP_NAT_CALLBACKREQUEST_XS | ||
− | | ' | + | | '_' |
|- | |- | ||
| | | | ||
|- | |- | ||
|OP_PUBLICPORT_REQ | |OP_PUBLICPORT_REQ | ||
− | | ' | + | | '_' |
|- | |- | ||
|OP_PUBLICPORT_ANSWER | |OP_PUBLICPORT_ANSWER | ||
− | | ' | + | | '_' |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
|- | |- | ||
|} | |} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |