You are on page 1of 11

Data Communications & Computer Networks

Dr. Mohammed A. Salem


Chapter 1
Answers by Mohamed Ashraf 20170633
[1] What advantage does a circuit-switched network have over a packet-switched
network?
• Decreases the delay the user experiences before and during a call.
• The call will be done with a steady bandwidth, dedicated channel, and
consistent data rate.
• Packets are always delivered in the correct order.
What advantages does TDM have over FDM in a circuit-switched network?
TDM has the advantage of being capable to use all the bandwidth
(multiplexing).

[2] Consider sending a packet from a source host to a destination host over a
fixed route. List the delay components in the end-to-end delay. Which of
these delays are constant, and which are variable?
The delay components are
• processing delay
• transmission delay
• propagation delay
• queuing delay
All of them are fixed for a fixed-size packet except queuing delay.
[3] Suppose Host A wants to send a large file to Host B. The path from Host
A to Host B has three links of rates R1 = 500 kbps, R2 = 2 Mbps, and R3 = 1 Mbps.
a. Assuming no other traffic in the network, what is the throughput
for the file transfer?
The throughput for the file transfer will be calculated over the minimum link
rate which is:
=500 kbps
So, the throughput for the file transfer=500 kbps
b. Suppose the file is 4 million bytes. How long will it take to transfer?
the file to Host B?
4 million bytes = 32000000 bits
• Using the R1:
𝑓𝑖𝑙𝑒 𝑠𝑖𝑧𝑒 32000000
= = 64 𝑠𝑒𝑐
𝑙𝑖𝑛𝑘 𝑟𝑎𝑡𝑒 500 ∗ 1000
• Using R2 Link:
𝑓𝑖𝑙𝑒 𝑠𝑖𝑧𝑒 32000000
= = 16 𝑠𝑒𝑐
𝑙𝑖𝑛𝑘 𝑟𝑎𝑡𝑒 2 ∗ 1000000
• Using R3 Link:
𝑓𝑖𝑙𝑒 𝑠𝑖𝑧𝑒 32000000
= = 32 𝑠𝑒𝑐
𝑙𝑖𝑛𝑘 𝑟𝑎𝑡𝑒 1 ∗ 1000000

[4] What are the five layers in the Internet protocol stack? What are the
principal responsibilities of each of these layers?
• Application layer - reserved for network applications and protocols
such as HTTP, SMTP, and FIP.
• Transport layer - end to end communication. Transports messages from
application layer.
• Network layer - moves packets from one host to destination. Has IP
protocols and Routing protocols.
• Link layer - responsible for link level communication. receives
datagram from network at each node and delivers it to the next node.
• Physical layer - at each node it moves individual bits of frames to next
node.
[5] What do encapsulation and de-encapsulation mean? Why are they needed
in a layered protocol stack?
• Data Encapsulation is the process in which some extra information is added
to the data item to add some features to it while it has been moved from top
to bottom layers.
• Data De-encapsulation is the reverse process of data encapsulation. The
encapsulated information is removed from the received data to obtain the
original data as it goes from down to top layers.
[6] You are in a university classroom and you want to spy on what websites
your classmates are visiting with their laptops during the course lecture.
If they all connect to the Internet through the university’s WiFi network,
what could you do?
Packet sniffing
to make copies of packets and this will tell me what they are trying to access.
[7] Suppose Alice and Bob are sending packets to each other over a
computer network. Suppose Trudy positions herself in the network so
that she can capture all the packets sent by Alice and send whatever she
wants to Bob; she can also capture all the packets sent by Bob and send
whatever she wants to Alice. List some of the malicious things Trudy can
do from this position.
IP spoofing
[8] Consider an application that transmits data at a steady rate (for example,
the sender generates an N-bit unit of data every k time units, where k is
small and fixed). Also, when such an application starts, it will continue
running for a relatively long period of time. Answer the following
questions, briefly justifying your answer:
a. Would a packet-switched network or a circuit-switched network be
more appropriate for this application? Why?
A circuit-switched network would be well suited to the application, because
the
application have long sessions with predictable bandwidth requirements.
b. Suppose that a packet-switched network is used and the only traffic
in this network comes from such applications as described above.
Furthermore, assume that the sum of the application data rates is
less than the capacities of each link.
Is some form of congestion control needed? Why?
If all the applications simultaneously transmit over one or more network links
that will be the worst case. However, since each link has sufficient bandwidth
to handle the sum of all the applications' data rates, no congestion (very little
queuing) will occur then the network does not need congestion control
mechanisms.
[9] Consider the circuit-switched network in Figure 1.13. Recall that there
are 4 circuits on each link. Label the four switches A, B, C, and D, going
in the clockwise direction.
a. What is the maximum number of simultaneous connections that
can be in progress at any one time in this network?
• The number of circuits on each link is the maximum number of
simultaneous connections in a network.
• When there are n connections between each of the four pairs of adjacent
switches, it gives a maximum of 4 n connections.
• The number of connections on each link between the adjacent switches is
4.
• Thus, the maximum number of simultaneous connections in the circuit
switched network is 44 =16 connections.
Then the maximum number of simultaneous connections is 16.
b. Suppose that all connections are between switches A and C. What
is the maximum number of simultaneous connections that can be in
progress?

