0% found this document useful (0 votes)
858 views

Assignment 2 - The Application Layer Solutions

Web caching reduces delays in receiving requested objects by storing copies of frequently accessed objects on caching servers located closer to users. When a user requests an object, the request is first checked against the cache. If a cached copy exists, it can be served faster than fetching it from the origin server. However, caching only reduces delays for objects stored in the cache. The first request for a new object still involves retrieval from the origin server.

Uploaded by

stanley umoh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
858 views

Assignment 2 - The Application Layer Solutions

Web caching reduces delays in receiving requested objects by storing copies of frequently accessed objects on caching servers located closer to users. When a user requests an object, the request is first checked against the cache. If a cached copy exists, it can be served faster than fetching it from the origin server. However, caching only reduces delays for objects stored in the cache. The first request for a new object still involves retrieval from the origin server.

Uploaded by

stanley umoh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Assignment 2 - The Application Layer Solutions

Instructor: S. U. Etienam-Umoh
Web and HTTP

1. What parameters would you use to evaluate the performance of a website?

Solution: Solution:

This includes performance, reliability, integrity, usability, accessibility, responsiveness, availability, scalability,
robustness, interoperability, security and exception handling.

2. List 10 performance optimization that can be made on the client side of webpage.

Solution:

1. Make fewer HTTP requests 13. Turn off ETags 25. Simplify CSS selectors
2. Use a CDN 14. Make AJAX cacheable and small 26. Use persistent connections
3. Add an Expires header 15. Dont block the UI thread 27. Reduce cookies
4. Gzip components 16. Split JavaScript payload 28. Avoid network congestion
5. Put CSS at the top 17. Load scripts asynchronously 29. Increase MTU, TCP window
6. Move JS to the bottom 18. Inline scripts before stylesheet 30. Avoid server congestion
7. Avoid CSS expressions 19. Write efficient JavaScript
8. Make JS and CSS external 20. Minimize uncompressed size
9. Reduce DNS lookups 21. Optimize images
10. Minify JS 22. Shard domains
11. Avoid redirects 23. Flush the document early
12. Remove duplicate scripts 24. Avoid iframes

3. What is the performance golden rule in web optimization?

Solution:

The Performance Golden Rule states that 80-90% of the end-user response time is spent on the frontend.

4. What is the default setting of Firefox for parallel downloads?

Solution:

Turned off by default

5. How would you configure your Firefox browser to download n objects in parallel?

Solution:

1. Open a new tab in Firefox


2. Put about:config into the address bar and press the Enter key on your keyboard.
3. Inside this configuration area, click on the search box and enter network.http.pipelining. Once its
entered, you should see it pop up.
4. Set network.http.pipelining to "true," by double clicking on it.
5. Set network.http.pipelining.aggressive to true
6. Set network.http.pipelining.maxrequests to n
7. Set network.http.pipelining.ssl to true

ECT 5572: Introduction to Computer Networking


6. From a performance standpoint what do you think is the best number of parallel downloads you should set
the browser?

Solution:

The consensus from most diehard Firefox fans is 8 10

7. List 5 consequences of poor frontend performance on an ecommerce website.

Solution:

Site Speed Impact:

1. Traffic
For a website that takes more than three seconds to load, 40% of visitors will abandon a website and
80% of those visitors wont return. In addition to this, 74% of mobile visitors will abandon a mobile site
that takes longer than five seconds to load.

2. Conversions
Every additional second added on to your load time results in a 7% loss in conversions. Similarly, shaving
two seconds off of Mozillas landing pages resulted in a 15.4% increase in conversions, which meant 60
million more downloads per year.

3. Engagement
A one-second delay in response time can result in 11% fewer page views and a 16% loss in customer
satisfaction. Plus, 40% of online shoppers feel that the most influential factor for them to revisit a site is
whether the website will load quickly.

