weblog d’un abbe


HOTD: Tweaking colo

Filed under: Fun — Tags: , , , , — abbe @ 0149

Yesterday in the afternoon, I was pointed to the ServerTweak.com page by a good friend Tarun Dua showing me how quickly a 32 MiB file gets downloaded on his n Mbps connection (n <= 4, I don’t remember the actual value). I also tried taking their Speed Test: 32 MB File Test where you’ve to download a 32 MiB file from their servers. On my near 256 Kbps internet connection the file got downloaded in 1-2s. I’m surprised, then I suspected file being transferred is in a highly compressed fashion, so to confirm this I executed following:

└─(01:32:%)── hexdump -C Desktop/32mb.test.file.zip              ──(Wed,Sep17)─┘
00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

The file is all zeroes, so this means the file is transferred with Content-Encoding HTTP header set to gzip.

└─(01:32:%)── telnet www.servertweak.com 80                      ──(Wed,Sep17)─┘
Connected to www.servertweak.com.
Escape character is '^]'.
GET /vip/dl.php?type=d&id=2 HTTP/1.1
Host: www.servertweak.com
Accept-Encoding: gzip
Connection: Close

HTTP/1.1 200 OK
Date: Tue, 16 Sep 2008 19:52:07 GMT
Server: Apache/2
Set-Cookie: PHPSESSID=03bf09c9c457814a9268896659c99257; path=/
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Cache-Control: must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Last-Modified: Tue, 16 Sep 2008 19:52:20 GMT
Cache-Control: private
Content-Disposition: attachment; filename="32mb.test.file.zip"
Content-Transfer-Encoding: binary
Content-Length: 33554432
Content-Encoding: gzip
Vary: Accept-Encoding,User-Agent
Connection: close
Content-Type: application/octet-stream

 �m7��w��       ���(
��      ���(
��      ���(
��      ���(
��      ���(
��      ���(
��      ���(
��      ���(
��      ���(
��      ���(
��      ���(
��      ���(
��      ���(
��      ���(
��      ���(
��      ���(
�EEYConnection closed by foreign host.

The time it took is 2-3 seconds. And I don’t think this is unintentional, as this download is listed in the section titled Fastest Fiber Network. Anyways, that was marked as the humor of the day, since if you try to download the file using wget, curl or fetch, then you’ll figure out their real speeds :P. Happy loling…:-D


Spoofing on Internet

Filed under: Fun — Tags: , , , , , , — abbe @ 2058

Feeling lazy to type it all again, so copy pasting:

Hi all,

For those who are not able to afford a fat pipe connection, and
depending on multiple small pipes, there is a good news. Now, they can
bond multiple ethernet links from Airtel and from some other ISP (e.g.
WTOM). By bonding I mean, being able to route outgoing packets from
WTOM's IP address via Airtel's link, and probably vice versa (not
tested other way round).

To verify this, try following:

1. Make sure both your ethernet links from different ISPs are
connected to a single interface on your router, i.e. using a network

2. Now, assign addresses from both ISPs to the single interface:

- ---->8---->8----
abbe [~] chateau % /sbin/ifconfig fxp0
fxp0      Link encap:Ethernet  HWaddr 00:13:20:B7:55:0A
         inet addr:  Bcast:  Mask:
         inet6 addr: 2001:db8:3151::1/48 Scope:Global
         inet6 addr: fe80::213:20ff:feb7:550a/64 Scope:Link
         RX packets:67542 errors:0 dropped:0 overruns:0 frame:0
         TX packets:67029 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000
         RX bytes:43453983 (41.4 Mb)  TX bytes:35309688 (33.6 Mb)

abbe [~] chateau % /sbin/ifconfig fxp0:0
fxp0:0    Link encap:Ethernet  HWaddr 00:13:20:B7:55:0A
         inet addr:aaa.bbb.ccc.ddd  Bcast:  Mask:
- ----8<----88---->8----
abbe [~] chateau % route add default gw
- ----8<----88---->8----
# iptables -t nat -n -v -L  POSTROUTING
Chain POSTROUTING (policy ACCEPT 178 packets, 12630 bytes)
 pkts bytes target     prot opt in     out     source               destination
 832 62349 MASQUERADE  all  --  *      ppp_1_32_1
- ----8<----88---->8----
abbe [~] chateau % curl --interface aaa.bbb.ccc.ddd http://checkip.dyndns.org
Current IP CheckCurrent IP Address: aaa.bbb.ccc.ddd
- ----8<----8<----

Okay, in case if you mistakenly added some other address, instead of
WTOM's provided address to 'fxp0', don't worry, your packets are still
reaching their destination, it is just that the address you provided
doesn't route back to you, so you aren't getting any replies.

I tested this working not only Airtel's AS, but also in couple of
other AS'es also. Except commands there is nothing involved in this
post, which specific to GNU/Linux, so you can use your BSD box to bond

Happy spoofing on public internet :)

Ashish Shukla

Create a free website or blog at WordPress.com.