Michael Prokop | 4438c60 | 2019-05-24 10:25:45 +0200 | [diff] [blame] | 1 | When NetScaler application switch is used as L3+ switch, information |
Bertrand Jacquin | 93b227d | 2016-06-04 15:11:10 +0100 | [diff] [blame] | 2 | regarding the original IP and TCP headers are lost as a new TCP |
| 3 | connection is created between the NetScaler and the backend server. |
| 4 | |
| 5 | NetScaler provides a feature to insert in the TCP data the original data |
| 6 | that can then be consumed by the backend server. |
| 7 | |
| 8 | Specifications and documentations from NetScaler: |
| 9 | https://support.citrix.com/article/CTX205670 |
| 10 | https://www.citrix.com/blogs/2016/04/25/how-to-enable-client-ip-in-tcpip-option-of-netscaler/ |
| 11 | |
| 12 | When CIP is enabled on the NetScaler, then a TCP packet is inserted just after |
Bertrand Jacquin | 72fa1ec | 2017-12-12 01:17:23 +0000 | [diff] [blame] | 13 | the TCP handshake. Two versions of the CIP extension exist. |
| 14 | |
| 15 | Legacy (NetScaler < 10.5) |
Bertrand Jacquin | 93b227d | 2016-06-04 15:11:10 +0100 | [diff] [blame] | 16 | |
| 17 | - CIP magic number : 4 bytes |
| 18 | Both sender and receiver have to agree on a magic number so that |
| 19 | they both handle the incoming data as a NetScaler Client IP insertion |
| 20 | packet. |
| 21 | |
| 22 | - Header length : 4 bytes |
| 23 | Defines the length on the remaining data. |
| 24 | |
| 25 | - IP header : >= 20 bytes if IPv4, 40 bytes if IPv6 |
| 26 | Contains the header of the last IP packet sent by the client during TCP |
| 27 | handshake. |
| 28 | |
| 29 | - TCP header : >= 20 bytes |
| 30 | Contains the header of the last TCP packet sent by the client during TCP |
| 31 | handshake. |
Bertrand Jacquin | 72fa1ec | 2017-12-12 01:17:23 +0000 | [diff] [blame] | 32 | |
| 33 | Standard (NetScaler >= 10.5) |
| 34 | |
| 35 | - CIP magic number : 4 bytes |
| 36 | Both sender and receiver have to agree on a magic number so that |
| 37 | they both handle the incoming data as a NetScaler Client IP insertion |
| 38 | packet. |
| 39 | |
| 40 | - CIP length : 4 bytes |
| 41 | Defines the total length on the CIP header. |
| 42 | |
| 43 | - CIP type: 2 bytes |
| 44 | Always set to 1. |
| 45 | |
| 46 | - Header length : 2 bytes |
| 47 | Defines the length on the remaining data. |
| 48 | |
| 49 | - IP header : >= 20 bytes if IPv4, 40 bytes if IPv6 |
| 50 | Contains the header of the last IP packet sent by the client during TCP |
| 51 | handshake. |
| 52 | |
| 53 | - TCP header : >= 20 bytes |
| 54 | Contains the header of the last TCP packet sent by the client during TCP |
| 55 | handshake. |