Beginner Ethernet Shield V1.1

Hi

i am also new to Ethernet Shield. I am doing Home Automation Project where i will be controlling LED's using web server. Even tho i have got the code for controlling LED's i can't understand how the code works. Here is the code.
#include <SPI.h>
#include <Client.h>
#include <Ethernet.h>
#include <Server.h>
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //physical mac address
byte ip[] = { 192, 168, 1,2 }; // ip in lan
byte gateway[] = { 192, 168, 0, 1 }; // internet access via router
byte subnet[] = { 255, 255, 255, 0 }; //subnet mask
Server server(80); //server port
byte sampledata=50; //some sample data - outputs 2 (ascii = 50 DEC)
int ledPin = 13; // LED pin
char link[]="http://www.scienceprog.com/"; //link data
String readString = String(30); //string for fetching data from address
boolean LEDON = false; //LED status flag
void setup(){
//start Ethernet
Ethernet.begin(mac, ip, gateway, subnet);
//Set pin 4 to output
pinMode(ledPin, OUTPUT);
//enable serial datada print
Serial.begin(9600);
}
void loop(){
// Create a client connection
Client client = server.available();
if (client) {
while (client.connected()) {
if (client.available()) {
char c = client.read();
//read char by char HTTP request
if (readString.length() < 100)
{
//store characters to string
readString += c; //replaces readString.append(c);
}
//output chars to serial port
Serial.print(c);
//if HTTP request has ended
if (c == '\n') {
//dirty skip of "GET /favicon.ico HTTP/1.1"
if (readString.indexOf("?") <0)
{
//skip everything
}
else
//lets check if LED should be lighted
if(readString.indexOf("L=1") >0)//replaces if(readString.contains("L=1"))
{
//led has to be turned ON
digitalWrite(ledPin, HIGH); // set the LED on
LEDON = true;
}else{
//led has to be turned OFF
digitalWrite(ledPin, LOW); // set the LED OFF
LEDON = false;
}
// now output HTML data starting with standart header
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println();
//set background to yellow
client.print("");
//send first heading
client.println("

HTTP test routines

");
client.println("
");
client.println("
");
//output some sample data to browser
client.println("Sample data: ");
client.print(sampledata);//lets output some data
client.println("
");//some space between lines
client.println("
");
//drawing simple table
client.println("Simple table: ");
client.println("
");
client.println("");
client.println("
row 1, cell 1 row 1, cell 2
row 2, cell 1 row 2, cell 2
");
client.println("
");
client.println("
");
//printing some link
client.println("Link: ");
client.print("Visit Scienceprog!");
client.println("
");
client.println("
");
//controlling led via checkbox
client.println("

LED control

");
//address will look like http://192.168.1.110/?L=1 when submited
if (LEDON)
client.println("LED
");
else
client.println("LED
");
client.println("
");
//printing LED status
client.print("LED status: ");
if (LEDON)
client.println("ON");
else
client.println("OFF");
client.println("
");
client.println("
");
client.println("");
//clearing string for next read
readString="";
//stopping client
client.stop();
}
}
}
}
}

Could you please explain me how the code works. Or could you teach me step by step process of how to work with Ethernet Shield? I understand how to setup the ip address. Just teach me about client and server and how to communicate.

Thanks in advance !!!!!!!!