Victor S. Andrei <firstname.lastname@example.org> has put together this tutorial to compile and install MPTCP on Amazon EC2
This tutorial includes retrieving and compiling your kernel yourself. If you get stuck somewhere, check this page
These instructions assume that you have an account with Amazon AWS. If you don't have one, you should go get one first.
- Start with one of the Ubuntu 11.10 EC2 AMIs. This release uses a kernel that is very close in version to what you can get from the MPTCP server. I like using EBS backed images because I can easily take snapshots of the EBS volumes and make custom AMIs from these snapshots.
- Launch a new instance based on your chosen AMI from step 1. I recommend a high CPU instance like c1.medium (for 32 bit Ubuntu AMIs) because you should take about two to three hours to compile. If you use a t1.micro instance or one of the m1.small instances, or their counterparts for 64-bit Ubuntu AMIs, compiling the kernel will take a whole lot longer - in some case, due to resource throttling on the t1.micro instances, you may leave your kernel compiling overnight and it may still not be done in the morning. Also, you will need to download a key pair to use to SSH into the instance. I use PuTTY, and there are many tutorials on how to convert the AWS key pair to one that PuTTY can use. (Hint: use puttygen.)
- Once you SSH into the instance, login as "ubuntu". At this point, you will need to install (
apt-get install) a number of useful packages like
git. (Hint: Don't forget git.)
- Create a directory somewhere on the instance - I prefer to use
/mnt/datasince it's really easy to fill up the / file system during the kernel compile process. Change to this directory, and follow the instructions on the MPTCP server (i.e., use git to download the MPTCP source).
- At this point, you may find this Xen wiki page handy. Skip down to the sections on building the kernel and updating the modules. In particular, you will need to grab the file
/boot/config-3.0.0-13-virtualand copy this into
.config. Then, run
make oldconfig- you might have to say no to one thing that's very minor. Using the existing kernel config will guarantee that your instance will boot properly later. Afterwards, run
make menuconfigand configure MPTCP support appropriately.
- Follow the rest of the instructions in the Xen wiki page from step 5. In other words, assuming you are root (just use sudo otherwise):
fakeroot make-kpkg --initrd --append-to-version=-mptcp kernel-image kernel-headers(Note that the value for concurrency level should be number of cores + 1. Same thing for the value of the -j argument on make.) Then install the linux kernel image .deb package in /mnt/data using dpkg -i.
- Lastly, you will need to modify two files: /boot/grub/menu.lst. I recommend adding a fallback kernel ("fallback 1" option after "default 0"). Then, add an entry for the new kernel right above the entry for the existing one (towards the bottom of this file). Make sure you use the same root=, ro, and console= arguments for the kernel.
- Modify the /etc/modules file as noted in the Xen wiki page from step 5.
- Do not touch anything in /etc/fstab.
- At this point you can take a snapshot of the EBS volume attached to your running instance using the AWS console. Then, register the snapshot to create a brand new AMI. You can boot this AMI using one of the AKIs on the Web page (Use this Web page rather than the Amazon PDF instructions floating around the Web - this Web page is much newer than the PDF.) Make sure that you select the correct data center where your running instance is located, whether your instance is i386 (32 bit) or x86_64 (64 bit). You want to select an hd0 image, version 1.02. For example, if I am compiling in the Northern Virginia data centers (just down the road from my house), I would select aki-805ea7e9 for a 32-bit Ubuntu AMI and aki-825ea7eb for a 64-bit Ubuntu AMI.
- Launch a new instance based on your custom AMI. Then, try to SSH in. To verify that MPTCP is installed, you can do "dmesg | grep coupled". You should see a message that says something like "TCP coupled registered".