From owner-freebsd-stable Thu Oct 17 4: 2:20 2002 Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9894437B401; Thu, 17 Oct 2002 04:02:18 -0700 (PDT) Received: from premijer.tel.fer.hr (premijer.tel.fer.hr [161.53.19.221]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3D55D43E97; Thu, 17 Oct 2002 04:02:13 -0700 (PDT) (envelope-from zec@tel.fer.hr) Received: from tel.fer.hr (zec-laptop.tel.fer.hr [161.53.19.8]) by premijer.tel.fer.hr (Postfix) with ESMTP id F1F681380; Thu, 17 Oct 2002 13:01:44 +0200 (MET DST) Message-ID: <3DAE98B4.4058023A@tel.fer.hr> Date: Thu, 17 Oct 2002 13:02:13 +0200 From: Marko Zec X-Mailer: Mozilla 4.78 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: "J. 'LoneWolf' Mattsson" Cc: freebsd-net@freebsd.org, freebsd-stable@freebsd.org Subject: Re: RFC: BSD network stack virtualization References: <3DADD864.15757E4E@tel.fer.hr> <3DADD864.15757E4E@tel.fer.hr> <5.1.0.14.2.20021017184945.02958380@helios.earthmagic.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG "J. 'LoneWolf' Mattsson" wrote: > At 08:59 17/10/2002 +0200, Ruben van Staveren wrote: > >Isn't this something that can overcome the current shortcomings of jail(2) ? > >(the no other stacks/no raw sockets problem) It should be possible even to run multiple jails within each virtual image, if one wishes to do so :) Actually, my code reuses the jail framework for providing separation (hiding) between the user processes, therefore the behavior in that area will be very similar. Everything else done on the networking layer is free of "jail" legacy, as my concept is completely different: providing multiple truly independent network stacks, instead of hiding parts of the monolithic one, which was the approach taken by jail implementation. An additional goodie is the introduction of soft limit option on average CPU usage per each virtual image. This can be very useful in virtual hosting applications, to prevent starving of CPU resources from runaway or malicious processes running in a single virtual image. > I've been tempted at looking into jail-ifying raw sockets as well, but time > has precluded me from doing so (and from tracking -stable regularly). I > must say that this virtualization sounds very promising in making the jail > even more useful! And of course all the other avenues that are made > possible with this. I guess the main/traditional question to ask first > would be: > This change adds abstraction, therefore it probably reduces performance - > by how much? In most parts of the code the virtualization is achieved via introduction of a single additional level of indirection for all virtualized symbols/variables, which are now contained in the new struct vimage, unique for each virtual image. Therefore the calls to most of the networking functions within the kernel had to be extended with an additional argument, which passes the pointer to the current vimage struct. This additional overhead shouldn't present a to significant problem, particularly not for the current 1+ GHz CPUs with fast memory. Some preliminary tests (netperf on TCP flows) show that the performance penalty is generally minimal, somewhere around 1-2%, compared to normal maximum throughputs (not limited by the media speed). As I perform more systematic and accurate measurements, I'll post them on my web page. Best regards, Marko To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message