Rooting Android Galaxy S2 - Connection Error
I followed this guide rooting mine:
http://forum.xda-developers.com/showthread.php?t=1773659

I started at Step 1. HOW TO INSTALL TWRP OR CWM : ON STOCK FIRMWARE OR CUSTOM ROMS - GB, ICS AND JB 

The guide even has a section for troubleshooting Odin errors.

Be careful with odin. When you're editing your bootloader. You can brick your device if you do it wrong, and then your only option is JTAG repair, which will cost you ~$50