Neither Rain, Nor Sleet, Nor Dark of Night: E-Mail


The United States Postal Service (USPS) promises to consistently deliver mail, no matter what's going on with the weather. Although e-mail services make no such promise, they have become equally as important. In fact, I know a lot of people who get nervous when they can't get to their e-mail for just a few minutes!

E-mail works a lot like paper mail with the postal service (otherwise known as snail mail). You can write a letter on paper and put it in an envelope. If you put a correct name and address on the front of the envelope and put it in a mailbox, you can reasonably expect the postal service to deliver the mail to the right place. If you put a return address on the envelope, the recipient can reply by putting your address on the front of the envelope.

For those of you who might not have used e-mail before, it allows you to do basically the same thing, but without the paper. E-mail allows you to type some text, identify to whom you want to send the text by putting that person's e-mail address at the top of the e-mail, and send the e-mail. By sending the e-mail, you do the equivalent of giving the e-mail to the postal service. The service delivers the e-mail, and the next time your friend checks his e-mail, he receives the message that you sent.

Each e-mail includes the text you typed, the recipient's e-mail address, and your e-mail address. Because the recipient now knows your e-mail address, he can easily respond to your e-mail. E-mail also enables you to send a message to multiple recipients at once.

Dropping Off and Getting Your (e)Mail

If you live in a house or apartment, a postal worker typically comes by your place every working day. He leaves your mail in your mailbox. He also picks up any outgoing mail that you left either in your mailbox or in a centralized post office box (PO box) that was set up just for outgoing mail. Figure 8-1 shows the general idea.

Figure 8-1. Postal Worker Picking Up and Dropping Off the Mail


After the postal worker has picked up your mail, he brings it back to the local post office. Eventually, your letter gets to the post office near your friend to whom you are sending the letter. At that point, the local postal worker at the destination puts the letter in the PO box at your friend's place, where he can pick up the letter when he gets home.

Simple and unsurprising, right? Well, e-mail works similarly. If you were to create and send an e-mail to your friend, your PC would not actually send the e-mail to your friend's PC. Instead, you would send the message to your e-mail server, which is the equivalent of dropping off a letter at the local post office. Your e-mail server would send the e-mail to your friend's e-mail server, which is the equivalent of the postal service delivering a paper letter to the post office near your friend. Then, at some point in the future, your friend would check her e-mail and retrieve the e-mail from her local e-mail server, which is the equivalent of retrieving her paper mail from her PO box. Figure 8-2 shows the same basic flow as snail mail, but instead now for e-mail, with Keith sending an e-mail to the sales department at fredsco.com (sales@fredsco.com).

Figure 8-2. Sending E-Mail Using E-Mail Servers


Although not exactly like the postal service, the same general ideas apply. Each company has one (or more) e-mail servers, acting as local post offices. Also, Internet service providers (ISPs) have one (or more) e-mail servers. If you use e-mail from your corporation's enterprise network, you typically use your company's e-mail servers to drop off and pick up e-mail. If you connect to an ISP from home, you would use that ISP's e-mail servers to drop off and pick up e-mail.

Postal Address Versus E-Mail Address

To send snail mail, you need to put the recipient's name and address on the front of the letter. The postal service then delivers the letter to the correct address. Similarly, to send an e-mail, you need to put the recipient's e-mail address on the e-mail. An e-mail address identifies the individual user who should receive the e-mail, allowing the e-mail servers to deliver the mail to the right person.

E-mail addresses have two parts: the name of the e-mail user and the name of the e-mail server. The name of the user sits before the @ sign, and the name of the server sits after the @ sign. For example:

tweedledee@fredsco.com

Figure 8-3 shows why a two-part e-mail address is useful. Both Keith and Conner send an e-mail to different people inside Fredsco. The text following the figure explains how the e-mail address helps in delivering the e-mail.

Figure 8-3. How a Two-Part E-Mail Address Is Used


Note that the e-mail software on Keith's and Conner's PCs do not think about the address at all. The PCs always send their e-mails to their respective local e-mail server. In real life, when you send a paper letter, you probably give the letter to the post office by putting it in the mailbox at the end of your driveway, bringing it to the post office, or dropping it off in a mailbox set up to receive letters. In any case, you probably give your outgoing letters to the post office in pretty much the same way every time you send a letter. With e-mail, the e-mail software on your PC sends the outgoing e-mail to the same e-mail server every time as well, regardless of who the recipient is.