4. Revenue
A 7% loss in conversion (per second) means that for a site with an annual revenue of $2 million per year,
a one second delay could cost $140,000 in revenue
46% of people who abandon their shopping cart cite slow website speed as the reason
$3 billion is lost annually from cart abandonment due solely to slow website pages
An extra second of page load time reduces per-user revenue 1.8%; two seconds reduces it by 4.3%
79% of shoppers who are dissatisfied with website performance are less likely to buy from the same site
again

5. Loyalty
52% of online shoppers state that quick page loading is important to their site loyalty

6. Brand Reputation (Brand trust and Brand loyalty)


44% of online shoppers will tell their friends about a bad experience online. That is, shoppers who
experience slow websites will spread the word by mouth, blogs and social media.

7. Poor page ranking


Site speed is used in Google Ranking Algorithm. Their experiment has shown a reduction of searches by
0.2% to 0.6% for a change that measured under 400 milliseconds. This means fewer people will find your
site.

8. Quality service
Every service disruption creates a negative impression about the company to each user, as it reduces
effectiveness, productivity and trust.

9. Innovation
Application performance problems not only impact you, but also your IT development team. The more
time the IT team spends to fix a broken application, the less it spends on thinking ahead on potential
opportunities.

ECT 5572: Introduction to Computer Networking


8. Write the HTML codes that will produce the webpage below.

Solution:

<html>
<head> <title> AMALGAMATED WIDGET, INC. </title> </head>
<body> <h1> Welcome to AWIs Home Page </h1>
<img src="http://www.widget.com/images/logo.gif" ALT="AWI Logo"> <br>
We are so happy that you have chosen to visit <b> Amalgamated Widgets</b> home page. We hope <i> you
</i> will find all the information you need here.
<p>Below we have links to information about our many fine products. You can order electronically (by
WWW), by telephone, or by email. </p>
<hr>
<h2> Product information </h2>
<ul>
<li> <a href="http://widget.com/products/big"> Big widgets </a> </li>
<li> <a href="http://widget.com/products/little"> Little widgets </a> </li>
</ul>
<h2> Contact information </h2>
<ul>
<li> By telephone: 1-800-WIDGETS </li>
<li> By email: [email protected] </li>
</ul>
</body>
</html>

9. Write the HTML codes that will produce the webpage below.

ECT 5572: Introduction to Computer Networking


Solution:

<html>
<head> <title> AWI CUSTOMER ORDERING FORM </title> </head>
<body>
<h1> Widget Order Form </h1>
<form ACTION="http://widget.com/cgi-bin/order.cgi" method=POST>
<p> Name <input name="customer" size=46> </p>
<p> Street address <input name="address" size=40> </p>
<p> City <input name="city" size=20> State <input name="state" size =4>
Country <input name="country" size=10> </p>
<p> Credit card # <input name="cardno" size=10>
Expires <input name="expires" size=4>
M/C <input name="cc" type=radio value="mastercard">
VISA <input name="cc" type=radio value="visacard"> </p>
<p> Widget size Big <input name="product" type=radio value="expensive">
Little <input name="product" type=radio value="cheap">
Ship by express courier <input name="express" type=checkbox> </p>
<p><input type=submit value="Submit order"> </p>
Thank you for ordering an AWI widget, the best widget money can buy!
</form>
</body>
</html>

10. Using a table list the differences in features between HTML 1.0, HTML 2.0, HTML 3.0, HTML 4.0 and HTML
5.0.

Solution:

Table: Some differences between HTML versions

Item HTML 1.0 HTML 2.0 HTML 3.0 HTML 4.0 HTML 5.0
Hyperlinks X X X X X
Images X X X X X
Lists X X X X X
Active maps & images X X X X
Forms X X X X
Equations X X X
Toolbars X X X
Tables X X X
Accessibility features X X
Object embedding X X
Style sheets X X
Scripting X X
Video and audio X
Inline vector graphics X
XML representation X
Background threads X
Browser storage X
Drawing canvas X

