Acn Class Test-2 Solution
Acn Class Test-2 Solution
Acn Class Test-2 Solution
• Figure below shows a scenario in which an electronic store can benefit from
the use of cookies.
• A shopper wants to buy a toy from an electronic store named BestToys.com.
• The Server sends the Webpage, but it also includes a cookie with the ID
12343.
• Using this a file is created such that the information clicked by the user is sent
and stored in the file, which are used by the server.
4) Explain the TCP connection establishment using a three way handshake
mechanism.
ANS:- Connection Establishment TCP uses a Three way handshaking
mechanism to establish a connection between client and server machines.
The three steps in three way handshaking mechanism are as follows.
SYN: The client sends the first segment, a SYN segment, in which only the
SYN flag is set. This segment is for synchronization of sequence numbers.
SYN + ACK: The server sends the second segment, a SYN +ACK segment,
with 2 flag bits set.
ACK: The client sends the third segment. This is just an ACK segment. It
guarantees the completion of three way handshaking.
5) Describe DHCP with its operation and static and dynamic allocation.
ANS:- DHCP (Dynamic Host Configuration Protocol) is a network management
protocol used to dynamically assign an IP address to any DHCP Operation 2M
device, or node, on a network so it can communicate using IP.
Working of DHCP:
In a network, a DHCP server manages a pool of IP addresses, as well Static
allocation 1M as default gateway details, DNS details and other information for
the clients’ network configuration. When a new computer is introduced into a
DHCP server-enabled network, it will send a query to the DHCP server
requesting all the necessary information. When the query reaches the DHCP
server, it will grant the new computer a new IP address and a lease - a time
frame for which the computer can use this IP address, as well as other
configuration details. The whole process takes place immediately after the new
computer boots, and to be successful, it has to be completed before initiating IP
based communication with other hosts in the network.
Dynamic allocation
When the DHCP server is configured to use dynamic allocation, this means that
it uses a lease policy. This way, when an assigned IP address from the available
pool is no longer used, it will be transferred back to the pool, making it
available for someone else to use. The advantage of this method is that the IP
addresses are used to their maximum - as soon as they are no longer used by the
client, they are instantly made available to others. The disadvantage of this
method is that a client will always have a random IP address.
Static allocation
The static allocation method is very popular in modern ISP networks, which do
not use dial-up methods. With the static allocation, the DHCP sever keeps a
database with all clients' LAN MAC addresses and gives them an IP address
only if their MAC address is in the database. This way, the clients can be sure
that they will be getting the same IP address every time. A DHCP server can be
set to work using a combination of the allocation methods. For example, in a
public Wi-Fi network, all of the known hosts and permanent clients can use the
static allocation, whereas for guests, the dynamic allocation is used. This way,
known hosts can always use the same IP address and the IP address pool is
equally available to everyone.
6) With the help of Diagram, explain architecture of WWW.
ANS:- The WWW (World Wide Web) is a way of exchanging information
between computers on the Internet.
WWW works on client server architecture, in which a client using a browser
can access a service using a server. Today, the WWW is a distributed client
server service.
The service provided is distributed over many locations called sites and each
site holds one or more documents i.e., Web pages.
Client sends a request through its browser to the server using HTTP protocol
which specifies the way the browser and web server communicates.
Then server receives request using HTTP protocol and checks its search for the
requested web page. If found it returns it back to the web browser and close the
HTTP connection.
Now the browser receives the web page, it interprets it and display the contents
of web page in web browser's window.
Fig. shows how WWW works.
The main web document and the image are stored in two separate files in the
same site (file X and file Y) and the referenced text file is stored in another site
(file Z).
Since, we are dealing with three different files, (namely, X, Y and Z) we need
three transactions if we want to see the whole document. The first transaction
(request/response) retrieves a copy of the main document (file X), which has a
reference (pointer) to the second and the third files.
When a copy of the main document is retrieved and browsed, the user can click
on the reference to The image to invoke the second transaction and retrieve a
copy of the image (file Y). if the user further needs to see the contents of the
referenced text file, she can click on its reference pointer) invoking the third
transaction and retrieving a copy of the file Z. Note that although file x and y
both are stored in site x, they are independent files with different names and
addresses. Two transactions are needed to retrieve them.
7) State the need for :
1. Sequence Control
2. Error Control
3. Flow Control in Networking
ANS:- Sequence Control
The 32-bit sequence number field defines the number assigned to the first byte
of data contained in this segment. TCP is a stream transport protocol. To ensure
connectivity, each byte to be transmitted is numbered. The sequence number
tells the destination which byte in this sequence comprises the first byte in the
segment. During connection establishment, each party uses a Random number
generator to create an initial sequence number (ISN), which is usually different
in each direction. We know that a TCP sequence number is 32 bit. So it has
finite (from 0 to (232-1) = 4 Giga sequence numbers) and it means we will be
able to send only 4GB of data with a unique sequence number not more than
that. It helps with the allocation of a sequence number that does not conflict
with other data bytes transmitted over a TCP connection. An ISN is unique to
each connection and separated by each device.
Error Control
Error Control mechanisms are useful to ensure reliability service of TCP. To
provide reliable service TCP detects and corrects errors. Error control
mechanisms are useful for detecting corrupted segments, lost segments, out-of-
order segments, and duplicated segments. Error detection and correction in TCP
is achieved through the use of three simple tools: checksum, acknowledgment,
and time-out.
Flow Control
Flow control make it possible for sender to send the amount of data bytes that
can be sent without worrying an acknowledgment and is one of the most
important duties of the data link layer. In most protocols, flow control is a set of
procedures that tells the sender how much data it can transmit before it must
wait for an acknowledgment from the receiver. The flow Control procedures not
allowed to overwhelm the receiver. Any receiving device has a limited speed at
which it can process incoming data and a limited amount of memory in which to
store incoming data, if sender sends data in a much speed data loss may occur to
overcome this problem flow control procedures are needful.
8)Describe SMTP with suitable diagram.
ANS:- It is the protocol that defines MTA client & server in internet.
• It is an application layer protocol of TCP/IP model.
• It transfer messages from sender’s mail servers to receivers mail server.
• SMTP interacts with local mail system and not user.
• SMTP uses a TCP socket on port 25 to transfer email reliably from client to
server.
• Email is temporarily stored on the local and eventually transferred directly to
receiving server.
• It is simple ASCII protocol.
• First Scenario
When the sender and the receiver of an e-mail are on the same mail server, we
need only two user agents.
• Second Scenario
When the sender and the receiver of an e-mail are on different mail servers, we
need two UAs and a pair of MTAs (client and server).
• Third Scenario
When the sender is connected to the mail server via a LAN or a WAN, we need
two UAs and two pairs of MTAs (client and server).
• Fourth Scenario
When both sender and receiver are connected to the mail server via a LAN or a
WAN, we need two UAs, two pairs of MTAs (client and server), and a pair of
MAAs (client and server). This is the most common situation today.