Chapter 5, 6, 7
Chapter 5, 6, 7
Chapter 5, 6, 7
DHCP
_________________________,________. ._________,__________________,________
Syllabus:
Host Configuration:
DHCP
Domain Name System (DNS)
Remote Login:
o
TELNET and
o
SSH
File Transfer:
o
FTP and o
TFTP
Introduction
DHCP (Dynamic Host Configuration Protocol) is a protocol which helps to do the
automatic assignment of IP (Internet Protocol) configurations on a computer network
and can be manage centrally by network administrators.
In the computer network for communicating with each other; computer system requires
the systems must have unique IP address. In the present scenario computers are
frequently moved and new systems ge (t added to a network. Without DHCP, the IP
address must be entered manually at each computer system.
DHCP helps network administrator to control and distribute IP addresses from a central
point.
i.
5.1.2
DHCP server hosts all located network addresses and deliver required configuratics
parameters to dynamically configured hosts.
DHCP Packet Format
Flags: 16 bits
from the flag first bit is mentioned with 0 or 1 and other 15 bits are zero bits.
0 means "Unicast" and 1 means "broadcast"
It is
5.1.3
Working
Client broadcasts a request for the address information from systems while starting with
TCP connection
DHCP server receives a request from systems(client) then it assigns a new address for a
specific time period to a system called as Lease Time meaning no wasted numbers.
DHCP server sends this dynamic addresses to the client together with the other required
configuration information.
To set up its configuration this information is acknowledged by the client system.
5.1.4
The DHCP server will not restructure the address during the lease period and will
attempt to return the same address every time the client requests an address.
The client may extend its lease with successive requests, and may send a message to the
server before the lease expires telling it that it no longer needs the address so it can be
released and assigned to another client on the network.
DHCP Message Passing:
The DHCP connection states are as shown below;
The message passing between client and server takes place by using the following
various message types which are explained in state transition diagram
5.1.5
RENEWING State:
When client gets DHCACK (acknowledgement) back from server the connection get
renewed. If client does not get the DHCACK then It goes to rebinding state.
REBINDING State:
If client gets DHCPACK then it goes to the rebind state and connection is establishes
again. Else the client broadcast the DHCPDISCOVER to search new server,
5.1.6
Manual configuration requires the careful input of a unique IP address, subnet mask
default router address and a Domain Name Server address.
When a client has finished with the operations, it is released for another computer to
Mobile users simply plug-in their systems to the network and receive their required
configuration dynamically.
The configuration will be supplied by the network's server when moving to a differem
network using a DHCP server.
TCP/IP client configurations, including IP address, gateway -address and DNS address
are centrally managed by DHCP Servers
Client addresses are assigned dynamically which requires the manual input of client
addresses which can be a time consuming and tedious task.
\,,
5.1.9 Limitations
Some fixed addresses machines on network for example servers and routers. The DHCP
server should be capable of assigning pre-allocated addresses to these specific machines.
Users should be prevented from reconfiguring their own IP addresses to avoid conflicts
between addresses assigned by the DHCP server and those assigned manually
We are able to upgrade the system which is having older operating systems because older
operating systems do not support DHCP.
If upgradation is not possible then systems may support the older BOOTP protocol.
____________________________________________________________________________________
The Internet users are not able to remember the IP addresses of all the web sites that
users wanted to visit
The Domain Name System acts as a bridge between domain names and IP addresses of
devices connected in the Internet
o A domain name (a part of the URL) is a unique alphanumeric name such as
gmail.com o Here the top level domain name is "com" o the secondary level domain
name is "gmail".
A huge amount of data related to various sites is divided among the number of systems
to avoid the burden on single system.
DNS uses services of UDP or TCP on the well-known port 53.
The working mechanism of DNS is also Client-Server Model.
sequence of characters.
Hirerarchical name space - In this kind of name space the names are organized as per
to avoid an ambiguities. The lables are used as key in domain name searching.
Domain Name : Each node has a unique domain name.the domain names are read
Root
If the lables are terminated with the root node i.e. Null string then it is known as
b)
If the lables are not terminated with the root node i.e. Null string then it is known
Fig. 5.2.2
Many servers are connected to root server like arpa server, edu server, com server, us
server etc.
Then further many users are connected to individual servers;
1. To edu server; fhda and bk clients are connected
2. To com server ; mcgraw and Irwin clients are connected
The root node is classified into various domain servers and further the individual domain
server are divided into sub-domain servers.
There is hierarchies of domain server as it is in the Name space.
5.2.4 Domains:
a)
Inverse Domain :
Root server having authority of whole tree and also it keeps track of all the servers under
each servers.
A primary server loads all information about servers which are sub parts of it on the
local disk file.
The primary server has all the authority about the sub severs under it and also able to
perform the operations like updation, modification, deletion etc.
The secondary server loads all information from the primary server. It dose not have any
authority to do any modifications in the information related with the server.
When the primary downloads information from the secondary, it is called zone transfer.
5.2.6
.museum - museums and other non-profit organizations are mentioned etc. For
Example : chal.atc.fhda.edu
2.
Fig. 5.2.7
5.2.7
The Resolutions which we use to trace the path from client to required server.lt may
map address to name or name to address by using the help of resolver.
Resolver:
A host or DNS Client which helps to map an address to name or names to an address.
Recursive resolution :
In this type of client starts searching for required server by following the
listed
domains.
>
The client wants to send data over the internet to the destination mcgraw.com ;
where .com is domain and mcgraw is a name of receiver's mail box.
Client first ask to its neighbour about intended destination. If the system is the
destination then it answers with the positive reply email by following the
neighbours in the path; till it reaches to thelse it ask tio next parential neighboring
node about required destination.
When a particular system found the destination; the server sends positive response
to the client by reward back on the same path.
Finally client can connect to the respective server via following the same path.
In this process client searches the destination by following the path in a sequence
which reaches to the required destination.
--------- -0
c)
Interactive Resolution :
Client start searching the respective server but client sends one-to-one message to
check whether the current place is required server.
The client ask for intended system if the receiver is required machine then search
is completed and sends positive relpy.
If client does not get positive reply from system then it sends ip address c: another
neighbor which can complete the search of client client.
When it founds the required destination; the server sends positive reply the:
finally mail transfer takes place between client and server.
"-
A-
'
5.2.10 5.2.9
Fig.
DNS Messages :
1. Query
2. Response
5.2.12 b)
Fig.
Header Format:
The Identification part maintains :
c)
Flags Field:
The fields of flags are mentioned below :
QR :
Query/Response
OpCode
AA:
Authoritative
TC :
Truncated
RD
Recursion Desired
.|
R
A
:
R
e
c
u
r
s
i
o
n
A
v
a
i
l
a
b
l
e
r
C
o
d
e
:
S
t
a
t
u
s
o
f
t
h
e
e
r
r
o
r
d
)
T
y
p
e
s
o
f
R
e
c
o
r
d
s
:
1.
It maintains the details about Query Name, Query type, Query class etc.
2.
Query name
Format:
NETwork) (a)
Introduction:
TELNET is general purpose client-server type application protocol useful in TCPIP model for remote system communication.
Communicate by transferring data and control characters (ASCII) format over the
connection.
TELNET client works on ephemeral ( any available port) and TELNET server
works on port 23.
Remote login is useful for remote process access. It means it helps for
communication with two remote systems.
Remote login works as TCP-IP protocol follows client - server architecture on port
513
TELNET was innovated when operating systems where following time - sharing
environment.
In time sharing scenario user feels like it is working on dedicated system for
accessing a resources, running application programs for other systems etc.
(b)
Login:
Since many users are related with each other via central server the security must
be included via authenticated login.
User can access information from the server by using individuals authenticated
login id.
"password".
Types of Login:
a)
Local Login:
To connect with any system in a network users have to provide his/her details to a
local server.
When users enters data using keyboard or any input device it is given to
terminal: driver of operating system.
Then termin?! drivers passes the accepted characters to the operating system and
then finally given to the desired application program as shown in the figure.
b)
Remote LOGIN:
In the above case the user able to use the local applications.
To connect with the applications running on the remote system can be done with
the 2.help of remote login as shown in the figure.
Client side:
The client sends data through input devices tothe terminal driver.
The input characters are sent to the TELNET client to convert it into universal
character set called as Network Virtual Terminal(NVT) Because of this the
character set can be considered in standard format.
This NVT set than given to TCP-IP stack at the client side.
Server side:
Than this set is forwarded over the internet and added to the TCP-IP stack at the
remote side.
This set is forwarded to operating system of remote machine but since it cannot
interpret directly it is given to the TELNET server
From TELNET server it is given to pseudo terminal driver which gives proper
interpretation and then forwarded via server side operating system to an
appropriate application program.
(c)
Since in the network many heterogeneous systems are connected with each other
individual system has its own operating system, terminal drivers etc.
When client TELNET transfers the data over the internet to remote TELNET the
character set considered by client machine is translated in Universal character set
called as "Network Virtual Terminal" (NVT).
Server TELNET than consider this NVT and transfer that into the format which is
acceptable by remote machine.
'
'
'
'
'
"
'
'
'
'
'.'- ...
.___ .,- .
-- --.__
5.3.3 (d)
Fig.
b)
In control character set from 8 bits; lower seven bits are the ASCII values and the
highest bit is represented as "1"( just replacing 1 on place of 0 in above fig)
Some examples of NVT control characters along with their binary representation
EOF (End Of File): 11101100
As mentioned earlier TELNET Client uses ephemeral port and TELNET Server
uses port 23.
Since TELNET contains data and control character sets for distinguish between
them special control characters are used like I AC (Interrupt As Control).
5.3.5 (f)
Fig.
Options:
To connect with the remote server and transfer data over it requires proper
connection between client and server TELNET.
Before the transmission of data both the ends negotiate options available and also
the features available.
Some examples of options are listed below;
0 - binary
1 - echo
represents status of
-s
gi
Option Negotiation :
Four control characters along with their code and meanings are considered as
follows;
Will - 251
possible
Do -253
Dont -254
It rejects the
selected option.
1.
Offer to enable :
2.
Request to enable :
3.
Offer to disable :
By using IAC, Do and ECHO commands client ask for the considering the data
transferred at sever side
The echo option is available on server side is stated using Echo, Will and IAC
Fig. 5.3.7
But on remote system this should be done by using special control character i.e. IP
(Interrupt Process).
As we are able to see in the figure the interrupt is occurred using IP and then server
sends aborted status to the application on server's side
5.3.8 h)
Fig.
Modes of Operation :
a)
Default Mode:
This mode is used if no other mode is selected from the option negotiation.
b) Character mode:
The client sends a character till full line is completed and sends echo signal to
server for displaying the data.
The client waits for go ahead command from server .It works as half duplex mode.
In this mode merits of both default mode and character mode combined together.
In the line mode the whole line is sent by client to server only after editing.
It is not as default mode because it does not wait for go ahead from server side
mode.
(i)
The parties should acknowledge the mode as they receive a mode change request j
SHell) (a)
Introduction:
Internet access has became a vital and available, it has become an essential replacement
for traditional couriers, telephone, and fax, as well as remote dial-up access to a companys
internal computer resources.
One of the biggest challenge in using the Internet is security.
Secure Shell is a protocol helps to provide authentication for secure users login
encryption for data security and data integrity to communicate with "several users in the
network.
Secure Shell provides following facilities :
It
provides file transfer which is secure, secure access of remote
machines and also having own commands which provides secure
programming
What is SSH ?
SSH is a protocol for secure remote login and other secure network/services over
an insecure network.
/
I
It is useful for entrusted hosts on insecure networks mostly when work from home
facility is available.
Commercial version
(c)
Working of SSH :
e)
If user uses protocols that can not be routed over SSH e.g. UDP based services or
user's client machines don't support SSH; then no need of using SSH.
Need of SSH :
authenticated login
The client initiates the connection. The server listens on port 22.
SSH version string exchange between client and server must end with "
\CR\LF".
All packets that follow the version string exchange is sent using the Binary Packet
Protocol. The exchange of data takes place between client and server.
After the fulfilment of requirement the TCP connection gets terminated between
the client and sever.
5.4
Protocol) (a)
Introduction
FTP Client: It send files or retrieve files by connecting to the FTP server.
In the FTP when client sent request to server for particular file server sends
response to client hence it is called as "request and response model"
(b)
It keeps control between Client Control Processes and Server Control Processes
during the communication
Using Client side command for establishing the connection with the FTP server,
sending FTP commands, receiving responses from the SERVER.
By using this FTP client-server model; FTP client can transfer commands, which
describe the functions to be performed, and the FTP Server replies to these
commands.
(c)
(d)
Data Connection :
It helps to transfer require data between Client Processes and Server Processes
during the communication.
It is supportive for listening commands coming from a Client over the control
channel on a data port, establishing the connection for the control channel
Receiving FTP commands from the Client and responding them and running the
SERVER commands.
Data Transfer Process (DTP)
FTP works on TCP connection. It needs two TCP connections between client and
server.
The well-known port 2i is used for the control connection and the well-known
port 20 for the data connection.
Every FTP implementation must support the use of the default data ports,
and only the USER-PI can initiate a change to non-default ports.
Both the Client-server Data Transfer Processes have a default data port.
The client sends FTP commands to the server, the server interprets them, runs is
DTP, then sends a standard response.
Once the connection is established between Client and Server, the server-Pi gives
the port on which data will be sent to the Client DTP.
The client DTP then listens on the specified port for data coming from the server
After the data transmission is over the connection between Client and Se: :
terminated.
1.
By using control commands the connection establishment takes place between Client
and server.
Passive Open by Server :
As shown in the figure firstly the Server will Passive opens the Control connection
Then as shown in the figure the Client actively opens the connection on port 62010
2.
(f)
FTP Commands:
Data structure
The nature of the action to be conducted like Retrieve, List, Store, etc.
There are three different types of FTP commands with some examples are listed below;
4.
Compressed c)
1. RETR It helps for retrieving copy of the file whose access path is given in
the parameters from the server DTP
2. STOR It helps to accept the data sent over the data channel and store them
in a file having the name given in the parameters.
If the file does not exist with the mentioned name, the server creates
it else overwrites, it,
3. DELE (delete) It helps to delete a file. The name is given in the parameters.
4. RMD (remove directory) It enables a directory to be deleted whose name is
indicated in the parameters.
5. MKD (make directory) It helps to create a directory . The name of the
directory to be created is mentioned in the parameters.
6. PWD (print working directory) It is useful to resend the complete current
directory path.
7. NOOP (no operations) It is only used, when there is a idle time between
client and server in order not to be disconnect the connection.
(g)
FTP Response
Introduction :
As we have seen FTP is request-response model; when server gets any request
command it reply using FTP response mechanism.
For each command from client; server try to answer it using appropriate response.
The responses are made up of using 3 digit code,
These 3 digit codes are difficult to remember by humans, hence it is accompanied
by a text.
The response codes are made up of 3 numbers the meanings of which are as follows;
1. The first digit: It recognize the status of the response (success or fail)
2. The second digit: It specifies what the response refers to.
3. The third digit: It provides a more specific meaning relative to each second digit
First Digit:
It shows the status of action requested has been fulfilled, a new command
can be sent.
This command helps to the client to formulate a different request. The command
has not been accepted since the action requested has not taken place.
Second Digit:
xOz Syntax
xlz Information
This response sends back an information for example a response to a STAT
command.
x2z Connections
It helps to show the response related to the login or the request to change
the account.
x4z File-transfer-protocol does not use this response.
x5z File system
system. (h)
protocol) (a)
Introduction
TFTP does not require authentication means no need of LOGIN while dealing with
it; hence we can say TFTP is less secure protocol.
Implementation of TFTP requires UDP, IP, and a device driver can fit on readonly
memory.
TFTP is also useful enough for diskless workstations but only for few Kbyte code.
The exchange between client-server takes place from the server only because the
server can read or write a file for client.
(b)
Message Types
- not defined
- Access violation
- Disk full
- Unknown port
- No such user
Each and every message format has 2 bytes reserved for OpCode ( Operation
Code)
The filename specifies the file on the server that the client wants to read from or
write to.
(c)
only positive
acknowledge
are
If sender does not receive ACK packet in appropriate time it re-sends the last
DATA packet.
TFTP uses port 69 as default port for sharing data within client and server.
Format (d)
Fig. 5.4.8 : TFTP Read Request Connection and TFTP rite Request
As shown in the Fig. 5.4.9 the connection can be established between client and I
server for data sharing.
Review Questions
Q. 1
Q. 2
Q. 3
Q. 4
Q. 5
Q. 6
Q. 7
Q. 8
Q. 9
Q. 10
Q. 12
Q. 11
i
Explain various multimedia compression techniques.
Q. 13
Q. 14
Q. 15
Q. 16
Q. 17
Q. 18
Q. 19
Q. 20
process.
Q. 21
Q. 22
Q. 23
Q. 24
Q. 25
Q. 26
Q. 27
Q. 28
Q. 29
Q. 30
Q. 31
____________________________________________________________________________
f?a
________________________________________________________________________________
y
Syllabus:
Electronic Mail:
Network Management:
SNMIP, Multimedia
____________________________________________
i
Web is collection of useful information and related resources interconnected via hyper
links.
World Wide Web is vast collection of information available on the Internet, which gives
data about any point at any moment.
For example some famous websites are:
www.google.com
www.wikipedia.com
www.yahoo.com
www.facebook.com
www.irtc.com
www.w3school.com etd
;
: :1
complex documents.
o
images, o
the
topic. o
sounds etc.
The Internet is really helpful for getting related information at only on a single click
and
without any hard work. The information can be used for a many of applications.
For example r
o
WWW
Instant messaging
Hyper linked i.e. Hypertext: the related web pages are linked with each other.
Graphical user interface : The front screen of any application.
Pictorial and non-text information : the images, videos, sound files are included in the
web pages for better clarity about the particular data.
Information that changes rapidly : the news flash, the weather forecast etc are updated
instantly on web.
Immediate access : The WWW provides immediate access of any web site on a click.
Anyone can author a web site : As some one ready with new application he/she can
launched it via launching the web site.
standards: o
HTTP (Hypertext
transfer Protocol)
6.1.1
a)
Large numbers of documents which are part of WWW are called as Web Pages.
Most of the documents are constructed,, designed and written using spec:a
languages called as "HTML" i.e. Hyper Text Mark up Language.
b)
Web Browser:
Users can view the information available on the web through the software
programs called "Web Browsers"
Internet
Explorer o
Opera o
Chrome
c)
Hyperlink:
The WWW content can be navigated by clicking the hyper links i.e. the Underlined or
Each page of information on the web has a unique address called the URL by
which it can be found.
The email address is related with an individual and it helpful for storing emails.
These web pages or documents are classified based on their working as follows:
a)
Static Document
The static categories of web document are shown in the given figure.
The contents remains same on the web server, each request for a static docume*
results in exactly the same response.
The HTML is basic example of static web document which is helpful over the internet
for transferring any kind of document. It is basically useful for static documents which
contains useful information's.
1)
Introduction to HTML
HTML is a universal, simple language for formatting text called as "Hyper Text
Mark-up Language".
HTML useful for embedding of graphics like images, videos, charts etc and
linking of documents via 'hyperlinks'.
HTML is a language which provides the response documents to the client from
the server. It is used to specify the document retrieval across the Internet using
browsers.
Mostly all the responses for any request of client on the web are in HTML
documents.
1.
.....................................................................................<html>....</html>,
HTML file can be save with the extension as .htm or .html anywhere in the
system.
HTML tags are non case sensitive. It means we can write using "Upper case or
Lower case".
2)
Tag format:
Tas format of naked tag with start and end tag is shown below :
We start and end with <html > paired tag to notify the browser that the web page is
of
HTML format.
1.
Head:
It gives information related with the document like name of document etc
..
In the example the <title> tag can be used in <head> tag to mention
the Name of the document
2.
Example:
Body:
It gives the main content of document along with the formatting provided on
content.
In the example the heading using <hl> tag and paragraph using <p> tag
included in the paired <body> tag.
Out
put:
For example:
Bold Faced Tag:
It is useful to format the text between the tags with the bold format. When
the text is displayed on screen it shows the data with bold letters.
document.
b)
Dynamic Document
to server.
The contents of a dynamic document can vary from one request to another.
Dynamic web page covers any web page generated differently for each user like
the online shopping site.
The user browse through the site and ask for his/her required, items then server
replies with the specific and related information via a web documents. These
documents various from user to user.
It gives current information to the client but once the documents retrieved the
content cannot be changed.
c)
Active Documents
6.2 HTTP
__________________________________________________________
For transmission of the web pages over the Internet HTTP protocol is very helpful
which gives some rules to be followed while doing the flawless transmission of the web
documents.
The standard Web transfer protocol is HTTP (Hyper Text Transfer Protocols). It is used
for document exchange between servers and clients on the web
It follows Client-Server model in the HTTP Request- HTTP Response pattern.
6.2.1
How it Works :
HTTP Request: To retrieve a document, the client first sends a request to the web
server and waits for a reply. It contains main parts like;
Header lines
HTTP Response: An HTTP daemon/service i.e. a program which waits for Http
requests on the server then handles the request and the document is sent to the client over a
connection established using TCP/IP - Transmission Control Protocol / Internet Protocol.
It contains main parts like;
Status line
Header lines
Response body
Protocol is nothing but the set of rules/standards which we follow for communicating
over the Internet.
The Server replies with a HTML document related with the users requirement.
In this method URL specifies all the name value pairs are submitted as a query string
with the help of special characters.
The name-value is not protected as it is visible in plain text format in the Location bar of
the web browser.
We have to take special care for encoding data if special characters like ampersand (&)
etc are present in the GET method since already the name-value displayed using the
special characters.
i
Length of the string is restricted in the GET method. We are not able to pass the data
with large memory.
GET is the default method; if method is not mentioned in the Form tag.
Data is always submitted in the form of text over the Internet using GET method.
POST Method :
All the name-value pairs are submitted in the Message Body of the request not
considered in the location bar of the URL.
Post Method is secured because Name-Value pairs cannot be seen in location bar of the
web browser.
If the service associated with the processing of a form has side effects for example,
modification of a database or subscription to a service; then the method should be POST.
Length of the string i.e. the amount of data submitted isnot restricted.
Data is submitted in the form as specified in encryption type attribute of form tag.
Limitations :
Stateless : HTTP is stateless protocol means it does not keep any information for future
use.
.3
Electronic Mail________________________________________________
By using HTML we are able to generate web pages. With the help of HTTP protocol
we are able to send an electronic-mail. These e-mails are send between client and server over
the world wide web via some protocols. These protocols helps to transfer the messages from
client to server and also by using some protocols servers are able to retrieve an e-mails.
Some major protocols are explained in this point along with their working. Electronic
mail requires several applications and services like Application layer protocols to transfer
over the Internet;
1. Simple Mail Transfer Protocol (SMTP) - sending email
2. Post Office Protocol (POP/POP3) - retrieving email
3. Hyper Text Transfer Protocol (HTTP) - world wide web
6.3.1 SMTP
Electronic mail requires several applications and services like Application layer
1. SMTP stands for Simple Mail Transfer Protocol. The SMTP designed to be a very
simple process to connect and read mail.
2. Simple Mail Transfer Protocol it is a standard application layer protocol for Electronic
mail transfer.
3. This process designed to be used over the Internet; when the Internet was young and
when the primary purpose of the Internet was to provide a way to share documents and
information.
(i)
(a)
SMTP Components :
Mail servers
User Agent:
The User Agent handles composing, editing, reading, saving mail messages e.g.
Outlook, Mozilla
On the mail server the outgoing, incoming messages are stored on mail
server
Mail Servers :
Servers mailbox contains incoming messages for the user from the remote machine.
j
Outgoing message queue of mail messages are also maintained on the mail server.
SMTP protocol works as Client- Server model to send email messages (i)
Client helps for sending mail to server.
(ii)
1.
Mail Transfer Agent (MTA) process is used to forward e-mail from client MTA to I
Server MTA on the local server
2. The Mail Deliver Agent (MDA) can resolve final delivery issues, such as vinu
scanning, Spam filtering, and return-receipt handling
As shown in the Fig. :
First it will confirm from server that whether the needed servers mail box
exist or
not.
If the needed servers mailbox does not exist then client will search on other
servers till getting the needed server.
After getting the server client will transfer the mail via TCP connection to the
servers mail box.
(d) SMTP
Architectures: i)
First Scenario:
The sender and receiver of the email are users on the same mail server
They are directly connected to shared mail server i.e. Both the sender and
receiver are having the same mailbox on the same system.
ii)
Second Scenario:
The sender and receiver of the email are users on two different mail servers.
The message is need to be send over internet on the individuals Mailbox. User
A
User B
6.3.4 iii)
Fig.
Third Scenario:
One user is directly connected to mail server and the other one is
separate: from mail server and connected vis LAN / WAN.
6.3.5 iv)
Fig.
Fourth Scenario:
Both the Sender and receiver are separated from mail server and
connected via LAN/VAN
(e)
SMTP Working :
At the Client side; SMTP Client sends mail to the SMTP Server's mail box
Then the mail is transferred over the internet to found the required Destination's
mailbox.
Fig. 6.3.6
(f)
Address Format:
To send any message; receivers address as well as to know who is sender we need
to specify the respective address of client and server. The message format is as shown in
the figure;
First part contains the name of a client/server mail box on its local site.
(g)
EMAIL System :
Following figure explain the email transmission over internet:
Client i.e. User A generates mail into its Spool by using interface through
User Agent.
Then the Client Mail Transfer Agent transfer it over the internet.
The server Mail Transfer Agent receives the mail and saves it into the Server's
mailbox.
Then Server i.e. User B able to read the mails from its own mail box through User
Agent over the communication channel using interface.
And same process steps are followed when User B wants to send mail to User
A.
(h)
Connections in SMTP :
Three major steps of SMTP connection between Client and Server are :
1. Connection Establishment
2. Message Transfer
3. Connection Termination
1.
Connection establishment:
As shown in the figure the MTA Server sends ready message to MTA Client
If MTA Client wants to accepts this message then replies with HELO
message
2.
Message transfer:
the
Header : It
3.
Connection Termination:
After the successful transfer of message MTA Client sends Quit message to
MTA Server.
(i)
The commands are given by client to server and the response related with that
commands are passed from server to client.
SMTP
command
ATRN
SIZE
ETRN
PIPELININ
DATA
DSN
RSET
VRFY
HELP
QUIT
The command and response are forwarded between client and server in the form of a three
Resets the buffer and clear the entire message transferred till that
time.
digit number and it is followed by text which explain about the reply from the server. For example :
220 Server Ready 500 Syntax error, command unrecognized. The list of reply codes are shown
below: Most of them will not occur if mail server programmed correctly.
2
Indicates a system status or help reply.
11
2
Describes the help Message.
14
2
Indicates that server is ready.
20
21
50
51
The server will forward the mail message but the specified receiver is not
local.
It indicates that sender can start sending the main part of message.
54
4
Save the mail messages and then the mail server will be shut down.
2
4
The mailbox is busy wait and try again.
5
4
Error occurred : The requested action not completed.
54
Mail server ran out : The requested action not completed due to the lack
5 of system storage.
25
00
01
02
03
04
5
The parameters of the last command not implemented by the server given
by client.
50
51
53
5
message will a receivers address.
5
Syntactical error : The specified mail address not syntactically
correct.
5
The mail transaction has failed due to unknown causes.
c
o
n
54
6.3.2 IMAP:
For retrieving the e-mail programs or messages from various systems over the network we are
able to use two mail access protocols:
In a POP, client system stores e-mail messages in user's mailboxes on users system and keeps
record of operations on messages like user have been read, replied to etc.
POP client able to delete old messages from the server's system without users nermissinns.
In the IMAP e-mail account, the original messages will remain on the
server, along with
operations performed on it like user read, replied to, or forwarded a
message.
(a)
Introduction:
IMAP is useful to access messages from more than one computer in the network.
IMAP protocol based on a TCP connection and works on default port 143.
IMAP generally leave messages on the server until the user commands for deleting
them.
It is not necessary that; client should know the details about server's file format.
As shown in the Fig. 6.3.14 the client able to interact with many servers at the same
time.
Client can decide where to store the mails like on server's mail fo,lder or on local J
mail folders.
*
The mails are not deleted until client explicitly deletes them.
(b)
Functionality:
1. IMAP Server's directory is considered as local directory hence work directly on
server.
1. It performs operations on different folders like copy, delete, modify etc.
3
4
Using IMAP users are able to download message headers and later on the full
messages.
Connection initialization
Connection termination
(c)
(d)
For example "A001" is generated for every new command then the command
with corresponding arguments followed.
(i)
(ii)
(iii)
Server response with the same tag with a state like "OK/NO/BAD"
(iv)
Untagged information can be sent at any time between client and server.
Most commands of IMAP are only valid in special states otherwise: protocol error
States are;
1. Initialization : In this state the session using IMAP Server and IMAP Client is
started.
2. Non-Authenticated : After connecting with IMAP server If Client's Status is
Unauthenticated then the Client's session is terminated and Logout state takes
place.
3. Authenticated : If the client is already having authentication then Client will
Login and starts the session with IMAP Server.
4. Selected : After the session has started the Client will work on the selected data as
per the requirement.
5. Logout, Closed : At the end after the completion of work the termination of
connection takes place i.e. the Logout state.
4.
(e)
1. It consists of the list of token related with the message and sent by the server
2. A flag indicates permanent or session-only
Types of Flag:
6. System flag:
7. (i)
(ii)
8. (i)
(ii)
listed below :
9.
mailbox.
This session is the first session related with this message.
10. (f)
COPY - It indicates the mailbox-name from which user wants to copy some data
11. (g)
12.
Login:
We login using user's account and password, not "abc" and "xyz"!
Commands:
a071ogout
Multiple clients at the same instance connected to the same mailbox using IMAP.
IMAP can create e-mail folders on the server; these folders are accessible from
anywhere. If POP is used and create e-mail folders, they are stored locally then user
cannot access these folders from anywhere except the computer on which user created
them.
15.
16.
6.3.3
POP 3 :
Post Office Protocol3 (POP3) is other mail access protocol which is widely
used but it has some drawbacks as compared to the IMAP.
17.
18.
Multiple clients at the same time can be connect to the same mail box.
It downloads all emails from remote machine to client's machine mailbox into 1 mail
folder which is known as "Inbox".
19.
20.
Due to many facilities and features IMAP has some additional complexity and overhead
but still it is considered as best because for the purpose it is invented it gives best
outcome.
POP just shows you what is in your inbox on the Users mail server, it checks the server
for new messages, downloads all the new messages in your inbox onto your computer,
and then deletes them from the server.
21.
The POP3 Client first log in to the POP3 server using user name and password After
the successful reply from server side client ask for the detail information about his mail box on
server.
22.
23.
Server displays the list of emails along with other required information.
Then client starts retrieving/reading the emails from the server's mail
box.
24.
6.3.4
Fig. 6.3.17
25.
Graphics image
Voice files
26.
model. Sender:
After receiving the encoded mail it decodes message to extract original binary
value.
28.
As shown in the figure users i.e. Client / Server able to ad non ASCII code like
Graph:. in the mail using MIME ; which converts that data in ASCII code and easily transferable
using SMTP over the internet.
29.
30.
(a)
Message Format:
(b)
Header:
31.
32.
33.
Email header:
It contains data about sender and receivers address along with the specification
of , subject.
34.
35.
MIME header:
36.
37.
Version:
38.
39.
It specifies the type of data used in the main information. Content type and sub
types are separated by the " / " (slash) Seven Basic MIME Tvoes :
40.
41.
42.
encoding used:
43.
45.
Content explanation:
46.
47.
Example:
48.
To: xyz@example.edu MIME Header: MIMEVersion: 1.0 Content-Type: image/jpeg ContentTransfer-Encoding : base64 Body:
49.
50._________________________________________________________________________ 6
.4 Network Management______________________________________
51.
1. Network Positioning
2. Network operations
3. Network Maintenance
52.
The above three classifications are.further divided into the sub parts as shown
in the figure
53.
Loss of connectivity
Duplicate IP address
Intermittent problems
Performance problems
54.
55.
The network management plays an important role to avoid all the problems
associated with the network related issues.
56.
57.
58.
(i)
Network Agent
59.
(ii)
Network objects
60.
To avoid this network related issues we use SNMP i.e Simple Network
Management Protocol.
61.
62.
63.
6.4.1
64. (a)
65.
67.
68. Fig.
6.4.3 (b)
It means Client system i.e. System Manager "pulls' data from the server i.e. ago*
2. An agent
73.
(c)
74.
SNMP
Components : Agent:
The agent collects data from various the network device and store it in MIB.
Agent executes all the MIB objects that are relevant to each other.
The agent provides the information through the MIB for management usages.
(d)
The network management on the Internet is done by using three protocols like
SNMP, SMI, and MIB.
(e)
Fig. 6.4.5
SNMP packet values that is status can be read and changed using SNMP.
SMI specifies the general rules for naming objects, defining object types
including range and length and also showing how to encode objects and values.
The SMI helps to define the data types that are allowed in the MIB.
It helps to create a collection of named objects, their types, and their relationships to
each other.
The MIB is nothing but a collection of network information from various network
devices.
This information is stored in databases fro the management related work and the
information is retrieved with the help of protocols like SNMP.
reset.
Number of clock ticks :
It help to get a number of clock ticks since the last reset of a system.
(g)
A tabular object describes a group of object instances that are found in MIB I
tables.
Comparing computer programming and network management:
As shown in the Fig.6.4.6 the SNMP in network managementworks for coding in
computer programming
The MIB works for objects declaration and definition in computer programming.
(h)
Management overview:
(i)
As shown in the Fig. 6.4.7 manager receives the UDP user datagrams
(ii) Then the datagrams are send over the network to check the details from various
protocols like SNMP,SMI and MIB.
(iii) The group of three protocols sends response of particular datagram that acts as
packet to the manager in the network.
(iv) Then SNMP packet is sent from manager to agent with the help of GetRequest
command (v) The Agent sends SNMP packet as response to manager's request for
particular
packet.
(vi) Manager sends reply to a management question about particular packet over the
network.
(i)
Ports and UDP :
SNMP uses UDP i.e. User Datagram Protocol as a transport mechanism for
transmission of SNMP messages over the network
UDP
UDP port 162
As it go upwards in the OSI layers the datagrams are added with SNMP messages like
udp datagram, IP packet and Ethernet frame along with CRC i.e. Cyclic Redundancy code. (j)
Object Identifier:
(k)
Each agent has its own MIB2, which is a collection of all the objects that the
manager can manage.
MIB-2:
These groups are under the mib-2 object in the object identifier tree as shown in the
figure. Each group has defined variables and/or tables.
Fig. 6.4.10
UDP ports:
As mentioned in above MIB-2 objects we will consider udp port. UDP port further
classified into 5 sub-objects groups are listed along with their object identification code as
follows:
Fig. 6.4.11
codes.
For example
UdpLocal Address : 181.23.45.14 and'the udpLocal Port No: 23 etc.
Fig. 6.4.13
Lexicographic ordering :
In the Lexicographic ordering first we consider the udpLocal address then the udpLocal
SNMP Operations :
Four basic operations of SNMP are as follows :
The SNMP manager and SNMP agent connection takes place on UDP connection.
The message transfer between Client and Server uses SNMP operations. As shown in the
figure the client - Server Connection is done using operations like; SNMP Manager to
SNMP Agent Operations :
GetRequest, GetNextRequest, GetBulkRequest, SetRequest
InformRequest and Report are two messages which are transfer between managers
SNMP PDU :
It has fields
Request ID:
It gives a sequence number of particular request of SNMP message.
GETBulk Request.
(i)
Request, (ii)
Fig. 6.4.17
Some PDU types along with the tags in Binary and Hex are listed down in the
following table:
Some SNMP PDU errors are listed down below along with the meaning
in the table:
Languages of SNMP :
SNMP Messages:
In the figure GetRequest PDU is shown along with the various variables and their
Fig.
Ras
Passive open by both Client and Server by using Port 162 and 161 respectively.
After the passive open, the client active opens the application on respective port
(i.e. 68000).
Then server active opens the application on respective port (i.e. 61150, sending a
trap message.
SNMP
Security :
Security :
By using SNMP version-3 managers are able to choose the different levels of securit)
according to the requirement of the network and also depends upon the data which user ( an
agent) wants to forward.
While considering the security levels different aspects of security configurations
administration policies where without administrator also the the security of devices can :
maintained.
6.4.2 Multimedia
1.
Introduction
People access internet not only for text but for audio video search as well.
2.
Multimedia Services
The audio video services on internet are generally divided in three categories.
These file can be accessed by various internet users by downloading it from the
network,
Working
End user sends GET request to server machine to which web server sends
response.
Example
In this type of multimedia user accesses the broadcasted audio and video
Fig.
6.4.21 Example
o Live Cricket matches broadcasted on internet
Multimedia can be used to communicate with people over the world and attached
by internet.
Fig. 6.4.22
Example
MP3 uses frequency and temporal masking for compressing audio signal.
MP3 can produces data rates 96 kbps,128 kbps and 160 kbps.
JPEG compressed images can be used to hide data for secret internei
communication.
The remainder of the signal is called the redundancy because it can be worked out
at the decoder from what is sent.
Fig. 6.4.24
Review Questions
Q. 1
Q. 2
Q. 3
Q. 4
Q. 5
Q. 6
Q. 7
Q. 8
Q. 9
Q. 10
Q. 11
Q. 12
Q. 13
Q. 14
Syllabus
Concurrent Connection Oriented (TCP) programming
Concurrent Connectionless (UDP) programming
Iterative connection oriented (TCP) servers programming
Iterative connectionless (UDP) servers programming
____________________________________________________________________________________
7.1 Sockets
___________________________________________________________
1.
Introduction
The Sockets are bidirectional that means any of two sockets is capable of both
sending and receiving data.
Client
3.
A client is a system that accesses the remote service on another computer using
network.
The application that initiates communication is generally called as client socket
4.
Server
The application that answers the client socket as generally called as server socket.
7.2
Socket Interface_____________________________________
1.
Introduction
below,
i.
Socket layer
ii.
Protocol layer
In above diagram client process on the left with the socket layer under it and the
protocol layer and device layer adjusted below it.
Corresponding layers are exists below the Server process on the right.
A line showing the network runs through all layers and connects the server
with client processes (in above diagram U shape line).
Fig. 7.2.2
The Internet does not follows entire OSI model but rather merges several of the
protocols layers together.
After initial connection phase anyone the client or the server is capable of
sending
or receiving data.
Fig. 7.2.3
Datagram sockets
2.
3.
Raw Socket
Sometime protocols like ICMP and OSPF uses services direct from IP.
____________________________________________________________________________________7
.4 Ports____________________________________________________
1.
Introduction
Problem arises when different applications trying to use the same port numbers on
one host is which should be avoided by writing applications to request an
available port from TCP/IP.
Because this port number is dynamically assigned, it may differ from one
invocation of an application to the next.
2.
Categories
Port numbers are divided into three different categories as given below:
i.
ii.
iii.
iv.
i.
ii.
Port 49152-65535
i.
ii.
IPC
Socket programming is used for implementing IPC (Interprocess communication)
with Java programming.
Unicast
In this transfer data is sent from one process to another single process.
Multicast
In this transfer data is sent from one process to more than one process at the same point
of time.
Broadcast
In this transfer data is sent from one process to all other available processes at the same
time.
Fig. 7.5.2
____________________________________________________________________________________
Introduction
Data is added into the stream by a sender process which is also called as the
server
Data is extracted from the stream with help of receiver process which is also
called the client.
2.
Working
The server process first creates a connection socket and then listens for
connection requests from other processes.
Socket is closed when the communication session between the two processes is
over.
The data and the server process is now free to accept another connection request.
3.
Problems
This problem can be solved by spawning threads, one for each incoming client
connection request and each thread will individually handle the particular client
from a source to a destination.
4.
The common key Methods of the Stream-Mode Socket API are explained given
below;
5.
ServerSocket(serverPortNumber):
Specify that the connection needs an arbitrary, unused port on local machine
and
E.g.
E.g.
PrintStream socketOutput = new PrintStream(dataSockct.gctOutputStream());
Or otherwise
DataOutputStream os = new
DataOutputStream(dataSocket.getOutputStream()>:
protocol
E.g.
socketOutput.println(message);
Or otherwise
E.g.
6.
connectionSocket.close();
a.
b. Create a Socket
Object
E.g.
BufferedReader br =
new BufferedReader(new
InputStreamReader(clientSocket.getInputStream()));
Or otherwise
is = new DataInputStream(clientSocket.getInputStream());
os = new DataOutputStream(clientSocket.getOutputStream());
E.g.
System.out.println(br.readLineO);
Or otherwise
E.g.
clientSocket.close();
>
Program 1 : Socket program to send sample message from
server to client when it connects to server using TCP.
Output:
Output
Out
put
7.7
1.
UDP is unreliable and does not guarantee the delivery of packets in same order as
they sent from server.
2.
Working
Any process that wishes to send or receive data using the datagram socket API
must instantiate a DatagramSocket object, which will be bound to a UDP port of
the machine and it is local to the process.
Fig. 7.7.1: Program flow in the sender and receiver process (adapted from [2])
a.
Sending Process
b.
Receiving Process
This local port corresponds to the port number carried in the datagram packet
of the sender.
c.
Process
Figure
3.
explained
4.
c.
Specify that the connection needs
an
arbitrary,
unused
protocol
port
on
local
machine and allow UDP to select one and Specify the server to which messages
must be sent.
b.
E.g.
DatagramPacket packet =
new DatagramPacket(buffer, buffer.length, receiverHost, receiverPort);
my Socket, send(packet);
d.
protocol
E.g.
mySocket.send(packet);
e.
Close the
socket
E.g.
mySocket.close();
>
Output:
Output:
Out
put
Out
put
In above example, tagramSocket is a binding call. Once a datagram packet arrives at the
receiver at the specified local port number where socket is opened and extract the bytes
stored in the datagram packet to a String.
Parameters are passed as,
Message to be sent
The sender program has nothing much to do after sending the message and hence the
socket is closed.
Similarly, the socket at the receiver side (UDP_Client) is also closed after receiving and
printing the message.
____________________________________________________________________________________
Introduction
There are number of clients connected with a single server so it faces many
challenges while handling these client requests at a same point of time.
2.
An iterative server is a server program which handles only one client program at
any point of time.
3.
Connectionless services are like sending a postcard via post sender assumes that
receiver will get it.
4.
'
While stateless servers do not maintain state of connected clients and thensessions.
1.
Introduction
An iterative server is a server program which handles only one client
program .
any point of time.
2.
Working
c. Sometimes clients may have to wait for longer period of time for the requests
in
the waiting queue to be processed by server.
d. When the client requests differ in the amount of time they take to be handled :
the server, it would then lead to a situation where a client with a lower execution
time for its request at the server may have to wait for the, requests (ahead in the
queue) that have a relatively longer execution time to be completed first.
e. Every server should specify INADDR ANY as internet address while binding
f.
7.9.1
Introduction
1.
> An iterative TCP server is a server program which handles only one client
program at any point of time by establishing a connection between client and
server.
The client program will work like a simple client socket program, whereas only
the algorithm for the server is modified.
Interactive servers are used when the server process knows in advance how long it
takes to handle each client request and it handles each request by itself.
i.
ii.
A client may have to wait if the server is busy at that point of time ,
2.
Accept the next connection request from the socket, and obtain a new
socket for the connection
client
E.g.
BufferedReader br =
new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
PrintStream ps = new PrintStream(clientSocket.getOutputStream());
3.
E.g. clientSocket.close();
Example
a. The example code is to find factorial of number sent by a client program and
return the factorial value to the requesting client.
b. In order to simulate the effect of time,consuming client requests, we make the
server program to sleep for 200 milliseconds after performing each addition.
c. As iterative servers are single-threaded programs, the whole program sleeps
when
we invoke the sleep() static function of the Thread class.
>
Program 3 : Socket program to compute and send factorial of
number from server to client.
Output:
Output:
7.9.2
1.
Introduction
An iterative UDP server is a server program which handles only one client
program at any point of time without establishing any connection between client
and server.
The client program will work like a simple client socket program, whereas only
the algorithm for the server is modified.
This UDP protocol is unreliable and does not guarantee the end to end delivery of
packet.
Concurrent servers are used when the server process knows in advance how long
it takes to handle.
Each client request only a Single copy of server runs at all times.
2.
Create a socket and bind it to the well known address for the service being
offered.
Now repeatedly call recvfrom to receive the next request from a client.
DatagramPacket packet =
receiverPort);
Perform all task and processing the data coming from the client.
f. Go to (c) or...
g. Exit
Introduction
A concurrent TCP server is a server program which can handles multiple client
programs at any point of time by establishing a connection between client and
server.
The client program will work like a simple client socket program, whereas only
the algorithm for the server is modified.
2.
E.g. : mySocket.send(packet);
Form a reply according to the application protocol and send it back to the
client using sendto process.
Working
When a client request is received, the server process generates a separate thread.
which is exclusively meant for a particular client.
So, if a program has to sleep after each processing step, it would be the particular
thread (doing that processing) that will sleep and not the whole server process,
which was the case with an iterative server.
While a thread of a process is sleeping, the operating system can schedule the
other threads of this process to run.
By doing above process waiting time of client requests with a relatively shorter
processing time, could be significantly reduced.
Code for the client program is independent of the design choice for the server.
In other words, one should be able to use the same client program with either an
iterative server or a concurrent server.
1.
Introduction
A concurrent TCP server is a server program which can handles multiple
client; programs at any point of time by establishing a connection between client
and server_
The client program will work like a simple client socket program, whereas only
the algorithm for the server is modified.
Concurrent servers are used when the server process don't know in advance how
long it takes to handle client request.
2.
d. Accept connection
Accept the next connection request from the socket, and obtain a new socket
for the connection
E.g. : Socket clientSocket = calcServer.accept();
e. Fork slave process
i.
E.g.
clientSocket.close();
ii.
E.g.
BufferedReader br =
new BufferedReader(new
InputStreamReader(clientSocket.getInputStream()));
iii.
Exit
f.
E.g.: clientSocket.close();
g.
Go to
(d) or...
h.
3.
Exit
Example
a.
The example code is to find factorial of number sent by a client program and
return the factorial value to the requesting client.
b.
In order to simulate the effect of time consuming client requests, we make the
server program to sleep for 200 milliseconds after performing each addition.
>
Program 4: Socket program to compute and send factorial
of number from server to client
PrintStream ps = new
PrintStream(clientSocket.getOutputStream( ));
ps.println(fact);
ps.flush();
clientSocket.close( );
}catch(Exception e){e.printStackTrace();}
}}
class ConcurrentTCPServer
Try{
--------------------------------System.out. println("............---------------
---------------------------------...................");
Server");
........................................................System.out.println("--------------
...................................................--.......................");
while (true) {
_____________________________
Run ConcurrentTCPServer.java program using Java command pass port number as argument
in
below program 1111 is port number.
Output:
Output:
Run FactClient.java program using java command pass port number as argument in
below
Output:
(UDP) 1.
Introduction
The client program will work like a simple client socket program, whereas only
the algorithm for the server is modified.
concurrent servers are used when the server process don't know in advance how
long it takes to handle each client request.
2.
Create a socket and bind it to the well known address for the service being
offered.
Now repeatedly call recvfrom to receive the next request from a client.
i.
Perform all task and processing the data coming from the
client,
ii.
; iii.
E.g.
mySocket.send(packet)
Exit
E.g.: mySocket.close();
f. Go to (c) or...
g. Exit
Review Questions
Q. 1
Q. 2
Q. 3
Q. 4
Q. 5
Q. 6
Q. 7
Q. 8
Q. 9
Q. 10
Q. 11
How does Server Socket receive incoming request from client and how does it
terminate connections.
Q. 12
Q. 13
Explain Socket Class and Server Socket Class with their methods.
Q. 14
What is Socket ? Which function create socket ? what are its argument ?
Q. 15
Q. 16
code.
Q. 17
Q. 18
Q. 19
Q. 20
Write simple client/server application which will print present time to any client
code.
which is
connected server without reading anything from client.
Q. 21
where
client send number to server and server returns to server square up that number.
Q. 22 Write client server application using Socket and ServerSocket where client send
number to server and server returns reverse of that number.
Q. 23 Write client server application using Socket and ServerSocket where client send
Two number to server and server returns addition of those number.
Q. 24 Write client server application that construct to socket object to connect to host
port using TCP. It must give message 'Connection Establish' on setting connection and
"connection Terminated" on closing connection other errors should handle with proper
messages.
Appendix A J
> Practical 1 :
List Of Practiais
Practical 2 :
RIP.
> Practical 3 :
the network.
> Practical 4 :
Practical 5 :
datagram.
> Practical 6 :
> Practical 7 :
> Practical 8:
> Practical 9 :
server and the server send date and time to the client.
> Practical 10 :