You are on page 1of 17

Department of Computer Science and Engineering

COSC 3213: Computer Networks I (Winter 2008)

Instructor: N. Vlajic
Date: April 8, 2008

Final Examination


• Examination time: 180 min.

• Print your name and CS student number in the space provided below.
• This examination is closed book and closed notes. Calculator and one-sided cheat-sheet are
• There are 8 questions. The points for each question are given in square brackets, next to the
question title. The overall maximum score is 100.
• Answer each question in the space provided. If you need to continue an answer onto the last
page, clearly indicate that and label the continuation with the question number.

Question Points
1 / 15
2 / 15
FIRST NAME: ___________________________ 3 / 10
4 / 13
LAST NAME: ___________________________
5 / 15
6 / 12
STUDENT #: ___________________________
7 / 14
/ 6
Total / 100

1. Multiple Choice [15 points] time: 20 min

Circle the letter beside the choice that is the best answer for each question. For each
question choose only ONE answer.

(1.1) To deliver a message to the correct application program running on a host, the
___________ address must be consulted.
(a) physical
(b) IP
(c) port
(d) DNS

(1.2) __________ is a type of transmission impairment in which the signal loses its
form/shape due to the different propagation speeds of each frequency that makes up the
(a) attenuation
(b) delay distortion
(c) thermal noise
(d) cross talk

(1.3) A signal that is digital and periodic in time domain can be represented by
__________ in frequency domain.
(a) one single spike
(b) a series of spikes
(c) a continuous function
(d) none of the above

(1.4) For a _________________ , the Nyquist bit rate formula defines the theoretical
maximum bit rate.
(a) noiseless signal
(b) noisy signal
(c) noiseless channel
(d) noisy channel

(1.5) Which of the following encoding methods does not provide for synchronization in a
long sequences of 1s?
(a) NRZ-L
(b) NRZ-I
(c) RZ
(d) Bipolar

(1.6) How many carrier frequencies are used in quadrature PSK (QPSK).
(a) 1
(b) 2
(c) 4
(d) none of the above

(1.7) Two dimensional party check can detect _____________ errors

(a) 1
(b) up to 2
(c) up to 3
(d) up to 4

(1.8) To guarantee correction of up to 5 errors in all cases, the minimum Hamming distance
in a block code must be __________.
(a) 5
(b) 6
(c) 10
(d) 11

(1.9) The Go-Back-N strategy is

(a) easier to implement than Selective Repeat
(b) as efficient as Selective Repeat in case of noiseless links
(c) both (a) and (b)
(d) none of the above

(1.10) The efficiency of a polling-based system increases as:

(a) overall number of stations (active + inactive) decreases
(b) number of active stations decreases
(c) average load per station increases
(d) polling time increases

(1.11) In which of the following scenarios Token Ring can be expected to provide better
performance than Ethernet? (Assume each active station sends only 1 small-sized packet at
a time.)
(a) a mid-size network with only a few active stations at any given time
(b) a mid-size network with a large numb. of active stations at any given time
(c) both (a) and (b)
(d) none of the above

(1.12) Although any router is also a bridge, replacing bridges with routers in a multi-segment
LAN has the following consequences:
(a) lower network cost
(b) shorter packet delivery delays
(c) both (a) and (b)
(d) none of the above

(1.13) IP is _____________ datagram protocol.

(a) an unreliable
(b) a connectionless
(c) both (a) and (b)
(d) none of the above

(1.14) If IPv4, an HLEN value of decimal 10 means ____________ .

(a) there are 10 bytes of options
(b) there are 20 bytes of options
(c) there are 40 bytes of options
(d) none of the above

(1.15) The number of addresses in a class C block is ___________ .

(a) 65,534
(b) 16,777,216
(c) 256
(d) none of the above

2. Channel Capacity [15 points] time: 20 min
A researcher wishes to digitally record analog sounds for testing animal hearing with
frequencies of up to 100 [kHz].

2.1) [2 points]
What is the minimum sampling rate required to process these sounds?

Answer :

2 [samples / Hz] * 100 [kHz] = 200 000 [samples / sec]

