0% found this document useful (0 votes)
3 views

Networking Assignments

Protocol

Uploaded by

wangariabe
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Networking Assignments

Protocol

Uploaded by

wangariabe
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Application Layer

Objectives

◇ The application layer enables the user, whether human or software, to access the net-work.

● It provides user interfaces and support for services such as electronic mail, file access and
transfer, access to system resources, surfing the world wide web, and net-work management.

☆The application layer is responsible for providing services to the user.

In this part, we briefly discuss some applications that are designed as a client/server

pair in the Internet. The client sends a request for a service to the server; the server

responds to the client.

SIMPLE MAIL TRANSFER PROTOCOL(SMTP)

◇The actual mail transfer is done through message transfer agents. 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 the
Simple Mail Transfer Protocol (SMTP).

☆As we said before, two pairs of MTA client/server Programs are used in the most common
situation (fourth scenario).

○SMTP is used two times, between the sender and the sender’s mail server and

Between the two mail servers. As we will see shortly, another protocol is needed

Between the mail server and the receiver.

☆SMTP simply defines how commands and responses must be sent back and forth.

-Each network is free to choose a software package for implementation.

Commands and Responses

SMTP uses commands and responses to transfer messages between an MTA client and

An MTA server .
Each command or reply is terminated by a two-character (carriage return and line feed)

End-of-line token.

Commands are sent from the client to the server. The fonnat of a command.

SMTP defines 14 commands. The first five are mandatory; every implementation must

Support these five commands. The next three are often used and highly recommended. The

Last six are seldom used.

POST OFFICE PROTOCOL(POP3)

☆Post Office Protocol, version 3 (POP3) is simple and limited in functionality.

◇The client POP3 software is installed on the recipient computer; the server POP3 software

is installed on the mail server.

-Mail access starts with the client when the user needs to download e-mail from the

mailbox on the mail server.

♧ The client opens a connection to the server on TCP port 110.

It then sends its user name and password to access the mailbox. The user can then list

and retrieve the mail messages, one by one.

●POP3 has two modes: the delete mode and the keep mode. In the delete mode, the

mail is deleted from the mailbox after each retrieval. In the keep mode, the mail

remains in the mailbox after retrieval.

- The delete mode is normally used when the user is working at her permanent computer and
can save and organize the received mail after reading or replying.

-The keep mode is normally used when the user accesses her mail away from her primary
computer (e.g., a laptop).

-The mail is read but kept in the system for later retrieval and organizing.
INTERNET MAIL ACCESS PROTOCOL(IMAP4)

☆Another mail access protocol is Internet Mail Access Protocol, version 4 (IMAP4).

IMAP4 is similar to POP3, but it has more features; IMAP4 is more powerful and more

Complex.

¤POP3 is deficient in several ways. It does not allow the user to organize her mail on

the server; the user cannot have different folders on the server. (Of course, the user can

create folders on her own computer.) In addition, POP3 does not allow the user to

partially check the contents of the mail before downloading.

IMAP4 provides the following extra functions:

o A user can check the e-mail header prior to downloading.

o A user can search the contents of the e-mail for a specific string of characters prior

to downloading.

o A user can partially download e-mail. This is especially useful if bandwidth is limited

and the e-mail contains multimedia with high bandwidth requirements.

o A user can create, delete, or rename mailboxes on the mail server.

o A user can create a hierarchy of mailboxes in a folder for e-mail storage

FILE TRANSFER

☆Transferring files from one computer to another is one of the most common tasks

expected from a networking or internetworking environment.

As a matter of fact, the greatest volume of data exchange in the Internet today is due to file
transfer. In this

section, we discuss one popular protocol involved in transferring files: File Transfer

Protocol (FTP).

File Transfer Protocol (FTP)

☆File Transfer Protocol (FTP) is the standard mechanism provided by TCP/IP for
copying a file from one host to another. Although transferring files from one system to

another seems simple and straightforward, some problems must be dealt with first. For

example, two systems may use different file name conventions. Two systems may have

different ways to represent text and data. Two systems may have different directory

structures. All these problems have been solved by FTP in a very simple and elegant

