0% found this document useful (0 votes)
23 views23 pages

CN Iae1 Set A Answer Key

Uploaded by

nithyabtechit95
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views23 pages

CN Iae1 Set A Answer Key

Uploaded by

nithyabtechit95
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 23

UNITED INSTITUTE OF TECHNOLOGY

(An Autonomous Institution)


Periyanaickenpalayam, Coimbatore – 641020
Continuous Internal Assessment - 1
Semester - V
CS 3591-COMPUTER NETWORKS
(Common to: B.E. Computer Science and Engineering / B.E. Computer Science and Engineering
(Cyber Security) / B.Tech. Information Technology)
(Regulations 2021)
Answer Key
PART – A
(2Marks)
1. Transmission mode:
 The way in which data is transmitted from one device to another device is known as
transmission mode.
 The transmission mode is also known as the communication mode.
 Each communication channel has a direction associated with it, and transmission
media provide the direction. Therefore, the transmission mode is also known as a
directional mode. The transmission mode is defined in the physical layer.
Types of Transmission mode
The Transmission mode is divided into three categories:
 Simplex Mode Ex: Radio
 Half-duplex Mode Ex: walkie talkie
 Full-duplex mode Ex: TV
2. Flow Control:
 Flow Control is the process of managing the rate of data transmission between two
nodes to prevent a fast sender from overwhelming a slow receiver.
 It provides a mechanism for the receiver to control the transmission speed, so that the
receiving node is not overwhelmed with data from transmitting node.
3. DNS:
 DNS is used for name-to-address mapping.
 The DNS provides the protocol which allows clients and servers to
 Communicate with each other.
 It is a directory lookup service that provides a mapping between the name of a host on
the internet and its numerical address.
4. Computer Networks:
 A computer network is defined as, “a set of computer which are interconnected by a
communication links for sharing data or resources or exchanging messages.
 The best known computer network is the Internet.
 All networks must have
 A resource to share
 A pathway to transfer data(transmission media)
 A set of rules governing how to communicate(protocol)

5. Socket Address:
 Socket is an end point of a two way communication link between two programs
running on a network.
 Connection of IP address and Port number.
IP address + Port number = Socket address

Ex: - IP Address Port Number


192.10.10.20 21

Socket Address
190.10.10.20:21

6. Stream Control Transmission Protocol:


Stream control transmission protocol (SCTP) is a new transport layer protocol mainly
designed to combine some features of UDP and TCP in an effort to create a better protocol
for multimedia communication.
Services of SCTP:
 Process-to-process communication
 Multiple Streams
 Multihoming
 Full-duplex communication
 Connection-oriented service
 Reliable Service
7. QOS:
 Quality of service is the overall performance of a telephony or computer network,
particularly the performance seen by the users of the network, which provides the
packet delivery guarantees, which is related to bandwidth and delay.
 Simply it is an issue that refers to a set of techniques and mechanisms that guarantees
the performance of a network.
8. Services of the Transport Layer:
The services provided by the transport layer protocols can be divided into five broad
categories,
 End-to-end delivery
 Addressing
 Reliable delivery
 Flow control
 Multiplexing

9. Three Phases involved in the circuit switching:


Communication via circuit switching involves three phases:
 Connection setup
 Data Transfer
 Connection teardown
10. Packet Switching:
 In the Packet-switched network, the sending message is divided into packets of either
fixed or variable size.
 Here, there is no resource allocation is required for packets.
 Resource are allocated based on demand.

PART – B
(16 Marks)
11. a) OSI: (Open System Interconnection)

1. PHYSICAL LAYER:
 Physical characteristics of interfaces and media
 Representation of bits
 Signals:
 Synchronization of bits
 Line Configuration
 Physical Topology
 Transmission Mode
2. DATA LINK LAYER
 Framing
 Physical addressing
 Flow control
 Error control
 Medium Access control
3. NETWORK LAYER
 Logical addressing
 Routing
4. TRANSPORT LAYER
 Port addressing / Service Point addressing
 Segmentation and reassembly
 Connection control
 Flow control
 Error Control
