You are on page 1of 12

Page 1 of 1 COMP2211-WE01

EXAMINATION PAPER
Examination Session: Year: Exam Code:

May/June 2017 COMP2211-WE01

Title:

NETWORKS AND SYSTEMS

Time Allowed: 2 Hours

Additional Material provided: N/A

Materials Permitted:

Calculators Permitted: yes Models Permitted: Casio FX-83 GTPLUS or Casio


FX-85GTPLUS
Visiting Students may use dictionaries:

Instructions to Candidates: Answer FOUR questions. (ONE from each Section)

Revision:
Networks and Systems (COMP2211WE01)
Page 2 COMP2211WE01

Section A Networks
(Dr F. Li)

Question 1

(a) Suppose you have implemented a network programme to connect a remote


machine through its port 21 for voice communication. Although the port
is working, unexpected messages are received. Explain the most possible
cause to this problem. [3 Marks]

(b) Describe how an IPv6 link-local address of a machine is generated. Show


the format of the link-local address. List two main functionalities facili-
tated by this address. [5 Marks]

(c) Name the address type of each of the following IPv6 addresses:

i. F E80 :: /10
ii. F C00 :: /7
iii. 2001 :: /16
iv. F F 00 :: /8

Explain which of them can support IP multicast. [5 Marks]

(d) Suppose the sample rate of Skype voice communication is 8 Kbps (Kilobit
per second). Such communication will be converted into network data
packets for transmission, where each packet size is 1000 bytes. Given
that a Skype voice communication session lasts for 10 minutes, assuming
the application end-to-end delay requirement is 150 ms. Translate the
application level QoS requirement of this communication session into the
network level QoS requirement by calculating the following:

i. Packet rate
ii. End-to-end network delay

State any assumption and extra parameters required. [6 Marks]

this question is continued on the next page


Page 3 COMP2211WE01

(e) An internet service provider maintains a large network that is physically


divided into many network segments serving different regions in the UK.
Majority of its network users watch youtube video or make skype commu-
nication, some other users perform generic file transmission, and only a
low portion of users conduct other miscellaneous usage.
Explain whether IntServ or DiffServ is a more cost-effective choice for pro-
viding a quality of service (QoS) control to this network. Based on your
answer, describe the implementation of such a QoS control by showing
what functionalities are provided by each router in the network and how
data transmission is organised among the network segments and within
each of them. [6 Marks]

continued
Page 4 COMP2211WE01

Question 2

(a) State the meaning of the IPv6 address 2001 : 529 : 0 : 1 :: /64. [3 Marks]

(b) Explain what IP address is used to support the communication between


an IPv4 router and an IPv6 router. Show an example of such an address.
[3 Marks]

(c) TCP supports reliable communication. Explain why TCP is not a suitable
choice for handling real-time video streaming. [3 Marks]

(d) The following is a diagram showing a network of connected routers for sup-
porting IP multicast. Each labelled circle represents a router. The number
showing on each line represents the cost of data transmission between two
routers.

5
3 C G
A 2 2

3 5 2 H
D
B
3 2
5 F
E 2

Assume only routers E and H Chave multicast clients


G connected, and a
A
machine connecting router A is the source of the multicast communication.
D H
i. Draw a diagram, showing
B the construction of an optimal shared dis-
tribution tree to support the multicast communication. [5 Marks]
F
ii. Describe how you construct the distribution tree. [3 Marks]
E
iii. Explain what data distribution policy should be applied to optimise
the multicast communication. [3 Marks]

this question is continued on the next page


Page 5 COMP2211WE01

(e) Suppose a network is designed to provide quality of service (QoS) controls


to two types of services, namely high-quality real-time video streaming and
offline video content download. What classes of service should be applied
for such QoS controls? Based on your answer, explain an optimal imple-
mentation of the QoS controls by showing the scheduling policy adopted
and how it organises the data flows of the two services. [5 Marks]

End of Section A continued


Page 6 COMP2211WE01

Section B Distributed Systems


(Dr F. Li)

Question 3

(a) Compare RPC and Java RMI with respect to how they support location
and migration transparency. [3 Marks]

(b) Draw a diagram of a fault-tolerant system that supports both active and
passive replication at the same time. The diagram should depict the organ-
isation of servers and how the clients can communicate with the servers.
Explain how data are replicated in the system and the data recovery pro-
cedure to handle server failure situations. [11 Marks]

(c) Define the term Byzantine fault. Analyse how your suggested system in
(b) can cope with the Byzantine fault. If not, explain why and describe
the modification should be done to enable this. [5 Marks]

(d) Describe phantom deadlock in distributed systems. Explain why phantom


deadlock is more likely to appear in a large-scale distributed system than
a small-scale one. [6 Marks]

continued
Page 7 COMP2211WE01

Question 4

(a) Compare how Java RMI and message-oriented middleware handle com-
munication data loss. Explain which of these technologies is more suit-
able for supporting media streaming with a guaranteed quality of service.
[5 Marks]

(b) Describe how linearizability formulates the strict consistency control in a


distributed system. Explain how linearizability can be optimally imple-
mented in a large-scale distributed system, where most of its components
are only locally dependent on some system components. [6 Marks]