ECT 5572: Introduction to Computer Networking


11. Describe how Web caching can reduce the delay in receiving a requested object. Will Web caching reduce
the delay for all objects requested by a user or for only some of the objects? Why?

Solution:

Web caching can bring the desired content "closer" to the user, perhaps to the same LAN to which the users
host is connected. Web caching can reduce the delay for all objects, even objects that are not cached, since
caching reduces the traffic on links.

12. The purpose of this question is to give you a quick look at an Internet RFC (the technical standards for the
Internet). You are not expected to read the RFC closely or in its entirety (of course you are welcome to do so,
but this RFC is 176 pages long, and I am sure you have better ways of spending your time). Go to www.rfc-
editor.org and download RFC 2616, which specifies HTTP 1.1. There is no need to print it out. Answer the
following questions (which you can find inside the RFC).
(a) Can the HTTP version number contained in the http message have leading zeros? Where in the RFC
did you find the answer to this question?
Solution:
Leading zeros MUST be ignored by recipients and MUST NOT be sent.
You can find this on page 18 in RFC 2616.
(b) What is the difference in the meaning of the words "MUST", "SHOULD NOT" and OPTIONAL in an
Internet RFC? (Note: you will need to look at another (very short) RFC to answer this question; see
section 1.2 in RFC 2616)
Solution:
You can find the following definitions in RFC 2119
MUST: This word, or the terms "REQUIRED" or "SHALL", mean that the definition is an absolute
requirement of the specification.
SHOULD: This word, or the adjective "RECOMMENDED", mean that there may exist valid reasons
in particular circumstances to ignore a particular item, but the full implications must be
understood and carefully weighed before choosing a different course.
MAY: This word, or the adjective "OPTIONAL", mean that an item is truly optional. One vendor
may choose to include the item because a particular marketplace requires it or because the
vendor feels that it enhances the product while another vendor may omit the same item. An
implementation which does not include a particular option MUST be prepared to interoperate
with another implementation which does include the option, though perhaps with reduced
functionality. In the same vein an implementation which does include a particular option MUST
be prepared to interoperate with another implementation which does not include the option
(except, of course, for the feature the option provides.)
(c) According to RFC 2616, what is the meaning of the 406 Not Acceptable return code by a server in
response to an Http request. You only need answer this question in a couple of sentences. Where in
the RFC did you find the answers to this question?
Solution:
The resource identified by the request is only capable of generating response entities which have
content characteristics not acceptable according to the accept headers sent in the request.
You can find it on page 67 in RFC 2616.
13. HTTP Performance. In this problem, we consider the performance of HTTP, comparing non-persistent HTTP
with persistent HTTP. Suppose the page your browser wants to download is 500K bits long, and contains 5
embedded images (with file names img01.jpg, img02.jpg, img5.jpg), each of which is also 100K bits in
length. The page and the 5images are all stored on the same server which has a 250 msec RTT from your
browser. We will abstract the network path between your browser and the web server as a 100Mbps link.
You can assume that the time it takes to transmit a GET message into the path is zero, but you should
account for the time it takes to transmit the base file and the embedded objects into the "link." This means
that the server-to-client link has both a 125 ms one-way propagation delay, as well as a transmission delay

ECT 5572: Introduction to Computer Networking


associated with it. In your answer below, make sure to take into account the time needed to setup up TCP
connections (1 RTT).

(a) Assuming non-persistent HTTP (and assuming no parallel connections are open between the browser
and server). How long is the response time - the time from the when the user requests the URL to the
point in time when the page and its embedded objects are displayed? Make sure you describe the
various components that contribute to this delay.

(b) Again assume non-persistent HTTP, but now assume that the browser can open as many parallel TCP
connections to the server as it wants. What is the response time in this case?

(c) Now assume persistent HTTP (i.e., HTTP1.1). What is the response time, assuming no parallel
connections?

(d) Now suppose persistent HTTP with parallel connections is used. What is the response time?

