1 9/18/2009 Network Applications and Network Programming: Email + DNS.

Slides:



Advertisements
Similar presentations
Application Layer 2-1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.
Advertisements

1 Electronic Mail u Three major components: u user agents u mail servers u simple mail transfer protocol: SMTP u User Agent u a.k.a. “mail reader” u composing,
Layer Aplikasi Risanuri Hidayat. Applications and application-layer protocols Application: communicating, distributed processes –e.g., , Web, P2P.
CPSC 441: FTP & SMTP1 Application Layer: FTP & Instructor: Carey Williamson Office: ICT Class.
Electronic Mail and SMTP
Ftp: File Transfer Protocol  ftp specification: RFC 959 ( file transfer FTP server FTP user interface FTP client local.
CPSC 441: DNS1 Instructor: Anirban Mahanti Office: ICT Class Location: ICT 121 Lectures: MWF 12:00 – 12:50 Notes derived.
Chapter 30 Electronic Mail Representation & Transfer
Esimerkki: Sähköposti. Lappeenranta University of Technology / JP, PH, AH Electronic Mail Three major components: user agents mail servers simple mail.
Simple Mail Transfer Protocol
Introduction 1 Lecture 7 Application Layer (FTP, ) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer Science & Engineering.
Mail Server Fitri Setyorini. Content SMTP POP3 How mail server works IMAP.
Electronic Mail Three major components: SMTP user agents mail servers
Introduction 1-1 Chapter 2 FTP & Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 IC322 Fall.
2: Application Layer1 Chapter 2 Application Layer These slides derived from Computer Networking: A Top Down Approach, 6 th edition. Jim Kurose, Keith Ross.
Electronic Mail (SMTP, POP, IMAP, MIME)
SMTP, POP3, IMAP.
1 Application Layer Lecture 5 Imran Ahmed University of Management & Technology.
Data Communications and Computer Networks Chapter 2 CS 3830 Lecture 9
CSE401N: Computer Networks Lecture-5 Electronic Mail S. M. Hasibul Haque Lecturer Dept. of CSE, BUET.
IT 424 Networks2 IT 424 Networks2 Ack.: Slides are adapted from the slides of the book: “Computer Networking” – J. Kurose, K. Ross Chapter 2: Application.
Intro to Computer Networks Bob Bradley The University of Tennessee at Martin.
Review: –How do we address “a network end-point”? –What services are provided by the Internet? –What is the network logical topology observed by a network.
Application Layer Protocols Simple Mail Transfer Protocol.
Lecturer: Maxim Podlesny Sep CSE 473 File Transfer and Electronic in Internet.
DNS,SMTP,MIME.
Fall 2005 By: H. Veisi Computer networks course Olum-fonoon Babol Chapter 7 The Application Layer.
Network Applications: DNS, UDP Socket Y. Richard Yang 9/12/2013.
2: Application Layer1 Reminder r Homework 1 for Wednesday: m Problems #3-5,11,16,18-20 m Half of the problems will be graded r Feel free to send me .
Sending and Receiving Mails
DNS: Domain Name System
1 DNS: Domain Name System People: many identifiers: m SSN, name, Passport # Internet hosts, routers: m IP address (32 bit) - used for addressing datagrams.
1 Application Layer Lecture 6 Imran Ahmed University of Management & Technology.
2: Application Layer1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail  SMTP,
File Transfer Protocol (FTP)
Network Applications: Overview, Y. Richard Yang 9/10/2013.
1 SMTP - Simple Mail Transfer Protocol –RFC 821 POP - Post Office Protocol –RFC 1939 Also: –RFC 822 Standard for the Format of ARPA Internet Text.
CPSC 441: DNS 1. DNS: Domain Name System Internet hosts: m IP address (32 bit) - used for addressing datagrams m “name”, e.g., - used by.
Chapter 16: Distributed Applications Business Data Communications, 4e.
CSE 524: Lecture 6 Application layer protocols. Where we’re at… ● Internet architecture and history ● Internet protocols in practice ● Application layer.
CS 3830 Day 9 Introduction 1-1. Announcements r Quiz #2 this Friday r Demo prog1 and prog2 together starting this Wednesday 2: Application Layer 2.
Network Applications 9/14/ Outline  Recap r ISO/OSI Layering and Internet Layering r Application layer overview r Examples.
Network Applications 9/14/ Outline  Recap r ISO/OSI Layering and Internet Layering r Application layer overview r Examples.
Network Applications: DNS, UDP Socket 1/24/ Outline  Recap r DNS r Network application programming: UDP.
CS440 Computer Networks 1 Neil Tang 12/01/2008.
Slides based on Carey Williamson’s: FTP & SMTP1 File Transfer Protocol (FTP) r FTP client contacts FTP server at port 21, specifying TCP as transport protocol.
Application Layer 2-1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.
World Wide Web r Most Web pages consist of: m base HTML page, and m several referenced objects addressed by a URL r URL has two components: host name and.
COMP 431 Internet Services & Protocols
Network Applications: DNS Details; UDP Network App Programming
Network Applications: Overview, Y. Richard Yang 1/27/2016.
1 Chapter 10: Application Layer Reference: Chapter 7 - “Computer Networks”, Andrew S. Tanenbaum, 4th Edition, Prentice Hall, 2003.
Important r On Friday, could you ask students to please me their groups (one per group) for Project 2 so we can assign IP addresses. I’ll send.
Ch 2. Application Layer Myungchul Kim
Network Applications: DNS Y. Richard Yang 2/1/2016.
Network Applications 1/19/ Outline  Recap r ISO/OSI Layering and Internet Layering r Application layer overview.
@Yuan Xue A special acknowledge goes to J.F Kurose and K.W. Ross Some of the slides used in this lecture are adapted from their.
Spring 2006 CPE : Application Layer_ 1 Special Topics in Computer Engineering Application layer: Some of these Slides are Based on Slides.
درس مهندسی اینترنت – مهدی عمادی مهندسی اینترنت برنامه‌نویسی در اینترنت 1 SMTP, FTP.
SMTP - Simple Mail Transfer Protocol POP - Post Office Protocol
Data Communications and Computer Networks Chapter 2 CS 3830 Lecture 9
Network Applications: Security, DNS
Chapter 2: Application layer
Internet and Intranet Protocols and Applications
DNS: Domain Name System
The Application Layer: SMTP, FTP
Network Applications: Overview,
Network Applications: Security, DNS
Chapter 2 Application Layer
Part II Application Layer.
Presentation transcript:

1 9/18/2009 Network Applications and Network Programming: + DNS

Outline r Recap r app. r DNS r Network application programming 2

3 Recap: The Internet Hourglass Architecture network infrastructure end users IP EthernetCable/DSLWireless TCP UDP Telnet FTPWWW

4 Recap: Client-Server Paradigm Typical network app has two pieces: client and server application transport network data link physical application transport network data link physical request reply Key questions to ask about a C-S application - Is the application extensible? - Is the application scalable? - How does the application handle server failures (being robust)? - How does the application provide security?

Outline r Recap r app. r DNS r Network application programming 5

6 Electronic Mail Three major components: r User agents r Mail servers r Protocols m Outgoing SMTP m Retrieving POP3: Post Office Protocol [RFC 1939] IMAP: Internet Mail Access Protocol [RFC 1730] user mailbox outgoing message queue mail server user agent user agent user agent mail server user agent user agent mail server user agent SMTP POP3 or IMAP SMTP

7 SMTP: Outgoing as a Client- Server Application S: 220 mr1.its.yale.edu C: HELO cyndra.yale.edu S: 250 Hello cyndra.cs.yale.edu, pleased to meet you C: MAIL FROM: S: 250 Sender ok C: RCPT TO: S: 250 Recipient ok C: DATA S: 354 Enter mail, end with "." on a line by itself C: Date: Wed, 23 Jan :20: (EST) C: From: "Y. R. Yang" C: To: "Y. R. Yang" C: Subject: This is subject C: C: This is the message body! C: Please don’t spoof! C: C:. S: 250 Message accepted for delivery C: QUIT S: 221 mr1.its.yale.edu closing connection

8 Mail Message Data Format SMTP: protocol for exchanging msgs RFC 822: standard for text message format: r Header lines, e.g., m To: m From: m Subject: r Body m the “message”, ASCII characters only blank line header body

9 Message Format: Multimedia Extensions r MIME: multimedia mail extension, RFC 2045, 2056 r Additional lines in msg header declare MIME content type From: To: Subject: Network map. MIME-Version: 1.0 Content-Type: image/jpeg Content-Transfer-Encoding: base64 base64 encoded data base64 encoded data multimedia data type, subtype, parameter declaration method used to encode data MIME version encoded data

10 Multipart Type: How Attachment Works From: To: Subject: Network map. MIME-Version: 1.0 Content-Type: multipart/mixed; boundary= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain Hi, Attached is network topology map Content-Transfer-Encoding: base64 Content-Type: image/jpeg base64 encoded data base64 encoded data

11 POP3 Protocol: Mail Access Authorization phase r client commands:  user: declare username  pass: password r server responses m +OK  -ERR Transaction phase, client:  list: list message numbers  retr: retrieve message by number  dele: delete r quit C: list S: S: S:. C: retr 1 S: S:. C: dele 1 C: retr 2 S: S:. C: dele 2 C: quit S: +OK POP3 server signing off S: +OK POP3 server ready C: user alice S: +OK C: pass hungry S: +OK user successfully logged on %telnet.mail.yale.edu 110 %openssl s_client –connect pop.gmail.com:995

12 Evaluation of SMTP//POP/IMAP Key questions to ask about a C-S application - extensible? - scalable? - handle server failures (being robust)? - security? mail server user agent user agent user agent mail server user agent user agent mail server user agent SMTP POP3 or IMAP SMTP

13 Positive r Some nice designs we can learn from the design of the application m separate protocols for different functions retrieval (e.g., POP3, IMAP) transmission (SMTP) m simple/basic requests to implement basic control; fine- grain control through ASCII header and message body make the protocol easy to read/debug/extend (analogy with end-to-end layered design?) m status code in response makes message easy to parse

14 Negative r Some design challenges m handling spam

Preview r Scalability (add more servers to help) and robustness (multiple servers serve as back up) depend on the mapping from address to server process(es). 15

Outline r Recap r app. r DNS 16

17 DNS: Domain Name System r Function m map between (domain name, service) to value, e.g., ( Addr) -> (cs.yale.edu, ) -> netra.cs.yale.edu r Why use name, instead of IP address directly? routers DNS Hostname, Service Address servers clients

18 DNS: Domain Name System r Naming scheme m a hierarchical naming space to avoid name conflict called a zone

19 Distributed Management of the Domain Name Space r A distributed database managed by authoritative name servers m divided into zones, where each zone is a sub-tree of the global tree m each zone has its own authoritative name servers m an authoritative name server of a zone may delegate a subset (i.e. a sub-tree) of its zone to another name server called a zone

20 Root Zone and Root Servers r The root zone is managed by the root name servers m 13 root name servers worldwide See for more detailshttp://root-servers.org/

21 Linking the Name Servers r Each name server knows the addresses of the root servers r Each name server knows the addresses of its immediate children (i.e., those it delegates) Top level domain (TLD) Q: how to query a hierarchy?

22 DNS Message Flow: Two Types of Queries Recursive query: r Puts burden of name resolution on contacted name server m the contacted name server resolves the name completely Iterated query: r Contacted server replies with name of server to contact m “I don’t know this name, but ask this server”

23 DNS Message Flow: Examples Local DNS server helps requesting hosts to query the DNS system Local DNS server is learned from DHCP, or configured, e.g. /etc/resolv.conf

24 DNS Message Flow: The Hybrid Case requesting host cyndra.cs.yale.edu gaia.cs.umass.edu root name server authoritative name server dns.cs.umass.edu 56 TLD name server 7 8 iterated query local name server

25 DNS Records DNS: distributed db storing resource records (RR) r Type=NS  name is domain (e.g. yale.edu)  value is the name of the authoritative name server for this domain RR format: (name, type, value, ttl) r Type=A  name is hostname  value is IP address r Type=CNAME  name is an alias name for some “canonical” (the real) name  value is canonical name r Type=MX  value is hostname of mail server associated with name r Type=SRV m general extension

26 DNS Protocol, Messages DNS protocol : over UDP/TCP; query and reply messages, both with the same message format DNS Msg header: r identification: 16 bit # for query, the reply to a query uses the same # r flags: m query or reply m recursion desired m recursion available m reply is authoritative

27 Observing DNS r Use the command dig (or nslookup):  force iterated query to see the trace: %dig +trace see the manual for more details r Capture the messages m DNS server is at port 53

28 Evaluation of DNS Key questions to ask about a C-S application - scalable? - handle server failures (being robust)? - extensible? - security?

29 What DNS did Right? r Hierarchical delegation avoids central control, improving manageability and scalability r Redundant servers improve robustness m see news/article.php/ for DDoS attack on root servers in Oct (9 of the 13 root servers were crippled, but only slowed the network) news/article.php/ r Caching reduces workload and improve robustness

30 Problems of DNS r Domain names may not be the best way to name other resources, e.g. files r Relatively static resource types make it hard to introduce new services or handle mobility r Although theoretically you can update the values of the records, it is rarely enabled r Simple query model makes it hard to implement advanced query r Early binding (separation of DNS query from application query) does not work well in mobile, dynamic environments m e.g., load balancing, locate the nearest printer - How does a client locate a server? - Is the application secure extensible, robust, scalable?

Outline r Recap r app. r DNS r Network application programming 31

32 Socket Programming Socket API r introduced in BSD4.1 UNIX, 1981 r Two types of sockets m connectionless m connection-oriented an interface (a “door”) into which one application process can both send and receive messages to/from another (remote or local) application process socket

33 Big Picture buffers, states buffers, states

34 Connectionless: Big Picture (Java version) close clientSocket Server (running on hostid ) read reply from clientSocket create socket, clientSocket = DatagramSocket() Client Create, address ( hostid, port=x, send datagram request using clientSocket create socket, port= x, for incoming request: serverSocket = DatagramSocket( x ) read request from serverSocket write reply to serverSocket specifying client host address, port number

35 DatagramSocket(Java) r DatagramSocket() constructs a datagram socket and binds it to any available port on the local host r DatagramSocket(int port) constructs a datagram socket and binds it to the specified port on the local host machine. r DatagramSocket(int port, InetAddress laddr) creates a datagram socket and binds to the specified local address. r DatagramSocket(SocketAddress bindaddr) creates a datagram socket and binds to the specified local socket address. r DatagramPacket(byte[] buf, int length) constructs a DatagramPacket for receiving packets of length length. r DatagramPacket(byte[] buf, int length, InetAddress address, int port) constructs a datagram packet for sending packets of length length to the specified port number on the specified host. r receive(DatagramPacket p) receives a datagram packet from this socket. r send(DatagramPacket p) sends a datagram packet from this socket. r close() closes this datagram socket.

36 How demultiplexing works r Dest. receives IP datagrams m each datagram has source IP address, destination IP address m each datagram carries 1 transport-layer segment m each segment has source, destination port number (recall: well-known port numbers for specific applications) r Dest. uses IP addresses & port numbers to direct segment to appropriate socket source port #dest port # 32 bits application data (message) other header fields TCP/UDP segment format

37 UDP Provides Multiplexing/Demultiplexing server client UDP socket space address: {*:9876} snd/recv buf: address: { :53} snd/recv buf: UDP socket space address: { :1500} snd/recv buf: address: { :4343} snd/recv buf: Packet demutiplexing is based on (dst address, dst port) at dst %netstat --udp –n -a local address local port