Skip to content
Snippets Groups Projects
user avatar
Tomasz Grabiec authored
Fixes #283.

When backlog is full upon receiving ACK, keep the entry in SYN
cache. The client will eventually retransmit unacknowledged data and
the connection state promotion will be retried at later time. Dropping
of SYN cache entries was causing connection resets on the client side.

The entry will be dropped when either of these occurs:
 * The connection is successfully ACK'ed
 * Invalid packet is received for that connection
 * SYN+ACK retransmission limit is exceeded
 * SYN cache hashmap bucket fills up - oldest entry is removed.

We could also implement yet another protection mechanism, as a next
step. We could drop SYN requests when we know the backlog is full, but
this patch makes the biggest difference. SYN-dropping might be needed
to avoid resets when the number of sudden connections is so large that
SYN cache buckets fill up. Assuming connection hashing is good, that's
quite a lot of connections - the hash map has 512 entries with buckets
of up to 30 elements.

Signed-off-by: default avatarTomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
bc8b01b6
History

OSv

OSv is a new open-source operating system for virtual-machines. OSv was designed from the ground up to execute a single application on top of a hypervisor, resulting in superior performance and effortless management when compared to traditional operating systems which were designed for a vast range of physical machines.

OSv has new APIs for new applications, but also runs unmodified Linux applications (most of Linux's ABI is supported) and in particular can run an unmodified JVM, and applications built on top of one.

For more information about OSv, see http://osv.io/ and https://github.com/cloudius-systems/osv/wiki

Documentation

Building

OSv can only be built on a 64-bit x86 Linux distribution. Please note that this means the "x86_64" or "amd64" version, not the 32-bit "i386" version.

First, install prerequisite packages:

Fedora

yum install ant autoconf automake boost-static gcc-c++ genromfs libvirt libtool flex bison qemu-system-x86 qemu-img maven maven-shade-plugin python-dpkt tcpdump gdb

Debian

apt-get install build-essential libboost-all-dev genromfs autoconf libtool openjdk-7-jdk ant qemu-utils maven libmaven-shade-plugin-java python-dpkt tcpdump gdb

Ubuntu users: you may use Oracle JDK if you don't want to pull too many dependencies for openjdk-7-jdk

To ensure functional C++11 support, Gcc 4.8 or above is required, as this was the first version to fully comply with the C++11 standard.

Make sure all git submodules are up-to-date:

git submodule update --init --recursive

Finally, build everything at once:

make

By default make creates image in qcow2 format. To change this pass format value via img_format variable, i.e.

make img_format=raw

Running OSv

./scripts/run.py

By default, this runs OSv under KVM, with 4 VCPUs and 2GB of memory, and runs the default management application (containing a shell, Web server, and SSH server).

If running under KVM you can terminate by hitting Ctrl+A X.

External Networking

To start osv with external networking:

sudo ./scripts/run.py -n -v

The -v is for kvm's vhost that provides better performance and its setup requires a tap and thus we use sudo.

By default OSv spawns a dhcpd that auto config the virtual nics. Static config can be done within OSv, configure networking like so:

ifconfig virtio-net0 192.168.122.100 netmask 255.255.255.0 up
route add default gw 192.168.122.1

Test networking:

test invoke TCPExternalCommunication

Running Java or C applications that already reside within the image:

# Building and running a simple java application example
$ make image=java-example
$ scripts/run.py -e "java.so -cp /java-example Hello"

# Running an ifconfig by explicit execution of ifconfig.so (compiled C++ code)
$ make
$ sudo scripts/run.py -nv -e "/tools/ifconfig.so"