There is too much information to explain here, I'd recommend typing
/debug -t @debug and reconnecting to the server, this will show you the data sent between you and the server you are connecting to. If you want to read the IRC protcol you can read
RFC1459 (Internet Relay Chat Protocol). You may also want to read
RFC1413 (Identification Protocol).