approach.

● FTP differs from other client/server applications in that it establishes two connections
between the hosts. One connection is used for data transfer, the other for control information
(commands and responses).

》Separation of commands and data transfer makes FTP more efficient. The control
connection uses very simple rules of communication.

》W/c need to transfer only a line of command or a line of response at a time. The

data connection, on the other hand, needs more complex rules due to the variety of data

types transferred. However, the difference in complexity is at the FTP level, not TCP.

For TCP, both connections are treated the same.

▪︎FTP uses two well-known TCP ports: Port 21 is used for the control connection,

and port 20 is used for the data connection.

-FTP uses the services of TCP. It needs two TCP connections.

The well-known port 21 is used for the control connection and the well-known port 20 for the
data connection.

-The control connection remains connected during the entire interactive FTP session.

-The data connection is opened and then closed for each file transferred.

-It opens each time commands that involve transferring files are used, and it closes when the
file is transferred. In other words, when a user starts an FTP session, the control connection

opens. While the control connection is open, the data connection can be opened and

closed multiple times if several files are transferred.


Communication over Control Connection

☆ FTP uses the same approach as SMTP to communicate across the control connection. It

uses the 7-bit ASCII character set.

Communication is achieved through commands and responses.

☆ This simple method is adequate for the control connection because we send one command
(or response) at a time. Each command or response is only one short line, so we need not
worry about file format or file structure.

- Each line is terminated with a two-character (carriage return and line feed) end-of-line

Token.

HYPERTEXT TRANSFER PROTOCOL(HTTP)

☆ The Hypertext Transfer Protocol (HTTP) is a protocol used mainly to access data on

the World Wide Web.

◇ HTTP functions as a combination of FTP and SMTP. It is similar to the SMTP because it
transfers files and uses the services of TCP. However, it is much simpler than FTP because it
uses only one TCP connection.

● There is no separate control connection; only data are transferred between the client and the
server.

□ HTTP is like SMTP because the data transferred between the client and the server look like
SMTP messages. In addition, the format of the messages is controlled by MIME-like headers.
Unlike SMTP, the HTTP messages are not destined to be read by humans; they are read and
interpreted by the HTTP server and HTTP client (browser).

》SMTP messages are stored and forwarded, but HTTP messages are delivered immediately. ○
The commands from the client to the server are embedded in a request message.

○ The contents of the requested file or other information are embedded in a response
message.

☆ HTTP uses the services of TCP on well-known port 80.


HTTP Transaction

☆ the HTTP transaction between the client and server. Although HTTP uses the services of
TCP, HTTP itself is a stateless protocol.

○ The client initializes the transaction by sending a request message. The server replies by
sending a response.

Messages

☆:The formats of the request and response messages are similar; A request message consists
of a request line, a header, and sometimes a body.

○A response message consists of a status line, a header, and sometimes a body.

o Request type:- This field is used in the request message. In version 1.1 of HTTP,

several request types are defined. The request type is categorized into methods as

defined.

Method Action

GET^( Requests a document from the server)

HEAD^( Requests information about a document but not the document itself)

POST^ (Sends some information from the client to the server)

PUT ^(Sends a document from the server to the client)

TRACE Echoes^( the incoming request)

CONNECT ^(Reserved)

OPTION ^(Inquires about available options).

◇ URL. We discussed the URL earlier in the chapter.

◇ Version. The most current version of HTTP is 1.1.

◇ Status code. This field is used in the response message.


■ The status code field is similar to those in the FTP and the SMTP protocols. It consists of
three digits.

Whereas the codes in the 100 range are only informational, the codes in the 200

range indicate a successful request. The codes in the 300 range redirect the client

to another URL, and the codes in the 400 range indicate an error at the client site.

Finally, the codes in the 500 range indicate an error at the server site. We list the

most common codes in Table 27.2.

o Status phrase. This field is used in the response message.

SIMPLE NETWORK MANAGEMENT PROTOCOL (SNMP)

☆The Simple Network Management Protocol (SNMP) is a framework for managing

devices in an internet using the TCP/IP protocol suite.

