CN-2-viks

Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

CN-II Answer

Q1.A. Explain how file transfer can be done using FTP? Explain three types of file transfer in it.

File Transfer Protocol (FTP) is a standard network protocol used for transferring files between a
client and a server on a computer network. Here's how file transfer can be done using FTP:

1. **Establishing Connection:**
- The client software (FTP client) initiates a connection to the FTP server by sending a request
over the network.
- The server listens for incoming FTP requests on port 21 by default, and upon receiving the
client's request, establishes a control connection with the client.

2. **Authentication:**
- The client typically provides a username and password to authenticate itself to the server.
- Depending on the server's configuration, additional authentication mechanisms such as
public/private key pairs or anonymous access may also be supported.

3. **Navigating the Directory Structure:**


- Once authenticated, the client can navigate the directory structure of the server using FTP
commands such as `CD` (change directory), `PWD` (print working directory), `LS` (list directory
contents), and `DIR` (list directory contents in long format).

4. **File Transfer:**
- To upload a file from the client to the server, the client uses the `PUT` or `STOR` command
followed by the filename. The server then accepts the file and stores it in the specified location.
- To download a file from the server to the client, the client uses the `GET` or `RETR` command
followed by the filename. The server then sends the file to the client, which saves it in the local
directory.

5. **Closing Connection:**
- Once the file transfer is complete, the client can choose to close the connection to the server
using the `QUIT` command, or the connection may be automatically closed after a period of
inactivity.

Throughout the file transfer process, FTP uses a combination of control connections (for sending
commands and responses) and data connections (for transferring actual file data). Depending
on the mode of operation (active or passive), the data connection is established either by the
client or the server.

Overall, FTP provides a straightforward and widely supported method for transferring files
between devices on a network.
File Transfer Protocol (FTP) is a standard network protocol used to transfer files from one host to
another over a TCP-based network, such as the internet. Here's how file transfer can be done
using FTP and three types of file transfer modes:

1. **FTP Active Mode:**


- In active mode, the client initiates a connection to the server on port 21 (the default FTP
port) to establish control connection.
- After the control connection is established, the client sends a PORT command to the server,
specifying the data port (usually port 20) on which the server should connect back to the client
for data transfer.
- The server then initiates a connection to the client's specified data port for data transfer.
- Active mode may encounter issues with firewalls and network address translation (NAT)
devices because the server initiates the data connection.

2. **FTP Passive Mode:**


- In passive mode, the client still establishes a control connection with the server on port 21.
- However, the data transfer occurs over a different range of ports negotiated between the
client and the server.
- The client sends a PASV command to the server, instructing it to enter passive mode.
- The server responds with an IP address and port number for the client to connect to for data
transfer.
- Passive mode is preferred in environments where the client or server is behind a firewall or
NAT device since it allows data connections to be initiated by the client.

3. **FTP Secure (FTPS):**


- FTPS is an extension of FTP that adds support for the Transport Layer Security (TLS) or Secure
Sockets Layer (SSL) cryptographic protocols for secure data transfer.
- It encrypts both control and data connections, providing confidentiality and integrity of data
during transfer.
- FTPS can operate in either explicit or implicit modes. In explicit mode, the client explicitly
requests security from the server, while in implicit mode, security is assumed upon connection
to a designated port (990 for implicit FTPS).

Each of these FTP modes offers different advantages and is used based on the specific
requirements and network configurations of the users.

Q1.B. Define different modes of operations in TELNET and their Efficiency.


Telnet is a network protocol used for remote terminal connections over a TCP/IP network. It
allows a user to establish a connection to a remote host and interact with its terminal or
command-line interface. Telnet operates in different modes, each with its own characteristics
and efficiency:

1. **Character-at-a-Time Mode:**
- In this mode, Telnet sends each character individually as it is typed by the user.
- Efficiency: While this mode provides real-time interaction, it can be inefficient due to the
overhead of sending each character separately, especially over high-latency or low-bandwidth
connections.