(a) Solution:

The delays associated with this scenario are:

1. 250 ms (RTT) to set up the TCP connection that will be used to request the base file.

2. 125 ms (one way delay) to send the GET message for the base file, and have the message propagate
to the sever, plus 5 ms to transmit the base file, plus 125 ms for the base file to propagate back to
the client (for a total of 255 ms)

3. 250 ms (RTT) to set up TCP connection that will be used to request img.01.jpg file

4. 125 ms (one way delay) to send the GET message for img01,jpg and have it propagate to the sever,
plus 1 ms to transmit the img01.jpg file, plus 125 ms for the img0.jpg file to propagate back to the
client (for a total of 251 ms)

The last two steps above are repeated for the 4 image files img02.jpg through Img5.jpg. The total
response time is thus 505ms + 501*5ms = 3010ms = 3.01s

(b) Solution:

The delays associated with this scenario are:

1. 250 ms (RTT) to set up the TCP connection that will be used to request the base file.

2. 125 ms (one way delay) to send the GET message for the base file, and have the message propagate
to the sever, plus 5 ms to transmit the base file, plus 125 ms for the base file to propagate back to
the client (for a total of 255 ms)

3. The client now sets up 5 parallel TCP connections. 250 ms (RTT) is needed to set up the 5 TCP
connections (since they are set up in parallel).

4. 125 ms (one way delay) to send the 5 GET message for the 5 images and have it propagate to the
sever, plus 5 ms to transmit the image files, plus 125 ms for the img0.jpg file to propagate back to
the client (for a total of 255 ms)

The total response time is thus 505ms + 250ms + 255ms = 1010ms = 1.01s

(c) Solution:

1. 250 ms (RTT) to set up the TCP connection that will be used to request the base file.

ECT 5572: Introduction to Computer Networking


2. 125 ms (one way delay) to send the GET message for the base file, and have the message propagate
to the sever, plus 5 ms to transmit the base file, plus 125 ms for the base file to propagate back to
the client (for a total of 255 ms)

3. 125 ms (one way delay) to send the GET message for img01,jpg and have it propagate to the sever,
plus 1 ms to transmit the img01.jpg file, plus 125 ms for the img0.jpg file to propagate back to the
client (for a total of 251 ms)

The last step above are repeated for the 4 image files img02.jpg through Img5.jpg. The total response
time is thus 250ms + 255ms + 251*5ms = 1760ms = 1.76s

(d) Solution:

1. 250 ms (RTT) to set up the TCP connection that will be used to request the base file.

2. 125 ms (one way delay) to send the GET message for the base file, and have the message propagate
to the sever, plus 5 ms to transmit the base file, plus 125 ms for the base file to propagate back to
the client (for a total of 255 ms)

3. 125 ms (one way delay) to send the 5 GET message for the 5 images and have it propagate to the
sever, plus 5 ms to transmit the image files, plus 125 ms for the img0.jpg file to propagate back to
the client (for a total of 255 ms)

The total response time is thus 505ms + 255ms = 760ms = 0.76s

DNS

1. Consider the networks shown in the figure below. There are two user machines m1.a.com and m2.a.com in
the network a.com. Suppose the user at m1.a.com types in the URL www.b.com/bigfile.htm into a
browser to retrieve a 0.5 Gbit (600 Mbit) file from www.b.com.

(a) List the sequence of DNS and HTTP messages


