VMware

This Question is Possibly Answered

1 "correct" answer available (10 pts)
1 2 Previous Next 18 Replies Last post: Jul 2, 2008 12:43 PM by rmehta  

Networking: NAT vs. Bridged? posted: Jun 28, 2007 11:57 PM

Click to view tirmidi's profile Hot Shot 138 posts since
Dec 22, 2006
I am running OSX 10.4.10 and beta 4.1, with an XP SP2 guest, on a MacPro Quad 3 ghz with 6 GB RAM. I had selected NAT networking, and all seemed well. However, using the speed tests on DSL Reports(www.dslreports.com/tools), I found an anomaly: whlie my download speed over cable was quite respectable (~20 k/sec), my upload speed started off fast (~1.5 k, but then bogged down to an average of 300 bits/sec). On the Mac side, download was comparable, but upload was 1.5. I reproduced this several times with different servers and different browsers.

So, I thought, let me try bridged networking. Voila! Slightly higher (~25 k/sec) downloads and reasonable (1.5 k/sec) uploads.

Why should this be? It really appeared that the outgoing network connection was saturating on the VM end of things under NAT. And no, the Mac side wasn't using the network.

Re: Networking: NAT vs. Bridged?

1. Jun 28, 2007 10:20 PM in response to: tirmidi
Click to view nathanp's profile Hot Shot 98 posts since
Feb 24, 2006
Usually, I'm not a "me too" person, but I did a quick comparison with my cable between NAT and Bridged.
NAT 6344 kb down / 300 kb up
Bridged 7474 kb down / 1516 kb up

So, downstream doesn't seem too affected, but my upstream got cut down by 5x.
That is the same ratio yours got as well for upload.

I ran it again and the downstream varied a bit, but upstream was pretty much exactly the same.

Re: Networking: NAT vs. Bridged?

2. Jun 28, 2007 10:50 PM in response to: tirmidi
Click to view dp_fusion's profile Hot Shot 285 posts since
Feb 23, 2007
What is the CPU(s) doing (system monitor) when you make these comparisons?

Edit: On my system using only NAT I got twice the output on the host and CPU was lower than when using the guest. I expect that given the interface is virtualized some performance hit would be normal. 2X is more than I expected. I don't run any services though so really don't care - it's interesting, though. I was using http://www.speedtest.net/ to and from Seattle.

Message was edited by:
dp_fusion

Re: Networking: NAT vs. Bridged?

4. Jun 30, 2007 12:29 PM in response to: tirmidi
Click to view westside_guy's profile Novice 14 posts since
Jun 13, 2007
Question: can someone provide a reference in the
documentation that further clarifies the difference
between NAT and bridged networking? This may well be
redundant, but it would be very useful to me.

Do you mean just in terms of performance, or in general?