2. **Line Mode:**
- Line mode sends a line of characters (terminated by a newline) at a time, rather than
individual characters.
- Efficiency: This mode reduces overhead compared to character-at-a-time mode, as it sends
entire lines at once. However, it may still suffer from inefficiency on high-latency connections.

3. **Block Mode:**
- Block mode sends data in larger blocks, typically several kilobytes in size, rather than line-by-
line or character-by-character.
- Efficiency: Block mode is the most efficient mode for bulk data transfer over Telnet
connections, as it reduces the overhead associated with sending small packets. However, it may
introduce delays in real-time interaction due to buffering.

The efficiency of each mode depends on factors such as network latency, bandwidth, and the
nature of the data being transmitted. For real-time interaction, character-at-a-time or line mode
may be preferred despite their lower efficiency, whereas block mode is better suited for bulk
data transfer where efficiency is paramount.

Q1. C. With neat diagram explain architecture of E-mail System.


The basic components of an email system are : User Agent (UA), Message Transfer Agent (MTA),
Mail Box, and Spool file. These are explained as following below.

User Agent (UA) : The UA is normally a program which is used to send and receive mail.
Sometimes, it is called as mail reader. It accepts variety of commands for composing, receiving
and replying to messages as well as for manipulation of the mailboxes.
Message Transfer Agent (MTA) : MTA is actually responsible for transfer of mail from one system
to another. To send a mail, a system must have client MTA and system MTA. It transfer mail to
mailboxes of recipients if they are connected in the same machine. It delivers mail to peer MTA if
destination mailbox is in another machine. The delivery from one MTA to another MTA is done
by Simple Mail Transfer Protocol.

Mailbox : It is a file on local hard drive to collect mails. Delivered mails are present in this file. The
user can read it delete it according to his/her requirement. To use e-mail system each user must
have a mailbox . Access to mailbox is only to owner of mailbox.
Spool file : This file contains mails that are to be sent. User agent appends outgoing mails in this
file using SMTP. MTA extracts pending mail from spool file for their delivery. E-mail allows one
name, an alias, to represent several different e-mail addresses. It is known as mailing list,
Whenever user have to sent a message, system checks recipient’s name against alias database. If
mailing list is present for defined alias, separate messages, one for each entry in the list, must be
prepared and handed to MTA. If for defined alias, there is no such mailing list is present, name
itself becomes naming address and a single message is delivered to mail transfer entity.

Q1.D. How audio and video files are compressed for transmission through Internet.

Audio and video files are often compressed for transmission over the internet to reduce file size
and minimize bandwidth usage while maintaining acceptable quality. Here are some common
compression techniques for audio and video files:

1. **Audio Compression:**
- **Lossy Compression:** Lossy compression techniques remove redundant or irrelevant
information from the audio data, resulting in some loss of quality. Examples include:
- **MP3 (MPEG Audio Layer III):** MP3 is a popular audio compression format that reduces
file size by discarding frequencies that are less audible to the human ear.
- **AAC (Advanced Audio Coding):** AAC is another widely used audio compression format
that provides better sound quality than MP3 at similar bitrates.
- **Lossless Compression:** Lossless compression techniques reduce file size without
sacrificing audio quality by finding and eliminating redundant data. Examples include:
- **FLAC (Free Lossless Audio Codec):** FLAC compresses audio data without losing any
information, making it ideal for preserving high-quality audio.
- **ALAC (Apple Lossless Audio Codec):** ALAC is similar to FLAC but is primarily used in
Apple's ecosystem.

2. **Video Compression:**
- **Lossy Compression:** Video compression techniques discard redundant or less noticeable
information from the video data, resulting in some loss of quality. Examples include:
- **H.264 (Advanced Video Coding):** H.264 is a widely used video compression standard
that offers high compression efficiency while maintaining good video quality.
- **MPEG-4:** MPEG-4 is a versatile video compression standard that supports various
compression profiles and is used for streaming, broadcasting, and storage.
- **Lossless Compression:** Lossless compression techniques preserve all original video data
without any loss of quality. However, they typically result in larger file sizes and are less
common for internet transmission due to bandwidth constraints.

