port addresses assigned by NAT A and NAT B, since they have no chance to learn these addresses. 12.4.2 Relaying When discussing the scenarios related to hole punching, we observed that direct connectivity may be impossible if specific types of NAT are on the path. However, if NATs satisfy the requirements defined in RFC 4787, hole punching ensures direct connectivity. Nevertheless, there are still NATs that do not comply with those requirements: for example, NATs with address- and port-dependent mapping behavior or NATs that do not support hairpinning may impair connectivity. Under such conditions, relays are needed. Relaying is the only NAT traversal technique that always ensures connectivity, but it comes at the cost of increased latency and reduced scalability. C 2009 by Taylor & Francis Group, LLC 2. .S forwards the endpoints Server S of B (B:b, B 1:b1) to A: Server S 2.S forwards the endpoints Internet of of A (A:a, A:a) to B: Session A-S: Session B-S: 1. Connection A_ 1 :a,-S:s B. :b -S:s request to B Internet A 1 a 1 NAT A NAT B B. :b A1 1 a 1 NAT A NAT B B :b 1 Session A-S: Session B-S: 3. A tries to establish 3. B tries to establish A:a -S:s B:b -S:s a session with B: a session with A: a.A:a - B:b1 c.B:b -A,:a, b.A:a - B:b d.B:b -A:a Host A Host B Host A Host B Server S Internet Session A-S: Session B-S: A :a -S:s B :b -S:s A. 1 a NAT A NAT B Session A-S: Session A-B: A,:a - B.:b Session B-S: A:a -S:s B:b -S:s Host A Host B FIGURE 12.5 A NAT traversal scenario including hosts behind different NATs. C 2009 by Taylor & Francis Group, LLC Server S 2. S forwards the endpoints Server S 2.S forwards the endpoints Internet of B (B:b, B:b2) to A: of A (A:a, A,:a2) to B: Session A-S: Session B-S: Internet A,:a,-S:s 2 2 B.:b -S:s A2:a2 NAT C Session A-S: Session B-S: 1. Connection Al:a, NAT C A.:a.-S:s B,:b,-S:s 1 10 request to B Internal Internal network NAT A NAT B A:a, 1 network B,:b. 1 1 NAT A NAT B B,:b1 1 3.A tries to establish 3. B tries to establish Session B-S: a session with B: a session with A: Session 