Revision Material 3

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

COMP313 W1

Comp 313 Test 3 (Semester 1: 2021)


Exam Time: 1.5 hrs
Exam script uploading time: 15 mins

Instructions to Candidates
1. This test is made up of 3 questions and each question comprises of twenty marks. Students
are required to answer all the four questions.
2. The marks for each part question are indicated in square brackets [].
3. Diagrams can be drawn by hand and then imported to the student’s work.
4. You have 1.5hrs to write the exam and an additional 15mins for reading of instructions and for
the uploading of the exam script (catering for possible network related problems).
5. Students are encouraged to manage their time wisely.
6. Students are reminded of the need for neatness in their test scripts.
7. Test scripts can be either Word or pdf documents. Scans and pictures of hand written work are
also acceptable but they might cost students in terms of bandwidth.
8. Plagiarism is strictly prohibited.

1. a. Define the following terms in the context of paging algorithm:


i. Demand-paging [2]

Solution

Only the missing page is fetched from auxiliary memory and page replacement only
occur when main memory is full.

ii. Page-fault rate [2]

Solution

When a page is required, but is not in primary memory, a page fault occurs. The page
fault rate is the number of page faults that occur during the execution of a page
reference string.
iii. Backward-distance [2]

Solution

The page that is replaced is the one that was referenced the furthest back in time.

b. Comment on the optimality and practicality of Belady’s algorithm. [3]

Solution

Belady’s algorithm is both optimal and un-realistic since it requires a look into the
future operations of the program. However it provides a useful benchmark against
which to measure the performance of other realizable algorithms.

c. Consider a machine with four (4) page frames and six (6) pages that is processing
the following reference string, v:
v = {1,5,6,3,5,1,4,6,1,2,4,6,3,5}
i) Show the changes that occur in memory as the machine processes v
using the Least-Frequently Used paging algorithm (The tie-breaking
rule is Least-recently-Used). Show all working.
(Note that memory is initially empty.) [5]

Solution

1 1 1 1 2 2 1 2 3 1 2 3 2 3
1 5 6 3 5 1 4 6 1 2 4 6 3 5
P1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
P2 5 5 5 5 5 5 5 5 5 5 5 3 3
P3 6 6 6 6 4 4 4 2 4 4 4 5
P4 3 3 3 3 6 6 6 6 6 6 6
F F F F F F

6 Faults
ii) Show the changes that occur in memory as the machine processes v
using Belady’s paging algorithm (The tie-breaking rule is Least-
recently-used).
(Note that memory is initially empty.) [6]

Solution

1 5 6 3 5 1 4 6 1 2 4 6 3 5
P1 1 1 1 1 1 1 1 1 1 2 2 2 2 5
P2 5 5 5 5 5 4 4 4 4 4 4 4 4
P3 6 6 6 6 6 6 6 6 6 6 6 6
P4 3 3 3 3 3 3 3 3 3 3 6
F F F

3 Faults

[Total 20 marks]

2. a. Name and describe two multiplexed techniques used in circuit-switched networks


to provide the bandwidth of a link into multiple channels. [4]

Solution

Frequency Division Multiplexing: The frequency range is divided into channels

Time division Multiplexing: Signal is divided into time slots via round-robin for each
channel

b. The processing of data in packet-switched networks incur various types of delays at


each processing node. Name four sources of delay incurred in packet-switched
networks. [4]

Solution

Queueing

Processing

Transmission

Propagation
c. What are the 2 primary differences between TCP and UDP in the TCP/IP protocol
stack? Provide an application example of each protocol to illustrate. [4]

Solution

TCP: reliable, connection/stream-based e.g. reliable file transfer

UDP: unreliable, packet-based e.g. ICMP messages (like ping)

d. Does classful addressing scheme have any benefits over CIDR? Explain your
answer. [2]

Solution

Yes, speed efficiency – no net mask is required as it can be calculated from the class
range