3. **Streaming Protocols:**
- In addition to compression techniques, streaming protocols play a crucial role in delivering
compressed audio and video files over the internet:
- **HTTP Live Streaming (HLS):** HLS is a widely used streaming protocol that delivers audio
and video content over HTTP. It allows adaptive bitrate streaming, enabling seamless playback
across different network conditions.
- **Dynamic Adaptive Streaming over HTTP (DASH):** DASH is a similar streaming protocol
that delivers multimedia content over HTTP. It dynamically adjusts the bitrate and resolution of
the video stream based on the available network bandwidth.

By employing these compression techniques and streaming protocols, audio and video files can
be efficiently transmitted over the internet while maintaining acceptable quality for end-users.

Q2.A Explain different options used in TELNET and TELNET option negotiation in detail.
Telnet is a protocol used for remote terminal connections over a TCP/IP network. Telnet
supports various options that can be negotiated between the client and server to customize the
behavior of the Telnet session. Here's an explanation of different options used in Telnet and how
option negotiation works:

1. **Terminal Type Option (TTYPE):**


- The TTYPE option allows the client to inform the server about the type of terminal or
terminal emulation it is using.
- This option enables the server to adjust its behavior and provide an optimal user experience
based on the capabilities of the client's terminal.

2. **Echo Option (ECHO):**


- The ECHO option determines whether the characters typed by the user should be echoed
back to the client by the server.
- When ECHO is enabled, characters are echoed back, providing local feedback to the user.
When disabled, characters are not echoed back, and the server is responsible for displaying
them.

3. **Suppress Go Ahead Option (SGA):**


- The SGA option controls whether the server sends a "Go Ahead" command after each line of
input from the client.
- When SGA is enabled, the server sends a "Go Ahead" command, indicating that it is ready to
receive more input. When disabled, the server does not send "Go Ahead" commands.

4. **Binary Transmission Option (BINARY):**


- The BINARY option determines whether the Telnet session should operate in binary mode or
in text mode.
- In binary mode, data is transmitted byte-for-byte without any interpretation by Telnet. In text
mode, Telnet interprets certain control characters and performs character-by-character
processing.

5. **Window Size Option (NAWS):**


- The NAWS option allows the client to inform the server about the size of its terminal
window.
- This option enables the server to adjust the formatting of output to fit the client's terminal
window size, providing a better user experience.

Option negotiation in Telnet occurs during the initial connection setup and is managed through
the exchange of Telnet control sequences. When the client connects to the server, both parties
exchange a series of negotiation commands to agree on which options will be enabled or
disabled for the duration of the session. If both the client and server support a particular option,
it is enabled; otherwise, it remains disabled. This negotiation process ensures compatibility and
allows for customization of the Telnet session based on the capabilities of the client and server.
Q2.B. What are types of web documents, explain in detail. Explain how web server serves
active document.
Web documents, also known as web pages or resources, are files stored on web servers and
accessed by web browsers over the internet. There are several types of web documents, each
serving a different purpose and containing different types of content. Here are the most
common types of web documents:

1. **HTML (Hypertext Markup Language) Documents:**


- HTML documents are the backbone of the World Wide Web and are used to create web
pages.
- HTML documents contain structured content and formatting instructions in the form of tags,
which define the structure and appearance of the content.
- Web browsers interpret HTML documents and render them as visual web pages, displaying
text, images, links, and other multimedia content.

2. **CSS (Cascading Style Sheets) Documents:**


- CSS documents are used to style HTML documents and control the presentation and layout
of web pages.
- CSS documents define styles such as fonts, colors, margins, padding, and positioning,
allowing web developers to create visually appealing and consistent designs across multiple web
pages.

3. **JavaScript Documents:**
- JavaScript documents contain client-side scripting code that adds interactivity and dynamic
behavior to web pages.
- JavaScript documents can manipulate HTML elements, respond to user actions, make HTTP
requests, and perform calculations, enabling the creation of interactive web applications.

4. **Image Documents:**
- Image documents, such as JPEG, PNG, GIF, and SVG files, are used to display graphics and
visual content on web pages.
- Image documents can be embedded directly into HTML documents using the `<img>` tag or
referenced externally using URLs.

