Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
51
Добавлен:
11.04.2015
Размер:
22.9 Mб
Скачать

Chapter 14 Teredo

339

Maintaining the NAT Mapping

Figure 14-12 shows how Teredo clients that are behind a NAT maintain the NAT mapping for Teredo traffic.

Teredo Server

2

IPv4 Internet

NAT

NAT

1

1. Bubble to Teredo Server

2. Response from Teredo Server

Teredo Client

Figure 14-12 Maintaining the NAT mapping

On a periodic basis, Teredo clients send a single bubble packet to their Teredo server. The Teredo server discards the bubble packet and sends a response. The periodic bubble packet refreshes the IP address/UDP port mapping in the NAT’s translation table. Otherwise, the mapping becomes stale and is removed. If the mapping is not present, all inbound Teredo traffic (for a cone NAT) or inbound Teredo traffic from the Teredo server (restricted NAT) to the Teredo client is silently discarded by the NAT. From the response, the Teredo client can determine if the external address and port number for its Teredo traffic have changed.

You can configure how often a Windows-based Teredo client refreshes its NAT mapping with the netsh interface teredo set state refreshinterval=Seconds command. The default refresh interval is 30 seconds.

Initial Communication Between Teredo Clients on the Same Link

Figure 14-13 shows the initial communication between Teredo clients on the same link.

340 Understanding IPv6, Second Edition

Teredo Server

IPv4 Internet

 

NAT

1

 

2

 

3

 

1.

Multicast Bubble

2.

Unicast Bubble

3.

Initial Packet

Teredo Client A

Teredo Client B

Figure 14-13 Initial communication between Teredo clients on the same link

To send an initial communication packet from Teredo Client A to Teredo Client B on the same link, the following process is used:

1.Teredo Client A sends a bubble packet to the Teredo IPv4 Discovery Address of 224.0.0.253, a reserved IPv4 multicast address. In the IPv6 header of the bubble packet, the destination address is set to the link-local scope, all-nodes multicast address (FF02::1).

2.Upon receipt of the multicast bubble packet from Teredo Client A, Teredo Client B determines the on-link IPv4 address of Teredo Client A and the UDP port used for Teredo traffic and sends a unicast bubble packet to Teredo Client A in response. Upon receipt of the unicast bubble packet from Teredo Client B, Teredo Client A determines the on-link IPv4 address of Teredo Client A and the UDP port used for Teredo traffic.

3.Teredo Client A sends an initial communication packet to Teredo Client B.

Initial Communication Between Teredo Clients in Different Sites

Initial communication between Teredo clients in different sites depends on whether the sites are using cone NATs or restricted NATs.

Cone NAT

Figure 14-14 shows the initial communication between Teredo clients in different sites when both sites are using cone NATs.

Chapter 14 Teredo

341

Teredo Server 1

Teredo Server 2

 

IPv4 Internet

Teredo

Cone NAT

Client A

 

1

Cone

 

NAT

1. Initial Packet to Teredo Client B

Teredo Client B

Figure 14-14 Initial communication between Teredo clients in different sites with cone NATs

When both Teredo clients are located behind cone NATs, the NAT translation table entry for Teredo traffic for each Teredo client allows traffic from any source IP address or source UDP port. Therefore, Teredo Client A can send packets directly to Teredo Client B without the use of bubble packets to establish additional NAT translation table entries.

Restricted NAT

Figure 14-15 shows the initial communication between Teredo clients in different sites when both sites are using restricted NATs.

To send an initial communication packet from Teredo Client A to Teredo Client B, the following process is used:

1.Teredo Client A sends a bubble packet directly to Teredo Client B. Because Teredo Client B is behind a restricted NAT, Teredo traffic from an arbitrary source IPv4 address and UDP port number is not allowed unless there is a source-specific NAT translation table entry. Assuming that there is none, the restricted NAT silently discards the bubble packet. However, when the restricted NAT for Teredo Client A forwarded

the bubble packet, it created a source-specific NAT translation table entry that will allow future packets sent from Teredo Client B to be forwarded to Teredo Client A.

342 Understanding IPv6, Second Edition

Teredo Server 1

Teredo Server 2

Restricted

3

NAT

 

IPv4 Internet

 

2

Teredo

4

Client A

1

 

 

5

 

Restricted

 

NAT

1.

Bubble to Teredo Client B

2.

Bubble to Teredo Server 2

3.

Forwarded Bubble to Teredo Client B

4.

Bubble to Teredo Client A

5.

Initial Packet to Teredo Client B

 

Teredo Client B

Figure 14-15 Initial communication between Teredo clients in different sites with restricted NATs

2.Teredo Client A sends a bubble packet to Teredo Client B via Teredo Server 2 (Teredo Client B’s Teredo server). The IPv4 destination address in the bubble is set to the IPv4 address of Teredo Server 2, which Teredo Client A determines from the third and fourth blocks of Teredo Client B’s Teredo address.

3.Teredo Server 2 processes the packet, determines that the IPv6 destination address is for a Teredo client, and then forwards the bubble packet to Teredo Client B. The restricted NAT for Teredo Client B forwards the packet because there is an existing source-specific mapping for Teredo traffic from Teredo Server 2.

4.Teredo Client B responds to the bubble packet received from Teredo Client A with its own bubble packet sent directly to Teredo Client A. Because Teredo Client A’s restricted NAT has a source-specific mapping for Teredo traffic from Teredo Client B (as established by the initial bubble packet sent from Teredo Client A in step 1), the bubble packet is forwarded to Teredo Client A.

5.Upon receipt of the bubble packet from Teredo Client B, Teredo Client A determines that source-specific NAT mappings exist for both NATs. Teredo Client A sends an initial communication packet directly to Teredo Client B.

Соседние файлы в папке Lecture 2_10