2.2) [1 points]
What is the name given to the theorem required to make this calculation?



2.3) [2 points]
If a 16 bit (per sample) PCM (A/D) converter is used, what is the data rate of the resulting
digital signal?


C = 16 [bit / sample] * 200 000 [sample / sec] = 3.2 [Mbps]

2.4) [5 points]
Use Shannon’s formula to find the minimum signal to noise ratio (in dB!) required to sustain
the given data rate over a 500 KHz radio channel.


Shannon capacity theorem is: C = B log2 (1 + SNR)

SNR = 2C/B – 1 = 23.2Mbps/0.5MHz – 1 = 26.4 – 1 = 83.4

SNR [dB] = 10 log(83.4) = 19.2

2.5) [4 points]
Assume in step 2.3) we decided to deploy Delta modulation instead of PCM. Which data rate
would the resultant signal have now? Would you expect better or worst overall system
performance? Explain!


In case of Delta modulation, 1 bit / sample is needed.

Hence, C = 1 [bit / sample] * 200 000 [sample / sec] = 0.2 [Mbps]

From Shannon’s theorem, lower C implies lower required SNR. This means, the
system would be able to tolerate more of the channel noise. Nevertheless, this would
not immediately imply a better system performance. Ultimately, the quality of the
recorded/reproduced analog system would depend on the selection of DM parameters
(e.g. step size δ).

3. Line Coding [10 points] time: 15 min

3.1) [7 points]
The following bit stream needs to be transmitted over a link: 10100000 00001111.

Show the transmitted digital signal assuming NRZ, NRZI, and 4B/5B encoding are deployed.
Use the provided table for 4B/5B encoding. State all necessary assumptions!






New 4B/5B stream: 10110 11110 11110 11101.

Upon using NRZI coding, the stream looks like:


3.2) [3 points]
What are the main problems of NRZ and NRZI? How does 4B/5B resolve these problems?


The main problem of NRZ and NRZI is lack of synchronization for long sequence of
zero-s and one-s.

4B/5B resolves this problem by substituting 4-bit patterns containing long sequences
of zeros with 5-bit patterns containing alternating sequences of zero-s and one-s.

4. Error Control [13 points] time: 20 min
Let g(x) = x3 + x2 + 1. Consider the information bits (1, 1, 0, 1, 1, 0)

4.1) [7 points]
Find the codeword corresponding to these information bits if g(x) is used as the generating


4.2) [6 points]
To provide more reliability than the Single Parity Bit technique, a new error-detecting scheme
has been proposed. The scheme uses one parity bit for checking all the odd numbered bits
and a second parity bit for all the even numbered bits. What is the (minimum) Hamming
distance of this code? Is this code able to correct errors? Explain!


By making changes to either one even or one odd bit a new dataword will be
generated. This change will cause (only) one of the parity bits to be changed. Hence,
the minimum Hamming distance of this code is 2.

The code still cannot correct any errors. (For correction of 1-bit errors, minimum
Hamming distance of 3 is required.

5. Medium Access Control Potpourri [15 points] time: 20 min

5.1) [5 points]
Measurements of a slotted ALOHA channel with an infinite number of users show that 10%
of sots are idle. What is the channel load, G? Is the channel overloaded or underloaded?


From the given information Psuccess = Pfinding an empty slot = 0.1 = e-G
Hence G = - ln 0.1 = 2.3

Whenever G>1, the channel is overloaded.

5.2) [3 points]
What is the throughput of the system from 5.1?


S = G*e-G = 2.3*e-2.3 = 0.23

5.3) [5 points]
A LAN uses polling to provide communication between M workstations and a central base
station. The system uses a channel operating at 25 Mbps. All stations are 100 meters from
the base station, and polling messages are 64 bytes long. Frames are of constant length –
1250 bytes, and stations indicate that they have no more frames to transmit with a 64 byte
(end) message.
What is the throughput of this system, assuming there are M=50 stations in the system and
stations are allowed to transmit N=10 frames per poll.


time to transmit useful bits M⋅N⋅ x