e. How do interior Gateway Protocols differ from Exterior Gateway Protocols in


terms of the information they share? [2]

Solution

IGPs share link-state information within a MAN

EGPs share distance-vector within a WAN

f. Given the subnet mask of, 255.255.255.192, calculate the subnet number and the
host number of the address 181.215.81.19. [4]
Class B:

-.-.11111111.11000000

-.-.01010001.00010011

Subnet mask: 1111111111 -> 0101000100

Host mask: 000000 -> 010011

Subnet: 324

Host: 19

[Total 20 marks]

3. a. Describe the functionality of the presentation layer in the OSI Standard network
protocol layers. [2]

Solution

Structures data in a mutually agreed format, concerned with issues such as how to code
and format data, including data encryption and data compression.

b. Provide the sequence of events (messages), involved in a successful Address


Resolution Protocol (ARP) request and reply. [3]

Solution

Packet contains sender + receiver network address and sender and receiver
hardware address

Request packet is reused with receiver hardware address value populated

c. Consider the following IP Address of a host in the specified CIDR address space:
194.125.27.41/28
Calculate the maximum number of hosts that the LAN can accommodate. [4]
Solution

Netmask = 11111111.11111111.11111111.11110000

Host mask = 0000

Hosts range = 24-2 = 14 hosts

d. Could IPv4 be redesigned to use hardware addresses (eg MAC) instead of the 32 bit
addresses currently used? Why? [4]

Solution

No, because different LAN transmission systems have different hardware address
formats e.g. only Ethernet LANs use MAC addresses (as opposed to fibre optic,
satellite, Bluetooth)

e. Which internet protocols are involved in requesting the web page:


http://moodle.cs.ukzn.ac.za/cs from your smartphone on campas? List the protocol
names and the respective roles that they play. [7]

Solution

The first protocol involved in delivering IP packets, is the Domain Name System
(DNS). It is used by the browser to look up the destination IP address that has been
registered for the www.moodle.cs.ukzn.ac.za domain name. Once the IP address
has been obtained (e.g. 146.230.90.21), and it has been determined that the
destination address is on a remote LAN, the IP packets are routed to the next
gateway, or hop, along the route to the destination LAN. On the source system, this
is called the default gateway one or more hops, or gateways, might need to be
travelled in order for the IP packet to arrive at their destination LAN.

The TCP/IP protocol is the second protocol involved, as it is used to establish a


socket-based connection to the webserver. The contents of the IP packet sent over
the connection will be the HTTP protocol message to request ‘cs’ resource from the
webserver.
HTTP is a text-based protocol, and is the 3rd protocol involved in our example
scenario. Throughout the routing process, each router along the way determines if
the IP packet is destined for a local network (which is directly connected to), or a
remote LAN. This calculation is done by looking at the destination network address
(e.g. 146.230.90.0), which is extracted from the destination IP packet by use of the
network mask (e.g. 255.255.255.0) of the LAN. If the destination is a remote LAN, the
router performs a Routing Information Base (RIB) query to determine the next router
to forward the IP packet to. This process is repeated until the packet arrive at their
destination network. At this point the IP routing process is over, and all that needs to
be done is to resolve the destination IP address to the hardware address of the
destination system on the LAN.

This is done via the Address Resolution Protocol (ARP) which is the forth protocol
involved in our scenario, and the packets are delivered to their destination. There are
other protocols involved, however, but they take part during the routing of the
packets, and are usually run between routers of MANs and WANs periodically. In
order for our HTTP scenario to work, we say that the routing protocols need to have
established at the time of the web URL query ie the routing protocols occur before
the HTTP query, but not in any particular order.

IS-IS = interior gateway protocols for routing within your ISP WAN

BGP = exterior gateway protocol for routing from ISP to UKZN MAN

OSPF = interior gateway protocol for routing within UKZN MAN

[Total 20 Marks]

You might also like