Intro to Socket basics

client.c

server.c

httpClient.c

SMTP client:

-bash-3.2$ telnet newman.eecs.umich.edu 25

Trying 141.212.113.18...

Connected to newman.eecs.umich.edu.

Escape character is '^]'.

220 newman.eecs.umich.edu ESMTP Sendmail 8.14.3/8.14.2; Fri, 8 Jan 2010 14:13:46 -0500

helo Z

250 newman.eecs.umich.edu Hello [141.212.202.75], pleased to meet you

mail from:<someone@umich.edu>

250 2.1.0 <someone@umich.edu>... Sender ok

rcpt to:<zhiyunq@eecs.umich.edu>

250 2.1.5 <zhiyunq@eecs.umich.edu>... Recipient ok

data

354 Enter mail, end with "." on a line by itself

helo, this is a test.

.

250 2.0.0 o08JDkHp008049 Message accepted for delivery



Here "helo Z" can be replaced to "helo [your machine's DNS name or IP address]" which conforms to the RFC specification. Some server may reject your email if you do not follow this rule.

"mail from:<someone@umich.edu>" can be replaced with "mail from:<ANY EMAIL ADDRESS>". This is a known problem with SMTP protocol. Most servers nowadays have some mechanisms to protect against it, but clearly this server does not.

"rcpt to:<zhiyunq@eecs.umich.edu>" can be replaced with "rcpt to:<ANYONE@eecs.umich.edu>". It has to be @eecs.umich.edu because newman.eecs.umich.edu is the mail server serving only accounts with @eecs.umich.edu.

Please do not abuse it, e.g. send me spam messages :)

DNS lookup program:

-bash-3.2$ dig www.google.com

;; QUESTION SECTION:

;www.google.com. IN A

;; ANSWER SECTION:

www.google.com. 241754 IN CNAME www.l.google.com.

www.l.google.com. 65 IN A 209.85.225.103

www.l.google.com. 65 IN A 209.85.225.99

www.l.google.com. 65 IN A 209.85.225.147

www.l.google.com. 65 IN A 209.85.225.105

www.l.google.com. 65 IN A 209.85.225.104

www.l.google.com. 65 IN A 209.85.225.106 dig is a built-in command line tool on *nix platform. Check "man dig" for the manual page.

Wireshark packets capture program:

Wireshark Homepage It's a very useful tool that helps learn computer network a lot.