sent/received from /by m1.a.com as well as any other
messages that leave/enter the a.com network that are
not directly sent/received by m1.a.com from the point
that the URL is entered into the browser until the file is
completely received. Indicate the source and destination
of each message. You can assume that every HTTP
request by m1.a.com is first directed to the HTTP cache
in a.com and that the cache is initially empty, and that all
DNS requests are iterated queries.
(b) How long does it take to accomplish the steps you
outlined in your answer to 1a? Explain how you arrived at
this answer. In answering this question, you can make the
following assumptions:
The packets containing any DNS commands and HTTP commands such as GET are very small
compared to the size of the file, and thus their transmission times (but not their propagation times)
can be neglected.
Propagation delays within the local area networks (LANs) are small enough to be ignored. The
propagation from router R1 to router R2 is 50 ms.
The one-way propagation delay from anywhere in a.com to any other site in the Internet (except
b.com) is 250 ms.
(c) Now assume that machine m2.a.com makes a request to exactly the same URL that m1.a.com made.
List the sequence of DNS and HTTP messages sent/received from/by m2.a.com as well as any other
messages that leave/enter the a.com network that are not directly sent/received by m2.a.com from

ECT 5572: Introduction to Computer Networking


the point that the URL is entered into the browser until the file is completely received. Indicate the
source and destination of each message. [Hint: make sure you consider caching here]
(d) Now suppose there is no HTTP cache in network a.com. What is the maximum rate at which machines in
a.com can make requests for the file www.b.com/bigfile.htm while keeping the time from when a
request is made to when it is satisfied non-infinite in the long run?

(a) Solution:

M1.a.com needs to resolve the name www.b.com to an IP address so it sends a DNS REQUEST
message to its local DNS resolver.
Local DNS server does not have any information so it contacts a root DNS server with a REQUEST
message.
Root DNS server returns name of DNS Top Level Domain server for .com.
Local DNS server contacts .com TLD.
TLD .com server returns authoritative name server for b.com.
Local DNS server contacts authoritative name server for b.com
Authoritative name server for b.com returns IP address of www.b1.com.
Local DNS server returns IP address of www.b1.com to DNS client.
The DNS client passes the IP address to the HTTP client.
HTTP client sends HTTP GET message to www.b1.com, which it sends to the HTTP cache in the
a.com network.
The HTTP cache does not find the requested document in its cache, so it sends the GET request
to www.b.com.
www.b.com receives the GET request and sends the file from www.b.com to R2.
The 0.5G bit file is transmitted over the 1 Mbps link between R2 and R1 to the HTTP cache.
The 0.5G bit file is sent from the HTTP cache to m1.a.com.

(b) Solution:

Let t=0 be the time at which the user enters www.b.com into the browser

The HTTP client will send its HTTP GET message to www.b1.com through the local HTTP cache in a.com.
This takes no time given the assumptions above.

The HTTP cache does not find the requested document in its cache and thus need to request the
document from b.com. Before it can send a GET request to www.b.com, it must first find out the IP
address for www.b.com. To do this, it will have to use the DNS. To resolve the name www.b.com to an IP
address, the web cache sends a DNS REQUEST message to its local DNS resolver. This takes no time given
the assumptions above.

Local DNS server does not have any information so it contacts a root DNS server with a REQUEST
message. This takes 0.25 sec given the assumptions above. At t=250ms, the root DNS server receives the
message.

Root DNS server returns name of DNS Top Level Domain server for .com. This takes 250 ms given the
assumptions above). At t=0.5 sec, the local DNS server receives the message and now knows the address
of the .com TLD DNS server.

The local DNS server contacts the .com TLD DNS server. This takes 250 ms given the assumptions above.
At t=0.75s, the TLD DNS server receives the message.

TLD .com server returns the authoritative DNS server for b.com. This takes 250 ms given the
assumptions above. At t=1s, the local DNS server receives the message.

Local DNS server contacts authoritative name server for b.com. This takes 50 ms given the assumptions
above. At t=1.05s, authoritative DNS server for b.com receives the message.

ECT 5572: Introduction to Computer Networking


The Authoritative name server for b.com returns IP address of www.b1.com.Tthis takes 50 ms given the
assumptions above. At t=1.1, the local DNS server for a.com receives the message, and returns this
message to the HTTP web cache.

The web cache is now ready to request the document from www.b.com.

