DCNS Unit 4
DCNS Unit 4
UNIT IV
TRANSPORT LAYER AND APPLICATION LAYER
Transport layer: Introduction — Transport Layer Protocols — Services — Port Numbers —
User Datagram Protocol — Transmission Control Protocol: Connection Management – Flow Control
– Congestion Control – Congestion avoidance (DEC bit, RED) Application layer: WWW and HTTP
— FTP — Email –Telnet –SSH — DNS — SNMP.
4.1 TRANSPORT LAYER: INTRODUCTION
The transport Layer is the second layer in the TCP/IP model and the fourth layer in the OSI
model.
It is an end-to-end layer used to deliver messages to a host.
It is termed an end-to-end layer because it provides a point-to-point connection rather than hop-
to-hop, between the source host and destination host to deliver the services reliably.
The unit of data encapsulation in the Transport Layer is a segment.
While Data Link Layer requires the MAC address of source-destination hosts to correctly deliver a
frame
and the Network layer requires the IP address for appropriate routing of packets, in a similar way
Transport Layer requires a Port number to correctly deliver the segments of data to the correct
process amongst the multiple processes running on a particular host.
A port number is a 16-bit address used to identify any client-server program uniquely.
TCP ensures the reliable delivery of messages and is used in various applications. UDP, on the other
hand, is a stateless and unreliable protocol that ensures best-effort delivery.
It is suitable for applications that have little concern with flow or error control and requires sending
the bulk of data like video conferencing.
It is often used in multicasting protocols.
Multiplexing (many to one) is when data is acquired from several processes from the sender and
merged into one packet along with headers and sent as a single packet.
Multiplexing allows the simultaneous use of different processes over a network that is running on a
host.
The processes are differentiated by their port numbers.
Similarly, Demultiplexing (one to many) is required at the receiver side when the message is
distributed into different processes.
Transport receives the segments of data from the network layer distributes and delivers it to the
appropriate process running on the receiver’s machine.
4. Congestion Control
Congestion is a situation in which too many sources over a network attempt to send data and the
router buffers start overflowing due to which loss of packets occurs.
As a result, the retransmission of packets from the sources increases the congestion further.
In this situation, the Transport layer provides Congestion Control in different ways.
2
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
It uses open-loop congestion control to prevent congestion and closed-loop congestion control to
remove the congestion in a network once it occurred.
TCP provides AIMD (Additive Increases Multiplicative Decrease) and leaky
bucket technique for congestion control.
The transport layer checks for errors in the messages coming from the application layer by using
error detection codes, and computing checksums, it checks whether the received data is not corrupted and
uses the ACK and NACK services to inform the sender if the data has arrived or not and checks for the
integrity of data.
6. Flow Control
The transport layer provides a flow control mechanism between the adjacent layers of the TCP/IP model.
TCP also prevents data loss due to a fast sender and slow receiver by imposing some flow control
techniques. It uses the method of sliding window protocol which is accomplished by the receiver by
sending a window back to the sender informing the size of data it can receive.
UDP Segment
While the TCP header can range from 20 to 60 bytes, the UDP header is a fixed, basic 8 bytes.
All required header information is contained in the first 8 bytes, with data making up the
remaining portion.
Because UDP port number fields are 16 bits long, the range of possible port numbers is defined as
0 to 65535, with port 0 being reserved.
UDP Format
Source Port: Source Port is a 2 Byte long field used to identify the port number of the source.
Destination Port: This 2-byte element is used to specify the packet’s destination port.
Length: The whole length of a UDP packet, including the data and header. The field has sixteen bits.
Cheksum: The checksum field is two bytes long. The data is padded with zero octets at the end (if
needed) to create a multiple of two octets. It is the 16-bit one’s complement of the one’s complement
sum of the UDP header, the pseudo-header containing information from the IP header, and the data.
Advantages of UDP
4
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
UDP also provides multicast and broadcast transmission of data.
UDP protocol is preferred more for small transactions such as DNS lookup.
It is a connectionless protocol, therefore there is no compulsion to have a connection-oriented
network.
UDP provides fast delivery of messages.
Disadvantages of UDP
In UDP protocol there is no guarantee that the packet is delivered.
UDP protocol suffers from worse packet loss.
UDP protocol has no congestion control mechanism.
UDP protocol does not provide the sequential transmission of data.
2. TCP
TCP stands for Transmission Control Protocol.
TCP protocol provides transport layer services to applications.
TCP protocol is a connection-oriented protocol.
A secured connection is being established between the sender and the receiver.
For a generation of a secured connection, a virtual circuit is generated between the sender and the
receiver.
The data transmitted by TCP protocol is in the form of continuous byte streams.
A unique sequence number is assigned to each byte. With the help of this unique number, a
positive acknowledgment is received from receipt.
If the acknowledgment is not received within a specific period the data is retransmitted to the
specified destination.
TCP Segment
A TCP segment’s header may have 20–60 bytes. The options take about 40 bytes. A header
consists of 20 bytes by default, although it can contain up to 60 bytes.
5
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
TCP Format
Source Port Address: The port address of the programme sending the data segment is stored in the
16-bit field known as the source port address.
Destination Port Address: The port address of the application running on the host receiving the data
segment is stored in the destination port address, a 16-bit field.
Sequence Number: The sequence number, or the byte number of the first byte sent in that specific
segment, is stored in a 32-bit field. At the receiving end, it is used to put the message back together
once it has been received out of sequence.
Acknowledgement Number: The acknowledgement number, or the byte number that the recipient
anticipates receiving next, is stored in a 32-bit field called the acknowledgement number. It serves as
a confirmation that the earlier bytes were successfully received.
Header Length (HLEN): This 4-bit field stores the number of 4-byte words in the TCP header,
indicating how long the header is. For example, if the header is 20 bytes (the minimum length of the
TCP header), this field will store 5 because 5 x 4 = 20, and if the header is 60 bytes (the maximum
length), it will store 15 because 15 x 4 = 60. As a result, this field’s value is always between 5 and 15.
Control flags: These are six 1-bit control bits that regulate flow control, method of transfer,
connection abortion, termination, and establishment. They serve the following purposes:
o Urgent: This pointer is legitimate
o ACK: The acknowledgement number (used in cumulative acknowledgement cases) is
valid.
o PSH: Push request
o RST: Restart the link.
o SYN: Sequence number synchronisation
o FIN: Cut off the communication
o Window size: This parameter provides the sender TCP’s window size in bytes.
Checksum: The checksum for error control is stored in this field. Unlike UDP, it is required for
TCP.
Urgent pointer: This field is used to point to data that must urgently reach the receiving process as
soon as possible. It is only valid if the URG control flag is set. To obtain the byte number of the final
urgent byte, the value of this field is appended to the sequence number.
6
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
7
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
Advantages of TCP
TCP supports multiple routing protocols.
TCP protocol operates independently of that of the operating system.
TCP protocol provides the features of error control and flow control.
TCP provides a connection-oriented protocol and provides the delivery of data.
Disadvantages of TCP
TCP protocol cannot be used for broadcast or multicast transmission.
TCP protocol has no block boundaries.
No clear separation is being offered by TCP protocol between its interface, services, and
protocols.
In TCP/IP replacement of protocol is difficult.
3. SCTP
Advantages of SCTP
SCTP provides a full duplex connection. It can send and receive the data simultaneously.
SCTP protocol possesses the properties of both TCP and UDP protocol.
SCTP protocol does not depend on the IP layer.
SCTP is a secure protocol.
Disadvantages of SCTP
To handle multiple streams simultaneously the applications need to be modified
8
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
accordingly.
The transport stack on the node needs to be changed for the SCTP protocol.
Modification is required in applications if SCTP is used instead of TCP or UDP protocol.
ICANN (Internet Corporation for Assigned Names and Numbers) has divided the
port numbers into three ranges:
Well-known ports
Registered
Ephemeral ports (Dynamic Ports)
WELL-KNOWN PORTS
These are permanent port numbers used by the servers. Range between 0 to 1023.
This port number cannot be chosen randomly.
These port numbers are universal port numbers for servers.
9
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
Every client process knows the well-known port number of the
corresponding server process.
For example, while the daytime client process, a well-known client
program, can use an ephemeral (temporary) port number, 52,000, to
identify itself, the daytime server process must use the well-known
(permanent) port number 13.
The client program defines itself with a port number, called the ephemeral port
number.
The word ephemeral means “short-lived” and is used because the life of a client is
normally short.
An ephemeral port number is recommended to be greater than 1023.
These port number ranges from 49,152 to 65,535 .
They are neither controlled nor registered. They can be used as temporary or
private port numbers.
REGISTERED PORTS: The ports ranging from 1024 to 49,151 are not assigned or controlled
10
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
11
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
1. Connection Establishment
Three-Way Handshake: The process of establishing a connection in TCP and other communication
protocols involves a three-way handshake:
1. SYN (Synchronize) The client sends a SYN packet to the server to initiate a connection. This packet
includes an initial sequence number (ISN) chosen by the client.
2. SYN-ACK (Synchronize-Acknowledge) The server responds with a SYN-ACK packet. The SYN part
contains the server's initial sequence number. The ACK part acknowledges the client's SYN packet by
incrementing the client's ISN by one.
3. ACK (Acknowledge) The client sends an ACK packet back to the server. This acknowledges the
server's SYN-ACK by incrementing the server's ISN by one.
After the three-way handshake, a connection is established, and data transfer can begin.
3. Connection Termination
Four-Way Handshake: The process of terminating a TCP connection involves a four-way handshake:
1. FIN (Finish) The client or server sends a FIN packet to terminate its side of the connection.
2. ACK (Acknowledge) The receiving end acknowledges the FIN packet with an ACK packet.
3. FIN (Finish) The receiver sends a FIN packet to close its side of the connection.
4. ACK (Acknowledge) The initiator of the termination acknowledges the receiver's FIN packet with an
ACK.
After these steps, the connection is fully terminated.
4. Resetting Connections
RST (Reset Command): A TCP connection can be reset using the RST packet, which immediately
terminates the connection. This is typically used to handle errors or when one side wants to abort the
connection abruptly.
12
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
This system allows document search and retrieval from any part of the Internet.
The documents were having Hypertext as the content
The units of information on the web can be referred to as pages, documents or resources.
A document can contain text, images, sound and video, together called Hypermedia.
Web is a vast collection of data, information, software and protocols, spread
across the world in web servers, which are accessed by client machines by
browsers through the Internet.
COMPONENTS OF THE WEB
13
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
Clients use browser application to send URL’s via HTTP to servers requesting
a Web page.
Web pages constructed using HTML /XML and consist of text, graphics,
sounds plus embedded files
Servers (or caches) respond with requested Web page.
Client’s browser renders Web page returned by server
Web Page is written using Hyper Text Markup Language (HTML)
Displays text, graphics and sound in browser
The entire system runs over standard networking protocols (TCP/IP, DNS)
WEB CLIENTS (BROWSERS)
A browser is a software on the client on the web which initiates the
communication with the server.
Each browser usually consists of three parts: a controller, client protocols, and
interpreters.
The controller receives input from the keyboard or the mouse and uses the
client programs to access the document. After the document has been accessed,
the controller uses one of the interpreters to display the document on the screen.
Examples are Internet Explorer, Mozilla FireFox, Netscape Navigator, Safari
etc.
WEB SERVERS
All the communication between the web client and a web server use the
standard protocol called as HTTP.
Web server informs its operating system to accept incoming network
connections using a specific port on the machine.
The server also runs as a background process.
A client (browser) opens a connection to the server, sends a request, receives
information from server and closes the connection.
Web server monitors a communications port on its host machine, accepts the
http commands through it and performs specified operations.
HTTP commands include a URL specifying the host machine.
The URL received is translated into either a filename or a program name,
accordingly the requested file or the output of the program execution is sent
back to the browser.
PROXY SERVER
A Proxy server is a computer that keeps copies of responses to recent requests.
The web client sends a request to the proxy server.
The proxy server checks its cache.
If the response is not stored in the cache, the proxy server sends the request to
the corresponding server.
14
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
Incoming responses are sent to the proxy server and stored for future requests
from other clients.
The proxy server reduces the load on the original server, decreases traffic, and
improves latency.
The URL defines four parts - Method, Host computer, Port, and Path.
o Method: The method is the protocol used to retrieve the document from a
server. For example, HTTP.
o Host: The host is the computer where the information is stored, and the
computer is given an alias name. Web pages are mainly stored in the computers
and the computers are given an alias name that begins with the characters
"www". This field is not mandatory.
o Port: The URL can also contain the port number of the server, but it's an
optional field. If the port number is included, then it must come between the
host and path and it should be separated from the host by a colon.
o Path: Path is the pathname of the file where the information is stored. The path
itself contain slashes that separate the directories from the subdirectories and
files.
WEB DOCUMENTS
Static Documents
Static documents are fixed-content documents that are created and stored in a
server.
15
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
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).
The HTTP protocol can be used to transfer the data in the form of plain text,
hypertext, audio, video, and so on.
HTTP is a stateless request/response protocol that governs client/server
communication.
HTTP is a text-oriented protocol. It contains embedded URL known as links.
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.
The HTTP protocol defines the format of the request and response messages.
Request Message: The request message is sent by the client that consists of a request line, headers, and
sometimes a body.
Response Message: The response message is sent by the server to the client that consists of a status line,
headers, and sometimes a body.
HTTP REQUEST MESSAGE
16
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
HTTP CONNECTIONS
NON-PERSISTENT CONNECTIONS
In a non-persistent connection, one
TCP connection is made for each
request/response.
Only one object can be sent over a
single TCP connection
The client opens a TCP connection
and sends a request.
The server sends the response and
closes the connection.
The client reads the data until it
encounters an end-of-file marker.
It then closes the connection.
PERSISTENT CONNECTIONS
HTTP version 1.1 specifies a persistent connection
by default.
Multiple objects can be sent over a single TCP
connection.
In a persistent connection, the server leaves the
connection open for more requests after sending a
response. 17
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
The server can close the connection at the request of a client or if a time-out has been
reached.
Time and resources are saved using persistent connections. Only one set of buffers
and variables needs to be set for the connection at each site.
The round trip time for connection establishment and connection termination is
saved.
Types of Cookies
1.Authentication cookies
These are the most common method used by web servers to know whether the user is
logged in or not, and which account they are logged in with. Without such a
mechanism, the site would not know whether to send a page containing sensitive
information, or require the user to authenticate themselves by logging in.
2.Tracking cookies
These are commonly used as ways to compile individuals browsing histories.
3.Session cookie
A session cookie exists only in temporary memory while the user navigates the website.
Web browsers normally delete session cookies when the user closes the browser.
4.Persistent cookie
Instead of expiring when the web browser is closed as session cookies do, a persistent
cookie expires at a specific date or after a specific length of time. This means that, for
the cookie's entire lifespan , its information will be transmitted to the server every time
the user visits the website that it belongs to, or every time the user views a resource
belonging to that website from another website.
HTTP SECURITY
File Transfer Protocol is said to be one of the earliest and also the most common forms of transferring
files on the internet.
Located in the application layer of the OSI model, FTP is a basic system that helps in transferring
files between a client and a server.
It is what makes the FTP unique that the system provides a reliable and efficient means of
transferring files from one system to another even if they have different file structures and operating
systems.
Types of FTP
There are different ways through which a server and a client do a file transfer using FTP. Some
of them are mentioned below:
Anonymous FTP: Anonymous FTP is enabled on some sites whose files are available for public
access. A user can access these files without having any username or password. Instead, the username
is set to anonymous, and the password is to the guest by default. Here, user access is very limited. For
example, the user can be allowed to copy the files but not to navigate through directories.
Password Protected FTP: This type of FTP is similar to the previous one, but the change in it is
the use of username and password.
FTP Secure (FTPS): It is also called as FTP Secure Sockets Layer (FTP SSL). It is a more secure
version of FTP data transfer. Whenever FTP connection is established, Transport Layer Security
(TLS) is enabled.
FTP over Explicit SSL/TLS (FTPES): FTPES helps by upgrading FTP Connection from port 21
to an encrypted connection.
Secure FTP (SFTP): SFTP is not a FTP Protocol, but it is a subset of Secure Shell Protocol, as it
works on port 22.
Advantages of FTP
Navigate Directories: Some commands include ls that is used to list directories and cd that is used
to change directories.
Transfer Files: File transfer may be done by using the commands such as get for downloading
files, and put for uploading files.
Manage Files: Make operations like deletion (Delete), renaming (Rename) as well as copying
(Copy) of files.
Close the Connection: Once file transfer has been accomplished, terminate the connection by
giving the bye or quit command.
FTP is a client server protocol that has two communication channel, command channel
for conversation control and data channel for file content. Here are steps mentioned in which FTP works:
A user has to log in to FTP Server first, there may be some servers where you can access to content
without login, known as anonymous FTP.
Client can start a conversation with server, upon requesting to download a file.
The user can start different functions like upload, delete, rename, copy files, etc. on server.
FTP can work on different modes like Active and Passive modes
Control Connection
Data Connection
Control Connection
For sending control information like user identification, password, commands to change the
remote directory, commands to retrieve and store files, etc., FTP makes use of a control connection. The
control connection is initiated on port number 21.
20
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
Data connection
For sending the actual file, FTP makes use of a data connection. A data connection is initiated on
port number 20.
FTP sends the control information out-of-band as it uses a separate control connection. Some
protocols send their request and response header lines and the data in the same TCP connection. For this
reason, they are said to send their control information in-band. HTTP and SMTP are such examples.
FTP Replies
Some of the FTP replies are:
200 – Command okay.
530 – Not logged in.
331 – User name okay, need a password.
221 – Service closing control connection.
551 – Requested action aborted: page type unknown.
502 – Command not implemented.
503 – Bad sequence of commands.
504 – Command not implemented for that parameter.
Advantages of FTP
File sharing also comes in the category of advantages of FTP in this between two machines files
can be shared on the network.
Speed is one of the main benefits of FTP.
Since we don’t have to finish every operation to obtain the entire file, it is more efficient.
Using the username and password, we must log in to the FTP server. As a result, FTP might be
considered more secure.
21
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
We can move the files back and forth via FTP. Let’s say you are the firm manager and you provide
information to every employee, and they all reply on the same server.
Disadvantages of FTP
File size limit is the drawback of FTP only 2 GB size files can be transferred.
More then one receivers are not supported by FTP.
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
22
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
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.
ADDRESS FORMAT OF EMAIL
E-mail address is userid @ domain where domain is hostname of the
mail server.
Email was extended in 1993 to carry many different types of data: audio,
video, images, Word documents, and so on.
23
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
Email Protocols
SMTP OPERATIONS
24
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
1 Connection Setup
An SMTP sender will attempt to set up a TCP connection with a target host
when it has one or more mail messages to deliver to that host.
The sequence is quite simple:
1. The sender opens a TCP connection with the receiver.
2. Once the connection is established, the receiver identifies itself
with "Service Ready”.
3. The sender identifies itself with the HELO command.
4. The receiver accepts the sender's identification with "OK".
5. If the mail service on the destination is unavailable, the destination
host returns a "Service Not Available" reply in step 2, and the process
is terminated.
2 Mail Transfer
Once a connection has been established, the SMTP sender may send one or
more messages to the SMTP receiver.
There are three logical phases to the transfer of a message:
1. A MAIL command identifies the originator of the message.
2. One or more RCPT commands identify the recipients for
this message.
3. A DATA command transfers the message text.
3 Connection Termination
The SMTP sender closes the connection in two steps.
First, the sender sends a QUIT command and waits for a reply.
The second step is to initiate a TCP close operation for the TCP connection.
The receiver initiates its TCP close after sending its reply to the QUIT
command.
25
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
26
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
There are seven different major types of content and a total of 14 subtypes.
27
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
MTA is a mail daemon (sendmail) active on hosts having mailbox, used to send an email.
Mail passes through a sequence of gateways before it reaches the recipient mail server.
Each gateway stores and forwards the mail using Simple mail transfer protocol (SMTP).
SMTP defines communication between MTAs over TCP on port 25.
In an SMTP session, sending MTA is client and receiver is server. In each exchange:
Client posts a command (HELO, MAIL, RCPT, DATA, QUIT, VRFY, etc.)
Server responds with a code (250, 550, 354, 221, 251 etc) and an explanation.
Client is identified using HELO command and verified by the server
Client forwards message to server, if server is willing to accept.
Message is terminated by a line with only single period (.) in it.
Eventually client terminates the connection.
28
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
IMAP allows multiple clients simultaneously connected to the same mailbox, and
through flags stored on the server, different clients accessing the same mailbox at the
same or different times can detect state changes made by other clients.
In other words, it permits a "client" email program to access remote message stores as if
they were local.
For example, email stored on an IMAP server can be manipulated from a desktop
computer at home, a workstation at the office, and a notebook computer while travelling,
without the need to transfer messages or files back and forth between these computers.
IMAP can support email serving in three modes:
Offline
Online
Users may connect to the server, look at what email is available, and access it
online. This looks to the user very much like having local spool files, but they’re
on the mail server.
Disconnected operation
A mail client connects to the server, can make a “cache” copy of selected
messages, and disconnects from the server. The user can then work on the
messages offline, and connect to the server later and resynchronize the server
status with the cache.
OPERATION OF IMAP
29
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
30
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
ADVANTAGES OF IMAP
With IMAP, the primary storage is on the server, not on the local machine.
Email being put away for storage can be foldered on local disk, or can be
foldered on the IMAP server.
The protocol allows full user of remote folders, including a remote
folder hierarchy and multiple inboxes.
It keeps track of explicit status of messages, and allows for user-defined status.
Supports new mail notification explicitly.
Extensible for non-email data, like netnews, document storage, etc.
Selective fetching of individual MIME body parts.
Server-based search to minimize data transfer.
Servers may have extensions that can be negotiated.
POP treats the mailbox as one store, and has no concept of folders.
POP works in two modes namely, delete and keep mode.
In delete mode, mail is deleted from the mailbox after retrieval. The delete
mode is normally used when the user is working at their permanent
computer and can save and organize the received mail after reading or
replying.
In keep mode, mail after reading is kept in mailbox for later retrieval. The
keep mode is normally used when the user accesses her mail away from
their primary computer.
POP3 client is installed on the recipient computer and POP server on the mail
server.
Client opens a connection to the server using TCP on port 110.
Client sends username and password to access mailbox and to retrieve
messages.
POP3 Commands
POP commands are generally abbreviated into codes of three or four letters
The following describes some of the POP commands:
1. UID - This command opens the connection
2. STAT - It is used to display number of messages currently in the mailbox
3. LIST - It is used to get the summary of messages
4. RETR -This command helps to select a mailbox to access the messages
5. DELE - It is used to delete a message
6. RSET - It is used to reset the session to its initial state
7. QUIT - It is used to log off the session
32
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
33
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
Local Login
Remote Logging
34
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
The characters cannot be passed directly to the operating system because the
remote operating system is not designed to receive characters from a TELNET
server; it is designed to receive characters from a terminal driver.
A piece of software called pseudoterminal driver, is added to this,which
pretends that the characters are coming from a terminal.
The operating system then passes the characters to the appropriate application
program.
TELENT OPTIONS
TELNET lets the client and server negotiate options before or during the use of
the service.
Options are extra features available to a user with a more sophisticated
terminal.
Users with simpler terminals can use default features.
TELENT COMMANDS
35
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
NVT Character Format
NVT uses two sets of characters, one for data and one for control.
For data, NVT normally uses what is called NVT ASCII. This is an 8-bit
character set in which the seven lowest order bits are the same as ASCII and the
highest order bit is 0.
To send control characters between computers , NVT uses an 8-bit character set
in which the highest order bit is set to 1.
Secure Shell (SSH) is a secure application program that can be used today for
several purposes such as remote logging and file transfer, it was originally
designed to replace TELNET.
There are two versions of SSH: SSH-1 and SSH-2, which are totally
incompatible. The first version, SSH-1, is now deprecated because of security
flaws in it.
SSH COMPONENTS
36
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
SSH APPLICATIONS
SSH is a general-purpose protocol that provides a secure connection between a client and
server.
The length field defines the length of the packet but does not include the
padding.
The Padding field is added to the packet to make the attack on the security
provision more difficult.
The type field designates the type of the packet used in different SSH
protocols.
The data field is the data transferred by the packet in different protocols.
The CRC field is used for error detection.
The FTP client can use the SSH client on the local site to make a secure
connection
with the SSH server on the remote site.
Any request from the FTP client to the FTP server is carried through the tunnel
provided by the SSH client and server.
Any response from the FTP server to the FTP client is also carried through the
tunnel provided by the SSH client and server.
38
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
WORKING OF DNS
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
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.
39
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
Each node in the tree has a label, which is a string with a maximum of 63
characters.
The root label is a null string (empty string). DNS requires that children of a
node (nodes that branch from the same node) have different labels, which
guarantees the uniqueness of the domain names.
Domai
n
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).
Generic Domains
The generic domains define registered hosts according to their generic
behavior.
Each node in the tree defines a domain, which is an index to the domain name
space database.
The first level in the generic domains section allows seven possible three
character levels.
41
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
Country Domains
The country domains section follows the same format as the generic domains
but uses two characters for country abbreviations
E.g.; in for India, us for United States etc) in place of the three character
organizational abbreviation at the first level.
Second level labels can be organizational, or they can be more specific,
national designation.
India for example, uses state abbreviations as a subdivision of the country
domain us. (e.g., ca.in.)
Inverse Domains
Mapping an address to a name is called Inverse domain.
The client can send an IP address to a server to be mapped to a domain name
and it is called PTR(Pointer) query.
To answer queries of this kind, DNS uses the inverse domain
42
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
DNS MESSAGES
DNS has two types of messages: query and response.
Both types have the same format.
The query message consists of a header and question section.
The response message consists of a header, question section, answer section,
authoritative section, and additional section .
Header
Both query and response messages have the same header format with
some fields set to zero for the query messages.
The header fields are as follows:
DNS SECURITY
DNS is one of the most important systems in the Internet infrastructure; it
provides crucial services to Internet users.
Applications such as Web access or e-mail are heavily dependent on the proper
operation of DNS.
DNS can be attacked in several ways including:
Attack on Confidentiality - The attacker may read the response of a DNS
server to find the nature or names of sites the user mostly accesses. This
type of information can be used to find the user’s profile. To prevent this
attack, DNS messages need to be confidential.
Attack on authentication and integrity - The attacker may intercept the
response of a DNS server and change it or create a totally new bogus
response to direct the user to the site or domain the attacker wishes the user
to access. This type of attack can be prevented using message origin
authentication and message integrity.
Attack on denial-of-service - The attacker may flood the DNS server to
overwhelm it or eventually crash it. This type of attack can be prevented
using the provision against denial-of-service attack.
To protect DNS, IETF has devised a technology named DNS Security
(DNSSEC) that provides message origin authentication and message integrity
using a security service called digital signature.
DNSSEC, however, does not provide confidentiality for the DNS messages.
There is no specific protection against the denial-of-service attack in the
specification of DNSSEC. However, the caching system protects the upper-
level servers against this attack to some extent.
44
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
SNMP MANAGER
A manager is a host that runs the SNMP client program
The manager has access to the values in the database kept by the agent.
A manager checks the agent by requesting the information that reflects the
behavior of the agent.
A manager also forces the agent to perform a certain function by resetting
values in the agent database.
For example, a router can store in appropriate variables the number of packets
received and forwarded.
The manager can fetch and compare the values of these two variables to see if
the router is congested or not.
SNMP AGENT
The agent is a router that runs the SNMP server program.
The agent is used to keep the information in a database while the manager is
used to access the values in the database.
For example, a router can store the appropriate variables such as a number of
packets received and forwarded while the manager can compare these variables
to determine whether the router is congested or not.
Agents can also contribute to the management process.
A server program on the agent checks the environment, if something goes
wrong, the agent sends a warning message to the manager.
45
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
The Management Information Base (MIB) is the second component used in network management.
Each agent has its own MIB, which is a collection of objects to be managed.
MIB classifies objects under groups.
MIB Variables
MIB variables are of two types namely simple and table.
Simple variables are accessed using group-id followed by variable-id and 0
Tables are ordered as column-row rules, i.e., column by column from top to
bottom. Only leaf elements are accessible in a table type.
46
23AD1502 DATA COMMUNICATION AND NETWORK SECURITY
SNMP is request/reply protocol that supports various operations using PDUs. SNMP defines eight types of
protocol data units (or PDUs):
1) GetRequest: The GetRequest PDU is sent from the manager (client) to the agent (server) to
retrieve the value of a variable or a set of variables.
2) GetNextRequest: The GetNextRequest PDU is sent from the manager to the agent to retrieve
the value of a variable.
3) GetBulkRequest: The GetBulkRequest PDU is sent from the manager to the agent to retrieve a
large amount of data. It can be used instead of multiple GetRequest and GetNextRequest PDUs.
4) SetRequest: The SetRequest PDU is sent from the manager to the agent to set (store) a
value in a variable.
5) Response:The Response PDU is sent from an agent to a manager in response to GetRequest or
6) GetNextRequest. It contains the value(s) of the variable(s) requested by the manager.
7) InformRequest: The InformRequest PDU is sent from one manager to another remote manager
to get the value of some variables from agents under the control of the remote manager. The
remote manager responds with a Response PDU.
8) Report: The Report PDU is designed to report some types of errors between managers.
Trap: The Trap PDU is sent from the agent to the manager to report an event. For example, if the agent is
rebooted, it informs the manager and reports the time of rebooting.
47