5. SESSION LAYER
 Dialog control
 Synchronization
6. PRESENTATION LAYER
 Translation
 Compression and expansion
7. APPLICATION LAYER
 FTAM (File Transfer, Access, Management)
 Mail services
 Directory services
11.b.i) HTTP: (Hypertext Transfer Protocol)
 The Hypertext Transfer Protocol (HTTP) is used to define how the client-
Server programs can be written to retrieve web pages from the Web.
 It is a protocol used to access the data on the World Wide Web (WWW).
 An HTTP client sends a request; an HTTP server returns a response.
 The server uses the port number 80; the client uses a temporary port number.
 HTTP uses the services of TCP, a connection-oriented and reliable protocol.
 Each HTTP message has the general form
START_LINE <CRLF>
MESSAGE_HEADER <CRLF>
<CRLF> MESSAGE_BODY <CRLF>
Where <CRLF> stands for carriage-return-line-feed.
Features of HTTP
 Connectionless protocol
 Media independent
 Stateless
Http request and response messages:
HTTP REQUEST MESSAGE

 The first line in a request message is called a request line.


 After the request line, we can have zero or more request header lines.
 The body is an optional one. It contains the comment to be sent or the file to
be
published on the website when the method is PUT or POST.

HTTP RESPONSE MESSAGE

 The first line in a request message is called a status line.


 After the request line, we can have zero or more response header lines.
 The body is an optional one. The body is present unless the response is an
error
Message

HTTP CONNECTIONS

 Non-persistent connections
 Persistent connections
11.b.ii) SMTP: Simple Mail Transfer Protocol
 SMTP is the standard protocol for transferring mail between hosts in the
 TCP/IP protocol suite.
 SMTP is not concerned with the format or content of messages themselves.
 SMTP uses information written on the envelope of the mail (message header),
but does not look at the contents (message body) of the envelope.
SMTP clients and servers have two main components
 User Agents(UA) – Prepares the message, encloses it in an envelope.
 Mail Transfer Agent (MTA) – Transfers the mail across the internet

SMTP also allows the use of Relays allowing other MTAs to relay the mail.
SMTP COMMANDS AND RESPONSES:-
 The operation of SMTP consists of a series of commands and responses
 exchanged between the SMTP sender and SMTP receiver.
 The initiative is with the SMTP sender, who establishes the TCP connection.
 Once the connection is established, the SMTP sender sends commands over the
 connection to the receiver.
 The command is from an MTA client to an MTA server; the response is from
 an MTA server to the MTA client.
SMTP OPERATIONS
Basic SMTP operation occurs in three phases:
1. Connection Setup
2. Mail Transfer
3. Connection Termination
12.a) working of an E-Mail:-
EMAIL (SMTP, MIME, IMAP, POP)
One of the most popular Internet services is electronic mail (E-mail).
 Email is one of the oldest network applications.
 The three main components of an Email are
1. User Agent (UA)
2. Messsage Transfer Agent (MTA) – SMTP
3. Messsage Access Agent (MAA) - IMAP , POP
When the sender and the receiver of an e-mail are on the same system, we need
only two User Agents and no Message Transfer Agent
 When the sender and the receiver of an e-mail are on different system, we need
two UA, two pairs of MTA (client and server), and two MAA (client and
server).
WORKING OF EMAIL
 When Alice needs to send a message to Bob, she runs a UA program to
prepare the message and send it to her mail server.
 The mail server at her site uses a queue (spool) to store messages waiting to be
sent. The message, however, needs to be sent through the Internet from Alice’s
site to Bob’s site using an MTA.
 Here two message transfer agents are needed: one client and one server.
 The server needs to run all the time because it does not know when a client will
ask for a connection.
 The client can be triggered by the system when there is a message in the queue
to be sent.
 The user agent at the Bob site allows Bob to read the received message.
 Bob later uses an MAA client to retrieve the message from an MAA server
running on the second server.

USER AGENT (UA)


 The first component of an electronic mail system is the user agent (UA).
It provides service to the user to make the process of sending and receiving a
message easier.
 A user agent is a software package that composes, reads, replies to, and
