Manual Forozan 5
Manual Forozan 5
Manual Forozan 5
PRACTICE SET
Questions
Q1-1. The five components of a data communication system are the sender, the
receiver, the transmission medium, the message, and the protocol.
a. Mesh: secure
b. Bus: easy installation
c. Star: robust
d. Ring: easy fault isolation
Q1-9. The general factors are size, distances (covered by the network), structure,
and ownership.
Q1-11. A protocol defines what is communicated, in what way and when. This pro-
vides accurate and timely transfer of information between different devices on
a network.
Q1-13. Each LAN should be connected to (n − 1) LANs, which means that we will
have n × (n − 1) connections. However, if each connection can be used in both
directions, we need only [n × (n − 1)]/2 connections.
1
2
Q1-15. The telephone company acts as an ISP. The connection from the resident to
the telephone company is a point-to-point access WAN that connects the
premises to the Internet. At the same time, the telephone company needs to
provide the necessary services such as e-mail.
Q1-17. An Internet draft is a working document with no official status and a six-
month lifetime; an Internet draft may become a proposed standard after six
months if it has received enough attention in the Internet community.
Q1-19. The IETF is responsible for identifying operational problems and recom-
mending solutions; the IRTF focuses on long-term research topics.
Problems
P1-1. Unicode uses 32 bits to represent a symbol or a character. We can define 232
different symbols or characters.
P1-3.
a. Cable links: n (n – 1) / 2 = (6 × 5) / 2 = 15
b. Number of ports: (n – 1) = 5 ports needed per device
P1-5. This is a LAN. The Ethernet hub creates a LAN as we will see in Chapter 13.
P1-7. In a bus topology, no station is in the path of the signal. Unplugging a station
has no effect on the operation of the rest of the network.
P1-9. In this case, the communication is only between a caller and the callee. A ded-
icated line is established between them. The connection is point-to-point.
CHAPTER 2
PRACTICE SET
Questions
Q2-1. To make the communication bidirectional, each layer needs to be able to pro-
vide two opposite tasks, one in each direction.
Q2-5.
Q2-7. A user datagram is a transport-layer data unit. It decapsulates a data unit going
to the application layer. In this case, the data unit is a message.
Q2-9. We mentioned HTTP, FTP, SMTP, SNMP, TELNET, SSH, and DNS.
Q2-11.
1
2
Q2-13. The application layer is the top layer in the suite; it does not provide services
to any layer, which means multiplexing/demultiplexing does not exist for this
layer.
Q2-15. We do not need a router in this case because a router is needed when there is
more than one path between the two hosts; the router is responsible for choos-
ing the best path at each moment.
Problems
P2-1. The services provided in part a and part b are the opposite of each other.
P2-3. In 10 years, the number of hosts becomes about six times (1.2010 ≈ 6.19) the
number in 2010. This means the number of hosts connected to the Internet is
more than three billion.
P2-5. The advantage of using large packets is less overhead. When using large pack-
ets, the number of packets to be sent for a huge file becomes small. Since we
are adding three headers to each packet, we are sending fewer extra bytes than
in the case in which the number of packets is large. The disadvantage mani-
fests itself when a packet is lost or corrupted during the transmission; we need
to resend a large amount of data.
P2-7.
P2-9. The following shows the situation. If we think about multiplexing as many-to-
one and demultiplexing as one-to-many, we have demultiplexing at the source
3
node and multiplexing at the destination node in the data-link layer. However,
some purists call these two inverse multiplexing and inverse demultiplexing.
Demultiplexing IP IP Multiplexing
L1 L2 L3 L1 L2 L3
P2-11. The following shows the layers. Note that we have not shown the security
checking that you need to pass through because it does not have the counter-
part when you arrive. It must be included in baggage/checking layer.
Source/destination Source/destination
airport airport
Baggage Baggage
checking/claiming checking/claiming
Boarding/unboarding Boarding/unboarding
Takeoff/Landing Takeoff/Landing
Flying
P2-13. The only two layers that need to be changed are the data-link layer and the
physical layer. The new hardware and software need to be installed in all host,
routers, and link-layer switches. As long as the new data-link layer can encap-
sulate and decapsulate datagrams from the network layer, there is no need to
change any protocol in the upper three layers. This is one of the characteristics
of the protocol layering.
4
P2-15. The following shows the layers and the flow of data. Note that each host is
involved in five layers, each switch in two layers, and each router in three lay-
ers.
R1
Point-to-point R2
WAN
Router Router
5 5
4 4
3 3 3 3 3 3
2 2 2 2 2 2 2 2 2 2
1 1 1 1 1 1 1 1 1 1
Host Switch Router Router Switch Host
CHAPTER 3
PRACTICE SET
Questions
Q3-1. The period of a signal is the inverse of its frequency and vice versa: T = 1/f
and f = 1/T.
Q3-3. Fourier series gives the frequency domain of a periodic signal; Fourier analy-
sis gives the frequency domain of a nonperiodic signal.
Q3-7. The Nyquist theorem defines the maximum bit rate of a noiseless channel.
Q3-9. A fiber-optic cable uses light (very high frequency). Since f is very high, the
wavelength, which is λ = c / f, is very low.
Q3-11. The frequency domain of a voice signal is normally continuous because voice
is a nonperiodic signal.
Problems
P3-1.
1
2
P3-3.
P3-5. We know the bandwidth is 2000. The highest frequency must be 100 + 2000 =
2100 Hz. See below:
20
5
Frequency
100 2100
Bandwidth = 2100 100 = 2000
P3-7.
P3-9. There are 8 bits in 16 ns. Bit rate is 8 / (16 × 10−9) = 0.5 × 109 = 500 Mbps
Amplitude
30 volts
10 volts 10 volts
Frequency
10 KHz 20 KHz 30 KHz
P3-17. The total gain is 3 × 4 = 12 dB. To find how much the signal is amplified, we
can use the following formula:
3
12 = 10 log (P2 /P1) → log (P2 /P1) = 1.2 → P2 /P1 = 101.2 = 15.85
P3-25. We have
a. Bit length = (2 ×108 m) × [(1 / (1 Mbps)] = 200 m. This means a bit occu-
pies 200 meters on a transmission medium.
b. Bit length = (2 ×108 m) × [(1 / (10 Mbps)] = 20 m. This means a bit occu-
pies 20 meters on a transmission medium.
4
c. Bit length = (2 ×108 m) × [(1 / (100 Mbps)] = 2 m. This means a bit occu-
pies 2 meters on a transmission medium.
This means
Latency = 10 μs + 20 μs + 1s + 0.01 s ≈ 1.01 s
The transmission time is dominant here because the packet size is huge.
CHAPTER 4
PRACTICE SET
Questions
Q4-1. The three different techniques described in this chapter are line coding, block
coding, and scrambling.
Q4-3. The data rate defines the number of data elements (bits) sent in 1s. The unit is
bits per second (bps). The signal rate is the number of signal elements sent in
1s. The unit is the baud.
Q4-5. When the voltage level in a digital signal is constant for a while, the spectrum
creates very low frequencies, called DC components, that present problems
for a system that cannot pass low frequencies.
Q4-7. In this chapter, we introduced unipolar, polar, bipolar, multilevel, and multi-
transition coding.
Q4-11. In parallel transmission we send data several bits at a time. In serial transmis-
sion we send data one bit at a time.
Problems
P4-1. We use the formula s = c × N × (1/r) for each case. We let c = 1/2.
1
2
P4-3. See the following figure. Bandwidth is proportional to (3/8)N which is within
the range in Table 4.1 (B = 0 to N) for the NRZ-L scheme.
0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
0 1 0 1 0 1 0 1 0 0 1 1 0 0 1 1
Case c Case d
P4-5. See the following figure. Bandwidth is proportional to (12.5 / 8)N which is
within the range in Table 4.1 (B = N to B = 2N) for the Manchester scheme.
B (12.5 / 8) N
Case a Case b
1 1 1 1 1 1 1 1
0 0 0 0 0 0 0 0
0 1 0 1 0 1 0 1 0 0 1 1 0 0 1 1
Case c Case d
3
P4-7. See the following figure. B is proportional to (5.25 / 16)N which is inside
range in Table 4.1 (B = 0 to N/2) for 2B/1Q.
B (5.25 / 8) N
Case a Case b
00 00 00 00 00 00 00 00 11 11 11 11 11 11 11 11
+3 +3
+1 +1
-1 -1
-3 -3
01 10 01 10 01 10 01 10 00 11 00 11 00 11 00 11
+3 +3
+1 +1
-1 -1
-3 -3
Case c Case d
a. NRZ-I: 10011001.
b. Differential Manchester: 11000100.
c. AMI: 01110001.
P4-11. The data rate is 100 Kbps. For each case, we first need to calculate the value
of f / N. We then use Figure 4.8 in the text to find P (energy per Hz). All calcu-
lations are approximations.
a. f /N = 0/100 =0 → P = 0.0
b. f /N = 50/100 = 1/2 → P = 0.3
c. f /N = 100/100 = 1 → P = 0.4
d. f /N = 150/100 = 1.5 → P = 0.0
P4-15.
4
PRACTICE SET
Questions
Q5-1. Normally, analog transmission refers to the transmission of analog signals
using a band-pass channel. Baseband digital or analog signals are converted to
a complex analog signal with a range of frequencies suitable for the channel.
Q5-3. The process of changing one of the characteristics of an analog signal based
on the information in digital data is called digital-to-analog conversion. It is
also called modulation of a digital signal. The baseband digital signal repre-
senting the digital data modulates the carrier to create a broadband analog sig-
nal.
Q5-5. We can say that the most susceptible technique is ASK because the amplitude
is more affected by noise than the phase or frequency.
Q5-7. The two components of a signal are called I and Q. The I component, called
in-phase, is shown on the horizontal axis; the Q component, called quadrature,
is shown on the vertical axis.
Q5-9.
Problems
P5-1. We use the formula S = (1/r) × N, but first we need to calculate the value of r
for each case.
1
2
P5-3. We use the formula r = log2L to calculate the value of r for each case.
a. log24 =2
b. log28 =3
c. log24 =2
d. log2128 =7
a. b.
Q Q
I I
2 3 –3 3
Q Q
2 2
I I
–2 2
–2 –2
c. d.
a. This is ASK. There are two peak amplitudes both with the same phase (0
degrees). The values of the peak amplitudes are A1 = 2 (the distance
between the first dot and the origin) and A2= 3 (the distance between the
second dot and the origin).
b. This is BPSK, There is only one peak amplitude (3). The distance between
each dot and the origin is 3. However, we have two phases, 0 and 180
degrees.
c. This can be either QPSK (one amplitude, four phases) or 4-QAM (one
amplitude and four phases). The amplitude is the distance between a point
and the origin, which is (22 + 22)1/2 = 2.83.
d. This is also BPSK. The peak amplitude is 2, but this time the phases are 90
and 270 degrees.
3
P5-7. We use the formula B = (1 + d) × (1/r) × N, but first we need to calculate the
value of r for each case.
P5-9.
First, we calculate the bandwidth for each channel = (1 MHz) / 10 = 100 KHz.
We then find the value of r for each channel:
P5-11.
a. BAM = 2 × B = 2 × 5 = 10 KHz
b. BFM = 2 × (1 + β) × B = 2 × (1 + 5) × 5 = 60 KHz
c. BPM = 2 × (1 + β) × B = 2 × (1 + 1) × 5 = 20 KHz
CHAPTER 6
PRACTICE SET
Questions
Q6-1. Multiplexing is the set of techniques that allows the simultaneous transmission
of multiple signals across a single data link.
Q6-3. In multiplexing, the word link refers to the physical path. The word channel
refers to the portion of a link that carries a transmission between a given pair
of lines. One link can have many (n) channels.
Q6-7. WDM is common for multiplexing optical signals because it allows the multi-
plexing of signals with a very high frequency.
Q6-9. In synchronous TDM, each input has a reserved slot in the output frame. This
can be inefficient if some input lines have no data to send. In statistical TDM,
slots are dynamically allocated to improve bandwidth efficiency. Only when
an input line has a slot’s worth of data to send is it given a slot in the output
frame.
Q6-11 The frequency hopping spread spectrum (FHSS) technique uses M different
carrier frequencies that are modulated by the source signal. At one moment,
the signal modulates one carrier frequency; at the next moment, the signal
modulates another carrier frequency.
Problems
P6-1. To multiplex 10 voice channels, we need nine guard bands. The required
bandwidth is then B = (4 KHz) × 10 + (500 Hz) × 9 = 44.5 KHz
1
2
P6-3.
P6-5.
a. Each output frame carries 2 bits from each source plus one extra bit for
synchronization. Frame size = 20 × 2 + 1 = 41 bits.
b. Each frame carries 2 bit from each source. Frame rate = 100,000/2 =
50,000 frames/s.
c. Frame duration = 1 /(frame rate) = 1 /50,000 = 20 ms.
d. Data rate = (50,000 frames/s) × (41 bits/frame) = 2.05 Mbps. The output
data rate here is slightly less than the one in Problem 4.
e. In each frame 40 bits out of 41 are useful. Efficiency = 40/41= 97.5%. Effi-
ciency is better than the one in Problem 4.
P6-7. We combine six 200-kbps sources into three 400-kbps. Now we have seven
400-kbps channel.
a. Each output frame carries 1 bit from each of the seven 400-kbps line.
Frame size = 7 × 1 = 7 bits.
b. Each frame carries 1 bit from each 400-kbps source. Frame rate = 400,000
frames/s.
c. Frame duration = 1 /(frame rate) = 1 /400,000 = 2.5 ms.
d. Output data rate = (400,000 frames/s) × (7 bits/frame) = 2.8 Mbps. We can
also calculate the output data rate as the sum of input data rate because
there is no synchronizing bits. Output data rate = 6 × 200 + 4 × 400 = 2.8
Mbps.
P6-9. We need to add extra bits to the second source to make both rates = 190 kbps.
Now we have two sources, each of 190 Kbps.
a. The frame carries 1 bit from each source. Frame size = 1 + 1 = 2 bits.
b. Each frame carries 1 bit from each 190-kbps source. Frame rate = 190,000
frames/s.
d. Output data rate = (190,000 frames/s) × (2 bits/frame) = 380 kbps. Here the
output bit rate is greater than the sum of the input rates (370 kbps) because
of extra bits added to the second source.
O L E L Y I E B H H
TDM
000000011000
101010100111
TDM 10100000
10100111
P6-15. The number of hops = 100 KHz/4 KHz = 25. So we need log225 = 4.64 ≈ 5
bits
P6-17. Random numbers are 11, 13, 10, 6, 12, 3, 8, 9 as calculated below:
N1 = 11
N2 =(5 + 7 × 11) mod 17 − 1 = 13
N3 =(5 + 7 × 13) mod 17 − 1 = 10
N4 =(5 + 7 × 10) mod 17 − 1 = 6
N5 =(5 + 7 × 6) mod 17 − 1 = 12
N6 =(5 + 7 × 12) mod 17 − 1 = 3
N7 =(5 + 7 × 3) mod 17 − 1 = 8
N8 =(5 + 7 × 8) mod 17 − 1 = 9
CHAPTER 7
PRACTICE SET
Questions
Q7-1. The transmission media is located beneath the physical layer and controlled
by the physical layer.
Q7-3. Guided media have physical boundaries, while unguided media are
unbounded.
Q7-5. Twisting ensures that both wires are equally, but inversely, affected by external
influences such as noise.
Q7-7. The inner core of an optical fiber is surrounded by cladding. The core is
denser than the cladding, so a light beam traveling through the core is
reflected at the boundary between the core and the cladding if the incident
angle is more than the critical angle.
Q7-9. In sky propagation radio waves radiate upward into the ionosphere and are
then reflected back to earth. In line-of-sight propagation signals are transmit-
ted in a straight line from antenna to antenna.
Problems
P7-1. See the following table (the values are approximate).
1
2
P7-3. We can use the table in P7-1 to find the power for different frequencies:
The table shows that the power is reduced 5 times, which may not be accept-
able for some applications.
P7-5. As the table in P7-4 shows, for a specific maximum value of attenuation, the
highest frequency decreases with distance. If we consider the bandwidth to
start from zero, we can say that the bandwidth decreases with distance. For
example, if we can tolerate a maximum attenuation of 50 dB (loss), then we
can give the following listing of distance versus bandwidth.
Distance Bandwidth
1 Km 100 KHz
10 Km 1 KHz
15 Km 1 KHz
20 Km 0 KHz
P7-7. We can use the formula f = c / λ to find the corresponding frequency for each
wave length as shown below (c is the speed of propagation):
Refraction
Critical angle
Refraction
Reflection
Critical angle
a. The incident angle (40 degrees) is smaller than the critical angle (60
degrees). We have refraction.The light ray enters into the less dense
medium.
b. The incident angle (60 degrees) is the same as the critical angle (60
degrees). We have refraction. The light ray travels along the interface.
c. The incident angle (80 degrees) is greater than the critical angle (60
degrees). We have reflection. The light ray returns back to the more dense
medium.
CHAPTER 8
PRACTICE SET
Questions
Q8-1. Switching provides a practical solution to the problem of connecting multiple
devices in a network. It is more practical than using a bus topology; it is more
efficient than using a star topology and a central hub. Switches are devices
capable of creating temporary connections between two or more devices
linked to the switch.
Q8-3. There are two approaches to packet switching: datagram approach and vir-
tual-circuit approach.
Q8-5. The address field defines the end-to-end (source to destination) addressing.
Q8-7. In a space-division switch, the path from one device to another is spatially
separate from other paths. The inputs and the outputs are connected using a
grid of electronic microswitches. In a time-division switch, the inputs are
divided in time using TDM. A control unit sends the input to the correct out-
put device.
Q8-9. The two categories of circuit switches are space-division and time-division. In
a space-division switch, the paths are separated from one another spatially. In
a time-division switch, TDM technology is used to separate paths from one
another.
Problems
P8-1. We assume that the setup phase is a two-way communication and the tear-
down phase is a one-way communication. These two phases are common for
all three cases. The delay for these two phases can be calculated as three prop-
agation delays and three transmission delays or
P8-3.
P8-7.
a. Packet 1: 2
b. Packet 2: 3
c. Packet 3: 3
3
d. Packet 4: 2
P8-9.
P8-11.
P8-13.
10 6 10
Crossbars Crossbars Crossbars
n = 10 10 × 6 6 × 10 n = 10
…
10 × 10
…
…
…
N = 100 n = 10 10 × 6 6 × 10 n = 10 N = 100
…
…
…
10 × 10
…
n = 10 n = 10
…
10 × 6 6 × 10
…
P8-15.
PRACTICE SET
Questions
Q9-1. Communication at the network layer is host-to-host; communication at the
data-link layer is node-to-node.
Q9-3. Two hosts in two different networks can theoretically have the same link-layer
address because a link-layer address has only local jurisdiction. However, the
tendency is to avoid this for the future development of the Internet. Even
today, manufacturers of network interface cards (NIC) use different set of
link-layer addresses to make them distinguished.
Q9-7. Station A does not know the link-layer address of station B yet. It uses an all-
zero address to define that this address is desired.
Q9-9. The source hardware address defines the link-layer address of station B.
Q9-11. A host does not know when another host sends an ARP request; it needs to be
ready all of the time to respond to an ARP request.
Q9-13. If an end-to-end address is changed during the packet journey, it is not guaran-
tee that the packet arrives at its destination.
Problems
P9-1. Theoretically, we do not need IP addresses because the global communication
is one to one. If a station has a packet to send to another station, it uses the
link-layer address of the destination host (or even port number related to the
destination) to send a packet. However, if the internet uses the TCP/IP proto-
col suite, then messages pass through the network layer and IP address come
to the picture.
1
2
P9-3. A router is need when we have more than one paths for the packet to travel
from the source to destination. In Figure 9.15 (in the text) there is only path in
each direction. We need no router.
P9-5. The current Internet is using packet-switching at the data-link layer. The
source divides the data at the data-link layer into frames and each frame is
independent.
P9-7. We can think of one journey with four links in this case: home-to-airport, air-
port-to-airport, and airport-to-home
Second Link
Source: Los Angeles Airport
Destination: Denver Airport
Third Link
Source: Denver Airport
Destination: Chicago Airport
Fourth Link
Source: Chicago Airport
Destination: 1432 American Boulevard
P9-9. The communication is impossible unless router R1 can reach router R2 using
another path (not shown in the figure).
P9-11. The packet cannot be delivered unless system A broadcast it and system B
receive it. In this case, all stations receive the packet. Other stations should
drop it.
P9-13. Two approaches can be used. In the first approach, system A has a table to
match the network-layer addresses to data-link addresses, it can use the table
to find the data-link address of system B. In the second approach, system A
has only the list of all data-link layer addresses, it can send unicast ARP
packet to all stations to find out the one which matches the network-layer
address. None of the approaches are practical because a host may change its
data-link layer address without notice (by changing NIC as we see in Chapter
3
P9-15.
a. A: host B: router
b. A: router B: router
c. A: router B: host
d. A: host B: host
CHAPTER 10
PRACTICE SET
Questions
Q10-1. In a single-bit error only one bit of a data unit is corrupted; in a burst error
more than one bit is corrupted (not necessarily contiguous).
Q10-3. In this case, k = 20, r = 5, and n = 20. Five redundant bits are added to the
dataword to create the corresponding codeword.
Q10-5. The minimum Hamming distance is the smallest Hamming distance between
all possible pairs in a set of words.
Q10-9.
a. The generator has three bits (more than required). Both the rightmost bit
and leftmost bits are 1s; it can detect all single-bit errors.
b. This cannot be used as a generator: the rightmost bit is 0.
c. This cannot be used as a generator; it has only one bit.
1
2
a. The length of the error is L = 5, which means L ≤ r. All burst errors of this
size will be detected.
b. The length of the error is L = 7, which means L = r + 1. This CRC will
detect all burst errors of this size with the probability 1 − (0.5)5 ≈ 0.9688.
Almost 312 out of 10,000 errors of this length may be passed undetected.
c. The length of the error is L = 10, which means L > r. This CRC will detect
all burst errors of this size with the probability 1 − (0.5)6 ≈ 0.9844. Almost
156 out of 10,000 errors of this length may be passed undetected. Although
the length of the burst error is increased, the probability of errors being
passed undetected is decreased.
Q10-13. The value of a checksum can be all 0s (in binary). This happens when the
value of the sum (after wrapping) becomes all 1s (in binary).
Q10-15. The following shows that L is the weighted sum of the data items.
Problems
P10-1. We have (vulnerable bits) = (data rate) × (burst duration). The last example
shows how a noise of small duration can affect a large number of bits if the
data rate is high.
P10-3. The following shows the results. In the interpretation, 0 means a word of all 0
bits, 1 means a word of all 1 bits, and ~X means the complement of X.
P10-7. The following shows the result. Part d shows that the Hamming distance
between a word and itself is 0.
a. It has more than one bit and the rightmost and leftmost bits are 1s; it can
detect a single-bit error.
d. Since 15 > 8 + 1, a burst error of size 15 is detected most of the time; it may
be left undetected with probability (1/2)r or (1/2)8 ≈ 0.004.
P10-11. The following shows the errors and how they are detected.
C1 C2 C3 C4 C5 C6 C7 C1 C2 C3 C4 C5 C6 C7
R1 1 1 0 0 1 1 1 1 R1 1 1 0 0 1 1 1 1
R2 1 0 1 1 1 0 1 1 R2 1 0 1 1 1 0 1 1
R3 0 1 1 1 0 0 1 0 R3 0 1 1 0 0 1 1 0
R4 0 1 0 1 0 0 1 1 R4 0 1 0 1 0 0 1 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
C1 C2 C3 C4 C5 C6 C7 C1 C2 C3 C4 C5 C6 C7
R1 1 1 0 0 1 1 1 1 R1 1 0 0 0 1 0 1 1
R2 1 0 1 0 0 0 1 1 R2 1 0 1 1 1 0 1 1
R3 0 1 1 0 0 0 1 0 R3 0 0 1 1 0 1 1 0
R4 0 1 0 1 0 0 1 1 R4 0 1 0 1 0 0 1 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
a. In the case of one error, it can be detected and corrected because the two
affected parity bits can define where the error is.
b. Two errors can definitely be detected because they affect two bits of the
column parity.The receiver knows that the message is somewhat corrupted
(although not where). It discards the whole message.
c. Three errors are detected because they affect two parity bits, one of the col-
umn parity and one of the row parity. The receiver knows that the message
is somewhat corrupted (although not where). It discards the whole mes-
sage.
d. The last case cannot be detected because none of the parity bits are
affected.
P10-13.
a. (x3 + x2 + x + 1) + (x4 + x2 + x + 1) = x4 + x3
b. (x3 + x2 + x + 1) − (x4 + x2 + x + 1) = x4 + x3
c. (x3 + x2) × (x4 + x2 + x + 1) = x7 + x6 + x5 + x2
d. (x3 + x2 + x + 1) / (x2 + 1) = x + 1 (remainder is 0)
P10-15. To detect single bit errors, a CRC generator must have at least two terms and
the coefficient of x0 must be nonzero.
P10-17. This generator is x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2
+ x + 1.
a. It has more than one term and the coefficient of x0 is 1. It detects all single-
bit error.
b. The polynomial is of degree 32, which means that the number of checkbits
(remainder) r = 32. It will detect all burst errors of size 32 or less.
c. Burst errors of size 33 are detected most of the time, but they are slip by
with probability (1/2)r−1 or (1/2)32−1≈ 465 × 10−12. This means 465 out of
1012 burst errors of size 33 are left undetected.
5
d. Burst errors of size 55 are detected most of the time, but they are slipped
with probability (1/2)r or (1/2)32 ≈ 233 × 10−12. This means 233 out of 1012
burst errors of size 55 are left undetected.
P10-21.
a. We calculate R and L values in each iteration of the loop and then concate-
nate L and R to get the checksum. All calculations are in hexadecimal and
modulo 256 or (FF)16. Note that R needs to be calculated before L in each
iteration (L = Lprevious + R).
Initial values: R = 00 L = 00
Iteration 1: R = 00 + 2B = 2B L = 00 + 2B = 2B
Iteration 2: R = 2B + 3F = 6A L = 2B + 6A = 95
Iteration 3: R = 6A + 6A = D4 L = 95 + D4 = 69
Iteration 4: R = D4 + AF = 83 L = 69 + 83 = EC
Checksum = EC83
b. The L and R values can be calculated as shown below (Di is the corre-
sponding bytes), which shows that L is the weighted sum of bytes.
R = D1 + D2 + D3 + D4 = 2B + 3F + 6A + AF = 83
L = 4 × D1 + 3 × D2 + 2 × D3 + 1 × D4 = EC
C = (1 × 0) + (2 × 0) + (3 × 7) + (4 × 2) + (5 × 9) + (6 × 6) + (7 × 7) + (8 × 7) +
(9 × 5) mod 11 = 7
P10-25. The receiver misses samples 21, 23, 25, 27, 29, 31, 33, 35, 37, and 39. How-
ever, the even-numbered samples are received and played. There may be some
glitches in the audio, but that passes immediately.
P10-27. The redundant bits in this case need to find (n + 1) different states because the
corruption can be in any of the n bits or in no bits (no corruption). A set of r
bits can define 2r states. This means that we need to have the following rela-
tionship: 2r ≥ n + 1. We need to solve the equation for each value of k using
trial and error to find the minimum value of r.
6
P10-29. If we need to correct m bits in an n bit codeword, we need to think about the
combination of n objects taking no object at a time or Com(n, 0), which means
the state of no error, the combination of n objects taking one object at a time or
Com (n, 1), which means the state of one-bit error, the combination of n
objects taking two objects at a time or Com(n, 2), which means the state of
two-bit error, and so on. We can have the following relationship between the
value of r (number of redundant bits) and the value of m (the number of
errors) we need to correct.
PRACTICE SET
Questions
Q11-1. The data link layer needs to pack bits into frames. Framing divides a message
into smaller entities to make flow and error control more manageable.
Q11-3. The answer is negative. We need to distinguish between a byte and a charac-
ter. It is better to think of a byte as the data unit at the data-link layer and the
character as the data unit at the application layer. The application layer was
designed to use one byte representing a character (ASCII). Today the tendency
is to use two or more bytes as representing one character (to show characters
in other languages and for other purposes). This does not mean that if a char-
acter is represented as two or more bytes at the application layer, we need to
change the protocol at the data-link layer. A character in the application layer
may change to two bytes (or more), but at the data-link layer, we treat them as
two separate bytes. The size of the flag or other control characters remain the
same.
Q11-7. The flags are the delimiters of the original frames. We need first to unstuff the
frame to remove extra bits. The flags are removed later when we want to
deliver data to the upper layer.
1
2
Q11-13. The timer belongs to the sender entity. The ready or blocking is the state of the
sender. However, in this protocol, the sender does not use the timer when it is
in ready state. It only uses when it is in the blocking state.
Q11-15. The slop of the line between two vertical time line shows the time spent to
move from one situation to another. We assume that encapsulation of the
packets in frames, or vice versa, takes a very short time (negligible). We have
shown this as the horizontal line. On the other hand, sending a frame from one
station to another through media takes a loner time. We have shown this as a
diagonal line.
Q11-17. We need two channels, but not necessarily two media. The same media can be
divided into two channels using multiplexing techniques we learned before.
Q11-23. PPP uses two different one-byte values as the flag and the escape bytes. The
flag byte is (01111110)2, but the escape byte is (01111101)2.
Problems
P11-1. Each escape or flag byte must be pre-stuffed with an escape byte. The follow-
ing shows the result. The red bytes show the added ones.
D E E D D E F D D E E E E D E F D
3
P11-3. The following shows the result. We inserted extra 0 after each group of five
consecutive 1’s.
0001111101100111110010001111101111110000111
P11-5. See the errata (The figure to be changed is Figure 11.11 not Figure 11.9). We
change the figure as shown below. Note that sender remains in the blocking
state when it receives a NAK.
Sending node
Packet came from network layer.
Make a frame, save a copy, and send the frame. Time-out.
Start the timer. Resend the saved frame.
Restart the timer.
Ready Blocking
Corrupted ACK or
NAK arrived.
Start Discard the ACK or NAK
Error-free ACK arrived.
Stop the timer. Error-free NAK arrived.
Discard the saved frame. Resend the saved frame.
Restart the timer.
Receiving node
Start
4
Packet Frame
Packet
ACK
Packet Frame
ACK
Frame (resent) Lost
Time-out
Packet
P11-9.
a. The sender stops the timer and discards the saved frame. It is ready to
receive new packets from the upper layer.
b. The sender resend a copy of the saved frame and starts a new timer.
c. This situation never happens. When the timer is running, the sender is at
the blocking state, not the ready state.
P11-11. The following figure shows the states, events, actions, and transitions.
Event 1 Event 3
State I State II
Event 5 Event 3
Action 1. Action 1.
Event 2 Action 2. Event 4
Action 1. Action 2.
Action 4.
Action 2. Action 6
Action 5.
State III
Event 2
5
Sender
P11-15. The user and the system exchange LCP packets in this phase.
P11-17.
b.
PRACTICE SET
Questions
Q12-1. The answer is CSM/CD.
Q12-5. The transmission rate of this network is Tfr = (1000 bits)/(1Mbps) = 1 ms. The
vulnerable time in slotted Aloha is Tfr = 1ms.
Q12-9. The use of K in Figure 12.13 decreases the probability that a station can
immediately send when the number of failures increases. This means decreas-
ing the probability of collision.
a. After one failure (K = 1), the value of R is 0 or 1. The probability that the
station gets R = 0 (send immediately) is 1/2 or 50%.
b. After four failures (K = 4), the value of R is 0 to 15. The probability that
the station gets R = 0 (send immediately) is 1/16 or 6.25%.
1
2
Q12-15. The sender needs to detect the collision before the last bit of the frame is sent
out. If the collision occurs near the destination, it takes 2 × 3 = 6 μs for the
collision news to reach the sender. The sender has already sent out the whole
frame; it is not listening for a collision anymore.
Q12-17. In random-access methods, there is no control over the medium access. Each
station can transmit when it desires. This liberty may create collisions. In con-
trolled-access methods, the access to the medium is controlled, either by an
authority or by the priority of the station. There is no collision.
a. It uses the combination of RTS and CTS frames to warn other stations that
a new station will be using the channel.
b. It uses NAV to prevent other stations to transmit.
c. It uses acknowledgments to be sure the data has arrived and there is no
need for resending the data.
Q12-23. In CSMA/CD, the lack of detecting collision before the last bit of the frame is
sent out is interpreted as an acknowledgment. In CSMA/CA, the sender can-
not sense collision; there is a need for explicit acknowledgments.
Problems
P12-1. In both pure and slotted Aloha networks, the average number of frames cre-
ated during a frame transmission time (Tfr) is G.
a. For a pure Aloha network, the vulnerable time is (2 × Tfr), which means
that λ = 2G.
p[x] = (e−λ × λx) / (x!) = (e−2G × (2G)x) / (x!)
b. For a slotted Aloha network, the vulnerable time is (Tfr), which means that
λ = G.
3
P12-5. We can find the probability for each network type separately:
P12-7. To find the value of p that maximizes the throughput, we need to find the
derivative of S with respect to p, dS/dp, and set the derivative to zero. Note
that for large N, we can say N − 1 ≈ N.
P12-9. We first find the probability of success for each station in any slot (PSA, PSB,
and PSC). A station is successful in sending a frame in any slot if it has a frame
to send and the other stations do not.
We then find the probability of failure for each station in any slot (PFA, PFB,
and PFC).
PFA = (1 − PSA) = 1 − 0.084 = 0.916
PFB = (1 − PSB) = 1 − 0.144 = 0.856
PFC = (1 − PSC) = 1 − 0.224 = 0.776
a. Probability of success for any frame in any slot is the sum of probabilities
of success.
P[success in first slot] = PSA+ PSB + PSC = (0.084) + (0.144) + (0.224) ≈ 0.452
b. Probability of success for the first time in the second slot is the product of
failure in the first and success in the second.
P[success in second slot for A] = PFA× PSA= (0.916) × (0.084) ≈ 0.077
c. Probability of success for the first time in the third slot is the product of
failure in two slots and success in the third.
P[success in third slot for C] = PFC × PFC × PSC = (0.776)2 × (0.224) ≈ 0.135
P12-11. The data rate (R) defines how many bits are generated in one second and the
propagation speed (V) defines how many meters each bit is moving per sec-
ond. Therefore, the number of bits in each meter nb/m= R / V. In this case,
P12-13. Let Lm be the length of the medium in meters, V the propagation speed, R the
data rate, and nb/m the number of bits that can fit in each meter of the medium
(defined in the previous problems). We can then proceed as follows:
P12-15. The propagation delay for this network is Tp = (2000 m) /(2 × 108 m/s) = 10
μs. The first bit of station A’s frame reaches station B at (t1 + 10 μs).
a. Station B has not received the first bit of A’s frame at (t1 + 10 μs). It senses
the medium and finds it free. It starts sending its frame, which results in a
collision.
b. At time (t1 + 11 μs), station B has already received the first bit of station
A’s frame. It knows that the medium is busy and refrains from sending.
P12-17. The first bit of each frame needs at least 25 μs to reach its destination.
a. The frames collide because 2 μs before the first bit of A’s frame reaches the
destination, station B starts sending its frame. The collision of the first bit
occurs at t = 24 μs.
b. The collision news reaches station A at time t = 24 μs + 24 μs = 48 μs. Sta-
tion A has finished transmission at t = 0 + 40 = 40 μs, which means that the
collision news reaches station A 8 μs after the whole frame is sent and sta-
tion A has stopped listening to the channel for collision. Station A cannot
detect the collision because Tfr < 2 × Tp.
c. The collision news reaches station B at time t = 24 + 1 = 25 μs, just two μs
after it has started sending its frame. Station B can detect the collision.
a. After the first collision (k = 1), R has the range (0, 1). There are four possi-
bilities (00, 01, 10, and 11), in which 00 means that both station have come
up with R = 0, and so on. In two of these four possibilities (00 or 11), a col-
lision may occur. Therefore the probability of collision is 2/4 or 50 percent.
b. After the second collision (k = 2), R has the range (0, 1, 2, 3). There are six-
teen possibilities (00, 01, 02, 03, 10, 11, …, 33). In four of these sixteen
possibilities (00, 11, 22, 33), a collision may occur. Therefore the probabil-
ity of collision is 4/16 or 25 percent.
P12-23. We need to check three properties: the number of sequences (N) in each chip
should be a power of 2, the dot product of any pair of chips should be 0, and
the dot product of each chip with itself should be N.
P12-25. Alice sends the code (0110)2 and Bob sends the code (1011)2. A 0 bit is
changed to −1 and a 1 bit is changed to +1. In other words, Alice is sending dA
= (−1, +1, +1, −1) and Bob is sending dB = (+1, −1, +1, +1). Each data item is
multiplied by the corresponding code. The signal generated by Alice and Bob
is shown below.
d1 = 0 d2 = 1 d3 = 1 d4 = 0
Alice
d1 = 1 d2 = 0 d3 = 1 d4 = 1
Bob
Signal sent
+2 −2 +2 +2
Alice
[+2/2, −2/2, +2/2 +2/2] (1011)2 (B)16
−2 +2 +2 −2
Bob
[−2/2, +2/2, +2/2 −2/2] (0110)2 (6)16
PRACTICE SET
Questions
Q13-1. In a full-duplex Ethernet, each station is connected to the switch and the
media is divided into two channels for sending and receiving. No two stations
compete to access the channels; each channel is dedicated.
Q13-3. The common traditional Ethernet implementations are 10Base5, 10Base2, 10-
Base-T, and 10Base-F.
Q13-7. The preamble is a 56-bit field that provides an alert and timing pulse. It is
added to the frame at the physical layer and is not formally part of the frame.
SFD is a one-byte field that serves as a flag.
Q13-9. A bridge can raise the bandwidth and separate collision domains.
Problems
P13-1. We interpret each four-bit pattern as a hexadecimal digit. We then group the
hexadecimal digits with a colon between the pairs:
5A:11:55:18:AA:0F
P13-3. The first byte in binary is 00000111. The least significant bit is 1. This means
that the pattern defines a multicast address.
P13-5. The smallest Ethernet frame is 64 bytes and carries 46 bytes of data (and pos-
sible padding). The ratio is (data size) / (frame size) in percent. The Ratio is
71.9 percent.
1
2
P13-7. We can calculate the load for each activity (as shown below) and add them
together. The total load is 2,888,890 bps or almost 3 Mbps. However, we have
not specified how fast we want the files we want to be downloaded. We have
assumed that the employee is so patient to allow the files to be downloaded at
the portion of the rate assigned for part a. In real case, the total rate is much
higher.
a. There are 100,000,000 bits on the channel in each second, which means
that (2/1000) × 100,000,000 = 200,000 bits are affected by the noise.
b. If each packet is 1000 bytes or 8,000 bits (assuming ASCII characters), this
means 200,000/8,000 = 25 packets. However, since the noise can start from
the beginning or near the end of the first packet, 25 or 26 packets are possi-
bly destroyed.
a. There are 10,000,000,000 bits on the channel in each second, which means
that (2/1000) × 10,000,000,000 = 20,000,000 bits are affected by the noise.
b. If each packet is 1000 bytes or 8,000 bits (assuming ASCII characters), this
means 20,000,000/8,000 = 2500 packets. However, since the noise can
start from the beginning or near the end of the first packet, 2500 or 2501
packets are possibly destroyed.
CHAPTER 14
PRACTICE SET
Questions
Q14-1. The telephone network is made of three major components: local loops,
trunks, and switching offices.
Q14-3. Signaling System Seven (SS7) is the protocol used to provide signaling ser-
vices in the telephone network. It is somehow similar to the five-layer Internet
model.
Q14-5. Dial-up modems use part of the bandwidth of the local loop to transfer data.
The latest dial-up modems use the V-series standards such as V.32 and V.32bis
(9600 bps), V.34bis (28,800 or 33,600 bps), V.90 (56 kbps for downloading
and 33.6 kbps for uploading), and V.92. (56 kbps for downloading and 48
kbps for uploading.
Q14-7. The traditional cable networks use only coaxial cables to distribute video
information to the customers. The hybrid fiber-coaxial (HFC) networks use a
combination of fiber-optic and coaxial cable to do so.
Q14-9. The cable modem (CM) is installed on the subscriber premises. The cable
modem transmission system (CMTS) is installed inside the distribution hub by
the cable company. It receives data from the Internet and passes them to the
combiner, which sends them to the subscriber. The CMTS also receives data
from the subscriber and passes them to the Internet.
Q14-13. STSs are the hierarchy of electrical signals defined by the SONET standards.
OCs are the corresponding optical signals.
Q14-15. A single clock handles the timing of transmission and equipment across the
entire network.
1
2
Q14-17. SONET defines four layers: path, line, section, and photonic.
Q14-19. A virtual tributary is a partial payload that can be inserted into an STS-1 and
combined with other partial payloads to fill out the frame. Instead of using all
86 payload columns of an STS-1 frame for data from one source, we can sub-
divide the SPE and call each component a VT.
Q14-21. The larger data items can block the access of small data items to the multi-
plexers. This results in unusual delays for small items. This may cause the
small data items to be assumed lost and resent.
Q14-23. A transmission path (TP) is the physical connection between a user and a
switch or between two switches. It is divided into several (VPs), which pro-
vide a connection or a set of connections between two switches. VPs in turn
consist of several virtual circuits (VCs) that logically connect two points
together.
Q14-25.
Problems
P14-1. Telephone networks were designed to carry voice, which was not packetized.
A circuit-switched network, which dedicates resources for the whole duration
of the conversation, is more suitable for this type of communication.
P14-3. In a telephone network, the telephone numbers of the caller and callee are
serving as source and destination addresses. These are used only during the
setup (dialing) and teardown (hanging up) phases.
P14-5. Although we did not discuss these rate in the book, the following information
can be obtained from the Internet.
56 kbps
50 kbps
30 kbps
14.4 kbps
10 kbps 9600 bps
P14-7. We can calculate the time based on the assumption of 56 Kbps data rate:
P14-9. We can calculate the time based on the assumption of 10 Mbps data rate:
P14-11. The cable modem technology is based on the bus (or rather tree) topology. The
cable is distributed in the area and customers have to share the available band-
width. This means if all neighbors try to transfer data, the effective data rate
will be decreased.
P14-13. Each STS-n frame carries (9 × n × 86) bytes of bytes. SONET sends 8000
frames in each second. We can then calculate the user data rate as follows:
P14-15. The user data rate of STS-1 is (8000 × 9 × 86 × 8) = 49.536 Mbps. To carry a
load with a data rate 49.540, we need another 4 kbps. This means that we need
to insert 4000 / 8 = 500 bytes into every 8000 frames. In other words, 500 out
of every 8000 frames need to allow the H3 byte to carry data. For example, we
can have sequences of 16 frames in which the first frame is an overloaded
frame and then 15 frames are normal.
P14-17.
a. The minimum number of cells is 1. This happens when the data size £ 36
bytes. Padding is added to make it exactly 36 bytes. Then 8 bytes of header
creates a data unit of 44 bytes at the SAR layer.
b. The maximum number of cells can be determined from the maximum num-
ber of data units at the CS sublayer. If we assume no padding, the maxi-
mum size of the packet is 65535 + 8 = 65543. This needs 65543 / 44 ≈
1489.61. The maximum number of cells is 1490. This happens when the
data size is between 65,509 and 65,535 (inclusive) bytes. We need to add
between 17 to 43 (inclusive) bytes of padding to make the size 65552
bytes. The 8 byte overhead at the CS layer makes the total size 65560
which means 1490 data units of size 44.
CHAPTER 15
PRACTICE SET
Questions
Q15-1. The medium of a wired LAN is guided (cable or wire); the medium of a wire-
less LAN is unguided (air).
Q15-5. In a wireless environment, a receiving station may receive more than one sig-
nal from the same sender related to the same message. One of these signals
can be the one received directly; the others are signals reflected back from
some barrier. Since the signals have travelled different distances, they can be
out of phase. The combination of these signals creates a signal which is the
distorted version of the original signal sent by the sender. It is sometimes diffi-
cult to detect the original message. We often have difficulty understanding the
other party when talking on a cellular phone
Q15-7. Error rate is much higher in a wireless LAN than in a wired LAN. Fragmenta-
tion reduces the frame size and reduces the probability of error in a frame.
Q15-9. The answer is negative. The addresses are selected from the same address
space. For example, if locally there are one wireless and one wired device,
they cannot have the same MAC address; addresses should be unique.
Q15-11. In a wired network, a link-layer switch is connected to the hosts via point-to-
point dedicated connections; there is no need for addresses for communication
between hosts and the switch. In a wireless network, an AP is connected to the
hosts via a multicast network (air); the MAC addresses of the host and the AP
make the communication more efficient; when a host sends a frame to the AP,
all other hosts drop the received copy of the frame at the MAC sublayer when
they find that the frame does not belong to them.
1
2
Q15-13. A piconet is the smallest ad hoc network. It is made of one primary (master)
station and up to seven secondary (slave) stations. A scatternet is a larger ad
hoc network made by gluing two or more piconets using one of the secondary
stations in one piconet to act as the primary station in another piconet.
Q15-15. The allocated band for Bluetooth is the ISM 2.4 GHz band, which actually
spans from 2.4 GHz to 2.4835 GHz. This means that the bandwidth is actually
0.0835 GHz or 83.5 MHz.
Q15-17. The 83.5 MHz bandwidth in Bluetooth is divided into 79 channels, each of 1
MHz. The rest of the bandwidth is used for guard bands.
Q15-19. The modulation technique is GFSK (FSK with Gaussian bandwidth filtering).
The carrier frequencies are 2042 + n MHz, in which n can be 0 to 79 (in most
countries).
Q15-21. The L2CAP layer has a role similar to the LLC sublayer in a LAN. It provides
multiplexing, segmentation and reassembly, quality of service, and group
management.
Problems
P15-1. Address 1 in 802.11 always defines the destination address in the current
movement of the frame in the wireless environment. The following figure
shows address 1 in all four situations:
From DS To DS
A1
Legend
A1
A1 : address 1
b. 01 c. 10 : current move
: previous move
A1
Wireless DS : next move
a. 00 : frame
A1
d. 11
a. When both To DS and From DS bits are 0s, the communication is confined
to the BSS. The frame has not entered the BSS before the current move-
ment and will not leave the BSS after the current movement. We have an ad
3
d. When both To DS and From DS bits are 1s, the frame is travelling in the DS
itself, which is wireless. A frame is going from one AP in the source BSS
to another AP in the destination BSS, but we are interested in the address
field when the frame is travelling in the wireless DS. Address 1 is the
address of the AP in the destination BSS.
P15-3. In 802.11, what address 3 defines depends on the type of the network. In an ad
hoc, address 3 defines the BSS identification. In an infrastructure network, it
either defines the address of the source in the previous move or the address of
the destination in the next move, whichever is appropriate. The following fig-
ure shows address 3 in all four situations:
A3 A3
From DS To DS
Legend
A3 = BSS ID
A3 : address 3
b. 01 c. 10 : current move
: previous move
Wireless DS
: next move
a. 00 : frame
A3
d. 11
a. When both the To DS and From DS bits are 0s, the communication is con-
fined to the BSS. The frame has not entered the BSS before the current
movement and will not leave the BSS after the current movement. We have
an ad hoc network; the communication is between two stations. Address 3
will set to the BSS ID to emphasize that the frame belongs to this BSS.
Other BSSs that may accidentally receive the frame will discard it.
router) that originally sent the 802.3 frame. This address is needed for the
final destination in case a response is needed.
d. When both the To DS and From DS bits are 1s, the frame is travelling in the
DS itself, which is wireless. A frame is going from one AP in the source
BSS to another AP in the destination BSS, but we are interested in the
address field when the frame is travelling in the wireless DS. Address 3 is
the address of the final destination host in the destination BSS. This
address helps the AP to know the destination of the frame that will travel in
the second BSS.
P15-5. We need to remember that the exchanged frames do not leave the BSS. All
addresses are addresses of entities inside the BSS. With this in mind, we
answer each question:
a. Since the exchanged frames do not leave the BSS, the values of both the To
DS and From DS bits in all frames are set to 0s. No frame comes from a
distribution system (From DS = 0) and no frame goes to a distribution sys-
tem (To DS = 0).
b. The RTS frame needs to be sent by the station that wants to send the data
frame, station A in this case. There are two addresses in this frame (address
1 and address 2). The value of address 1 is the recipient of the data frame
that follows (address 1 = B’s address); the value of address 2 is the address
of the station that will send the data frame (address 2 = A’s station). Note
that since the channel is a broadcast channel, every nonhidden station will
receive the RTS frame, but address 1 emphasizes that station B needs to
respond to the RTS frame.
c. The CTS frame needs to be sent by the future recipient of the data frame,
which is station B in this case. The value of address 1 in this frame (the
only address field) is the address of the intended recipient of the CTS
frame, which is station A. All stations that are not hidden from B also
receive this frame.
d. After receiving the CTS frame, station A can send the data frame. The
value of the address 1 field in this frame is the address of the recipient of
the frame, which is station B. The value of the address 2 field is the address
of the station sending the frame, which is station A. Address 3 in this case
is the address of any entity involved in the communication besides the
5
sender and receiver. Since there is no other entity involved, the address
chosen is the BSS identification, which has the same format as other MAC
addresses. This identification is used here to show that the communication
should be confined to this BSS. Stations in other BSSs should drop this
frame if it is accidentally received by them. The value of the address 4 field
is not used in this case because the frame does not leave the BSS.
e. The ACK frame needs to be sent by the recipient of the data frame, station
B in this case. The value of the address 1 in this frame is the address of the
station that sent the data frame, address A.
b. Communication from the AP1 to the AP2 now occurs in a wireless envi-
ronment; we need to consider four addresses. However, since the frame
needs to go to the distribution system and comes from the distribution sys-
tem, the value of both To DS bit and From DS are set to 1s. Address 1 is the
address of the immediate receiver, which is the address of the AP2.
Address 2 is the address of the immediate sender, which is the AP1.
Address 3 is the address of the final destination which is station C. Address
4 is the address of the original source, which is station A. The addresses are
shown below:
P15-9. The following shows how the fields in the 802.3 frame are filled, by the AP,
from the fields of the 802.3 frame. The values of some fields are discarded.
Recalculated
Discarded Discarded
Discarded
a. The host knows the IP address of its default router (address of interface
m2). It may also know the MAC address of this interface (in its cache).
Otherwise, the AP2 needs to send an ARP frame to discover. The host
encapsulates its IP datagram in an 802.11 frame in which address 1 is the
MAC address of the AP2 and address 2 is its own MAC address. Address 3
in this case is the MAC address of the router (interface m2). The frame is
sent to the AP2.
b. The AP2 receives the frame and changes the frame format. It now creates
an 802.3 frame in which the destination address is a copy of address 3 and
the source address is a copy of address 2 (the original host).
P15-13. DCF is using a version of the Stop-and-Wait protocol. Each frame is consid-
ered as one or more fragments. In other words, if a frame is not fragmented, it
is considered as the first and only fragment. Each fragment needs to be indi-
vidually acknowledged by an ACK frame. The sender does not send the frag-
ment until it receives the acknowledgment for the previous frame. The sender
sets a timer, and if the acknowledgment for a fragment does not arrive, it
resends it. The Stop-and-Wait protocol (used in this case), however, is simpler
than the one we discussed before because, in this case, no sequence number
and no acknowledgment number is used. Although a data frame has the SC
field, the sequence number and fragment number defined there are actually the
identification number and offset that define each fragment uniquely for the
purpose of reassembly.
7
P15-15. IP uses three fields in the header for fragmentation: identification (16 bits),
flags (3 bits), and offset (13 bits). The 802.11 protocol uses three subfields in
the header for this purpose: fragment number (4 bits), sequence number (12
bits), and more fragment (1 bit). The fragment number and sequence number
subfields are part of the sequence control (SC) field; the more fragment sub-
field is part of the frame control (FC) field. The following shows the relation-
ship between the fields in the two protocols:
P15-17. To better understand the value of the NAV that needs to be set for each frame,
we first show the time line for the transactions and the NAV (ignoring the
propagation delay) in the following figure.
SIFS SIFS
SIFS
ACK +
Data’s NAV SIFS
b. CST = 40 + 4 + 2 × 1 = 46 μs.
c. Data = 4 + 1 = 5 μs.
8
d. ACK = 0 μs. After the ACK is transmitted, there is no need for channel
reservation.
a. Station A wins the contention and can start using the channel.
b. Station B needs to wait four slots and test the channel again. If the channel
is idle, it can use the channel; otherwise, it should start the procedure again.
c. Station C needs to wait 20 slots and test the channel again. If the channel is
idle, it can use the channel; otherwise, it should start the procedure again.
a. The short interframe space (SIFS) is used to allow the two parties in a sin-
gle session to continue their transmission. This includes the time that a
party needs to send a CTS after receiving an RTS, sending an ACK after
receiving a data fragment, or sending the next fragment after receiving the
ACK for the previous fragment. It cannot be used to start a new session.
b. The base station that needs to send a beacon or poll frame (in PCF mode)
needs to wait for a PIFS period of time to do so. PIFS is longer than SIFS
to allow other stations to finish their sessions. However, if a time period of
SIFS elapses and the entitled station did not use its opportunity, the base
station can send its beacon or poll frame (after waiting PIFS) if it has one.
c. If a base station does not use its opportunity after PIFS time and a time
equal to DIFS elapses, a station using DCF can start a new dialog. You may
have noticed that PIFS is smaller than DIFS to give priority to the PCF sub-
layer.
d. An EIFS is normally used when there is an error in transmission and the
station needs to wait this period of time to report the situation. This period
is larger than the other ones to force the station to wait to see if the error is
corrected before an action. For example, if a station has received a wrong
frame, it needs to wait for a while to see if the correct frame will eventually
arrive.
PRACTICE SET
Questions
Q16-1. WiMax defines a wireless WAN.
Q16-3. This is the case of a mobile WiMax. The mobile phone communicates with a
mobile subscriber station (MSub).
Q16-5. A mobile switching center connects cells, records call information, and is
responsible for billing.
Q16-7. In a hard handoff, a mobile station communicates with only one base station.
In a soft handoff, a mobile station communicates with two base stations at the
same time.
Q16-9. D-AMPS is a digital cellular phone system that is backward compatible with
AMPS.
Q16-11. CDMA encodes each traffic channel using one of the rows in the Walsh-64
table.
Q16-13. A GEO satellite has an equatorial orbit since the satellite needs to remain
fixed at a certain spot above the earth.
Q16-15. A satellite orbiting in a Van Allen belt would be destroyed by the charged par-
ticles. Therefore, satellites need to orbit either above or below these belts.
Q16-17. GPS is a satellite system that provides land and sea navigation data for vehi-
cles and ships. The system is also used for clock synchronization.
1
2
Problems
P16-1. Let us assume that WiMax uses only TDM. In each time slot, a frame is in the
air. The base station fills the data to send to substation in the downstream sub-
frame; the substations fills the data to send to the base station in the upstream
subframe. Let us give a very simplified example to make the point clear.
Assume that the time slot is one minute and the communication is instanta-
neous. This means in each minute there is a frame in the air.
a. During the first half of each minute, the base station is sending data to the
substations and the substations are receiving data from the base station
(downstream communication).
b. During the second half of each minute, the substations are sending data to
the base station and the base station is receiving data from the substations
(upstream communication).
5
5 2
2 1 3
1 3 4 5
4 5 2
5 2 1 3
2 1 3 4
1 3 4 5
4 5 2
2 1 3
1 3 4
4
P16-5. In AMPS, there are two separate bands for each direction in communication.
In each band, we have 416 analog channels. Out of this number, 21 channels
are reserved for control. With a reuse factor of 7, the maximum number of
simultaneous calls in each cell is
P16-7. In GSM, separate bands are assigned for each direction in communication.
This means 124 analog channels are available in each cell (assuming no con-
trol channels). Each analog channel carries 1 multiframe. Each multiframe
carries 26 frames (2 frames are for control). Each frame allows 8 calls. With a
reuse factor of 3, we have
P16-9. A 3-KHz voice signal is modulated using FM to create a 30-KHz analog sig-
nal. As we learned in Chapter 5, the bandwidth required for FM can be deter-
mined from the bandwidth of the audio signal using the formula
P16-11. GPS satellites are orbiting at 18,000 km above the earth surface. Considering
the radius of the earth, the radius of the orbit is then (18,000 km + 6378 km) =
24,378 km. Using the Kepler formula, we have
P16-13. Globalstar satellites are orbiting at 1400 km above the earth surface. Consid-
ering the radius of the earth, the radius of the orbit is then (1400 km + 6378
km) = 7778 km. Using the Kepler formula, we have
P16-15. In problem P16-6 we showed that the maximum simultaneous calls per cell
for D-APMS is 356. Using the total bandwidth of 50 MHz (for both direc-
tions), we have
P16-17. In problem P16-8, we showed that the maximum simultaneous calls per cell
for IS-95 is 1100. Using the total bandwidth of 50 MHz (for both directions),
we have
PRACTICE SET
Questions
Q17-1. An amplifier amplifies the signal, as well as noise that may come with the sig-
nal, whereas a repeater regenerates the signal, bit for bit, at the original
strength.
Q17-3. A transparent switch is a switch in which the stations are completely unaware
of the switch’s existence. If a switch is added or deleted from the system,
reconfiguration of the stations is unnecessary.
Q17-5. A forwarding port forwards a frame that it receives; a blocking port does not.
Q17-7. Members of a VLAN can send broadcast messages with the assurance that
users in other groups will not receive these messages.
b. A router needs to search a routing table for finding the output port based on
the best route to the final destination; A switch needs only to consult a fil-
tering table based on the location of stations in a local network.
1
2
Problems
P17-1.
LAN 1 BC LAN 1
A A
B C B C
1 1 1 1
Addr Port Addr Port Addr Port Addr Port
B 1 B 1
2 2 2 2
E F E F
D D BC
LAN 2 LAN 2 BC
LAN 1 A BC LAN 1 A
BC
B C B C
1 1 1 1
Addr Port Addr Port Addr Port Addr Port
B 1 B 1 B 1 B 1
2 2 2 2
E F E F
D D BC
LAN 2 LAN 2 BC
P17-5. The looping problem comes from redundancy (two switches between the
LANs instead of just one). If we change the hub in both LANs, it reduces the
traffic in each LAN, but the switches between the two LANs still forward the
frame in both direction.
3
Root
1 1
0 S1 LAN 1 S2
1 2
1 LAN 2 S3 LAN 3
a. Spanning Tree
S1 LAN 1 S2
Blocking Blocking
LAN 2 S3 LAN 3
b. Logical connection with blocking port
P17-9. The router in this case acts as a link-layer switch and needs a link-layer
address.
CHAPTER 18
PRACTICE SET
Questions
Q18-1. The transport layer communication is between two ports; the network layer
communication is between two hosts. This means that each layer has a differ-
ent source/destination address pair; each layer needs a different header to
accommodate these pair of addresses. In addition, there are other pieces of
information that need to be separately added to the corresponding header.
Q18-3. Forwarding is delivery to the next node. A router uses its forwarding table to
send a packet out of one of its interfaces and to make it to reach to the next
node. In other words, forwarding is the decision a router makes to send a
packet out of one of its interfaces. Routing, on the other hand, is an end-to-end
delivery resulting in a path from the source to the destination for each packet.
This means a routing process is a series of forwarding processes. To enable
each router to perform its forwarding duty, routing protocols need to be run-
ning all of the time to provide updated information for forwarding tables.
Although forwarding is something we can see in the foreground, in the back-
ground, routing provides help to the routers to do forwarding.
Q18-7. None of these services are implemented for the IP protocol in order to make it
simple.
Q18-9. The throughput is the smallest transmission rate, or 140 Kbps. The bottleneck
is now the link between the source host and R1.
Q18-11. Yes. We can find the prefix length using only the block size. The prefix length
is directly related to the block size as shown below:
n = 32 − log2N
1
2
Problems
P18-1. The size of the address in each case is the base to the power of the number of
digits:
P18-3. We change each 8-bit section to the corresponding decimal value and insert
dots between the bytes.
a. 94.176.117.21
b. 137.142.208.49
c. 87.132.55.15
P18-5. The class can be defined by checking the first few bits (see figure 4.31). We
need to stop checking if we find a 0 bit or four bits have already been checked.
a. N = 232−0 = 4,294,967,296
b. N = 232−14 = 262,144
c. N = 232−32 = 1
P18-9. We can first write the prefix in binary and then change each 8-bit chunk to
decimal:
P18-11. We first write each potential mask in binary notation and then check if it has a
contiguous number of 1s from the left followed by 0s.
P18-13. We write the address in binary and then keep only the leftmost n bits.
P18-15. Both NAT and DHCP can be used for this purpose. DHCP dynamically
assigns one of the assigned addresses when a host needs to access the Internet;
NAT permanently assigns a set of private addresses to the host, but maps the
private address to the global address when a host needs to use the Internet.
P18-17. The total number of addresses is 212 = 4096. This means that there are 512
addresses for each network. We can divide the whole address space into eight
blocks (block 0 to block7), each of 512 addresses. The addresses in each block
are allocated as (0 to 511), (512 to 1023), (1024 to 1535), (1536 to 2047), …,
(3584 to 4095). It can be checked that each block is allocated according to the
two restrictions needed for the proper operation of CIDR. First, the number of
addresses in each block is a power of 2. Second, the first address is divisible
by the number of addresses as shown below:
The prefix length for each group is ni = 12 − log2512 = 3. We can then write
the ranges in binary to find the prefix for each block.
Block Range Range in binary n Prefix
0 0 to 511 000000000000 to 000111111111 3 000
1 512 to 1023 001000000000 to 001111111111 3 001
2 1024 to 1535 010000000000 to 010111111111 3 010
3 1536 to 2047 011000000000 to 011111111111 3 011
4 2048 to 2559 100000000000 to 100111111111 3 100
5 2560 to 3071 101000000000 to 101111111111 3 101
6 3072 to 3583 110000000000 to 110111111111 3 110
7 3584 to 4095 111000000000 to 111110000000 3 111
The following figure shows the outline and the forwarding table. Note that
each interface can use one of the addresses in the corresponding block. The
addresses are written in decimal (not dotted-decimal) because of the address
space size.
4
P18-19. One way to do this is to first find the size of each block. We can then add the
size to the first address in the block to find the last address. Next, we can put
the blocks together to find whether they can be combined into a larger block.
Since the blocks are contiguous, we can combine the three blocks into a larger
one. The new block has 256 addresses and n = 32− log2256 = 24.
16.27.24.127/26
16.27.24.128/25
16.27.24.255/24
16.27.24.63/26
16.27.24.64/26
16.27.24.0/26
P18-21.
Forwarding table
Org.: Organization m1
Prefix Interface
ISP Org. 1 Default m0
I.: Interface m2
Org. 2 0001000 00001100 01000000 m1
Dis.: Discard
m3 0001000 00001100 01000001 m2
Org. 3
m4 0001000 00001100 01000010 m3
m0 Org. 4
0001000 00001100 01000011 m4
Internet m5
Org. 5 0001000 00001100 01000100 m5
m6
Org. 6 0001000 00001100 01000101 m6
m7 0001000 00001100 01000110 m7
Dis. Org. 7
m8 0001000 00001100 01000111 m8
Org. 8
0001000 00001100 01001 Dis.
d. To find the first address in subnet 1024, we need to add 65,472 (1023 × 64)
in base 256 (0.0.255.192) to the first address in subnet 1. The last address
can then be found by adding 63 to the first.
a. Router R2 applies the mask /26 to the address (or it extracts the leftmost 26
bits) resulting in the network address/mask of 140.24.7.0/26, which does
not match with the first entry in the forwarding table.
b. Router R2 applies the mask /24 to the address (or it extracts the leftmost 24
bits) resulting in the network address/mask of 140.24.7.0/24, which
matches with the second entry in the forwarding table. The packet is sent
out from interface m0 to router R1.
c. Router R1 applies the mask /26 to the address (or it extracts the leftmost 26
bits) resulting in the network address/mask of 140.24.7.0/26, which
matches with the first entry in the forwarding table. The packet is sent out
from interface m0 to organization 1.
CHAPTER 19
PRACTICE SET
Questions
Q19-1. The minimum length of the IPv4 header is 20 bytes and the maximum is 60
bytes. The value of the header length field defines the header length in multi-
ples of four bytes, which means that HLEN can be between 5 and 15. It cannot
be less than 5 and it cannot be greater than 15. It is exactly 5 when there is no
option.
Q19-3. Since the fragmentation offset field shows the offset from the beginning of the
original datagram in multiples of 8 bytes, an offset of 100 indicates that the
first byte in this fragment is numbered 800, which means bytes numbered 0 to
799 (for a total of 800 bytes) were sent before.
Q19-5. The header length is 6 × 4 = 24. The option length is then 24 − 20 = 4 bytes.
Q19-7. The protocol field and the port numbers both have the same functionality:
multiplexing and demultiplexing. Port numbers are used to do these tasks at
the transport layer; the protocol field is used to do the same at the network
layer. We need only one protocol field at the network layer because payload
taken from a protocol at the source should be delivered to the same protocol at
the destination. The client and server processes, on the other hand, normally
have different port numbers (ephemeral and well-known), which means we
need two port numbers to define the processes. The size of the protocol field
defines the total number of different protocols that use the service of the net-
work layer, which is a small number (eight bits is enough for this purpose). On
the other hand, many new applications may by added every day that needs a
larger size of the port number field (sixteen bits is assigned).
Q19-9. Each datagram should have a unique identification number that distinguishes
it from other datagrams sent by the same source. The identification number is
copied into all fragments. In other words, the identification number glues all
fragments belonging to the same datagram together.
1
2
Q19-11. If this happens, we may enter a loop, a vicious circle. The first datagram is in
error; the second datagram reports error in the first. If the second datagram is
also in error, the third datagram will be carrying error information about the
second, and so.
Q19-13. These two messages need new fields and information that is not supported by
the ICMP protocol. A new application-layer client and server are needed to
send requests and receive responses. The designer of Mobile IP has decided to
implement it at the application layer instead of at the network layer, which
requires changes in this layer. UDP was selected instead of TCP as the trans-
port layer because of its lower overhead and because the messages exchanged
have clear boundaries and fixed size.
Q19-15. An ICMP solicitation message has all the necessary fields to be used as an
agent solicitation. No extra fields are needed.
Problems
P19-1. The total length of the datagram is (00A0)16 = 160 bytes. The header length is
5 × 4 = 20. The size of the payload is then 160 − 20 = 140. The efficiency =
140 / 160 = 87.5%.
a. The wrapped sum can be found by adding the quotient and remainder when
dividing the sum by the modulus, which is 216 or (10000)16 in this case.
Note that the modulus is actually (FFFF + 1)16. Since the wrapped sum has
less than 8 digits (we can use the following steps); otherwise; we need a
loop to continuously find the quotient and remainder. Note that we use the
symbol (/) to define quotient and (%) to define remainder. All calculations
are in hexadecimal.
b. The checksum can be calculated from the wrapped sum easily. All calcula-
tions are in hexadecimal.
P19-5. We can calculate the sum, wrapped sum and checksum after each word if we
keep track of the sum in each step. The following shows the process. The
value of the last row in the last column shows the final checksum. All calcula-
tions are in decimal.
P19-7. In each case, we first need to think about the value of M and then the value of
the offset:
a. Since M = 1, it means there are more fragments and this is the first or mid-
dle; since the offset field is zero, it means this is the first fragment.
b. Since M = 1, it means there are more fragments and this the first or middle;
since the offset field is nonzero, it means this is a middle fragment.
P19-9. We show the value of each word in hexadecimal and then add them to get the
sum. Note the value of the sum in this case is less than FFFF + 1, so we do not
need to wrap the sum using quotient and remainder. We subtract the sum from
the FFFF to get the checksum.
ICMP
Advertisement Message
16 8 1456
10800 0 Reserved
ICMP
Advertisement Message
16 20 1672
14400 0 Reserved
128.1.1.2
128.1.1.3
128.1.1.4
CHAPTER 20
PRACTICE SET
Questions
Q20-1. According to the principle we mentioned in the text, the shortest path is the
inverse of the original one. The shortest path is G → E → B → A.
Q20-3. Link-state routing uses Dijkstra’s algorithm to first create the shortest-path
tree before creating the forwarding table. The algorithm needs to have the
complete LSDB to start.
Q20-5. The three ASs described in the text are stub, multihomed, and transient. The
first two do not allow transient traffic; the third does. The stub and multi-
homed ASs are similar in that they are either the sink or source of traffic; the
first is connected to only one other AS, but the second is connected to more
than one ASs.
Q20-9. Although RIP is running as a process using the service of the UDP, the process
is called a daemon because it is running all the time in the background. Each
router acts both as a client and a server; it acts as a client when there is a mes-
sage to send; it acts as a server when a message arrives.
Q20-11. OSPF divides an AS into areas, in which routing in each area is independent
from the others; the areas only exchange a summary of routing information
between them. RIP, on the other hand, considers the whole AS as one single
entity.
Q20-13. In RIP, each router just needs to share its distance vector with its neighbor.
Since each router has one type of distance vector, we need only one update
message. In OSPF, each router needs to share the state of its links with every
other router. Since a router can have several types of links (a router link, a net-
work link, …), we need several update messages.
1
2
Q20-15. The type of payload can be determined from the value of the protocol field.
The protocol field value for ICMP is 01; for OSPF, it is 89.
Q20-17. It cannot. A link needs to be advertised in a router link LSP; a network needs
to be advertised in a network link LSP.
Problems
P20-1. We have
Dxy = min {(cxa + Day), (cxb + Dby), (cxc + Dcy), (cxd + Ddy)}
P20-3.
P20-5. Two nodes, A and D, see the changes. These two nodes update their vectors
immediately. We assume that changes in each round are fired in the order A,
B, C, D. The following shows that the internet is actually stable after two
rounds of updates, but more updates are fired to assure the system is stable.
We have shown only three columns for each forwarding table, but RIP usually
uses more than columns. Also note that we have used the yellow color to show
the changed in cost field, which triggers updates. The cost and the next hop
fields participate in updating.
A B C D
Changes A 0 A A 3 B A 5 B A 1 D
occured B 3 A B 0 B B 2 C B 5 D
C 5 B C 2 B C 0 C C 4 D
in the links. D D 5 D 0 D
1 D B D 4 C
1 2
+3 +1
A sends A 0 B A 3 B A 5 B A 1 D
B 3 C B 0 B B 2 C B 4 A
updates to C 4 D
C 5 C C 2 B C 0 C
B and D. D 1 D 4 A D 4 D 0 D
C C
+1 +5 +4
D sends A 0 B A 3 B A 5 B A 1 D
updates to B 3 C B 0 B B 2 C B 4 A
A, B, and C. C 5 C C 2 B C 0 C C 4 D
D 1 C D 4 A D 4 C D 0 D
P20-9. The following shows the advertisement in each case (a triplet defines the des-
tination, cost, and the next hop):
P20-11. The forwarding table for node A can be made using the least-cost tree, as
shown below:
P20-13. The following shows the steps to create the shortest path tree for node B and
the forwarding table for this node.
2 0 5 2 0 5
A B C A B C
G G
8
8
D E F D E F
8
8
8
5 4
Initialization Iteration 1
2 0 5 2 0 5
A B C A B C
G G
8
8
D E F D E F
5 4 6 5 4 6
Iteration 2 Iteration 3
2 0 5 2 0 5
A B C A B C
G G
8 8
D E F D E F
5 4 6 5 4 6
Iteration 4 Iteration 5
Number of searches = n + n − 1 + n − 2 + n − 3 + … + 3 + 2 + 1 = n (n + 1) / 2
The series can be calculated if it is written twice: once in order and once in the
reverse order. We then have n items, each of value (n + 1), which results in n(n
+ 1). However, we need to divide the result by 2. In computer science, this
complexity is written as O(n2) and is referred to as Big-O notation.
P20-17. Router R1, using its OSPF forwarding table, knows how to forward a packet
destined for N4. R1 announces this reachability to R5 using an eBGP session.
R5 adds an entry to its RIP forwarding table that shows R1 as the next router
for any packet destined for N4.
CHAPTER 21
PRACTICE SET
Questions
Q21-1. In multicasting, the sender host sends only one copy of the message, but it is
multiplied at the routers if needed; all multiplied copies have the same desti-
nation address. In multiple-unicasting, the sender host sends one copy for each
destination; each copy has its own destination address.
Q21-3. The multicast address block is 224.0.0.0/4. In other words, a multicast address
is between 224.0.0.0 and 239.255.255.255. Based on this criteria we have
Q21-7.
Q21-9. DVMRP allows a router to create the shortest path-tree whenever it receives a
multicast packet (on demand).
Q21-11. RPB creates a broadcast shortest path tree with the source as the root and net-
works as the leaves. In other words, it tries a shortest path from the source to
every network assuming that all networks are interested to receive that partic-
ular group message.
1
2
Q21-13. Each router using DVMRP creates the shortest-path three in three steps:
a. In the first step, the router uses the RPF algorithm to keep only packets that
have arrived from the source using the shortest-path three. In other words,
the first part of the tree is made using the RPF algorithm.
b. In the second step, the router uses the RPB algorithm to create a broadcast
tree.
c. In the third step, the router use the RPM algorithm to change the broadcast
tree created in the second step to a multicast tree.
Q21-15. Every multicast routing algorithm needs to somehow use a unicast protocol in
its operation. For example, DVMRP needs to use RIP and MOSPF needs to
use OSPF. Although PIM also needs to use a unicast protocol, the protocol can
be either RIP or OSPF.
Q21-17. In PIM-DM, it is assumed that most networks have a loyal member in each
group, so it does not matter if the first packet reaches all networks. In PIM-
SM, it is assumed that a few networks has a loyal member in each group, so
broadcasting is wasting the bandwidth.
Problems
P21-1. We define two properties for a block in classless addressing. The first address
needs to divide the number of addresses in the block. The number of addresses
in the block should also be a power of 2. Let us check these properties for
these two blocks (two applets for chapter 4 can easily find the values).
a. In the first block, the value of the first address is 3,758,096,895 and the
number of addresses in the block is 65,024. None of the conditions meet.
The block is intended to be split in the future.
b. In the second block, the value of the first address is 3,758,292,992 and the
number of addresses in the block is 134,021,120. None of the conditions
meet. The block is intended to be split in the future.
c. In the third block, the value of the first address is 3,925,868,544 and the
number of addresses in the block is 83,886,080. None of the conditions
meet. The block is intended to be split in the future.
3
P21-5. There is no need for a report message to travel outside of its own network
because its only purpose is to inform the next router in the spanning tree of
group membership. There is no need for a query message to travel outside of
the local network because its only purpose is to poll the local network for
membership in any groups.
P21-7. Please correct the errors in this problem using the errata. Since router B tells
that the source is 4 hops away, router B needs to be selected as the designated
router.
P21-9. The following show the shortest path from the source and the shortest path
tree seen from router R.
Root 3
S
R
4 7
a. Shortest path tree seen by router S
PRACTICE SET
Questions
Q22-1. We can say (1) larger address space, (2) better header format, (3) new options,
(4) allowance for extension, (5) support for resource allocation, and (6) sup-
port for more security.
Q22-5. The IP header is included because it contains the IP address of the original
source. The first 8 bytes of the data are included because they contain the first
section of the TCP or UDP header which contains information about the port
numbers (TCP and UDP) and sequence number (TCP). This information
allows the source to direct the ICMP message to the correct application.
Q22-7. The prefix length is 3, which means the size of the block is
Q22-9. The prefix length is 7, which means the size of the block is
Q22-13. The next header field is responsible for multiplexing and demultiplexing in
IPv6. It is similar to the protocol field in IPv4.
1
2
Q22-15.
Q22-17. We need to encapsulate IPv6 packets in IPv4 packets in the tunneling strategy.
Problems
P22-1. The following table shows the comparison:
P22-3.
a. 0:FFFF:FFFF::
b. 1234:2346:3456::FFFF
c. 0:1::FFFF:1200:1000
d. ::FFFF:FFFF: 24.123.12.6
P22-5.
a. 0000 :0000:0000:0000:0000:0000:0000:0002
b. 0000:0023:0000:0000:0000:0000:0000:0000
c. 0000:000A:0000:0000:0000:0000:0000:0003
3
P22-7. Both subnets keep the given global routing prefix. Each subnet adds a 16-bit
subnet identifier. We assume the subnet identifiers start from (0001)16, but
they can also start from (0000)16.
P22-9. We change the seventh bits from 0 to 1 (F5 is changed to F7) and insert four
extra hexadecimal digits (FF-FE) after the sixth digits:
F5 - A9 - 23 - 12 - 7A - B2
F7 - A9 - 23 - FF - FE - 12 - 7A - B2
P22-15. Here we mean unique local unicast address (see the errata). The prefix in this
case is FC00/7. After adding the suffix (0::123/48), we can get the unique
local unique address as FC::123/48.
6 0 3245
0 0 15
581E:14562314:ABCD::1211
581E:1456:2314:ABCD::2211
6 8 194 4
128020
60333 25
345
Checksum
7
5 Reserved 0 8192
Checksum 0
128000 bytes of data
4
P22-19. The error-reporting messages in ICMPv4 and ICMPv6 are similar except that
some messages have been totally deleted in version 6 or has been inserted in
other categories. The following table shows a comparison.
Message v4 v6 Explanation
Destination unreachable √ √
Source quench √ Deleted from ICMPv6; rarely used
Time exceeded √ √
Parameter problem √ √
Redirection √ Moved to neighbor-discovery category
Packet too big √ Added in v6 to prevent big-packet size
Message v4 v6 Explanation
Router solicitation √ Version 4 uses DHCP for this purpose
Router advertisement √ Version 4 uses DHCP for this purpose
Neighbor solicitation √ Version 4 uses ARP request packet
Neighbor advertisement √ Version 4 uses ARP reply packet
Redirection √ Included in error-reporting group in v4
P22-23. Group membership messages are new in Version 6. Version 4 is using IGMP
protocol for this purpose. The following table shows a comparison.
Message v4 v6 Explanation
Membership query √ It was part of IGMP protocol in v4.
Membership report √ It was part of IGMP protocol in v4.
CHAPTER 23
PRACTICE SET
Questions
Q23-1. The answer is no. Host-to-host and process-to-process communication are
needed because each computer in the Internet is designed to do multiple tasks:
to run multiple application-layer programs.
Q23-3. Although any port number can be used for the client and server and they can
be the same in this private communication, it is recommended to follow the
division specified by ICANN:
a. The client port number should be chosen from the dynamic range, 49,152
to 65,535.
b. The server port number also should be chosen from the dynamic range,
49,152 to 65,535.
c. It is advisable to choose different port numbers for the server and the client
to be able to better debug the programs.
a. The protocol can be Stop-and-Wait with the receive window size of 1 and
the send window size of 1.
b. The protocol can also be Go-Back-N with the receive window size of 1 and
the send window size of n packets.
c. The protocol cannot be Selective-Repeat because the size of both windows
should be the same (1), which means the protocol is Stop-and-Wait, not
Selective-Repeat.
1
2
Q23-9. The networks need to be carefully designed to make the time between the two
wraparounds as long as possible. For example, in a protocol that uses the
sequence number field of size 3 (m = 3), every 2m = 8 packets have the same
sequence number. If the previous packet with sequence number x (or its acci-
dentally created duplicate) is still wandering in the network arrives at the des-
tination, the receiver may confuse this with the expected new packet, also with
sequence number x.
Q2311. The transport-layer packets are encapsulated in the datagram at the network
layer. The router through which the datagrams need to pass to reach their des-
tination may be congested and drop the packets.
Q23-13. The rest of the packets (2m − 2) are supposed to be in transit, filling the pipe.
The size of the receive window is chosen to be 1 to accept only one packet, the
one expected, and not out-of order packets. The receiver cannot be over-
whelmed because it holds only one packet in its window. When the only
packet in the window is consumed by the upper-layer protocol, the receive
window slides to make it possible to receive the next packet in transit. If any
packet in transit arrives before the window slides, it is discarded.
Problems
P23-1. The domain of IP addresses is universal. A device directly connected to the
Internet needs a unique IP address. The domain of port numbers is local; they
can be repeated. Two computers running the HTTP server process use the
same well-known port number (80); two computers running the HTTP client
process can use the same ephemeral port number.
P23-3. The sequence number of any packet can be found using the following relation:
3
in which m is the number of bits used to define the sequence number. The
sequence number in this case is
seqNo = (0 + 100 − 1) mod 25 = 99 mod 32 = 3
P23-5.
P23-7. The following figure shows the states and events. The sender needs two states:
ready and blocking. The receiver also needs these two states. To send a packet,
the sender should be in the ready state and receives data from the application
layer. The receiver accepts a packet from the sender when it is in the ready
state. When the receiver becomes ready, it sends an ACK packet and moves to
the ready state.
Sender Receiver
P23-9. The following figure shows the case. It happens when an ACK is delayed and
the time-out occurs. The sender resends the packet that is already acknowl-
edged by the receiver. The receiver discards the duplicate packet, but resends
the previous ACK to inform the sender that there is a delay in the network.
Stop Discards
ACK 1 (it is duplicate)
Duplicate
ACKs received
(maybe time-out
occured too soon) Time Time
4
P23-11. The figure on the next page shows the outline. Note that since the simple pro-
tocol provides no error control, if a packet is lost, the receiving process is
responsible for finding a solution. The transport layer is not even aware that
this has happened. The packets may also be delivered out of order to the
receiving process. The responsibility again is on the receiving process to reor-
der the packets.
Sender Receiver
Transport Transport
layer layer
Req Packet 0
Packet 1 pArr
Req
Req Packet 2 pArr
Req Packe
t3 Lost
Packet 4
Req
pArr
pArr
Time Time
Req Packet 1
Start 0 1 0 1 0 1
Lost
Timeout; T-Out
0 1 0 1 0 1 Packet 1 (resent)
restart pArr
ACK 0 0 1 0 1 0 1
aArr
Stop 0 1 0 1 0 1
Time Time
5
Events:
Req: Request from process
pArr: Packet arrival Sender Receiver
aArr: ACK arrival
Transport Transport
T-Out: time out layer layer
Sf Sn Rn
Initial 0 1 2 3 4 5 6 7 0 Initial 0 1 2 3 4 5 6 7 0
Sf Sn
Req Packet 0 Rn
Start 0 1 2 3 4 5 6 7 0 pArr
0 1 2 3 4 5 6 7 0
Sf Sn ACK 0
Stop aArr Data delivered
0 1 2 3 4 5 6 7 0 to application
Sf Sn Rn
Req Packet 1
Start 0 1 2 3 4 5 6 7 0 pArr
0 1 2 3 4 5 6 7 0
Sf Sn ACK 1
aArr Data delivered
Stop 0 1 2 3 4 5 6 7 0 to application
Sf Sn Rn
Req Packet 2
Start 0 1 2 3 4 5 6 7 0 pArr
0 1 2 3 4 5 6 7 0
Sf Sn ACK 2
Stop aArr
0 1 2 3 4 5 6 7 0
Data delivered
Sf Sn to application
Req Pa
Start 0 1 2 3 4 5 6 7 0 ck
et
3
Sf Sn Rn
Req Packet 4
0 1 2 3 4 5 6 7 0 pArr
0 1 2 3 4 5 6 7 0
Sf Sn ACK 4
Restart
aArr Rn
0 1 2 3 4 5 6 7 0
pArr
0 1 2 3 4 5 6 7 0
Sf Sn ACK 3
aArr
Stop 0 1 2 3 4 5 6 7 0
Data delivered
Time Time to application
a. seqNo = 15.
b. Five packets with seqNos set to 10, 11, 12, 13, and 14 are to be resent.
c. Sf = 13 and Sn = 15.
d. The size of the window remains the same. Max Wsize = 64 − 1 = 63.
e. Sf = 18 and Sn = 21. Next state = ready.
f. Rn = 17. Action: message is delivered and an ACK with ackNo = 17 is sent.
P23-19. In each case we first define the bandwidth-delay product (BDP) in bits and
then find it in the number of packets:
P23-21. We first calculate the average round-trip time (RTT) and the number of pack-
ets in the pipe before finding the sizes of the windows, the value of m, and the
time-out value.
Sf Sn Rn
62 63 64 65 66 67 68 64
Sender Receiver
a. If the receiver expects a packet with sequence number 64 and packets with
sequence numbers 62 to 65 are already sent but not acknowledged, it
means that two packets with sequence numbers 64 and 65 are in transit
from the sender to the receiver.
b. If the sender expects the acknowledgment for packet 62, but the value of Rn
= 64, it means that the ACK packets with acknowledgment numbers 62 and
63 are in transit from the receiver to the sender.
CHAPTER 24
PRACTICE SET
Questions
Q24-1. The protocol field of the datagram defines the transport-layer protocol that
should receive the transport-layer packet. If the value is 06, the protocol is
TCP; if the value is 17, the protocol is UDP.
Q24-3. UDP is preferred because each user datagram can be used for each chunk of
data.
Q24-5. The answer is positive. There is nothing in the UDP or TCP protocol that
requires the use of the IP protocol. A UDP user datagram or a TCP segment
can be encapsulated in an Ethernet frame. However, the protocol field of the
Ethernet needs to define which protocol is directly used in this case.
Q24-7. The SYN segment cannot carry data. The SYN + ACK segment cannot carry
data either, but this segment is actually the SYN segment with an additional
ACK bit. Although some people think that the FIN segment may not carry
data, it actually can. The client or the server can send the last bytes of data in a
segment and set the FIN bit.
Q24-9. We find the sequence number of the second segment in each case:
1
2
Q24-13. The window size field of the TCP header is only 16 bits. A number with 16
bits can define a decimal number between 0 and 65,535.
Q24-15. A SYN segment opens the connection in only one direction. For a communi-
cation using TCP, two SYN segments are needed, one for each direction.
Q24-17. A segment carrying an RST flag can close the communication in both direc-
tions immediately. The segment carrying an RST flag should not even be
acknowledged.
Q24-19. The server needs to immediately send a segment with the RST flag set to show
that the connection cannot be established. As we see in Chapter 19, if the net-
work layer knows about the availability, it can also send an ICMP packet.
Q24-21. A connection identifier in this case needs to include the identifier for two end
points. In this case, a unique identifier for each end is defined by a socket
address. The connection identifier should therefore be a pair of socket
addresses: the source socket address and the destination socket address.
Q24-23. In this case, Bob has made a passive open connection when he publicly
announced his telephone number or privately gave his telephone number to
Alice. Alice makes an active open when she dials Bob’s telephone number.
Q24-25. A TCP segment or a combination of two or more segments can perform one of
the following tasks:
a. Establishing a connection
b. Terminating a connection
c. Transferring data
d. Acknowledging the receipt of a segment
e. Advertising the window size (rwnd)
Q24-27. The acknowledgment identifies the sequence number of the next segment that
is expected to arrive.
Q24-29. The TCP server has received a segment whose sequence number is higher
than expected. The TCP server should store the out-of-order segment and send
an ACK with acknowledgment number 2001 to lead to the generation of a
3
Q24-31. The server needs to store the bytes in the buffer and sends an ACK with
sequence number 2401. This reaction helps the client to purge the correspond-
ing segment from its queue (Rule 5 in ACK generation).
Q24-33. The client needs to store the new bytes, but delay the acknowledgment until
receiving the next segment or wait a period of 500 ms. This reduces the num-
ber of ACKs in the network. (Rule 2 in ACK generation).
Q24-35. Figures 24.22 and 24.23 define the FSMs for unidirectional communication.
The first rule of ACK generation is for bidirectional communication. It is the
interaction between the sender and receiver TCP at each end. The rule should
be implemented in the software.
Q24-37. The six rules we mentioned for ACK generation are related to flow and error
control and are applicable during the data transmission phase, not the connec-
tion establishment phase. In this case, if the client accepts the connection, it
needs to send an ACK segment immediately or a data segment that acknowl-
edges the SYN + ACK segment. Otherwise, it needs to send an RST segment
and abort the connection.
Q24-39.
Q24-41.
Problems
P24-1.
P24-3.
P24-5. The number (0111)2 in decimal is 7. The total length of the header is then (7 ×
4) = 28. The base header is 20 bytes. The segment has 28 − 20 = 8 bytes of
options.
P24-7. The following are eight out of 64 possible combinations that are normally
used:
000000 → A data segment with no acknowledgment
110000 → A data segment with urgent data and acknowledgment
010000 → An ACK segment with or without data
000010 → A SYN segment
011000 → A data segment with push data and acknowledgment
000001 → A FIN segment
010010 → An ACK + SYN segment
000100 → An RST segment
5
P24-9. Even with three letters exchanged between Alice and Bob, there is no guaran-
tee that both know where and when they should meet. However, more and
more communication raises the probability that both parties know about the
meeting. Experts believe that three communications between the two parties
are adequate assurance that they can come to the meeting. Let us go through
each event:
a. Alice cannot go to the meeting because she is not sure that Bob has
received the letter. The letter may have been lost and Bob knows nothing
about the meeting. This is similar to sending a SYN segment from the cli-
ent to the server. The client (Alice) sets the scenario.
b. Bob cannot go to the meeting because he does know if Alice has received
his confirmation. This is similar to the SYN + ACK. The server (Bob) con-
firms Alice’s request.
c. Alice cannot go to the meeting with total assurance that Bob will be there
because she does not know if Bob has received her letter and knows that
she knows that the meeting is confirmed. This is similar to the last ACK.
The client (Alice) confirms that she has received the confirmation from the
server (Bob).
P24-11.
a. The sequence number in the SYN segment is 2171. The SYN segment con-
sumes one sequence number; the next sequence number to be used is 2172.
b. The sequence number in the data segment is 2172 (which represents the
sequence number of the first byte). The bytes in the packets are numbered
2172 to 3171. Note that the client sends the data with the second packet (no
separate ACK segment).
a. The sequence number in the FIN segment is 3172. Note that the FIN seg-
ment does consume a sequence number, but it needs a sequence number to
be acknowledged.
P24-13. The data section is only 16 bytes. The TCP header is 20 bytes. The efficiency
is
ACK Segment
59,100 80
14534
14,535
3 785
21,733
5 0 10 0 00 4000
Time Checksum Time
P24-17. The following figure shows the connection termination phase. We assume a
three-handshake connection termination because the server has no more data
to send.
Client
FIN + ACK Segment
Server
59,100 80
14,635
1 785
22,933
5 0 1 0 0 01 0
Checksum
FIN + ACK Segment
80 59100 59,100
22,933
785
14,536 2
5 0 10 00 1 0
Checksum
ACK Segment
59,100 80
14534
14,636
3 785
22,934
5 0 10 0 00 0
Time Checksum Time
7
CLOSED CLOSED
ACK / –
Time-out / – Passive open / _
TIME-WAIT
TIME-WAIT Active open / SYN
LISTEN
LISTEN LAST-ACK
LAST-ACK
SNY-SENT
SNY-SENT
FIN + ACK / ACK SYN / SYN + ACK Close / FIN + ACK
Note that the FIN-WAIT-2 state is not used in this case. Note also that there
are changes in the server side that are not shown in the text because this is
somewhat of an implementation issue. In this case, the server sends FIN +
ACK before going to the LAST-ACK state.
P24-21. Bob, the server, sends the response to Alice’s IP address; the destination IP
address is the source IP address in the request message. Since Alice has not
requested this response, the response is dropped and lost. Eve can receive the
response only if she can intercept the message.
P24-23. The probability of this mistake is very low because the initial sequence num-
ber (ISN) has a high probability of being unique. Assume Alice and Bob were
using ISNs x and y, respectively in the previous connection, but z and t in this
connection. The old ACK segment (third segment) has the acknowledgment
number (y + 1); the new ACK segment should have the acknowledgment (t +
1). Bob’s server immediately recognizes the problem and sends an RST seg-
ment to abort the connection. Alice then needs to start a new connection.
P24-25. The receiving TCP allocates a fixed-size buffer (the same size as the buffer
allocated by the sending site). The application program at the receiver site
pulls data from the buffer, which means there is no flow control from the
receiving TCP toward the application program. Data received from the send-
ing TCP are stored in the buffer until they are consumed by the application
program. The part of the buffer that is still empty is advertised as the value of
rwnd to the sending TCP (flow control). The following figure shows a simple
example how the buffer status will change. We have shown both linear and
8
circular representation of the buffer. The latter better shows the position of the
data read by the application.
Note:
Red arrow shows
where the next byte
is read from the buffer
(rwnd = 0)
100% full
P24-27. The following figure shows the time line for each segment. Note that the situ-
ation is improved from the previous situation. Both of Nagle’s rules are
applied. Some segments are sent with the maximum segment size; others in
9
Client Server
60 ms
ACK
a. When a received segment has a sequence number greater than Rn, it means
that the bytes are received out of order. TCP stores the bytes in the receive
window, but it sends an ACK with the acknowledgment number equal to
Rn to help fast retransmission of the missing bytes. This is a duplicate ACK
because the receiver has already sent an ACK with the acknowledgment
number equal to Rn. The issuing of duplicate ACKs is only a clue to the
sender that some packets have arrived out of order. If three duplicate ACKs
arrive, the sender deploys the fast retransmission and resends the packet
with the sequence number defined by the acknowledgment.
b. When a duplicate segment arrives, the receiver TCP drops the packet and
sends an ACK that defines the segment expected. This is also a duplicate
ACK that gives a clue to the sender that its timer may have timed out pre-
maturely. One might ask how the receiver could know whether the dupli-
10
P24-31. The data from the client process, 5400 bytes, can be divided into six chunks
(five chunks of 980 bytes and one chunk of 500 bytes). After adding a header
of 20 bytes, we have six segments (five segments of 1000 bytes and one seg-
ment of 520 bytes). The segments and the ACKs are created according to the
rule we mentioned in the text. The size of the congestion window is increased
by one MSS for each ACK received. If we follow the growth of the cwnd, we
can see the pattern is exponential, but the base is decreased from 2 to 1.5 (20 =
1, 21 = 2, 1.752 ≈ 3, 1.603 ≈ 4, and 1.54 ≈ 5).
Segment
ACK
Client Server
500
ms
Time Time
P24-33. The following shows the events and the values. The units of windows and
ssthresh are MSS. We use abbreviations for states such as slow start (SS), con-
gestion avoidance (CA), and fast recovery (FR). The leftmost state shows the
current state, the rightmost one shows the new state.
CA 3 dup-ACKs 4 4+3=7 FR
FR dup-ACK 4 7 + 1/7 ≈ 7.14 FR
FR dup-ACK 4 7.14 + 1/(7.14) = 7.38 FR
FR ACK arrived 4 4 CA
CA ACK arrived 4 4 + 1/4 = 4.25 CA
CA Time-out 2.12 1 SS
P24-35. According to Karn’s algorithm, we need to ignore the RTT for segment 1 in
our calculation because it was timed-out and resent. Using only segment 2, the
calculation is shown below:
RTTM = 23 − 6 = 17 ms
RTTS = (1 − 0.2) RTTS + 0.2 × RTTM = 14.6 ms
P24-39.
P24-41. See the following figure. Chunks 18 and 19 are sent but not acknowledged
(200 bytes of data). 18 DATA chunks (1800 bytes) can be sent, but only 4
chunks are in the queue. Chunk 20 is the next chunk to be sent.
outstanding
From process chunks
23 22 21 20 19 18 To send
Sending Queue 20 curTSN
2000 rwnd
200 inTransit
P24-43. See the following figure. We have filled the fields with available information.
Each packet has the general header and the appropriate control chunk. Note
12
that only the SHUTDOWN chunk has the cumTSN ACK, which acknowl-
edges the receipt of the last packet.
Client Server
2000
1
7 0 8
570
SHUTDOWN
806
2
8 0 4
SHUTDOWN ACK
2000
3
14 0 T 4
SHUTDOWN COMPLETE
Time Time
CHAPTER 25
PRACTICE SET
Questions
Q25-1. No changes are needed. The new protocol needs to use the services provided
by one of the transport-layer protocols.
Q25-3. A server should always be on because a client may need to access it at any
time. A client is normally the initializer of the connection; it can be run when
it is needed.
Q25-9. The client should either know the IP address of the server being communi-
cated with or should know the name of the server (URL) and use the DNS to
map the name to the IP address. The client should know the well-known port
number of the corresponding server process.
Q25-11. We can use the second constructor of the InetSocketAddress and use the port
number 51000. An IP address is represented in Java as an instance of the Ine-
tAddress class.
Q25-13. An integer in Java is in the range (−231) and (231 − 1). We need to be sure that
the port number is always between (0 to 216− 1). For this reason, we need to
set the 16 leftmost bits of the integer to 0.
1
2
the corresponding DNS record. A user can only create a variable of type Inet-
Address and call one of the appropriate static methods to fill the related val-
ues. Even if we know the IP address of a host (for example 23.12.56.8) we
cannot create an InetAddress object out of this value; we should let all pieces
of information be filled by calling the appropriate static method.
Q25-17. We first need to create a variable of type InetAddress and then call the static
method that accepts the name of the computer and returns an object of type
InetAddress. Note that the given IP address (as a string) in this case is inter-
preted as another name for the computer. So we need to call the static method
that takes the name of the computer and returns an instance of the InetAddress
class. This means that the method still sends a request to a DNS server and if
the corresponding IP address is not assigned to any host, the UnknownHost-
Exception will be thrown.
Q25-19. We first need to create an array in which each element is an object of type Ine-
tAddress. We then call the corresponding static method to fill the array.
Q25-21. There is no static method to return all of the InetAddress objects associated
with the local computer. We can first find one of the InetAddress instances,
get the canonical name of the computer, and then use the canonical name to
get all InetAddress objects.
Q25-23. The answer is negative. All of the three constructors of the InetSocketAddress
are based on the fact that the IP address should belong to a host. In the first
constructor, the IP address comes from an InetAddress object, which can only
exist if the IP address is assigned to a host. In the second constructor, the IP
address is the IP address of the local computer. In the third constructor, the IP
address comes from the DNS record, which is called by the first parameter in
the constructor.
Q25-25. We can use the second constructor of the InetSocketAddress and use the port
number 56000.
Q25-27. We can use the appropriate constructor of the InetSocketAddress and use the
port number 23.
Q25-31. Both classes are used in TCP communication for creating sockets. The Server-
Socket class is used at the server site as the listening socket to wait for a client
to make a connection. The Socket class is used at both client and server sites
to create sockets for data transfer.
Q25-33. We need to use the second constructor in Table 25.11, which includes the IP
address and the port number of the remote site.
Q25-37. The client program executes the client.getResponse() statement (Line 76).
This statement is blocking because it calls the receive (...) method of the Data-
gramSocket, which is blocking. The program is blocked until the response
arrives.
Q25-39. The input stream in the TCP client program needs to be attached to the Socket
object. None of the input stream classes in Java have a method to do so. This
input stream needs to be created in conjunction with the Socket object.
Problems
P25-1. The recvfrom() function is a blocking procedure. When it is called, it sleeps
until a datagram arrives from the remote site. Once the datagram arrives, it
wakes up and calls the request handler.
P25-3. Instead of using just one buffer, we need to have two buffers: recvBuffer and
sendBuffer. In line 32, we use the recvBuffer; in line 35, we use the sendBuf-
fer. We also need a line of codes between lines 33 and 34 to process the
request and create the response. The codes need to read the request in the
recvBuffer and write the response to the sendBuffer.
4
P25-5. The following shows an approach. Since the standard Java has no unsigned
integer, we have used a long data type, in which the leftmost 32 bits are set to
0s and the rightmost 32 bits represent the numeric value of the address.
P25-9. The following shows an approach. Since the standard Java has no unsigned
integer, we have used a long data type, in which the leftmost 32 bits are set to
0s and the rightmost 32 bits represent the numeric value of the address.
6 } // End of method
Given: 23
Returned: 4,294,966,784
P25-11. The following shows an approach. Note that we are calling some methods we
have used in the solutions to previous problems.
2 {
10 return firstAddr;
11 } // End of method
Given: "27.92.13.56/17"
Returned: 27.92.0.0/17
P25-13. The following shows an approach. Note that we are calling some methods we
have used in the solutions to previous problems.
P25-15. We need to use the concurrent UDP server program (posted on the book web
site under the extra materials for Chapter 25), but replace the three methods
makeRequest (), useResponse(), and process() as shown in Example 25.4 in
the text.
6
P25-17. We need to use the concurrent TCP server program (posted on the book web
site under the extra materials for Chapter 25), but replace the three methods
makeRequest (), useResponse(), and process() as shown in Example 25.4 in
the text.
CHAPTER 26
PRACTICE SET
Questions
Q26-1. Probably Alice turned off her desktop, which stopped the FTP server, when
she left the office. A server process should be running all the time, waiting for
clients to access it.
Q26-3. In an HTTP request message, a blank line signals the end of the headers and
the beginning of the body of the message, if any.
Q26-5. One example can be the use of a remote control when we are watching TV.
The remote control establishes a control connection with the TV set, which is
separate from one-way multimedia connection.
Q26-7. FTP definitely cannot use the services of UDP for control connection because
the client and the server need to be connected during the whole session. Since
UDP is not a connection-oriented protocol, it cannot do this task. FTP does
not use the services of UDP during data transmission for another reason. A
file to be transferred may be too large to fit in a single user datagram (UDP
packet). In addition, UDP is not a reliable transport-layer protocol; for file
transfer, reliability is an important issue. TCP is more appropriate for this pur-
pose.
Q26-9. If the control connection is severed during a session, no more control informa-
tion can be exchanged between the client control process and the server con-
trol process. Since the control connection and the data connection are two
separate TCP connections, the severance of the control connection has no
effect on the current data connection. However, when the current data connec-
tion is terminated, no new data connection can be made until the control con-
nection is again established.
Q26-11. The answer is no. Data-transfer activity is controlled by the client. If a file
needs to be transferred from the client site to the server site, the client needs to
store it at the server site.
Q26-13. FTP allows the client to define the file format it can receive or send; the server
needs to use the format acceptable to the client when sending a file and to
accept the format used by the client when receiving a file.
1
2
Q26-15. The file (or list of directories or files, which is consider as a file) is transmitted
using stream mode (default), block mode, or compressed mode. The mode is
determined by the client using the MODE command. In the stream mode, no
header is added to the file bytes; in the other two modes, a header is added to
the beginning of the file to show information about blocking or compressing.
Q26-17. The answer is no. We cannot have a data-transfer connection without a control
connection. The data-transfer connection is established with one or more com-
mands issued from a client; there should be a control connection to allow the
client to issue these commands.
Q26-19. It depends on how the file is stored on the server. If the file is stored as a web
page, embedded in an HTML document, we need to use HTTP to download
the file. On the other hand, if the file is stored on the server without having
been embedded in an HTML document, then we need to download it using
FTP.
Q26-21. The MAIL FROM in the envelope contains the source e-mail address while
the FROM in the header contains the name of the sender.
Q26-23. The client changes the ASCII character to NVT characters. The server
changes NVT characters to EBCDIC.
Q26-25. When a host logs into a remote computer, it can use all services available on
that host. Since an FTP or an HTTP server provides services, the user can use
these services. As a matter of fact, the TELNET interface allows the user to
define the port number of the server she wants to use.
Problems
P26-1. The following shows a possible request and response:
a. A possible request
GET /usr/users/doc HTTP /1.1
Date: Fri, 26-Nov-04 16:46:23 GMT
MIME-version: 1.0
Accept: image/gif
Accept: image/jpeg
Last modified: Mon, 22-Nov-04
b. A possible response
HTTP/1.1 200 OK
Date: Fri, 26-Nov-04 16:46:26 GMT
Server: Challenger
MIME-version: 1.0
Content-length: 4623
(Body of document)
3
P26-3. The following shows a simple situation. A portal is a special site that holds
the often-visited URLs for each client. The cookie stored in the browser under
the name of the portal holds the list of the sites the user normally needs to
check periodically. When the user clicks on the portal web page, a request is
sent with the cookie to the portal site with the list of desired web pages. The
portal then fetches the current pages from the corresponding site, compiles a
page, and sends it to the browser.
Portal Client
cookie Portal Site 1 Site 2
Site 1
Site 2
Request
1 + cookie
2 Request
3
P1
4 Request
5
6
P2
P1 P2
P26-5. The following shows a simple example. In part a, the request can be
responded to by the proxy server. In part b, the proxy needs to send the request
to the true server. When the response is received, the proxy server saves it in
the cache for future use, and then sends it to the client.
Client
Proxy
Server
Internet
Request
Answer 1
to part a Response
2
Request
1
Request
2
Answer Add resposne Response
to part b to the cache
3
Response
4
P26-7. HTTP provides some presentation features, using the request and response
headers. For example, HTTP messages can define the format and the language
of the messages exchanged, which is a kind of presentation.
P26-9.
MIME-version: 1.1
Content-Type: Text/Plain
Content-Transfer-Encoding: 7bit
P26-11. Since there are several programs to do the job, we post on the book web site.
See extra materials for Chapter 26.
P26-15. The following shows the four states and the transitions from one state to
another.
Start
All messages marked
Closed
for delete become effective TCP connection
and TCP connection is is established.
terminated.
Update Authorization
P26-17. The following gives the meaning and usage of each command:
b. The TOP command, always with two arguments, is used by the client to
ask the server to return the top lines of a particular message. In this case, it
means to return the top 15 lines of message 1.
c. The USER command is used by the client to define its user identification.
d. The PASS command is used by the client to define its password.
P26-19. The following shows an example. We have shown only part of the transaction
(when the client starts retrieving the message):
Client: RETR 1
Server: +OK 230 octets
Server: … // Message contents
Server: . // Dot means end of mail
Client: DELE 1
Server: +OK message 1 deleted
Client: RETR 2
Server: OK 400 octets
Server: … // Message contents
Server: . // Dot means end of mail
Client: DELE 2
Server: +OK message 2 deleted
P26-21. SMTP does not create a session between the client and sender in which the cli-
ent can send some e-mails in a single session. The e-mails need to be sent one
by one. However, POP3 allows the user to retrieve all e-mails received in the
mailbox in one session.
P26-23. The following shows the commands and responses. The file mode in this case
needs to be C (compressed).
Client: MODE C
P26-25. The following shows the set of commands and responses. Note that there is no
data transfer connection in this; we have only a control connection. We need
to give the name of the file to be renamed (/usr/users/report/file1) and then the
new name (/usr/top/letters/file1).
PRACTICE SET
Questions
Q27-1. Fault and performance are areas of management defined by OSI; personnel is
not.
Q27-5. Reactive fault management is responsible for handling faults in a timely man-
ner. Proactive fault management is responsible for preventing some faults
from occurring.
Q27-7. Internal traffic measures the number of packets circulated inside the network;
external traffic measures the number of packets sent to or received from out-
side.
Q27-9. A router or a switch cannot be used as a manager station; only a host can be a
manager station.
Q27-13.
a. Simple
b. Simple
c. Simple
d. Sequence of
e. Sequence
f. Sequence of
Q27-15. SMI only sets the rules for naming objects, distinguishes between simple data
types and shows how to combine them to make structured data types, and
specifies how to encode objects and the values to be stored in those objects.
1
2
MIB, on the other hand, defines the objects to be managed in SNMP using the
rules set by SMI.
Q27-17. The identifiers of the variables are x.1, x.2, and x.3.
Q27-19. SNMP can only reference an entity which is a leaf in the MIB tree. Non-leaf
entities in the leaf are not variables to be accessed.
Q27-21. We can say that tables in the MIB are column-oriented. This means that each
column in a table is represented by a leaf in the MIB tree. In this case, we have
three leaves related to the table. The rows in a table are not represented as
leaves in the MIB tree because the number of rows are not fixed from one
object to another. Consider the case of a forwarding (routing) table. A router
may have a forwarding table with three rows; another table may have a for-
warding table with eight rows.
Q27-23.
Problems
P27-1. The identifiers are (x.1) and (x.2). The variable identifier of an object does not
have any relation to the type of the variable. Each simple variable of an object
is a leaf on the MIB tree, as shown below:
x
Object x MIB tree
x.1 x.2
Variables
x.1 x.2
P27-3. Since MIB considers each column of a tree as a variable, we have four leaves
on the tree. The identifiers for the two variables are (x.1) and (x.2). The identi-
fier for the table is (x.3), which is not a leaf. The identifier for the table entry is
(x.3.1). Each column has an identifier on the leaf. The identifier for the first
column is (x.3.1.1); the identifier for the second column is (x.3.1.2).
P27-5. A simple variable has only one instance, which is not on the MIB tree. The
instance can be referred to by adding a zero to the identifier of the variable. In
3
this case, the identifiers of the variables are (x.1) and (x.2). The instances can
be referred to as (x.1.0) and (x.2.0).
P27-7. The identifier of the table is (1.3.6.1.2.4.21). The identifier of the table entry is
(1.3.6.1.2.4.21.1). The identifier of the second column is (1.3.6.1.2.4.21.1.2).
Each instance must add the corresponding index, which is the destination IP
addresses:
Each digit in the identifier is translated into two hexadecimal digits. The
encoding in compact form is 06080103060102010701.
P27-13. First we need to encode the inner sequence and then the outer one, as shown
below:
40 04 1864060E 04 03 554450
30 19 02 04 00000083 30 11
IPAddress OCTETSTRING
Integer
Sequence
Sequence
The total length is (13 + 6 = 19) bytes. The whole data type in compact format
is
3019020400000083301140041846060E0403553350
4
P27-15. Since the code starts with the tag 30, it is a sequence. We need to split the code
carefully to find each component.
T L T L V T L V
30 0C 02 04 00 00 09 98 40 04 0A 05 03 0E
The first byte is the tag for a sequence and the next byte is the length of the
sequence (12 bytes). The next byte defines a data type (an integer). The next
byte is the length of the integer (4 bytes) and the next four bytes define the
value (2456). The last tag defines an IP address with the value 10.5.3.14. In
summary, the code defines a sequence of an integer and an IP address. The
following shows the whole data type using ASN.1:
SEQUENCE
{
INTEGER 2456
IP Address 10.5.3.14
}
P27-17. A VarBind is a sequence of two data items: the corresponding object identifier
and the value of the variable.
a. In the GetRequest message the sequence is the instance of the object identi-
fier (the last 00 defines the instance). The last two bytes defines the identi-
fier of the null object (05) and the null value (00).
T L T L V T L
30 0D 06 0B 010306010201070400 05 00
b. In the Response message the sequence is the instance of the object identi-
fier (the last 00 defines the instance). The last six bytes defines a counter of
length 4 with the value 15.
T L T L V T L V
30 11 06 0F 010306010201070400 41 04 0000000F
5
P27-21. A VarBindList is a list of VarBinds. Note that VarBind is itself a structure that
needs to be defined.
PRACTICE SET
Questions
Q28-1. In dictionary coding, the number of iterations in the loop is one less than the
number of characters in the message. In this case, the number of iterations is
59.
Q28-3. In a Huffman tree, the number of leaves is the same as the number of symbols.
Therefore, we have 20 leaves in the tree.
A → 00 B → 01 C → 10 D → 11
Huffman coding cannot help here because we could have encoded each char-
acter as two bits. Huffman coding will help if the occurrence probabilities of
the characters in the messages are different and we can send fewer bits for
characters with high probability and more bits for characters with low proba-
bility.
Q28-7. ADM is a variation of DM in which the value of Δ may change from one step
to another.
Q28-9. The answer is given for each case for both PCM and DM.
Q28-11. In DM, only the immediate previous yn value is used in the calculation of en.
In DPCM, weighted averages of several previous yn values are used in the cal-
culation of en.
Q28-13. The answer is no. The value of the T matrix entries, for each value of N, is
fixed. The receiver either has the matrix or can generate it.
1
2
Q28-15. The value of Q(m, n) becomes larger and larger when we move toward the
higher frequencies in the matrix, from M(0, 0) to M(N−1, N−1) diagonally.
This is done to reduce the effect of higher frequencies. Human eyes cannot
recognize the higher frequencies when their amplitude (strength) is outside of
an upper and a lower threshold. The values in the Q(m, n) matrix are selected
based on this property. Dividing the amplitude of higher frequencies by a
larger number makes these amplitudes smaller and smaller, finally moving
them toward zero values and elimination (better compression).
Q28-17. The whole idea is to change the real numbers (values with fractions) to integer
values to reduce the number of transmitted bits. The real value 14.125 or
(1110.001)2 needs seven bits to send; the integer value 14 or (1110)2 needs
only four bits to send. The number of bits to send tremendously increases if
we want to use a high level of precision.
Q28-19. The answer is no. Multimedia data encoded in JPEG cannot be recovered
using GIF and vice versa. If two entities want to communicate, they must use
the same encoding and decoding scheme.
Q28-21. In the second approach, the whole multimedia file is downloaded using HTTP
as the application-layer protocol. In the third approach, HTTP is only respon-
sible for downloading the metafile; the actual multimedia file is normally
downloaded using a specific application program that may use the service of
UDP/RTP.
Q28-23. In live audio/video, the multimedia data is being sent on the Internet no matter
whether we use it or not. In real-time interactive audio/video, two parties start
exchanging multimedia when they both agree to do so.
Q28-25. The answer is yes. The protocol defines a server as a process running at the
application level. The two servers can be on the same machine or different
machines.
Q28-27. The answer is negative. The sequence numbers or timestamps are needed to
glue the chunks together in time. When all chunks can be carried in one
packet, they arrive all together and in the order they are inserted into the
packet. There is no need for sequence numbers or timestamps.
Q28-29. The sequence numbers in RTP and TCP play almost the same role. They
check to see if a packet is missing. However, there are some differences in the
nature and applications of the sequence numbers in these two protocols.
number defines the packet. Two consecutive packets sent by the source
have consecutive sequence numbers.
b. The applications of the sequence numbers in these two protocols are some-
what different. The sequence numbers in TCP are related to acknowledg-
ment numbers, and, if the sequence numbers attached to bytes in a packet
are not acknowledged, the bytes are resent. In RTP, the sequence numbers
are still used to indicate whether an RTP packet is lost. However, there is
no retransmission. The receiver needs to know this fact to somehow find a
remedy for it.
Q28-31. If there is only one source sending the multimedia application and audio and
video are mixed by the application program, we have only one synchroniza-
tion source (the synchronization source and contributor source is the same).
This means that the value of the contributor count is 0 and there is no CSRC
field. Without the extension header and CSRC fields, the size of the RTP
packet is only 12 bytes.
Q28-33. The encoding applied on a chunk of data can be different from the encoding
applied on another chunk of data, although this practice is not very common.
Q28-35. Each packet needs to carry an SSRC and a CSRC identifier. The SSRC identi-
fier is the same for audio and video packets, but the CSRC identifier is differ-
ent for each type of packet. In other words, we have two CSRCs, but only one
SSRC during the session.
Q28-37. RTCP sends messages to control the flow and quality of data and allows the
receiver to send feedback to the source. TCP already has this mechanism, so it
doesn’t need this protocol.
Q28-39. The caller and the callee each play the roles of the client and the server. In
other words, SIP can be considered as a peer-to-peer application program
instead of a client-server program. Both parties use the registered port number
5060.
Q28-41. This needs to be defined during the call setup, when they exchange SIP mes-
sages to establish the call. Each party can define the port number at which
desires to receive the RTP packets.
Q28-43. The wired or wireless environment defines the link at which communication
occurs (data-link layer). The RTP/RTCP and SIP are application-layer proto-
cols. Like any application-layer message, they are eventually carried in a data-
link layer (wired or wireless).
Q28-45. Bob can register the two addresses with the SIP proxy server. When a tele-
phone call arrives, the proxy server can fork the call to both destinations.
4
Q28-47. Yes, H.323 can be used for both audio and video.
Problems
P28-1. We replace each run of the same character with a count and the symbol as
shown below.
3A6C1B4C5D4A3B
P28-3. Let us show how the dictionary for each case is made using the knowledge
about the previous case.
P28-5. We follow the procedure in Table 28.2. The loop is shown inside the frame
with a thick border. We need to initialize the dictionary before reading the
code. The message is "AACCCBCCDDAB".
P28-7. We need to read the code, bit by bit, until we get a sequence of bits that can be
decoded using the table:
0 0 1 1 0 1 1 0 0 1 1 1 1 0 1 1 1 1 1 1 0 1 0
A A − − C − − C A − − D − B − − D − − D A − B
P28-11. We first calculate the value of qn from the code. If the code is bit 1, the value
of qn is 1; otherwise, it is −1. The value of the yn can then be calculated as yn =
yn −1 + qn × Δ. Note that the value of y0 is not shown in the table, but is given
in the problem as y0 = 8.
n 1 2 3 4 5 6 7 8 9 10 11
Cn 1 0 0 1 0 1 1 0 0 1 1
qn 1 −1 −1 1 −1 1 1 −1 −1 1 1
yn 14 8 2 8 2 8 14 8 2 8 14
P28-13. We first calculate the value of qn from the code. If the code is bit 1, the value
of qn is 1; otherwise, it is −1. The value of Mn can then be calculated depend-
ing on the change in qn. We can then calculate the value of Δn as defined in the
problem. The value of yn can then be calculated using yn = yn −1 + qn × Δn.
Note that the value of y0 is not shown in the table, but is given in the problem
as y0 = 20.
n 1 2 3 4 5 6 7 8 9 10 11
Cn 1 1 1 0 0 1 1 0 0 1 1
qn 1 1 1 −1 −1 1 1 −1 −1 1 1
6
Mn 1 1.5 2.25 1.13 1.70 0.85 1.28 0.64 0.96 0.48 0.72
Δn 4 6 13.5 15.3 26 22.1 28.3 18.1 17.4 8.4 6
yn 24 30 43.5 28.2 2.2 24.3 52.6 34.5 17.1 25.5 31.5
P28-15. The answer is yes. We have T(m, n) = C(m, n) cos(x). The value of cos(x) is
always between −1 and 1. We only need to prove that C(m, n) ≤ 1, which can
be done using two cases:
P28-17. The following shows the four matrices. The first one (N = 1) is actually a
number (scalar value). Note that we have rounded the values to two decimal
digits.
N=8
a. For each color in the palette we can send three bits (the index of the row).
7
b. The bit index for the red color is 100, for the blue color is 010, for the green
color is 001, for the black color is 000, for the white color is 111, and for
the magenta is 110.
a. At time 00:00:17
first packet: 10 units arrived, 9 units played, 1 unit in buffer
second packet: 2 units arrived, none played, 3 units in buffer
b. At time 00:00:20
first packet: none left
second packet: 5 units arrived, 2 units played, 3 units in buffer
c. At time 00:00:25
first packet: none left
second packet: 10 units arrived, 7 units played, 3 units in buffer
d. At time 00:00:30
first packet: none left
second packet: none left
third packet: 3 units arrived, 2 units played, 1 unit in buffer
a. The first two bits define the version, which means the version is 2.
b. The third bit is the P bit, which means there is no padding.
c. The fourth bit is the X bit, which means there is no extension header.
d. The next four bits define the number of contributors, which is 6 in this
case.
e. The seven bits after the color bit (M) (with the value 3 in decimal) define
the payload type, which means GSM audio.
f. Since we have six contributors, the total size of the packet header is 12
bytes (first part of the header) plus 6 × 4 bytes for CSRCs, for a total of 36
bytes.
multimedia data (even a single pixel in an image may need more than eight
bits). A chunk cannot be associated with several bytes because TCP may
split bytes, making a chunk into different segments, which means a chunk
of multimedia data may be in one segment and the other parts in other seg-
ments. What is needed in multimedia is that a chunk of data be carried in a
single packet. Although TCP may use push and urgent flags to artificially
create boundaries for each segment, it is not guaranteed that a TCP imple-
mentation will honor these flags all of the time. On the other hand, a UDP
user datagram is a packet with clear-cut boundaries. A UDP packet, when
combined with RTP/RCTP packets, can carry a single chunk of multimedia
payload, and the size of the UDP datagram is large enough to hold any
chunk of multimedia data as defined so far.
b. TCP is not an appropriate protocol for multicasting and multi-party com-
munication because it is a connection-oriented protocol in which a connec-
tion involves only two parties. UDP, on the other hand, is a connection-less
protocol. Multicasting and multi-party communication can be achieved
using UDP. Using the same multicast address, a UDP sender can send mul-
ticast packets to many receivers; several UDP senders can use the same
multicast addresses to create multi-party communication.
c. TCP delivers data bytes to the application program in order. This means
that if a segment is missing, the out-of-order bytes need to wait. This is not
appropriate for live or real-time interactive multimedia streaming, as dis-
cussed in the text. This problem does not exist in UDP. Each UDP packet is
independent, and the chunk of data carried in a UDP datagram can be
delivered to the application program as it arrives.
d. Since multimedia chunks can use different encoding methods, we need a
field to define the type of payload. A TCP segment lacks this field. A UDP
datagram can allow encapsulation of the RTP packet, which includes this
field.
e. For a live or real-time multimedia streaming, there is a need for synchroni-
zation using timestamps that define the temporal relationship between each
chunk and the other chunks. None of the three protocols, TCP, UDP, or
SCTP, provide timestamping. UDP, however, allows the encapsulation of
the RTP packets, which includes timestamping. Since an SCTP packet can
carry many data chunks in a single packet, timestamping may not be
needed if the stream is short.
f. Congestion control in multimedia communication is a big issue because of
the volume of data exchanged. Although TCP has a congestion control
mechanism, it is not suitable for multimedia communication, because it is
based on segments, not chunks. Congestion control in UDP/RTP is more
convenient for multimedia communication.
CHAPTER 29
PRACTICE SET
Questions
Q29-1.
Q29-3. A decentralized network generates less traffic and is less vulnerable to attacks,
but is more difficult to build.
b. In the indirect strategy, the object is stored in a peer that owns the object,
but a reference is stored in a peer whose ID is somehow closest to the
object ID.
Q29-9.
b. In the indirect method, the file is stored in node 4, but a reference is given
in node 20.
1
2
Q29-11. For this network, m = log21024 = 10. This means each identifier has 10 bits.
The height of the tree is also 10. The number of leaves is 1024. Each node has
10 subtrees. Each routing table also has 10 rows.
Problem
P29-1. The number of rows in the finger table is log216 = 4. The rows in the table for
node N6 show the successors of target keys (6 + 2m−1) for m = 1 to 4 as shown
below:
Pre: N11 0
1 N3
2 N3
3 N3 Pre: N13
4 N8 k14 1 N8
Finger 2 N8
N13 N3 3 N8
4 N11
Pre: N8 Pre: Predecessor Finger
1 N13 Finger[1]: Successor
2 N13
3 N3 N11 k5
4 N3
Finger
k9 N8
Legend Pre: N3
: Key 1 N11
: Node 2 N11
3 N13
: Point 4 N3
: Responsible node Finger
3
P29-5. Let us go through the event as we did in Example 2.16 in the text. The follow-
ing shows how N12 with some help from N5 goes through the sequence of
events to find the successor of k7:
k7 N10
N12
6 N10
find_
successor N5
2 Your finger [1]?
k7 N5
N10
find_ N5 is the
predecessor predecessor N5
of k7.
Your finger [1]?
3
Note:
k7 N5 When the loop in
the find_predecessor
4 function terminates,
find_closest_ N12 knows that it
predecessor has found the
predecessor node.
a. Event 1: Since N12 is not the responsible node for k7, it calls its
find_successor function.
b. Event 2: N12 calls the find_predecessor function.
c. Event 3: Since N12 is not the predecessor node of k7, N12 calls the
find_closest_predecessor function. This function checks the finger table of
N12 from bottom to top. It finds that N5 is the closest predecessor because
5 ∈ (12, 7), N5 is between N12 and k7 when going around the ring in the
clockwise direction. This can also be seen if we think of 5 as 37 (in modulo
32 arithmetic) and 7 as 39. Definitely 37 ∈ (12, 39). Note that we need to
add 32 to 5 and 7 because we move from 12 to these two points as we pass
point 0.
d. Event 4: The find_closest_predecessor function returns N5 to the find_ pre-
decessor function as the closest predecessor of k7. N12 finds that N5 is
actually the predecessor of k7 (by remotely calling the N5.finger[1])
because 7 ∈ (5, 10].
e. Event 5: The find_predecessor function returns N5 to the find_successor
function as the predecessor of k7.
f. Event 6: Node N12 finds that the successor node of k7 is N10 by remotely
asking N5 to send its finger [1].
4
P29-9. We have m = log216 = 4 and n = m/b = 4/2 = 2. The routing table has n rows
(here 2) and 2b columns (here 4). The identifiers are 00 to 33 in base 4. The
following shows a possible routing table for node N21. In row 0, there should
be no common digits with the node identifier; the first digit defines the col-
umn number. In row 1, the first digit should be 2 (one common digit with node
N21); the second digit defines the column. Note that some cells can have no
entry.
0 1 2 3
0 00 10 31
1 20 22 23
a. Key k24 is not in the range of the leaf set of N02. The routing table should
be used. In this case p = 0 and v = 2, which means we need to look at the
routing table entry [0, 2] = N20. The query is passed to node N20. N20 is
not responsible for k24; the key k24 is not in the range of leaf set of N20;
the routing table is used. In this case, p = 1 and v = 4. Since table entry [1,
4] does not exist, the query is passed to a node sharing a prefix as long as
the current node, but numerically closer to the key, which is N23. The node
N23 is responsible for k24.
b. Key k12 is in the range of the leaf set of N20. The closest node in the leaf
set to k12 is the node N11. The query is passed to N11, which is responsi-
ble for k12.
a. The length of the common prefix between N0 (N0000) and k12 (k1100) is
0. Node N0 sends the query to the node specified in row 0 of its routing
table, node N8.
b. The length of the common prefix between N8 (N1000) and k12 (k1100) is
1. Node N8 sends the query to the node specified in row 1 of its routing
table, node N15.
c. Node 15 is responsible for k12. It responds to the query.
CHAPTER 30
PRACTICE SET
Questions
Q30-1. We cannot define the absolute order, but in normal situation we will rank them
as follows:
Q30-3. We cannot define the absolute order, but in normal situation we will rank them
as follows:
Q30-5. Our choice is VoIP. The goal is to make VoIP similar to the telephone conver-
sation we have over the phone using circuit switching.
Q30-7. None of these applications actually fit in this flow class. It is mostly designed
for interactive multimedia applications.
Q30-9. FIFO queueing and priority queueing are techniques used for scheduling.
a. Rspec (Resource specification) defines the resources that the flow needs to
reserve before starting the communication.
b. Tspec (Traffic specification) defines the traffic specification.
Q30-13. IntServ is called destination-base service because the destination host needs to
define the type of service required to start the communication.
Q30-17. In IntServ, the resources needs to be reserved before the communication starts.
We need to find the resources needed at each router. We need to send Path and
1
2
collect Resv packets to find the resources the routers need for communication
flow.
a. Meter
b. Marker
c. Shaper
d. Dropper
Problems
P30-1. We answer each question separately:
a. The following shows the time lines and the contents of the queue:
1 2 3 4 5 6 7
Arrival
t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13
1 2 3 4 5 6 7
Processing
t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13
Departure
1 2 3 4 5 6 7
t0 t1 t2 t3
Q Q Q Q
t4 t5 t6 t7
4 Q 5 Q 6 5 Q 7 6 Q
t8 t9 t10 t11
7 6 Q 7 Q 7 Q 7 Q
t12 t13
Q Q
b. The following shows the calculation of the time spent in the router and the
relative delay for each packet.
Packets: 1 2 3 4 5 6 7
Arrival time t0 t1 t2 t4 t5 t6 t7
Departure time t1 t2 t5 t7 t9 t12 t13
Time spent in the router 1 1 3 3 4 6 6
Relative departure delay − 1 3 2 2 3 1
c. Since the relative departure delay between each packet and the previous
one is not the same, there is jitter even if all packets have the same propa-
gation delay.
3
t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20
Departure
1 2 3 8 9 16 4 5 6 10 11 17 7 12 13 18 14 15 19 20
b. The following shows the contents of queues at t0, t5, t10, t15, and t20.
t10 7 15 14 13 12 20 19 18 17
t15 15 14 20 19
t20
c. We can calculate the relative delay between packets for the class w = 3 as
shown below. Since departure delays are different, the packets introduce
jitter even if they have the same propagation time.
Packets 1 2 3 4 5 6 7
Departure time t0 t1 t2 t6 t7 t8 t12
Delay with respect to previous packet − 1 1 4 1 1 4
d. We can calculate the relative delay between packets for the class w = 2 as
shown below. Since departure delays are different, the packets introduce
jitter even if they have the same propagation time.
Packets 8 9 10 11 12 13 14 15
Departure time t3 t4 t9 t10 t13 t14 t16 t17
Delay with respect to previous packet − 1 5 1 3 1 2 1
e. We can calculate the relative delay between packets for the class w = 1 as
shown below. Since departure delays are different, the packets introduce
jitter even if they have the same propagation time.
Packets 16 17 18 19 20
Departure time t5 t11 t15 t18 t19
Delay with respect to previous packet − 6 4 3 1
4
P30-5.
a. The input during the first minute is (100 gallons/minute) × (12/60 minute)
or 20 gallons.
b. The output during the first minutes is (5 gallons/minute) × (1 minute) or 5
gallons.
c. This means that after the first minute, 15 gallons of liquid is left in the
bucket. The problem does not mention the input rate after the first minute.
If there is no input flow, the bucket would be empty after four minutes.
P30-7. We set the value of n = 1000 bits and the time tick to one second. In each tick
of time, only 2 packets will be transmitted, as shown below.
a. The value of the counter is set to 1000; the size of the first packet (400 bits)
is less than the value of the counter. The first packet is transmitted. The
value of the counter is now decremented to 600.
b. The value of the counter is now 600; the size of the second packet (400
bits) is less than the value of the counter, so it is transmitted. The value of
the counter is now decremented to 200.
c. The value of the counter is now 200; the size of the third packet (400 bits)
is now larger than the value of the counter, so it cannot be transmitted. It
needs to wait for the next tick of time (next second).
d. The process repeats for every second. In each tick of time only two packets
can be sent. This means 800 bits per second or the rate of 0.8 Kbps. We
have reduced the rate from 4 Kbps to 0.8 Kbps.
P30-9. The following shows that the sender collects credits (tokens) that can be used
during the last three seconds. However, the sender loses some of the tokens
when the bucket becomes full because it uses very little during the first four
seconds and starts using the credits a little bit late.
Drop
Buckets
Seconds
0 1 2 3 4 5 6 7
Buffers
5
P30-11. To better understand the behavior of the leaky bucket in this problem, we first
create a table in each case to show the movement of cells in the system. The
flow diagram can follow the table. Although adding, removing, and dropping
cells are done for each individual cell, we assume that the cells are first added
to the queue, the ones that can be transmitted are removed from the queue, and
at the end of each second, the extra cells are dropped (discarded) if the queue
is full. Now we create the table and the flow diagrams for each case sepa-
rately.
a. The following shows the table for the first case. The table shows that there
are occasions when the queue is full and some cells are dropped (t12 to t16).
13 20 15 35 10 20 5
14 20 15 35 10 20 5
15 20 15 35 10 20 5
16 20 15 35 10 20 5
17 20 0 20 10 10 0
18 10 0 10 10 0 0
19 0 0 0 0 0 0
20 0 0 0 0 0 0
6
The following shows the flow of cells graphically. The first seven seconds,
the ISP rate follows the rate of the customer, but the ISP rate is reduced (to
the maximum 10 cells per second. The customer sends 170 cells, but the
ISP sends only 145 cells, which means that 25 cells are lost. The third fig-
ure shows the number of cells left in the queue in each second. Since some
cells are queues and some not, this means that there is uneven delay
between the cells (jitter).
Cell rate
20
15
10
5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Time
Cells arrived at ISP (170)
Cell rate
20
15
10
5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Time
Cells cent by ISP (145)
Cells
Drop of 25 cells
20
15
10
5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Time
Cells in the queue
7
b. The following shows the table for the second case. The table shows that
there is no cell lost. Although the customer sends more number of cells in
each second than its maximum rate, this only occurs only for four seconds
and does not overflow the queue.
01 0 15 15 10 5 0
02 5 15 20 10 10 0
03 10 15 25 10 15 0
04 15 15 30 10 20 0
05 20 5 25 10 15 0
06 15 5 20 10 10 0
07 10 5 15 10 5 0
08 5 5 10 10 0 0
09 0 5 5 5 0 0
10 0 5 5 5 0 0
11 0 5 5 5 0 0
12 0 5 5 5 0 0
13 0 5 5 5 0 0
14 0 5 5 5 0 0
15 0 5 5 5 0 0
16 0 5 5 5 0 0
17 0 5 5 5 0 0
18 0 5 5 5 0 0
19 0 0 0 0 0 0
20 0 0 0 0 0 0
8
The following shows the flow of cells graphically. The customer sends 130
cells, the ISP also sends 130 cells. There is no cell loss, but there is a delay
because some of the cells need to be queued during the first four seconds.
The queueing delays all cells after the t5 (jitter). The queue first becomes
full, but it gradually becomes empty.
Cell rate
20
15
10
5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Time
Cells arrived at ISP (130)
Cell rate
20
15
10
5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Time
Cells cent by ISP (130)
Cells
20
15
10
5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Time
Cells in the queue
9
c. The table for the third customer is shown below. The following shows the
table for the third case. This is another case in which there is no cell loss.
01 0 0 0 0 0 0
02 0 0 0 0 0 0
03 0 20 20 10 10 0
04 10 20 30 10 20 0
05 20 0 20 10 10 0
06 10 0 10 10 0 0
07 0 20 20 10 10 0
08 10 20 30 10 20 0
09 20 0 20 10 10 0
10 10 0 10 10 0 0
11 0 20 20 10 10 0
12 10 20 30 10 20 0
13 20 0 20 10 10 0
14 10 0 10 10 0 0
15 0 20 20 10 10 0
16 10 20 30 10 20 0
17 20 0 20 10 10 0
18 10 0 10 10 0 0
19 0 0 0 0 0 0
20 0 0 0 0 0 0
10
The following shows the flow of cells graphically. This is a very interesting
case. Although, some cells are queues, but the cells are departed from the
ISP with even delays. If we think that the cells are created at the ISP, we
can say that, from t3 to t18 , ISP sends 10 cells per second.
Cell rate
20
15
10
5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Time
Cells arrived at ISP (160)
Cell rate
20
15
10
5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Time
Cells cent by ISP (160)
Cells
20
15
10
5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Time
Cells in the queue
CHAPTER 31
PRACTICE SET
Questions
Q31-1. Only snooping is a threat to confidentiality. Masquerading and repudiation are
threats to integrity.
Q31-5. This is an example of steganography because the letter is covered by the seal.
Q31-7. This is an example of steganography because the message is hidden inside the
essay.
Q31-13. The key in this case needs to be between 0 and 25 (although there is no cipher
if the key is 0). on average Eve needs to test 26/2 = 13 keys to break the code.
Q31-15. For the additive cipher, we use only one key. For the monoalphabetic cipher,
we use 26 keys. For the autokey cipher, we use 1000 keys.
Q31-17. This is a straight permutation because the number of inputs and the number of
outputs are the same.
Q31-19.
1
2
b. The inverse of a shift right operation is a shift left operation using the same
number of bits to be shifted.
c. The inverse of a combine operation is a split operation.
Q31-21. Half of the input in DES is only 32 bits. The key is applied only to this 32-bit
section. The two inputs to an XOR should be of the same size. Since the key is
48 bits, we need to expand the 32-bit section to a 48-bit section using an
expansion P-box. Making the key for each round smaller jeopardizes the secu-
rity of DES.
Q31-23. The one-time pad is an ideal, but a theoretical, cipher; it cannot be imple-
mented easily because it requires that the sender and receiver have a secure
channel to exchange the key stream. However, it is controversial; if there is a
secure channel, the main message, in plaintext, can be sent through that chan-
nel.
Q31-29. Message authentication and entity authentication both authenticate the sender
for the receiver. As their names indicate, however, message authentication
authenticates the sender for a particular message, while entity authentication
authenticates the sender for the entire session in which several messages can
be sent. If the sender is sending only a single message, message authentication
has the same effect as entity authentication; if a sender is sending several mes-
sages, one entity authentication authenticates the sender for all messages.
Q31-31
a. The first choice is actually very inefficient and not practical because Alice
needs to have a shared secret key between herself and each of the recipi-
ents. She also needs to create fifty separate MACs, one for each secret key.
b. Alice can use digital signature and sign only one message with her own
private key. She then sends a copy of the message to each recipient. Each
recipient needs to use Alice’s public key to verify the message.
Q31-33. Alice needs to use the public key of each recipient, which different for each of
them. This means Alice needs to use 100 public keys.
Problems
P31-1.
P31-3.
P31-5. The plaintext and ciphertext are shown below, ignoring the space:
Plaintext Ciphertext
an exercise (5, 5), (3, 3), (1, 5), (3, 1), (1, 5), (2, 2), (3, 5), (4, 4), (3, 2), (1, 5)
P31-9. The content of each element represents the input column number; the index
represents the output column number.
3 1 4 5 2
1 2 3 4 5
b. The decryption key can be represented as shown below. Note that the
indexes are sorted.
2 5 1 3 4
1 2 3 4 5
c. We can first exchange the content and index and then sort the array accord-
ing to the index. For example, to get the decryption key from the encryp-
tion key in part a, we can first swap the contents and the index and then sort
it according to the index.
1: Swap 2: Sort
1 2 3 4 5 2 5 1 3 4
3 1 4 5 2 1 2 3 4 5
P31-11.
P31-13. As we said about the keys for the transposition cipher, permutation boxes (P-
boxes) can be represented by a table in which the contents of each element
shows the input number and the index show the output number.
2 5 4 1 3 1 3 5 1 3 3 1 2
1 2 3 4 5 1 2 3 1 2 3 4 5
Straight Compression Expansion
the result according to the index. The following shows the inversion of a
straight permutation box used in the decryption.
P31-15. le. In other words, we need to show that the component NI is eliminated in the
decryption process.
Encryption: C1 = P1 ⊕ NI
Decryption: P2 = C2 ⊕ NI = C1 ⊕ NI = (P1 ⊕ NI) ⊕ NI = P1 ⊕ (NI ⊕ NI)
P2 = P1 ⊕ (0) = P1
P31-17. Both operations are keyless and the operations are predefined. If Eve, the
intruder, wants to break the cipher, she can easily simulate them.
P31-21. Two messages can easily have the same traditional checksum. For example,
two different messages in which two bytes are swapped will have the same
traditional checksum because the calculation of a traditional checksum is
independent from the position of the bytes. This means a traditional checksum
cannot be used as a cryptographic hash function.
P31-23. The following shows the new diagram. The timestamp, T, included in the only
message does the job of the challenge message and RB.
Alice Bob
(claimant) (verifier)
Alice, T
P31-25. The following shows one simple solution. It shows the idea, but it is vulnera-
ble to some attacks. There are some better but more complicated solutions. In
7
the first message, Alice sends her identification and her nonce. In the second
message, Bob sends his identification, his nonce, and Alice’s encrypted nonce.
Alice’s nonce is encrypted with the shared secret key. When Alice receives
this message and decrypts her nonce, Bob is authenticated for her because
only Bob can encrypt Alice’s nonce with the shared secret key. In the third
message, Alice sends Bob’s encrypted nonce. When Bob receives this mes-
sage and decrypts his nonce, Alice is authenticated for Bob because only
Alice can encrypt Bob’s nonce with the shared secret key.
1 Alice, RA
Bob is Bob, RB , RA 2
authenticaed
3 RB Alice is
authenticaed
P31-27. The following shows the new diagram. Two nonces and two keys are used to
achieve bidirectional authentication.
Alice Bob
(claimant) (verifier)
1 Alice
RB 2
P31-29. The following shows the value of the digest after hashing each character of the
text. The method is not secure because the digest is always between 0 and 25.
The total number of possible digests is N = 26.
PRACTICE SET
Questions
Q32-1. IPSec needs a set of security parameters before it can be operative. In IPSec,
the establishment of the security parameters is done via a mechanism called
security association (SA).
Q32-3. The two protocols defined by IPSec for exchanging datagrams are Authentica-
tion Header (AH) and Encapsulating Security Payload (ESP).
Q32-5. The Encapsulating Security Payload (ESP) protocol adds an ESP header, ESP
trailer, and the digest. The ESP header contains the security parameter index
and the sequence number fields. The ESP trailer contains the padding, the
padding length, and the next header fields. Note that the digest is a field sepa-
rate from the header or trailer.
Q32-7. The two dominant protocols for providing security at the transport layer are
the Secure Sockets Layer (SSL) Protocol and the Transport Layer Security
(TLS) Protocol. The latter is actually an IETF version of the former.
Q32-9. A session between two systems is an association that can last for a long time;
a connection can be established and broken several times during a session.
Some of the security parameters are created during the session establishment
and are in effect until the session is terminated. Some of the security parame-
ters must be recreated (or occasionally resumed) for each connection.
Q32-11. One of the protocols designed to provide security for email is Pretty Good Pri-
vacy (PGP). PGP is designed to create authenticated and confidential e-mails.
Q32-13. The Handshake Protocol establishes a cipher set and provides keys and secu-
rity parameters. It also authenticates the server to the client and the client to
the server, if needed.
Q32-15. A firewall is a security mechanism that stands between the global Internet and
a network. A firewall selectively filters packets.
1
2
Q32-17. A VPN is a virtual network that uses VPN technology.The technology allows
an organization to use the global Internet yet safely maintain private internal
communication.
Problems
P32-1. When IPSec is used in the transport mode, two parties need to first create
cryptographic secrets between themselves before exchanging secure data.
This cannot be done using the connectionless service provided by IP. The two
parties need to create a virtual connection-oriented service between them-
selves over the services provided by IP. This is done using the Security Asso-
ciation (SA) described in the text.
P32-5. An SA provides two services for IPSec: it creates a virtual connection and
establishes security parameters between the two parties. The first service is
not needed in the case of SSL because SSL runs over TCP, which is a connec-
tion-oriented protocol. The second service of SA is provided by the handshake
protocol in SSL.
P32-7. The handshake protocol in SSL should start its function after the three-way
handshaking in TCP because the handshaking protocol in SSL does not create
a connection; it uses the connection established by TCP to exchange security
parameters.
P32-9. Alice creates a message digest and signs it with her private key. She then
sends the message and the signed digest.
P32-11. Alice creates a message digest from the content. Alice then sends the digest,
the hash algorithm, and the content. The whole is referred to as digestedData
object.
P32-13. Alice uses an envelopedData. She creates a random number as the session
key. She then encrypts the session key with Bob’s public key. The message is
encrypted with the session key.
P32-15. In e-mail communication, there is no virtual connection between the two par-
ties. Each e-mail is a unidirectional communication between the sender and
receiver. This means that there cannot be entity authentication in PGP or in S/
MIME. When we talk about authentication in PGP or S/MIME, we mean mes-
sage authentication.