5. **Multimedia Documents:**
- Multimedia documents, such as audio and video files, are used to embed audio and video
content directly into web pages.
- Multimedia documents can be embedded using HTML5 audio and video tags, allowing web
developers to create rich multimedia experiences without requiring third-party plugins.

6. **Document Files (PDF, DOCX, etc.):**


- Document files, such as PDF, DOCX, and PPTX files, contain textual and graphical content
created using word processing, spreadsheet, or presentation software.
- These files can be linked to or embedded in HTML documents, allowing users to view and
download them directly from web pages.

Web servers serve active documents, such as dynamic web pages generated from server-side
scripts or databases, using the following process:

1. **Client Request:**
- A client (typically a web browser) sends a request to the web server for a specific web page
or resource.
- The request contains information such as the URL of the resource being requested and any
additional parameters or headers.

2. **Server Processing:**
- The web server receives the client request and determines the type of document or resource
being requested.
- For active documents, such as PHP, ASP.NET, or Python scripts, the server executes the script
and generates the dynamic content to be served to the client.
3. **Content Generation:**
- The server-side script interacts with databases, external APIs, or other resources to generate
the content of the web page dynamically.
- The script may perform calculations, retrieve data, or generate HTML, CSS, and JavaScript
code based on the client's request and other factors.

4. **Response Generation:**
- Once the dynamic content has been generated, the web server constructs an HTTP response
containing the generated content, along with any necessary headers and metadata.
- The response is typically formatted as an HTML document but may also include other types
of content, such as images, CSS files, or JavaScript files.

5. **Transmission to Client:**
- The web server sends the HTTP response back to the client over the network.
- The client's web browser receives the response, parses the HTML, CSS, and JavaScript
content, and renders the web page for the user to interact with.

By serving active documents dynamically, web servers can generate personalized and interactive
content for users based on their requests and other contextual information. This enables the
creation of dynamic web applications that respond to user input and provide rich and engaging
user experiences.

Q2.C. Explain Session Initiation Protocol in detail. Also explain mechanism of SIP to track the
callee.
The Session Initiation Protocol (SIP) is a signaling protocol used for initiating, modifying, and
terminating real-time communication sessions over IP networks, such as voice, video, and
messaging sessions. SIP enables users to establish and manage multimedia sessions with other
users or communication devices, regardless of their location or the underlying network
technologies. Here's a detailed explanation of SIP and its mechanism for tracking the callee:

**1. SIP Basics:**


- SIP is an application-layer protocol defined by the Internet Engineering Task Force (IETF) in
RFC 3261.
- It operates on top of the transport layer protocols, such as TCP or UDP, and uses text-based
messages similar to HTTP.
- SIP follows a client-server architecture, with SIP entities known as user agents (UA) acting as
clients, servers, or both.
- The primary functions of SIP include session establishment, session modification (e.g., adding
participants), and session termination.

**2. SIP Components:**


- **User Agent (UA):** A SIP user agent is an endpoint that initiates or receives SIP messages.
It can be a SIP client (e.g., softphone) or a SIP server (e.g., proxy server).
- **SIP Proxy Server:** A SIP proxy server forwards SIP requests to other SIP servers or user
agents based on routing rules. It acts as an intermediary for SIP communication.
- **SIP Registrar Server:** A SIP registrar server maintains a database of user locations and
contact information. It registers users' addresses and keeps track of their current locations.
- **SIP Redirect Server:** A SIP redirect server provides clients with the address of the target
user or resource. It responds to SIP requests with redirection responses containing the correct
address.

**3. SIP Session Establishment:**


- To establish a communication session, the initiating user agent sends a SIP INVITE request to
the SIP server.
- The SIP server forwards the INVITE request to the recipient's user agent or proxy server.
- The recipient's user agent generates a SIP 180 Ringing response to indicate that it is
processing the request and alerting the callee.
- Once the callee accepts the call, the recipient's user agent sends a SIP 200 OK response back
to the initiator, confirming the acceptance and establishing the session.

