DNS    

Email    


Application Layer



7.1 DNS

Recall IP addresses.

A global list of sites

Each site could keep a list of all sites on the network (or have access to such a list).
BITNET kept such a list, of thousands of international sites.
ARPANET did this at first, too.


A decentralised list - DNS

DNS - Domain Name System

The Internet has long since grown too big to keep a list of all sites anywhere, let alone have one at each site. This means sites do not know a priori if an email address or web site name is valid. They must go out on the net and find out.

The upside is that each subzone of the net can develop rapidly, without having to tell everyone else what it is doing. Say the University of MIT is responsible for all addresses:

  *.mit.edu
It is assigned a segment of the numerical address space:
  106.132.*.*
and can assign and reassign names to this as it likes. i.e. It doesn't need permission to add new machines to the Internet, nor does it need to publicise those machines. Other sites find out about these machines if and when they need to (which may be never). When given the name of a machine:
  jimmy6.chemistry.mit.edu
they talk to the DNS server for .edu, which gives them the name of the DNS server for .mit.edu, which gives them the real address of the site (or says "invalid site").

You don't clutter up your site with info about other sites, 90 percent of which you will never actually need to know about. You don't have 90 % of Internet traffic being the announcements of new sites. Also the Internet can expand very fast, as each subzone can build and rebuild its own topology as it pleases. Don't even need to report how much of that address space is used.

Can set up "virtual machines" distributed over many real machines (e.g. "www.yahoo.com" is not 1 machine, but a "farm" of machines).
Can set up multiple aliases for same machine ("site.com" = "www.site.com" = "ftp.site.com"), etc.

DNS so important / done so often that there are duplicate DNS servers, caches of remote information, etc. (without going as far as the complete cache of all sites on the net).

DNS uses UDP (not TCP) for address lookups.


7.1.2 Aliases

Lookup our web server:
www.computing.dcu.ie and:
www.compapp.dcu.ie
and you find:
www.computing.dcu.ie = 
www.compapp.dcu.ie = 
elbrus.computing.dcu.ie = 
elbrus.compapp.dcu.ie = 
136.206.11.240
These are all the same machine.
Recall Different forms of URL.



7.2 Email


SMTP

Message transfer agents - Move email across the network.

Source machine establishes TCP socket connection to port 25 on destination machine.



Sample SMTP conversation delivering an email from client C to server S.
Try these out:
$ telnet mail.dcu.ie 25

$ telnet mailhost.computing.dcu.ie 25
help
214-2.0.0 This is sendmail version 8.12.10
214-2.0.0 Topics:
214-2.0.0       HELO    EHLO    MAIL    RCPT    DATA
214-2.0.0       RSET    NOOP    QUIT    HELP    VRFY
214-2.0.0       EXPN    VERB    ETRN    DSN     AUTH
214-2.0.0       STARTTLS

You may not be able to either read or send email though. See following:



Email protocol security

You may find: Why?

Why don't ISPs have this problem?

Solution:


Email headers



Basic email header fields.
Message consists of:
Header fields
(blank line)
Message body


Other email header fields.
Applications can invent their own. Must begin with X-.
e.g. X-Spam-Status:


MIME

MIME encoding for binary data to be sent by email (designed for text data).
Encodes it as simple plain text 7-bit ASCII chars.

base64 encoding: For binary attachments.
Can encode any binary stream whatsoever as (a really safe subset of) 7-bit ASCII.
"The resultant base64-encoded data has a length that is approximately 33% greater than the original data"

Content-Type: application/msword; name="Postgrad_Prospectus_Research.doc";
 x-mac-type="42494E41"; x-mac-creator="4D535744"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="Postgrad_Prospectus_Research.doc"

0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAABAAAATwAAAAAAAAAA
EAAAUQAAAAEAAAD+////AAAAAE4AAAD/////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////s
pcEATSAJBAAA8BK/AAAAAAAAEAAAAAAABAAAKzIAAA4AYmpiauI94j0AAAAAAAAAAAAAAAAAAAAA
AAAJBBYAIlAAAIBXAACAVwAARywAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//w8AAAAA
AAAAAAD//w8AAAAAAAAAAAD//w8AAAAAAAAAAAAAAAAAAAAAAGwAAAAAAMYBAAAAAAAAxgEAAMYB
AAAAAAAAxgEAAAAAAADGAQAAAAAAAMYBAAAAAAAAxgEAABQAAAAAAAAAAAAAANoBAAAAAAAAshcA
AAAAAACyFwAAAAAAALIXAAAAAAAAshcAABwAAADOFwAAVAAAANoBAAAAAAAAqyQAAIoBAAAuGAAA
....

Quoted-printable encoding: For basically plaintext with 8-bit ASCII chars.
Encodes everything as 7-bit ASCII. The 8-bit chars are encoded as: "=nn".
"=" itself encoded as "=3D".

I have had several enquiries =
regarding=20
IEEE Xplore (full-text access to IEEE and IEE publications) and would =
like to=20
inform you of some recent developments. As part of the<A=20
href=3D"http://www.library.dcu.ie/news/index.htm#HES"> IReL</A> =
initiative (funded=20
by SFI and HEA) to provide increased access to e-journals, negotiations =
for IEEE=20
Xplore are at an advanced stage.


MIME headers.


MIME content types.

HTTP uses these too.



POP3

User agents - Clients. Read and send email.

Often, one is not logged directly onto mailhost.computing.dcu.ie
or mail.dcu.ie
or whatever machine receives your email when you are offline, such as: mailhost.isp.com
One is on another machine, or at home on dialup, for example.



(a) Email when you are permanently on the network.
(b) Email when you are not permanently on the network.

POP3 commands

POP3 client sets up TCP connection to the mail server at port 110.


Sample POP3 conversation to retrieve 3 email messages.
You can retrieve and then delete from server. Or retrieve and leave on server.


IMAP



Email filters