2. DATA COMMUNICATON 2
Common Network ServicesCommon Network Services
BY;
Muhammad Aurangzeb
12BS(cs)27
Departament of Computer sciences-Quest
3. Network ServicesNetwork Services
• GOALS;
• understand most common data services in
networks:
o Domain Name Servers (DNS)
o Remote access services
o File transfer services
o e-mail services
o Streaming services
3
4. IntroductionIntroduction
• Network Services -> key in companies and
organizations
• Work based in shared network resources & distributed
services
• Great diversity of services
4
5. Types of Network ServicesTypes of Network Services
Configuration and management
o Management of hosts.
o e.g. DHCP.
Remote Access
o Remote hosts are allowed to access to a network.
o e.g. SSH
File management
o File transfer, storage and management
o e.g. FTP.
Print services
o Printer share.
Information
o Information sharing and querying
o e.g. WWW, video sharing, IPTV
Communication
o User communication by means of text, audio and/or video
messages
o e.g. e-mail, chat, videoconference, IP telephony, games online.
5
6. Architecture of Network ServicesArchitecture of Network Services
• ApproachesApproaches
o Client-serverClient-server
o Peer-to-peer (P2P)Peer-to-peer (P2P)
o Hybrid of client-server and P2PHybrid of client-server and P2P
Network services 6
8. 8
P2P ARCHITECTUREP2P ARCHITECTURE
• no always-on server
• arbitrary end systems
directly communicate
• peers are intermittently
connected and change IP
addresses
• Highly scalable but
difficult to manage
peer-peer
9. 9
Hybrid of client-server and P2PHybrid of client-server and P2P
Skype
voice-over-IP P2P application
centralized server: finding address of remote
party:
client-client connection: direct (not through
server)
Instant messaging
chatting between two users is P2P
centralized service: client presence
detection/location
• user registers its IP address with central server
when it comes online
• user contacts central server to find IP
addresses of buddies
12. 12
Approach:
From the user’s point of view
o Identifies resource holder by means of an address
(www.dte.us.es)
Cont:Cont:
13. 13
Approach:
May www.dte.us.es be used as an identifier of the queried
resource?
User’s host
Internet
www.dte.us.es
Cont:Cont:
Resource
holder’s host
14. 14
Approach:
From the network’s point of view
o IP addresses are used (routing & addressing)
Internet
IP
Cont:Cont:
User’s host
Resource
holder’s host
15. 15
Approach:
A mechanism to translate names into IP addresses is
necessary
Internet
www.dte.us.es
IP
DNS
Cont:Cont:
User’s host
Resource
holder’s host
16. 16
Hosts, routers:
IP address (32 bits) – used to address datagrama
“name”, e.g.: www.google.es – used by human beings
130.213.40.3
Myserver.dte.us.es
Cont:Cont:
Resource
holder’s host
18. DNS: Domain Name SystemDNS: Domain Name System
18
IP Address
4 bytes in decimal format (69.146.202.8)
Hierarchical structure -> precise information about host location
Name
No host location information except maybe the country
19. DNS: Domain Name SystemDNS: Domain Name System
19
Domain Name System:
distributed database implemented
in hierarchy of many name
servers
application-layer protocol host,
routers, name servers to
communicate to resolve names
(address/name translation)
DNS uses UDP services
DNS services
hostname to IP address
translation
host aliasing
Canonical, alias names
mail server aliasing
load distribution
replicated Web servers:
set of IP addresses for
one canonical name
20. 20
Basic foundations
1. App needs to know a remote IP
address associated to a name
2. App requests IP address to DNS
client
3. DNS client sends a request to
the network
4. DNS client rcvs a reply
including IP addr
5. DNS client gives IP address to
app
DNS: Domain Name SystemDNS: Domain Name System
Why not centralize DNS?
single point of failure
traffic volume
distant centralized
database
maintenance
doesn’t scale!
21. 21
Root DNS Servers
com DNS servers org DNS servers edu DNS servers
poly.edu
DNS servers
umass.edu
DNS servers
yahoo.com
DNS servers
amazon.com
DNS servers
pbs.org
DNS servers
Distributed, Hierarchical DatabaseDistributed, Hierarchical Database
Client wants IP for www.amazon.com; 1st
approx:
client queries a root server to find com DNS server
client queries com DNS server to get amazon.com DNS
server
client queries amazon.com DNS server to get IP address
for www.amazon.com
22. 22
DNS: Root name serversDNS: Root name servers
contacted by local name server that can not resolve name
root name server:
contacts authoritative name server if name mapping not known
gets mapping
returns mapping to local name server
13 root name servers
worldwide
b USC-ISI Marina del Rey, CA
l ICANN Los Angeles, CA
e NASA Mt View, CA
f Internet Software C. Palo Alto,
CA (and 36 other locations)
i Autonomica, Stockholm (plus
28 other locations)
k RIPE London (also 16 other locations)
m WIDE Tokyo (also Seoul,
Paris, SF)
a Verisign, Dulles, VA
c Cogent, Herndon, VA (also LA)
d U Maryland College Park, MD
g US DoD Vienna, VA
h ARL Aberdeen, MD
j Verisign, ( 21 locations)
23. 23
Local Name ServerLocal Name Server
does not strictly belong to hierarchy
each ISP (residential ISP, company,
university) has one.
also called “default name server”
when host makes DNS query, query is sent to
its local DNS server
acts as proxy, forwards query into hierarchy
24. 24
requesting host
cis.poly.edu
gaia.cs.umass.edu
root DNS server
local DNS server
dns.poly.edu
authoritative DNS server
dns.cs.umass.edu
TLD DNS server
DNS nameDNS name
resolution exampleresolution example
Host at cis.poly.edu wants
IP address for
gaia.cs.umass.edu
iterated query:
contacted server replies
with name of server to
contact
“I don’t know this name,
but ask this server”
recursive query:
puts burden of name
resolution on contacted
name server
25. 25
DNS name resolution exampleDNS name resolution example
recursive queryiterative query
requesting host
cis.poly.edu
gaia.cs.umass.edu
root DNS server
1
2
3 4
5
6
authoritative DNS server
dns.cs.umass.edu
7
8
TLD DNS server
requesting host
cis.poly.edu
gaia.cs.umass.edu
root DNS
server
local DNS server
dns.poly.edu
1
2
45
6
authoritative DNS server
dns.cs.umass.edu
7
8
TLD DNS
server
3
26. 26
DNS protocol, messagesDNS protocol, messages
Name, type fields
for a query
RRs in response
to query
records for
authoritative servers
additional “helpful”
info that may be used
29. 2929
Access remote servicesAccess remote services
Virtual connection to a remote terminal
“Substitutes” a direct cable
Access remote services
Telnet
SSH
30. 3030
TelnetTelnet
Basically -> TCP connection (port 23)
Some other features negotiated in handshake
No security –> even passwords are visible
Solution: encryptation -> SSH
Telnet is now quite obsolete
31. 3131
SSHSSH
SSH (Secure Shell): RFC 4251
Aims similar to telnet -> provides security!
TCP connection (port 22)
Other additional functions
o Secure FTP
o support any insecure protocol -> tunneling
o secure connections for X Windows servers ->
graphic apps
32. 3232
SSH. FeaturesSSH. Features
Reduces security menaces:
o Man in the middle -> sniffer
o Spoofing
Cyphered data -> 128-bit encryptation
Security scheme -> public/private key (RSA)
Client-server arquitecture.
Two versions
o SSHv1 (1995) -> vulnerabilities
o SSHv2 (1997)
Improvements over SSHv1
Current standard
34. 3434
File Transfer ServicesFile Transfer Services
File transfer between remote hosts
Aims:
Remote hosts may share files
Client & server file systems are independent
Efficient data transfer
Two main protocols
FTP (File Transfer Protocol): uses TCP -> reliable
• RFC 959
TFTP (Trivial File Transfer Protocol): uses UDP -> more
simple
• RFC 1350
35. Network services 35Network services 35
TFTPTFTP
Trivial File Transfer Protocol
File transfer
Very simple protocol
Non reliable -> UDP (port 69)
No folders; no encryptation
For transfering small files
36. 3636
TFTPTFTP
TFTP messages
Opcode: type of message
• 01: RRQ (Read Request)
• 02: WRQ (Write Request)
• 03: DATA
• 04: ACK
• 05: Error message
Variable length data: depend on the opcode
37. 3737
FTP: the file transfer protocolFTP: the file transfer protocol
transfer file to/from remote host
client/server model
client: side that initiates transfer (either to/from
remote)
server: remote host
ftp: RFC 959
Uses TCP: ports 20, 21 -> reliable transfer
file transfer
FTP
server
FTP
user
interface
FTP
client
local file
system
remote file
system
user
at host
38. 3838
Two TCP connections
Data: transferred data (port 20)
Control: allows the user moving through the directory
structure and downloading & uploading files (port 21)
FTPFTP
39. 3939
FTP Client/Server modelFTP Client/Server model
FTP Client initiates connection (server’s port 21)
Connection parameters are negotiated in handshake
Data port
Connection mode: active/pasive
Transfer mode: ASCII/binary
40. 4040
FTP ServersFTP Servers
Configuration parameters
Control port (default: port 21)
Max # of connections to server & max # of connections per IP
Connection timeout
Welcome & goodbye msgs
Passive mode port numbers
Users & groups
Authenticated users: have login & passwd -> registered in
server
Anonymous users
Groups: share the same properties in FTP server
41. 4141
FTP ServersFTP Servers
Permissions
Read, write, execution (rwx)
Permissions for the owner, for groups & for the rest of users
Bandwidth limit
Server may limit transfer rate for the users
Logs
Register data or any other info about user connections &
errors
42. 4242
FTP ClientsFTP Clients
ftp <ip_addr>
Commands
cd
get
put
mkdir
exit
…
Do not mistake FTP
commands typed by client
for FTP control commands
43. FTP commands, responsesFTP commands, responses
Sample commands:
• sent as ASCII text over
control channel
• USER username
• PASS password
• LIST return list of file in
current directory
• RETR filename retrieves
(gets) file
• STOR filename stores
(puts) file onto remote
host
Sample return codes
• status code and phrase
(as in HTTP)
• 331 Username OK,
password required
• 125 data connection
already open;
transfer starting
• 425 Can’t open data
connection
• 452 Error writing
file
4343
45. E-mail servicesE-mail services
Main features:
• One of the most important services on the
Internet
• Allows users to exchange mails in an easy, fast
and cheap way
• Multiple receivers
• Client-server scheme
• Types of client apps
o Graphic interfaces (Microsoft Outlook, Mozilla
Thunderbird, Apple Mail)
o Text (pine, elm, mail)
o Web (Gmail, Hotmail, SquirrelMail)
45
46. E-mail servicesE-mail services
Related concepts:
• Mail account
o Associated to user name & passwd
user@domain.com
• Mailbox
• Mail alias
• Mail list
46
47. E-mail servicesE-mail services
Standards:
• SMTP (Simple Mail Transfer Protocol)
• IMF (Internet Mail Format)
• MIME (Multipurpose Internet Mail Extensions)
• POP (Post Office Protocol)
• IMAP (Internet Message Access Protocol)
47
48. E-mail servicesE-mail services
Components:
• Mail User Agent (MUA)
• Mail Transfer Agent (MTA)
• Mail Delivery Agent (MDA)
Mail User Agents (MUA)
• Mail client
• Compose, edit, read mail
messages
• Use two mail servers:
o Outgoing mail server (SMTP)
o Incoming mail server (POP
or IMAP)
48
User mailbox
Outgoing
mail queue
MTA
MUA
MUA
MUAMTA
MUA
MUA
MTA
MUA
SMTP
SMTP
SMTP
POP
IMAP
49. E-mail servicesE-mail services
Mail Agent Transfer (MTA)
• Mail server
• Stores sender’s mails for
delivery (outgoing queue)
• Stores incoming mails for
their users
Mail Delivery Agent (MDA)
• In charge of copying
incoming messages to user
mailbox
49
MTA
MUA
MUA
MUAMTA
MUA
MUA
MTA
MUA
SMTP
SMTP
SMTP
POP
IMAP
User mailbox
Outgoing
mail queue
50. 50
Scenario: Alice sends message to
Bob
1) Alice uses UA to compose
message and “to”
bob@someschool.edu
2) Alice’s UA sends message to
her mail server; message
placed in message queue
3) Client side of SMTP opens
TCP connection with Bob’s
mail server
4) SMTP client sends Alice’s
message over the TCP
connection
5) Bob’s mail server places the
message in Bob’s mailbox
6) Bob invokes his user agent to
read message
user
agent
mail
server
mail
server user
agent
1
2 3 4 5
6
51. 51
Message formatMessage format
• IMF (RFC 5322)IMF (RFC 5322)
• HeadersHeaders
o To:To:
o From:From:
o Subject:Subject:
o Date:Date:
• BodyBody
o Simple text messages (noSimple text messages (no
extended ASCII ) up toextended ASCII ) up to
998 characters(no CRLF)998 characters(no CRLF)
Headers
Body
Blank
line
52. Network services 52
Message formatMessage format
MIME extensions:
• Add funcionalityAdd funcionality
o Attached filesAttached files
o Extended ASCIIExtended ASCII
• New headersNew headers
o Mime-Version:Mime-Version:
o Content-Type:Content-Type:
Default -> text/plainDefault -> text/plain
Attachments ->Attachments ->
MultipartMultipart
o Content-Description:Content-Description:
o Content-Transfer-Content-Transfer-
Encoding:Encoding:
Types de encoding
7 bits
8 bits & binary
quoted-printable &
base64.
Example quoted-printable
F3 = ó & F1 = ñ
Transmisión de ñ
Transmisi=F3n de =F1
53. Network services 53
Web accessWeb access
Features:
• A browser is used instead of a mail client
• MUA is integrated in a web page
• Host uses HTTP to communicate with web server
• Web server habitually uses IMPA for the access to the
incoming msgs in the mail server
56. 5656
Streaming Stored MultimediaStreaming Stored Multimedia
Stored streaming:
media stored at source
transmitted to client
streaming: client playout begins
before all data has arrived
o timing constraint for still-to-be transmitted data: in
time for playout
57. 5757
StreamingStreaming LiveLive MultimediaMultimedia
Examples:
Internet radio talk show
live sporting event
Streaming (as with streaming stored multimedia)
playback buffer
playback can lag tens of seconds after transmission
still have timing constraint
Interactivity
fast forward impossible
rewind, pause possible!