**4. Mechanism of SIP to Track the Callee:**


- SIP uses the concept of Uniform Resource Identifiers (URIs) to identify users or resources in
the SIP network. A SIP URI typically consists of the user's address (e.g., username@domain) and
may include additional parameters.
- When a user agent registers with a SIP registrar server, it provides its SIP URI and current
network address (e.g., IP address).
- The registrar server updates its database with the user's SIP URI and address, allowing other
SIP entities to locate the user when needed.
- When a user initiates a SIP session with another user, the SIP proxy server queries the
registrar server to obtain the current address of the callee based on their SIP URI.
- The proxy server forwards the SIP request to the callee's current address, ensuring that the
session is delivered to the correct destination even if the user has moved or changed networks.

In summary, SIP enables the establishment and management of real-time communication


sessions over IP networks by providing a flexible and extensible signaling framework. Its
mechanism for tracking the callee ensures that communication sessions can be reliably
delivered to users, regardless of their current location or network configuration.

Q3.A. Explain flow control and error control mechanism of TFTP. Also explain out-of-band
signalling in TELNET.
Sure, let's break down each topic:

**Flow Control and Error Control Mechanism of TFTP (Trivial File Transfer Protocol):**

1. **Flow Control:**
- TFTP uses a simple form of flow control called "stop-and-wait."
- In stop-and-wait flow control, the sender (TFTP client) sends a data packet to the receiver
(TFTP server) and waits for an acknowledgment (ACK) before sending the next packet.
- The sender includes a sequence number in each data packet, allowing the receiver to
acknowledge the receipt of packets by sending back an ACK packet containing the sequence
number of the next expected packet.
- If the sender does not receive an ACK within a certain timeout period, it assumes that the
packet was lost or damaged and retransmits the packet.
2. **Error Control:**
- TFTP implements error control using two types of messages: ACK and error packets.
- If the receiver detects an error in a received packet (e.g., checksum error), it sends back an
error packet containing an error code and an error message.
- Upon receiving an error packet, the sender can take appropriate action, such as terminating
the transfer or retrying the transmission.

**Out-of-Band Signaling in TELNET (TELecommunication NETwork):**

1. **Definition:**
- Out-of-band signaling refers to the transmission of control information separate from the
main data stream.
- In the context of TELNET, out-of-band signaling is used to send special control characters,
known as Telnet control characters or Telnet commands, to the remote terminal.

2. **Use Cases:**
- Out-of-band signaling is used in TELNET for various purposes, including:
- Negotiating terminal parameters: TELNET uses out-of-band signaling to negotiate terminal
settings such as terminal type, character set, and terminal emulation mode between the client
and server.
- Sending Telnet commands: TELNET supports a set of Telnet commands that allow the client
to perform actions such as suspending or aborting the session, toggling echo mode, or
requesting remote assistance from the server.
- Handling special situations: Out-of-band signaling is also used to handle special situations
such as interrupting a command in progress or signaling the end of file transmission.

3. **Telnet Control Characters:**


- Telnet defines a set of control characters that are used for out-of-band signaling. Some
common Telnet control characters include:
- **IAC (Interpret as Command):** Indicates the beginning of a Telnet command sequence.
- **DONT, DO, WONT, WILL:** Used for negotiating terminal parameters and options
between the client and server.
- **AO (Abort Output), AYT (Are You There), IP (Interrupt Process):** Used for sending
control signals to the remote terminal.

In summary, flow control and error control mechanisms in TFTP ensure reliable file transfer over
unreliable networks, while out-of-band signaling in TELNET enables the transmission of control
information and special commands between the client and server during a remote terminal
session.

Q3.B. Draw and explain HTTP Query and Response message in detail.
Here's a basic representation of an HTTP request and response:

**HTTP Request Message:**

```
GET /index.html HTTP/1.1
Host: www.example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,
image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Accept-Language: en-US,en;q=0.9
Connection: keep-alive
```

Explanation of HTTP Request Message:


