Escolar Documentos
Profissional Documentos
Cultura Documentos
= + = ,
which gives a value of B = 764.9138 Hz.
7
4. Error Control [15 points]
4.1) [4 points]
Suppose an error correction scheme that encodes each 3 bit data block into a 7 bit code
word. What is the number of invalid code words in case of such a scheme?
Solution:
Number of possible codes (3-bit combinations) = 2
3
= 8
Number of possible codewords = 2
7
= 128
Hence, the number of invalid words is: 128 8 = 120
4.2) [8 points]
The three-out-of-seven code consists of all possible binary words of length 7, containing
exactly three 1s. What is the minimum Hamming distance between such code words?
Solution:
Let a and b be two distinct code words. If the number of positions where the
three 1s overlap is 0, for example, a = 1 1 1 0 0 0 0 and b =0000111, then the
Hamming distance is d(a, b)=6.
If the number of positions where the three 1s overlap is 1, for example, a = 1 1
1 0 0 0 0 and b =0011100, then the Hamming distance is d(a, b)=4.
If the number of positions where the three 1s overlap is 2, for example, a = 1 1
1 0 0 0 0 and b =0111000, then the Hamming distance is d(a, b)=2.
Since these are the only three possibilities, then the minimum Hamming distance
between any two code words in the three-out-of-seven code is 2.
4.3) [3 points]
How many errors can three-out-of-seven code correct?
Solution:
Since the minimum Hamming distance between any two code words is 2, this code
can detect up to one error, but cannot correct any errors
8
5. Flow Control [15 points]
5.1 [5 points]
Suppose you are required to use the Stop-and-Wait protocol for reliable communication over
a 100 Mbps channel with an end-to-end distance of 6000 km. Each packet sent by the
sender is 1000 bytes long. Assume that the speed of propagation is 3*10
5
km/sec and ignore
all other sources of delay other than the propagation delay. ACK packets have negligible
transmission time. What is the utilization of such a channel?
Solution:
5.2 [10 points]
Consider a 1 Mbps channel with a 20 msec one-way propagation delay, i.e. 40 msec
roundtrip propagation delay. We want to transfer a file of size 13,500 bytes. Each packet has
a total size of 1625 bytes, including the 125 byte header, i.e. each packet contains 1500
bytes of data. When there is data to be transmitted, each packet contains the maximum
number of bytes. ACK packets are 125 bytes long and there is a processing delay of 1 msec
after a packet is fully received at the receiver until the transmission of the corresponding
ACK is started.
Assume that we used Selective Repeat protocol of window size N=4 for transmission of this
file. Assume that every 6
th
packet crossing the forward channel is lost while ACKs are not
lost or corrupted. Assume that the processing delay at the sender after an ACK is received is
negligible.
How much time is required to complete the transfer of the whole file and receive the final
ACk at the sender? Assume the timeout for each packet is set to 50 msec, starting from the
end of the transmission of the packet.
0.2% 0.002
2,004
4
4
2,000
1
1
8 * 1000
0 100,000,00
0 300,000,00
6,000,000
2
1
1
n
R t 2
1
1
f
prop
SW
= =
+
=
+
=
+
=
9
Solution:
Number of segments = ceiling [13,500 / 1,500] = 9
Packet transmission time = 1625*8 bits / 1 Mbps = 13 msec
ACK transmission time = 125*8 bits / 1 Mbps = 1 msec
Timeout = 50 msec
Transfer is completed in 186 msec.
Average data transfer rate: 13,500 * 8 bits / 186 msec = 580.6 kbps.
10
6. Ethernet [15 points]
6.1) [10 points]
Suppose an Ethernet-type of network that utilizes the following MAC protocol:
(Note, in step 6, a node randomly selects to back of for either 1, 2 or 3 full slots.
Transmissions in the middle of a slot are not permitted.)
There are three nodes in the link, and each node attempts to send as many packets as
possible.
What is the probability of a packet being transmitted eventually (as opposed to being
dropped)?
Solution:
Since all three nodes attempt to send their packets at the same time, the first
attempt is always failed due to collision.
On the second attempt, the nodes randomly pick a number from {1,2,3}. For a
packet to be sent without collision, there are two possible cases:
a) a node selects 1, and others select 2 or 3;
b) a node selects 2, and other select 3.
According to the algorithm, if the second attempt fails, the packet is dropped.
Hence, the probability of successful transmission is calculated as:
P(case A) + P(case B) =
= 1/3 * (2/3)
2
+ 1/3 * (1/3)
2
= 4/27 + 1/27 = 5/27 = 0.185
11
6.2) [5 points]
Why is it necessary to pad an Ethernet frame to 64 bytes? Explain in no more than 3-4
sentences.
Solution:
To allow stations in the collision domain to transmit long enough in order to detect
a collision. Namely, to detect a collision, a station must be in the position to be
sending its own and receiving the interfering signal (i.e. compare the two)
concurrently.
In the worst case collision scenario (A and B are at two ends of a network. B
starts transmitting just a moment before As packet arrives to B), a packet
transmission time must be equal to the networks roundtrip delay.
In real world Ethernet networks, this time translates to 64 byte frame size.
Hence, all Ethernet packets have to be padded to (i.e. extended to) this size
12
7. Bridges [8 points]
Consider the network of learning bridges shown in the following figure. Assume each bridge
initially knows nothing about the network, show the forwarding table of the bridges after the
following transmissions:
a) B sends to C
b) D sends to B
c) E sends to F
For each of these questions (i.e. after each transmissions) give a table for each bridge, each
with two columns: destination and interface number.
Solution:
13
8. IP Protocol [12 points]
8.1 [4 points]
IP includes an option for Record Route in which, as a packet is forwarded through the
network, each router records its identity in a list.
Given the constraints imposed by the design of the IP header, what is the largest number of
router addresses that such an option can record?
Solution:
(Max IP header length Mandatory IP header length) = 40 bytes.
Hence, there are 40 bytes available to any, including this, option.
First 3-4 bytes of the options are reserved for the option header, leaving us with
36 bytes available for the option payload router recording in this case.
As each (router) address occupies 4 bytes, the overall number of addresses that
can be recorded is 36 / 4 = 9.
8.3 [8 points]
An IP packet, with Strict Route option occupying 20 (additional) bytes of its header, is to be
sent across a link with MTU = 320. Some of the fields of this packets header, before
fragmentation, are given below.
Total Length = 1000;
Identification = 998;
Fragmentation Offset = 0;
Flags = 0 0 0.
c.1) How many fragments will be created altogether?
c.2) Show what the fields Total Length, Identification, Fragmentation Offset, and Flags are
for each created fragment.
Solution:
Due to the use of Strict Route option, the size of the IP header in this case for
the original packet and all subsequently created fragments is 40 byts.
14
The original packet has a total length 1000 bytes, which comprises 20+20=40
bytes header and 960 bytes payload.
Now, each new MTU (i.e. fragment) can accommodate 320 bytes total, or 280
bytes payload. This implies that, in order to sent 960 bytes of the original
payload, we need 4 fragments.
Fragment 1:
Total Length = 320;
Identification = 998;
Fragmentation Offset = 0;
Flags = 0 0 1.
Fragment 2:
Total Length = 320;
Identification = 998;
Fragmentation Offset = 280/8 = 35;
Flags = 0 0 1.
Fragment 3:
Total Length = 320;
Identification = 998;
Fragmentation Offset = 560/8 = 70;
Flags = 0 0 1.
Fragment 4:
Total Length = 120 + 40 = 160;
Identification = 998;
Fragmentation Offset = 840/8 = 105;
Flags = 0 0 0.
15