FTP. Mail. File Transfer Protocol (FTP) FTP commands, responses. Electronic Mail. TDTS06: Computer Networks

Similar documents
Chapter 2: Application layer

Application Layer: , DNS

Chapter 2 part B: outline

CC451 Computer Networks

Computer Networking Introduction

Chapter 2 Application Layer

Lecture 05: Application Layer (Part 02) Domain Name System. Dr. Anis Koubaa

Chapter 2 Application Layer. Lecture 5 DNS. Computer Networking: A Top Down Approach. 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012

Applications & Application-Layer Protocols: FTP and (SMTP & POP)

Electronic Mail. Three Components: SMTP SMTP. SMTP mail server. 1. User Agents. 2. Mail Servers. 3. SMTP protocol

WWW: the http protocol

Lecture 7 Application Layer. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

Application Layer Chapter 2

Applications & Application-Layer Protocols: (SMTP) and DNS

Lecture 6: Application Layer Web proxies, , and SMTP

CSC 4900 Computer Networks:

The Application Layer: SMTP, FTP

ELEC / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition

Application Layer Protocols

Chapter 2 Application Layer

Section 2: Application layer

Chapter 2 Application Layer

CS 3516: Computer Networks

Chapter 1 Introduction

Chapter 2: outline. 2.6 P2P applications 2.7 socket programming with UDP and TCP

CSC 401 Data and Computer Communications Networks

Domain Name System (DNS) 김현철 ( 화 ) 정보통신융합서울대학교컴퓨터공학부

Chapter 2 outline. 2.1 Principles of app layer protocols

Internet Protocol Stack! Principles of Network Applications! Some Network Apps" (and Their Protocols)! Application-Layer Protocols! Our goals:!

Chapter 2 Application Layer

Internet and Intranet Protocols and Applications

CS4/MSc Computer Networking. Lecture 3: The Application Layer

The Application Layer: & SMTP

The Application Layer: Sockets, DNS

Chapter 2 Application Layer

Chapter 2 Application Layer

Course on Computer Communication and

Chapter P2P file sharing network applications 2.22 Web and HTTP 2.3 FTP DNS

CSCE 463/612 Networks and Distributed Processing Spring 2018

Chapter 2: Application Layer

Domain Name Service. DNS Overview. October 2009 Computer Networking 1

Foundations of Telematics

Internet applications. 2: Application Layer 1

Network Application. Topic. Principle of Network Application. Principle of Network Application

Chapter 2 Application Layer

CSCE 463/612 Networks and Distributed Processing Spring 2018

Chapter 2 Application Layer

Different Layers Lecture 21

Chapter 2: outline. 2.6 P2P applications 2.7 socket programming with UDP and TCP

Lecture 05: Application Layer (Part 02) FTP, Peer-to-Peer, . Dr. Anis Koubaa

internet technologies and standards

EECS 3214: Computer Network Protocols and Applications

Lecture 2 - Application Layer. Lecture 1 Review. Application Layer. Principles of network applications. Notes. Notes. Notes. Notes

Web caches (proxy server)

Lecture 7: Application Layer Domain Name System

Networking. Layered Model. DoD Model. Application Layer. ISO/OSI Model

ELEC / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition

CS 3516: Advanced Computer Networks

CSC358 Week 3. Adapted from slides by J.F. Kurose and K. W. Ross. All material copyright J.F Kurose and K.W. Ross, All Rights Reserved

CSCD 330 Network Programming Winter 2015

Introduction to Computer Networking. Guy Leduc. Chapter 2 Application Layer. Chapter 2: outline

Chapter 2. Application Layer. 2: Application Layer 1

Chapter 2 Application Layer

Layered Model. DoD Model. ISO/OSI Model

Application Layer. Applications and application-layer protocols. Goals:

Information Network Systems The application layer. Stephan Sigg

Chapter 2 Application Layer

Chapter 2 Application Layer