It takes 100 ms to set up the TCP connection between the HTTP cache and www.b.com. At t=1.2s, the
web cache sends to the GET request to www.b.com.

It then takes 50 ms for the GET to propagate to www.b.com, given the assumptions above. At t=1.25s,
www.b.com receives the GET request.

If we assume that as soon as the first bit reaches R2, it is forwarded over the link between R2 and R1,
then this transmission delay can be ignored, since the transmission of the file from www.b.com is
pipelined with the transmission of the file between R2 and R1.

The 0.5 Gbit file must be transmitted over the 1 Mbps link between R2 and R1. This takes 500 seconds.
There is an additional 50 ms propagation delay. Thus at t = 501.3s, the last bit of the file is received at
R1. If we assume that R1 forwards packets to the HTTP cache as it receives them from R2, then the
transmission delay between R2 and the cache can be ignored since it is pipelines with the transmission
from R1 to R2.

The delay of sending the file from R1 to the HTTP cache and sending the file from HTTP cache to
m1.a.com can be ignored if we assume that as soon as the first few bits of the file arrive, they are
forwarded to the next destination.

Thus the total delay is approximately 501.3 seconds.

(c) Solution:

The HTTP client at m2.a.com will send its HTTP GET message to www.b1.com through the local HTTP
cache in a.com. This takes no time given the assumptions above.

The HTTP cache finds the requested document in its cache, so it sends a GET request with an If-
Modified-Since to www.b.com. (This takes 50ms given the assumptions)

www.b.com receives the GET request. The document has not changed, so www.b.com sends a short
HTTP REPLY message to the HTTP cache in a.com indicating that the cached copy is valid. (This takes 50
ms given the assumptions)

There is a 0.5s delay (0.5 GB/1Gbps) to send the 1Gbps file from the HTTP cache to m2.a.com.

The total delay is thus: 0.05 + 0.05 + 0.5 = 0.6s

(d) Solution:

Since it takes approximately 500s to send the file from R2 to R1, the maximum rate at which requests to
send the file from b.com to a.com is 1 request every 500 seconds, or an arrival rate of .002
requests/sec.)

2. DNS can store different types of records for different sorts of mappings. What are some common record
types, and what are their uses?

Solution:

A: IPv4 host address


CNAME: alias to another domain name
NS: name server record
MX: mail server for a given domain

For more, see http://en.wikipedia.org/wiki/List of DNS record types

ECT 5572: Introduction to Computer Networking


3. How many lookups (packet round-trips) might be needed to resolve a given host name? How few?

Solution:

Caching can reduce the number of lookups needed to zero (if cached on the local machine) or one (if cached
on the local nameserver); since each portion of the domain name could be in a different zone, there could be
as many lookups as there are portions in the name.

4. Is the mapping that DNS provides between hostnames and IP addresses one-to-one, one-to-many, many-to-
one, or many-to-many? Give examples.

Solution:

It is many-to-many. One hostname can have multiple IP addresses, and different hostnames can resolve to
the same address or set of addresses.

5. g

Putting Above together (Web Transfer)

1. In the topology shown below, machine A is a desktop client, N is a name server (but not the authoritative
name server for S), C is a Web cache, R is a router and S is a Web server. Client A is configured to use Web
cache C for all requests (assume that the Web cache resolves the name for any Web server and that the
client is configured with the IP address of the cache). All wires/links are Ethernet segments.

Assume the following:

