Elements of Computer Networking: An Integrated Approach (Concepts, Problems and Interview Questions)
Elements of Computer Networking: An Integrated Approach (Concepts, Problems and Interview Questions)
Computer Networking
An Integrated Approach
By
N a ra s i mh a K a ru m a n c h i
D r. A . D a m o d a ra m
D r. M. S re e ni v a s a R a o
All rights reserved. No part of this book may be reproduced in any form or by any
electronic or mechanical means, including information storage and retrieval systems,
without written permission from the publisher or author.
Acknowledgements
and , it is impossible to thank you adequately for everything you have
done, from loving me unconditionally to raising me in a stable household, where you
persistent efforts traditional values and taught your children to celebrate and embrace
life. I could not have asked for better parents or role-models. You showed me that
anything is possible with faith, hard work and determination.
This book would not have been possible without the help of many people. I would like
to thank them for their efforts in improving the end result. Before we do so, however, I
should mention that I have done my best to correct the mistakes that the reviewers
have pointed out and to accurately describe the protocols and mechanisms. I alone am
responsible for any remaining errors.
First and foremost, I would like to express my gratitude to many people who saw me
through this book, to all those who provided support, talked things over, read, wrote,
offered comments, allowed me to quote their remarks and assisted in the editing,
proofreading and design. In particular, I would like to thank the following individuals.
, Senior Consultant, Juniper Networks Pvt. Ltd.
, IIT Kanpur, Mentor Graphics Pvt. Ltd.
, IISc, Bangalore
, Head Master, Obulasuni Palle, Z. P. H. School
, Teacher, Kambhampadu, Z. P. H. School
, Teacher, Durgi
, Founder, StockMonks Pvt. Ltd.
, Co-Founder, NotionPress Pvt. Ltd.
, Lecturer, Nagarjuna Institute of Technology and Sciences, MLG
, Yahoo Pvt. Ltd.
, Development Manager, IBM Software Labs
, Development Manager, IBM Software Labs
, - ., , Subjects.
B-Tech., Technical Lead, HCL
-
M. Tech,
Founder,
Other Titles by Narasimha Karumanchi
Data Structures and Algorithms Made Easy
Data Structures and Algorithms for GATE
Data Structures and Algorithms Made Easy in Java
Coding Interview Questions
Peeling Design Patterns
IT Interview Questions
Preface
Dear Reader,
Please Hold on! We know many people do not read the preface. But we would strongly
recommend that you go through the preface of this book at least.
There are hundreds of books on computer networking already flooding the market.
The reader may naturally wonder what the need of writing another book on computer
networking is!
This book assumes you have basic knowledge about computer science. Main objective
of the book is to provide you the of and
questions. Before writing the book, we set ourselves the following :
Dr. A. Dr. M.
M. Tech, M.Tech. (C.S.E.), Ph.D. (C.S.E) Dean MSIT Programme,
Founder, Director, School of IT M.Tech. (C.S.E.), Ph.D. (C.S.E)
Director, School of IT
Table of Contents
2. Introduction -------------------------------------------------------------------------- 19
2.1 What is a Computer Network? ----------------------------------------------------------- 19
2.2 Basic Elements of Computer Networks ------------------------------------------------- 19
2.3 What is an Internet? ----------------------------------------------------------------------- 20
2.4 Fundamentals of Data and Signals------------------------------------------------------ 20
2.5 Network Topologies ------------------------------------------------------------------------ 24
2.6 Network Operating Systems -------------------------------------------------------------- 28
2.7 Transmission Medium --------------------------------------------------------------------- 29
2.8 Types of Networks -------------------------------------------------------------------------- 31
2.9 Connection-oriented and Connectionless services ------------------------------------ 34
2.10 Segmentation and Multiplexing -------------------------------------------------------- 35
2.11 Network Performance -------------------------------------------------------------------- 36
2.12 Network Switching ------------------------------------------------------------------------ 43
Problems and Questions with Answers ------------------------------------------------------ 49
Chapter
Organization of
Chapters 1
1.1 Why Computer Networks are needed?
Computer networking is one of the most exciting and important technical fields of our
time. Information and communication are two of the most important strategic issues
for the success of every enterprise.
is the mother of invention, and whenever we really need something, humans
will find a way to get it. Let us imagine we do not have computer networking in our
lives now. People can communicate only with each other through phone (or fax). For
example, sharing a printer between many computers will be difficult as printer cable
must be attached to the computer which requires printing. Removable media such as
diskettes or thumb drives must be used in order to share files or to transfer files from
one machine to another machine.
Just imagine you need to transfer a file to one thousand computers. To
these problems, computer networks are . Computer networks allow the user
to access and either of the same organization or
from other enterprises or public sources. Computer networks provide faster
communication than other facilities. Many applications or software‘s are also
developed for enhancing communication. Some examples are Email, Instance
Messages, and internet phone.
The application layer is built on the transport layer and provides network
services to user applications. It provides the interface between the applications
we use to communicate and the underlying network over which our messages
are transmitted. Application layer protocols are used to exchange data between
programs running on the source and destination hosts. In this chapter, we
discuss all the fore mentioned protocols in detail.
17. : This chapter covers other important topics of computer
networking (such as [QoS], operation,
basics etc.) even though they are out of scope of this book.
At the end of each chapter, a set of problems/questions are provided for you to
improve/check your understanding of the concepts. Wherever applicable, protocols
are compared with other similar protocols.
The examples in this book are kept simple for easy understanding. The objective is to
enhance the explanation of each concept with examples for a better understanding.
Chapter
Introduction 2
2.1 What is a Computer Network?
A computer network is a group of computers that are connected together and
communicate with one another. These computers can be connected by the telephone
lines, co-axial cable, satellite links or some other communication techniques.
Medium Network
Devices Message
Communication begins with a message that must be sent from one device to another.
People exchange ideas using many different communication methods. All of these
methods have elements in common.
The first of these elements is the . Message sources are
people, or electronic devices, that need to send a message to other
individuals/devices.
Important Question
From the choices below, select the best definition of a network.
A. A collection of printers with no media.
B. Devices interconnected by some common communication channel.
C. A device that sends communication to the Internet.
D. A shared folder stored on a server.
Answer: B.
Amplitude
Time
The readings from the thermometer are also continuous in amplitude. This means that
assuming your eyes are sensitive enough to read the mercury level, readings of 37,
37.4, or 37.440183432°C are possible. In actuality, most cardiac signals of interest
are analog by nature. For example, voltages recorded on the body surface and cardiac
motion is continuous functions in time and amplitude.
In this, signals 0 and 1 are transmitted as electric waves. A system of transmitting
analog signals is called system.
Time
Basically, code 1 is transmitted when applying a specific voltage and code 0 is
transmitted in the case of 0 V. A system of transmitting digital signals is called
system.
2.4.7 Frequency
Frequency describes the number of waves that pass a fixed place in a given amount of
time. So if the time it takes for a wave to pass is 1/2 second, the frequency is 2 per
second. If it takes 1/100 of an hour, the frequency is 100 per hour.
High frequency waves Low frequency waves
1 0 1 1 1 0 0 0 1 0
Time
The speed of the data is expressed in bits per second (bits/s, bits per second or bps).
The data rate is a function of the duration of the bit or bit time:
Rate is also called C. If the bit time is 10 , the data rate equals:
R= = bps or 100 million bits/sec
This can be used to translate baud into a bit rate using the following formula:
Baud can be abbreviated using the shortened form when being used for technical
purposes.
The significance of these formulas is that higher baud rates equate to greater amounts
of data transmission, as long as the bits per symbol are the same. A system using
4800 baud modems that has 4 bits per symbol will send less data than a system using
9600 baud modems that also has 4 bits per symbol. So, all other things being equal, a
higher rate is generally preferred.
2.4.10 Attenuation
(also called ) is a general term that refers to any reduction in the
strength of a signal. Attenuation occurs with any type of signal, whether digital or
analog. It usually occurs while transmitting analog or digital signals over long
distances.
How is it expressed?
As the name suggests, signal to noise ratio is a comparison or ratio of the amount of
signal to the amount of noise and is expressed in decibels. Signal to noise ratio is
abbreviated and higher numbers mean a better specification. A component
with a signal to noise ratio of 100 dB means that the level of the audio signal is 100
dB higher than the level of the noise and is a better specification than a component
with a S/N ratio of 90 dB.
Signal-to-noise ratio is defined as the power ratio between a signal and noise. It can be
derived from the formula
clears the cable so that other computers can send packets on the network. If there is
no termination, the entire network fails.
Node
Link
Only one computer at a time can transmit a packet on a bus topology. Systems in a
bus topology listen to all traffic on the network but accept only the packets that are
addressed to them. Broadcast packets are an exception because all computers on the
network accept them. When a computer sends out a packet, it travels in both
directions from the computer. This means that the network is occupied until the
destination computer accepts the packet.
The number of computers on a bus topology network has a major influence on the
performance of the network. A bus is a passive topology. The computers on a bus
topology only listen or send data. They do not take data and send it on or regenerate
it. So if one computer on the network fails, the network is still up.
Advantages
One advantage of a bus topology is . The bus topology uses less cable than other
topologies. Another advantage is the ease of . With the bus topology, we
simply connect the system to the cable segment. We need only the amount of cable to
connect the workstations we have. The ease of working with a bus topology and the
minimum amount of cable make this the most economical choice for a network
topology. If a computer fails, the network stays up.
Disadvantages
The main disadvantage of the bus topology is the difficulty of . When
the network goes down, usually it is from a break in the cable segment. With a large
network this can be tough to isolate. A cable break between computers on a bus
topology would take the entire network down. Another disadvantage of a bus topology
is that the the traffic, the the network.
Scalability is an important consideration with the dynamic world of networking. Being
able to make changes easily within the size and layout of your network can be
important in future productivity or downtime. The bus topology is not very scalable.
Link
Hub
Node
Advantages
One advantage of a start topology is the centralization of cabling. With a hub, if one
link fails, the remaining systems are not affected like they are with other topologies,
which we will look at in this chapter.
Centralizing network components can make an administrator‘s life much easier in the
long run. Centralized management and monitoring of network traffic can be vital to
network success. With this type of configuration, it is also easy to add or change
configurations with all the connections coming to a central point.
Disadvantages
On the flip side to this is the fact that if the hub fails, the entire network, or a good
portion of the network, comes down. This is, of course, an easier fix than trying to find
a break in a cable in a bus topology.
Another disadvantage of a star topology is cost: to connect each system to a
centralized hub, we have to use much more cable than we do in a bus topology.
Link
Node
As shown in figure, the ring topology is a circle that has no start and no end.
Terminators are not necessary in a ring topology. Signals travel in one direction on a
ring while they are passed from one system to the next. Each system checks the
packet for its destination and passes it on as a repeater would. If one of the systems
fails, the entire ring network goes down.
Advantages
The nice thing about a ring topology is that each computer has equal access to
communicate on the network. (With bus and star topologies, only one workstation can
communicate on the network at a time.) The ring topology provides good performance
for each system. This means that busier systems that send out a lot of information do
not inhibit other systems from communicating. Another advantage of the ring topology
is that signal degeneration is low.
Disadvantages
The biggest problem with a ring topology is that if one system fails or the cable link is
broken the entire network could go down. With newer technology this isn‘t always the
case. The concept of a ring topology is that the ring isn‘t broken and the signal hops
from system to system, connection to connection.
Link
Node
A mesh topology is not very common in computer networking. The mesh topology is
more commonly seen with something like the national phone network. With the mesh
topology, every system has a connection to every other component of the network.
Systems in a mesh topology are all connected to every other component of the
network. If we have 4 systems, we must have six cables— three coming from each
system to the other systems.
Two nodes are connected by dedicated point-point links between them. So the total
number of links to connect nodes would be
[Proportional to ]
Advantages
The biggest advantage of a mesh topology is fault tolerance. If there is a break in a
cable segment, traffic can be rerouted. This fault tolerance means that the network
going down due to a cable fault is almost impossible.
Disadvantages
A mesh topology is very hard to administer and manage because of the numerous
connections. Another disadvantage is cost. With a large network, the amount of cable
needed to connect and the interfaces on the workstations would be very expensive.
Repeater-1
Repeater-2 Repeater-3
we have eight stations, this can be used in a normal fashion. But if we need to add
more stations then we can connect two or more repeaters in a hierarchical format (tree
format) and can add more stations.
In the figure Repeater-1 refers to repeater one and so on and each repeater is
considered to have 8-ports.
All the topologies discussed so far are symmetric and constrained by well-defined
interconnection pattern. However, sometimes no definite pattern is followed and nodes
are interconnected in an arbitrary manner using point-to-point links.
Unconstrained topology allows a lot of configuration flexibility but suffers from the
complex routing problem. Complex routing involves unwanted overhead and delay.
2.6.1 Peer-to-peer
Peer to Peer
Network
File Server
Other
equipment
Twisted pair cables are widely used in telephone network and are increasingly being
used for data transmission.
Larger the cable diameter, lower is the transmission loss, and higher transfer speeds
can be achieved. A co-axial cable can be used over a distance of about 1 KM and can
achieve a transfer rate of up to 100 Mbps.
On the flip side, difficult installation and maintenance procedures of fiber require
skilled technicians. Also, the cost of a fiber-based solution is more. Another drawback
of implementing a fiber solution involves cost for fitting to existing network
Projector
Camera
Scanner
Printer
These large streams of data would result in significant delays. Further, if a link in the
interconnected network infrastructure failed during the transmission, the complete
message would be lost and have to be retransmitted in full.
A better approach is to divide the data into smaller, more manageable pieces to send
over the network. This division of the data stream into smaller pieces is called
. Segmenting messages has two primary benefits.
, by sending smaller individual pieces from source to destination, many different
conversations can be interleaved on the network. The process used to interleave the
pieces of separate conversations together on the network is called .
, segmentation can increase the reliability of network communications. The
separate pieces of each message need not travel the same pathway across the network
from source to destination. If a particular path becomes congested with data traffic or
fails, individual pieces of the message can still be directed to the destination using
alternate pathways. If part of the message fails to make it to the destination, only the
missing parts need to be retransmitted.
Next Router/Switch
or
Processing delay Destination
Processing delay
Router or Switch
These are the latencies caused only by propagation delays in the transmission
medium. If you were the only one sending one single data bit and you had unlimited
bandwidth available, the speed of the packet would still be delayed by the propagation
delay.
This delay happens without regard for the amount of data being transmitted, the
transmission rate, the protocol being used or any link impairment.
For example:
Serialization of a 1500 byte packet used on a 56K modem link will take 214
milliseconds
Serialization of the same 1500 byte packet on a 100 Mbps LAN will take 120
microseconds
Serialization can represent a significant delay on links that operate a lower
transmission rates, but for most links this delay is a tiny fraction of the overall latency
when compared to the other contributors.
Voice and video data streams generally use small packet sizes (~20 ms of data) to
minimize the impact of serialization delay.
effect of noise can be overcome by increasing the power level of the transmitted signal,
or by adding a few extra error correcting bits to the data that is being transmitted.
These error correcting bits help the receiver correct bit errors. However, the error
correction bits increase the bandwidth that is required.
Bandwidth
The Bandwidth Delay Product, or BDP for short determines the amount of data that
can be in transit in the network. It is the product of the availalbe bandwidth and the
latency. Sometimes it is calculated as the data link's capacity multiplied by its round
trip time (RTT). BDP is a very important concept in a Window based protocol such as
TCP.
It plays an especially important role in high-speed / high-latency networks, such as
most broadband internet connections. It is one of the most important factors of
tweaking TCP in order to tune systems to the type of network used.
The BDP simply states that:
the traffic arrives occasionally or arrives in bursts. To get some insight here, let ― ‖
denote the average rate at which packets arrive at the queue ( is in units of
packets/sec). Also, assume that is the transmission rate; that is, it is the rate (in
bits/sec) at which bits are pushed out of the queue.
For simplicity, that all packets consist of bits. Then the average rate at which bits
arrive at the queue is bits/sec. Finally, suppose that the queue is very big, so that
it can hold basically an infinite number of bits. The ratio , called the
, often plays an important role in estimating the extent of the queuing delay.
When downloading a file you will see a window with a progress bar and a number.
This number is actually the throughput and you must have noticed that it is not
constant and almost always has a value lower than specified bandwidth for your
connection.
Several factors like the number of users accessing the network, network topology,
physical media and hardware capabilities can effect this reduction in the bandwidth.
As you can imagine, throughput is also measured using the same units used to
measure the bandwidth.
As you have seen, bandwidth and throughput seems to give a similar measurement
about a network, at the first glance. They are also measured using the same units of
measurement. Despite all these similarities they are actually different. We can simply
say that the bandwidth is the maximum throughput you can ever achieve while the
actual speed that we experience while surfing is the throughput.
To simplify further, you can think of the bandwidth as the width of a highway. As we
increase the width of the highway more vehicles can move through a specified period
of time. But when we consider the road conditions (craters or construction work in the
highway) the number of vehicles that can actually pass through the specified period of
time could be less than the above. This is actually analogous to the throughput. So it
is clear that bandwidth and throughput gives two different measurements about a
network.
9. Let P be the percentage of time that bits are in the channel. With the
unrestricted protocol we have: P = ( )
( )
Link
Node
It is not efficient to build a physically separate path for each pair of communicating
end systems. An alternative method to a - - connection is a
network. In a communication network, each communicating (or
or or ) is connected to a network node.
The interconnected nodes are capable of transferring data between stations.
Shared Medium
Communication Network
Depending on the architecture and techniques used to transfer data, two basic
categories of communication networks are broadcast networks and switched networks.
Broadcast Networks
Switched Networks
Communication Networks
Node
Link
Broadcast is a method of sending a signal where multiple nodes may hear a single
sender node. As an example, consider a conference room with full of people. In this
conference room, a single person starts saying some information loudly.
During that time, some people may be sleeping, and may not hear what person is
saying. Some people may not be sleeping, but not paying attention (they are able to
hear the person, but choose to ignore). Another group of people may not only be
awake, but be interested in what is being said. This last group is not only able to hear
the person speaking, but is also listening to what is being said.
In this example, we can see that a single person is broadcasting a message to all
others that may or may not be able to hear it, and if they are able to hear it, may
choose to listen or not.
Switched communication networks can be categorized into different types such as the
following.
Communication Networks
Circuit Establishment
Data Transfer
Circuit Disconnect
Therefore, the channel capacity must be reserved between the source and destination
throughout the network and each node must have available internal switching
capacity to handle the requested connection. Clearly, the switching nodes must have
the intelligence to make proper allocations and to establish a route through the
network.
The most common example of a circuit-switched network can be found in public
telephone network supporting services such as POTS (plain old telephone systems)
and long-distance calls.
However, if senders each have a packet to send, a given sender will transmit
approximately of all packets.
: The 30,000 packets/second processing speed means 30,000 packets are going
in and 30,000 packets are coming out of the switch every second. Therefore the I/O
bus speed is 60,000 packets/second.
Minimum IP packet size 64 bytes Bit rate = 60,000 64 8 = 30.78 Mbps
Average IP packet size 500 bytes Bit rate = 60,000 500 8 = 240 Mbps
Maximum Ethernet frame size 1500 bytes Bit rate = 60,000 1500 8 = 720 Mbps
Question 2: Imagine the length of a cable is 2500 metres. If the speed of propagation
in a thick co-axial cable is 60% of the speed of light, how long does it take for a bit
to travel from the beginning to the end of the cable? Ignore any propagation delay
in the equipment. (Speed of light = 3 x metres / sec)
: Speed of propagation = 60% = 60 3 / 100 = 18 metres / sec.
So it would take a bit 2500 / 18 = 13.9 secs.
Question 3: Suppose that data are stored on 2.44 Mbyte floppy diskettes that weight
20 gm each. Suppose that an airliner carries kg of these floppies at a speed of
2000 km/h over a distance of 8000 km. What is the data transmission rate in bits
per second of this system?
: Let us first calculate the time for which data was carried.
=
So, Time = = = 4 hrs.
Question 6: Suppose a 128 kbps peer-to-peer link is set up between earth and a rover
on mars. The distance from the earth to mars (when they are the closest together)
is approximately 55 Gm (Gigameter), and data travels over the link at the speed of
light meters/sec. Calculate the minimum RTT for the link.
: Propagation delay of the link is = 184 secs. Thus, RTT = 368 secs.
Question 7: For the Question 6, calculate the product of the link.
Answer: The delay bandwidth product for the link is the RTT bandwidth = 23.5
Mb.
Question 8: For the Question 6, a camera on the rover takes pictures of its
surroundings and sends these to the earth. How quickly can it reach Mission
Control on Earth? Assume that each image is 5 Mb in size.
: After a picture is taken, it must be transmitted on the link and completely
propagated, before Mission Control can interpret it. Transmit delay for 5 Mb of data is
29 secs. Hence, total time = Transmit delay + Propagation delay = 223 secs.
Question 9: Calculate the latency (from first bit sent to the last bit received) for the
following: 1 Gbps Ethernet with a single store and forward switch in the path, and
a packet size of 5000 bits. Assume that each link introduces a propagation delay
of 10 (micro second) and that the switch begins retransmitting immediately
after it has finished receiving the packet.
:
A) For each link it takes 5 to transmit the packet on the link, after which it
takes an additional 10 µs for the last bit to propagate across the link. Thus for a LAN
with only with only one switch that starts forwarding only after receiving the whole
packet, the total transfer delay is the transmit delays + two propagation delays 30
.
B) For 3 switched and thus 4 links, the total delay is 4 transmission delays + 4
propagation delays = 60 .
Question 10: Determine the maximum length of the cable (in km) for transmitting data
at a rate of 500 Mbps in an Ethernet LAN with frames of size 10,000 bits. Assume
the signal speed in the cable to be 2,00,000 km/s.
A) 1 B) 2 C) 2.5 D) 5
:B
= +
= +
Length = 2 km
Question 11: 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,200 bytes and the link rate is 3 Mbps. What is the queuing delay
for the packet? More generally, what is the queuing delay when all packets have
length S, the transmission rate is T, X bits of the currently being transmitted
packet have been transmitted, and packets are already in the queue?
: The arriving packet must first wait for the link to transmit 5,400 bytes or
43,200 bits. Since these bits are transmitted at 3 Mbps, the queuing delay is 14.3
msec. Generally, the queuing delay is .
Question 12: Suppose we would like to urgently deliver 60 Terabytes of data from
to . We have a 1000 Mbps dedicated link for data transfer
available. Would you prefer to transmit the data via this link or instead use
AirMail overnight delivery? Explain.
Answer: 60 Terabytes = 60 8 bits. So, if using the dedicated link, it will take
60 8 / (1000 ) = 480000 seconds = 5.6 days. But with AirMail overnight
delivery, we can guarantee the data arrives in one day, and it only costs us no more
than USD 100.
Question 13: Two nodes, A and B, communicate through a store & forward network.
Node A is connected to the network by a 10 Mbps link, while node B is connected
by a 5 Mbps link. Node A sends two back-to-back packets of 1000 bits each. The
difference between the arrival times of the two packets at B is 1 ms. What is the
smallest capacity of a link along the path between A and B?
Note: Assume that there are no other packets in the network except the ones sent
by A, and ignore the packet processing time. Assume both packets follow the same
path, and they are not reordered. The arrival time of a packet at a node is defined
as the time when the last bit of the packet has arrived at that node.
: Since packets are sent back-to-back, the difference between the arrival times
of the packets at B represents the transmission time of the second packet on the
slowest link in the path. Thus, the capacity of the slowest link is 1000 bits/1 ms = 1
Mbps.
Question 14: Consider an infinite queue that can send data at 10 Kbps. Assume the
following arrival traffic:
• During every odd second the queue receives an 1000 bit packet every 50 ms
• During every even second the queue receives no data.
Assume an interval I of 10 sec starting with an odd second (i.e., a second in which
the queue receives data). At the beginning of interval I the queue is empty. What is
the maximum queue size during interval I?
: 10 packets. There are 20 packets arriving during the second and 10
packets sent at the end of that second. Thus at the end of second there are 10
packets in the queue. All the 10 packets will be sent at the end of second (since no
new packets are received). Thus, at the end of second the queue size is 0. After that
the process repeats.
(Note: The following alternate answers: 11 packets, 10 Kb, and 11 Kb all received
maximum points. The 11 packets and 11 Kbps assume that at a time when a packet is
received and another one is sent out, the received packet is already in the queue as
the other packet is sent out.)
Question 15: For the Question 14, what is the average time (delay) a packet spends in
the queue during interval I?
:
= = 0.475 s
Alternate solution that approximates the average delay: We use Little‘s theorem:
= . During an odd second the number of packets in the
queue increases linearly from 0 to 10 and during the next second it decreases from 10
to 0. This means that the average number of packets in the queue is 5. Over an odd
and an even second the average arrival rate is = 10.
Then, = = = 0.5sec.
(Note: The following answers also received maximum points: 0.575s and 0.5s.)
Question 16: Similar to Question 14 and Question 15, now assume that during odd
seconds the queue receives 1000 bit packets every 25 ms (instead of every 50 ms),
and during even seconds it still receives no data. For this traffic patterns answer
the same questions. What is the maximum queue size during interval I?
: 110 packets. In this case the queue is never empty. During the first 9 seconds
of interval I there are 5 s (1 s/25 ms) = 200 packets received and 90 packets sent out.
Thus, at the end of the second there are 110 packets in the queue.
(Note: The following answers also received the maximum number of points: 111
packets, 110 Kb, and 111 Kb.)
Question 17: For the Question 16, what is the average time (delay) a packet spends in
the queue during interval I?
: Packets received during first second
• packet arrives at time 0 and starts being transmitted immediately, at time 0.
delay 0
• packet arrives at 0.025 s and starts being transmitted at 0.1 s (after the first
packet) delay 0.075 s
• packet arrives at 0.05s and starts being transmitted at 0.2 s (after first two
packets) delay 0.15 s
• packet arrives at 0.075 s and starts being transmitted at 0.3 s (after first three
packets) delay 0.225 s
…
• packet arrives at ( ) 0.025 s and starts being transmitted at ( ) 0.1 s
delay ( ) 0.075s
= = 1.4625 s
Packets received during second: note that at the beginning of the second there
are still 20 packets in the queue
• packet arrives at time 0 and starts being transmitted immediately, at time 2s
delay 2
• packet arrives at 0.025s and starts being transmitted at 2+0.1 s delay
2+0.075 s
• packet arrives at 0.05s and starts being transmitted at 2+0.2 s delay 2+0.15
s
• packet arrives at 0.075s and starts being transmitted at 2+0.3 s delay
2+0.225 s
…
• packet arrives at (k-1)*0.025s and starts being transmitted at 2+( ) 0.1 s
delay 2+( ) 0.075 s
The average delay of the packets in the first two seconds is
= = 3.4625 s
…
Packets received during second: note that at the beginning of the second there
are still 80 packets in the queue
• packet arrives at time 0 and starts being transmitted immediately, at time
8s delay 2
• packet arrives at 0.025s and starts being transmitted at 8+0.1s delay
8+0.075s
• packet arrives at 0.05s and starts being transmitted at 8+0.2s delay
8+0.15s
• packet arrives at 0.075s and starts being transmitted at 8+0.3s delay
8+0.225s
…
• packet arrives at (k-1) 0.025s and starts being transmitted at 8+(k-1)
0.1s delay 8+(k-1) 0.075s
The average delay of the packets in the first two seconds is
= = 9.4625 s
Alternate solution that approximates the average delay: The average arrival rate is 40
packets/2 sec = 20 packets/sec.
During the 1st sec the number of packets in the queue increases linearly from 0 to 30,
thus the average number of packets in the queue in the sec is 15. During
second the queue decreases linearly from 30 to 20, thus the average number of
packets in the queue is 25, and the average number of packets in the queue over the
first two seconds is 20.
During and seconds the process repeats with the difference that there are 20
packets in the queue at the beginning of the second. Thus, the average number of
packets in the queue during the and seconds is 20 20 = 40.
2.12 Network Switching 54
Elements of Computer Networking Introduction
Similarly, the average number of packets during the and seconds is 40+20 =
60, during the and seconds 60+20=80, and during the and seconds is
80+20=100.
Thus the average number of packets over the entire interval I is = 60.
According to the Little‘s theorem = = = 6sec.
(Note: In general the average number of packets over the interval defined by the
2 and 2 seconds is 20, where .)
Question 18: Suppose a CSMA/CD network is operating at 1 Gbps, and suppose there
are no repeaters and the length of the cable is 1 km. Determine the minimum
frame size if the signal propagation speed is 200 km/ms.
: Since the length of the cable is 1 km, we have a one-way propagation time of
= = 0.005 ms = 5 µs. So, 2 = 10 µs.
: Period = = 1 ms.
Question 20: A digital signaling system is required to operate at 9600 bps. If a symbol
encodes a 4-bit word, what is the minimum required channel bandwidth?
: The formula to use is
Maximum number of bits/sec 2 Channel bandwidth Number of bits per sample
If number of different possible values of a sample is given, use the formula
Maximum number of bits/sec 2 Channel bandwidth
Question 23: Suppose that data is stored on 1.4 Mbyte floppy diskettes that weight 30
grams each. Suppose that an airliner carries Kg of these floppies at a speed of
1000 Km/h over a distance of 5000 Km. What is the data transmission rate in bps
of this system?
: Each floppy measures 30 grams. We have the following
Number of floppies = /30 = 333333.33
Total number of bits transported = Number of floppies 1.4 1024 (not 1000!)
1024 8
i.e., Number of bits/sec = Total number of bits transported/5*3600.
The answer is 217.4 Mbps.
: When we talk of computer momory, it is typically measured in powers of 2,
thefore 1 Kb bytes. When it comes to networks, we use clocks to send data, if a
clock is 1 Khz, we transmit at the rate of 1 kilobits per sec, where the kilo is 1000, we
are transmitting at the clock rate.
Question 24: Consider a 150 Mb/s link that is 800 km long, with a queue large enough
to hold 5,000 packets. Assume that packets arrive at the queue with an average
rate of 40,000 packets per second and that the average packet length is 3,000
bits. Approximately, what is the propagation delay for the link?
: 800 km times 5 microseconds per km is 4,000 microseconds or 4 ms.
Question 25: For the Question 24:, what is the transmission time for an average length
packet?
: Link speed is 150 bits per microsecond, so a 3,000 bit packet can be sent in
20 microseconds.
Question 26: For the Question 24:, what is the traffic intensity?
: Bit arrival rate is 40,000 times 3,000 or 120 Mb/s. Since the link rate is 150
Mb/s, I=0.8
Question 27: For the Question 24:, what is the average number of packets in the
queue?
: =4.
Question 28: What is the average number in the queue, if the average arrival rate is
80,000 packets per second?
: In this case, the traffic intensity is 1.6, so the queue will be nearly full all the
time. So, the average number is just under 5,000 packets.
Question 29: A user in Hyderabad, connected to the Internet via a 5 Mb/s connection
retrieves a 50 KB (B=bytes) web page from a web server in New York, where the
page references 4 images of 300 KB each. Assume that the one way propagation
delay is 20 ms. Approximately how long does it take for the page (including
images) to appear on the user‘s screen, assuming persistent HTTP?
: Total time is 3RTT + Transmission time.
3RTT = 120 ms and Transmission time = = = 2 seconds
Total time = 2.12 seconds.
Question 30: For the Question 29, how long would it take using non-persistent HTTP
(assume a single connection)?
2(1 + number of objects in page)RTT + Transmission time
400 ms + 2 seconds = 2.4 seconds
2.12 Network Switching 56
Elements of Computer Networking Introduction
Question 31: Suppose a movie studio wants to distribute a new movie as a digital file to
1,000 movie theaters across country using peer-to-peer file distribution. Assume
that the studio and all the theaters have DSL connections with an 8 Mb/s
downstream rate and a 4 Mb/s upstream rate and that the file is 10 GB long.
Approximately, how much time is needed to distribute the file to all the theaters
under ideal conditions?
: The total upstream bandwidth is about 4 Gb/s. Since the file must be
delivered to 1,000 studios, we have 10 TB of data to be delivered. At 4 Gb/s, this takes
20,000 seconds, or roughly 6 hours.
Question 32: For the Question 24:, suppose the studio wanted to use the client-server
method instead. What is the smallest link rate that is required at the studio that
will allow the file to be distributed in under 40,000 seconds?
: This time period is twice the time used for the first part, so the server‘s
upstream bandwidth must be half as large as the upstream bandwidth of the peers in
the first part. So, 2 Gb/s is enough.
Question 33: Suppose a file of 5,000 bytes is to be sent over a line at 2400 bps.
Calculate the overhead in bits and time in using asynchronous communication.
Assume one start bit and a stop element of length one bit, and 8 bits to send the
byte itself for each character. The 8-bit character consists of all data bits, with no
parity bit.
: Each character has 25% overhead. For 10,000 characters, there are 20,000
extra bits. This would take an extra = 2.0833 seconds.
Question 34: Calculate the overhead in bits and time using synchronous
communication. Assume that the data are sent in frames. Each frame consists of
1000 characters - 8000 bits and an overhead of 48 control bits per frame.
: The file takes 10 frames or 480 additional bits. The transmission time for the
additional bits is = 0.2 seconds.
Question 35: What would the answers to Question 28 and Question 29 be for a file of
100,000 characters?
: Ten times as many extra bits and ten times as long for both.
Question 36: What would the answers to Question 28 and Question 29 be for the
original file of 10,000 characters except at a data rate of 9600 bps?
: The number of overhead bits would be the same, and the time would be
decreased by a factor of 4 = .
Question 43: Station A uses 32 byte packets to transmit messages to Station B using a
sliding window protocol. The round trip delay between A and B is 80 milliseconds
and the bottleneck bandwidth on the path between A and B is 128 kbps. What is
the optimal window size that A should use ?
A) 20 B) 40 C) 160 D) 320
: B.
Path bandwidth = 128 kbps
Time delay = 80 ms
Total data = bits = bytes
1 packet size = byte
Number of packets =