blob: dc64327a6364dadb64cf47915e69580ede8fdf34 [file] [log] [blame]
Michael Prokop4438c602019-05-24 10:25:45 +02001When NetScaler application switch is used as L3+ switch, information
Bertrand Jacquin93b227d2016-06-04 15:11:10 +01002regarding the original IP and TCP headers are lost as a new TCP
3connection is created between the NetScaler and the backend server.
4
5NetScaler provides a feature to insert in the TCP data the original data
6that can then be consumed by the backend server.
7
8Specifications 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
12When CIP is enabled on the NetScaler, then a TCP packet is inserted just after
Bertrand Jacquin72fa1ec2017-12-12 01:17:23 +000013the TCP handshake. Two versions of the CIP extension exist.
14
15Legacy (NetScaler < 10.5)
Bertrand Jacquin93b227d2016-06-04 15:11:10 +010016
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 Jacquin72fa1ec2017-12-12 01:17:23 +000032
33Standard (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.