CS代写 SEHH2238 : Computer Networking

Lab/Tutorial :
SEHH2238 : Computer Networking
Session 12 : Application Protocols (Solution)
1. Consider a connection between a web browser (client) and web server. The client is requesting a file with the following parameters:

Copyright By PowCoder代写 加微信 powcoder

HTTP version: 1.1
Client accepts images of types jpeg and tiff
Document location: usr/users/abc.jpg
Date/time of request: 31-Jan-2019 10:10:10 GMT
Length of document: 4096 bytes
Content Encoding: MIME-version 1.0
Server name: HKCC01
Draw the possible Request and Response sequence of the HTTP Get request.
GET /usr/users/abc HTTP/1.1
Accept: image/jpeg
Accept: image/tiff
HTTP/1.1 200 OK
(Body of the document . . .)
Date: Thu, 31-Jan-2019 10:10:13 GMT
Server: HKCC01
Content-encoding: MIME-version1.0
Content-length: 4096
With reference to your answer in Part (a),
(i) Does HTTP have any session layer features? Explain.
In the OSI reference model, the session layer is concerned with establishing, managing and terminating the connections between the local and remote application. From (a), HTTP handles the session between the client and server by negotiating the HTTP version (HTTP/1.1) being exchanged. Thus HTTP has session layer features implemented.
(ii) Does HTTP have any presentation layer features? Explain.
In the OSI reference model, the presentation layer transforms data into the form that the application accepts. This layer formats data to be sent across a network. From (a), HTTP exchanges the image data types acceptable by both the client and the server (Content-encoding: MIME-version1.0) and
SEHH2238 Computer Networking Tutorial 12 Page 1

the server send the corresponding data type accordingly. Thus HTTP also has presentation layer features implemented.
2. Consider the File Transfer Protocol (FTP).
a) FTP uses two separate port numbers for control and data connection. If the control connection was interrupted before the end of the FTP session, what would happen?
If the control connection is interrupted during a session, no more control information can be exchanged between the client control process and the server control process. Since the control connection and the data connection are two separate TCP connections, the interruption of the control connection has no effect on the current data connection. However, when the current data connection is terminated, no new data connection can be made until the control connection is again established.
b) FTP uses the services of TCP for exchanging control information and data transfer. Could FTP use the services of UDP for these two connections? Explain.
FTP requires the client and the server to be connected during the whole session. Since UDP is not a connection-oriented protocol, it cannot do this task. Also, A file to be transferred is usually too large to fit in a single user datagram (UDP packet). In addition, UDP is not a reliable transport-layer protocol; for file transfer, reliability is an important issue so that the resulting file is not corrupted. Thus UDP is not suitable for FTP’s control and data connections.
c) Can there be a pure data-transfer connection without a control connection in FTP? Explain.
No. The data-transfer connection is established with one or more commands issued from a client; there should be a control connection to allow the client to issue these commands.
3. Domain Name Service (DNS) resolves a name to an address so that applications such as web access or email can resolve to the correct hosts and retrieve the correct web pages or deliver the emails to the correct destinations. What could be the consequences if the following happens? How could such attacks be prevented?
a) The response of the DNS server is intercepted and a new bogus response is created for the user.
The user is re-directed to the site or domain the attacker wishes the user to access. This type of attack can be prevented by verifying the sender of the message (e.g. using digital certificate of the sender, encrypted password etc.) and checking the message integrity (by using message digest).
SEHH2238 Computer Networking Tutorial 12 Page 2

b) One of the DNS servers is compromised and contains incorrect records for a particular domain.
This is called DNS Poisoning. The user will again be re-directed to the attacker’s address which could contain some sort of malicious phishing website. Worse still, this incorrect information could spread around if other ISPs are getting their DNS information from the compromised server1. The solution is to require DNS records be signed using public-key cryptography (to be covered in Lecture 12) which becomes the criterium on whether a DNS record should be trusted or not.
4. Consider the DNS hierarchy below:
google.com
polyu.edu.hk
Suppose you are making DNS requests to resolve the IP addresses of polyu.edu.hk and google.com. Assume there is no caching in the DNS servers. Describe the resolution steps when using:
In both resolution approaches, if the local DNS server does not have the requested record in cache, it contacts Root directly.
a) Recursive resolution
Each DNS server issues a request.
polyu.edu.hk: YouCRootADARootCYou
( request )( reply
google.com: YouCRootBRootCYou ( request )( reply )
1 https://www.howtogeek.com/161808/htg-explains-what-is-dns-cache-poisoning/
SEHH2238 Computer Networking Tutorial 12

b) Iterativeresolution
The local DNS server (i.e. C) makes requests to other DNS servers according to the redirection one-by-one.
polyu.edu.hk:
You request C
C requests Root, Root redirects C to ask A
C requests A, A redirects C to ask D
C requests D, D replies C with the address of polyu.edu.hk C replies You with the address of polyu.edu.hk
google.com:
You request C
C requests Root, Root redirects C to ask B
C requests B, B replies C with the address of google.com C replies You with the address of google.com
SEHH2238 Computer Networking Tutorial 12 Page 4

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com