Application-layer Protocols

Chapter 2: Application Layer last updated 22/09/03

CS 43: Computer Networks. 12: and SMTP September 28, 2018

Chapter 2: Application Layer

Chapter II: Application Layer

Introduction to Computer Networking. Guy Leduc. Chapter 2 Application Layer. Chapter 2: outline

Application layer. Some network apps. Client-server architecture. Hybrid of client-server and P2P. Pure P2P architecture. Creating a network app

Part 2: Application Layer

CSEN 404 Introduction to Networks. Mervat AbuElkheir Mohamed Abdelrazik. ** Slides are attributed to J. F. Kurose

Lecture 6 Application Layer. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

Chapter 2: Application layer. Chapter 2 Application Layer. Chapter 2: Application Layer. Some network apps

Chapter 2 Application Layer

TDTS06: Computer Networks

Chapter 2 Application Layer

Chapter 2 Application Layer

CS 43: Computer Networks. 10: Naming and DNS September 24, 2018

Chapter 2 Application Layer

Application Layer. Goals: Service models. Conceptual aspects of network application protocols Client server paradigm

Application Layer. Goals:

Application Layer. Applications and application-layer protocols. Goals:

Chapter 2 Application Layer

Chapter 2: Application layer. Chapter 2 Application Layer. Some network apps. Chapter 2: Application Layer. Chapter 2: Application layer

Chapter 2: Application layer. Chapter 2 Application Layer. Chapter 2: Application Layer. Some network apps

Chapter 2: application layer

Review for Internet Introduction

CSEN 503 Introduction to Communication Networks

Application Layer. Pure P2P architecture. Client-server architecture. Processes communicating. Hybrid of client-server and P2P. Creating a network app

Computer Networks 1 (Mạng Máy Tính 1) Lectured by: Dr. Phạm Trần Vũ

Chapter 2 Application Layer

Application Layer. CMPS 4750/6750: Computer Networks

Computer Networks 2 *+ # $ $!,( -. ( - ( - # ( / $!

Chapter 2 Application Layer

Transcription:

TDTS0: Computer Networks Instructor: Niklas Carlsson Email: niklas.carlsson@liu.se FTP Notes derived from Computer Networking: A Top Down Approach, by Jim Kurose and Keith Ross, Addison-Wesley. The slides are adapted and modified based on slides from the book s companion Web site, as well as modified slides by Anirban Mahanti and Carey Williamson. File Transfer Protocol (FTP) FTP commands, responses FTP client contacts FTP at port, specifying TCP as transport protocol obtains authorization over control connection browses remote directory by sending commands over control connection. When receives a command for a file transfer, the opens a TCP data connection to client After transferring one file, closes connection. FTP client TCP control connection port TCP data connection port 0 FTP Server opens a second TCP data connection to transfer another file. Control connection: out of band FTP maintains state : current directory, earlier authentication Sample commands: sent as ASCII text over control channel USER name 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) Username OK, password required data connection already open; transfer starting Can t open data connection Error writing file Mail Electronic Mail Three major components: s e.g., Eudora, Outlook, Pine, Netscape Messenger mail s Incoming, outgoing messages Simple Mail Transfer Protocol: SMTP mail SMTP mail SMTP SMTP outgoing message queue mail mailbox

