ComputerNetworks mod4HTTP2smtp Q1 Etext2
ComputerNetworks mod4HTTP2smtp Q1 Etext2
ComputerNetworks mod4HTTP2smtp Q1 Etext2
Quadrant 1 – e-text
In our top-down approach to understanding network protocols, we have started with HTTP,
one of the most widely used application layer protocol. We will continue with some of the
interesting features that have made HTTP scale and survive over two and a half decades.
We will then look at another protocol, SMTP, used in another very common application,
namely, e-mail.
The objectives for this module are as follows.
Learning Objectives
• To understand support for cookies & caching in HTTP
• To understand the basic protocol used for e-mail
– SMTP
Cookies are used for many purposes. A website could use it for authentication. If a user is
logged into a secure area of the website, the login information (rather information related
to login) can be kept in a cookie. The browser can send this information automatically to
the site whenever it is accessed, so that the user need not enter this information again and
again when accessing the site.
It can be used to keep track of sessions - "session cookies" as they are called. These can
be used to keep track of the various page activities performed by a user so that the user
can take off from where he left previously.
It can be used by e-commerce websites to keep track of users purchases with shopping
carts. The user may not choose all that he/she wants to buy in one visit to the web-site.
So, a cookie may be used to track the items being added to the cart over multiple visits to
the site.
Cookies are also used by ad-sites to track user preferences and behavior. Similarly, many
websites allow users to customize the presentation or layout of the page. Such
preferences can be remembered with the help of cookies.
While there are many such uses, there is also a downside to use of cookies that the user
should be aware of. Cookies can be a source of security and privacy concerns. Since
cookies keep track of behavior about various websites, they can be used as some form of
spy-ware. They are not malicious as viruses (they do not execute code), but they can leak
a lot of information about the users web-behavior and interaction.
Figure 4.3 Web caching example (a) Without web cache (b) with web cache
(a) Without web cache :
Data rate required for object retrieval per node = 15 * 100kbps = 1.5 Mbps
LAN utilization = 1.5 Mbps / 1Gbps = 15%
Access link utilization = 1.5 Mbps / 1.54 Mbps = 99%
Total delay = Internet delay + access delay + LAN delay = 2 sec + minutes +
usecs
Even a single request can clog the access link. Only one request can be processed by the
access link per second. So the access delay could run to minutes depending on the
number of clients. Even with 10 clients (with 15 requests/sec/client), it can take up to 150
secs (2 and a half minutes) of waiting time. So, delays would be high for about 100 clients.
One solution to this would be to use a higher bandwidth access link, but that would be an
expensive solution.
(b) Instead, if we use a proxy server (web cache) at the edge of the institutional
network, let us look at how the total delay can be decreased. Assume that we have
a hit rate of 40% in the proxy’s cache. That is, 40% of the requests are server by
the cache, and 60% have to go to the origin server.
Access Link utilization
60% of requests use access link
Data rate to browsers over access link = 0.6*1.50 Mbps = .9 Mbps
Access Link utilization = 0.9/1.54 = .58
Total delay
Total delay = 0.6 * (delay from origin servers) + 0.4 * (delay when satisfied at
cache)
= 0.6 (2.01) + 0.4 (~msecs)
= ~ 1.2 secs
We can see from this example, that use of cache gives a significant improvement in
performance even for a 40% hit rate. Another advantage of using cache is that the load
at the server is also reduced.
Hence, caching and proxy servers are regularly deployed by most institutions, and ISPs at
various levels. Taking this cache idea further, there are many web caches that are
employed at many places in the network, which work in a cooperative fashion. With
cooperating caches, the clients first check with these caches, caches talk to each other
and try to service the request, thereby reducing the number of requests going to the origin
server.
It is interesting to note that the web caches act as both a server and a client. They act as
servers if the object is available in the cache. If it is not in the cache, it acts as a client to
contact another cache or the origin server. Another advantage of web caches is that the
Internet dense with caches enables even “poor” content providers to effectively deliver
content.
4.3 Electronic Mail - SMTP
The next application we consider is email and the Simple Mail Transfer Protocol (SMTP)
used by this application. As the name says, it is a simple protocol where messages -
commands and responses - are exchanged by mail servers. User agents facilitate access
to the mail servers. Thus, an email application has three components (Fig. 4.4).
• User agents
• Mail servers, and the
• Simple mail transfer protocol: SMTP.
In addition to these, there are a set of protocols used by the user agents to interact with
the servers. User agents send mail messages to the servers using SMTP, and receive or
retrieve the messages from the servers using protocols such as POP3 or IMAP. We will
look at the details of these protocols later.
S: 220 hamburger.edu
C: HELO crepes.fr
S: 250 Hello crepes.fr, pleased to meet you
C: MAIL FROM: <alice@crepes.fr>
S: 250 alice@crepes.fr... Sender ok
C: RCPT TO: <bob@hamburger.edu>
S: 250 bob@hamburger.edu ... Recipient ok
C: DATA
S: 354 Enter mail, end with "." on a line by itself
C: Do you like ketchup?
C: How about pickles?
C: .
S: 250 Message accepted for delivery
C: QUIT
S: 221 hamburger.edu closing connection
Command Explanation
The SMTP server may not implement (or allow) some commands. If so, it returns a "502"
response: 502 5.5.1 Command not implemented: "SOML".
References
1. Computer Networking: A Top Down Approach Featuring the Internet, 6th edition.
Jim Kurose, Keith Ross
Addison-Wesley, 2012.
2. Computer Networks: A systems Approach, 5th edition, David Peterson, Davie,
Morgan Kauffman, 2012.