forwards messages. It also handles local mailboxes on the user computers.
MESSAGE TRANSFER AGENT (MTA)
 The actual mail transfer is done through message transfer agents (MTA).
 To send mail, a system must have the client MTA, and to receive mail, a
system must have a server MTA.
 The formal protocol that defines the MTA client and server in the Internet is
called Simple Mail Transfer Protocol (SMTP).
MESSAGE ACCESS AGENT (MAA)
 MAA is a software that pulls messages out of a mailbox.
 POP3 and IMAP4 are examples of MAA.

12.b) Domain Name System:-

 DNS is used for name-to-address mapping.


 The DNS provides the protocol which allows clients and servers to
 communicate with each other.
Eg: Host name like www.yahoo.com is translated into numerical IP addresses
like 207.174.77.131
 Domain Name System (DNS) is a distributed database used by TCP/IP
applications to map between hostnames and IP addresses and to provide
electronic mail routing information.
 Each site maintains its own database of information and runs a server program
that other systems across the Internet can query.

The following six steps shows the working of a DNS. It maps the host name to an IP
address:
1. The user passes the host name to the file transfer client.
2. The file transfer client passes the host name to the DNS client.
3. Each computer, after being booted, knows the address of one DNS server. The
DNS client sends a message to a DNS server with a query that gives the file
transfer server name using the known IP address of the DNS server.
4. The DNS server responds with the IP address of the desired file transfer server.
5. The DNS server passes the IP address to the file transfer client.
6. The file transfer client now uses the received IP address to access the file
transfer server.
NAME SPACE
 To be unambiguous, the names assigned to machines must be carefully selected
from a name space with complete control over the binding between the names
and IP address.
 The names must be unique because the addresses are unique.
 A name space that maps each address to a unique name can be organized in
two ways: flat (or) hierarchical.
Domain Name
 Each node in the tree has a label called as domain name.
 A full domain name is a sequence of labels separated by dots (.)
 The domain names are always read from the node up to the root.
 The last label is the label of the root (null).
 This means that a full domain name always ends in a null label, which
means the last character is a dot because the null string is nothing.
 If a label is terminated by a null string, it is called a fully qualified domain
name (FQDN).
 If a label is not terminated by a null string, it is called a partially qualified
domain name (PQDN).

HIERARCHY OF NAME SERVERS


 The way to distribute information among DNS servers is to divide the whole
space into many domains based on the first level.
 Let the root stand-alone and create as many domains as there are first level
nodes.
 Because a domain created this way could be very large,
 DNS allows domains to be divided further into smaller domains.
 Thus we have a hierarchy of servers in the same way that we have a hierarchy
of names.

13.a) The segment format of TCP:-


TRANSMISSION CONTROL PROTOCOL (TCP)
 TCP is a reliable, connection-oriented, byte-stream protocol.
 TCP guarantees the reliable, in-order delivery of a stream of bytes. It is a full-duplex
protocol, meaning that each TCP connection supports a pair of byte streams, one
flowing in each direction.
 TCP includes a flow-control mechanism for each of these byte streams that allow the
receiver to limit how much data the sender can transmit at a given time.
 TCP supports a demultiplexing mechanism that allows multiple application programs
on any given host to simultaneously carry on a conversation with their peers.
 TCP also implements congestion-control mechanism. The idea of this mechanism is
to prevent sender from overloading the network.
 Flow control is an end to end issue, whereas congestion control is concerned with
how host and network interact.
TCP SERVICES
1. Process-to-Process Communication
2. Stream Delivery Service
3. Full-Duplex Communication
4. Multiplexing and De-multiplexing
5. Connection-Oriented Service
6. Reliable Service
TCP SEGMENT:-
SrcPort and DstPort―port number of source and destination process.
SequenceNum―contains sequence number, i.e. first byte of data segment.
Acknowledgment― byte number of segment, the receiver expects next.
HdrLen―Length of TCP header as 4-byte words.
Flags― contains six control bits known as flags.
1. URG — segment contains urgent data.
2. ACK — value of acknowledgment field is valid.
3. PUSH — sender has invoked the push operation.
4. RESET — receiver wants to abort the connection.
5. SYN — synchronize sequence numbers during connection establishment.
6. FIN — terminates the TCP connection.
Advertised Window―defines receiver’s window size and acts as flow control.
Checksum―It is computed over TCP header, Data, and pseudo header containing IP fields
(Length, SourceAddr & DestinationAddr).
UrgPtr ― used when the segment contains urgent data. It defines a value that must be
added to the sequence number.
The segment format of UDP:-
Source Port Number
 Port number used by process on source host with 16 bits long.
 If the source host is client (sending request) then the port number is an temporary
