Você está na página 1de 39

FAQ

1. What is the use of sharing computers over the network?


\Ans:
Sharing computers over the network enable you to exchange information and resources among
computers and their users. Information exchange can be electronic mail or file transfer. Resource
sharing can be usage of peripheral device, such as printer, connected to other computers.
2. What is a workgroup?
Ans:
group of users who share information in a multi!user environment is known as a workgroup.
3. What is the WWW? Who invented it?
Ans:
World Wide Web or the WWW is a bank of information that is available over the network. "im
#erners!$ee invented it in %&'&.
4. What is a Web browser?
Ans:
Web browser is a software for viewing websites. Internet (xplorer and )etscape )avigator are some
popular Web browsers.
5. What is a modem?
Ans:
modem *+,dulate -(modulate. is a device used to connect to the Internet through telephone lines.
Chapter Two Questions
Part 1
1. ,SI is a protocol model standardi/ed by the 00000000000
Ans.
IS,
2. ,SI has 00000000 layers.
Ans.
Seven
3. "he 00000000 layer is responsible for delivering data frames from one station to next without error.
Ans.
-ata $ink
4. "he 0000000000 layer uses the services provided by the network layer.
Ans.
"ransport
5. t the receiving end, the data is passed to transport layer from 00000000.
Ans.
)etwork
6. (ach layer adds 00000000 to the data it received from the upper layer.
Ans.
Its own information
7. "123I2 has 00000000000 layers.
Ans.
4ive
8. "he layers not present in "123I2 model are 0000000000 and 00000000000.
Ans.
Session and 2resentation
9. t transport layer the protocols defined by "123I2 model are 000000000 and 000000000.
Ans.
5-2 and "12
10. R41 stands for 00000000000000.
Ans.
Re6uest for 1omments
Part 2
1. #riefly explain what is meant by protocol and protocol architecture.
Ans.
protocol is software that resides either in a computer7s memory or in the memory of a transmission
device, such as a network interface card. 2rotocols govern format, timing, se6uencing, and error
control. protocol is used for communication between entities in different systems. 4or two entities
to communicate successfully, they must speak the same language. What is communicated, how it is
communicated, and when it is communicated must conform to some mutually acceptable convention
or protocol between the entities involved. "he following are the key elements of a protocol8
Syntax8 Includes such things as data format and signal levels
Semantics8 Includes control information for coordination and error handling
Timing8 Includes speed matching and se6uencing
2rotocol architecture is a structured set of modules that implements the
communication function between computers.
2. #riefly explain the ,SI architecture.
Ans.
,pen System Interconnection *,SI. protocol architecture, defined by the International Standards
Organization (ISO), includes a set of protocols to define and standardi/e the data communication
process. It defines how data communications take place in the real world and what protocols should
be used at each layer.
"he following are the salient features of ,SI protocol architecture8
Layere arc!itect"re8 "he ,SI model is composed of seven ordered layers8 2hysical *layer %., -ata
link *layer 9., )etwork *layer :., "ransport *layer ;., Session *layer <., 2resentation *layer =., and
pplication *layer >.. Within a single computer system, each layer calls upon the services of the layer
?ust below it. 4or example, )etwork layer *layer :. uses the services provided by the -ata link layer
*layer 9. and it provides services to "ransport layer *$ayer ;..
Peer#t$#%eer %r$cess8 "he processes on each system that communicate at a given layer are called
peer!to!peer processes. 1ommunication between machines is therefore a peer!to!peer processes
communicating to each other using protocols appropriate to the given layer. t the physical layer,
communication is direct. @owever, at the higher layers, communication must move down through the
layers on -evice , over to the device #, and then back up through the layers. (ach layer in the
sending device adds its own information to the message it receives from the layer ?ust above it and
passes the whole package to the layer ?ust below it. @eaders are added to the data at layers =,<,;,: and
9. "railers are usually added only at layers 9.
Layer $rgani&ati$n8 "he seven layers can be thought of as belonging to three subgroups. "he layers
%, 9, and :, called the 2hysical, -ata $ink, and )etwork layers respectively, are the network support
layers. "hey deal with the physical aspects of moving data from one device to another device. "he
layers <, =, and >, called Session, 2resentation, pplication respectively, are the user support layers.
"hey allow interoperability among unrelated software systems. "he layer ; called the "ransport layer
links the two subgroups and ensures that the upper layers can use the data that the lower layers have
transmitted. "he upper ,SI layers are implemented in software. "he lower ,SI layers are a
combination of hardware and software, except for the physical layer, which is mostly hardware.
3. What are the functions of the network layer? (xplain.
Ans.
"he network layer is responsible for the source!to!destination delivery of a packet possibly across
multiple networks *links.. Whereas data link layer oversees the delivery of the packet between two
systems on the same network *link., the network layer ensures that each packet gets from point of
origin to its final destination. If the two systems are connected to the same link then there would be no
re6uirement for the network layer. @owever if the two systems are attached to different networks with
connecting devices *known as routers. between the networks, then this layer plays a crucial role in
getting the packet from source to destination.
"he )etwork layer provides for the transfer of data in the form of packets across the communication
networks. It establishes, maintains, and terminates logical and physical connections across multiple
interconnected networks. key aspect of this transfer is the routing of packets from the source to the
destination machine typically traversing a number of transmission links and network nodes where
routing is carried out. Routing is the process by which a path is selected out of many available paths
to the destination so that data packet reaches the destination fast, efficiently, reliably as re6uired. "his
function makes the network most complex layer in the reference model.
4. (xplain the functionalities and the services offered by the transport layer of the ,SI model.
Ans.
"he transport layer is designed to provide the Atransparent transfer of data from a source end open
system to a destination end open system,B according to the ,SI Reference +odel. "he transport layer
establishes, maintains, and terminates communications links between two machines.
"he "ransport layer ensures data is successfully sent and received between two end systems. If data is
sent incorrectly, this layer has the responsibility to ask for retransmission of the data. lso it ensures
data are passed onto the upper layers in the same order in which they were sent. Specifically, it
provides a reliable, network!independent message!interchange service to the top three application!
oriented layers. "his layer acts as an interface between the bottom and top three layers. #y providing
the session layer with a reliable message transfer service, it hides the detailed operation of the
underlying network from the session layer.
Some of the important services that are performed by the transport layer in order
to meet the above re6uirements are8
Ser'ice#%$int aressing8 1omputers often run several programs at the same time. 4or this reason,
source!to!destination delivery means delivery not only from one computer to the next but also from a
specific process *a running program. to a specific process at the receiving end. "he transport layer
header must therefore include a type of address called service!point address *or port address.. "he
network layer gets each packet to the correct computerC the transport layer gets the entire message to
the correct process on that computer.
Segmentati$n an reassem()y8 If the message sent by the application program at the transmitting
end is huge, there would be problem in moving that from the transmitting system to the receiving
system as many of the physical network underneath would impose restriction on the maximum si/e of
the data that can be transferred at one time. In order to over!come this restriction, transport layer splits
the incoming message into segments *each of transferable si/e. at the transmitting system and
reassembles them at the receiving end.
part from the above, other tasks performed by the transport layer are
1onnection control, 4low control, and (rror control.
5. What are the functionalities of the session layer of ,SI model?
Ans.
"he session layer organi/es and synchroni/es the exchange of data between application processes. It
works with the application layer to provide simple data sets called synchroni/ation points that let an
application know how the transmission and reception of data are progressing. In simplified terms, the
session layer can be thought of as a timing and flow control layer.
"he session layer is the network dialog controller. It establishes, maintains, and synchroni/es the
interaction between communicating systems. Specifically its responsibilities include8
*ia)$g c$ntr$)8 "his allows two systems to enter into a dialog. It allows the communication between
two processes to take place either in half!duplex *one way at a time. or full duplex *both ways
simultaneously..
Sync!r$ni&ati$n8 "he session layer allows a process to add checkpoints *synchroni/ation points. into
a stream of data. 4or example, if a system is sending a file of 9,DDD pages, it is advisable to insert
checkpoints after every %DD pages to ensure that each %DD page is received and acknowledged
independently. "he reception of acknowledgement for these checkpoints ensures to the sending
system that data up to the corresponding checkpoint is received properly by the receiving end system.
n example where session layer plays a crucial role is the file transfer application when used to
transfer huge files *downloading of huge files.. When huge files are transferred across the network, if
the network connection speed is not high, it would take very long time for transfer. "here is every
chance that network connection would break during this transfer and the user is re6uired to start a
fresh to do the file transfer, and there is no guarantee that the same would not repeat, making it
sometime practically impossible to download very huge files. If the checkpoints are used by the file
transfer application then, this problem can be sorted out easily. Suppose the connection fails during
the %D:;th page, then after reconnecting we can proceed from the last checkpoint, i.e. from page
%DD%. -uring retransmission time the only pages that are resent for the second time are %DD% to %D:;
as pages till %DDD are received and acknowledged. If checkpoints were not there, we have to start from
page % every time we try to reconnect.
6. What are the layers present in "123I2 model? (xplain the layer, which provides the transport
functionalities along with the protocols defined for that layer.
Ans.
"he "123I2 model is made up of five layers8
2hysical layer
-ata $ink layer
)etwork layer *I2.
"ransport layer *5-2 and "12.
pplication layer
"he layer that provides the transport functionalities along with the protocols defined for that layer is
)etwork layer. "he network layer is concerned with access to and routing data across a network for
two end systems attached to multiple interconnected networks. "he Internet 2rotocol *I2. is used at
this layer to provide the routing function across multiple networks. "his protocol is implemented not
only in the end systems but also in routers. router is a processor that connects two or more networks
and whose primary function is to relay data from one network to the other on its route from the source
to the destination end system.
"he Internet 2rotocol *I2. is the transmission mechanism used by the "123I2 protocols. It is an
unreliable and connectionless datagram protocol E i.e. it provides a best!effort delivery service. "he
term best!effort means that I2 provides no error checking or tracking. I2 assumes the unreliability of
the underlying layers and does its best to get the get a transmission through to its destination, but with
no guarantees. I2 transports data in packets called datagrams each of which is transported separately.
-atagram can travel through different routes and can arrive out of se6uence or be duplicated. I2 does
not keep track of routes and has no facility to reorgani/e datagrams once they arrive at their
destination. "hese limitations should not be considered as the weakness of the protocol stack. It is
intentional, to get the maximum efficiency. "he purpose at this layer is to provide the bare!bone
transmission functions that free the user to add only those facilities necessary for a given application.
t this network layer "123I2 supports the Internetworking Protocol (IP). I2, in turn, contains four
supporting protocols8 R2, RR2, I1+2 and IF+2.
7. +ake a brief comparison between ,SI and "123I2 models.
Ans.
"he ,SI architecture is a de!?ure *according to law. standard. "he focus in the ,SI world has always
been more on the standard than the implementation of the standard. "he ,SI model is used as a
reference model to make comparisons. "he ,SI reference model was devised before the protocols
were implemented. "he ordering means that the model was not biased toward one particular set of
protocols, which made it 6uite general.
"he "123I2 architecture is a de!facto *in reality. standard. With the "123I2 model, the protocols
came first, and the model was ?ust a description of the existing protocols. "he "123I2 model is not
used to describe other models.
FAQ
1. What is the difference between network protocol and protocol architecture?
Ans:
network protocol is a set of rules for communication between computers. 2rotocol architecture is a
structured set of modules that implements the communication function between computers.
2. What does ,SI stands for?
Ans:
,SI stands for ,pen System Interconnection.
3. What is ,SI protocol architecture?
Ans:
G,SI protocol architecture, defined by the International Standards ,rgani/ation *IS,., includes a set
of rules that are used to define and standardi/e the data communication process. ,SI protocol
architecture defines how data communications take place in the real world and what protocols should
be used at each layer.
4. @ow many layers are present in the ,SI protocol architecture?
Ans:
"he ,SI model is composed of seven ordered layers8 2hysical *layer %., -ata link *layer 9., )etwork
*layer :., "ransport *layer ;., Session *layer <., 2resentation *layer =., and pplication *layer >..
5. What is "123I2 protocol architecture? @ow many layers are present in the "123I2 protocol
architecture?
Ans:
"123I2 is the most widely used architecture and is a result of protocol research and development
work conducted on the experimental network, R2)(". "he "123I2 model is made up of five
layers8 2hysical layer, -ata link layer, )etwork layer, "ransport layer, and pplication layer. "he first
four layers provide physical standards, network interface, internetworking and transport functions that
correspond to the first four layers of the ,SI model. @owever, the three top layers of the ,SI model
are represented in the "123I2 by a single layer called pplication layer.
6. (xplain the data flow from device to device # through different ,SI layers.
Ans:
G"he se6uence of data transfer from device to device # through different ,SI layers is8
pplication layer of device 2resentation layer of device Session layer of device
"ransport layer of device )etwork layer of device -ata link layer of device 2hysical
layer of device 2hysical layer of device # -ata link layer of device # )etwork layer of
device # "ransport layer of device # Session layer of device # 2resentation layer of device
# pplication layer of device #.
"he preceding concept is displayed in the following figure8
Data Flow from Device A to Device B throgh Different OSI !a"ers
7. What is the difference between physical layer and data link layer?
Ans:
"he physical layer is the lowest layer of the ,SI model and deals with the Bmechanical, electrical,
functional, and procedural meansB re6uired for transmission of data. "he physical layer is responsible
for data transmission from one host to another. "he data link layer provides for the control of the
physical layer, and detects and corrects errors that can occur during transmission. "he data link layer
adds header and trailer at the transmitting end and removes the same at the receiving end.
8. Which layer is responsible for encoding, encrypting, and compressing data?
Ans:
"he presentation layer is responsible for encoding, encrypting, and compressing data.
9. What is the difference between ,SI model and "123I2 model?
Ans:
"he ,SI model is a de!?ure *according to law. standard. "he focus in the ,SI world has always been
more on the standard than the implementation of the standard. "he ,SI model is used as a reference
model to make comparisons. "he ,SI reference model was devised before the protocols were
implemented. "he ordering means that the model was not biased toward one particular set of
protocols, which made it 6uite general. "he "123I2 model is a de!facto *in reality. standard. With the
"123I2 model, the protocols came first, and the model was ?ust a description of the existing protocols.
"he "123I2 model is not used to describe other models.
10. What is the use of the session layer?
Ans:
"he session layer organi/es and synchroni/es the exchange of data between application processes. It
works with the application layer to provide simple data sets called s"nchronization #oints that let an
application know how the transmission and reception of data are progressing. In simplified terms, the
session layer can be thought of as a timing and flow control layer.
Chapter Three Questions
1. What is an I2 address?
Ans.
(ach system on the Internet is recogni/ed by a uni6ue I2 address. It is a :9 bit *; bytes. long number.
It uni6uely identifies the host that is connected to the Internet. "he Internet uthority grants these
addresses. If the local network is not connected to the Internet then it is possible to have I2 address of
ones choice. @owever, there is a subset of addresses available for that purpose and it is recommended
to use those addresses only. It is possible for a host to have multiple I2 addresses.
n I2 address has two parts. "he one that identifies the network is known as netid. "he other one that
identifies the host is known as hostid.
2. What are the different classes of I2 addresses available in I2H;?
Ans.
"here are five different I2 classes8 , #, 1, -, and (. these are designed to cover the needs of
different types of organi/ation.
1lass
If the first bit is D, then the given address is a class address. Remaining
portion of the first byte define the netid. #yte 9 to ; determines the hostid.
1lass addresses are designed for organi/ations that are having huge
number of hosts connected to their network.
1lass #
If the first two bits of the I2 address are %D, then the given address is a 1lass
# address. @ere hostid is %= bits long and the rest %; bits are for the netid.
"hese addresses are designed for midsi/e organi/ations.
1lass 1
If the first three bits of the I2 address are %%D,then the given address is a
1lass 1 address. "he next 9% bits define the netid and the remaining ' bits
determine the hostid. "hese are addresses are designed for small
organi/ations.
1lass -
"his address is meant for multicasting. "his does not have netid or hosted.
"he first four bits *%%%D. define the class here.
1lass (
"his is a class reserved for special purposes by the Internet authority. "he
first four bits of this class are %%%%. "here is no netid or hostid in this class.
3. What is a subnet?
Ans.
subnet is one of the networks that is created when a large physical network is divided into smaller
networks.
4. What is a subnet mask? Why is it necessary?
Ans.
subnet mask is a :9!bit mask used to distinguish the network I- from the host I-.
In the process of routing, when a "123I2 host sends data to another "123I2 host, the I2 at the source
host determines whether the destination host is local or remote. "o determine this, I2 uses the )-
operation. I2 )-s the source I2 address with the source subnet mask and the destination I2 address
with the source subnet mask. If the )-ing results of the source and destination addresses match, the
destination host is local. If they do not match, then the destination host is remote.
5. What are private networks?
Ans.
Internet authorities have reserved three blocks of address from which an organi/ation can choose the
netid of their choice. "hese addresses are
1lass 8 *netid.%D.D.D
1lass #8 *netid.%>9.%= to %>9.:%
1lass 18 *netid.%&9.%='.D to %&9.%='.9<<
ddresses with these netid are private addresses.
6. What is I2 multicasting?
Ans.
When a data packet is sent from an individual source to a group of destinations, a multicast
communication takes place. multicast address is a 1lass - address. "he whole address defines a
multicast group id. "he multicast address can never be a source I2 address. It can only be a
destination addresses in an I2 datagram packet.
Some of the multicast addresses are8
99;.D.D.%8 ll systems on this S5#)("
99;.D.D.>8 S" routers
99;.D.%.>8 udio news
FAQ
1. What are I2 addresses? #riefly explain them.
Ans:
I2 addresses are necessary for universal communication services that are independent of underlying
physical network. n I2 address is currently a :9!bit *; byte. address, which can uni6uely identify a
host connected to the Internet. )o two hosts on the Internet can have the same I2 address. In addition,
I2 addresses are defined such a way so that one can easily identify the network to which it is
connected so that routing becomes easy. 4or example, %9'.%%.:.:% is an I2 address.
2. What is a port address?
Ans:
port address identifies the correct process *a running program on the computer. on the source and
destination host systems to which the data actually corresponds. 4or example, data sent by the 4"2
client process from system should reach the 4"2 server process at the system #. It should not reach
the +I$ server process running on the system #. So it is not only crucial to identify the end systems
to which the data meant but the end processes has to be identified also. "o achieve this, different
processes are labeled uni6uely. In "123I2, this labeling is called as port address. port address is %=
bits long *9 byte..
3. (xplain the I2 datagram format.
Ans:
"he unit of transfer in an I2 network is called an I2 datagram. I2 datagram has a predefined format in
which a datagram has to be filled so that all the systems that receive it, understand its content without
any ambiguity. It consists of an I2 header and data relevant to higher!level protocols. datagram is a
variable length packet consisting of two parts, header and data. "he header can be from 9D to =D bytes
long and contains information essential for routing and delivery. "he length of the data part varies
from packet to packet but the total length of the I2 datagram should be within =<,<:< bytes.
4. What are I2 address classes? 1lassify the I2 address classes and briefly explain them.
Ans:
"he Inter)I1 *"he Internet7s )etwork Information 1enter. allocates the I2 addresses. "he bits that
correspond to the network I- are set to one. "he bits that correspond to the host I- are set to /ero.
"hese I2 addresses are divided into 1lass , 1lass #, 1lass 1, 1lass -, and 1lass (. (nd users do not
use the 1lass - and 1lass ( I2 addresses.
+)ass A ,P aress8 Iou can have 1lass I2 addresses in your network if you have large number of
hosts. "he high!order bit is always set to binary D. "he next seven bits complete the network I-. "he
last three octets represent the host I-. "he default subnet mask used in the 1lass I2 address is
9<<.D.D.D. In addition, they have the first octet from D!%9=. "he number of networks possible in class
I2 addresses is %9'. "he number of hosts possible per network is %=,>>>,9%=. 4or example,
%%.<9.:=.' is a 1lass I2 address.
+)ass - ,P aress8 Iou can have 1lass # I2 addresses if your organi/ation has medium!si/ed
networks. "he two high!order bits are always set to binary % D. "he next %; bits complete the network
I-. "he last two octets represent the host I-. "he default subnet mask used in the 1lass # I2 address
is 9<<.9<<.D.D. In addition, they have the first octet from %9'!%&%. "he number of networks possible
in class # I2 addresses is %=,:';. "he number of hosts possible per network is =<,<:=. 4or example,
%>9.<9.:=.' is a 1lass # I2 address.
+)ass + ,P aress8 1lass 1 I2 addresses are used in small local area networks. "he three high!order
bits are always set to binary % % D. "he next 9% bits complete the network I-. "he last octet represents
the host I-. "he default subnet mask used in the 1lass 1 I2 address is 9<<.9<<.9<<.D. In addition,
they have the first octet from %&9!99:. "he number of networks possible in class I2 addresses is
9,D&>,%<9. "he number of hosts possible per network is 9<=. 4or example, %&9.<9.<=.' is a 1lass 1 I2
address.
+)ass * ,P aress8 1lass - I2 addresses are reserved for I2 multicast addresses. "he four high!
order bits are always set to binary % % % D. "he remaining bits represent the specific group in which
the client participates. +icrosoft supports class - I2 addresses for multicast applications to multicast
data to hosts on an internetwork. "hese hosts are designed to receive multicast data.
+)ass . ,P aress8 "he class ( I2 addresses are for experimental purposes. "hey are not in use. "he
four high!order bits are always set to binary % % % %.
Chapter Four Questions
Part 1
1. Indicate the length of following addresses in terms of bytes8
2hysical address *for (thernet.
I2 address
2ort address
Ans.
a. P!ysica) aress /0$r .t!ernet18 = bytes
b. ,P aress8 ; bytes
c. P$rt aress8 9 bytes
2. Identify the class of the following I2 addresses.
a. 99&.%<.>=.%%D
b. %&%. :9.>'.9>
c. ;.<.=.>
Ans.
a. 229.15.76.1108 1lass -
b. 191. 32.78.278 1lass #
c. 4.5.6.78 1lass
3. device having more than one I2 address is known as 000000000 device.
Ans.
+ultihomed
4. 1hange the following I2 address from binary to decimal point notation8
D%%%D%DD% D%D%%%D% DD%D%%D% %DDD%D%D
Ans.
9::.&:.;<.%:'
5. device whose primary function is routing the I2 datagrams over the physical network is called
as 00000000000.
Ans.
Router
6. "he two types of routing are 000000000 routing and 000000000 routing.
Ans.
-irect and indirect
7. "he minimum length of I2 datagram is 0000000000 bytes.
Ans.
<>=
8. "he I2 datagram header has the I2 addresses of 0000000 and 000000000 systems.
Ans.
Source, destination
9. In the I2 datagram 0000000000 field is used for the error detection purpose.
Ans.
1hecksum
10. 2rotocol used to find out the physical address of a destination host from its I2 address is known as
0000000.
Ans.
R2
11. 2rotocol used for reporting the errors occurred during the datagram transfer is 00000000.
Ans.
I1+2
Part 2
1. Write in detail about the different addressing mechanisms used in the "123I2 model.
Ans.
"123I2 model has the following three different levels of addressing8
P!ysica) aress8 "his is the address of a node at the data link layer, as defined by the $) or W).
It is included in the frame sent by the data link layer. "his address determines the host system on a
particular network. "he "123I2 does not define the si/e and format of the physical address and it
depends on the kind of the network. 4or example, (thernet $) uses = byte *;' bit. physical address
that is imprinted into the )etwork Interface 1ard.
2hysical addresses can be either unicast *Single recipient., multicast *a group
of recipients. or broadcast *received by all in the network.. @owever not all
networks supports these. (thernet E one of the popular $) E supports all of
these.
,nternet aress8 Internet addresses are necessary for universal communication services that are
independent of underlying physical network. 2hysical networks have different addressing format
depending upon the network technology used. In addition, the addressing does not have any
component using which one can identify the network to which it is connectedC which is essential for
the routing purpose.
"he Internet addresses are designed for this purpose. n Internet address is
currently a :9 bit *; byte. address, which can uni6uely identify a host,
connected to the Internet. )o two hosts on the Internet can have the same I2
address. In addition, Internet addresses are defined such a way that given an
I2 address one can easily identify the network to which it is connected so that
routing becomes easy.
P$rt aress8 "he I2 address and the physical address identify the source and the destination
systems. "hey do not identify the process *a running program on the computer. on these systems to
which the data actually corresponds. "he final ob?ective of the Internet communication is providing a
communication link between two processes running on two different systems. 4or example, data sent
by the 4"2 *4ile "ransfer 2rotocol. client process from system should reach the 4"2 server process
at the system #. It should not reach the +I$ server process running on the system #. So it is not
only crucial to identify the end systems to which the data meant, but also the end processes are also to
be identified. "o achieve this, different processes are labeled uni6uely. In "123I2, this labeling is
called as port address. port address is %= bits long *9 byte..
2. (xplain the different classes of I2 addresses. Write briefly about, given an I2 address how to find
its class.
Ans.
"he Inter)I1 *"he Internet7s )etwork Information 1enter. allocates the I2 addresses. "he bits that
correspond to the network I- are set to %. "he bits that correspond to the host I- are set to D. "hese I2
addresses are divided into 1lass , 1lass #, 1lass 1, 1lass -, and 1lass (. (nd users do not use the
1lass - and 1lass ( I2 addresses.
+)ass A ,P aress8 Iou can have 1lass I2 addresses in your network if you have large number of
hosts. "he high!order bit is always set to binary D. "he next seven bits complete the network I-. "he
last three octets represent the host I-. "he default subnet mask used in the 1lass I2 address is
9<<.D.D.D. In addition, they have the first octet from D!%9>. "he number of networks possible in class
I2 addresses is %9'. "he number of hosts possible per network is %=,>>>,9%=. 4or example,
%%.<9.:=.' is a 1lass I2 address.
+)ass - ,P aress8 Iou can have 1lass # I2 addresses if your organi/ation has medium!si/ed
networks. "he two high!order bits are always set to binary % D. "he next %; bits complete the network
I-. "he last two octets represent the host I-. "he default subnet mask used in the 1lass # I2 address
is 9<<.9<<.D.D. In addition, they have the first octet from %9'!%&%. "he number of networks possible
in class # I2 addresses is %=,:';. "he number of hosts possible per network is =<,<:=. 4or example,
%>9.<9.:=.' is a 1lass # I2 address.
+)ass + ,P aress8 1lass 1 I2 addresses are used in small local area networks. "he three high!order
bits are always set to binary % % D. "he next 9% bits complete the network I-. "he last octet represents
the host I-. "he default subnet mask used in the 1lass 1 I2 address is 9<<.9<<.9<<.D. In addition,
they have the first octet from %&9!99:. "he number of networks possible in class I2 addresses is
9,D&>,%<9. "he number of hosts possible per network is 9<=. 4or example, %&9.<9.<=.' is a 1lass 1 I2
address.
+)ass * ,P aress8 1lass - I2 addresses are reserved for I2 multicast addresses. "he four high!
order bits are always set to binary % % % D. "he remaining bits represent the specific group in which
the client participates. +icrosoft supports class - I2 addresses for multicast applications to multicast
data to hosts on an internetwork. "hese hosts are designed to receive multicast data.
+)ass . ,P aress8 "he class ( I2 addresses are for experimental purposes. "hey are not in use. "he
four high!order bits are always set to binary % % % %.
"here are two ways of determining the class of an address depending on the format it is represented.
If the address is given in the form of binary then depending upon the first few bits one can identify the
class.
If the first bit is D then it is 1lass
If the first 9 bits are %D E 1lass #
If the first : bits are %%D E 1lass 1
If the first ; bits are %%%D E 1lass -
If the first ; bits are %%%% E 1lass (
@owever mostly the addresses are given in the decimal notation, which re6uires following method for
determining the class.
+)ass A8 first number is between D and %9>
+)ass -8 first number is between %9' and %&%
+)ass +8 first number is between %&9 and 99:
+)ass *8 first number is between 99; and 9:&
+)ass .8 first number is between 9;D and 9<<
3. Write briefly about nicast, mlticast and $roadcast addresses
Ans.
data packet can be sent to one system, more than one system, or to all the systems in the network.
"he Internet addressing mechanism has provision for all of these.
2nicast Aresses8 5nicast communication is one!to!one. When a data packet is sent from a source
system to an individual destination system, a unicast communication takes place. ll system on the
Internet should have one uni6ue unicast address. 5nicast addresses belong to class , # or 1.
3")ticast Aresses8 +ulticast communication is one!to!many. When a data packet is sent from an
individual source to group of destinations, a multicast communication takes place. multicast
address is a 1lass - address. "he whole address defines a multicast group id. system on the Internet
can have one or more multicast addresses *in addition to its unicast address or addresses.. If a system
intends to participate in a particular multicast group then it should enable corresponding multicast
address in its software. )ote that the multicast addresses *or 1lass -. can never be a source I2
addressC it can only be a destination address in an I2 datagram packet. Some of the multicast
addresses are listed below8
224.0.0.18 ll systems on this S5#)("
224.0.0.78 S" routers.
224.0.1.78 udio news
224.0.1.118 I("4!%!udio
224.0.1.128 I("4!% Hideo
-r$acast Aresses8 #roadcast communication is one!to!all. "he Internet allows broadcasting only
at the local network level. "here are two types of broadcasting allowed.
Limite (r$acast8 all %s in the I2 address. #oth netid and hostid in this case are all %*in decimal
notation 9<<.9<<.9<<.9<<.. "his identifies all the hosts connected to the local network. n I2
datagram packet with destination address as 9<<.9<<.9<<.9<< should be received by all the systems
connected to the local network.
*irect (r$acast8 "his identifies all the hosts connected to a particular network *need not be local
network as in the case of $imited broadcast.. @ere the netid part will identify the destination network
*any valid netid. and hostid part will have all %s. (xample address is =:.9<<.9<<.9<<. *=: identifies
the 1lass network and rest implies all hosts on that network..
4. Write a brief note about direct and indirect roting%
Ans.
*irect 4$"ting8 If the destination host is attached to the same physical network as the source host, I2
datagrams can be directly exchanged. "his is called direct delivery and is referred to as direct routing.
-irect routing occurs when both source and destination hosts are connected to the same physical
network.
,nirect 4$"ting8 Indirect routing occurs when the destination host is not connected to a network
directly attached to the source host. "he only way to reach the destination is via one or more I2 router.
"he address of the first router *the first hop. is called an indirect route in the I2 routing algorithm. "he
address of the first router is the only information needed by the source host to send a packet to the
destination host.
5. What are the types of routing tables? (xplain briefly.
Ans.
"he determination of routes is derived from the table known as routing table. "he types of routing
tables are as follows8
Static routing table
-ynamic routing table
Static 4$"ting Ta()e8 Routing tables can be a static one in which case the entries remain same unless
someone changes it manually. If there is any change in the Internet topology, like some of the links
going down temporarily, the entries will not be updated automatically resulting in the routing table
which does not reflect the changed topology. @owever this simple mechanism is sufficient for many
of the routers which interconnect small networks where changes in the topology is very unlikely or
even if that happens the inconvenience caused is not much before the administrator updates the
routing table manually.
*ynamic 4$"ting Ta()e8 dynamic routing table is updated periodically automatically. It does not
need the manual intervention from the administrator for the updating process. @owever for this the
routers must have implemented one of the dynamic routing protocols such as RI2, ,S24 or #F2.
#asically the routers participating in dynamic routing communicate with each other using one of the
above!mentioned protocols informing about the status of the Internet by exchanging respective
protocol packets. "hrough these communication whenever there is a change in the Internet topology,
such as shutdown of a router or a link becoming inactive or even a link becoming active, the router
which comes to know about such a change informs the rest of the router about the change using
routing protocol, so that the remaining routers updates their routing tables appropriately. change in
the Internet may not result in the change in routing table at all the routers. It may affect only some of
the routers. "he routers in the Internet need to be updated dynamically for efficient delivery of the I2
packets.
6.Write the I2 header datagram. (xplain the fields Service "ype, 2rotocol, 1hecksum, Source I2
address and -estination I2 address.
Ans.
"he unit of transfer in an I2 network is called an I2 datagram header. datagram is a variable length
packet consisting of two parts, header and data. "he maximum length of an I2 datagram is =<,<:<
bytes *octets.. "he header can be from 9D to =D bytes long and contains information essential for
routing and delivery. "he length of the data part varies from packet to packet but the total length of
the I2 datagram should be within =<,<:< bytes.
"he following are some of the fields of the header8
Ser'ice Ty%e8 "he service type is an indication of the 6uality of service re6uested for this I2
datagram.
Pr$t$c$) +!ec5s"m8 "his field is a checksum for the information contained in the header. If the
header checksum does not match the contents, it implies that the datagram is corrupted and is
discarded.
S$"rce ,P Aress8 "his is the :9!bit I2 address of the host, sending this datagram.
*estinati$n ,P Aress8 "his is the :9!bit I2 address of the destination host, for this datagram.
7. Why fragmentation is re6uired? (xplain how the I2 header fields are used for the same purpose.
Ans.
When an I2 datagram travels from one host to another, it may pass through different physical
networks. (ach physical network has a maximum frame si/e. "his is called the ma&imm
transmission nit *+"5.. It limits the length of a datagram that can be placed in one physical frame.
"he format and si/e of the received frame depends on the protocol used by the underlying physical
network through which the frame passes through. Since each protocol used at the physical layer has
its own +"5, there is every possibility that the incoming frame exceeds the +"5 of the outgoing
physical network. "o enable forwarding the datagram in such cases, I2 implements a process to
fragment datagrams exceeding the +"5. "he process creates a set of datagrams within the maximum
si/e. "he receiving host reassembles the original datagram.
"he source or any router in the path can fragment a datagram. @owever, only the destination host does
the reassembly of the datagram, as each fragment becomes an independent datagram. When a
datagram is fragmented, re6uired parts of the header must be copied by all the fragments. "he host or
the router that fragments the datagram must change the values of three fields8 flags, fragmentation
offset, total length% "he checksm field for each of the fragments has to be recomputed and duly filled.
"he following steps are performed to fragment the datagram8
"he -4 flag bit in the flag field is checked to see if fragmentation is allowed. If the bit is set which
indicates not to fragment, the datagram will be discarded as it cannot be forwarded and an I1+2 error
returned to the originator.
#ased on the +"5 value, the data field of the datagram is split into two or more parts. ll newly
created data portions must have a length that is a multiple of ' octets, with the exception of the last
data portion.
(ach data portion is placed in an I2 datagram. "he headers of these datagrams are minor
modifications of the original8
"he more fragments flag bit is set in all fragments except the last.
"he fragment offset field in each is set to the location this data portion occupied in the original
datagram, relative to the beginning of the original unfragmented datagram. "he offset is measured in
'!octet units.
"he header length field of the new datagram is set.
"he total length field of the new datagram is set.
"he header checksum field is re!calculated.
(ach of these fragmented datagrams is now forwarded as a normal I2 datagram. I2 handles each
fragment independently. "he fragments can traverse different routers to the intended destination. "hey
can be sub?ect to further fragmentation if they pass through networks specifying a smaller +"5.
8. Five an overview of R2 mechanism using diagrams.
Ans.
"he R2 protocol is a network!specific standard protocol. "he address resolution protocol is
responsible for converting the higher!level I2 addresses to physical network addresses.
I2 layer provides a virtal or logical network view to the higher layer protocols where in each host is
identified by the uni6ue address known as I2 address. @owever, when the datagram are sent on the
physical network, this I2 address cannot identify the destination system. t the physical or data link
layer, it is the #h"sical address, which identifies the host system. "herefore, there is a need to do
address translation from I2 address to physical address. "he R2 mechanism, which resides at the
network la"er in the "123I2 protocol, performs this address translation.
4or this purpose, the R2 module will have a lookup table called A'P cache. "his table will have
entries for all the known I2 addresses. 4or each I2 address present in the cache, corresponding
#h"sical address is stored against it. "herefore, when R2 module is re6uested to perform an address
translation, it first looks into this cache. If it finds an entry for the I2 address, it gets the corresponding
#h"sical address and returns it.
@owever, many times there will be no entry in the cache for re6uested I2 address. In such cases R2
module broadcasts a message over the network re6uesting for the address translation and after getting
the proper reply stores the physical address of the I2 address re6uested in the cache table and passes
the same to the upper layers that re6uested it.
(very host or the router on the network receives and processes the R2 6uery packet, but only the
intended recipient recogni/es the I2 address and sends back the an A'P res#onse packet. "he
response packet contains the recipientJs I2 and physical addresses. "he packet is unicast directly to
the in6uirer using the physical address received in the 6uery packet.
9. Write a brief note about RR2.
Ans.
In some local area networks, there would be a powerful computer, which acts as a server. "here
would be several hosts, which will not have any disks *hard disk 3 floppy disk. that will be connected
to the host. 2eople would use these hosts as the front!end system and would be connected to the
server over the network. 4inally, they would be working on the server but using these hosts as the
front!end systems. @aving disk!less hosts has an advantage in some setups, where there would be a
central powerful server computer on which many people can work simultaneously by connecting
through such hosts. s these hosts are disk!less system, they would not need any configuration by the
administrator. +aintenance would be minimal. "hese disk!less systems would be booted from the
R,+ *Read ,nly +emory chip., which is programmed by the manufacturer. It cannot include the I2
address as the network administrator assigns them.
(ach time these disk!less hosts are switched on, they will not be aware of their I2 address, as they do
not have any disk or storage device. @owever, they will be aware of their hardware address as
encoded into the )etwork Interface 1ard, from which they can get it.
Since in a network each system is recogni/ed by the logical or more commonly, I2 address, it is vital
for the system to be aware of its I2 address. ny I2 datagram to be sent should have the senders I2
address duly filled in. ,therwise, the recipient of that packet would not know from whom the packet
arriver and it would ?ust discard.
"o find out ones I2 address these disk!less host systems, uses a protocol known as Reverse ddress
Resolution 2rotocol. "his is a protocol, which does the function opposite of that of R2 i.e. given the
physical address gets the I2 address.
t boot up time, these disk!less hosts would broadcast a RR2 re6uest packet over the network after
filling its physical address in it. "he server which will have a reference table of physical address and
their corresponding I2 address would respond with the RR2 response packet. "his reference table
has entries for each of the physical address *present in the local network. and their I2 address would
be created and maintained by the administrator.
10. What are the error reporting messages present in the I1+2? (xplain any two of them.
Ans.
I2 provides an unreliable and connectionless datagram delivery. I2 protocol does not have any error!
reporting or error!correcting mechanism. "herefore, if something goes wrong, the router does not find
route for the I2 packet and so discards it. "he sender will be never aware of it, and he would keep
resending the same. "he I1+2 was designed to compensate these deficiencies of I2. It is a companion
to the I2 protocol and is part of the network layer along with the I2.
I1+2 messages are divided into two broad categories, error(re#orting messages and )er" messages%
"he error reporting messages report the problems that a router or a host may encounter when it
processes an I2 packet. "hey would report the problem back to the I2 module at the sending system.
"he 6uery messages, which occur in pairs, help a host or a network manager get specific information
from a router or another host. 4or example, this can be used by the hosts to discover the routers
present in their network. "he host would send an I1+2 6uery asking for routers to respond. "he
routers present in the network will respond with an I1+2 reply message. "he host would get enough
information about the router from this reply.
5nder error!reporting type, the following messages are present8
-estination unreachable
Source 6uench
"ime exceeded
2arameter problem
Redirection
"he 6uery messages type has following messages8
(cho re6uest and reply
"imestamp re6uest and reply
ddress mask re6uest and reply
Router solicitation and advertisement
FAQ
1. What is the functionality of a network layer?
Ans:
"he network layer is responsible for transferring the data from the source to the destination host
across several physical networks. key aspect of this transfer is the roting of #ackets fast,
efficiently, and reliably from the source to the destination machine typically traversing a number of
transmission links and network nodes where routing is carried out.
"he network layer also provides the virtual network concept to the upper layers. s far as the upper
layers are concerned, there is only one network, and each host is recogni/ed by a uni6ue I2 address.
2. Identify the protocols used in the network layer.
Ans:
"he following protocols are used in the network layer8
,P8 Internet 2rotocol
A4P8 ddress Resolution 2rotocol
4A4P8 Reverse ddress Resolution 2rotocol
,+3P8 Internet 1ontrol +essage 2rotocol
3. -efine routing.
Ans:
Routing is the process by which a path is selected out of many available paths to the destination host
so that data packet reaches the destination fast, efficiently, reliably as re6uired. It uses the destination
I2 address that is stored in the I2 datagram packet to reach the correct destination.
4. -efine R2.
Ans:
R2 *ddress Resolution 2rotocol. is a network!specific standard protocol. R2 is responsible for
converting the higher!level protocol addresses *I2 addresses. to physical network addresses.
5. -efine RR2.
Ans:
RR2 *Reverse ddress Resolution 2rotocol. is responsible for converting the physical network
addresses of disk!less host systems to I2 addresses.
6. (xplain the working of I1+2.
Ans:
I1+2 *Internet 1ontrol +essage 2rotocol. is a network layer protocol and it provides error!reporting
or error!correcting mechanism. In addition, I1+2 provides 6uery messages, which occur in pairs and
it helps a host or a network manager get specific information from a router or another host. "herefore,
I1+2 is designed to compensate the unreliable and connectionless deficiencies of I2.
Chapter Five Questions
Part 1
1. 5-2 is an acronym for 000000000000000000000
Ans.
5ser -atagram 2rotocol
2. In the sending system, 5-2 receives data unit from the 00000000000000 layer.
Ans.
)etwork
3. 5-2 needs the 000000000 address to deliver the data to the correct process.
Ans.
2ort
4. 5-2 offers 000000 to 000000 data communication.
Ans.
2rocess!to!process
5. 5-2 has the fixed header si/e of 000 bytes.
Ans.
(ight
6. In "12 a unit of data is referred to as 00000000.
Ans.
-atagram
7. 4low control is achieved through the use of 0000000000000 window mechanism.
Ans.
Sliding
8. 000000000 field in the "12 header is used to detect errors in the "12 segment.
Ans.
1hecksum
9. In "12, before sending data, a 0000000000 is established between the sending and receiving
processes.
Ans.
Hirtual path
10. "12 offers 00000000 duplex data transfer service.
Ans.
4ull
Part 2
1. Write a short note on, services offered by the 5-2 and what kind of applications 5-2 service is
used.
Ans.
5-2 is a connectionless, unreliable transport protocol. 5-2 provides process!to!process
communication. In addition, it performs very limited error checking. 5-2 is very efficient because of
its simplicity. (stablishing a connection with the destination process is fast, and if reliability is not an
important criterion then the transfer of data is faster for bulk transfer.
"he services offered by 5-2 are as follows8
+$nnecti$n)ess Ser'ices8 5-2 provides a connectionless service. "his means that each user
datagram sent by the 5-2 is an independent datagram. "here is no relationship between the different
user datagrams even if they are coming from the same source process and going to the same
destination program. "he user datagrams are not numbered. lso, there is no connection
establishment and no connection termination at the beginning and end of a transaction. "his means
that each user datagram can travel a different path.
,ne of the ramifications of being connectionless is that the process that uses
5-2 cannot send a stream of data to 5-2 and expect to receive the same
stream of data at the destination. Instead each re6uest must be small enough
to fit into one user datagram. ,nly those processes sending short messages
should use 5-2. ,therwise if needed, the end application should take care of
section of data arriving out of order and reordering them to get the original
stream.
6)$7 an .rr$r +$ntr$)8 5-2 is a very simple, unreliable transport protocol. "here is no flow
control, and hence no windowing mechanism. "he receiver may overflow with incoming messages.
gain it is left for the end application to take of it. "he end applications which uses 5-2 either
generates less data or they have inbuilt mechanism to take care of flow control.
"here is no error control mechanism in 5-2 except for the checksum. "his
means that the sender does not know if a message has been lost or duplicated.
When the receiver detects an error using the checksum, the user datagram is
silently discarded.
.nca%s")ati$n a *eca%s")ati$n8 "o send a message from one process to another, the 5-2 protocol
encapsulates and decapsulates the messages.
3")ti%)exing an *em")ti%)exing8 In a host running a "123I2 protocol, there is only one 5-2 but
possibly several processes that may want to use the services of 5-2. "o handle this situation, 5-2
uses the concept called +ultiplexing and -emultiplexing.
"he applications at the "ransport layer use the services of 5-2. "here are several multimedia
applications with powerful desktop computer and high bandwidth communication network that uses
5-2. "he multimedia applications, which re6uire bulk transfer of data, needs no fool!proof
reliability. "he reliability provided by the underlying networks is sufficient. $oss of data to some
extent is tolerable, and in fact in some cases there are techni6ues available to recover the lost data
with the source re6uiring sending it again.
"odayJs multimedia applications, such as HoI2 *Hoice over I2. and Hideo conferencing applications
use a protocol known as R"2 *Real "ime 2rotocol. for data transfer at the application layer. "his R"2
protocol uses the services of 5-2.
2. (xplain how port number concept is used to offer process!process data communication in 5-2.
Ans.
In "123I2 model, each process re6uiring the "123I2 communication service is assigned a %=!bit *9
byte. number called port number. "he "123I2 standard has defined uni6ue port numbers for some of
the well!known network application process. "his helps to uni6uely identify a network application
process running on a host machine.
1omputer systems today support both multi!user and multiprogramming environments. $ocal and
remote computers can run several server programs at the same time. 4or communication, the
following hosts and processes must be defined8
$ocal host
$ocal process
Remote host
Remote process
"he local host and the remote host are identified using I2 addresses. "o define the processes, we need
second identifiers, which are called port numbers. In the "123I2 protocol suite, the port numbers are
integers between D and =<,<:<.
"he client program is assigned a port number, chosen randomly by the 5-2 software running on the
client host. "his is the ephemeral port number.
"he server process must also be assigned a port number. "his port number, however, cannot be
chosen randomly. If the computer at the server site runs a server process and assigns a random
number as the port number, the process at the client site that wants to access that server and use its
services will not know the port number. "herefore, "123I2 has decided to use universal port numbers
for serversC these are called well!known port numbers. (very client process knows the well!known
port number of the corresponding server process.
"he destination I2 address defines the host among the different hosts in the Internet. fter the host has
been selected, the port number selects one of the intended processes on this particular host.
3. Write the 5-2 datagram header. (xplain each field.
Ans.
5-2 packets, known as user datagrams, have a fixed!si/e header of eight bytes.
"he fields of 5-2 packets are explained below8
S$"rce %$rt n"m(er8 "his is the port number of the source process sending the 5-2 datagram. It is
%= bits long *9 byte.. If the source process is a client *a client sending a re6uest., the port number, in
most cases, is an ephemeral port number. If the source process is a server *a server sending a
response., the port number, in most cases, is a well!known port number.
*estinati$n %$rt n"m(er8 "his is the port number of the destination process to which this 5-2
datagram is meant. It is also %= bits long. Its characteristics are similar to the Source 2ort )umber.
Lengt!8 "his is a %=!bit field that defines the total length of the 5-2 datagram, header plus data. "he
%= bits can define a total length of D to =<,<:< bytes. @owever, the minimum length is eight bytes,
which indicates a user datagram with only header and no data. @owever it should be noted that I2 has
a limitation of =<,<:< bytes for its datagram. "herefore, the length of the data can be between D and
=<,<D> *=<,<:< E 9D E '. bytes *twenty bytes for I2 header and ' bytes for 5-2 header..
"he 5-2 length can be computed using data length in the I2 header.
@owever, the designers of 5-2 protocol felt that it was more efficient for the
destination 5-2 to calculate the length of the data from the information
provided in the 5-2 datagram rather than asking to supply this information.
We should remember that when the I2 module delivers the 5-2 user
datagram to the 5-2 layer, it has already dropped the I2 header.
+!ec5s"m8 "his field is used to detect errors over the entire user datagram *header plus data.. 5nlike
lower layer protocols like I2, which provide checksum only for their header, this provides the
checksum for entire datagram, which includes the data sent by the user process.
4. -escribe how checksum is calculated for the 5-2 datagram.
Ans.
5-2 checksum calculation includes three sections8
2seudo header8 "he pseudo header is part of the header of the I2 packet in which the user datagram is
to be encapsulated for transmission with some fields with Ds.
5-2 header8 @eader for this 5-2 datagram.
5ser -ata8 -ata sent by the upper layer.
"he pseudoheader is added to ensure that the user datagram reaches the intended process, which uses
the intended transport protocol on the intended host. Since in no other layer, it is possible to check all
these three, a pseudoheader derived from the I2 header that has destination and source I2 address and
protocol numbers is used. "he pseudoheader along with the 5-2 header uni6uely identifies the
destination process.
+!ec5s"m +a)c")ati$n at t!e S$"rce8 t the source host system, the sender follows these steps to
calculate the checksum8
%. dd the pseudoheader to the 5-2 user datagram.
If the total number of bytes is not even, add one byte of padding *all Ds.. "he padding is only for the
purpose of calculating the checksum and will be discarded afterwards.
4ill the checksum field with /eros.
-ivide the total bits into %=!bit *two!byte. words sections.
dd all %=!bit sections using oneJs complement arithmetic.
"ake ones complement of the result *change Ds to %s and all original %s to Ds., which is a %=!bit
checksum number.
,nce %= bits checksum field is computed using the above method, it is filled into the original 5-2
header and the resulting 5-2 datagram is sent. It should be noted that the pseudoheader and the
padding bits are not sent but only used during the computation of checksum.
+!ec5s"m +a)c")ati$n at *estinati$n 8$st8 "he receiver follows these steps to calculate the
checksum8
%. ,btain the I2 header, derive the pseudoheader from it, and add it to the 5-2
user datagram.
dd padding if needed.
-ivide the total bits into %=!bit sections.
dd all %=!bit sections using oneJs complement arithmetic.
"ake onesJ complement the result to get the checksum.
5-2 datagram is accepted if the resulting checksum is all Ds. ,therwise it is discarded, as it indicates
an error in it.
5. (xplain the (ncapsulation and -ecapsulation mechanism used in 5-2.
Ans.
.nca%s")ati$n8 When a process has a message to send through 5-2, it passes the message to 5-2
along with a pair of socket addresses and the length of data. 5-2 receives the data and adds the 5-2
header. 5-2 then passes the user datagram to the I2 with the socket addresses. I2 adds its own
header, using the value %> in the protocol field, indicating that the data has come from the 5-2
protocol. "he I2 datagram is then passed to the data link layer. "he data link layer receives the I2
datagram, adds its own header *and possibly a trailer., and passes it to the physical layer. "he
physical layer encodes the bits into electrical or optical signals and sends it to the remote machine.
*eca%s")ati$n8 When the message arrives at the destination host, the physical layer decodes the
signals into bits and passes it to the link layer. "he data link uses the header *and the trailer. to check
the data. If there is no error, the header and trailer are dropped and the datagram is passed to the I2.
"he I2 software does its own checking. If there is no error, the header is dropped and the user
datagram is passed to the 5-2 with the sender and receiver I2 addresses. 5-2 uses the checksum to
check the entire user datagram. If there is no error, the header is dropped and the application data
along with the sender socket address is passed t the process. "he sender socket address is passed to
the process in case it needs to respond to the message received.
6. Write a short note on importance of "12.
Ans.
"he protocol, which is responsible for widespread usage of "123I2 model for computer!to!computer
communication network is the "12. It is the combination of "12 at the "ransport layer and I2 at the
)etwork layer, which is largely responsible for success of this model.
"he network application program, which needs to communicate over the network, expects a very
simple, easy to implement communication channel. If a user wants to write an application program,
which communicates with another over the network, he should not be expected to build logic into his
program to take care of so many issues that are involved in the communication. @e should not worry
about things such as, some part of the message getting corrupted or lost. "here are other issues which
should not be handled by him, like rearranging the datagrams which arriver out of order, issues of
congestion and resulting delay, issues of flow control by which the rate at which the source sends the
data can be controlled.
"12 ensures easy to use communication channel, which provides the reliable, stream oriented
communication service, which takes are of such error and flow control mechanisms.
I2 provides an unreliable, best!effort, datagram service and 5-2 adds ?ust the process!to!process
communication facility apart from error checking mechanism to some extent. "herefore, there is a
need for another protocol, which sits on top of the I2 and provides the services as mentioned above to
the end application. So the designer of "123I2 model came out with "12 at the "ransport layer.
"12 provides process!to!process communication channel, which is reliable and stream oriented in
nature. In addition, it takes care of the error!control and flow control.
"he process!to!process mechanism is very similar to the one used by 5-2. 2ort numbers are used to
identify an individual process. ssociation of I2 address and port number is known as the socket.
socket identifies each communicating process and a pair of socket determines the communication
channel. port number can be shared by both 5-2 as well as "12. I.e. there can be a port number,
which is assigned to two processes at the same host, but which uses different protocols, one process
uses 5-2 and another "12. 2ort number does not identify the protocol. "he protocol field in the I2
header makes that distinction.
7. (xplain the stream!oriented data transfer offered by the "12.
Ans.
"12 provides stream data transfer service, which means the destination process receives the
stream of data in exactly the same manner it is sent by the source process. 5nlike in datagram service,
there is no concept of unit of data transfer. In datagram service, all the data have to be sent as a single
unit. "his imposes two restrictions. ,ne restriction is that all the data should be available at the time
of sending. ,therwise, they will be sent in another datagram. (ach datagram unit is a separate entity
and there is no relation between them. nother restriction is on the si/e of the data transfer.
Source "12 accepts a stream of characters from the sending application program as and when they
arrive, creates packets, called segments, of appropriate si/e extracted from the stream, and sends them
across the network. "he receiving "12 receives segments, extracts data from them, orders them if
they have arrived out of order, and delivers them as a stream of characters to the receiving application
program.
4or stream delivery, the sending and receiving "12s use buffers. "he sending "12 uses a sending
buffer to store the data coming from the sending application program. "he sending application
program delivers data at the rate it is created. 4or example, if the user is typing the data on a
keyboard, the data is delivered to the sending "12 character by character. If the data is coming from a
file, data may be delivered to the sending "12 line!by!line, or block!by!block. "he sending
application program writes data to the buffer of the sending "12. @owever, the sending "12 does
not create a segment of data for each write operation issued from the sending application program.
"12 may choose to combine the result of several write operations into one segment to make
transmission more efficient.
"he receiving "12 receives the segments and stores them in a receiving buffer. "he receiving
application program uses the read operation to read the data from the receiving buffer, but it does not
have to read all of the data contained in one segment in one operation. Since the rate of reading can
be slower than the rate of receiving, the data is kept in the buffer until the receiving application reads
if completely.
8. Write a diagram of "12 header. (xplain the fields, Se6uence number, cknowledgement number,
Window si/e and 5rgent pointer.
Ans.
In "12, a unit of data transfer is known as "12 segment. Since "12 provides the stream!oriented
data service, it uses the concept of segment for a unit of transfer.
"he segment consists of a 9D!to =D!byte header, followed by data from the application program. "he
header is 9D bytes if there are no options and up to =D bytes if it contains some options. Some of the
header fields are as follows8
S$"rce %$rt aress8 "his is a %=!bit *9 bytes. field that defines the port number of the application
program in the host that is sending the segment.
*estinati$n %$rt aress8 "his is a %=!bit *9 bytes. field that defines the port number of the
application program in the host that is receiving the segment.
Se9"ence n"m(er8 "his :9!bit *; bytes. field defines the number assigned to the first byte of data
contained in this segment. "12 is a stream transport protocol. "o ensure connectivity, each byte to
be transmitted is numbered. "he se6uence number informs the destination the position of the first
byte of this segment in the original stream of data at the source.
Ac5n$7)egement n"m(er8 "his :9!bit *; bytes. field defines the byte number that the source of the
segment is expecting to receive from the other end process. If host has received successfully till byte
number n from the other host, then it defines n K % as the acknowledgement number, which indicates
it is expecting data starting from location nK% at the other hostsJ stream.
8eaer )engt!8 "his four!bit field indicates the length of the "12 header. It is e6ual to number of
four!byte words in the "12 header. "he length of the header can be between 9D and =D bytes.
"herefore, the value of this field can be between < *< x ; L 9D. and %< *%< x ; L =D..
4eser'e8 "his is a six!bit field reserved for future use.
+$ntr$)8 "his field defines six different control bits or flags as shown in figure. ,ne or more of these
bits can be set at a time. "hese bits enable flow control, connection establishment and termination,
and the mode of data transfer in "12. brief description of each bit is given below8
24:8 "he value of urgent pointer is valid.
A+;8 "he value of acknowledgement field is valid.
PS88 Re6uest to push the data
4ST8 Re6uest to reset the connection.
S<=8 Re6uest to synchroni/e the se6uence number during connection
6,=8 Re6uest to terminate the connection.
>in$7 si&e8 "his field defines the si/e of the window, in bytes, that the other end must maintain.
"he length of this field is %= bits, which means that the maximum si/e of the window is =<,<:< bytes.
+!ec5s"m8 "his %=!bit *9 bytes. field contains the checksum, used for error checking purpose.
2rgent %$inter8 "his %=!bit field, which is valid only if the urgent flag is set, is used when the
segment contains urgent data. It defines the number that must be added to the se6uence number to
obtain the number of the last urgent byte in the data section of the segment.
?%ti$ns8 "here can be up to ;D bytes of optional information in the "12 header.
9. -escribe briefly how error!control mechanism is achieved in "12 when data is corrupted, and
when acknowledgement is lost.
Ans.
"12 is a reliable transport layer protocol. "his means that an application program that delivers a
stream of data to "12 relies on "12 to deliver the entire stream to the application program on the
other end in order, without error, and without any part lost or duplicated. "12 provides reliability
using error control. (rror control includes mechanisms for detecting corrupted segments, lost
segments, out!of!order segments, and duplicated segments. (rror control also includes a mechanism
for correcting errors after they are detected.
.rr$r *etecti$n an c$rrecti$n8 (rror detection in "12 is achieved through the use of three simple
tools8 checksum, acknowledgement, and time!out. "ime!out is the duration for which the sending
"12 waits for the acknowledgement, after which it considers whether the data sent is either corrupted
or lost and retransmits the same.
(ach segment includes the checksum field, which is used to check for a corrupted segment. #y
computing checksum, one can find whether the segment is corrupted or not. If it is corrupted, it is
discarded by the destination "12. "12 uses the acknowledgement method to confirm the receipt of
those segments that have reached the destination "12 uncorrupted. If a segment is not acknowledged
before the time!out, it is considered to be either corrupted or lost.
"he error!correction mechanism used by "12 is also very simple. "he source "12 starts one time!out
counter for each segment sent. (ach counter is checked periodically. When a counter expires, the
corresponding segment is considered to be either corrupted or lost, and the segment will be
retransmitted.
1onsider an example where data becomes corrupted while it is sent from one host to another. In this
example the source host sends segments % through :, each 9DD bytes. "he se6uence number begins at
%,9D% on segment %. "he receiving "12 receives segments % and 9, using the checksum, finds them
error free. It acknowledges the receipt of segments % and 9 using acknowledgement number %,=D%,
which means that it has received bytes %,9D% to %,=DD safe and sound, and is expecting to receive byte
%,=D%. @owever, it finds that segment : to be corrupted and discards segment :. )ote that although it
has received bytes %,=D% to %,'DD in segment :, the destination does not consider this as a receipt
because this segment was corrupted. fter the time!out for segment : expires, the source "12 will
resend segment :. fter receiving segment :, the destination sends the acknowledgement for byte
%,'D%, which indicates that it has received bytes %,9D% to %,'DD error free.
1onsider an example where acknowledgement is lost while data is sent from one host to another. In
the "12 acknowledgement mechanism, a lost acknowledgement may not even be noticed by the
source "12. "12 uses an accumulative acknowledgement system. (ach acknowledgement is a
confirmation that everything up to the byte specified by the acknowledgement number has been
received. 4or example, if the destination sends an 1M segment with an acknowledgement number
for byte %,'D%, it is confirming that bytes %,9D% to %,'DD have been received. If the destination had
previously sent an acknowledgement for byte %,=D%, meaning it has received bytes %,9D9 to %,=DD,
loss of the acknowledgement is totally irrelevant.
10. (xplain why one needs the service of 5rgent -ata operation of "12.
Ans.
"12 is a stream!oriented protocol. "his means that the data is presented from the application program
to the "12 as a stream of characters. (ach byte of data has a position in the stream. @owever, there
are occasions in which an application program needs to send urgent bytes. "his means that the
sending application program wants a piece of data to be read out of order by the receiving application
program. Suppose that the sending application program is sending data to be processed by the
receiving application program. When the result of processing comes back, the sending application
program finds that everything is wrong. It wants to abort the process, but it has already sent a huge
amount of data. If it issues an abort command *1ontrol K 1., these two characters will be stored at the
end of the receiving "12 buffer. It will be delivered to the receiving application program after all the
data has been processed.
"he solution is to send a segment with the 5RF bit set. "he sending application program tells the
sending "12 that the piece of data is urgent. "he sending "12 creates a segment and inserts the
urgent data at the beginning of the segment. "he rest of the segment can contain normal data from the
buffer. "he urgent pointer field in the header defines the end of the urgent data and the start of normal
data.
When the receiving "12 receives a segment with the 5RF bit set, it extracts the urgent data from the
segment, using the value of the urgent pointer, and delivers it, out of order, to the receiving
application program.
11. (xplain the concept of +ultiplexing and -emultiplexing in "12.
Ans.
"he concept of multiplexing and demultiplexing operation is as follows8
3")ti%)exing8 t the source host, there may be several processes that need to send user datagrams.
@owever, there is only one "12. "his is a many!to!one relationship and re6uires multiplexing. "12
accepts messages from different processesC each message will have a port number assigned to it,
which identifies the process, which generated the message. fter adding the header, "12 passes the
user datagram to I2.
*em")ti%)exing8 t the receiver site, there is only one "12. @owever, we may have many processes
that can receive user datagrams. "his is a one!to!many relationship and re6uires demultiplexing.
"12 receives user datagrams from I2. fter error checking and dropping of the header, "12 delivers
each message to the appropriate process based on the port numbers.
12. (xplain the need of 2ushing -ata operation in "12.
Ans.
In certain situations, the sending "12 uses a buffer to store the stream of data coming from the
sending application program. "he sending "12 has the choice to create segments of any si/e from the
stream. "he receiving "12 also buffers the data when they arrive and delivers them to the application
program when the application program is ready or when the receiving "12 feels that it is convenient.
"his type of flexibility increases the efficiency of "12.
@owever, there are occasions in which the application program is not comfortable with this flexibility.
4or example, consider an application program that communicates interactively with another
application program on the other end. "he application program on one site wants to send a keystroke
to the application at the other site and receive an immediate response. -elayed transmission and
delayed delivery of data may not be acceptable by the application program.
"12 can handle such a situation. "he application program on the sending site can re6uest a push
operation. "his means that the sending "12 should not wait for the window to be filled. It should
create a segment and send it immediately. "he sending "12 should also set the push bit *2S@. to tell
the receiving "12 that the segment includes data that must be delivered to the receiving application
program as soon as possible and not to wait for more data to come.
lthough the push operation can be dictated by the application program, today most implementations
ignore such re6uests. "12 has the choice to use this operation or not.
13. (xplain how connection is established in "12 using three!way hand shaking.
Ans.
"he connection establishment in "12 is called three!way handshaking. In this procedure, an
application program, called the client, wants to make a connection with another application program,
called the server, using "12 as the transport layer protocol.
"he three!way handshaking procedure starts with the server. "he server program tells its "12 that it is
ready to accept a connection. "his is called a re6uest for a passive open.
"he client program makes a re6uest for an active open. client that wishes to connect to a server tells
its "12 that it needs to be connected to a particular server. "he clients "12 can now start the three!
way handshaking process.
"he steps of the process are as follows8
"he client sends the first segment, with the SI) bit set, which is known as SI) segment. "he
segment includes the source and destination port numbers. "he destination port number clearly
defines the server to which the client wants to be connected. "he segment also contains the client
Initiali/ation Se6uence )umber *IS). used for numbering the bytes of data sent from the client to the
server. If the client needs a large window, it defines the window scale factor here using the
appropriate option. "his segment defines the wish of the client to make a connection with certain
parameters.
"he server sends the second segment, a SI) and 1M segment. "his segment has a dual purpose.
4irst, it acknowledges the receipt of the first segment using the 1M flag and acknowledgement
number field. "he acknowledgement is the client initiali/ation se6uence number plus one. "he server
must also define the client window si/e. Second, the segment is used as the initiali/ation segment for
the server. It contains the initiali/ation segment for the server and initiali/ation se6uence number
used to number the bytes sent from the server. s mentioned before, this is two segments combined
into one.
"he client sends the third segment. "his is ?ust an 1M segment. It acknowledges the receipt of the
second segment using the 1M flag and acknowledgement number field. "he acknowledgement
number is the server initiali/ation se6uence number plus one. "he client must also define the server
window si/e. )ote that data can be sent with the third packet.
14. -escribe briefly how 4low!control is achieved in "12 using sliding window mechanism.
Ans.
"o accomplish flow control, "12 uses a sliding window protocol. With this method, both hosts use a
window for each connection. "he window covers a portion of the buffer that a host can send before
worrying about an acknowledgement from the other host. "he window is called a sliding window
because it slides over the buffer as the receiver sends acknowledgement of the bytes received without
any error. 1onsider a sliding window of si/e %D. #efore receiving any acknowledgement from the
destination, the source can send up to %D bytes. @owever, if it receives acknowledgement of the first
three bytes, it can slide the window three bytes to the right. "his means that now it can send %D more
bytes before worrying about an acknowledgement.
"he previous example shown is a fixed si/e window. @owever flow(control needs the si/e of the
window to vary to achieve the flow control. @ence in "12 window si/e is variable. "he destination,
in each acknowledgement segment, can define the si/e of the window. "he advertised si/e is relative
to the acknowledgement number. 4or example, if the receiver acknowledges the receipt of byte :,DDD
and defines the si/e of the window to be 9DD, it means that the window now expands from byte :DD%
to byte :,9DD.
"he destination can also increase or decrease the si/e of the window in an acknowledgement segment.
FAQ
1. What does process!to!process communication mean?
Ans:
"here may be several processes running on a computer. "hus, source to destination delivery involves
not only the delivery of a message from one computer system to another but also from one process to
another across the two systems. "he "ransport layer does this by including a service!point address on
its header, which ensures the delivery of the message to the right process.
2. What is a socket address?
Ans:
Socket address is a combination of an I2 address and a port number.
3. What is checksum?
Ans:
"he error detection method used by most of the "123I2 protocols is called checksum. "he checksum
protects against the corruption that may occur during the transmission of a packet.
4. @ow does "12 ensure reliable data delivery?
Ans:
"here are a number of aspects that "12 needs to manage for reliable delivery of data between the
computers on a network. "hese are error control, se6uence control, loss control, and duplication
control8
.rr$r c$ntr$)8 "12 implements error control by ensuring that the data sent by the sending machine is
delivered at the destination machine exactly as it originated from the source machine. "he -ata $ink
layer takes care of error control, but only for computer!to!computer delivery. @owever, "12 ensures
source!to!destination reliability while implementing error control. ,ne method of implementing
reliability is through acknowledgements. When a packet is delivered to a destination computer, an
acknowledgement of receipt is returned to the source computer. In this way, the "ransport layer tracks
and validates the transmission of each packet.
Se9"ence c$ntr$)8 "12 is responsible for ensuring the correct se6uence of data both at the senderJs
end and at the receiverJs end. t the senderJs end, the "ransport layer receives data from the upper
layers and ensures that the data is usable by the lower layers. t the receiverJs end, the "ransport
layer ensures that the data is assembled correctly. "12 also makes use of the se6uence numbers. It
assigns a se6uence number to each segment that it transfers. "hese se6uence numbers enable the
message to be reassembled in an ordered manner at the destination. "he se6uence numbers also help
to identify and replace the packets that are lost during transmission.
L$ss c$ntr$)8 "12 also ensures that all the segments of data are delivered to the destination machine.
Some segments of data may be lost during transmission due to the segmentation of data. "12 uses the
se6uence numbers to identify the segments that are missing and re6uests for the redelivery of those
segments.
*"%)icati$n c$ntr$)8 "12 guarantees that none of the segments of data arrive duplicated at the
destination machine. In addition to identifying the missing segments of data, the se6uence numbers
also help to identify and discard the segments that are duplicated.
5. What is buffer?
Ans:
buffer is a data area shared by hardware devices or program processes that operate at different
speeds or with different sets of priorities. "he buffer allows each device or process to operate without
being held up by the other. In order for a buffer to be effective, the si/e of the buffer and the
algorithms for moving data into and out of the buffer need to be considered by the buffer designer.
4or stream delivery, the sending and receiving "12s use buffers. "he sending "12 uses a buffer to
store the data coming from the sending application program. "he receiving "12 receives the
segments and stores them in a receiving buffer. "he receiving application program uses the read
operation to read the data from the receiving buffer, but it does not have to read all of the data
contained in one segment in one operation. Since the rate of reading can be slower than the rate of
receiving, the data is kept in the buffer until the receiving application reads if completely.
6. What is full duplex service?
Ans:
"12 offers fll(d#le& service, where data can flow in both directions at the same time. fter two
application programs are connected to each other, they can both send and receive data. ,ne "12
connection can carry data from application to # and at the same time, from # to . When a packet
is going from to #, it can also carry an acknowledgement of the packets received from #.
$ikewise, when a packet is going from # to , it can also carry an acknowledgement of the packets
received from . "his is called piggybacking because acknowledgements can be sent with data.
7. What is an out!of!order segment?
Ans:
"12 uses the services of I2, an unreliable, connectionless network layer protocol. "he "12 segment
is encapsulated in an I2 datagram. (ach datagram is an independent entity. "he routers are free to
send each datagram through any route they find suitable. ,ne datagram may follow a route with a
short delayC another may follow another route with a longer delay. "herefore, datagrams may arrive
out of order. If datagrams arrive out of order, the "12 segments that are encapsulated in the
datagrams will be out of order as well. "his is called an out!of!order segment.
8. What is the difference between pushing data and urgent data?
Ans:
"he difference between pushing data and urgent data is8
P"s!ing ata8 "he application program on the sending site can re6uest a push operation. "his means
that the sending "12 should not wait for the sliding window to be filled. It should create a segment
and send it immediately. "he sending "12 should also set the push bit *2S@. to inform the receiving
"12 that the segment includes data that must be delivered to the receiving application program as
soon as possible and not to wait for more data to come.
2rgent ata8 1onsider a situation where an application program needs to send urgent bytes. "his
means that the sending application program wants a piece of data to be read out of order by the
receiving application program. Suppose that the sending application program is sending data to be
processed by the receiving application program. When the result of processing comes back, the
sending application program finds that everything is wrong. It wants to abort the process, but it has
already sent a huge amount of data. If it issues an abort command *1ontrol K 1., these two characters
will be stored at the end of the receiving "12 buffer. It will be delivered to the receiving application
program after all the data has been processed.
"he solution is to send a segment with the 5RF bit set. "he sending application program tells the
sending "12 that the piece of data is urgent. "he sending "12 creates a segment and inserts the
urgent data at the beginning of the segment. "he rest of the segment can contain normal data from the
buffer. "he urgent pointer field in the header defines the end of the urgent data and the start of normal
data.
When the receiving "12 receives a segment with the 5RF bit set, it extracts the urgent data from the
segment, using the value of the urgent pointer, and delivers it, out of order, to the receiving
application program.
9. Identify the two protocols present in the "ransport layer.
Ans:
"he two protocols present in the "ransport layer are 5-2 and "12.
10. What is the length of following addresses in terms of bytes?
a. 2hysical address
b. I2 address
c. 2ort address
Ans:
a. P!ysica) aress8 = bytes
b. ,P aress8 ; bytes
c. P$rt aress8 9 bytes
Chapter Six Questions
Part 1
1. In "123I2 model, the session and presentation layers are integrated with 000000000 layer.
Ans.
pplication
2. In "123I2 the two communicating process can be best described using the 000000000000000000
model.
Ans.+)ient#ser'er
:. ,n c)ient#ser'er@ t!e AAAAAAAAA %r$gram is a)7ays r"nning.
Ans.
Server
4. 1onnection!oriented concurrent server uses the service of 00000000 transport protocol.
Ans.T+P
5. In client!server model, a user wanting a particular service runs the 00000000 program.
Ans.A%%)icati$n
6. 4"2 is used to transfer 00000000 from one host to another.
Ans.6i)es
7. 4"2 uses 000000000 protocol, for transmission purpose.
Ans.6i)e trans0er
8. "he number of connections re6uired for 4"2 operation is 000000.
Ans.T7$
9. 1ommands are sent over 00000000 connection.
Ans.+$ntr$)
10. Information regarding the file, such as file type, structure, and transmission mode are sent to the
server 0000000 the data transfer takes place.
Ans.-e0$re
Part 2
1. Write a brief description about 1lient!server model.
Ans.
"he purpose of a "123I2 or Internet is to provide data communication services to users. "he hurdles
created because of the geographical distance while accessing information from another host should be
minimi/ed. If a user at a local host computer wishes to receive a service from a computer at a remote
site. 1omputer executes specific programs to perform the specific ?ob. "here would be a program to
do the Word processing, a program to browse the web site and so on. In other words for data
communication to take place, a computer runs a program to re6uest a service from another program
residing on the destination computer. "his means that two computers connected by an Internet should
each run a program, one to provide a service and one to re6uest a service.
It is important to determine beforehand, who makes the re6uest for service and who offers it. Issue of
whether both the application programs are able to re6uest services and provide services or should the
application programs ?ust do one or the other, must be resolved. ,ne solution is to have an application
program, called the client, running on the local host computer, re6uest a service from another
application program, called the server, running on the remote computer. In other words, the task of
re6uesting program is either a re6uester *a client., or a provider *a server.. If a machine needs to
re6uest a service and provide a service, two application programs must be installed. In other words,
application programs come in pairs.
n application program in a client server model provides services to any application program
installed anywhere in an Internet that re6uests this service. "herefore, a server provides service to any
client. In other words, the client!server relationship is many!to!one. +any clients can use the services
of one server.
In a client server model, a client program, which re6uests a service, should run only when it is needed.
"he server program, which provides a service, should run all the time because it does not know when
its service is needed.
2. What is a connectionless!iterative server? 5sing a diagram explain the same.
Ans.
The servers that use UDP are normally iterative, which means that the server
processes one request at a time. A server gets the request received in a
datagram from UDP, processes the request, and gives the response to UDP to
send to the client. The server pays no attention to the other datagrams. These
datagrams are stored in a queue, waiting for service. They could all be from one
client or from many clients. In either case they are processed one by one in
order of arrival.
The following figure illustrates the same

*onnectionless(Iterative Server
3. Write a brief description about the connection!oriented concurrent server.
Ans.
"he servers that use "12 are normally concurrent. "his means that the server can serve many clients
at the same time. 1ommunication is connection!oriented, which means that a re6uest is a stream of
bytes that can arrive in several segments and the response can occupy several segments. connection
is established between the server and each client, and the connection remains open until the entire
stream is processed and the connection is terminated.
"his type of server cannot use only one well!known port because each connection needs a port and
many connections may be open at the same time. +any ports are needed, but a server can use only
one
well!known port. "he solution is to have one well!known port and many ephemeral ports. "he server
makes a passive open at the well!known port. client can make its initial approach to this port to
make the connection. fter the connection is made, the server assigns a temporary port to this
connection to free the well!known port. -ata transfer can now take place between these two
temporary ports, one at the client site and the other at the server site. "he well!known port is now free
for another client to make the connection. "he idea is to push demultiplexing to "12 instead of the
server.
"he server must also have one buffer for each connection. "he segments coming from the client are
stored in the appropriate buffer, and will be served concurrently by the server.
"o provide this service, most implementations use the concept of parent and child servers. server
running infinitely and accepting connections from the clients is called a parent server. "he parent uses
the well!known port. fter it makes a connection, the parent server creates a child server and an
ephemeral port and lets the child server handle he service. It thereby frees itself so that it can wait for
another connection.
4. (xplain the concept of process.
Ans.
process is an instance of a program. When the operating system executes a program, an instance of
the program, a process, is created. "he operating system can create several processes from one
program, which means several instances of the same program are running at the same time
*concurrently.. lthough all processes have the same data types, memory is allocated for each
process separately. In addition, the values stored in variables may be totally different from one
process to another. "he functions executed by each process of the same program may differ, as each
may take different inputs.
5. Write a short note on 4"2.
Ans.
4ile transfer protocol *4"2. is the standard mechanism provided by "123I2 for copying a file from
one host to another. "ransferring files from one computer to another is one of the most common tasks
expected from the networking environment.
lthough transferring files from one system to another seems simple and straightforward, some
problems must be dealt with first. 4or example, two systems may use different file name conventions.
"wo systems may have different ways to represent text and data. "wo systems may have different
directory structures. ll of these problems have been solved by 4"2 in a very simple and elegant
approach.
4"2 differs from other client!server applications in that it establishes two connections between the
hosts. ,ne connection is used for data transfer, the other for control information *commands and
responses.. Separation of commands and data transfer makes 4"2 more efficient. "he control
connection uses very simple rules of communication. We need to transfer only a line of command or
a line of response at a time. "he data connection, on the other hand, needs more complex rules due to
the variety of data type transferred.
4"2 uses two well!known "12 ports, 2ort 9% is used for the control connection, and port 9D is used
for the data connection.
"he client has three components8 user interface, client control process, and the client data transfer
process. "he server has two components8 the server control process and the server data transfer
process. "he control connection is made between the control processes. "he data connection is made
between the data processes. "he control connection remains connected during the entire interactive
4"2 session. "he data connection is opened and then closed for each file transferred. It opens each
time commands that involve transferring files are used, and it closes when the file is transferred.
Similarly, when a user starts an 4"2 session, the control connection is opened. While the control
connection is open, the data connection can be opened and closed multiple times if several files are
transferred.
"he two 4"2 connections control and data use different strategies and different port numbers.
6. Write a brief description about the control connection used in 4"2.
Ans.
"he control connection is created in the same way as other application programs described so far.
"here are two steps8
%. "he server issues a passive open on the well!known port 9% and waits for a
client.
"he client uses an ephemeral port and issues an active open connection to the port 9% of server
process.
"he connection remains open during the entire process. "he service type, used by the I2 protocol, is
to minimi/e delay because this is an interactive connection between a user *human. and a server. "he
user types commands and expects to receive responses without significant delay. fter the initial
connection, the server process creates a child process and assigns the duty of serving the client to the
child process using an ephemeral port.
7. Write a brief description about the data connection used in 4"2.
Ans.
"he data connection uses the well!known port 9D at the server site. @owever, the creation of a data
connection is different from what we have seen so far. "he following shows how 4"2 creates a data
connection8
%. "he client, not the server, issues a passive open using an ephemeral port. "he
client must do this because it is the client that issues the commands for
transferring files.
"he client sends this port number to the server using the 2,R" command.
"he server receives the port number and issues an active open using the well!known port 9D and the
received ephemeral port number.
fter the initial connection, the server process creates a child process and assigns the duty of serving
the client to the child process using an ephemeral port.
8. Write a brief note on the 1ommands processing. -escribe the groups into which 1ommands *that
are sent from client to server. can be divided.
Ans.
4"2 uses the control connection to establish a communication between the client control process and
the server control process. -uring this communication, the commands are sent from the client to the
server and the responses are sent back from the server to the client.
+$mmans8 We can roughly divide the commands into six groups8 access commands, file
management commands, data formatting commands, port defining commands, file transferring
commands, and miscellaneous commands.
Access c$mmans8 "hese commands let the user access the remote system.
1ommands are ! 5S(R, 2SS, 11", R(I), N5I", #,R
6i)e management c$mmans8 "hese commands let the user access the file system on the remote
computer. "hey allow the user to navigate through the directory structure, create new directories,
delete files, and so on.
!ommands are " !#D, !DUP, D$%$, %I&T, '.
Data formatting commands These commands let the user define the data
structure, file type and transmission mode. The defined format is then used by
the file transfer commands.
1ommands are E "I2(, S"R5, and +,-(.
Port defining commands These commands define the port number for the
data connection on the client site.
G1ommands are E 2,R", 2SH
File transfer commands These commands actually let the user transfer files.
R("R, S",R, 22(, S",5, O.
Miscellaneous commands These commands deliver information to the (TP
user at the client site.
!ommands are ) *$%P, +,,P, '
9. #riefly explain the steps involved in storing an image file into the server from client side.
Ans.
"he steps involved in storing an image file into the server from client side are as follows8
%. "he control connection to port 9% is created.
9. fter the control connection to port 9% is created, the 4"2 server sends the
99D *service ready. response on the control connection.
:. "he client sends the 5S( command *this 5S(R command passes the user
information to server..
;. "he server responds with ::% *user name is ,M, a password is re6uired..
<. "he client sends the 2SS command *sends the password for the user..
=. "he server responds with 9:D *user login ,M, if user id and password match..
>. "he client issues a passive open on an ephemeral port for data connection and
sends the 2,R" command *over the control connection. to give this port
number to the server.
'. "he server does not open the connection at this time, but prepares itself for
issuing an active open on the data connection between port 9D *server side.
and the ephemeral port received from the client. It sends the response %<D
*data connection will be open shortly..
&. "he client sends the "I2( command *to indicate the type of data as binary
O.
%D. "he server responds with response 9DD *command ,M.
%%. "he client sends the S"R5 command *defines the data following as of file
type..
%9. "he server responds with response 9DD *command ,M.
%:. "he client sends the S",R command *to re6uest the server to store the data.
%;. "he server opens the data connection and sends the message 9<D.
%<. "he client sends the file on the data connection. fter the entire file is sent
the data connection is closed. 1losing the data connection means end!of!file.
%=. "he server sends the response 99= on the control connection.
%>. "he client sends the N5I" command *or it can send the other commands to
open another data connection for transferring another file..
%'. "he server responds with 99% *service closing. and it closes the control
connection.
FAQ
1. What is concurrency?
Ans:
1oncurrency means the ability to run simultaneously. #oth clients and serves can run in concurrent
mode. @owever, the concurrency in clients and server differ from each other.
+$nc"rrency in +)ients:
1lients can be run on a computer either iteratively or concurrently. Running clients iteratively means
running them one by oneC one client must start, run, and terminate before the computer can start
another client. @owever today, most computers allow concurrent clients, that is, two or more clients
running at the same time.
+$nc"rrency in Ser'ers
#ecause an iterative server can process only one re6uest at a time, it receives a re6uest, processes it,
and sends the response to the re6uestor before it handles another re6uest. If there is a re6uest from
another client, then it has to either re?ect the re6uest or keep the re6uest in waiting until the server
finishes the first one. ,n the other hand, a concurrent server can process many re6uests at the same
time and thus can share its time between many re6uests.
2. What are a connectionless iterative server and a connectionless concurrent server?
Ans:
+$nnecti$n)ess iterati'e ser'er8 "he servers that use 5-2, a connectionless transport layer protocol,
are normally iterative. "his means that the server processes one client re6uest at a time in order of
their arrival. server receives the re6uest in a datagram from 5-2, processes the re6uest, and gives
the response to 5-2 to send to the client.
+$nnecti$n)ess c$nc"rrent ser'er8 "he servers that use 5-2, a connectionless transport layer
protocol can also be iterative. "his means that the server processes multiple client re6uests at the same
time. "his type of server will be found occasionally.
3. What are a connection!oriented iterative server and a connection!oriented concurrent server?
Ans:
+$nnecti$n#$riente iterati'e ser'er8 "he servers that use "12, a connection!oriented transport
layer protocol can be concurrent. "his means that the server can serve one client re6uest at a time.
"his type of server will be found occasionally.
+$nnecti$n#$riente c$nc"rrent ser'er8 "he servers that use "12, a connection!oriented transport
layer protocol, are normally concurrent. "his means that the server can serve many clients at the same
time. 1ommunication is connection!oriented, which means that a re6uest is a stream of bytes that can
arrive in several segments and the response can occupy several segments. connection is established
between the server and each client, and the connection remains open until the entire stream is
processed and the connection is terminated.
4. What is an active open connection?
Ans:
client opens the communication channel using the I2 address of the remote host and the well!
known port address of the specific server program running on that machine. "his is called an active
o#en connection.
5. What is a passive open connection?
Ans:
server opens the channel for incoming re6uests from clients, but it never initiates a service until it is
re6uested to do so. "his is called a #assive o#en connection.
6. What is a control connection?
Ans:
4"2 uses S1II character set to communicate across the control channel. 1ommunication is achieved
through commands and responses. "his simple method is ade6uate for the control connection because
we send one command *response. at a time. (ach command or response is only one short line so we
need not worry about file format or file structure. (ach line is terminated with a two!character
*carriage return and line feed. end!of!line token.
7. What is data connection?
Ans:
-ata connection allows you to transfer files after defining the types of file to be transferred, the
structure of the data, and the transmission mode. #efore sending the file through the data connection,
you need to prepare for transmission through the control connection. "he heterogeneity problem is
resolved by defining three attributes of communications8 file type, data structure, and transmission
mode. common format for the above three attributes is agreed upon before actually transferring the
data.
8. Write a brief description about client!server model.
Ans:
"he purpose of a client!server model is to provide data communication services to users. In the client!
server model, an application program, called the client, re6uests for a service from another application
program, called the server. In other words, when a machine needs to re6uest for a service, it is called
a re6uester or a client. When a machine provides a service, it is called a provider or a server.
9. Write a short note on 4"2.
Ans:
4ile transfer protocol *4"2. is the standard mechanism provided by "123I2 to copy a file from one
host to another. When two systems use different file name conventions, different ways to represent
text and data, and different directory structures, you can use 4"2 in such a situation to transfer files.
4"2 establishes two connections between the hosts. ,ne connection is used for data transfer and the
other for control information *commands and responses.. 4"2 uses two well!known "12 ports, port
9D is used for the data connection and port 9% is used for the control connection.
10. What are the common 4"2 commands for processing?
Ans:
4"2 uses the control connection to establish a communication between the client control process and
the server control process. -uring this communication, the 4"2 commands are sent from the client to
the server and the responses are sent back from the server to the client. Iou can divide the 4"2
commands into six groups8 access commands, file management commands, data formatting
commands, port defining commands, file transferring commands, and miscellaneous commands.
Access +$mmans8 "hese commands let the user access the remote system.
1ommands are ! 5S(R, 2SS, 11", R(I), N5I", #,R
6i)e 3anagement +$mmans: "hese commands let the user access the file system on the remote
computer. "hey allow the user to navigate through the directory structure, create new directories,
delete files, and so on.
1ommands are E 1W-, 1-52, -($(, $IS", O
*ata 6$rmatting +$mmans: "hese commands let the user define the data structure, file type and
transmission mode. "he defined format is then used by the file transfer commands.
1ommands are E "I2(, S"R5, and +,-(.
P$rt *e0ining +$mmans: "hese commands define the port number for the data connection on the
client site.
1ommands are E 2,R", 2SH
6i)e Trans0er +$mmans: "hese commands actually let the user transfer files.
R("R, S",R, 22(, S",5, O
3isce))ane$"s +$mmans: "hese commands deliver information to the 4"2 user at the client site.
1ommands are ! @($2, ),,2, O

Você também pode gostar