Ankur : Taking into consideration TCP ,we have defined how the mappings are maintained for TCP session ,once the session expires this mapping is removed from cache the entry.
Charitha: So we need to keep track of tcp states and a timer that tracks the remaining lifetime of the TCP session .Once the timer expires the dynamically created mapping is removed from the cache entry.
Ankur : Now to define the states
V6 INIT: An IPv6 packet containing a TCP SYN was received,translated, and forwarded by the NAT64, implying that a TCP connection is being initiated from the IPv6 side. The NAT64 is
now waiting for a matching IPv4 packet containing the TCP SYN in the opposite direction.
the opposite direction.
ESTABLISHED: Represents an open connection, with data able to flow in both directions.
V4 FIN RCV: An IPv4 packet containing a TCP FIN was received by the NAT64, data can still flow in the connection, and the NAT64 is waiting for a matching TCP FIN in the opposite direction.
V6 FIN RCV: An IPv6 packet containing a TCP FIN was received bythe NAT64, data can still flow in the connection, and the NAT64 is waiting for a matching TCP FIN in the opposite direction.
V6 FIN + V4 FIN RCV: Both an IPv4 packet containing a TCP FIN and an IPv6 packet containing an TCP FIN for this connection were received by the NAT64. The NAT64 keeps the connection state alive and forwards packets in both directions for a short period of time to allow remaining packets (in particular, the ACKs) to be delivered.
TRANS: The lifetime of the state for the connection is set to TCP_TRANS minutes either because a packet containing a TCP RST was received by the NAT64 for this connection or simply because the
lifetime of the connection has decreased and there are only TCP_TRANS minutes left. The NAT64 will keep the state for the connection for TCP_TRANS minutes, and if no other data packets for
that connection are received, the state for this connection is then terminated.
CLOSED: CLOSED is a fictional state because it represents the state when there is no state for this
particular cache entry, and therefore no connection.
Charitha :we need a state machine for TCP processing.It should be noted that there is one state machine per connection, so only packets belonging to a given connection are inputs to the state machine associated to that connection.