one requested by the process and chosen by UDP.
 If the source is server (sending response) then it is well known port number.
Destination Port Number
 Port number used by process on Destination host with 16 bits long.
 If the destination host is the server (a client sending request) then the
port number is a well known port number.
 If the destination host is client (a server sending response) then port number
is an temporary one copied by server from the request packet.
Length
 This field denotes the total length of the UDP Packet (Header plus data)
 The total length of any UDP datagram can be from 0 to 65,535 bytes.
Checksum
 UDP computes its checksum over the UDP header, the contents of the message
body, and something called the pseudoheader.
 The pseudoheader consists of three fields from the IP header—protocol number,
source IP address, destination IP address plus the UDP length field.
Data
 Data field defines tha actual payload to be transmitted.
 Its size is variable.
13.b) TCP State-Transition-Diagrams (STD):
Opening a TCP Connection
1. Server invokes a passive open on TCP, which causes TCP to move to LISTEN state
2. Client does an active open, which causes its TCP to send a SYN segment to the server
and move to SYN_SENT state.
3. When SYN segment arrives at the server, it moves to SYN_RCVD state and responds
with a SYN + ACK segment.
4. Arrival of SYN + ACK segment causes the client to move to ESTABLISHED state
and sends an ACK to the server.
5. When ACK arrives, the server finally moves to ESTABLISHED state.

Closing a TCP Connection


Client / Server can independently close its half of the connection or simultaneously.
Transitions from ESTABLISHED to CLOSED state are:
One side closes:
ESTABLISHED → FIN_WAIT_1 → FIN_WAIT_2 → TIME_WAIT → CLOSED
Other side closes:
ESTABLISHED → CLOSE_WAIT → LAST_ACK → CLOSED
Simultaneous close:
ESTABLISHED → FIN_WAIT_1 → CLOSING → TIME_WAIT → CLOSED
14.a) Congestion control techniques:-
 Congestion occurs if load (number of packets sent) is greater than capacity of the
network (number of packets a network can handle).
 When load is less than network capacity, throughput increases proportionally.
 When load exceeds capacity, queues become full and the routers discard some
packets and throughput declines sharply.
 When too many packets are contending for the same link
 The queue overflows
 Packets get dropped
 Network is congested
 Network should provide a congestion control mechanism to deal with such a
situation.
 TCP maintains a variable called Congestion Window for each connection.
 TCP Congestion Control mechanisms are:
1. Additive Increase / Multiplicative Decrease (AIMD)
2. Slow Start
3. Fast Retransmit and Fast Recovery
Additive Increase / Multiplicative Decrease (AIMD)
 TCP source initializes CongestionWindow based on congestion level in the network.
 Source increases CongestionWindow when level of congestion goes down and
decreases the same when level of congestion goes up.
 TCP interprets timeouts as a sign of congestion and reduces the rate of transmission.
 On timeout, source reduces its CongestionWindow by half, i.e., multiplicative
decrease. For example, if CongestionWindow = 16 packets, after timeout it is 8.
 Value of CongestionWindow is never less than maximum segment size (MSS).
 When ACK arrives CongestionWindow is incremented marginally, i.e., additive
increase.
Increment = MSS × (MSS/CongestionWindow)
CongestionWindow += Increment

Slow Start
 Slow start is used to increase Congestion Window exponentially from a cold start.
 Source TCP initializes Congestion Window to one packet.
 TCP doubles the number of packets sent every RTT on successful transmission.
 When ACK arrives for first packet TCP adds 1 packet to CongestionWindow and
