|-----Original Message----- |From: Simon Perreault [mailto:[email protected]] |Sent: Friday, August 12, 2011 9:41 PM |To: DENG Xiaohong ESP/PEK |Cc: [email protected]; [email protected]; [email protected] |Subject: Re: [Softwires] Clarification of the |stateles/stateful discussion | |On 2011-08-12 09:25, [email protected] wrote: |> |In your experiments, do you measure port and session usage on the |> |NAT, on the internal host, or both? It's not clear to me |when reading |> |your experiment results at |> |http://opensourcev6transtechnologies.weebly.com/experiments-res |> |ults.html |> |> The data shows there are only the port and session usage on the NAT. | |Ok. Thanks. | |Then I think we're missing an important piece of data: port |and session usage on the host. Here's why, with an example.
Nice examples. More below. | | |Suppose I run an app on my host that creates two sessions |using two different source ports: | |192.168.0.10:65000 --> 1.2.3.4:80 |192.168.0.10:65001 --> 5.6.7.8:80 | |An EIM NAT will always map these two sessions to two different |external ports, let's say like this: | |4.4.4.4:65000 --> 1.2.3.4:80 |4.4.4.4:65001 --> 5.6.7.8:80 | |A non-EIM NAT could instead conserve ports by reusing the same |external port for the two sessions: | |4.4.4.4:65000 --> 1.2.3.4:80 |4.4.4.4:65000 --> 5.6.7.8:80 | |------------------------------ | |Suppose now that a different app creates two sessions using |the same source port: Very perceptive example. We did run into this case during PCP-UPnP Interworking work when we're struggling how PCP handle internal ports conflicts. It's quiet common that different apps share the same source port (at least ) on Windows XP (observed). This case *exactly* shows how comes more sessions than ports even with EIM NAT, so I wonder if you have this vision why still surprised by the results? | |192.168.0.10:65000 --> 1.2.3.4:80 |192.168.0.10:65000 --> 5.6.7.8:80 | |Both the EIM NAT and the non-EIM NAT would map them to the |same external |port: | |4.4.4.4:65000 --> 1.2.3.4:80 |4.4.4.4:65000 --> 5.6.7.8:80 | |-------------------------------------- | | |So, conclusion: unless your extremely certain of the NAT |behaviour (we rarely are, especially in edge cases), just by |looking at the NAT port and session usage says nothing about |what happens on the host. We don't know whether BitTorrent, 1. Looking at the NAT usage indeed says something about what happens on the host. More reasons below. 2. Port and session usages on NAT are exactly what we're concerning about, are they? As far as BitTorrent concerned, it is the case that incomming sessions are established by different destinations connecting to the same internal port (listening port), which leads to more sessions than ports on the host. That's one reason, among others, why sessions are more than ports on both the host and the NAT for BT applications. (b) Second, tcp and udp sharing the same internal port to establish different sessions is another reason results in more sessions. (c) Third, as you listed above, different applications share the same internal port to establish different sessions. |Skype, or Firefox reuse source ports for different |destinations or whether they simply use additional internal |source ports. | |Usually, if an application just uses the usual BSD sockets API |to initiate each new session (socket() then connect()), the OS |will assign a different source ports (for all common consumer |OSes). It could be possible that the application does it |otherwise, but the straightforward way to do it just consumes |another port. Consider how socket RESUME option works. ;) | |So your observations on the NAT, where significantly more Just for BT and skype cases, it is significantly more. For firefox and IE, I would say it's a bit more, given that http requests are always acommpany with DNS UDP queries, which hopefully could you explain why, according to reason (b) and (c) above, If you also agree with (b), since you already agreed with (c). |sessions were active than there were ports, mean that either |of these is true: Niether, IMHO. | |a) Firefox, the BitTorrent client you tested, and Skype do not |create new sessions with the usual socket() then connect() |sequence. (That would be quite strange for Firefox and |BitTorrent, not so much for Skype.) See above. Hope it's clear stated and be stay open to hear your comments. | |b) The NAT you tested was not EIM. (This would not be |surprising since there are many non-EIM consumer grade NATs out there.) IMHO. A linux knernal 2.6.32 ,which we used for A+P NAT, provide an EIM, yet corret me if wrong. | |Thoughts? All above. Cheers, Xiaohong | |Simon |-- |DTN made easy, lean, and smart --> http://postellation.viagenie.ca |NAT64/DNS64 open-source --> http://ecdysis.viagenie.ca |STUN/TURN server --> http://numb.viagenie.ca | _______________________________________________ Softwires mailing list [email protected] https://www.ietf.org/mailman/listinfo/softwires