Certainly if network speed doesn't particularly matter, and you don't need to join an AD domain (since you don't have to join a domain to get at domain shares etc. for the most part), NAT has the benefit of helping protecting your Windows install from the outside world. Since I mainly use XP for testing web pages on IE, and for playing some older Windows games - I use NAT, turn off the Windows firewall and generally don't run antivirus protection (things that'd be ill-advised if you were running in Bridged mode). I do run the OS X firewall, of course.

Re: Networking: NAT vs. Bridged?

6. Jun 30, 2007 1:21 PM in response to: tirmidi
Click to view westside_guy's profile Novice 14 posts since
Jun 13, 2007
I have to admit I was surprised to read about the very significant speed difference you and others have measured. I know I'm stating the obvious; but NAT in and of itself isn't the source of that.

I'm too lazy to try this right now, but it might be interesting to set up a separate NAT server daemon on the Mac, and to point the virtual machine (bridged) at that. It'd require a bit of monkeying around with the firewall though; and while I've done that with Linux iptables I don't have the experience to do that quickly using ipfw.

Re: Networking: NAT vs. Bridged?

7. Jun 30, 2007 2:47 PM in response to: westside_guy
Click to view etung's profile Guru 11,086 posts since
Oct 15, 2006
I'll agree the speed difference is surprising (note I have absolutely no knowledge of how Fusion's networking stack operates); you should file a bug (perhaps include a link to this thread).

Re: Networking: NAT vs. Bridged?

8. Jun 30, 2007 2:51 PM in response to: tirmidi
Click to view Yaztromo's profile Enthusiast 87 posts since
May 28, 2007
Question: can someone provide a reference in the
documentation that further clarifies the difference
between NAT and bridged networking? This may well be
redundant, but it would be very useful to me.

One other thing to keep in mind is that the networking is significantly simplified when using NT if you're a laptop user that frequently moves between wireless networks. Under NAT, as VMware/OS X is handling the address assignment to the guest OS's, they don't need to re-authenticate when moving between networks -- only the host OS needs to. Under bridged mode, each guest would also have to authenticate, and get new NAT addresses, etc.

Whether or not this impacts you depends. In my case, my MacBook tends to roam through three different wireless networks over the course of the day -- my home network (which uses WPA2-based authentication), the campus network (which uses 802.1X-based authentication), and my department's network (which uses a web-based authentication scheme). Using NAT, I can kep using VM's as I cross these various network boundries throughout my day without affecting them at all -- they don't need a new IP address, and need do no authentication. If I were to run them all in Bridged mode, I'd have to authenticate against the campus and department wireless networks as I move between them during the day, for each and every guest OS (as well as the OS X host).

Little of which matters for a desktop system, but for a roaming laptop user, NAT mode can certainly reduce a lot of headaches. I can just imagine that in Bridged mode, if you were to stop somewhere with paid WiFi access (like many airports, at least here in Canada), you'd have to pay once per host/guest if you wanted all of them to have network access, whereas in NAT mode only the host needs pay, and everyone else can "ride for free".

Yaz.

Re: Networking: NAT vs. Bridged?

9. Jun 30, 2007 3:24 PM in response to: tirmidi
Click to view westside_guy's profile Novice 14 posts since
Jun 13, 2007
Okay, I decided to try this out as well so we'd have another data point. In my case, NAT vs. Bridged doesn't significantly impact the download speed - but NAT's upload speed is ~42% lower under NAT than in Bridged mode.

I used Firefox to connect to the Speakeasy speed test http://www.speakeasy.net/speedtest/, and connected to San Francisco each time. I did three reps for each connection.

OS X (native): download 4585.3kbps, upload 359.7kbps

VMware w/ NAT networking: download 4505.00kbps, upload 207.0kbps

VMware w/ Bridged networking: download 4488.7kbps, upload 353.7kbps

Then I switched back to NAT and tried again, just to be sure it wasn't a transient problem - the upload speed was about 210kbps again

Re: Networking: NAT vs. Bridged?

10. Jun 30, 2007 4:38 PM in response to: westside_guy
Click to view sbartel's profile Novice 4 posts since
Dec 22, 2006
Ah, this explains the issue I posted a couple of days ago regarding my slow FTP upload speed. I was in NAT and though I thought it was also happening in Bridged, a couple of tests this evening confirms that while there are slight variations, the problem is definitely with NAT. Bridged mode is currently netting me within a 10% allowance of the speeds I get from FTP with the host Mac, while NAT is off by a factor of about 75%.

Re: Networking: NAT vs. Bridged?

12. Jul 1, 2007 7:55 AM in response to: tirmidi
Click to view etung's profile Guru 11,086 posts since
Oct 15, 2006
As far as I know, that link is the way to report bugs, request support, and make feature requests. You can get to it from vmware.com/mac > Report a Problem, so if it's wrong, the site needs to be corrected.

Re: Networking: NAT vs. Bridged?

13. Jul 1, 2007 11:19 AM in response to: tirmidi
Click to view westside_guy's profile Novice 14 posts since
Jun 13, 2007
Hmm. That link doesn't any longer go to the bug
report page, but to the support page. Is there an
alternate URL?

It worked fine for me.

You log in to that support page, and there's support contact information for various VMware products including Fusion. Clck on the link for Fusion, and you'll be taken to a form allowing you to file a bug report.

I did NOT file a bug report; but I did follow the links and got to the reporting form without problems.

VMware Developer

SDKs, APIs, Videos, Learn and much more in the Developer community.

Learn More

Developer Sample Code

Increase your developer productivity with VMware API sample code.

Learn More

VMworld Sessions & Labs

Online access to the latest VMworld Sessions & Labs and online services.

Learn more

Purchase PSO Credits Online

Purchase credits to redeem training and consulting services online.

Buy Now

Community Hardware Software

View reported configurations or report your own.

Learn More

VMware vSphere

Come witness the next giant leap in virtualization.

Register Today

Communities