sends two packets.
 When two ACKs arrive, TCP increments CongestionWindow by 2 packets and sends
four packets and so on.
 Instead of sending entire permissible packets at once (bursty traffic), packets are sent
in a phased manner, i.e., slow start.
 Initially TCP has no idea about congestion, henceforth it increases
 CongestionWindow rapidly until there is a timeout. On timeout:
CongestionThreshold = CongestionWindow/ 2
CongestionWindow = 1

Fast Retransmit And Fast Recovery


 TCP timeouts led to long periods of time during which the connection went dead
while waiting for a timer to expire.
 Fast retransmit is a heuristic approach that triggers retransmission of a dropped
packet sooner than the regular timeout mechanism. It does not replace regular
timeouts.
 When a packet arrives out of order, receiving TCP resends the same
acknowledgment (duplicate ACK) it sent last time.
 When three duplicate ACK arrives at the sender, it infers that corresponding packet
may be lost due to congestion and retransmits that packet. This is called fast
retransmit before regular timeout.
 When packet loss is detected using fast retransmit, the slow start phase is replaced by
additive increase, multiplicative decrease method. This is known as fast recovery.
 Instead of setting CongestionWindow to one packet, this method uses the ACKs that
are still in pipe to clock the sending of packets.
 Slow start is only used at the beginning of a connection and after regular timeout. At
other times, it follows a pure AIMD pattern.
14.b.i) SCTP flow control:-
Flow control in SCTP is similar to that in TCP.
 Current SCTP implementations use a byte-oriented window for flow control.
Receiver Site
 The receiver has one buffer (queue) and three variables.
 The queue holds the received data chunks that have not yet been read by the process.
 The first variable holds the last TSN received, cumTSN.
 The second variable holds the available buffer size; winsize.
 The third variable holds the last accumulative acknowledgment, lastACK.
 The following figure shows the queue and variables at the receiver site.

 When the site receives a data chunk, it stores it at the end of the buffer (queue) and
subtracts the size of the chunk from winSize.
 The TSN number of the chunk is stored in the cumTSN variable.
 When the process reads a chunk, it removes it from the queue and adds the size of the
removed chunk to winSize (recycling).
 When the receiver decides to send a SACK, it checks the value of lastAck; if it is less
than cumTSN, it sends a SACK with a cumulative TSN number equal to the
cumTSN.
 It also includes the value of winSize as the advertised window size.
Sender Site
 The sender has one buffer (queue) and three variables: curTSN, rwnd, and inTransit.
 We assume each chunk is 100 bytes long. The buffer holds the chunks produced by
the process that either have been sent or are ready to be sent.
 The first variable, curTSN, refers to the next chunk to be sent.
 All chunks in the queue with a TSN less than this value have been sent, but not
acknowledged; they are outstanding.
 The second variable, rwnd, holds the last value advertised by the receiver (in bytes).
 The third variable, inTransit, holds the number of bytes in transit, bytes sent but not
yet acknowledged.
 The following figure shows the queue and variables at the sender site.

14.b.ii) SCTP Error control:-


 SCTP is a reliable transport layer protocol.
 It uses a SACK chunk to report the state of the receiver buffer to the sender.
 Each implementation uses a different set of entities and timers for the receiver and
sender sites.
Receiver Site
 The receiver stores all chunks that have arrived in its queue including the out-of-
order ones. However, it leaves spaces for any missing chunks.
 It discards duplicate messages, but keeps track of them for reports to the sender.
 The following figure shows a typical design for the receiver site and the state of the
receiving queue at a particular point in time.

The available window size is 1000 bytes.


 The last acknowledgment sent was for data chunk 20.
 Chunks 21 to 23 have been received in order.
 The first out-of-order block contains chunks 26 to 28.
 The second out-of-order block contains chunks 31 to 34.
 A variable holds the value of cumTSN.
Sender Site
 At the sender site, it needs two buffers (queues): a sending queue and a
retransmission queue.
 Three variables were used - rwnd, inTransit, and curTSN as described in the previous
section.
 The following figure shows a typical design.

