2. World Wide Web (WWW) and Hyper Text Transfer Protocol
(HTTP)
• The World Wide Web (WWW) is a repository of information linked together from
points all over the world.
Architecture
• WWW today is a distributed client/server service
• A client using a browser can access a service using a server. However, the service
provided is distributed over many locations called sites.
• Each site holds one or more documents, referred to as Web pages.
• Each Web page can contain a link to other pages in the same site or at other sites.
• The pages can be retrieved and viewed by using browsers shown in Fig. The client
needs to see some information that it knows belongs to site A.
• It sends a request through its browser, a program that is designed to fetch Web
documents.
• The request, among other information, includes the address of the site and the
Web page, called the URL.
3. Fig.5.8 Architecture of WWW
• The server at site A finds the document and sends it to the client.
• When the user views the document, she finds some references to
other documents, including a Web page at site B.
• The reference has the URL for the new site. The user is also
interested in seeing this document.
• The client sends another request to the new site, and the new page
is retrieved.
4. Client (Browser)
• Each browser usually consists of three parts: a controller, client protocol, and
interpreters.
• The controller receives input from the keyboard or the mouse and uses the
client programs to access the document as in fig.5.9.
• After the document has been accessed, the controller uses one of the
interpreters to display the document on the screen.
• The client protocol can be one of the protocols described previously such as
FTP or HTTP.
• The interpreter can be HTML, Java, or JavaScript, depending on the type of
document.
Fig.5.9 Browser Architecture
5. Uniform Resource Locator (URL)
• A client that wants to access a Web page needs the address. To facilitate the access of
documents distributed throughout the world, HTTP uses locators.
• The uniform resource locator (URL) is a standard for specifying any kind of information on
the Internet. The URL defines four things: protocol, host computer, port, and path as in
Fig.5.10.
Fig.5.10 URL
• The protocol is the client/server program used to retrieve the document.
• The host is the computer on which the information is located, although the name of the
computer can be an alias.
• The URL can optionally contain the port number of the server. If the port is included, it is
inserted between the host and the path, and it is separated from the host by a colon.
• Path is the pathname of the file where the information is located.
Cookie
• Cookies are small files which are stored on a user's computer. They are designed to hold a
modest amount of data specific to a particular client and website, and can be accessed either
by the web server or the client computer.
6. 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 as shown in fig.5.19. The client can get only a copy of the
document.
• Of course, the contents in the server can be changed, but the user cannot
change them.
Fig.5.11 Static document
Hypertext Markup Language (HTML)
• Hypertext Markup Language (HTML) is a language for creating Web pages.
• For an example, to make part of a text displayed in boldface with HTML, we
put beginning and ending boldface tags (marks) in the text, as shown in
Fig.5.12.
7. Fig.5.12 Boldface tags
• The two tags <B> and </B> are instructions for the browser. When the
browser sees these two marks, it knows that the text must be boldfaced.
• A markup language such as HTML allows us to embed formatting
instructions in the file itself. The instructions are included with the text.
• A Web page is made up of two parts: the head and the body. The head is
the first part of a Web page.
• The head contains the title of the page and other parameters that the
browser will use. The actual contents of a page are in the body, which
includes the text and the tags.
8. Example 1: This example shows how tags are used to let the browser
format the appearance of the text.
<HTML>
<HEAD>
<TITLE> First Sample Document </TITLE>
</HEAD>
<BODY>
<CENTER>
<H1><B> ATTENTION </B></H1>
</CENTER>
You can get a copy of this document by:
<UL>
<LI> Writing to the publisher
<LI> Ordering online
<LI> Ordering through a bookstore
</UL>
</BODY>
</HTML>
9. Example 2: This example shows how tags are used
to import an image and insert it into the text.
<HTML>
<HEAD>
<TITLE> Second Sample Document </TITLE>
</HEAD>
<BODY>
This is the picture of a book:
<IMG SRC="Pictures/book1.gif"
ALIGN=MIDDLE>
</BODY>
</HTML>
10. 2. Dynamic Documents
• A dynamic document is created by a Web server whenever a browser requests the document as in
fig.5.13.
• When a request arrives, the Web server runs an application program or a script that creates the
dynamic document.
• The server returns the output of the program or script as a response to the browser that requested
the document. Because a fresh document is created for each request, the contents of a dynamic
document can vary from one request to another.
• A very simple example of a dynamic document is the retrieval of the time and date from server.
Fig.5.13 Dynamic document
Common Gateway Interface (CGI)
• The Common Gateway Interface (CGI) is a technology that creates and handles dynamic
documents.
• CGI is a set of standards that defines how a dynamic document is written, how data are input to
the program, and how the output result is used.
11. 3. 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.
• The program definitely needs to be run at the client
site where the animation or interaction takes place.
• When a browser requests an active document, the
server sends a copy of the document or a script. The
document is then run at the client (browser) site.
12. Fig.5.14 Active document
• One way to create an active document is to use Java applets.
• Java is a combination of a high-level programming language, a
run-time environment, and a class library that allows a
programmer to write an active document (an applet) and a
browser to run it.
• An applet is a program written in Java on the server.
• JavaScript is a very high level scripting language and is used to
create an active document.
13. Hypertext Transfer Protocol (HTTP)
• The Hypertext Transfer Protocol (HTTP) is a protocol used mainly to
access data on the World Wide Web.
• HTTP functions as a combination of FTP and SMTP.
• It is similar to FTP because it transfers files and uses the services of TCP.
However, it is much simpler than FTP because it uses only one TCP
connection.
• HTTP is like SMTP because the data transferred between the client and
the server look like SMTP messages.
• Unlike SMTP, the HTTP messages are not destined to be read by humans;
they are read and interpreted by the HTTP server and HTTP client
(browser).
• SMTP messages are stored and forwarded, but HTTP messages are
delivered immediately.
• HTTP uses the services of TCP on well-known port 80.
14. 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.Fig.5.15
illustrates the HTTP transaction between the client and
server.
Fig.5.15 HTTP transaction
15. Messages
• The formats of the request and response messages are similar; both are shown in
Fig.5.16. 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.
Fig.5.16 Request and Response messages
• 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.
Fig.5.17 Request Line
16. • Request type: This field is used in the request message. In version 1.1 of HTTP, several
request types are defined.
• URL: Uniform Resource Locator
• Version: The most current version of HTTP is 1.1.
Fig.5.18 Status Line
• Status code: This field is used in the response message. The status code field is similar to
those in the FTP and the SMTP protocols.
• It consists of three digits. Whereas the codes in the 100 range are only informational, the
codes in the 200 range indicate a successful request.
• The codes in the 300 range redirect the client to another URL, and the codes in the 400
range indicate an error at the client site.
• Finally, the codes in the 500 range indicate an error at the server site.
• 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.
• Body: The body can be present in a request or response message. Usually, it contains the
document to be sent or received.
17. ELECTRONIC MAIL (Email)
• One of the most popular Internet services is electronic mail (e-mail).
• It allows a message to include text, audio, and video.
• E-mail system includes three main components: user agent, message transfer agent(MTA), and message
access agent(MAA).
Architecture
• The sender and the receiver of the e-mail are users (or application programs) on the same system; they
are directly connected to a shared system.
• The administrator has created one mailbox for each user where the received messages are stored.
• A mailbox is part of a local hard drive, a special file with permission restrictions.
• Only the owner of the mailbox has access to it. When Alice, a user, needs to send a message to Bob,
another user, Alice runs a user agent (UA) program to prepare the message and store it in Bob's mailbox.
• The message has the sender and recipient mailbox addresses (names of files).
• Bob can retrieve and read the contents of his mailbox at his convenience, using a user agent.
Fig.5.1 SMTP concept
18. • In the next 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 (UAs) and message transfer agents (MTAs).
Fig.5.2 UAs and MTAs
• When the sender is connected to the mail server via a LAN or a
WAN, we need two UAs and two pairs of MTAs (client and server).
19. • In the most common scenario, Bob is also connected to his mail server by a WAN
or a LAN.
• Bob uses an MAA client to retrieve his messages. When both sender and receiver
are connected to the mail server via a LAN or a WAN, we need two UAs, two pairs
of MTAs (client and server), and a pair of MAAs (client and server).
Fig.5.3 Today’s most Common Scenario for E-mail System
20. There are two components, they are
• User Agent (It provides service to the user to make the process of sending and receiving a
message easier)
• Message Transfer Agent(MTA)
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.
• Composing Messages: A user agent helps the user compose the e-mail message to be sent out.
• Reading Messages: When a user invokes a user agent, it first checks the mail in the incoming
mailbox. Each e-mail contains the following fields.
– A number field
– A flag field that shows the status of the mail such as new, already read but not replied to, or
read and replied to
– The size of the message
– The sender
– The optional subject field
• Replying to Messages: After reading a message, a user can use the user agent to reply to a
message. The reply message may contain the original message and the new message.
• Forwarding Messages: Forwarding is defined as sending the message to a third party.
• Handling Mailboxes: A user agent normally creates two mailboxes: an inbox and an outbox. The
inbox keeps all the received e-mails and outbox keeps all the sent e-mails
21. User Agent Types
There are two types of user agents:
• Command-driven: It accepts a one-character command from the keyboard to perform its task. Some examples of
command-driven user agents are mail, pine, and elm.
• 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. Some examples of GUI-based user agents are Eudora,
Microsoft's Outlook, and Netscape.
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 as in fig.
Fig.5.4 Format of an e-mail
• Envelope: It contains the sender and the receiver addresses.
• Message: It contains the header and the body.
• 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.
• Addresses: The address consists of two parts: a local part and a domain name, separated by an @ sign as in fig.
Fig.5.5 Email address
22. Multipurpose Internet Mail Extensions (MIME)
• Email can send messages only in NVT 7-bit ASCII format. For example, it cannot be used for languages that are not
supported by 7-bit ASCII characters (such as French, German, Hebrew, Russian, Chinese, and Japanese).
• Multipurpose Internet Mail Extensions (MIME) is a supplementary protocol that transforms non-ASCII data at
the sender site to NVT ASCII data and delivers them to the client MTA to be sent through the Internet as in
fig.5.6.
• MIME defines five headers that can be added to the original e-mail header section to define the transformation
parameters.
1. MIME-Version: This header defines the version of MIME used. The current version is 1.1.
MIME-Version:1.1
2. Content-Type: This header defines the type of data used in the body of the message.
The content type and the content subtype are separated by a slash. Depending on the subtype, the header may contain
other parameters.
Content-Type<type Jsubtype; parameters>
3. Content-Transfer-Encoding: This header defines the method used to encode the messages into 0s and 1s for
transport:
Content-Transfer-Encoding :< type>
4. Content-Id This header uniquely identifies the whole message in a multiple-message environment.
Content-Id:id=<content-id>
5. Content-Description: This header defines whether the body is image, audio, or video.
Content-Description :< description>
Fig.5.6 MIME
23. Message Access Agent: POP and IMAP
Currently two message access protocols are
available:
– Post Office Protocol, version 3(POP3)
– Internet Mail Access Protocol, version 4 (IMAP4)
Fig.5.7 POP3 and SMTP
24. Post Office Protocol Version 3(POP3)
• The client POP3 software is installed on the recipient computer; the server POP3
software is installed on the mail server.
• Mail access starts with the client when the user needs to download e-mail from
the mailbox on the mail server. The client opens a connection to the server on TCP
port 110.
• It then sends its user name and password to access the mailbox. The user can then
list and retrieve the mail messages, one by one.
• POP3 has two modes: the delete mode and the keep mode. In the delete mode,
the mail is deleted from the mailbox after each retrieval. In the keep mode, the
mail remains in the mailbox after retrieval.
Internet Mail Access Protocol version 4(IMAP4)
• IMAP4 is similar to POP3.IMAP4 is more powerful and more complex. It provides
the following extra functions:
– A user can check the e-mail header prior to downloading.
– A user can search the contents of the e-mail for a specific string of characters
prior to downloading.
– A user can partially download e-mail. This is especially useful if bandwidth is
limited and the e-mail contains multimedia with high bandwidth
requirements.
– A user can create, delete, or rename mailboxes on the mail server.
– A user can create a hierarchy of mailboxes in a folder for e-mail storage.
25. Domain Name System (DNS)
• The Domain Name System (DNS) is a supporting program that is used by other
programs such as e-mail.
• A user of an e-mail program may know the e-mail address of the recipient; however,
the IP protocol needs the IP address.
• The DNS client program sends a request to a DNS server to map the e-mail address to
the corresponding IP address.
• When the Internet was small, mapping was done by using a host file. The host file
had only two columns: name and address.
• Every host could store the host file on its disk and update it periodically from a
master host file. When a program or a user wanted to map a name to an address, the
host consulted the host file and found the mapping.
• Today, however, it is impossible to have one single host file to relate every address
with a name and vice versa. The host file would be too large to store in every host.
• One solution is to divide this huge amount of information into smaller parts and
store each part on a different computer.
• 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).
26. Name Space symmetry
• 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 Name Space-A name is assigned to an address. A name in
this space is a sequence of characters without structure. It
cannot be used in a large system such as the Internet.
• Hierarchical Name Space-Each name is made of several parts.
The first part can define the nature of the organization, the
second part can define the name of an organization, and the
third part can define departments in the organization, and so on.
27. Domain Name Space
• To have a hierarchical name space, a domain name space was designed.
• In this design the names are defined in an inverted-tree structure with the root at
the top. The tree can have only 128 levels: level 0 (root) to level 127 (see Fig.5.19).
Fig.5.19 Domain Name Space
Label
• Each node in the tree has a label, which is a string with a maximum of 63
characters. The root label is a null string (empty string).
• DNS requires that children of a node (nodes that branch from the same node)
have different labels, which guarantees the uniqueness of the domain names.
28. Domain Name
• Each node in the tree has a domain name as in fig.5.20. A full
domain name is a sequence of labels separated by dots (.).
• The domain names are always read from the node up to the
root. The last label is the label of the root (null).
• This means that a full domain name always ends in a null label,
which means the last character is a dot because the null string is
nothing.
Fig.5.20 Domain names and labels
29. Fig.5.21 Domains
Domain
• A domain is a subtree of the domain name space.
• The name of the domain is the domain name of
the node at the top of the subtree. Fig.5.21
shows some domains.
• Note that a domain may itself be divided into
domains (or subdomains as they are sometimes
called).
30. Distribution of Name Space
•The information contained in the domain name space must be stored.
•However, it is very inefficient because responding to requests from all over the
world places a heavy load on the system.
•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.
31. 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.
• A primary server loads all information from the disk file; the
secondary server loads all information from the primary server.
• When the secondary downloads information from the primary, it is
called zone transfer.
DNS in the Internet
• DNS is a protocol that can be used in different platforms.
• In the Internet, the domain name space (tree) is divided into three
different sections: generic domains, country domains, and the
inverse domain (see Fig.5.22).
Fig.5.22 DNS used in the internet
32. 1. Generic Domains
• The generic domains define registered hosts according to their
generic behavior as in fig.5.23.
• Each node in the tree defines a domain, which is an index to the
domain name space database.
Fig.5.23 Generic domains
33. Table 25.1
Table 25.1 Generic domain labels
Generic domain labels
Label Description
com Commercial organizations
edu Educational institutions
gov Government institutions
int International organizations
mil Military groups
net Network support centers
org Nonprofit organizations
34. Table 25.2
Table 25.2 New generic domain labels
New generic domain labels
Label Description
aero Airlines and aerospace companies
biz Businesses or firms (similar to com)
coop Cooperative business organizations
info Information service providers
museum Museums and other nonprofit organizations
name Personal names (individuals)
pro Professional individual organizations
35. 2. 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.).Fig.5.24 shows the country domains section.
• The address anza.cup.ca.us can be translated to De Anza College in Cupertino,
California, in the United States.
Fig.5.24 Country Domain
36. 3. Inverse Domain
• The inverse domain is used to map an address to a name. This may happen, for example, when a
server has received a request from a client to do a task.
• Although the server has a file that contains a list of authorized clients, only the IP address of the
client is listed.
• The server asks its resolver to send a query to the DNS server to map an address to a name to
determine if the client is on the authorized list.
Fig.5.25 Inverse Domain
37. • This type of query is called an
inverse or pointer (PTR) query.
To handle a pointer query, the
inverse domain is added to the
domain name space with the
first-level node called arpa (for
historical reasons) as shown in
fig.5.25.
• The second level is also one
single node named in-addr (for
inverse address). The rest of
the domain defines IP
addresses.
38. FILE TRANSFER
• Transferring files from one computer to another is one of the most
common tasks expected from a networking or internetworking
environment.
File Transfer Protocol (FTP)
• File Transfer Protocol (FTP) is the standard mechanism provided by TCP/IP
for copying a file from one host to another.
• FTP establishes two connections between the hosts.
• One connection is used for data transfer, the other for control
information (commands and responses).
• FTP uses two well-known TCP ports: Port 21 is used for the control
connection, and port 20 is used for the data connection.
39. • The client has three components: user interface, client control process, and the
client data transfer process.
• The server has two components: the server control process and the server data
transfer process.
• The control connection is made between the control processes. The data connection
is made between the data transfer processes.
• The control connection remains connected during the entire interactive FTP session.
• When a user starts an FTP session, the control connection opens. While the control
connection is open, the data connection can be opened and closed multiple times
if several files are transferred.
Fig.5.32 FTP
40. Communication over Control Connection
• FTP uses the same approach as SMTP to communicate across the control connection.
• It uses the 7-bit ASCII character set. Communication is achieved through commands and
responses.
• This simple method is adequate for the control connection because we send one
command (or response) at a time.
• Each command or response is only one short line, so we need not worry about file format
or file structure.
• Each line is terminated with a two-character (carriage return and line feed) end-of-line
token.
Fig.5.33 Communication over Control Connection
41. Communication over Data Connection
• File transfer occurs over the data connection under the control of the commands sent over the control
connection as in fig.5.34. However, we should remember that file transfer in FTP means one of three things:
– A file is to be copied from the server to the client. This is called retrieving a file. It is done under the
supervision of the RETR command.
– A file is to be copied from the client to the server. This is called storing a file. It is done under the
supervision of the STOR command.
– A list of directory or file names is to be sent from the server to the client. This is done under the
supervision of the LIST command.
• The client must define the type of file to be transferred, the structure of the data, and the transmission
mode.
• Before sending the file through the data connection, we prepare for transmission through the control
connection.
• The heterogeneity problem is resolved by defining three attributes of communication: file type, data
structure, and transmission mode.
Fig.5.34 Communication over Data Connection
42. File Type:
• FTP can transfer one of the following file types across the data connection: an ASCII file, EBCDIC file, or
image file.
• The ASCII file is the default format for transferring text files. Each character is encoded using 7-bit ASCII.
• The sender transforms the file from its own representation into ASCII characters, and the receiver
transforms the ASCII characters to its own representation.
Data Structure
• FTP can transfer a file across the data connection by using one of the following interpretations about the
structure of the data: file structure, record structure, and page structure.
• In the file structure format, the file is a continuous stream of bytes. In the record structure, the file is
divided into records.
Transmission Mode
• FTP can transfer a file across the data connection by using one of the following three transmission modes:
stream mode, block mode, and compressed mode.
• The stream mode is the default mode. Data are delivered from FTP to TCP as a continuous stream of bytes.
• TCP is responsible for chopping data into segments of appropriate size. If the data are simply a stream of
bytes (file structure), no end-of-file is needed. End-of-file in this case is the closing of the data connection
by the sender.
43. Anonymous FTP
• To use FTP, a user needs an account (user name) and a password on the
remote server. Some sites have a set of files available for public access, to
enable anonymous FTP.
• To access these files, a user does not need to have an account or
password. Instead, the user can use anonymous as the user name and
guest as the password.
• User access to the system is very limited. Some sites allow anonymous
users only a subset of commands. For example, most sites allow the user
to copy some files, but do not allow navigation through the directories.
44. REMOTE LOGGING
• In the Internet, users may want to run application programs at a remote
site and create results that can be transferred to their local site.
• After logging on, a user can use the services available on the remote
computer and transfer the results back to the local computer.
TELNET
• TELNET is an abbreviation for TErminaL NETwork.
• It is the standard TCP/IP protocol for virtual terminal service as proposed
by the International Organization for Standards (ISO).
• TELNET enables the establishment of a connection to a remote system in
such a way that the local terminal appears to be a terminal at the remote
system.
Timesharing Environment
• TELNET was designed at a time when most operating systems, such as
UNIX, were operating in a timesharing environment.
• In such an environment, a large computer supports multiple users.
• The interaction between a user and the computer occurs through a
terminal, which is usually a combination of keyboard, monitor, and
mouse.
45. Logging
• In a timesharing environment, users are part of the system with some
right to access resources.
• Each authorized user has identification and probably, a password. The
user identification defines the user as part of the system.
• To access the system, the user logs into the system with a user id or log-in
name.
• The system also includes password checking to prevent an unauthorized
user from accessing the resources. Fig.5.29 and Fig.5.30 shows the logging
process.
• When a user logs into a local timesharing system, it is called local log-in.
Fig.5.29 Local login
46. • As a user types at a terminal or at a workstation running a terminal emulator, the keystrokes are accepted
by the terminal driver.
• The terminal driver passes the characters to the operating system. The operating system interprets the
combination of characters and invokes the desired application program or utility.
• When a user wants to access an application program or utility located on a remote machine, she performs
remote log-in.
• The commands or text, in NVT form as in fig.5.31, travel through the Internet and arrive at the TCP/IP
stack at the remote machine.
• The operating system then passes the characters to the appropriate application program.
Fig.5.30 Remote login
Fig.5.31 Concept of NVT
47. SECURE SHELL PROTOCOL (SSH)
• Secure Shell protocol (SSH) provides a remote login service in a secure
manner.
• SSH uses well-known port 22. SSH is used to provide strong
client/server authentication
– Passwords are not sent as clear text over the network. It is sent in encrypted
form.
– Thus sending password through un-trusted network is not a problem.
• Unlike Telnet and rlogin, SSH supports message integrity and
confidentiality.
• SSH version 2 consist of the following protocols
– Transport layer protocol SSH-TRANS
– Authentication protocol SSH-AUTH
– Connection protocol SSH-CONN
48. SSH-TRANS
• SSH-TRANS provide an encrypted channel for communication. It runs on
top of a TCP connection.
• Client and server establish secure channel by first having the client
authenticate the server using RSA.
• Server informs the client of its public key at the time of connection
• Client warns the user when it tries to connect to the server for the first
time, since it does not know the server
49. SSH-AUTH
• Server is authenticated during setup of SSH-TRANS channel by default
• User can authenticate using any of the three mechanism
– Login with username and password. Password is sent in encrypted form
– Public key encryption by asking the user to store user's public key on the server
– Host based authentication requires the client to be authenticated when it
connects to server for the first time. Further connection from a trusted host is
believed to be from the same user.
• In UNIX,
– /.ssh/known_hosts records the keys for all the hosts the user has logged into.
– /.ssh/authorized_keys contains the public keys needed to authenticate the
user when he or she logs into this machine.
– /.ssh/identity contains the private keys for authenticating user on remote
machine.
50. • SSH-CONN
• SSH can be extended to support insecure TCP applications
such as X Windows, IMAP mail readers, etc using SSH-CONN.
• Insecure applications are run by tunneling through SSH,
known as port forwarding.
• Client on host A communicates with server on host B using
SSH.
• Client data sent through SSH is encrypted at sender side
• The receiving SSH at well-known port decrypts the contents
content is forwarded to the actual port on which the server is
listening
51. Simple Network Management Protocol (SNMP)
• Simple Network Management Protocol (SNMP) is a framework for managing
devices in an internet using TCP/IP.
• It provides a set of fundamental operations for monitoring and maintaining an
internet.
• SNMP uses the concept of manager and agent as in fig.
• A manager is a host that runs the SNMP client program.
• A managed station called an agent, is a router that runs the SNMP server program
Fig.SNMP concept
52. • SNMP uses the services of UDP on two well-known ports, 161 (agent) and 162
(manager).
• SNMP is supported by two other protocols in Internet Network management. They
are:
– Structure of Management Information (SMI)
– Management Information Base (MIB)
• The role of SNMP is to
– define format of the packet to be sent from a manager to an agent and vice versa.
– Interprets the result and creates statistics.
– It reads and changes the status(values) of object(variables) in snmp packets
• The role of SMI is to define rules for naming objects and object types. It uses Basic
Encoding Rules to encode data to be transmitted over the network.
• The role of MIB is to create a collection of named objects, their types, and their
relationships to each other in an entity to be managed.
53. SMI(Structure of Management Information )
• The is a component for network management. Its
functions are:
– To name objects.
– To define the type of data that can be stored in an object.
– 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.
54. 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 as in fig., which is a hierarchical identifier
based on a tree structure.
• The tree structure starts with an unnamed root. Each object can be defined by using a sequence of
integers separated by dots.
• The integer-dot representation is used in SNMP. The name-dot notation is used by people. For
example,
iso.org.dod.internet.mgmt.mib-2 1.3.6.1.2.1
• 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. Object identifiers follow lexographic ordering.
55. Fig.5.31 Object identifier
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.1)
• SMI has two broad categories of data type: simple type(integer,unsigned) and
structured type(sequence, sequence of).
56. Encoding Method
• SMI uses another standard, Basic Encoding
Rules (BER), to encode data to be transmitted
over the network.
• BER specifies that each piece of data be
encoded in triplet format: tag(type of data),
length(define the length), and value(value of
the data).
57. MIB Groups
• Each agent has its own MIB2 (version 2), which is a collection of all the objects that the manager can
manage.
• The objects in MIB2 are categorized under 10 different groups. They are
– sys (system defines general information about the node such as the name, location, and lifetime.
– if (interface defines information about all the interfaces of the node such as physical address and IP
address, packets sent and received on each interface, etc.
– at (address translation defines information about the ARP table)
– ip (defines information related to IP such as the routing table, statistics on datagram forwarding,
reassembling and drop, etc. )
– icmp (This object defines information related to ICMP, such as the number of packets sent and
received and total errors created.)
– tcp (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 (information on UDP traffic such as total number of UDP packets sent and received.)
– egp (Objects are related to the opertaion of EGP)
– Trans (Objects are related to the specific method of transmission(future use))
– snmp (This object defines general information related to SNMP itself.)
58. Accessing MIB variables
• MIB variables are of two types namely simple and table.
• To show how to access different variables, we use the udp group as an example. There are four simple variables in
the udp group and one sequence of (table of) records. Fig. shows the variables and the table.
• Simple Variables: To access any of the simple variable content, we use id of the group (1.3.6.1.2.1.7) followed by
the id of the variable. The following shows how to access each variable.
udpInDatagrams 1.3.6.1.2.1.7.1
udpNoPorts 1.3.6.1.2.1.7.2
udplnErrors 1.3.6.1.2.1.7.3
udpOutDatagrams 1.3.6.1.2.1.7.4
Fig.udp group
59. • Tables: To identify a table, we first use the table id. The udp group has only
one table (with id 5). So to access the table, we use the following:
udpTable 1.3.6.1.2.1.7.5
• In case of table, only leaf elements are accessible.
– In this case, the group id is followed by table id and so on up to the leaf
element.
– To access a specific instance (row) of the table, add the index to the
above ids. The indexes are based on the value of one or more fields in
the entries.
– Tables are ordered according to column-row rules, i.e. one should go
column by column from top to bottom.
60. SNMPv3 PDU
1. SNMP is request/reply protocol that defines eight types of packets (or PDUs):
GetRequest, GetNextRequest,GetBulkRequest, SetRequest, Response, Trap,
InformRequest, and Report as in fig.5.34.
– GetRequest used by manager to retrieve value of a variable or a set of
variable.
– GetNextRequest used by manager to retrieve next entries in a agent's
table.
– GetBulkRequest sent from the manager to the agent to retrieve a large
amount of data.
– SetRequest used by manager to set a value in a variable.
– Response Trap sent from an agent to a manager in response to GetRequest
or GetNextRequestthat contains value(s) of the variable(s).
– Trap sent from an agent to the manager to report an event such as reboot.
– Inform Request sent from manager to another remote manager to get
value
– Report designed to report some error
61. Fig.5.34 SNMP PDUs
2. The SNMP client puts the identifier for the MIB variable it wants to get into
the request message, and sends this message to the server.
3. The server then maps this identifier into a local variable, retrieves the current
value held in this variable, and uses BER to encode the value it sends back to
the client.