All the machines were just booted and their associated caches (ARP, DNS, Web, persistent
connection) are all empty
http://S/index.html fits in a single packet
Persistent HTTP connections are used among A, C, and S (i.e. you should assume that once any
connection between these hosts is established it is never closed)
Web caches respond to TCP requests that look like packet two in table 1 below (e.g., GET
http://foo/bar/).

They reply with the normal web cache contents.

(a) The user on machine A, requests the web page http://S/index.html. The table below shows a
number of messages sent/received in servicing this request (this is not necessarily a complete list of all
packets). In addition, there are a few bogus packets that are never sent/received. The packets are not
listed in temporal order - fill in the order column to indicate the order in which each packet was
sent/received (1=first, 2=second, etc.). Place an X in the order column if the packet is bogus.

ECT 5572: Introduction to Computer Networking


Table 1: HTTP Request

ID Src Dst Src Port Dst Port Protocol Contents Order

1 C DNS root DNS UDP query for S

2 A C Web Cache TCP GET http://S/index.html

3 N DNS root DNS UDP query for S

4 C S HTTP TCP SYN

5 C S HTTP TCP GET index.html

6 S A HTTP TCP index.html

7 A broadcast ARP who is R

8 C A Web Cache TCP index.html

9 N C DNS UDP address for S

10 S C HTTP TCP index.html

(b) Assume that the client A has no local Web or DNS cache and that cache C has no DNS cache. However,
all other cacheable things are cached. On a subsequent request for http://S/ index.html which of
the messages from Table 1 would be eliminated (use the ID column to name the messages)?

(a) Solution:

Table 2: HTTP Request

ID Src Dst Src Port Dst Port Protocol Contents Order

1 C DNS root DNS UDP query for S X

2 A C Web Cache TCP GET http://S/index.html 2

3 N DNS root DNS UDP query for S 3

4 C S HTTP TCP SYN 5

5 C S HTTP TCP GET index.html 6

6 S A HTTP TCP index.html X

7 A broadcast ARP who is R 1

8 C A Web Cache TCP index.html 8

9 N C DNS UDP address for S 4

10 S C HTTP TCP index.html 7

(b) Solution:

3, 4, 5, 7, 10

P2P

ECT 5572: Introduction to Computer Networking


1. Discuss three different architectures of the peer-to-peer applications. Give examples of real applications for
each architecture and discuss the advantages and disadvantages of each architecture.

Solution:

Advatages:

1. Centralized directory of resources/files, as in Napster. Advantage is that search for resources is


simple with min overhead (just ask the centralized server). The disadvantages are: single point of
failure, performance bottleneck and target of lawsuit.
2. Fully distributed, non-centralized architecture, as in Gnutella, where all peers and edges form a flat
overlay (without hierarchy). Advantages: robustness to failure, no performance bottleneck and no
target for lawsuit. Disadvantages is that search is more involved and incurs high overhead with query
flooding.
3. Hierarchical overlay, with some nodes acting as super nodes (or cluster heads), or nodes forming
loose neighbourhoods (sometimes referred to as loose hierarchy, as in BitTorrent). Advantages,
robust (no single point of failure), avoids flooding to search for resources during queries.
Disadvantages is that it needs to keep track of at least some nodes using the Tracker server. In
general, this architecture attempts to combine the best of the 2 other architectures.

2.

Socket Programming

1. How many port numbers are in use? Consider incoming TCP segments arriving at a server, and suppose that
(e.g., using Wireshark), we see 3 different destination port numbers being used (i.e., where the server port is
the destination port).

(a) How many client connections are coming into this server: (i) less than 3 client connections, (ii) exactly
three client connections, (iii) three or more client connections? Explain your answer in a few sentences.

Solution:

There are three or more client connections. This is because more than one client can connect to each
port and they can be differentiate by their IP address, but each connection can use no more than one
port.

For example there could be three connections going to port 80(web), 1 connection to SMTP, (port 25)
and one to FTP (port 21).

(b) Does the number of sockets open equal the number of client connections? Explain your answer in a few
sentences.

Solution:

This isnt quite right. For a TCP server there is one welcoming socket and then one socket for each client
connect. So for example with a web server with N client connections there are N+1 sockets (one
welcoming socket and N server-client sockets).

2. Create a network application that sends the message "GET / HTTP/1.1\" to the google.ca web server and
prints out the response on the console. Use the c programming language and follow software engineering
principles.

ECT 5572: Introduction to Computer Networking

You might also like