(c) Describe the difference between time redundancy and component redun-
dancy in supporting fault tolerance. Explain how they can be incorporated
in active replication and passive replication systems. [5 Marks]

(d) Consider three distributed systems, containing 70%, 50%, 30% of over-
loaded servers, respectively. For each of these distributed systems, suggest
a suitable load distributing algorithm to optimise the system performance.
Justify your answer.
Suppose each of these distributed systems has a further 30% of increase
in overloaded servers. Based on your answer above, analyse the stability
of these modified systems. [9 Marks]

End of Section B continued


Page 8 COMP2211WE01

Section C Compiler Design


(Dr G. Mertzios)

Question 5

(a) i. What is the parsing problem? [1 Mark]


ii. What is a parse tree? In a parse tree, how are the internal nodes
labeled and how are the leafs labeled? [3 Marks]

(b) Demonstrate with a simple example and using diagrams that the following
grammar is ambiguous:

A → A+A | A∗A | x | y

[6 Marks]

(c) i. Predictive parsers can be constructed for the LL(k) grammars. What
does the name LL(k) stand for? [3 Marks]
ii. Can an ambiguous grammar be an LL(k) grammar for some positive
integer k? Briefly justify your answer. [4 Marks]

(d) Construct the leftmost derivation and the rightmost derivation of the string
(a + b) × c in the following grammar:

E → E+T
E → T
T → T ×F
T → F
F → (E)
F → a
F → b
F → c

[8 Marks]

continued
Page 9 COMP2211WE01

Question 6

(a) Provide the names of the three main phases of the analysis part of a com-
piler (or front end) and give a brief description of what each of these parts
is responsible for. [12 Marks]

(b) i. Eliminate the immediate left recursion in the following grammar:

S → Sx | Sy | zw | wy

[3 Marks]
ii. In the following grammar, eliminate the left recursion that appears in
more than one steps:

S1 → S2 ba | c
S2 → S3 a | b
S3 → S2 c | ab

[4 Marks]

(c) Using the following simple Syntax Directed Definition (SDD), construct
the annotated parse tree for the computation 2 ∗ 8. [6 Marks]

PRODUCTION SEMANTIC RULES


1) T →FT0 T 0 .inh = F.val
T.val = T 0 .syn
2) T 0 → ∗ F T10 T10 .inh = T 0 .inh · F.val
T 0 .syn = T10 .syn
3) T0→ε T 0 .syn = T 0 .inh
4) F → digit F.val = digit.lexval

End of Section C continued


Page 10 COMP2211WE01

Section D Databases
(Dr G. Mertzios)

Question 7

(a) In the Relational Data Model, what is the full functional dependency, what
is the partial functional dependency and what is the transitive functional
dependency? [6 Marks]

(b) Consider the relation “Engineer”, which has the following relation schema:

Engineer (Engineer ID, Topic, Engineer Name,


YearsOfExperience-in-Topic, Engineer City, Engineer Country)

In the schema of this relation the attributes of the primary key are under-
lined, according to the standard notation.

i. Normalize the relation to the 2nd normal form (2NF) and specify
which are the primary keys and the foreign keys. [4 Marks]
ii. Normalize the relation to the 3nd normal form (3NF) and specify
which are the primary keys and the foreign keys. [6 Marks]

(c) Based on the following relation schemas of the relations “Employee” and
“Branch”, write an SQL statement for each of the given queries:

Staff (StaffID, StaffName, Position, MonthlySalary, Depart-


ment, HireYear, BranchNo)
Branch (BranchNo, BranchName, City, Address, Budget)

(i) List the names, the positions and the departments of all staff mem-
bers who were hired on or after year 2010. [2 Marks]
(ii) List the names, the departments and the annual salaries of all em-
ployees who work in a branch in London. [3 Marks]
(iii) Compute the average monthly salary of all staff members who work
in a Sales department of a branch that has budget at least 350000.
[4 Marks]

continued
Page 11 COMP2211WE01

Question 8

(a) In the Relational Data Model, define the terms candidate key, primary key,
entity integrity and referential integrity. [6 Marks]

(b) For the following scenario draw the Entity-Relationship (ER) diagram using
the Crows Foot notation, clearly showing the entities, their named relation-
ships and the cardinalities of these relationships. In your diagram, resolve
the many-to-many relationships.

Each member of staff works in exactly one branch and a branch


can hire many members of staff (or even no staff at all). Ev-
ery staff member can supervise many contracts (or even on no
contract at all) and each of these contracts requires the service
of at least one staff member. A client can sign zero or more
contracts, but a contract is signed by exactly one client.

[10 Marks]

(c) Based on the following relation schemas of the relations “Client” and
“Viewing”, write an SQL statement for each of the given queries:

Client (clientNo, clientName, sex, familyStatus, profession)


Viewing (propertyNo, clientNo, city, Rent, numberRooms, floor,
comment)

(i) List the name and the profession of all female clients (i.e. of clients
with sex “F”) who are single. [2 Marks]
(ii) List the client number, the name and the salary of each client who
viewed a property in Durham. [3 Marks]
(iii) For each city list the number of male clients (i.e. of clients with
sex “M”) who viewed a property in this city. [4 Marks]

END OF PAPER

You might also like