After Keith and Conner's e-mail servers have their respective e-mails, the servers look at the name after the @ sign, but they ignore the name before the @ sign. Their goal is to deliver the e-mail to the e-mail server at Fredsco, and the part after the @ identifies that e-mail server. It's much like how your local post office just looks at the city and state on a letter you give them, or they just look at the zip code, to figure out to which post office to send the letter. The local post office doesn't care about the name of the person on the letter or the street address; it just wants to send the letter to a post office near the recipient.

The ISP1 and ISP2 e-mail servers know how to find the e-mail server for fredsco.com because they ask another type of server called a Domain Name System (DNS) server. The DNS server tells the e-mail servers how to find the other e-mail servers. Chapter 13, "People Like Names, but Computers Like Numbers," covers the details about DNS servers. For now, just know that they can indeed find other e-mail servers easily.

Finally, after the Fredsco e-mail server gets the e-mails, it holds the e-mail, waiting on the users to check the mail. When the person who uses the sales@fredsco.com account checks his e-mail, the Fredsco e-mail server must check the entire e-mail address of all e-mail it is holding for delivery. The e-mails with username sales get delivered to that PC. Likewise, when user fred checks his e-mail, Fredsco's e-mail server delivers the mail to Fred.

Rules, Schmools: Even More Rules?

Now that you have the general idea of how e-mail works, you should know about a few of the protocols and standards for e-mail. First, Table 8-1 lists the standards. Afterward, I'll explain a little about each.

Table 8-1. TCP/IP E-Mail Standards

Standard

RFC

Description

Internet Message Format

2822

Defines the headers used to encapsulate the e-mail text, including the sender and receiver e-mail addresses

Simple Mail Transport Protocol (SMTP)

2821

Defines protocols for transmitting and receiving e-mails

Post Office Protocol Version 3 (POP3)

1939

Defines protocols for a client to retrieve e-mail from a server


note

TCP/IP includes thousands of different protocols and standards, which are defined in documents called Requests for Comments (RFCs). Table 8-1 lists the common names for three of the protocols, along with their RFC numbers. You can go to the Internet Engineering Task Force (IETF) website at http://www.ietf.org/rfc.html using a web browser if you would like to read more about these or other RFCs.


The protocols shown in Table 8-1 happen to be application layer protocols according to the TCP/IP model. Interestingly, there is an important distinction here between the application itself and the application layer protocol. Figure 8-4 provides a good backdrop to discuss the concept.

Figure 8-4. E-Mail Client Application and Its Use of Application Layer Protocols


A user uses e-mail client software to generate, send, receive, and read e-mails. The e-mail client must do work that has nothing to do with communication. It must have a user interface, accept text typed from the keyboard, understand what a user clicks on the screen, store e-mails on the computer hard disk, and so on. None of those tasks requires a network.

The e-mail client also needs to use the network. To do so, the people who wrote the e-mail client software had to read, understand, and implement e-mail TCP/IP protocols in the e-mail client software. So, the e-mail client application is not the same thing as the application layer protocol; rather, to communicate, the e-mail client must implement the correct application layer e-mail protocols.

Protocols for Addressing the Envelope Correctly: Internet Message Formats

When an e-mail client sends an e-mail and the e-mail servers forward it, they not only send the text of the e-mail message, but also a header. The header contains several fields, including the recipient's and sender's e-mail addresses, as shown in Figure 8-5.

Figure 8-5. Sampling of the E-Mail Header Defined by RFC 2822


RFC 2822, "Internet Message Formats," defines the, well, uh, format of Internet e-mail messages. Yes, the name is a bit self-defining. RFC 2822 defines the header fields shown in Figure 8-5, and many more, so that all the clients and servers know where to find all the information needed to forward the e-mail correctly.

The KISS Principle and SMTP

The KISS principle refers to a wise adage to Keep It Simple, Stupid. Much of what you do every day might be better done if you make it uncomplicated. One of the most popular e-mail protocols also tries to keep things simple: Simple Mail Transfer Protocol, or SMTP.