Therefore, the number of simultaneous connections possible from A to C is 8.


c. Suppose we want to make four connections between switches A
and C, and another four connections between switches B and D.
Can we route these calls through the four links to accommodate all
eight connections?
Yes, it possible to make four connections between A and
C and other four connections between B and D.

[10] In this problem, we consider sending real-time voice from Host A to


Host B over a packet-switched network (VoIP). Host A converts analog
voice to a digital 64 kbps bit stream on the fly. Host A then groups the
bits into 56-byte packets. There is one link between Hosts A and B; its
transmission rate is 2 Mbps and its propagation delay is 10 msec. As soon
as Host A gathers a packet, it sends it to Host B. As soon as Host B
receives an entire packet, it converts the packet’s bits to an analog signal.
How much time elapses from the time a bit is created (from the original
analog signal at Host A) until the bit is decoded (as part of the analog
signal at Host B)?
Given:
Host A converts analog voice to a digital 64 kbps bit stream on the fly. Host
A then groups the bits into 56- byte packets. There is one link between Hosts
A and B; its transmission rate is 2 Mbps and its Propagation delay is 10 msec.
Queuing Delay:
𝑛𝑜. 𝑜𝑓 𝑝𝑎𝑐𝑘𝑒𝑡𝑠 56 ∗ 8
= = 7 𝑚𝑠
𝑏𝑖𝑡 𝑠𝑡𝑟𝑒𝑎𝑚 64 ∗ 1000
Transmission Delay:

