CN Unit-1
CN Unit-1
CN Unit-1
Communication - Networks – Network Types – Protocol Layering – TCP/IP Protocol suite –OSI Model –
Introduction to Sockets - Application Layer protocols: HTTP – FTP – Email protocols (SMTP - POP3 - IMAP
- MIME) – DNS – SNMP
1. INTRODUCTION TO NETWORKS
* Write the parameters used to measure the network performance. (May/June 2016) (2)
* List the metrics that influence the performance of computer networks.
(Apr/May 2018)(2)
Data communications are the exchange of data between two devices via some form of
transmission medium such as a wire cable. For data communications to occur, the communicating devices
must be part of a communication system made up of a combination of hardware (physical equipment)
and software (programs). The effectiveness of a data communications system depends on four
fundamental characteristics: delivery, accuracy, timeliness, and jitter.
Delivery. The system must deliver data to the correct destination. Data must be received by the intended
device or user and only by that device or user.
Accuracy. The system must deliver the data accurately. Data that have been altered in transmission and
left uncorrected are unusable.
Timeliness. The system must deliver data in a timely manner. Data delivered late are useless. In the case
of video and audio, timely delivery means delivering data as they are produced, in the same order that
they are produced, and without significant delay. This kind of delivery is called real-time transmission.
Jitter. Jitter refers to the variation in the packet arrival time. It is the uneven delay in the delivery of audio
or video packets. For example, let us assume that video packets are sent every 30 ms. If some of the
packets arrive with 30-ms delay and others with 40-ms delay, an uneven quality in the video is the result.
1.1 Components
A data communications system has five components
Message: The message is the information (data) to be communicated. Popular forms of information
include text, numbers, pictures, audio, and video.
Sender: The sender is the device that sends the data message. It can be a computer, workstation,
telephone handset, video camera, and so on.
Receiver: The receiver is the device that receives the message. It can be a computer, workstation,
telephone handset, television, and so on.
Transmission medium: The transmission medium is the physical path by which a message travels
from sender to receiver. Some examples of transmission media include twisted-pair wire, coaxial
cable, fiber-optic cable, and radio waves.
Protocol. A protocol is a set of rules that govern data communications. It represents an agreement
between the communicating devices. Without a protocol, two devices may be connected but not
communicating. The Key elements of a Protocol are as follows,
● Syntax – It refers to the structure or format of data meaning the order in which they are
presented.
● Semantics – It refers to the meaning of each section of bit. How to do interpretation.
● Timing – When data should be sent and how fast they can be sent.
1.3 Simplex
In simplex mode, the communication is unidirectional, as on a one-way street. Only one of the
twodevices on a link can transmit; the other can only receive
Half-Duplex
In half-duplex mode, each station can both transmit and receive, but not at the same time.
When onedevice is sending, the other can only receive, and vice versa.
In full-duplex mode (also called duplex), both stations can transmit and receive simultaneously
1.4 Network Criteria
A network must be able to meet a certain number of criteria. The most important of
these are performance, reliability, andsecurity.
Performance is often evaluated by two networking metrics: throughput and delay.
Network reliability is measured by the frequency of failure, the time it takes a link
Network security issues include protecting data from unauthorized access, protecting data from
damage and development, and implementing policies and procedures for recovery from
breaches and data losses.
Multipoint
A multipoint (also called multidrop) connection is one in which more than two specific
devices share a single link
1.6 Network Topology
*Illustrate Network topology with neat diagram [13 ]
* What are the types of network topologies? [2 ]
● Network Topology refers to the physical layout or geographical orientation and the
arrangement of various elements like links, nodes etc.
● The various topologies are Bus topology, Ring topology, Star topology, Mesh Topology
and Tree Topology.
Bus Topology
Bus topology is a network type in which every computer and network device is connected to
single cable. When it has exactly two endpoints, then it is called Linear Bus topology.
MESH Topology
It is a point-to-point connection to other nodes or devices. All the network nodes are connected
to each other. Mesh has n(n-1)/2 physical channels to link n devices.
Features of Mesh Topology
Fully connected.
Robust.
Not flexible.
HYBRID Topology
It is two different types of topologies which is a mixture of two or more topologies. For example
if in an office in one department ring topology is used and in another star topology is used, connecting
these topologies will result in Hybrid Topology (ring topology and star topology).
2. NETWORKS TYPES
*Differentiate the protocol layering of TCP/IP protocol suite and OSI model. Explain
both with the diagram.(NOV/DEC 2021)(13)
A protocol is a set of rules and standards that primarily outline a language that devices will use to
communicate. There are an excellent range of protocols in use extensively in networking, and that they
are usually implemented in numerous layers.
It provides a communication service where the process is used to exchange the messages. When the
communication is simple, we can use only one simple protocol.
When the communication is complex, we must divide the task between different layers, so, we need to
follow a protocol at each layer, this technique we used to call protocol layering. This layering allows us
to separate the services from the implementation.
Each layer needs to receive a set of services from the lower layer and to give the services to the upper
layer. The modification done in any one layer will not affect the other layers.
Reasons
The reasons for using layered protocols are explained below −
Layering of protocols provides well-defined interfaces between the layers, so that a change in
one layer does not affect an adjacent layer.
The protocols of a network are extremely complicated and designing them in layers makes their
implementation more feasible.
Advantages
The advantages of layered protocols are as follows −
Assists in protocol style, as a result of protocols that operate at a particular layer have outlined
information that they work and a defined interface to the layers on top of and below.
Foster’s competition because products from completely different vendors will work along.
Prevents technology or capability changes in one layer from touching different layers above and
below.
Provides a typical language to explain networking functions and capabilities.
Disadvantages
The disadvantages of layered protocols are as follows −
The main disadvantages of layered systems consist primarily of overhead each in computation
and in message headers caused by the abstraction barriers between layers. Because a message
typically should pass through several (10 or more) protocol layers the overhead of those
boundaries is commonly more than the computation being done.
The upper-level layers cannot see what is within the lower layers, implying that an application
cannot correct where in an exceedingly connection a problem is or precisely what the matter is.
The higher-level layers cannot control all aspects of the lower layers, so that they cannot modify
the transfer system if helpful (like controlling windowing, header compression,
CRC/parity checking, et cetera), nor specify routing, and should rely on the lower protocols
operating, and cannot specify alternatives when there are issues.
*Differentiate the protocol layering of TCP/IP protocol suite and OSI model. Explain both
with the diagram.(NOV/DEC 2021)(13)
Application Layer
● An application layer is the topmost layer in the TCP/IP model.
● It is responsible for handling high-level protocols, issues of representation.
● This layer allows the user to interact with the application.
● When one application layer protocol wants to communicate with another application layer, it
forwards its data to the transport layer
● There is an ambiguity occurs in the application layer. Every application cannot be placed
inside the application layer except those who interact with the communication
system. For example: text editor cannot be considered in application layer while web browser
using HTTP protocol to interact with the network where HTTP protocol is an application layer
protocol.
5. OSI MODEL
* Write a neat sketch, explain the architecture of an OSI seven layer model (NOV/DEC 2017)(13)
* Draw the ISO-OSI architecture and outline the functions performed by each layer (NOV/Dec
2019) (13)
* What is the use of data link layer in OSI? (NOV/DEC 2015)(13)
*Define Flow control(May/June 2016)(2)
*Justify the need for layer five in the OSI model.(NOV/DEC 2021)(2 )
*What is the need for another checking mechanism at the transport layer even though the data
link layer is capable of detecting the errors between the hops (NOV/DEC 2020)(13)
*What are the layers of the ISO/OSI protocol stack? Briefly list out their functions.
(NOV/DEC 2020)(13)
*What are the layers of the ISO/OSI protocol stack? Briefly list out their functions.(APR/MAY
2021)(13)
*How are the subgroups of OSI model layers segregated by their functions?
(APR/MAY 2020)(2)
● OSI stands for Open System Interconnection is a reference model that describes how
information from a software application in one computer moves through a physical medium to
the software application in another computer.
● OSI consists of seven layers, and each layer performs a particular network function.
● OSI model was developed by the International Organization for Standardization (ISO) in 1984,
and it is now considered as an architectural model for the inter-computer communications.
● OSI model divides the whole task into seven smaller and manageable tasks. Each layer is
assigned a particular task.
● Each layer is self-contained, so that task assigned to each layer can
be performed independently.
Physical Layer
The main functionality of the physical layer is to transmit the individual bits from
one node to another node.
It is the lowest layer of the OSI model.
It establishes, maintains and deactivates the physical connection.
It specifies the mechanical, electrical and procedural network interface specifications.
Data-Link Layer
This layer is responsible for the error-free transfer of data frames.
It defines the format of the data on the network.
It provides a reliable and efficient communication between two or more devices.
It is mainly responsible for the unique identification of each device that
resides on a local network.
*List out the functions of the Data Link Layer(Apr/May
2021)(2)
Network Layer
It is a layer 3 that manages device addressing, tracks the location of devices on the network.
It determines the best path to move data from source to the destination based on the network
conditions, the priority of service, and otherfactors.
The Data link layer is responsible for routing and forwarding the packets.
Routers are the layer 3 devices, they are specified in this layer and used to provide the routing
services within an internetwork.
The protocols used to route the network traffic are known as Network layer protocols.
Examples of protocols are IP and Ipv6
Functions of Network Layer:
Addressing: A Network layer adds the source and destination address to the header of the
frame. Addressing is used to identify the device on the internet.
Routing: Routing is the major component of the network layer, and it determines the best
optimal path out of the multiple paths from source to the destination.
Transport Layer
The Transport layer is a Layer 4 ensures that messages are transmitted in the order in which
they are sent and there is no duplication of data.
The main responsibility of the transport layer is to transfer the data completely.
It receives the data from the upper layer and converts them into smaller units known
assignments.
This layer can be termed as an end-to-end layer as it provides a point-to-point
connection between source and destination to deliver the data reliably.
Session Layer
It is a layer 3 in the OSI model.
The Session layer is used to establish, maintain and synchronizes the interaction between
communicating devices.
Functions of Session layer:
Dialog control: Session layer acts as a dialog controller that creates a dialog between two
processes or we can say that it allows the communication between two processes which can be
either half-duplex or full-duplex.
Synchronization: Session layer adds some checkpoints when transmitting the data in a
sequence. If some error occurs in the middle of the transmission of data, then the transmission
will take place again from the checkpoint. This process is known as Synchronization and
recovery.
Presentation Layer
A Presentation layer is mainly concerned with the syntax and semantics of the
information exchanged between the two systems.
It acts as a data translator for a network.
This layer is a part of the operating system that converts the data from one presentation
format to another format.
The Presentation layer is also known as the syntax layer.
consider a point to point link 2km in length at what bandwidth would propagation delay(at
speed of 2X108 m/sec equal transmit delay for 100 byte packet? What about512 byte
packet.
= 80 X 106 bps
= 80 Mbps
o for 512 byte packet
Bandwidth = size / transmit
= 4872 x 10 -3 bits
= 4872/1000
= 4.873 which is approximately 5 bits
3. Suppose a 128 Kbps point to point link is set up between earth and a river on mars.
Thedistance from earth to mars is approximately 55Gm and data travels over the link
at speed of light 3 X 10 8m/se.
a. Calculate the minimum RTT for the link
b. Calculate the delay X bandwidth product.
c. A camera on the river takes a picture of its surroundings and sends those
to earth. How quickly after a picture is taken can it reach missioncontrol;
on earth? Assume that each image is 5 MB in size.
1. Suppose a 100 Mbps point to point link is being set up between earth and a new lunar colony. The
distance from moon to earth is approximately 3,85,000 kms and data travels over the link at the speed
of light 3 X 108 m/sec.
a. Calculate the minimum RTT for the link.
b. Using the RTT as the delay, calculate the delay X bandwidth product for thelink.
c. A camera on the lunar base takes pictures of earth and saves them in digital format disk.
Suppose mission control on earth wishes to download most currentimage, which is 25MB.
What is the minimum amount of time that will elapse between when the request for the data
goes out and the transfer finished?
2. For a wireless LAN of 54 Mbps bandwidth and 0.33 µs Round trip delay find the delayx
bandwidth product.
The HyperText Transfer Protocol (HTTP) is used to define how the client-server programs can be written to retrieve
web pages from the Web. An HTTP client sends a request; an HTTP server returns a response. The server uses the port
number 80; the client uses a temporary port number. HTTP uses the services of TCP.
Nonpersistent versus Persistent Connections
If the web pages, objects to be retrieved, are located on different servers, we do not have any other choice than
to create a new TCP connection for retrieving each object. However, if some of the objects are located on the same
server, we have two choices: to retrieve each object using a new TCP connection or to make a TCP connection and
retrieve them all. The first method is referred to as a nonpersistent connection, the second as a persistent connection.
HTTP, prior to version 1.1, specified nonpersistent connections, while persistent connections are the default in version
1.1, but it can be changed by the user.
Nonpersistent Connections
In a nonpersistent connection, one TCP connection is made for each request/response.
Thefollowing lists the steps in this strategy:
1. The client opens a TCP connection and sends arequest.
2. The server sends the response and closes the connection.
3. The client reads the data until it encounters an end-of-file marker; it then closes the connection. In this
strategy, if a file contains links to N different pictures in different files (all located on the same server), the connection
must beopened and closed N 1 time. The nonpersistent strategy imposes high overhead on the server because the
server needs N 1 different buffer each time a connection is opened. Persistent Connections HTTP version 1.1 specifies
a persistent connection by default. In a persistent connection, the server leaves the connection open for more requests
after sending a response. The server can close the connection at the request of a client or if a time -out has been
reached. The sender usually sends the length of the data with each res ponse.
However, there are some occasions when the sender does not knowthe length of the data. This is the case when
a document is created dynamically or actively. In these cases, the server informs the client that the length is not known
and closes the connection after sending the data so the client knows that the end of the data hasbeen 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.
Message Formats The HTTP protocol defines the format of the request and response messages, as shown in Figure
below. We have put the two formats next to each other for comparison. Each message is made of four sections. The
first section in the request message is called the request line; the first section in the response message is called the
status line. The other three sections have the same names in the request and response messages.
Request Message
As we said before, the first line in a request message is called a request line.
There are three fields in this line separated by one space and terminated by two characters (carriage return and line
feed) as shown in Figure above.
The fields are called method, URL, and version.
The method field defines the request types.
In version 1.1 of HTTP, several methods are defined, as shown in Table. Most of the time, the client uses the
GET method to send a request. In this case, the body of the message is empty.
The HEAD method is used when the client needs only some information about the web page from the server,
such as the last time it was modified. It can also be used to test the validity of a URL. The response message in this case
has only the header section; the body section is empty.
The PUT method is theinverse of the GET method; it allows the client to post a new web page on the server (if
permitted). The POST method is similar to the PUT method, but it is used to send some information to the server to be
added to the web page or to modify the web page.
The TRACEmethod is used for debugging; the client asks the server to echo back the request to check whether
the server is getting the requests.
The DELETE method allows the client to delete a web page on the server if the client has permission to do so.
The CONNECT methodwas originally made as a reserve method; it may be used by proxy servers, as discussed later.
Finally, the OPTIONS method allows the client to ask about the properties of a web page. The second field, URL, was
discussed earlier in the chapter. It defines the address and name of the corresponding web page. The third field,
version, gives the version of the protocol; the most current version of HTTP is 1.1
After the request line, we can have zero or more request header lines. Each header line sends additional information
from the client to the server. For example, the client can request that the document be sent in a special format. Each
header line has a header name, a colon, a space, and a header value as shown in Figure. Table below shows some
header names commonly used ina request. The value field defines the values associated with each header name. The
list of values can be found in the corresponding RFCs. The body can be present in a request message. Usually, it contains
the comment to be sent or the file to be published on the website when the method is PUT or POST.
Response Message
The format of the response message is also shown in Figure . A response message consists of a status line, header lines,
a blank line,and sometimes a body.
The first line in a response message is called the status line.
There are three fields in this line separated by spaces and terminated by a carriage return and line feed.
The first field defines the version of HTTP protocol, currently 1.1.
The statuscode field defines the status of the request. 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 the400 range indicate an error at the client site. Finally, the codes
in the 500 range indicate an error at the server site.
The status phrase explains the status code in text form. After the status line, we can have zero or more response
header lines. Each header line sends additional information from the server to the client. For example, the sender can
send extra information about the document. Each header line has a header name, a colon, a space, and a header value.
The body contains the document to be sent from the server to the client. The body is present unless the response is an
error message.
Cookies
The World Wide Web was originally designed as a stateless entity. A client sends a request; a server responds. Their
relationship is over. The original purpose of the Web, retrieving publicly available documents, exactly fits this design.
Today the Web has other functions that need to remember some information about the clients; some are listed below:
❑ Websites are being used as electronic stores that allowusers to browse through the store, select wanted items, put
them in anelectronic cart, and pay at the end with a credit card.
❑ Some websites need to allow access to registered clients only.
❑ Some websites are used as portals: the user selects the web pages he wants to see.
❑ Some websites are just advertising agencies. For these purposes, the cookie mechanism was devised.
Creating and Storing Cookies The creation and storing of cookies depend on the implementation; however, the
principle is the same.
1. When a server receives a request from a client, it stores information about the client in a file or a string. The
information may include the domain name of the client, the contents of the cookie (information the server has gathered
about the client such as name,registration number, and so on), a timestamp, and other information depending on the
implementation.
2. The server includes the cookie in the response that it sends to the client.
3. When the client receives the response, the browser stores the cookie in the cookie directory, which is sorted by the
server domainname. Using Cookies When a client sends a request to a server, the browser looks in the cookie directory
to see if it can find a cookie sent by that server. If found, the cookie is included in the request. When the server receives
the request, it knows that this is an old client, not a new one. Note that the contents of the cookie are never read by the
browser or disclosed to the user. It is a cookie made by the server and eatenby the server.
❑ An electronic store (e-commerce) can use a cookie for its client shoppers. When a client selects an item and inserts
it in a cart, a cookie that contains information about the item, such as its number and unit price, is sent to the browser.
Ifthe client selects a second item, the cookie is updated with the new selection information, and so on. When the client
finishes shopping and wants to check out, the last cookie is retrieved and the total charge is calculated.
❑ The site that restricts access to registered clients only sends a cookie to the client when the client registers for the
first time. For any repeated access, only those clients that send theappropriate cookie are allowed.
❑ A web portal uses the cookie in a similarway. When a user selects her favorite pages, a cookie is made and sent. Ifthe
site is accessed again, the cookie is sent to the server to show what the client is looking for. ❑ A cookie is also used by
advertising agencies. An advertising agency can place banner ads on some main website that is often visited by users.
The advertising agency supplies only a URL that gives the advertisingagency’s address instead of the banner itself.
When a user visits the main website and clicks the icon of a corporation, a request is sent to the advertising agency.
The advertising agency sends the requested banner, but it also includes a cookie with the ID of the user.
FTP
File Transfer Protocol (FTP) is the standard protocol 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 data. Two systems may have different directory structures. All of
these problems have been solved by FTP in a very simple and elegant approach. Although we can transfer files using
HTTP, FTP is a better choice to transfer large files or to transfer files using different formats.
The server has two components: .the server control process and the server data transfer process.
The data connection is made between the data transfer processes. Separation of commands and data transfer makes
FTP more efficient.
The control connection uses very simple rules of communication. We need to transfer only a line of command or a
lineof response at a time.
The data connection, on the other hand, needs more complex rules due to the variety of data types transferred.
Two Connections
The control connection remains connected during the entire interactive FTP session. The data connection is opened
and then closed for each file transfer activity. 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 aretransferred. FTP uses two well-known TCP ports: port 21 is used for the control connection, and port 20 is
used for the data connection.
Control Connection
For control communication, FTP uses the same approach as TELNET (discussed later). It uses the NVT ASCII character
set as used by TELNET. 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 line is terminated with a two-
character (carriage return and line feed) end- of-line token. During this control connection, commands are sent from
the client to the server and responses are sent from the server to the client. Commands, which are sent from the FTP
client control process, are in the form ofASCII uppercase, which may or may not be followed by an argument.
Every FTP command generates at least one response. A response has two parts: a three-digit number followed by text.
The numeric part defines the code; the text part defines needed parameters or further explanation s. The first digit
defines the status of the command. The second digit defines the area in which the status applies. The third digit
provides additional information. The below table show some common responses.
File Type FTP can transfer one of the following file types across the data connection: ASCII file, EBCDIC file, or image
file.
Data Structure FTP can transfer a file across the data connection using one of the following interpretations of the
structure of the data: file structure, record structure, or page structure. The file structure format (used by default) has
no structure. It is a continuous stream of bytes. In therecord structure, the file is divided into records. This can be used
only with text files. In the page structure, the file is divided intopages, with each page having a page number and a page
header. The pages can be stored and accessed randomly or sequentially.
Transmission Mode
FTP can transfer a file across the data connection using one of the following three transmission modes: stream mode,
block mode, or compressed mode. The stream mode is the default mode; data are delivered from FTP to TCP as a
continuous stream of bytes. In the block mode, data can be delivered from FTP to TCP in blocks. In this case, each block
is preceded by a 3-byte header. The first byte is called the block descriptor; the next two bytes define the size of the
block in bytes.
File Transfer File transfer occurs over the data connection under the control of the commands sent over the control
connection. However, we should remember that file transfer in FTP means one of three things: retrieving a file (server
to client), storing a file (client to server), and directory listing (server to client). Figure below shows an example of
using FTP for retrieving a file. The figure shows onlyone file to be transferred. The control connection remains open
all the time, but the data connection is opened and closed repeatedly.
We assume the file is transferred in six sections. After all records have been transferred, the server control process
announces that the file transfer is done. Since the client control process has no file to retrieve, it issues the QUIT
command, which causes the service connection to be closed.
ELECTRONIC MAIL
When the request arrives, the server provides the service. There is a request and there is a response. In the case of
electronic mail, the situation is different. First, e-mail is considered a one-way transaction.
When Alice sends an email to Bob, she may expect a response, but this is not a mandate. Bob may or may not respond.
If he does respond, it is another one- way transaction. Second, it is neither feasible nor logical for Bob to run a server
program and wait until someone sends an e-mail to him.
Bob may turn off his computer when he is not using it. This means that the idea of client/server programming should
be implemented in another way: using some intermediate computers (servers).
Architecture
To explain the architecture of e-mail, we give a common scenario, as shown in Figure below. Another possibility is the
case in which Alice or Bob is directly connected to the corresponding mail server, in which LAN or WAN connection is
not required.
In the common scenario, the sender and the receiver of the e-mail, Alice and Bob respectively, are connected via a LAN
or a WAN to two mail servers. The administrator has created one mailbox for each user where the received messages
are stored. A mailbox is part of a server hard drive, a special file with permission restrictions.
Only the owner of the mailbox has access to it. The administrator has also created a queue (spool) to store messages
waiting to be sent. A simple e-mail from Alice to Bob takes nine different steps, as shown in the figure. Alice and Bob
use three different agents: a user agent (UA), a message transfer agent (MTA), and a message access agent (MAA).
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. The electronic mail system needs
two UAs, two pairs of MTAs (client and server), and a pair of MAAs (client andserver).
User Agent
The first component of an electronic mail system is the user agent (UA). It provides service to the user to make
the process of sending and receiving a message easier. A user agent is a software package (program) that composes,
reads, replies to, and forwards messages. It also handles local mailboxes on the user computers.
There are two types of user agents: command-driven and GUI-based. Command driven user agents belong to
the early days of electronic mail. They are still present as the underlying user agents. A command-driven user agent
normally accepts a one character command from the keyboard to perform its task.
For example, a user can type the characterr, at the command prompt, to reply to the sender of the message, or
type the character R to reply to the sender and all recipients. Some examples of command driven user agents are mail,
pine, and elm. Modern user agents are GUI-based. They contain graphical user interface (GUI) components that allow
the user to interact with the software by using both the keyboard and the mouse. They have graphical components
such as icons, menu bars, and windows that make the services easy to access. Some examples of GUI-based user agents
are Eudora and Outlook.
Sending Mail
To send mail, the user, through the UA, creates mail that looks very similar to postal mail. It has an envelope and a
message. The envelope usually contains the sender address, the receiver address, and other information. The message
contains the header and the body. The header of the message defines the sender, the receiver, the subject of the
message, and some other information. The body of the message contains the actual information to be read by the
recipient. The format of mail is given below:
Receiving Mail
The user agent is triggered by the user (or a timer). If a user has mail, the UA informs the user with a notice. If
the user is ready to read the mail, a list is displayed in which each line contains a summary of the information about a
particular mess age in the mailbox.
The summary usually includes the sender mail address, the subject, and the time the mail was sent or received.
The user can select any ofthe messages and display its contents on the screen.
Addresses
To deliver mail, a mail handling system must use an addressing system with unique addresses. In the Internet, the
address consistsof two parts: a local part and a domain name, separated by an @ sign
The formal protocol that defines the MTA client and server in the Internet is called Simple Mail Transfer Protocol
(SMTP). 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 backand forth.
Commands
Commands are sent from the client to the server. The format of a command is shown below: Keyword: argument(s) It
consists of a keyword followed by zero or more arguments. SMTP defines 14 commands, listed in Table
Responses Responses are sent from the server to the client. A response is a three-digit code that may be followed by
additional textual information. Table below shows the most common response types
After connection has been established between the SMTP client and server, a single message between a sender and
one or more recipients can be exchanged. This phase involves eight steps. Steps 3 and 4 are repeated if there is more
than one recipient.
1. The client sends the MAIL FROM message to introduce the sender of the message. It includes the mail address of the
sender (mailbox and the domain name). This step is needed to give the server the return mail address for returning
errors and reporting messages.
2. The server responds with code 250 or some other appropriate code.
3. The client sends the RCPT TO (recipient) message, which includes the mail address of the recipient.
4.The server responds with code 250 or some other appropriate code.
5. The client sends the DATA message to initialize the message transfer.
6. The server responds with code 354 (start mail input) or some other appropriate message.
7. The client sends the contents of the message in consecutive lines. Each line is terminated by a two-character end-
of-line token(carriage return and line feed). The message is terminated by a line containing just one period.
8. The server responds with code 250 (OK) or some other appropriate code.
Connection Termination
After the message is transferred successfully, the client terminates the connection.
This phaseinvolves two steps.
1. The client sends the QUIT command.
2. The server responds with code 221 or some other appropriate code.
Message Access Agent:
POP and IMAP The first and second stages of mail delivery use SMTP. However, SMTP is not involved in the third stage
because SMTP is a push protocol; it pushes the message from the client to the server. In other words, the direction of
the bulk data (messages) is from the client to the server. On the other hand, the third stage needs a pull protocol; the
client must pull messages from the server.
The direction of the bulk data is from the server to the client. The third stage uses a message access agent.
Currently two message access protocols are available:
POST OFFICE PROTOCOL, VERSION 3 (POP3) AND INTERNET MAIL ACCESS PROTOCOL, VERSION 4 (IMAP4).
POP3
Post Office Protocol, version 3 (POP3) is simple but 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 its 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 (for
example, from a laptop). The mail is read but kept in the system for later retrieval and organizing.
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. In addition,
POP3 does not allow the user to partially check the contents of the mail before downloading.
IMAP4 provides the following extra functions:
MIME
Electronic mail has a simple structure. Its simplicity, however, comes with a price. It can send messages only in NVT
7-bit ASCIIformat. In other words, it has some limitations. It cannot be used for languages other than English (such as
French, German, Hebrew, Russian, Chinese, and Japanese). Also, it cannot be used to send binary files or video or audio
data.
Multipurpose Internet Mail Extensions (MIME) is a supplementary protocol that allows non-ASCII data to be sent
through e-mail. MIME transforms non-ASCII data at the sender site to NVT ASCII data and delivers it to the client MTA
to be sent through the Internet. The message at the receiving site is transformed back to the original data. We can think
of MIME as a set of software functions that transforms non-ASCII data to ASCII data and vice versa, as shown in Figure.
MIME Headers MIME defines five headers, as shown in Figure which can be added to the original email header section
to define the transformationparameters.
MIME-Version This header defines the version of MIME used. The current version is 1.1.
Content-Type This header defines the type of data used in the body of the message. The content type and the content
subtype areseparated by a slash. Depending on the subtype, the header may contain other parameters. MIME allows
seven different types of data, listed in Table
Content-Transfer-Encoding This header defines the method used to encode the messages into 0s and 1s for
transport. The five types of encoding methods are listed in Table. The last two encoding methods are interesting. In
the Base64 encoding, data, as a string of bits, is first divided into 6-bit chunks as shown in Figure
DOMAIN NAME SYSTEM (DNS)
* Briefly explain the Domain Name Service protocol with an example (13)
The last client-server application program we discuss has been designed to help other application programs.
To identify an entity, TCP/IP protocols use the IP address, which uniquely identifies the connection of a host to the
Internet. However, people prefer to use names instead of numeric addresses.
Therefore, the Internet needs to have a directory system that can map a name to an address. This isanalogous
to the telephone network. A telephone network is designed to use telephone numbers, not names. People can either
keep a private file to map a name to the corresponding telephone number or can call the telephone directory to do so.
We discuss how this directory system in the Internet can map names to IP addresses. Since the Internet is so huge
today, a central directory system cannot hold all the mapping. In addition, if the central computer fails, the whole
communication network will collapse.
A better solution is to distribute the information among many computers in the world.
In this method, the host that needs mapping can contact the closest computer holding the needed information. This
method is used by the Domain Name System (DNS).
Figure below shows how TCP/IP uses a DNS client and a DNS server to map a name to an address. A user wants to use
a file transfer client to access the corresponding file transfer server running on a remote host. The user knows only
the file transfer server name, such as afilesource.com. However, the TCP/IP suite needs the IP address of the file
transfer server to make the connection.
The following six steps map the host name to an IP address:
1. The user passes the host name to the file transfer client.
2. The file transfer client passes the host name to the DNS client.
3. Each computer, after being booted, knows the address of one DNS server. The DNS client sends a message to a DNS
server with a query that gives the file transfer server name using the known IP address of the DNS server.
4. The DNS server responds with the IP address of the desired file transfer server.
5. The DNS server passes the IP address to the file transfer client.
6. The file transfer client now uses the received IP address to access the file transfer server
Name Space
To be unambiguous, the names assigned to machines must be carefully selected from a name space with complete
control over the binding between the names and IP addresses. In other words, 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.
In a flat name space, a name is assigned to an address. A name in this space is a sequence of characters without
structure. The names may or may not have a common section; if they do, it has no meaning.
The main disadvantage of a flat name space is that it cannot be used in a large system such as the Internet
because it must be centrally controlled to avoid ambiguity and duplication. In a hierarchical name space, each name is
madeof several parts.
The first part can define the nature of the organization, the second part can define the name of an organization,
thethird part can define departments in the organization, and so on. In this case, the authority to assign and control
the name spaces can be decentralized.
A central authority can assign the part of the name that defines the nature of the organization and the name of
the organization.
The responsibility for the rest of the name can be given to the organization itself. The organization can add
suffixes (or prefixes) to the name to define its host or resources. The management of the organization need not worry
that the prefix chosen for a host is taken by another organization because, even if part of an address is the same, the
whole address is different.
For example, assume two organizations call one of their computers caesar. The first organization is given a
name by the central authority, such as first.com, the second organization is given the name second.com. When each of
these organizations adds the name caesar to the name they have already been given, the end result is two
distinguishable names: ceasar.first.com and ceasar.second.com. The names are unique.
Domain
A domain is a subtree of the domain name space. The name of the domain is the name of the node at the top of the
subtree
Hierarchy of Name Servers
The solution to these problems is to distribute the information among many computers called DNS servers.
One way to do this is to divide the whole space into many domains based on the first level.
In other words, we let the root stand alone and create as many domains (subtrees) as there are first-level
nodes. Because a domain created this way could be very large, DNS allows domains to be divided further into smaller
domains (subdomains). Each server can be responsible (authoritative) for either a large or small domain.
Zone
Since the complete domain name hierarchy cannot be stored on a single server, it is divided among many
servers. What a server is responsible for or has authority over is called a zone. We can define a zone as a contiguous
part of the entire tree. If a server accepts responsibility for a domain and does not divide the domain into smaller
domains, the “domain” and the “zone” refer to the same thing.The server makes a database called a zone file and keeps
all the information for every node under that domain
Root Server
A root server is a server whose zone consists of the whole tree. A root server usually does not store any
information about domainsbut delegates its authority to other servers, keeping references to those servers. There are
several root servers, each covering the whole domain name space. The root servers are distributed all around the
world.
The primary and secondary servers are both authoritative for the zones they serve. The idea is not to put the
secondary server at a lower level of authority but to create redundancy for the data so that if one server fails, the other
can continue serving clients. Note also that aserver can be a primary server for a specific zone and a secondary server
for another zone.
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.
Country Domains
The country domains section uses two-character country abbreviations (e.g., us for United States). Second
labels can be organizational, or they can be more specific national designations. The United States, for example, uses
state abbreviations as a subdivision of us (e.g., ca.us.).
DNS Messages
To retrieve information about hosts, DNS uses two types of messages: query and response. Both types have the same
format as shown in Figure
SNMP
Several network management standards have been devised during the last few decades. The most important
one is Simple Network Management Protocol (SNMP), used by the Internet. We discuss this standard in this section.
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. SNMP uses the concept
of manager and agent. That is, a manager, usually a host, controls and monitors a set of agents, usually routers or
servers
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.
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 three protocols: SNMP, SMI,and MIB, as shown in Figure.
Role of SNMP
SNMP has some very specific roles in network management. It defines the format of the packet to be sent from
a manager to an agentand vice versa. It also interprets the result and creates statistics (often with the help of other
management software). The packets exchanged contain the object (variable) names and their status (values). SNMP is
responsible for reading and changing these values.
Role of SMI
To use SNMP, we need rules for naming objects. This is particularly important because the objects in SNMP
form a hierarchical structure (an object may have a parent object and some child objects). Part of a name can be
inherited from the parent. SMI defines the general rules for naming objects, defining object types (including range and
length), and showing how to encode objects and values.
Role of MIB
We hope it is clear that we need another protocol. For each entity to be managed, this protocol must define the
number of objects, name them according to the rules defined by SMI, and associate a type to each named object. This
protocol is MIB. MIB creates a set of objects defined for each entity in a manner similar to that of a database. MIB
creates a collection of named objects, their types, and their relationships to each other in an entity to be managed
SMI
The Structure of Management Information, version 2 (SMIv2) is a component for network management. SMI
is a guideline for SNMP.It emphasizes three attributes to handle an object: name, data type, and encoding method. Its
functions are:
❑ To name objects.
❑ To define the type of data that can be stored in anobject.
❑ To show how to encode data for transmission over the network.
Name
SMI requires that each managed object (such as a router, a variable in a router, a value, etc.) have a unique
name.
To name objects globally, SMI uses an object identifier, which is a hierarchical identifier based on a tree
structure. The objects that are used in SNMP are located under the mib-2 object, so their identifiers always start with
1.3.6.1.2.1.
MIB
The Management Information Base, version 2 (MIB2) is the second component used in network management.
Each agent has its own MIB2, which is a collection of all the objects that the manager can manage.
The objects in MIB2 are categorized under several groups: system, interface, address translation, ip, icmp, tcp, udp,
egp, transmission, and snmp (note that group 9 is deprecated). These groups are under the mib-2 object in the object
identifier tree. Each group has defined variables and/or tables.
❑ sys This object (system) defines general information about the node (system), such as the name, location, and
lifetime.
❑ if This object (interface) defines information about all of the interfaces of the node including interface number,
physical address,and IPaddress. at This object (address translation) defines the information about the ARP table.
❑ ip This object defines information related to IP, such as the routing table and the IP address.
❑ icmp This object defines information related to ICMP, such as the number of packets sent and received and total
errors created.
❑ tcp This object defines general information related to TCP, such as the connection table,time-out value, number of
ports, andnumber of packets sent and received.
❑ udpThis object defines general information related toUDP, such as the number of ports and number of packets sent
and received.
❑ egp These objects are related to the operation ofEGP.
❑ trans These objects are related to the specific method of transmission (future use).
❑ snmp This object defines general information related to SNMP itself.
SNMP uses both SMI and MIB in Internet network management. It is an application program that allows:
❑ A manager to retrieve the value of an object defined in anagent.
❑ A manager to store a value in an object defined in an agent.
❑ An agent to send an alarmmessage about an abnormal situation to the manager.
Messages
SNMP does not send only PDUs, it embeds each PDU in a message. A message is made of a message header followed
by thecorresponding PDU, as shown in Figure