Section: 6.2.5.1.4.2 Derivation of packet filter for UL direction from DL user data packet
Content: If the UE needs to derive a packet filter for UL direction from the DL user data packet (see subclause 6.2.5.1.4.3 and 6.2.5.1.4.4), the UE shall proceed as follows: a) if the received DL user data packet belongs to a PDU session of IPv4 or IPv4v6 PDU session type and is an IPv4 packet and: 1) the protocol field of the received DL user data packet indicates TCP as specified in IETF RFC 793 [33]; 2) the protocol field of the received DL user data packet indicates UDP as specified in IETF RFC 768 [32]; or 3) the protocol field of the received DL user data packet indicates ESP as specified in IETF RFC 4303 [38] and an uplink IPSec SA corresponding to a downlink IPSec SA indicated in the security parameters index field of the received DL user data packet exists; then the packet filter for UL direction contains the following packet filter components: 1) an IPv4 remote address component set to the value of the source address field of the received DL user data packet; 2) an IPv4 local address component set to the value of the destination address field of the received DL user data packet; 3) a protocol identifier/next header type component set to the value of the protocol field of the received DL user data packet; 4) if the protocol field of the received DL user data packet indicates TCP as specified in IETF RFC 793 [33] or UDP as specified in IETF RFC 768 [32]: i) a single local port type component set to the value of the destination port field of the received DL user data packet; and ii) a single remote port type component set to the value of the source port field of the received DL user data packet; 5) if the protocol field of the received DL user data packet indicates ESP as specified in IETF RFC 4303 [38], an uplink IPSec SA corresponding to a downlink IPSec SA of the SPI in the DL user data packet exists and the SPI of the uplink IPSec SA is known to the NAS layer: i) a security parameter index type component set to the security parameters index of the uplink IPSec SA corresponding to the downlink IPSec SA indicated in the security parameters index field of the received DL user data packet; and 6) if the protocol field of the received DL user data packet indicates UDP and the received DL user data packet contains a UDP-encapsulated ESP header as specified in IETF RFC 3948 [55], an uplink IPSec SA corresponding to a downlink IPSec SA of the SPI in the DL user data packet exists and the SPI of the uplink IPSec SA is known to the NAS layer: i) a security parameter index type component set to the security parameters index of the uplink IPSec SA corresponding to the downlink IPSec SA indicated in the security parameters index field of the ESP header field of the UDP-encapsulated ESP header as specified in IETF RFC 3948 [55] of the received DL user data packet; otherwise it is not possible to derive a packet filter for UL direction from the DL user data packet; b) if the received DL user data packet belongs to a PDU session of IPv6 or IPv4v6 PDU session type and is an IPv6 packet and: 1) the last next header field of the received DL user data packet indicates TCP as specified in IETF RFC 793 [33]; 2) the last next header field of the received DL user data packet indicates UDP as specified in IETF RFC 768 [32]; or 3) the last next header field of the received DL user data packet indicates ESP as specified in IETF RFC 4303 [38] and an uplink IPSec SA corresponding to a downlink IPSec SA indicated in the security parameters index field of the received DL user data packet exists; then the packet filter for UL direction contains the following packet filter components: 1) an IPv6 remote address/prefix length component set to the value of the source address field of the received DL user data packet; 2) an IPv6 local address/prefix length component set to the value of the destination address field of the received DL user data packet; 3) a protocol identifier/next header type component set to the value of the last next header field of the received DL user data packet; 4) if the last next header field of the received DL user data packet indicates TCP as specified in IETF RFC 793 [33] or UDP as specified in IETF RFC 768 [32]: i) a single local port type component set to the value of the destination port field of the received DL user data packet; and ii) a single remote port type component set to the value of the source port field of the received DL user data packet; 5) if the last next header field of the received DL user data packet indicates ESP as specified in IETF RFC 4303 [38], an uplink IPSec SA corresponding to a downlink IPSec SA of the SPI in the DL user data packet exists and the SPI of the uplink IPSec SA is known to the NAS layer: i) a security parameter index type component set to the security parameters index of the uplink IPSec SA corresponding to the downlink IPSec SA indicated in the security parameters index field of the received DL user data packet; and 6) if the last next header field of the received DL user data packet indicates UDP, and the received DL user data packet contains a UDP-encapsulated ESP header as specified in IETF RFC 3948 [55], an uplink IPSec SA corresponding to a downlink IPSec SA of the SPI in the DL user data packet exists and the SPI of the uplink IPSec SA is known to the NAS layer: i) a security parameter index type component set to the security parameters index of the uplink IPSec SA corresponding to the downlink IPSec SA indicated in the security parameters index field of the ESP header field of the UDP-encapsulated ESP header as specified in IETF RFC 3948 [55] of the received DL user data packet; otherwise it is not possible to derive a packet filter for UL direction from the DL user data packet; c) if the received DL user data packet belongs to a PDU session of Ethernet PDU session type, the packet filter for UL direction contains the following packet filter components: 1) a destination MAC address component set to the source MAC address of the received DL user data packet; 2) a source MAC address component set to the destination MAC address of the received DL user data packet; 3) if one or more 802.1Q C-TAG is included in the received DL user data packet, an 802.1Q C-TAG VID component set to the outermost 802.1Q C-TAG VID of the received DL user data packet and an 802.1Q C-TAG PCP/DEI component set to the outermost 802.1Q C-TAG PCP/DEI of the received DL user data packet; 4) if one or more 802.1Q S-TAG is included in the received DL user data packet, an 802.1Q S-TAG VID component set to the outermost 802.1Q S-TAG VID of the received DL user data packet and an 802.1Q S-TAG PCP/DEI component set to the outermost 802.1Q S-TAG PCP/DEI of the received DL user data packet; 5) If the Ethertype field of the received DL user data packet is set to a value of 1536 or above, an Ethertype component set to the Ethertype of the received DL user data packet; 6) if the Ethertype field of the Ethernet frame header indicates that the data carried in the Ethernet frame is IPv4 data, the UE shall also add to the packet filter for UL direction the IP-specific components based on the contents of the IP header of the received DL user data packet as described in bullet a) above; and 7) if the Ethertype field of the Ethernet frame header indicates that the data carried in the Ethernet frame is IPv6 data, the UE shall also add to the packet filter for UL direction the IP-specific components based on the contents of the IP header of the received DL user data packet as described in bullet b) above; and d) if the received DL user data packet belongs to a PDU session of PDU session type other than Ethernet, IPv4, IPv6 and IPv4v6, it is not possible to derive a packet filter for UL direction from the DL user data packet.