[Netnice-developer] VIFlet - flexibly extends VIF functionality with embedded Java technology!
Status: Alpha
Brought to you by:
taost6
|
From: Takashi O. <ta...@wi...> - 2006-06-07 12:27:13
|
Dear netnice users/hackers,
I have a good news, and a request, for you today.
So far, VIFs can flexibly control network traffic on a host, but, it
cannot provide ALTQ-like queuing control, for example, queuing control
by address-port pairs. So, I have implemented a new mechanism for VIF
system, VIFlet. As the name suggests, VIFlet is a software component,
based on the Java technology. A VIFlet is a container of methods to
perform processing of packets. On the new system, Java Virtual Machines
are embedded on each VIF, and users can run their own VIFlets to
customize functionality of their VIFs. To write such a program,
you can simply use ordinary Java development environment. Just inherit
VIFlet class provided in the class library, and override necessary
methods. Sample VIFlet is attached below, and you will notice that
it is really easy to write a VIFlet. To boost the performance, I also
implemented a in-kernel Just-In-Time compiler, which speeds up
execution of VIFlets close to hardcoded implementations.
A request is that I need a proofreader for a technical report of
the new technology, my dissertation :-)
Because it has more than 150 pages, I think it would be reasonable
to pay for that, in return for the feedback and for the time. I
need a native english speaker, and appreciate latex experience.
If you're interested, please let me know. Even if you're not
interested, comments and questions are highly appreciated :-)
thanks!
-- taka
public class PriQVIFlet extends VIFlet {
private static final int NCLASS = 4;
private Queue[] queue;
private PacketClassifier pc =
new SimplePacketClassifier();
PriQVIFlet() {
System.out.println("Initializing...");
queue = new Queue[NCLASS];
for (int i = 0; i < NCLASS; i++)
queue[i] = new Queue();
}
public void enqueue(Packet p) {
int type = pc.classify(p);
length++;
queue[type % NCLASS].enqueue(p);
}
public Packet dequeue() {
for (int i = 0; i < NCLASS; i++)
if (queue[i].isEmpty() != true) {
length--;
return queue[i].dequeue();
}
return null;
}
}
|