- **Request Line:** Begins with the HTTP method (GET), followed by the requested resource
(/index.html), and the HTTP version (HTTP/1.1).
- **Header Fields:** Additional information about the request, such as the Host header
specifying the domain, User-Agent identifying the client, Accept specifying the types of content
the client can accept, Accept-Language specifying the preferred language, and Connection
specifying whether the connection should be kept alive.

**HTTP Response Message:**

```
HTTP/1.1 200 OK
Date: Mon, 21 Mar 2022 15:45:00 GMT
Server: Apache/2.4.46 (Ubuntu)
Last-Modified: Fri, 18 Mar 2022 12:00:00 GMT
ETag: "10c8-5dbb48f770280"
Content-Type: text/html
Content-Length: 520
Connection: keep-alive

<!DOCTYPE html>
<html>
<head>
<title>Welcome to Example.com</title>
</head>
<body>
<h1>Hello, World!</h1>
<p>Welcome to Example.com</p>
</body>
</html>
```

Explanation of HTTP Response Message:


- **Status Line:** Begins with the HTTP version (HTTP/1.1), followed by the status code (200
OK) indicating a successful response, and a status message (OK).
- **Header Fields:** Additional metadata about the response, such as the Date specifying the
timestamp of the response, Server specifying the server software, Last-Modified specifying the
last modification date of the resource, ETag specifying a unique identifier for the resource,
Content-Type specifying the type of content (text/html in this case), Content-Length specifying
the size of the content in bytes, and Connection specifying whether the connection should be
kept alive.
- **Response Body:** Contains the actual content of the response, which in this case is an
HTML document with a welcome message.

In summary, an HTTP request message is sent by a client to request a resource from a server,
and an HTTP response message is sent by the server to provide the requested resource to the
client. Both messages consist of a header section containing metadata and an optional body
section containing the actual content.

Q3. C. Explain all the methods of streaming stored audio and video using media server and
RTSP.

Streaming stored audio and video using a media server and RTSP (Real-Time Streaming
Protocol) involves several methods or approaches to deliver multimedia content to clients over
a network. Here's an explanation of each method:

1. **Progressive Download:**
- In progressive download, the media file is hosted on a web server and accessed by clients
through HTTP.
- Clients download the media file in its entirety before playback begins.
- While downloading, clients can start playing the media file before it is fully downloaded, but
they cannot skip ahead until the entire file is downloaded.
- This method is simple to implement but may result in buffering or playback interruptions if
the network connection is slow or unreliable.

2. **HTTP Live Streaming (HLS):**


- HLS is a streaming protocol developed by Apple for delivering audio and video content over
HTTP.
- The media file is segmented into smaller chunks, typically between 2 to 10 seconds in
duration.
- A manifest file (usually in the form of an M3U8 playlist) is generated, containing URLs to
these segments.
- Clients download the manifest file and then request the individual segments using HTTP
range requests.
- HLS supports adaptive bitrate streaming, allowing clients to switch between different quality
levels based on network conditions.

3. **Dynamic Adaptive Streaming over HTTP (DASH):**


- DASH is an adaptive bitrate streaming protocol standardized by MPEG (Moving Picture
Experts Group).
- Similar to HLS, the media file is segmented into smaller chunks, and a manifest file (MPD -
Media Presentation Description) is generated.
- Clients download the MPD file and select the appropriate quality level based on network
conditions.
- DASH supports various features, including multiple audio and video tracks, subtitles, and
DRM (Digital Rights Management).

4. **RTSP (Real-Time Streaming Protocol):**


- RTSP is a network control protocol used for establishing and controlling media sessions
between clients and servers.
- In the context of streaming stored audio and video, RTSP is often used to control media
servers that stream media files stored on disk.
- Clients establish an RTSP session with the media server and issue RTSP commands to play,
pause, seek, and stop the media stream.
- RTSP can be used in conjunction with RTP (Real-Time Transport Protocol) for transmitting the
actual media data.

Each of these methods has its advantages and use cases, depending on factors such as network
conditions, client compatibility, and required features. Media servers can support multiple
streaming methods simultaneously to ensure compatibility with a wide range of client devices
and network environments.

You might also like