Settlement & clearing

How are F&O trades settled? What are NSDL and CDSL? What are pay-in and pay-out? What happens if I sell shares before they are delivered to my demat account? What is a clearing corporation? What is a Depository Participant (DP)? What is a settlement holiday? What is an auction settlement? What is early pay-in?