Professional Documents
Culture Documents
. -
ISO/OSI
TCP/IP
(, ,
)
! (ISO/OSI TCP/IP
).
...
(Connection
Oriented)
(Connectionless)
4 ()
Request () (N+1)-
N- , ().
.
Indication ()
,
Response ()
, .
Confirm ()
o
Request.
?
?
?
?
LISTEN -
CONNECT -
RECEIVE -
SEND -
DISCONNECT -
Client Server
,
.
!
vs.
WEB HTTP
:
: HTML ,
java , , , ...
Web
HTML
.
URL
(Uniform Resource Locator)
URL
http://www.famis.edu.mk/sliki/bitola.jpg
Client-Server
equ
est
PC - Windows HT
TP
res
pon
se
: web
(web browser) ,
web HTML
WEB
(Apache, SunOne, Microsoft
IIS, Google GWS)
HT
TP
r
st
e
u
eq
r
se Server
P
n
T
o
p
running
HT
es
r
TP
Apache Web
T
H
server
PC - Linux
HTTP
TCP
TCP (
socket) 80
TCP
HTTP
web (HTTP ) web
(HTTP )
() TCP
HTTP
RTT
RTT
time
time to
transmit
File Tt
time
HTTP
HTTP
request ()
response ()
HT
TP
r
equ
est
PC - Windows HT
TP
res
pon
se
st
e
u
req
se Server
P
n
T
o
p
running
HT
es
r
P
T
Apache Web
HT
server
PC - Linux
HTTP request
request line
(GET, POST,
HEAD commands)
Carriage return,
line feed
indicates end
of message
HTTP response
status line
(protocol
status code
status phrase)
header
lines
data, e.g.,
requested
HTML file
HTTP/1.1 200 OK
Connection close
Date: Mon, 09 March 2009 12:00:15 GMT
Server: Apache/1.3.0 (Unix)
Last-Modified: Mon, 09 March 2009 ...
Content-Length: 6821
Content-Type: text/html
data data data data data ...
HTTP response
200 OK
request , ...
( redirecting) ...:)
URL
HTTP
HTTP/1.0
GET
POST
HEAD
HTTP/1.1
GET, POST, HEAD
PUT
upload
URL
DELETE
URL
:
telnet yahoo.com 80
GET /autos/
Apache HTTP
Windows
Linux
XAMPP (Windows, Linux)
httpd.conf
HTTP
FTP
file transfer
file
system
FTP
remote file
system
/ ()
(
)
/
(remote host)
FTP
21,
TCP
21
,
,
21
,
20
,
.
FTP
client
FTP
server
TCP
(Data
Connection)
,
20
. out of band.
FTP
.
FTP ( )
: ASCII
(FileZilla, CuteFTP, WiseFTP, Commander)
ftp
http://www.the-eggman.com/seminars/ftp_error_codes.html
http://www.ftpplanet.com/ftpresources/ftp_codes.htm
.
1xx ....
2xx ....
3xx - , ....
4xx .....
.....
.....
10xxx .....
:
mail
simple mail transfer protocol:
SMTP
outgoing
message queue
user mailbox
user
agent
mail
server
email mail reader SMTP
,
email
mail
: Eudora, Outlook,
server
elm, Netscape Messenger
outgoing (), incoming
() server
user
agent
SMTP
SMTP
user
agent
user
agent
mail
server
user
agent
user
agent
outgoing
message queue
Mail Servers -
mailbox email
message queue
mail
server
()
SMTP protocol -
email
SMTP
/
email
mail
client:
server
email !!!!
server: e
email !!!!
user
agent
user mailbox
user
agent
SMTP
SMTP
user
agent
user
agent
mail
server
user
agent
user
agent
, TCP email
25
: (sending server to receiving server)
handshaking ( )
/
commands: ASCII
response:
7- ASCII
:
email
1)
2)
3)
4) SMTP
TCP
5) Email ja
(mailbox)
6)
email .
( )
email
goran@mailserver2
email email
. ()
mailServer1
SMTP
, TCP
email .
1
user
agent
?
2
mail
server1
3
SMTP
mail
server2
?
6
user
agent
SMTP
S
C -
S: 220 manu.edu.mk
C: HELO server1.mk
S: 250 Zdravo server1, OK
C: MAIL FROM: <korisnik@server1.mk>
S: 250 korisnik@server1.mk... Sender ok
C: RCPT TO: <xmail@manu.edu.mk>
S: 250 xmail@manu.edu.mk ... Recipient ok
C: DATA
S: 354 Daj mi go emailot, za kraj vnesi "." na krajnata linija
C: Zdravo kako si?
C: Sto ima novo?
C: .
S: 250 Porakata e primena za dostava
C: QUIT
S: 221 manu.edu.mk closing connection
SMTP: protocol
email
RFC 822:
:
header lines
To:
From:
Subject:
SMTP
!
body ()
, ASCII
header
body
blank
line
MIME
multimedia data
type, subtype,
parameter declaration
encoded data
From: nikola@manu.edu.mk
To: nikola@yahoo.com
Subject: Slika.
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Type: image/jpeg
base64 encoded data .....
.........................
......base64 encoded data
user
agent
SMTP
senders mail
server
user
agent
receivers mail
server
SMTP: email
POP: Post Office Protocol [RFC 1939] 110
/
IMAP: Internet Mail Access Protocol [RFC 1730] 143
()
...
HTTP: Hotmail , Yahoo! Mail,
POP3 protocol
:
user: username
pass:
+OK ( !)
-ERR (!)
, client:
list:
retr:
dele:
quit ()
S:
C:
S:
C:
S:
C:
S:
S:
S:
C:
S:
S:
C:
C:
S:
S:
C:
C:
S:
list
1 498
2 912
.
retr 1
<message 1 contents>
.
dele 1
retr 2
<message 1 contents>
.
dele 2
quit
+OK POP3 server signing off
on
IMAP
( )
POP3
(stateless)
..
HTTP FTP
Windows Linux
Linux Server (SuSe Linux, Ubuntu Server)
Windows Server 2003 (IIS)
Apache Web Server (Windows, Linux)
FileZilla FTP Server (XAMPP)
XAMPP ( Windows Linux)
Vsftpd (Linux)
DynDNS?
(Transport Layers and Services)
application
transport
network
data link
physical
network
data link
physical
network
data link
physical
gi
lo
l
ca
network
data link
physical
en
den
d
tr
network
data link
physical
or
sp
an
network
data link
physical
:
send sid (
):
rcv side ( ):
()
,
.
:
Internet: TCP UDP
application
transport
network
data link
physical
:
?
:
:
:
12 -
12
-
=
=
=
transport protocol =
network-layer protocol =
()
(MUX/DMUX)
?
()
?
()
MUX/DEMUX
MUX :
,
(header)
()
DEMUX :
() ,
= socket
application
transport
network
link
= process
P3
P1
P1
application
transport
network
P2
P4
application
transport
network
link
link
physical
host 1
physical
host 2
physical
host 3
application
transport
network
link
P3
P1
P1
application
transport
network
P2
P4
application
transport
network
link
link
physical
host 1
physical
host 2
physical
host 3
UDP ,
DEMUX,
TCP
(, ) Reliable
Ordered (
/ )
Byte-Stream (
)
Full Duplex
.
(Flow and Congestion Controll)
handshaking
UDP
UDP ()
UDP
(lost)
(disordered)
.
header
DEMUX
UDP...
(streaming)
:
32 bits
UDP
Source port #
Dest port #
Length
Checksum
Application
data
()
:
DNS,
SNMP
UDP
UDP Checksum
:
(Sender):
16 bit
Checksum: ,
(Source Port,
Destination Port, Length)
Checksum
Checksum
(Receiver):
Checksum
Checksum
NO
YES
?
DNS?
IP ,
/ , IP
: http://yahoo.com
yahoo.com IP
IP .
Internet (ARPAnet)
IP
( Internet)
DNS
1983 , TCP/IP
1984 DNS (Domain
Name System)
,
, IP
1991
Internet Service
Provider (ISP).
,
(1992)
InterNIC
DNS
,
NSF (National Science Foundation)
InterNIC, InterNIC 100.000 USD
,
!
1998 ICANN (International Corporation for
Assigned Names and Numbers - www.icann.org)
DNS , IP ,
,
!
ICANN ..
Shared
Registration System
DNS
DNS
,
IP
(hostname) -
.
()
(hostname)
(
)
DNS
. DNS DNS
Domain Name ( )
.
.
.
DNS
IP .
IP
(label)
63
.
-
:
A-Z a-z
0 9
- ( )
DNS
Root DNS
ROOT
DNS
a Verisign, Dulles, VA
c Cogent, Herndon, VA (also Los Angeles)
d U Maryland College Park, MD
g US DoD Vienna, VA
k RIPE London (also Amsterdam, Frankfurt)
h ARL Aberdeen, MD
i Autonomica, Stockholm (plus 3 other
j Verisign, ( 11 locations)
locations)
m WIDE Tokyo
e NASA Mt View, CA
f Internet Software C. Palo Alto, CA
(and 17 other locations)
13 root name
TLD :
DNS ( IP
)
DNS (resolver)
, DNS
.
(Recursive) DNS
DNS
(authoritative) DNS
IP
DNS
1.
2.
DNS
IP .
IP
- !
DNS
DNS ,
: IP
DNS
.
DNS
DNS
,
.
,
,
DNS
!
IP
DNS
, DNS
DNS
root DNS
53
3
7
6
TLD DNS
DNS server
dns.poly.edu
cis.poly.edu
gaia.cs.umass.edu
Type=A
name is hostname
value is IP address
Type=NS
name is domain (e.g. foo.com)
value is IP address of
authoritative name server for
Type=MX
this domain
value is name of mailserver
associated with name
Type=CNAME
name is alias name for some
cannonical (the real) name
www.ibm.com is really
servereast.backup2.ibm.com
value is cannonical name
Internet Layer ( )
IP (Internet Protocol)
IP
IP .
IP
(Portions).
IPv4
IP
TCP/IP
IPv4.
V4