ρ= = =
overall time to send bits M ⋅ (N ⋅ x + x end + x poll )
N ⋅ (1250 * 8/Rbps)
(N ⋅ 1250 * 8/R + 64 * 8/R + 64 * 8/R)bytes

time to transmit useful bits 1
ρ= = =
overall time to send bits 2 ⋅ 64
N ⋅ 1250
≈ = 0.99

5.4) [2 points]
What is the throughput of the system from 5.3 assuming each station is allowed to transmit
an unlimited number of frames?


From the above formula, it is evident that as N→∞, the throughput approaches 1. This
is easy to understand/explain, as with more frames sent per poll, the overhead cost
diminishes …

6. Flow Control [12 points] time: 15 min

6.1) [8 points]
Consider the Go-Back-N protocol with a sender window size of 3 and sequence numbers in
the range 0 to nmax=1024. (I.e. nmax is sufficiently large so sequence numbers never get
Suppose that at a time t, the next in-order packet that the receiver is expecting has a
sequence number of k. Assume that the medium does not reorder packets. What are the
possible sets of sequence numbers inside the sender’s window at time t?

(Discuss all possible scenarios to obtain the full mark.)


Here we have a window size of N=3.

1) Suppose the receiver has received packet k-1, and has ACKed that and all other
preceeding packets. If all of these ACK's have been received by sender, then
sender's window is [k, k+N-1].
2) Now, suppose next that none of the ACKs have been received at the sender. In
this second case, the sender's window contains k-1 and the N packets up to
and including k-1. The sender's window is thus [k-N, k-1]. By these arguments,
the senders window is of size 3 and begins somewhere in the range [k-N,k].

6.2) [4 points]
Related to 6.1) – what are all possible values of the ACK field in all possible messages
currently propagating back to the sender at time t? Justify your answer.


If the receiver is waiting for packet k, then it has received (and ACKed) packet k-1 and
the N-1 packets before that. If none of those N ACKs have been yet received by the
sender, then ACK messages with values of [k-N,k-1] may still be propagating back.
Because the sender has sent packets [k-N, k-1], it must be the case that the sender
has already received an ACK for k-N-1. Once the receiver has sent an ACK for k-N-1 it
will never send an ACK that is less that k-N-1. Thus the range of in-flight ACK values
can range from k-N-1 to k-1.

7. Network Layer Potpourri [14 points] time: 15 min

7.1) [2 points]
The value of the total length field in an IPv4 datagram is 36, and the value of the header
length field is 5. How many bytes of data is the packet carrying?


The value HLEN = 5 implies 20 bytes of header. Hence, the packet carries 36-20 = 16
bytes of data.

7.2) [2 points]
An IPv4 datagram arrives with fragmentation offset of 0 and an M bit (more fragment bit) of
0. Is this a first fragment, middle fragment, or last fragment?


Offset = 0 implies that this is the first fragment. At the same time, M=0 implies that
there is no more fragments, hence this is an un-fragmented IPv4 packet.

7.3) [3 points]
An IP packet is transmitted from one router to another. Does the IP header change,
assuming no fragmentation occurs? Explain!


Yes. The values of the TTL and the checksum fields are changed from router to router.

7.4) [3 points]
Find the Netid and Hostid of the following IP addresses: Netid: _____114_________ Hostid: ______32.2.8________ Netid: _____208.34.54_____ Hostid: ________12_________

7.5) [4 points]
A company has a class B network address. The network administrator has assigned 60
subnets to this network. What is the subnet bit mask deployed inside the network? Provide
both binary and decimal representation!


Network (class B) mask: 11111111 11111111 00000000 000000000 =

To generate 60 subnet numbers, the administrator needs 6 bits from the third byte.
Hence, the subnet mask is: 11111111 11111111 11111100 000000000 =

8. Connecting LANs [6 points] time: 10 min
Consider a bridged network depicted below. Starting with empty routing caches at all
bridges, show the content of caches of Bridges A, B, and C, after:
8.1) Station 9 sends a frame to Station 6;
8.2) Station 2 sends a frame to Station 6.