rfc3303.txt
来自「RFC 的详细文档!」· 文本 代码 · 共 1,285 行 · 第 1/5 页
TXT
1,285 行
Legend: ++++ MIDCOM control traffic
---- SIP control traffic
==== RTP/RTCP media traffic
7.2. Timeline flow - Middlebox implementing NAPT service
In the following example, we will assume a middlebox implementing
NAPT service. We make the assumption that the middlebox is pre-
configured to redirect SIP calls to the specific private SIP phone
application. I.e., the INVITE from the external caller is not made
to the private IP address, but to the NAPT external address. Let us
say, the external phone's IP address is Ea, NAPT middlebox external
Address is Ma, and the internal SIP phone's private address is Pa.
SIP calls to the private SIP phone will arrive as TCP/UDP sessions,
with the destination address and port set to Ma and 5060
respectively. The middlebox will redirect these datagrams to the
internal SIP phone. The following timeline will illustrate the
operations necessary to be performed by the MIDCOM agent to permit
the RTP/RTCP media stream through the middlebox.
As with the previous example (section 7.1), the INVITE from the
caller (external) is assumed to include the SDP payload. You will
note that the MIDCOM agent requests the middlebox to create NAT
session descriptors for the private-to-external RTP/RTCP flows before
the INVITE is relayed to the private SIP phone (for the same reasons
as described in section 7.1). If the called party (private phone)
sends "early media" before sending the 200 OK response, the NAPT
middlebox will have blocked these packets without the initial MIDCOM
signaling from the agent. Also, note that after the 200 OK is
received by the proxy from the private phone, the agent requests the
middlebox to allocate NAT session descriptors for the external-to-
private RTP2 and RTCP2 flows, such that the ports assigned on the Ma
for RTP2 and RTCP2 are contiguous. The RTCP stream does not happen
Srisuresh, et al. Informational [Page 19]
RFC 3303 MIDCOM Architecture and Framework August 2002
with a non-contiguous port. Lastly, you will note that even though
each media stream (RTP1, RTCP1, RTP2 and RTCP2) is independent, they
are all tied to the single SIP control session, while their NAT
session descriptors were being created. Finally, when the agent
issues a terminate session bundle command for the SIP session, the
middlebox is assumed to delete all associated media stream sessions
automagically.
SIP Phone SIP Proxy Middlebox SIP Phone
(External) (MIDCOM agent) (NAPT (Private)
IP Addr:Ea | Service) IP addr:Pa
| | IP addr:Ma |
| | | |
|----INVITE------>| | |
| | | |
|<---100Trying----| | |
| | | |
| |++ Query Port-BIND | |
| | for (Ma, 5060) +++>| |
| |<+ Port-BIND reply | |
| | for (Ma, 5060) ++++| |
| | | |
| |++ Query NAT Session | |
| | Descriptor for | |
| | Ea-to-Pa SIP flow+>| |
| |<+ Ea-to-Pa SIP flow | |
| | Session Descriptor+| |
| | | |
| Determine the Internal | |
| IP address (Pa) | |
| of the callee. | |
| | | |
| Identify UDP port numbers | |
| on Ea (Eport1, Eport1+1) | |
| for pri-to-ext RTP & RTCP | |
| sessions (RTP1, RTCP1) | |
| | | |
| |++Create NAT Session | |
| | descriptors for | |
| | RTP1, RTCP1; Set | |
| | parent session to | |
| | SIP-ctrl session ++>| |
| |<+RTP1, RTCP1 session | |
| | descriptors created+| |
| | | |
| | |..redirected..|
| |--------INVITE--------|------------->|
| | | |
Srisuresh, et al. Informational [Page 20]
RFC 3303 MIDCOM Architecture and Framework August 2002
| |<-----180Ringing---------------------|
| | | |
|<--180Ringing----| | |
| |<-------200 OK-----------------------|
| | | |
| Identify UDP port numbers | |
| on Pa (Pport2, Pport2+1) | |
| for ext-to-pri RTP & RTCP | |
| sessions (RTP2, RTCP2) | |
| | | |
| |++Create consecutive | |
| | port BINDs on Ma | |
| | for (Pa, Pport2), | |
| | (Pa, Pport2+1) ++++>| |
| |<+Port BINDs created++| |
| | | |
| |++Create NAT Session | |
| | descriptors for | |
| | RTP2, RTCP2; Set | |
| | parent session to | |
| | SIP-ctrl session ++>| |
| |<+RTP2, RTCP2 session | |
| | descriptors created+| |
| | | |
| Modify the SDP | |
| parameters in "200 OK" | |
| with NAPT PORT-BIND | |
| for the RTP2 port on Ma. | |
| | | |
|<---200 OK ------| | |
| | | |
|-------ACK------>| | |
| | | |
| Modify IP addresses | |
| appropriately in the SIP | |
| header (e.g., To, from, | |
| Via, contact fields) | |
| | |..redirected..|
| |-----------ACK--------|------------->|
| | | |
| | | |
|<===================RTP/RTCP============|=============>|
| | | |
|-------BYE------>| | |
| | | |
| |----------------------|-----BYE----->|
| | | |
| |<----------200 OK--------------------|
Srisuresh, et al. Informational [Page 21]
RFC 3303 MIDCOM Architecture and Framework August 2002
| | | |
| |+++Terminate the SIP | |
| | Session bundle +++>| |
| |<++SIP Session bundle | |
| | terminated ++++++++| |
| | | |
|<---200 OK-------| | |
| | | |
Legend: ++++ MIDCOM control traffic
---- SIP control traffic
==== RTP/RTCP media traffic
7.3. Timeline flow - Middlebox implementing NAPT and firewall
In the following example, we will assume a middlebox implementing a
combination of a firewall and a stateful NAPT service. We make the
assumption that the NAPT function is configured to translate the IP
and TCP headers of the initial SIP session into the private SIP
phone, and the firewall function is configured to permit the initial
SIP session.
In the following time line, it may be noted that the firewall
description is based on packet fields on the wire (ex: as seen on the
external interface of the middlebox). In order to ensure correct
behavior of the individual services, you will notice that NAT
specific MIDCOM operations precede firewall specific operations on
the MIDCOM agent. This is noticeable in the time line below when the
MIDCOM agent processes the "200 OK" from the private SIP phone. The
MIDCOM agent initially requests the NAT service on the middlebox to
set up port-BIND and session-descriptors for the media stream in both
directions. Subsequent to that, the MIDCOM agent determines the
session parameters (i.e., the dynamic UDP ports) for the media
stream, as viewed by the external interface and requests the firewall
service on the middlebox to permit those sessions through.
SIP Phone SIP Proxy Middlebox SIP Phone
(External) (MIDCOM agent) (NAPT & (Private)
IP Addr:Ea | firewall IP addr:Pa
| | Services) |
| | IP addr:Ma |
| | | |
|----INVITE------>| | |
| | | |
|<---100Trying----| | |
| | | |
| |++ Query Port-BIND | |
| | for (Ma, 5060) +++>| |
Srisuresh, et al. Informational [Page 22]
RFC 3303 MIDCOM Architecture and Framework August 2002
| |<+ Port-BIND reply | |
| | for (Ma, 5060) ++++| |
| | | |
| |++ Query NAT Session | |
| | Descriptor for | |
| | Ea-to-Pa SIP flow+>| |
| |<+ Ea-to-Pa SIP flow | |
| | Session Descriptor+| |
| | | |
| Determine the Internal | |
| IP address (Pa) | |
| of the callee. | |
| | | |
| Identify UDP port numbers | |
| on Ea (Eport1, Eport1+1) | |
| for pri-to-ext RTP & RTCP | |
| sessions (RTP1, RTCP1) | |
| | | |
| |++Create NAT Session | |
| | descriptors for | |
| | RTP1, RTCP1; Set the| |
| | parent session to | |
| | point to SIP flow++>| |
| |<+RTP1, RTCP1 session | |
| | descriptors created+| |
| | | |
| |++Permit RTP1 & RTCP1 | |
| | sessions External to| |
| | middlebox, namely | |
| | Ma to Ea:Eport1, | |
| | Ma to Ea:Eport1+1 | |
| | sessions ++++++++++>| |
| |<+Ma to Ea:Eport1, | |
| | Ma to Ea:Eport1+1 | |
| | sessions OKed ++++++| |
| | | |
| | |..redirected..|
| |--------INVITE--------|------------->|
| | | |
| |<-----180Ringing---------------------|
| | | |
|<--180Ringing----| | |
| |<-------200 OK-----------------------|
| | | |
| Identify UDP port numbers | |
| on Pa (Pport2, Pport2+1) | |
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?