Electronic Mail: SMTP [RFC 8] s SMTP mail establishes a TCP connection to the recipients SMTP using Port three phases in messg. transfer handshaking (greeting) transfer of messages closure command/response interaction commands: ASCII text response: status code and phrase messages must be in -bit ASCII Sample SMTP interaction S: 0 hamburger.edu C: HELO crepes.fr S: 0 Hello crepes.fr, pleased to meet you C: MAIL FROM: <alice@crepes.fr> S: 0 alice@crepes.fr... Sender ok C: RCPT TO: <bob@hamburger.edu> S: 0 bob@hamburger.edu... Recipient ok C: DATA S: Enter mail, end with "." on a line by itself C: Do you like ketchup? C: How about pickles? C:. S: 0 Message accepted for delivery C: QUIT S: hamburger.edu closing connection 8 Try SMTP interaction for yourself: SMTP: final words telnet name see 0 reply from enter HELO, MAIL FROM, RCPT TO, DATA, QUIT commands above lets you send email without using email client (reader) SMTP uses persistent connections SMTP requires message (header & body) to be in - bit ASCII SMTP uses CRLF.CRLF to determine end of message SMPT is a chatty protocol Comparison with HTTP: HTTP: pull SMTP: push both have ASCII command/response interaction, status codes HTTP: each object encapsulated in its own response msg SMTP: multiple objects sent in multipart msg 9 0 Mail message format Message format: multimedia extensions SMTP: protocol for exchanging email msgs RFC 8: standard for text message format: header lines, e.g., To: From: Subject: different from SMTP commands! body the message, ASCII characters only header body blank line MIME: multimedia mail extension, RFC 0, 0 additional lines in msg header declare MIME content type MIME version method used to encode data multimedia data type, subtype, parameter declaration encoded data From: alice@crepes.fr To: bob@hamburger.edu Subject: Picture of yummy crepe. MIME-Version:.0 Content-Transfer-Encoding: base Content-Type: image/jpeg base encoded data.........base encoded data

Mail access protocols DNS SMTP SMTP access protocol sender s mail receiver s mail SMTP is a push protocol. How will a access emails? Mail access protocol: retrieval from POP: Post Office Protocol [RFC 99] Users can t create folders on mail IMAP: Internet Mail Access Protocol [RFC 0] more features (more complex) manipulation of stored msgs on HTTP: Hotmail, Yahoo! Mail, etc. DNS: Domain Name System Internet hosts: IP address ( bit) - used for addressing datagrams name, e.g., www.yahoo.com - used by humans DNS: provides translation between host name and IP address distributed database implemented in hierarchy of many name s distributed for scalability & reliability DNS Services Hostname to IP address translation Host aliasing Canonical and alias names Mail aliasing Load distribution Replicated Web s: set of IP addresses for one canonical name DNS Infrastructure Host at cis.poly.edu wants IP address for gaia.cs.umass.edu Infrastructure: resolver Local DNS Authoritative DNS Server Root DNS Server Top-Level Domain DNS Server local DNS dns.poly.edu 8 requesting host cis.poly.edu root DNS TLD DNS authoritative DNS dns.cs.umass.edu gaia.cs.umass.edu Distributed, Hierarchical Database Root DNS Servers TLD com DNS s ca DNS s edu DNS s Servers yahoo.com amazon.com DNS s DNS s ucalgary.ca DNS s usask.ca DNS s poly.edu umass.edu DNS s DNS s Root s and TLD s typically do not contain hostname to IP mappings; they contain mappings for locating authoritative s. 8

DNS: Root name s contacted by local name that cannot resolve name directly root name : contacts authoritative name if name mapping is not known gets mapping returns mapping to local name TLD and Authoritative Servers Top-level domain (TLD) s: responsible for.com,.org,.net,.edu,.gov,.mil, and all toplevel country domains (e.g.,.uk,.fr,.ca,.jp) Network Solutions maintains s for.com TLD Educause for.edu TLD Authoritative DNS s: organization s DNS s, providing authoritative hostname to IP mappings for organization s s (e.g., Web and mail). Can be maintained by organization or service provider 9 0 Local Name Server Recursive queries root DNS Each ISP (residential ISP, company, university) has one. Also called default name When a host makes a DNS query, query is sent to its local DNS Acts as a proxy, forwards query into hierarchy. Reduces lookup latency for commonly searched hostnames recursive query: puts burden of name resolution on contacted name heavy load? iterated query: contacted replies with name of to contact I don t know this name, but ask this local DNS dns.poly.edu 8 requesting host cis.poly.edu authoritative DNS dns.cs.umass.edu gaia.cs.umass.edu TLD DNS DNS: caching and updating records once (any) name learns mapping, it caches mapping cache entries timeout (disappear) after some time called the Time To Live (TTL) TLD s typically cached in local name s Thus root name s not often visited DNS records DNS: distributed db storing resource records (RR) Type=A Type=NS RR format: (name, value, type, ttl) name is hostname value is IP address name is domain (e.g. foo.com) value is IP address of authoritative name for this domain Type=CNAME name is alias name for some canonical (the real) name www.ibm.com is really east.backup.ibm.com value is canonical name Type=MX value is name of mail associated with name

