Sequence number translation explanations.
Hi!
I need to translate sequence numbers between the two networks that are separated by the firewall. In fact, I just need to translate on of them (so tcph->ack_seq in one direction, and tcph->seq in the opposite direction). I found the ip_nat_seq stucture and the ip_nat_seq_adjust function but I do not understand them. Particularly this "correction_pos", what is it?
Could someone provide me with some explanations?
Emmanuel
Quoted 10 lines · Emmanuel Guiton
Hi!
I need to translate sequence numbers between the two networks that are separated by the firewall. In fact, I just need to translate on of them (so
tcph->ack_seqin one direction, andtcph->seqin the opposite direction).
I found theip_nat_seqstucture and theip_nat_seq_adjustfunction but I do not understand them. Particularly this "correction_pos", what is it?Could someone provide me with some explanations?
It is for inserting/removing bytes from a TCP stream, as needed with NAT of protocols like FTP (IP address printed in ASCII has different length, compare strlen('1.1.1.1') to strlen('255.255.255.255').
correction_pos is the position (sequence number) where the addition/subtraction occurred, and offset is the number of bytes added (positive) or removed (negative).
Quoted 1 line
Emmanuel
Signature · 5 lines
- Harald Welte <[email protected]> http://www.netfilter.org/ ============================================================================ "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie
Quoted 12 lines · Harald Welte
Quoted 8 lines · Emmanuel Guiton
Hi!
I need to translate sequence numbers between the two networks that are separated by the firewall. In fact, I just need to translate on of them (so
tcph->ack_seqin one direction, andtcph->seqin the opposite direction). I found theip_nat_seqstucture and theip_nat_seq_adjustfunction but I do not understand them. Particularly this "correction_pos", what is it?Could someone provide me with some explanations?
Quoted 9 lines
It is for inserting/removing bytes from a TCP stream, as needed with NAT of protocols like FTP (IP address printed in ASCII has different length, compare strlen('1.1.1.1') to strlen('255.255.255.255').
correction_posis the position (sequence number) where the addition/subtraction occurred, and offset is the number of bytes added (positive) or removed (negative).
Ok, then it does not fit my problem. I will operate the change like for the TCP port number. Thanks!
Emmanuel