 which in response returns A the internal and the external transport addresses of B and, at the same time, forwards the request to B. Moreover, S sends B the internal and the external transport addresses of A. As soon as both hosts know each other, they probe the addresses received from S by attempting to communicate directly using each of them. To understand how the communication is actually established, three main scenarios are considered in the following: 1. Both A and B are placed in the same internal network. 2. A and B are placed in separate internal networks connected by the same external one. 3. A and B are placed behind multiple layers of NATs. In the first scenario (see Figure 12.4), each host that successfully probes the transport addresses will be successful for the internal addresses as both hosts are in the same internal network, and possibly for the external ones, if the NAT C 2009 by Taylor & Francis Group, LLC Server S 2. S forwards the endpoints of B (B:b, B1:b1) to A Server S 2. S forwards the endpoints Internet Internet of A (A:a, A, to B: Session A-S: Session B-S: 1. Connection A:a1 1 - S:s B: 1 :b 1 - S:s request to B A 1 :a 1 B 1 :b1 3. B tries to establish 3. A tries to establish a session with A: a session with B: C. B:b -A :a Session A-S: Session B-S: a. A:a - B :b 1 d.B:b -A:a B:b - Sis b.A:a-B:b A:a S:s Internal network Internal Host A Host B Host A network Host B Server S Internet Session A-S: Session B-S: A:a,-S:s B. :b -S:s A, 1 1 B,:b 1 1 Session A-S: Session B-S: A:a S:s Internal B:b - S:s network Host A Host B Session A-B: A:a - B:b FIGURE 12.4 A NAT traversal scenario showing hosts behind the same NATs. C 2009 by Taylor & Francis Group, LLC SIP Handbook: Services, Technologies, and Security supports hairpinning. The internal transport addresses will be the preferred choice. In the second (and most common) scenario (see Figure 12.5), probing of the internal transport addresses fails since the hosts belong to different inter- nal networks. The success of the external transport add