56 ∗ 8
= 0.224 𝑚𝑠
2 ∗ 106
𝑇𝑜𝑡𝑎𝑙 𝑑𝑒𝑙𝑎𝑦
= 𝑇𝑟𝑎𝑛𝑠𝑚𝑖𝑠𝑠𝑖𝑜𝑛 𝑑𝑒𝑙𝑎𝑦 + 𝑃𝑟𝑜𝑝𝑎𝑔𝑎𝑡𝑖𝑜𝑛 𝑑𝑒𝑙𝑎𝑦
+ 𝑄𝑢𝑒𝑢𝑖𝑛𝑔 𝑑𝑒𝑙𝑎𝑦
= 0.224 + 10 + 7 = 17.224 𝑚𝑠
[11] Consider a packet of length L which begins at end system A and travels over
three links to a destination end system. These three links are connected by two packet
switches. Let 𝑑𝑖 , 𝑠𝑖 , 𝑎𝑛𝑑 𝑅𝑖 denote the length, propagation speed, and the
transmission rate of link The packet switch delays each packet by 𝑑𝑝𝑟𝑜𝑐 . Assuming
no queuing delays, what is the total end-to-end delay for the packet? Suppose now
the packet is 1,500 bytes, the propagation speed on all three links is 2.5 x 10^8 m/s,
the transmission rates of all three links are 2 Mbps, the packet switch processing
delay is 3 msec, the length of the first link is 5,000 km, the length of the second link
is 4,000 km, and the length of the last link is 1,000 km. For these values, what is the
end-to-end delay?
For all three links:
𝐿 1500 ∗ 8
= = 6 𝑚𝑠
𝑅1,2,3 2 ∗ 106
First link propagation delay:
𝑑1 5000 ∗ 103
= = 20 𝑚𝑠
𝑠 2.5 ∗ 108
Second link propagation delay:
𝑑2 4000 ∗ 103
= = 16 𝑚𝑠
𝑠 2.5 ∗ 108
Third link propagation delay:
𝑑3 1000 ∗ 103
= = 4 𝑚𝑠
𝑠 2.5 ∗ 108
𝐿 1
𝐸𝑛𝑑 𝑡𝑜 𝐸𝑛𝑑 𝑑𝑒𝑙𝑎𝑦 = 3 ( ) + (𝑑1 + 𝑑2 + 𝑑3 ) + 2 ∗ 𝑑𝑝𝑟𝑜𝑐
𝑅 𝑠
= 3 ∗ 6 + 20 + 16 + 4 + 2 ∗ 3
= 64 𝑚𝑠
[12] A packet switch receives a packet and determines the outbound link
to which the packet should be forwarded. When the packet arrives, one
other packet is halfway done being transmitted on this outbound link and
four other packets are waiting to be transmitted. Packets are transmitted
in order of arrival. Suppose all packets are 1,500 bytes and the link rate is
2 Mbps. What is the queuing delay for the packet? More generally, what
is the queuing delay when all packets have length L, the transmission rate
is R, x bits of the currently-being-transmitted packet have been
transmitted, and n packets are already in the queue?

𝑡𝑜𝑡𝑎𝑙 𝑏𝑦𝑡𝑒𝑠 𝑡𝑜 𝑏𝑒 𝑡𝑟𝑎𝑛𝑠𝑚𝑖𝑡𝑡𝑒𝑑 = 1500 ∗ 4.5 = 6750 𝑏𝑦𝑡𝑒𝑠


𝐿 6750 ∗ 8
𝑄𝑢𝑒𝑢𝑖𝑛𝑔 𝑑𝑒𝑙𝑎𝑦 = = = 27 𝑚𝑠
𝑅 2 ∗ 106
More generally:
𝑛𝐿 + 𝐿 − 𝑥
𝑇𝑄 =
𝑅
Where:
n: no. of bits to be transmitted
L: size of packets(bits)
x: no of bits that has been transmitted
R: rate of transmission
[13] Suppose N packets arrive simultaneously to a link at which no packets
are currently being transmitted or queued. Each packet is of length L and
the link has transmission rate R. What is the average queuing delay for
the N packets?
First packet queuing delay=0
𝐿
Second one =
𝑅
2𝐿
Third one =
𝑅
𝐿
Nth packet = (𝑁 − 1) ∗
𝑅
𝐿
Then the average is = (𝑁 − 1) ∗
2𝑅

[14] Suppose you would like to urgently deliver 40 terabytes data from
Boston to Los Angeles. You have available a 100 Mbps dedicated link
for data transfer. Would you prefer to transmit the data via this link or
instead use FedEx 1-day delivery. Explain.
40 terabytes = 3.2e^14 bits
3.2𝑒 14
𝑇𝑟𝑎𝑛𝑠𝑚𝑖𝑠𝑠𝑖𝑜𝑛 𝐷𝑒𝑙𝑎𝑦 = = 3.2 𝑚𝑖𝑙𝑙𝑖𝑜𝑛 𝑠𝑒𝑐 = 37.03 𝑑𝑎𝑦𝑠
100 ∗ 106
So the FedEx 1-day delivery is faster.