-It provides a set of fundamental operations for monitoring and maintaining an internet.

Concept

◇ SNMP uses the concept of manager and agent. That is, a manager, usually a host,

controls and monitors a set of agents, usually routers .

◇ SNMP is an application-level protocol in which a few manager stations control a

set of agents.

- The protocol is designed at the application level so that it can monitor devices made by
different manufacturers and installed on different physical networks. In other words, SNMP
frees management tasks from both the physical characteristics of the managed devices and
the underlying networking technology.

◇ It can be used in a heterogeneous internet made of different LANs and WANs connected by
routers made by different manufacturers.

Managers and Agents

☆ A management station, called a manager, is a host that runs the SNMP client program. A

managed station, called an agent, is a router (or a host) that runs the SNMP server program.
○ Management is achieved through simple interaction between a manager and an agent.

○ The agent keeps performance information in a database. The manager has access

to the values in the 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.

The manager can also make the router perform certain actions. For example, a router

periodically checks the value of a reboot counter to see when it should reboot itself.

It reboots itself,

for example, if the value of the counter is O. The manager can use this feature to reboot the
agent remotely at any time. It simply sends a packet to force a 0 value in the counter.

- Agents can also contribute to the management process. The server program running

on the agent can check the environment, and if it notices something unusual, it can send

a warning message, called a trap, to the manager.

In other words, management with SNMP is based on three basic ideas:

1. A manager checks an agent by requesting information that reflects the behavior of

the agent.

2. A manager forces an agent to perform a task by resetting values in the agent database.

3. An agent contributes to the management process by warning the manager of an

unusual situation.

Management Components

☆ To do management tasks, SNMP uses two other protocols: Structure of Management

Information (SMI) and Management Information Base (MIB). In other words, management
on the Internet is done through the cooperation of the three protocols SNMP,

SMI, and MIB,


REAL-TIME TRANSPORT Protocol (RTP)

Real-time Transport Protocol (RTP) is the protocol designed to handle real-time traffic

on the Internet. RTP does not have a delivery mechanism (multicasting, port numbers,

and so on); it must be used with UDP. RTP stands between UDP and the application

program. The main contributions of RTP are time-stamping, sequencing, and mixing

facilities.

o P. This I-bit field, if set to 1, indicates the presence of padding at the end of the

packet. In this case, the value of the last byte in the padding defines the length of

the padding. Padding is the norm if a packet is encrypted. There is no padding if

the value of the P field is O.

o X. This I-bit field, if set to 1, indicates an extra extension header between the

basic header and the data. There is no extra extension header if the value of this

field is O.

o Contributor count. This 4-bit field indicates the number of contributors. Note that

we can have a maximum of 15 contributors because a 4-bit field only allows a number
between 0 and 15.

o M. This I-bit field is a marker used by the application to indicate, for example, the

end of its data.

o Payload type. This 7-bit field indicates the type of the payload. Several payload

types have been defined so far. We list some common applications in Table 29.1.
A discussion of the types is beyond the scope of this book.

o Sequence number. This field is 16 bits in length. It is used to number the RTP

packets. The sequence number of the first packet is chosen randomly; it is incremented by 1
for each subsequent packet. The sequence number is used by the

receiver to detect lost or out-of-order packets.

o Timestamp. This is a 32-bit field that indicates the time relationship between

packets. The timestamp for the first packet is a random number. For each succeeding

packet, the value is the sum of the preceding timestamp plus the time the first byte

is produced (sampled). The value of the clock tick depends on the application. For

example, audio applications normally generate chunks of 160 bytes; the clock tick

for this application is 160. The timestamp for this application increases 160 for

each RTP packet.

o Synchronization source identifier. If there is only one source, this 32-bit field

defines the source. However, if there are several sources, the mixer is the synchronization
source and the other sources are contributors. The value of the source identifier

is a random number chosen by the source. The protocol provides a strategy in case of

conflict (two sources start with the same sequence number).

o Contributor identifier. Each of these 32-bit identifiers (a maximum of 15) defines

a source. When there is more than one source in a session, the mixer is the synchronization
source and the remaining sources are the contributors.

You might also like