G.4 Procedures for employing the IMS-ALG and IMS Access Gateway
23.2283GPPIP Multimedia Subsystem (IMS)Release 18Stage 2TS
G.4.1 General
The procedures described in this clause are applied in addition to the procedures of the P‑CSCF described in the other clauses of this specification.
G.4.2 NAT detection in P‑CSCF
When supporting the IMS-ALG function, the P‑CSCF, based on information received in a SIP request message (e.g. a REGISTER request), shall detect if there is NAT between the UE and itself and shall make a decision if IMS-ALG function shall be invoked for the session of subscriber. In addition to when a NAT is detected between the UE and the P‑CSCF, the IMS-ALG function may be invoked for other reasons (e.g. UEs using IP address from a Private IP address range).
G.4.3 Session establishment procedure
This procedure is applied when P‑CSCF invokes the IMS-ALG function for a session. This can happen at terminating side if the called party is behind a NAT or at the originating side if the session initiator is behind a NAT. Both cases are handled in the P‑CSCF and the IMS Access Gateway as described in this clause.
Figure G.3: Session establishment procedure with NAT traversal
NOTE 1: In figure G.3 if UE_A belongs to the P‑CSCF (originating case) then there will be IMS elements, i.e., CSCFs, between the P‑CSCF and UE_B. If UE_B belongs to the P‑CSCF (terminating case) then there will be IMS elements, i.e., CSCFs, between the P‑CSCF and UE_A.
NOTE 2: The Transport address refers to both the IP address and Ports (see definition in clause 3.1).
1) The P‑CSCF receives a SIP message with an SDP offer from UE_A and decides to invoke the IMS-ALG function for this session. The session can either an originating or a terminating session. The SDP offer contains the transport address(es) of UE_A where the media flow(s) should be sent.
2) The P‑CSCF requests a transport address for each media flow from the IMS Access Gateway. Each request contains sufficient information to determine the side of the IMS access gateway that the transport request is being requested for. (e.g. local or remote side with respect to UE_A).
3) The IMS Access Gateway reserves one of its transport addresses for the given side of the media flow and this transport address is sent back to the P‑CSCF. The IMS Access Gateway shall keep the reserved temporary transport address (binding) until the session is released.
4) The P‑CSCF changes the original transport address(es) of the SDP offer to the transport address(es) received from the IMS Access Gateway.
5) The P‑CSCF forwards the SIP message with the modified SDP offer according to the normal routing procedures.
6) UE_B sends back a SIP message with an SDP answer, which is forwarded to the P‑CSCF according to the normal SIP message routing procedures.
7) The P‑CSCF requests a transport address for each media flow in the routing domain of its own IMS network from the IMS Access Gateway. The request contains sufficient information to correlate to the transport address request performed in step 2.
NOTE: If some of the offered media flows are rejected in the answer, then the P‑CSCF shall indicate this to the IMS Access Gateway. The IMS Access Gateway can release the resources (e.g., the transport address) reserved for that media flow. The P‑CSCF may indicate directly to release the resources.
8) The IMS Access Gateway reserves one of its transport addresses for the given side of the media flow and this transport address is sent back to the P‑CSCF.
9) The P‑CSCF changes the original transport address(es) of the SDP answer to the transport address(es) received from the IMS Access Gateway.
10) The P‑CSCF forwards the SIP message with the modified SDP answer according to the normal SIP message routing procedures.
G.4.4 Session release procedure
This procedure is applied when a session has to be released, for which the IMS-ALG function is invoked.
Figure G.4: Session release procedure with NAT traversal
1) The P‑CSCF receives a trigger to release a session, for which the IMS-ALG function is invoked.
2) The P‑CSCF sends an indication to the IMS Access Gateway for each media flow of the session that the resources allocated during the session establishment procedures are to be released.
3) The IMS Access Gateway releases its resources allocated for the given media flows.
G.4.5 Session modification
A session modification can cause the creation, and/or modification, and/or release of media flows.
When a new media flow is created the procedure used during session establishment shall be applied.
When an existing media flow is released the procedure for session termination shall be applied for the particular media flow.
When an existing media flow is modified, this may lead to a modification of the media flow directly, or to the establishment of a new media flow and release of the existing one.
G.4.6 Media forwarding in the IMS Access Gateway
This clause presents the media forwarding performed by the IMS Access Gateway. The behaviour presented in this clause is valid in both directions.
Figure G.5: Packet forwarding in the IMS Access Gateway
1) UE_A sends a media packet to the transport address of the IMS Access Gateway that was received during the session establishment/modification.
2) After receiving the media packet the IMS Access Gateway recognizes the media flow based on the transport address where the packet arrived at. The IMS Access Gateway changes the source transport address to its own transport address that was given to the UE_B as the destination transport address during session establishment/modification and the destination transport address to the transport address of UE_B.
The IMS Access Gateway can learn the transport addresses where the inbound (i.e. towards the UE) media packets shall be forwarded to in two ways, depending on whether there is a NAT device in the path or not. In absence of a NAT device in the path, it is the P‑CSCF that signals the destination transport address for the inbound media flows. In presence of NAT device in the path, it is the IMS Access Gateway that may, upon being informed that there is a NAT in the network, determine the destination transport address of the inbound media flow based on previously received media packets in the opposite direction.
Beyond the changes of transport addresses the IMS Access Gateway shall perform the other necessary changes in the IP header as it is specified in the NAT related IETF specifications, IETF RFC 2766 [33] and IETF RFC 2663 [34].
NOTE 1: If the IMS Access Gateway does not know the transport address where a packet shall be forwarded, i.e. no packet of the other direction of the media flow has been received, then it can store or drop the packet.
NOTE 2: If this is not the first packet then the IMS Access Gateway can check the source transport address. If it is not the same as the transport address previously used for this media flow in this direction then the media packet may be a fraud one and should be dropped.
NOTE 3: This solution (i.e. when the IMS Access Gateway determine the destination transport address on its own) assumes that the UE supports "symmetric media" i.e. it supports receiving media packets at the same address and port as it uses for sending.
3) The IMS Access Gateway routes the media packet towards UE_B.