190 likes | 422 Views
Lecturer: Maxim Podlesny Sep 29 2008 CSE 473. File Transfer and Electronic Email in Internet. File Transfer Overview. Application protocol: FTP Main parts: client host and server host Parts of interaction: client authentication and file transfer Used transport protocol: TCP. FTP Session.
E N D
Lecturer: Maxim Podlesny Sep 29 2008 CSE 473 File Transfer and Electronic Email in Internet
File Transfer Overview • Application protocol: FTP • Main parts: client host and server host • Parts of interaction: client authentication and file transfer • Used transport protocol: TCP
FTP Session • Two TCP connections (out-of-band) • Control connection employing port 21 • Data connection employing port 20 • Data transfer • One data connection per one file transfer • Control information • One control connection per FTP session • User account • Commands to change directory on server side • Commands to put and get a file from server • Keeping state information for each session
Control Interaction • Client commands: • USER <name> • PASS <password> • LIST • RETR <filename> • STOR <filename> • Server reply: • 331: username OK, password required • 125: transfer starting • 425: can’t open data connection • 452: error writing file
Email System Overview • Application protocol: SMTP (Simple Mail Transfer Protocol) • Main parts: • Sender side: agent, mail server • Receiver side: agent, mail server • Used transport protocol: TCP
SMTP • Interaction between mail servers and sender-his mail server • Text of a mail: 7-bit ASCII • TCP connection uses 25 port • Handshaking • One connection for sending a bunch of messages between the servers
Message Structure • From: <…> • To: <…> • Subject: <…> • [MIME headers] • Received: from < > by <> <time> • Inserted to a message by a SMTP receiving server • May consist of several records due to forwarding • <Body of a message>
Comparison with HTTP • HTTP vs. SMTP • transferring files • persistent connections • pull vs. push protocol • any characters vs. 7-bit ASCII • one message per object vs. one message per all objects
MIME • Purpose: sending content different from ASCII text • Placement: additional headers in the message • Structure: • Content-Type header • Indicates the type of non-ASCII data (video file, jpeg file, …) • Content-Transfer-Encoding header • Type of encoding used for non-ASCII data (base64, …)
Mail Access Protocol • Purpose: reading email from receiver’s SMTP server • SMTP – pushing protocol • Getting email is a pulling operation • Protocols: POP3, IM AP, HTTP
POP3 • TCP connection uses port 110 • Phases: • Authentication • Getting access to SMTP server • Transaction • Retrieving messages • Marking messages for deletion • Obtaining mail statistics • Update • Deleting messages • Closing a session • Download-and-keep, download-and-delete
POP3 (cont.) • Authentication • user <name> • pass <password> • Transaction • list, retr, dele • Update • quit • Server response • +OK • -ERR • No support of remote folders for messages
IMAP • Purpose: supporting remote folders • Features: • Maintaining user state information across sessions • Retrieving parts of messages
Web-Based Email • Yahoo, Google, Gmail, … • HTTP: • sending message to client mail server • retrieving message from recipient mail server • SMTP: • interaction between mail servers
DNS • Purpose: translating hostname to IP address • Architecture: distributed system • Additional functions: • Host aliasing • Mail server aliasing • Load distribution • Transport protocol: • UDP • port 53
Structure • Hierarchy: • Root DNS server • Top-level domain (TLD) DNS server • Authoritative DNS server • Local DNS server • Part of DNS • Interaction between end-host and the rest of DNS • Intermediate DNS server • Interaction between TLD and authoritative server • Accelerating performance through caching
DNS Record • DNS resource record: (Name, Value, Type, TTL) • Type: A, NS, CNAME, MX • Name: hostname, domain, alias hostname, alias name of a mail server • Value: IP address, hostname of authoritative DNS server, canonical hostname, canonical name of a mail server • TTL: time of keeping a record in a cache