Networking Assignments
Networking Assignments
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.
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
◇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
☆SMTP simply defines how commands and responses must be sent back and forth.
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
◇The client POP3 software is installed on the recipient computer; the server POP3 software
-Mail access starts with the client when the user needs to download e-mail from the
It then sends its user name and password to access the mailbox. The user can then list
●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
- 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
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
FILE TRANSFER
☆Transferring files from one computer to another is one of the most common tasks
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) 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.
▪︎FTP uses two well-known TCP ports: Port 21 is used for the control connection,
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
☆ FTP uses the same approach as SMTP to communicate across the control connection. It
☆ 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.
☆ The Hypertext Transfer Protocol (HTTP) is a protocol used mainly to access data on
◇ 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.
☆ 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.
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
HEAD^( Requests information about a document but not the document itself)
CONNECT ^(Reserved)
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
-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,
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.
☆ 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
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
the agent.
2. A manager forces an agent to perform a task by resetting values in the agent database.
unusual situation.
Management Components
Information (SMI) and Management Information Base (MIB). In other words, management
on the Internet is done through the cooperation of the three protocols SNMP,
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
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
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
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
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
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.