E-mail clients and servers use SMTP protocols to manage the process of sending and receiving e-mail. As it turns out, instead of just sending an e-mail with the correct RFC 2822 header around it, the e-mail clients and servers need to talk about it first. For instance, a client should identify itself to the server before sending an e-mail. Also, the sender of the e-mail should identify the recipient before sending the e-mail; that way, if the next client/server in the path cannot deliver the e-mail, you do not waste time forwarding the e-mail. Figure 8-6 outlines the process.

Figure 8-6. Simple SMTP Messages: Identifying the Client and the Recipient


The SMTP protocol defines messages so that the e-mail clients and servers can manage the e-mail forwarding process. The Extended Hello (EHLO) command identifies the client. The Mail command tells the server that the client wants to either send or receive e-mail. The RCPT (short for recipient) identifies the, well, uh, recipient of the e-mail that is about to be sent. After the server replies with an acknowledgement (ACK) message to each of these first three commands, the e-mail can be transmitted.

Note that when any of the devices actually sends the e-mail, that message conforms to the Internet Message Format (RFC 2822) specifications for the contents of the header and text. The SMTP RFC (RFC 2821) defines the messages that control the process with SMTP, such as EHLO and MAIL.

What to Do When You Need a Little POP in Your Network

The last e-mail protocol I'll cover here is called Post Office Protocol (POP). The current version, POP3, also allows you to transfer e-mail, like SMTP. However, POP3 was designed specifically for use between an e-mail client and its e-mail server; it cannot transfer e-mail between servers.

Yes, POP3 essentially lets you do a subset of the functions of SMTP. So, why bother with another protocol when SMTP already allows clients to get their e-mail? Well, POP3 allows for several options for authentication, as well as some other useful features for e-mail clientsfeatures that are not included in SMTP.

One of POP3's better features is authentication. Authentication refers to the process of one device identifying itself to another device via a name and a password. The other device then decides whether the first device is allowed access. For instance, if you have an e-mail account through your ISP, at some point you were given an e-mail address and password. When you check your e-mail, if you use POP3 (and you probably do), your e-mail client identifies itself and provides a password. The e-mail server decides if you should be allowed to get the e-mail. Figure 8-7 outlines the process with POP3.

Figure 8-7. Basic Authentication with POP3


As you can see in the figure, Conner sends both a username and a password to the server. The server checks its list of usernames and passwords and finds a match. So, the server tells the client "OK," meaning that the server is ready to start forwarding e-mails to the client. POP3 also tells the user how many e-mails are waiting for him. To get the e-mails, the client asks for the e-mails, one at a time, as shown in the figure.

SMTP and POP3 Working Together

Often, networks use both SMTP and POP3. Clients use POP3 to get e-mail from their server, but they use SMTP to send e-mail. Servers use SMTP to forward e-mail to other servers. Figure 8-8 depicts the general flow.

Figure 8-8. Typical Usage of SMTP and POP3


A couple of important facts show up in the figure. POP3 is used only to pull the e-mail from the server. Also, note that the e-mail servers are labeled as SMTP server and POP3 server. So far, I have simply referred to an e-mail server generically. In practice, to perform SMTP, you need server software that understands SMTP, and that software is cleverly called SMTP server software. So, for all this to work, the servers need to have SMTP server software running. Similarly, to allow a client to retrieve mail, the server hardware must be running POP3 server software in addition to the SMTP server software. In effect, a single computer needs to run both servers.

The SMTP server and the POP3 server on the same computer store and retrieve e-mails from the same message storage location. For instance, in Figure 8-8, the Fredsco e-mail server received an e-mail using the SMTP server, storing it on the disk drive. Later, when the person using the sales@fredsco.com account checked his e-mail using POP3, the POP3 server, on that same computer, retrieved the e-mail, forwarding it to the client.

Well, at this point, you probably know more than you ever wanted to know about e-mail! Just like with the postal service, as a user, all you need to know is that you send the mail, and it gets there. Now that you are armed with a few more details, you can certainly have a more intelligent conversation about e-mail.




Computer Networking first-step
Computer Networking First-Step
ISBN: 1587201011
EAN: 2147483647
Year: 2004
Pages: 173
Authors: Wendell Odom

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net