Assignment 2 HT2018
Assignment 2 HT2018
Introduction
Today’s Internet is arguably the largest engineered system ever created by mankind, with millions of
communication links and connected computers with billions of users. Internet as an infrastructure
that provide services to applications. The applications are said to be distributed applications, since
they involve multiple end-systems that exchange data with each other. All data exchanges in
Internet applications that involve two or more communicating remote entities is governed by a
protocol. The Internet and computer networks in general make extensive use of protocols. Protocols
are running everywhere in the Internet. Different protocols are used to accomplish different
communication tasks. As Internet application developers, you need to have good knowledge of
Internet protocols. The objective of the lab assignment is to provide you with an understanding of
Internet protocols. After you have completed this assignment you should be able to identify and
analyze some of the Internet protocols and services.
Literature
In addition to the course book (chapter 3 and chapter 4), you can read about the protocols used
during the laboratory assignments on multiple sites.
The TCP/IP Guide (http://www.tcpipguide.com/free/index.htm) by Charles M. Kozierok is good, but a
relatively length source. Wikipedia in this case is a good source to start with a short introduction. You
mayse these links as a reference.
• HTTP - http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol
• TCP - http://en.wikipedia.org/wiki/Transmission_Control_Protocol
• IP - http://en.wikipedia.org/wiki/IPv4
• DNS - http://en.wikipedia.org/wiki/Domain_Name_System
• SMTP - http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol
• Mail format - http://en.wikipedia.org/wiki/Email#Message_format
Lab Assignment 1:
This assignment contains a preparatory task with question that need to be answered before
continuing on to assignment 2. Assignment 1 provides a background to what occurs during
assignment 2. Please bear this in mind.
Answer the following questions:
Protocol Layers
• Which layers are included in the TCP/IP model?
• What are the advantages and disadvantages of using a layer model?
Ports
• What is the purpose of using ports?
• In total, there are 65536 ports and one usually divides them into three areas. What are these
areas are called and what port numbers belong to which areas?
• What is the default port for HTTP?
• Which is the standard port for SMTP?
1(3)
Module 5, Laboratory Assignment
Computer Systems & Architecture, Computer networking
HTTP
• What is the purpose of the HTTP protocol?
• What response code is received from a web server if everything has gone well?
• What response code is obtained if the web server cannot find the resource that is in
demand?
• Which two response codes can you get if you do not have rights to a requested resource?
• What are the different requests can be made using HTTP?
SMTP
• What is the purpose of the SMTP protocol?
• What is the command to indicate the sender's address to SMTP?
• What is the command to enter the destination address under SMTP?
• What is the command to indicate the actual text of an e-mail to SMTP?
• Which command asks an SMTP server which extensions it supports?
• An e-mail message consists of two parts: Header and Body. Which two fields must always be
in the header? Hint: Read about the format of e-mail Internet?
DNS
• What is the purpose of DNS?
• What type of DNS resource record should you ask for if you want to know the IPv4 address
for a domain?
• What type of DNS record should you ask for if you want to know the IPv6 address for a
domain?
Lab Assignment 2:
The aim of this part is to familiarize you with some common protocols by manually using them.
“How to ask a web server a question?”
HTTP is a text-based protocol and can be ideally issued “manually” (i.e., typing commands in a
terminal), although of course it is much more common to use a browser that handles HTTP
communication on behalf of the user. In this section of the lab assignment you will communicate
with a web server using Telnet:
Telnet (https://en.wikipedia.org/wiki/Telnet) a protocol for sending data over TCP. Telnet is often
used just to test protocols that send data in clear text, such as HTTP, SMTP and POP3.
Task 2.1
Open a terminal window and connect to the web server using telnet. The web server address is
da.dsv.su.se and port is 80. If you are running a Windows Operating system, then instead of a
command prompt, use PuTTY [ http://www.chiark.greenend.org.uk/~sgtatham/putty/ ]
For more instruction about downloading and running PuTTY, watch the recorded PuTTY Tutorial.
[ https://stockholmuniversity.app.box.com/s/ork1kme0mwm55xkb82ig6j5nicbaguks ]
(Please note: do not forget to connect PuTTY in Raw mode).
2(3)
Module 5, Laboratory Assignment
Computer Systems & Architecture, Computer networking
In order to ask for resources on the below tasks ( 2.1.1 -2.1.3) from the web server (da.dsv.su.se), the
recommendation is to read the section in the slides covering Computer Networking about how a
HTTP GET request is supposed be formatted. There you will find the explicit instructions regarding
how to format an HTTP GET request.
Please note: you need to reconnect after every question because the connection is closed by the
Web server when it sent its reply.
Subtasks:
2.1.1 Ask for the resource /art.txt
2.1.2 Ask for resource /layers.html
2.1.3 Ask for resource /grades.txt
Important: In answering the questions below it is not sufficient to simply show that you have been
successful in entering the commands and obtain the correct result. This only demonstrates that you
were able to follow the instructions and will be graded accordingly. What you need to do is also
explain the meta-data received from the web server (headers) as well as the actual content. You
need to be able to distinguish between the two. This is in principle a straight-forward task. Be sure to
use the references and course literature to guide you.
3(3)