Chapter 2
[1] For a communication session between a pair of processes, which process
is the client and which is the server?
The process which initiates the communication is the client.
the process that waits to be contacted is the server.
[2] What information is used by a process running on one host to identify a
process running on another host?
The IP address of the destination host and the port number of the destination
socket.
[3] Suppose you wanted to do a transaction from a remote client to a server
as fast as possible. Would you use UDP or TCP? Why?
With UDP, because the transaction can be completed in one RTT - the client
sends the transaction request into a UDP socket, and the server sends the reply
to the client's UDP socket. With TCP, a minimum of two RTTs are needed -
one to set-up the TCP connection, and another for the client to send the
request, and for the server to send back its reply.
[4] List the four broad classes of services that a transport protocol can
provide. For each of the service classes, indicate if either UDP or TCP
(or both) provides such a service.
• Reliable data transfer: TCP only
• A guarantee that a certain value for throughput will be maintained: Neither
TCP nor UDP.
• A guarantee that data will be delivered within a specified amount of time:
Neither TCP nor UDP.
• Security: Neither TCP nor UDP.

[5] Why do HTTP, and SMTP run on top of TCP rather than on UDP?
Because TCP is more reliable than the UDP.
TCP is a connected-oriented network where there is a guarantee of the
transmitted packet in reaching the destination.
[6] The UDP server described needed only one socket, whereas the TCP
server needed two sockets. Why? If the TCP server were to support n
simultaneous connections, each from a different client host, how many
sockets would the TCP server need?
UDP uses one socket and TCP requires two sockets in a transmission because
UDP is a way one connectionless protocol but TCP is connection oriented.
The TCP server that supports n simultaneous connections would require n
sockets, ranging from 1 through n.
[7] Consider an HTTP client that wants to retrieve a Web document at a
given URL. The IP address of the HTTP server is initially unknown.
What transport and application-layer protocols are needed in this
scenario?
HTTP is an application layer protocol. HTTP needs TCP as its transport layer
protocol.
To establish a TCP connection, socket address of the server is needed.
So, another application layer protocol is needed. Which is DNS and that uses
UDP as its transport layer protocol.
[8] Suppose within your Web browser you click on a link to obtain a Web
page. The IP address for the associated URL is not cached in your local
host, so a DNS lookup is necessary to obtain the IP address. Suppose that
n DNS servers are visited before your host receives the IP address from
DNS; the successive visits incur an RTT of RTT1, . . ., RTTn. Further
suppose that the Web page associated with the link contains exactly one
object, consisting of a small amount of HTML text. Let RTT0 denote the
RTT between the local host and the server containing the object.
Assuming zero transmission time of the object, how much time elapses
from when the client clicks on the link until the client receives the
object?
The total amount of time to get the IP address is
𝑅𝑇𝑇1 + 𝑅𝑇𝑇2 + … + 𝑅𝑇𝑇𝑛
Once the IP address is known, 𝑅𝑇𝑇0 elapses to set up the TCP connection and
another 𝑅𝑇𝑇0 elapses to request and receive the object. The total response time is
2𝑅𝑇𝑇0 + 𝑅𝑇𝑇1 + 𝑅𝑇𝑇2 + … + 𝑅𝑇𝑇𝑛
[9] Referring to the previous question, suppose the HTML file references
eight very small objects on the same server. Neglecting transmission
times, how much time elapses with
a. Non-persistent HTTP with no parallel TCP connections?
𝑅𝑇𝑇1 + ⋯ + 𝑅𝑇𝑇𝑛 + 2𝑅𝑇𝑇0 + 8 ∗ 2 𝑅𝑇𝑇0
= 18𝑅𝑇𝑇0 + 𝑅𝑇𝑇1 + 𝑅𝑇𝑇2 + … + 𝑅𝑇𝑇𝑛
b. Non-persistent HTTP with the browser configured for 5 parallel
connections?
𝑅𝑇𝑇1 + ⋯ + 𝑅𝑇𝑇𝑛 + 2𝑅𝑇𝑇0 + 2 ∗ 2 𝑅𝑇𝑇0
= 6𝑅𝑇𝑇0 + 𝑅𝑇𝑇1 + 𝑅𝑇𝑇2 + … + 𝑅𝑇𝑇𝑛
c. Persistent HTTP?
𝑅𝑇𝑇1 + ⋯ + 𝑅𝑇𝑇𝑛 + 2𝑅𝑇𝑇0 + 𝑅𝑇𝑇0
= 3𝑅𝑇𝑇0 + 𝑅𝑇𝑇1 + 𝑅𝑇𝑇2 + … + 𝑅𝑇𝑇𝑛

You might also like