Unit 1 Introduction and Application Layer PDF
Unit 1 Introduction and Application Layer PDF
Data 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
DATA COMMUNICATION
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.
1. 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.
2.Accuracy. The system must deliver the data accurately. Data that have been altered in
transmission and left uncorrected are unusable.
3.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.
4. 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 Networks
A network is a set of devices (often referred to as nodes) connected by communication
links. A node can be a computer, printer, or any other device capable of sending and/or
receiving data generated by other nodes on the network.
i) Database resource
• The database is required to access for decision making by various departments. The
database is maintained by dedicated server and users (clients) can access the data. One
server can provide services to many clients. The client and server in a network is shown
in Fig. 1.2. This arrangement is called as client – server model.
3) Mobile Computers
• Many professionals use desktop computers at office and want to be connected to the
office network while travelling and at home also. This is possible by wireless networks,
hence use of Lap-top, notebook computers and personal digital assistants (PDAs) is
increased. With the help of wireless networks one can access internet, read and send e-
mail. Wireless networks are used in:
i) Taxis, delivery vehicles and other mobile vehicles for keeping contacts with
their office.
ii) Geographical Information Systems (GIS).
iii) Military applications
iv) Airports
v) Banking
vi) Weather reporting
1.1.3 Requirements
• For designing the computer network, it is necessary to identify the requirements and
constraints. Depending upon the user or organizations, requirements are changed.
• Following are the three parameters which affects the design:
1. Application programmer : Specify the list of services
2. Network designer: List the properties of a cost-effective design
3. Network Provider: List the properties of a system that is easy to administer and
manage.
1.1.4 Challenges for Building Networks
1. The Scalability and Extensible Network: The rapid growth of the Internet and network
technologies has increased audio, video, image and graphic data applications, which
A network is two or more devices connected through links. There are two possible types of
connections:
⮚ Point-to-point
⮚ Multipoint.
Point-to-Point
A point-to-point connection provides a dedicated link between two devices. The entire
capacity of the link is reserved for transmission between those two devices. Most point-to-
point connections use an actual length of wire or cable to connect the two ends.
Multipoint
A multipoint (also called multidrop) connection is one in which more than two specific
devices share a single link. In a multipoint environment, the capacity of the channel is shared,
either spatially or temporally.
If several devices can use the link simultaneously, it is a spatially shared connection.
If users must take turns, it is a timeshared connection.
Mesh: In a mesh topology, every device has a dedicated point-to-point link to every
other device. The term dedicated means that the link carries traffic only between the two
devices it connects. To find the number of physical links in a fully connected mesh network
with n nodes, we first consider that each node must be connected to every other node. Node 1
must be connected to n - 1 nodes, node 2 must be connected to n – 1 nodes, and finally node n
must be connected to n - 1 nodes. We need n(n - 1) physical links.
However, if each physical link allows communication in both directions (duplex mode),
we can divide the number of links by 2. In other words, we can say that in a mesh topology, we
need n(n -1) /2 duplex-mode links.
Attributes of LAN
⮚ The LAN transmits data amongst user stations
⮚ The LAN transmission capacity is more than 1 Mbps.
⮚ The LAN channel is typically privately owned by the organization using the facility
⮚ The Geographical coverage of LANs is limited to area less than 5 square Kilometers
1.2.2 Metropolitan Area Network (MAN)
A metropolitan area network, or MAN, covers a city. The best-known example of a
MAN is the cable television network available in many cities. This system grew from earlier
community antenna systems used in areas with poor over-the-air television reception. In these
early systems, a large antenna was placed on top of a nearby hill and signal was then piped to
the subscribers' houses. At first, these were locally-designed, ad hoc systems. Then companies
began jumping into the business, getting contracts from city governments to wire up an entire
city.
• Subnet consists of transmission lines and switching elements. The transmission line is
used for data transfer between two machines. Switching elements are used for
connecting two transmission lines.
Parameter LA WA MA
N N N
Area Covers small area Covers large Covers larger than
covered i.e. within
geographical area. LAN & smaller than
the
building. WAN.
Sr. LA WA
No. N N
1. It covers small area. WAN covers large geographical area.
2. LAN operates on the principal of WAN operates on the principal of point
broadcasting. to point.
3. Used for time critical application. Not used for time critical application.
4. Transmission speed is high. Transmission speed is low.
5. Easy to design and maintain. Design and maintenance is not easy.
6. LAN is broadcasting in nature. WAN is point-to-point in nature.
7. Transmission medium is co-axial Transmission or
communication
or UTP cable.
medium is PSTN or satellite link.
8. LAN does not suffer WAN suffer from propagation delay.
from
propagation delay.
Example 1. Consider a bus LAN with a number of equally spaced stations with a data
rate of 9 Mbps and a bus length of 1 km. What is the mean time to send a frame of 500 bits
to another station, measured from the beginning of transmission to the end of reception?
Assume a propagation speed of 150 m/s. If two stations begin to monitor and transmit at
the same time, how long does it need to wait before an interference is noticed?
Solution: We assume that the distance between two stations is 500 m
Mean time to send = Propagation time + Transmission time
= 500 m / 150 msec. + 500 bits / 9000000 bps.
= 3.33 msec. + 55.55 msec. = 58.88 msec.
If the two stations begin the transmission at exactly the same time the signal will
interface after exactly 250 m.
Tinterface = (250 m + 250 m) / 150 m / msec = 3.33 msec …Ans.
1.3 Layering and Protocols
• A computer network must provide general, cost effective, fair and robust connectivity
among a large number of computers. Designing a network to meet these requirements is
no small task.
• To deal with this complexity, network designers have developed general blue prints –
usually called network architectures. It guides the design and implementation of
networks.
• Computer network is designed around the concept of layered protocols or functions. For
exchange of data between computers, terminals or other data processing devices, there is
data path between two computers, either directly or via a communication network.
• Protocols are the rules that govern network communication. Fig. 1.12 shows the five
layer network.
Physical Layer
Physical Layer is the lowest layer of the OSI model. The physical layer coordinates the
functions required to transmit a bit stream over a communication channel. It deals with the
mechanical and electrical specifications of the interface and transmission medium. It also deals
with procedures and functions required for transmission.
1. Physical characteristics of interfaces and medium. The physical layer defines the
characteristics of the interface between the devices and the transmission medium.
2. Representation of bits. The physical layer data consists of a stream of bits (sequence of
Os or 1s) with no interpretation. To be transmitted, bits must be encoded into signals--
electrical or optical.
3. Data rate. The physical layer define the transmission rate-The number of bits sent each
second
4. Synchronization of bits. The transmission rate and receiving rate must be same. This is
done by synchronizing clock at sender and receiver.
5. Line configuration. The physical layer is concerned with the connection of devices to
the media. In a point-to-point configuration, two devices are connected through a
dedicated link. In a multipoint configuration, a link is shared among several devices.
6. Physical topology. The physical topology defines how devices are connected to make a
network. Devices can be connected by using a mesh topology, star topology, a ring
topology, a bus topology, or a hybrid topology (this is a combination of two or more
topologies).
7. Transmission mode. The physical layer also defines the direction of transmission
between two devices: simplex, half-duplex, or full-duplex. In simplex mode, only one
device can send; the other can only receive. The simplex mode is a one-way
communication. In the half-duplex two devices can send and receive, but not at
the same time. In a full-duplex (or simply duplex) mode, two devices can send and
receive at the same time.
Transport Layer
The transport layer is responsible for delivery of message from one process to
another process. The network layer does the source-to-destination delivery of individual
packets considering it as independent packet; it does not recognize any relationship between
those packets. The transport layer ensures that the whole message arrives intact and in order
with error control and flow control at the source-to-destination level.
CN Unit 1 :Chennai Institute of 18
Technology
Figure 2.10 shows the relationship of the transport layer to the network and session
layers.
Figure 1.18 Transport layer
Other responsibilities of the transport layer include the following:
1. Service-point addressing. Computers perform several operations simultaneously. For
this reason, source-to-destination delivery means delivery not only from one computer
to the next but also from a specific process (running program) on one computer to a
specific process (running program) on the other. The transport layer header must
therefore include a type of address called a service-point address (or port address).
2. Segmentation and reassembly. A message is divided into segments, each segment
containing a sequence number which enable the transport layer to reassemble at the
destination.
3. Connection control. The transport layer performs connectionless or connection
oriented service with the destination machine.
4. Flow control. Like the data link layer, the transport layer is responsible for flow control.
However, flow control at this layer is performed end to end rather than across a single
link.
5. Error control. Like the data link layer, the transport layer is responsible for error
control. However, error control at this layer is performed end to end rather than across a
single link.
Session Layer
The services provided by the first three layers (physical, data link, and network) are not
sufficient for some processes. The session layer is responsible for dialog control and
synchronization. It establishes, maintains, and synchronizes the interaction among
communicating systems.
Specific responsibilities of the session layer include the following:
1. Dialog control: The communication between two processes to take place in either half
duplex (one way at a time) or full-duplex (two ways at a time) mode. The session layer
manages control for this communication.
2. Synchronization. The session layer adds checkpoints, or synchronization points, to a
stream of data. For example, if a system is sending a file of 2000 pages, it is advisable to
insert.
Figure 1.19 illustrates the relationship of the session layer to the transport and
presentation layers.
3. OSI model based on three concept TCP/IP model did not originally clearly
i.e. service, interface and protocol. distinguish between service, interface
and
protocol.
4. OSI model gives guarantee Transport layer does not
of always
reliable delivery of packet. guarantee the reliable delivery of packet.
5. OSI does not support TCP/IP support.
internet
working
1.5.2 Addressing
• An Internet employing TCP / IP protocols uses four levels of addresses:
1. Physical (Link) addresses 2. Logical (IP) addresses
3. Port addresses 4. Specific addresses
• Each address type is related to a specific layer in TCP / IP architecture. Fig.1.27 shows
the relationship of layers and addresses in TCP / IP.
1. Physical Addresses
• The physical address is the lowest level address and is also refereed as link address.
They physical address of a node is defined by its LAN or WAN. The physical address is
included in the frame by the data link layer.
• The size and format of physical addresses vary depending on the network. It has
authority over the network. At data link layer the frame contains physical (link)
addresses in the header.
2. Logical Addresses
• Logical addresses are independent of underlying physical networks. Since different
networks can have different address formats hence a universal address system is
required which can identify each host uniquely irrespective of underlying physical
CN Unit 1 :Chennai Institute of 24
Technology
networks. Logical addresses are necessary for universal communications. It is 32-bit
address which uniquely defines host connected to Internet.
4. Specific Addresses
• Specific addresses are designed by users for some applications. For example
[email protected] and the Universal Resource Locator (URL), www.vtubooks.com. The
first example defines the recipient of e-mail and second example is used to find a
document on the world wide web.
• The specific addresses gets changed to corresponding port and logical addresses by the
station or host who sends it.
INTRODUCTION TO SOCKETS
Socket interface started in the early 1980s at UC Berkeley as part of a UNIX environment.
The socket interface is a set of instructions that provide communication between the application
layer and the operating system, as shown in Figure 25.4. It is a set of instructions that can be used
by a process to communicate with another process. The idea of sockets allows us to use the set of
all instructions already designed in a programming language for other sources and sinks. For
example, in most computer languages, like C, C++, or Java, we have several instructions that can
read and write data to other sources and sinks such as a keyboard (a source), a monitor (a sink), or a
Figure 25.5 Sockets used the same way as other sources and sinks
Sockets
● Although a socket is supposed to behave like a terminal or a file, it is not a physical entity
like them; it
is an abstraction.
● It is an object that is created and used by the application program.
● We can say that, as far as the application layer is concerned, communication between a
client process
and a server process is communication between two sockets, created at two ends
The client thinks that the socket is theentity that receives the request and gives the response; the
server thinks
that the socket is the one that has a request and needs the response. If we create two sockets, one at
each end, and
define the source and destination addresses correctly, we can use the available instructions to send
and receive
data. The rest is the responsibility of the operating system and the embedded TCP/IP protocol.
A socket address
Since a socket defines the end-point of the communication, we can say that a socket is identified
by a pair
of socket addresses, a local and a remote.
Finding Socket Addresses
How can a client or a server find a pair of socket addresses for communication? The situation is
different for each
Server Site
The server needs a local (server) and a remote (client) socket address for communication.
Local Socket Address The local (server) socket address is provided by the operating system.
● The operating system knows the IP address of the computer on which the server
process is running.
● The port number of a server process, however, needs to be assigned.
● If the server process is a standard one defined by the Internet authority, a port
number is
already assigned to it.
● For example, the assigned port number for a Hypertext Transfer Protocol (HTTP)
is the integer
80, which cannot be used by any other process.
● If the server process is not standard, the designer of the server process can choose a
port number,
in the range defined by the Internet authority, and assign it to the process. When a
server starts
running, it knows the local socket address.
Remote Socket Address The remote socket address for a server is the socket address of the client
that makes
the connection.
● Since the server can serve many clients, it does not know beforehand the remote
socket address for communication.
● The server can find this socket address when a client tries to connect to the server.
● The client socket address, which is contained in the request packet sent to the
server, becomes the
remote socket address that is used for responding to the client.
● In other words, although the local socket address for a server is fixed and used
during its lifetime,
the remote socket address is changed in each interaction with a different client.
Client Site
The client also needs a local (client) and a remote (server) socket address for communication.
Local Socket Address The local (client) socket address is also provided by the operating system.
● The operating system knows the IP address of the computer on which the client is
running.
● The port number, however, is a 16-bit temporary integer that is assigned to a client
process
each time the process needs to start the communication.
● The port number, however, needs to be assigned from a set of integers defined by
the
Internet authority and called the ephemeral (temporary) port numbers.
● The operating system, however, needs to guarantee that the new port number is not
used by any
other running client process.
(
B
r
o
w
s
e
r
)
A variety of vendors offer commercial browsers that interpret and display a Web
document, and all use nearly the same architecture. Each browser usually consists of
three parts: a controller, client protocol, and interpreters.
Server
3
5.1.1 WEB DOCUMENTS
The documents in the WWW can be grouped into three broad categories: static, dynamic, and active.
1. Static Documents
Static documents are fixed-content documents that are created and stored in a server. The client can get only a
copy of the document. In other words, the contents of the file are determined when the file is created, not
when it is used.
HTML
Hypertext Markup Language (HTML) is a language for creating Web pages.
● HTML documents are in plain text format that contain embedded HTML tags. Documents can be
created in any text editor. There are also many other tools, including editors, designed specifically
to assist in creating HTML documents. To HTML document, the user needs a browser.
● A document will be ready by both graphical and character based web browser. The three basic
tagging pairs used to create the highest level of structure in an HTML documents are as follows :
<HTML> HTML documents </HTML>
<HEAD> Header information of documents </HEAD>
<BODY> Body of the HTML document </BODY> The
general structure of the HTML is
<HTML>
<HEAD>
<TITLE>
Title here
</TITLE>
</HEAD>
<BODY>
Body element and content
</BODY>
</HTML>
A simple HTML document is given below.
<HTML>
<HEAD>
<TITLE> Communication Networks </TITLE>
</HEAD>
3
<BODY>
<H/> Information about the communication networks </H/>
<P> Information about the communication networks is available
<A HREF :http://www.technicalpublicationspune.com></A></P>
</BODY>
</HTML>
● Structural elements in the document are identified by Start andEnd tags. For example the
<TITLE> and </TITLE> tags are used to specify the title of the document.
● The <H/> and </H/> tags' are used to define the first level heading. Headings are generated by an
<Hn> tags, where n is a digit in the range 1 to 6. <H/> is the most important heading and <H6> is
the less important. Typically the lower numbered heading will be displayed in a larger and
heavier font.
● The browser may also choose to use different colors for each level of heading. Typically
<H1> headings are large and bold face with at least one blank line above and below.
● In contrast <H2> headings are in a smaller font, and with less space above and below. The <BR>,
<P> and <HR> tags all indicate a boundary between sections of text.
● The precise format can be determined by the style sheet associated with the page. The
<BR> tag just forces a line break. <P> starts a paragraph, which might for example, insert a blank
line and possibly some indentation. <HR> (horizontal-rule) tag forces the browser to generate a
horizontal rule or line, across the display. It breaks pages into logical sections and is useful when
creating forms. There is no equivalent vertical rule.
Advantages and Disadvantages of HTML
A) Advantages of HTML
1. Applications are quickly developed
2. Web applications are easy to maintain and update.
B) Disadvantages
1. Locking: HTML is not a compiled data format. .
2. Security : Information is easily accessible and travels unimpeded between hosts and desktops.
5.1.2 Dynamic Web Documents
Server Side dynamic web page generation using the various scripting languages
Scripting Technologies for Dynamic Documents
A few technologies have been involved in creating dynamic documents using scripts. Among the most
common are Hypertext Preprocessor (pHP), which uses the Perl language; Java Server Pages (JSP), which
uses the Java language for scripting; Active Server Pages (ASP), a Microsoft
3
product which uses Visual Basic language for scripting; and ColdFusion, which embeds SQL database queries
in the HTML document.
Active Documents
For many applications, we need a program or a script to be run at the client site. These are called active
documents. For example, suppose we want to run a program that creates animated graphics on the screen or a
program that interacts with the user.
Java Applets
One way to create an active document is to use Java applets.
JavaScript
The idea of scripts in dynamic documents can also be used for active documents. If the active part of the
document is small, it can be written in a scripting language; then it can be interpreted and run by the client at
the same time.
5.2 HTTP
The Hypertext Transfer Protocol (HTTP) is a protocol used mainly to access data on the World.
HTTP Transaction
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.
HTTP transaction
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.
3
Request and response message
Request and Status Lines The first line in a request message is called a request line; the first line in the
response message is called the status line.
3
Status phrase: This field is used in the response message. It explains the status code in text form.
Header: The header exchanges additional information between the client and the server.
Difference between Persistent and Non-persistent
Second Scenario
In the second scenario, the sender and the receiver of the e-mail are users (or application programs) on two
different systems. The message needs to be sent over the Internet. Here we need user agents (VAs) and
13
6
message transfer agents (MTAs).
Third Scenario
In the third scenario, Bob, as in the second scenario, is directly connected to his system. Alice, however, is
separated from her system. Either Alice is connected to the system via a point-to- point WAN, such as a dial-
up modem, a DSL, or a cable modem; or she is connected to a LAN in an organization that uses one mail
server for handling e-mails-all users need to send their messages to this mail server.
Fourth Scenario
In the fourth and most common scenario, Bob is also connected to his mail server by a WAN or a LAN. After
the message has arrived at Bob's mail server, Bob needs to retrieve it. Here, we need another set of
client/server agents, which we call message access agents (MAAs). Bob uses an MAA client to retrieve his
13
7
messages. The client sends a request to the MAA server, which is running all the time, and requests the
transfer of the messages.
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.
Services Provided by a User Agent
A user agent is a software package (program) that composes reads, replies to, and forwards messages. It also
handles mailboxes.
13
9
SMTP is used two times, between the sender and the sender's mail server and between the two mail servers.
SMTP simply defines how commands and responses must be sent back and forth.
Commands and Responses
SMTP uses commands and responses to transfer messages between an MTA client and an MTA server.
Commands: Commands are sent from the client to the server. It consists of a keyword followed by zero or
more arguments.
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.
14
0
Post Office Protocol (POP)
● Post Office Protocol 3 (POP3) is used to transfer e-mail messages from a mail server to mail
client software.
● POP3 begins when the user agent opens a TCP connection to the mail server on port 110.
● After TCP connection established, POP3 progresses three phases :
i) Authorization ii) Transaction iii) Update
● In authorization phase, user agent sends a user name and a password to authenticate the user
downloading the mail.
● In transaction phase, the user agent retrieves messages. In this phase, user agent can also mark
messages for deletion, remove deletion marks.
● In update phase, it occurs after the client has issued the quit command, ending the POP3
session.
● POP3 has two modes : Delete mode and the keep mode.
● In the delete mode, mail is deleted from the mailbox after each retrieval.
● In the keep mode, the mail remains in the mailbox after retrieval.
● Fig. 5.4.7 shows downloading using POP3.
14
1
Fig. 5.4.7 POP3
IMAP
● IMAP is the Internet Mail Access Protocol. IMAP4 is more power and more complex. IMAP is
similar to SMTP.
● It was designed to help the user who uses multiple computers.
● An IMAP client connects to a server by using TCP.
● IMAP supports the following modes for accessing e-ma me
i) Offline mode ii) Online mode iii) Disconnected mode
Offline mode: A client periodically connects to the server to download e-mail messages. After downloading,
messages are deleted from the server.
Online mode : Client process e-mail messages on the server. The e-mail messages are stored on the server
itself but are processed by an application on the client’s end.
Disconnected mode : In this mode, both offline and online modes are supported.
IMAP4 provides the following extra functions.
1. User can check the e-mail header prior to downloading.
2. User can partially download e-mail.
3. A user can create, delete or rename mailboxes on the mail server.
4. A user can create a hierarchy of mailboxes in a folder for e-mail storage.
5. User can search the contents of the e-mail for a specific string of characters.
14
2
● Fig. 5.4.8 shows IMAP state transition diagram.
1. Not authenticated: Client provides authentication information to the server.
2. Authenticated: Server verify the information and client is now allowed to perform operations on
a mailbox.
3. Selected: Client is allowed to access of manipulate individual messages within the mailbox.
4. Logout: Client send logout command for closing IMAP session.
14
3
Fig.5.4.8 IMAP state diagram
20
Generic domain:
There are 14 generic domains, each specifying an organization type. The generic domain defines registered hosts
according to their generic behaviour.
These labels describe the organization types as shown below
1. Country domains:
Each country domain specifies a country. Such as in for india, jp for japan , uk for United kingdom and us for
United State , etc
20
2. Inverse domain:
The inverse domain finds a domain name for a given IP address. This is called address-to-name resolution. It
is used to map an address to a name.
3. Types of Records:
There are two types of DNS records:
1. Question records
2. Resource records
Question Records:
The question records are used in the question section of the query and response messages. It is used by the
client to get information from a server.
20
Resource Records:
Every domain whether it is a single host or a top level domain, can have a set of resource records associated
with it. For a single host, the most common resource record is just its IP address, but many other kinds also
exist. When a resolver gives a domain name to DNS, what it gets back are the resource records associated
with that name. Thus, the primary function of DNS is to map domain names onto resource records. The server
database consists of resource records. This record is used in the answer, authoritative and additional
information sections of the response message.
Name Spaces
● Name spaces are of two types: Flat name spaces and Hierarchical names.
i) Flat name spaces
● A name is assigned to an address.
ii) Hierarchical names
● Hierarchical namespaces provides a simple yet flexible naming structure.
● The namespace is partitioned at the top level.
The top level domains are divided into three areas :
1. Arpa is a special domain used for the address-to-name mappings.
2. The 3 character domains are called the generic domains.
3. The 2 character domains are based on the counter codes found in ISO 3166. These are
called the country domains.
● Fig. 5.7.5shows the hierarchy of DNS.
21
Fig.5.7.7 Hierarchy of name server
● To distribute the information among many computers, DNS servers are used.Creates many
domains as there are first level nodes. Fig. 5.7.7 shows hierarchy of name servers.
● Root server: If zone consists of the full tree then that zone server is called root server. Root
server do not maintain any information about domains.
DNS uses two types of servers:
1. Primary server 2. Secondary server
● Primary server: This server keeps a file about the zone for which it is responsible and have
authority. It performs operation on zone file like create, update and maintaining.
● Secondary server: It loads all information from the primary server. Secondary server cannot
perform any operation on zone file.
Message Format
● Messages are sent between domain clients and domain servers with a specific format.
● DNS has two types of messages: Query and Response. Both types have the same format.
● The query message consists of the header and the question records, the response message consists
of a header, question record, answer record, authoritative record and additional records.
● Fig. 5.7.11 shows the query and response messages.
22
Fig. 5.7.11 Query and response message
● Fig. 5.7.12 shows the header format of the DNS.
23
variable length fields. The identification field is set by client and returned by
the server. It lets the client, match responses to requests.
● Fig. 5.7.13 flag fields in DNS header.
24
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.
In other words, management with SNMP is based on three basic ideas:
1. A manager checks an agent by requesting information that reflects the behaviour 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 un
usualsituation.
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, as shown in Figure 28.3.
Role of SNMP
SNMP defines the format of packets exchanged between a manager and an agent. It reads
and changes the status (values) of objects (variables) in SNMP packets.
Role of SMI
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
MIB creates a collection of named objects, their types, and their relationships to each
other in an entity to be managed.
Structure of Management Information(SMI)
Its functions are
1. To name objects
25
2. To define the type of data that can be stored in an object
3. To show how to encode data for transmission over the network
SMI is a guideline for SNMP. It emphasizes three attributes to handle an object: name,
data type, and encoding method (see Figure 28.5).
Name
SMI requires that each managed object (such as a router, a variable in a router, a value)
have a unique name. To name objects globally, SMI uses an object identifier, which is a
hierarchical identifier based on a tree structure (see Figure28.6).
Type
The second attribute of an object is the type of data stored in it. To define the data type, SMI uses
fundamental Abstract Syntax Notation 1 (ASN.l) definitions and adds some new definitions. .
SMI has two broad categories of data type: simple and structured.
26
Type Size Description
INTEGER 4 bytes 31 31
An integer with a value between _2 and 2 -1
27
Structured Type: By combining simple and structured data types. SMI defines two
structured data types: sequence and sequence of.
Sequence. A sequence data type is a combination of simple data types, not necessarily of
the same type.
Sequence of. A sequence of data type is a combination of simple data types all of the
same type.
Encoding Method
SMI uses another standard, Basic Encoding Rules (BER), to encode data to be trans
mitted over the network.
Tag. The tag is a 1 -byte field that defines the type of data. It is composed of three
subfields:class(2bits),format(1bit),andnumber(5bits).Theclasssubfielddefines the scope of
the data..
Length.The length field is 1 or more bytes. If it is 1 byte, the most significant bit must be
O. The other 7 bits define the length of the data. If it is more than 1 byte, the most
significant bit of the first byte must be 1.
Value. The value field codes the value of the data according to the rules defined in BER.
Management Information Base (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
10different groups: system, interface, address translation, ip, icmp, tcp, udp, egp, trans•
mission, and snmp. These groups are under the mib-2 object in the object identifier tree
(see Figure 28.15). Each group has defined variables and/or tables.
28
The following is a brief description of some of the objects:
Sys:Thisobject (system) defines general information about the node (system), such as
the name, location, and lifetime.
if :This object (interface) defines information about all the interfaces of the node
including interface number, physical address, and IPaddress.
at :Thisobject(addresstranslation)definestheinformationabouttheARPtable.
ip:Thisobject defines information related to IP, such as the routing table and the
IPaddress.
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, and number of packets sent and received.
Udp :This object defines general information related to UDP, such as the number of
ports and number of packets sent and received.
Snmp :This object defines general information related to SNMP itself.
SNMP
1. A manager to retrieve the value of an object defined in an agent
2. A manager to store a value in an object defined in an agent
3. An agent to send an alarm message about an abnormal situation to the manager
PDUs
SNMPv3 defines eight types of packets (or PDUs): GetRequest, GetNextRequest,
GetBulkRequest,SetRequest,Response,Trap,InformRequest,andReport(seeFigure28.20).
GetRequestTheGetRequest PDU is sent from the manager (client) to the agent (server) to
retrieve the value of a variable or a set of variables.
29
GetNextRequestTheGetNextRequestPDU is sent from the manager to the agent to
retrievethevalueofavariable.
GetBulkRequestThe GetBulkRequest POD is sent from the manager to the agent to
retrieve a amount of data. It can be used instead of multiple GetRequest and
GetNextRequestPODs.
SetRequestThe SetRequest PDD is sent from the manager to the agent to set (store) a
value in a variable.
Response The Response PDD is sent from an agent to a manager in response to
GetRequest or GetNextRequest. It contains the value(s) of the variable(s) requested by
the manager.
TrapThe Trap (also called SNMPv2 Trap to distinguish it from SNMPv1 Trap) POD is
sent from the agent to the manager to report an event. For example, if the agent is
rebooted, it informs themanager and reports the time of rebooting.
InformRequest The Inform Request POD 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 POD.
Report The Report POD is designed to report some types of errors between managers.
It is not yet in use.
Format
The format for the eight SNMP PODs is shown in Figure 28.21. The GetBulkRequest
POD differs from the others in two areas, as shown in the figure.
21
0
Max repetition :This field is also used only in GetBulkRequest and replaces the error index
field, which is empty in Request PDUs.
VarBindlist. This is a set of variables with the corresponding values the manager wants
to retrieve or set.
Messages
SNMP does not send only a PDU, it embeds the PDU in a message. A message in
SNMPv3 is made of four elements: version, header, security parameters, and data (which
include the encoded PDU), as shown in Figure 28.22.
Strength of SNMP
1. It is simple to implement.
2. Agents are widely implemented.
3. Agent level overhead isminimal.
4. It is robust and extensible.
5. Polling approach is good for LAN based managed object.
6. It offers the best direct manager agent interface.
7. SNMP meet a critical need.
Weakness of SNMP
1. It is too simple and does not scale well.
2. There is no object oriented data view.
3. It has no standard control definition.
4. It has many implementation specific (private MIB) extensions.
5. It has high communication overhead due to polling.
5.1 SSH
21
1
● SSH is a protocol for secure remote login and other secure network services
over an insecure network.
● Secure Shell (SSH) is a protocol for secure network communications
designed to be relatively simple and inexpensive to implement.
● Secure shell provides strong authentication and encrypted data
communications between two computers connecting over an open network
such as the internet.
● SSH uses the client-server model, connecting a secure shell client
application, the end at which the session is displayed, with an SSH server,
the end at which the session runs.
● Fig. 5.9.1 shows SSH protocol stack.
21
2
Fig. 5.9.2 Setup flow of a secure shell connection
● The protocol works in the client-server model, which means that the
connection is established by the SSH client connecting to the SSH server.
● The SSH client drives the connection setup process and uses public key
cryptography to verify the identity of the SSH server.
● After the setup phase the SSH protocol uses strong symmetric encryption
and hashing algorithms to ensure the privacy and integrity of the data that is
exchanged between the client and server.
● Once a connection has been established between the SSH client and server,
the data that is transmitted is encrypted according to the parameters
negotiated in the setup.
● During the negotiation the client and server agree on the symmetric
encryption algorithm to be used and generate the encryption key that will be
used.
● The keys used for authentication are called SSH keys.
● The protocol is used in networks for :
1. Providing secure access for users and automated processes.
2. Interactive and automated file transfers.
3. Issuing remote commands.
4. Managing network infrastructure and other mission-critical system
components.
Difference between SSH Version 1 and SSH Version 2
21
3
The same algorithms and keys are used in Encryption, MAC and compression are
both directions negotiated separately for each direction,
with independent keys.
Server key used for forward secrecy on the Use of Diffie-Hellman key agreement
session key. removes the need for a server key.
21
4