DNS protocol, messages DNS protocol : query and reply messages, both with same message format msg header identification: bit # for query, reply to query uses same # flags: query or reply recursion desired recursion available reply is authoritative DNS protocol, messages Name, type fields for a query RRs in response to query records for authoritative s additional helpful info that may be used DNS messages are carried using on port Inserting records into DNS Socket programming Example: just created startup Network Utopia Register name networkutopia.com at a registrar (e.g., Network Solutions) Need to provide registrar with names and IP addresses of your authoritative name (primary and secondary) Registrar inserts two RRs into the com TLD : (networkutopia.com, dns.networkutopia.com, NS) (dns.networkutopia.com,..., A) Put in authoritative Type A record for www.networkutopia.com and Type MX record for networkutopia.com How do people get the IP address of your Web site? 8 Sockets (recall) sends/receives messages to/from its app developer Internet Socket programming Goal: learn how to build client/ application that communicate using s Socket API explicitly created, used, released by apps client/ paradigm two types of transport service via API: unreliable datagram reliable, byte oriented a host-local, application-created, OS-controlled interface (a door ) into which application can both send and receive messages to/from another application controlled by OS 9 0

sendpacket receivepacket infromuser outtoserver infromserver infromuser Socket-programming using TCP Socket: a door between application and endend-transport protocol (UCP or TCP) TCP service: reliable transfer of bytes from one to another application developer operating system internet application developer operating system / interaction: TCP Server (running on hostid) create, port=x, for incoming request: welcomesocket = ServerSocket() TCP wait for incoming connection request connection setup connectionsocket = welcomesocket.accept() read request from connectionsocket write reply to connectionsocket close connectionsocket create, connect to hostid, port=x = Socket() send request using read reply from close Stream jargon keyboard monitor Socket programming with is a sequence of characters that flow into or out of a. input is attached to some input source for the, e.g., keyboard or. output is attached to an output source, e.g., monitor or. Process input output input client TCP TCP to network from network : no connection between client and no handshaking sender explicitly attaches IP address and port of destination to each packet must extract IP address, port of sender from received packet : transmitted data may be received out of order, or lost application viewpoint: provides unreliable transfer of groups of bytes ( datagrams ) between client and / interaction: Example: client () Server (running on hostid) keyboard monitor create, port= x. Socket = DatagramSocket() read datagram from Socket write reply to Socket specifying client address, port number create, = DatagramSocket() Create datagram with IP and port=x; send datagram via read datagram from close Process Output: sends packet (recall that TCP sent byte ) input packet client to network packet from network Input: receives packet (recall thattcp received byte )

Chapter : Summary Chapter : Summary application architectures client- PP hybrid application service requirements: reliability, bandwidth, delay Internet transport service model connection-oriented, reliable: TCP unreliable, datagrams: specific protocols: HTTP FTP SMTP, POP, IMAP DNS PP: BitTorrent, Skype programming some important lessons about protocols typical request/reply message exchange: client requests info or service responds with data, status code message formats: headers: fields giving info about data data: info being communicated Important themes: control vs. data msgs in-band, out-of-band centralized vs. decentralized stateless vs. stateful reliable vs. unreliable msg transfer complexity at network edge 8