The sending queue holds chunks 23 to 40.


 The chunks 23 to 36 have already been sent, but not acknowledged; they are
outstanding chunks.
 The curTSN points to the next chunk to be sent (37).
 We assume that each chunk is 100 bytes, which means that 1400 bytes of data
(chunks 23 to 36) is in transit.
 The sender at this moment has a retransmission queue.
 When a packet is sent, a retransmission timer starts for that packet (all data chunks in
that packet).
 Some implementations use one single timer for the entire association, but other
implementations use one timer for each packet.

15.a) Packet Switching:-


 The packet switching is a switching technique in which the message is sent in one
go, but it is divided into smaller pieces, and they are sent individually.
 The message splits into smaller pieces known as packets and packets are given a
unique number to identify their order at the receiving end.
 Every packet contains some information in its headers such as source address,
destination address and sequence number.
 Packets will travel across the network, taking the shortest path as possible.
 All the packets are reassembled at the receiving end in correct order.
 If any packet is missing or corrupted, then the message will be sent to resend the
message.
 If the correct order of the packets is reached, then the acknowledgment message
will be sent.

Advantages of Packet Switching:


1. Cost-effective
2. Reliable
3. Efficient
Disadvantages of Packet Switching:
 Packet Switching technique cannot be implemented in those applications that
require low delay and high-quality services.
 The protocols used in a packet switching technique are very complex and requires
high implementation cost.
 If the network is overloaded or corrupted, then it requires retransmission of lost
packets. It can also lead to the loss of critical information if errors are nor
recovered.
APPROACHES OF PACKET SWITCHING
There are two approaches to Packet Switching:
o Datagram Packet switching
o Virtual Circuit Switching
Datagram Packet switching
 It is a packet switching technology in which packet is known as a datagram, is
considered as an independent entity.
 Each packet contains the information about the destination and switch uses this
information to forward the packet to the correct destination.
 The packets are reassembled at the receiving end in correct order.
 In Datagram Packet Switching technique, the path is not fixed.
 Intermediate nodes take the routing decisions to forward the packets.
 Datagram Packet Switching is also known as connectionless switching.
 There are no setup or teardown phases.
 Each packet is treated the same by a switch regardless of its source or destination.
Delay in a datagram network

 The packet travels through two switches.


 There are three transmission times (3T),three propagation delays (slopes 3t of the
lines), and two waiting times (w1 + w2).
 We ignore the processing time in each switch.
Total delay = 3T + 3t + w1 + w2
15.b) IPv4 packet format:-
 Version − Version no. of Internet Protocol used (e.g. IPv4).
 IHL − Internet Header Length; Length of entire IP header.
 DSCP − Differentiated Services Code Point; this is Type of Service.
 ECN − Explicit Congestion Notification; It carries information about the congestion
seen in the route.
 Total Length − Length of entire IP Packet (including IP header and IP Payload).
 Identification − If IP packet is fragmented during the transmission, all the fragments
contain same identification number. to identify original IP packet they belong to.
 Flags − As required by the network resources, if IP Packet is too large to handle,
these ‘flags’ tells if they can be fragmented or not. In this 3-bit flag, the MSB is
always set to ‘0’.
 Fragment Offset − This offset tells the exact position of the fragment in the original
IP Packet.
 Time to Live − To avoid looping in the network, every packet is sent with some TTL
value set, which tells the network how many routers (hops) this packet can cross. At
each hop, its value is decremented by one and when the value reaches zero, the packet
is discarded.
 Protocol − Tells the Network layer at the destination host, to which Protocol this
packet belongs to, i.e. the next level Protocol. For example protocol number of ICMP
is 1, TCP is 6 and UDP is 17.
 Header Checksum − This field is used to keep checksum value of entire header
which is then used to check if the packet is received error-free.
 Source Address − 32-bit address of the Sender (or source) of the packet.
 Destination Address − 32-bit address of the Receiver (or destination) of the packet.
 Options − This is optional field, which is used if the value of IHL is greater than 5.
These options may contain values for options such as Security, Record Route, Time
Stamp, etc.

You might also like