CN Chapter 2 Solutions
CN Chapter 2 Solutions
5 PRACTICE SET
2.5.1 Quizzes
A set of interactive quizzes for this chapter can be found on the book website. It is
strongly recommended that the student take the quizzes to check his/her understanding
of the materials before continuing with the practice set.
2.5.2 Questions
Q2-1. What is the first principle we discussed in this chapter for protocol layering
that needs to be followed to make the communication bidirectional?
Ans:
(We need to make each layer so that it is able to perform two opposite tasks, one in
each direction.) The first principle dictates that if we want bidirectional
communication, we need to make each layer so that it is able to perform two opposite
tasks, one in each direction. For example, the third layer task is to listen (in one
direction) and talk (in the other direction). The second layer needs to be able to
encrypt and decrypt. The first layer needs to send and receive mail.
Q2-2. Which layers of the TCP/IP protocol suite are involved in a link-layer switch?
Ans:
In TCP IP protocol, a link-layer switch is involved with the data-link layer and
physical layer
Q2-3. A router connects three links (networks). How many of each of the following
layers can the router be involved with?
Ans:
a. physical layer: 3
b. data-link layer: 3
c. network layer: 1
Q2-4. In the TCP/IP protocol suite, what are the identical objects at the sender and
the receiver sites when we think about the logical connection at the application
layer?
Ans:
Identical objects are messages at the application layer.
Q2-5. A host communicates with another host using the TCP/IP protocol suite. What
is the unit of data sent or received at each of the following layers?
Ans:
a. application layer : messages
b. network layer: datagrams or packets
c. data-link layer: frames
Q2-6. Which of the following data units is encapsulated in a frame?
a. a user datagram
b. a datagram
c. a segment
Ans:
All of them.
Q2-7. Which of the following data units is decapsulated from a user datagram?
a. a datagram
b. a segment
c. a message
Ans:
a message
Q2-8. Which of the following data units has an application-layer message plus the
header from layer 4?
Ans:
Hypertext Transfer Protocol (HTTP)
Simple Mail Transfer Protocol (SMTP)
File Transfer Protocol (FTP)
Terminal Network (TELNET)
Domain Name System (DNS)
Q2-10. If a port number is 16 bits (2 bytes), what is the minimum header size at the
transport layer of the TCP/IP protocol suite?
Ans:
The minimum header size will be (2*16 bits) 32 bits to contain the sending and
receiving port address.
Q2-11. What are the types of addresses (identifiers) used in each of the following
layers?
Ans:
a. Application layer: site name or email (specific address).
b. Network layer: logical address (IP address).
c. Data-link layer: link-layer address.
48 PART I OVERVIEW
Q2-12. When we say that the transport layer multiplexes and demultiplexes
application layer messages, do we mean that a transport-layer protocol can combine
several messages from the application layer in one packet? Explain.
Ans:
No, multiplexing/de-multiplexing at transport layer don’t mean to combine several
upper layer packets into one transport layer packet. It only means that each of the
transport layer protocols such as transmission control protocol (TCP) can carry a
packet from any application layer protocol that needs its service. However, a transport
layer packet can carry one and only one packet from an application layer protocol
Ans:
Because the application layer is the top layer in the suite - it doesn’t provide services
to any layer, which means multiplexing/demultiplexing does not exist for this layer
Q2-14. Assume we want to connect two isolated hosts together to let each host
communicate with the other. Do we need a link-layer switch between the two?
Explain.
Ans:
Link layer switch is used to establish the communication between incoming links and
outgoing links - link layer switch receive the incoming frames and transmit it to the
outgoing links. In this case we dont need a link layer switch because the
communication is automatically one to one. A link layer switch is needed when we
need to change a one to many communication to a one to one
Q2-15. If there is a single path between the source host and the destination host, do
we need a router between the two hosts?
Ans:
a router is used to forward data units between multiple devices and networks. Router
main functionality is to select the best path for the packets to travel to reach the
destination. Routers select the best path suitable for the delivery of the packers when
multiple paths are available to reach the destination. when there is only one path
available between the source host and the destination host a router has no scope for
selecting the best path for the packets to travel. therefore, a router is not required when
only one path exists.
2.5.3 Problems
P2-1. Answer the following questions about Figure 2.2 when the communication is
from Maria to Ann:
P2-2. Answer the following questions about Figure 2.2 when the communication is
from Maria to Ann:
P2-3. Assume that the number of hosts connected to the Internet at year 2010 is five
hundred million. If the number of hosts increases only 20 percent per year,
what is the number of hosts in year 2020?
Ans:
A = P(1 + r/100)^n
P - old hosts
r - rate per year
n - number of years
500(1+20/100)^10
3100 million hosts
P2-4. Assume a system uses five protocol layers. If the application program creates a
message of 100 bytes and each layer (including the fifth and the first) adds a
header of 10 bytes to the data unit, what is the efficiency (the ratio of application
layer
bytes to the number of bytes transmitted) of the system?
Ans:
5*10 bytes added to every data unit
so 150 bytes are transmitted instead of the 100 bytes, therefore the efficiency range of
the system = 100 /150 = 66.66%
P2-5. Assume we have created a packet-switched internet. Using the TCP/IP protocol
suite, we need to transfer a huge file. What are the advantage and disadvantage
of sending large packets?
Ans:
advantages - packets are routed to the fastest available route, each package is
transmitted independently therefore security achieved mostly. routers every time
verify the destination address of the packet. Disadvantages - larger packets are
required longer time for transmitting. it allows any network for data transmission
P2-6. Match the following to one or more layers of the TCP/IP protocol suite:
a. route determination
b. connection to transmission media
c. providing services for the end user
Ans:
a. data link and network layer
b. physical layer
c. application layer
P2-7. Match the following to one or more layers of the TCP/IP protocol suite:
a. creating user datagrams
b. responsibility for handling frames between adjacent nodes
c. transforming bits to electromagnetic signals
Ans:
a. transport layer
b. data-link layer
c. physical layer
P2-8. In Figure 2.10, when the IP protocol decapsulates the transport-layer packet,
how does it know to which upper-layer protocol (UDP or TCP) the packet
should be delivered?
Ans:
A protocol needs to have a field in its header to identify to which protocol the
encapsulated packets belong.
P2-9. Assume a private internet uses three different protocols at the data-link layer
(L1, L2, and L3). Redraw Figure 2.10 with this assumption. Can we say that,
in the data-link layer, we have demultiplexing at the source node and multiplexing
at the destination node?
Ans:
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 node and
multiplexing at the destination node in the data-link layer. However,
some purists call these two inverse multiplexing and inverse demultiplexing.
P2-10. Assume that a private internet requires that the messages at the application
layer be encrypted and decrypted for security purposes. If we need to add
some information about the encryption/decryption process (such as the algorithms
used in the process), does it mean that we are adding one layer to the
TCP/IP protocol suite? Redraw the TCP/IP layers (Figure 2.4 part b) if you
think so.
Ans:
No it does not mean that we are adding another layer to the protocol suite, it just
means that the transport layer has taken another function and now contains the
encryption/decryption process. This process could be contained and handled within
the transport layer to be able to encrypt and decrypt data.
P2-12. The presentation of data is becoming more and more important in today’s
Internet. Some people argue that the TCP/IP protocol suite needs to add a new
layer to take care of the presentation of data. If this new layer is added in the
future, where should its position be in the suite? Redraw Figure 2.4 to include
this layer.
Ans:
The presentation of data is becoming more and more important in today’s
Internet. Some people argue that the TCP/IP protocol suite needs to add a new
layer to take care of the presentation of data. If this new layer is added in the
future, where should its position be in the suite? Redraw Figure 2.4 to include
this layer.
P2-13. In an internet, we change the LAN technology to a new one. Which layers in
the TCP/IP protocol suite need to be changed?
Ans:
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 encapsulated 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.
Ans:
The reason for having several protocols in a layer is to provide different services to
the upper-layer protocols. The services provided by UDP are different from the
services provided by TCP. When we write an application program, we need to first
define which transport-layer protocol is supposed to give services to this application
program. Note that this does not violate the principle of layer independence. The
independency of a layer means that we can change a protocol in a layer as long as the
new one gives the same services as the old one. This does not mean that we can
replace UDP by TCP, because they provide different services.
P2-15. Using the internet in Figure 1.11 (Chapter 1) in the text, show the layers of the
TCP/IP protocol suite and the flow of data when two hosts, one on the west
coast and the other on the east coast, exchange messages.