Computer Networks and Applications. Application Layer ( , DNS, P2P, Socket Programming)

Size: px
Start display at page:

Download "Computer Networks and Applications. Application Layer ( , DNS, P2P, Socket Programming)"

Transcription

1 Computer Networks and Applications COMP 3331/COMP 9331 Week 3 Application Layer ( , DNS, P2P, Socket Programming) Reading Guide: Chapter 2, Sections

2 Announcements v Lab for Week 3 Socket Programming Practice v Sample Problem Set Did anyone attempt the first problem set? Please do. Solutions soon. Set for application layer is now available v Remember mid-semester exam in Week 6 v First Programming Assignment released this week 2

3 2. Application Layer: outline 2.1 principles of network applications app architectures app requirements 2.2 Web and HTTP 2.3 FTP 2.4 electronic mail SMTP, POP3, IMAP 2.5 DNS 2.6 P2P applications 2.7 socket programming with UDP and TCP 3

4 4

5 Electronic mail Three major components: v user agents v mail servers v simple mail transfer protocol: SMTP User Agent v a.k.a. mail reader v composing, editing, reading mail messages v e.g., Outlook, Thunderbird, iphone mail client v outgoing, incoming messages stored on server mail server SMTP mail server user agent user agent SMTP SMTP user agent outgoing message queue mail server user mailbox user agent user agent user agent 5

6 Electronic mail: mail servers mail servers: v mailbox contains incoming messages for user v message queue of outgoing (to be sent) mail messages v SMTP protocol between mail servers to send messages client: sending mail server server : receiving mail server mail server SMTP mail server user agent user agent SMTP SMTP user agent mail server user agent user agent user agent 6

7 Electronic Mail: SMTP [RFC 2821] v uses TCP to reliably transfer message from client to server, port 25 v direct transfer: sending server to receiving server v three phases of transfer handshaking (greeting) transfer of messages closure v command/response interaction (like HTTP, FTP) commands: ASCII text response: status code and phrase v messages must be in 7-bit ASCII 7

8 Scenario: Alice sends message to Bob 1) Alice uses UA to compose message to 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 1 user agent mail server mail server 6 user agent Alice s mail server 5 Bob s mail server 8

9 Sample SMTP interaction S: 220 hamburger.edu C: HELO crepes.fr S: 250 Hello crepes.fr, 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: Do you like ketchup? C: How about pickles? C:. S: 250 Message accepted for delivery C: QUIT S: 221 hamburger.edu closing connection 9

10 Try SMTP interaction for yourself: v telnet servername 25 v see 220 reply from server v enter HELO, MAIL FROM, RCPT TO, DATA, QUIT commands above lets you send without using client (reader) Implication: one could send forged ed Note: Many SMTP servers will not allow the above interaction without authentication. E.g: try the above with port

11 How to tell a fake ? Examine Long Headers or Raw Source Further reading: 11

12 Securing v STARTTLS: upgrade a plain text connection to TLS/SSL instead of using a separate port for encrypted communication Can be used for SMTP/IMAP/POP v PGP (later in the course) 12

13 SMTP: final words v SMTP uses persistent connections v SMTP requires message (header & body) to be in 7-bit ASCII v SMTP server uses CRLF.CRLF to determine end of message comparison with HTTP: v HTTP: pull v SMTP: push v both have ASCII command/response interaction, status codes v HTTP: each object encapsulated in its own response msg v SMTP: multiple objects sent in multipart msg 13

14 Mail message format SMTP: protocol for exchanging msgs RFC 822: standard for text message format: v header lines, e.g., To: From: Subject: different from SMTP MAIL FROM, RCPT TO: commands! v Body: the message ASCII characters only header body blank line 14

15 Quiz: attachments? v IF SMTP only allows 7-bit ASCII, how do we send pictures/videos/files via ? A: We use a different protocol instead of SMTP B: We encode these objects as 7-bit ASCII C: We re really sending links to the objects, rather than the objects themselves D: We don t!! You have been lied to!! 15

16 Mail access protocols user agent SMTP SMTP sender s mail server receiver s mail server mail access protocol (e.g., POP, IMAP) user agent v SMTP: delivery/storage to receiver s server v mail access protocol: retrieval from server POP: Post Office Protocol [RFC 1939]: authorization, download IMAP: Internet Mail Access Protocol [RFC 1730]: more features, including manipulation of stored msgs on server HTTP(S): Gmail, Yahoo! Mail, etc. 16

17 POP3 protocol authorization phase v v client commands: user: declare username pass: password server responses +OK -ERR transaction phase, client: v v v v list: list message numbers retr: retrieve message by number dele: delete quit S: +OK POP3 server ready C: user bob S: +OK C: pass hungry C: list S: S: S:. C: retr 1 S: <message 1 contents> S:. C: dele 1 C: retr 2 S: <message 1 contents> S:. C: dele 2 C: quit Self Study S: +OK user successfully logged on S: +OK POP3 server signing off 17

18 POP3 (more) and IMAP Self Study more about POP3 v previous example uses POP3 download and delete mode Bob cannot re-read e- mail if he changes client v POP3 download-andkeep : copies of messages on different clients v POP3 is stateless across sessions IMAP v keeps all messages in one place: at server v allows user to organize messages in folders v keeps user state across sessions: names of folders and mappings between message IDs and folder name 18

19 Quiz: HTTP vs SMTP v Which of the following is not true? A. HTTP is pull-based, SMTP is push-based B. HTTP uses a separate header for each object, SMTP uses a multipart message format C. SMTP uses persistent connections D. HTTP uses client-server communication but SMTP does not 19

20 2. Application Layer: outline 2.1 principles of network applications app architectures app requirements 2.2 Web and HTTP 2.3 FTP 2.4 electronic mail SMTP, POP3, IMAP 2.5 DNS 2.6 P2P applications 2.7 socket programming with UDP and TCP A nice overview 20

21 DNS: domain name system people: many identifiers: TFN, name, passport # Internet hosts, routers: IP address (32 bit) - used for addressing datagrams name, e.g., - used by humans Q: how to map between IP address and name, and vice versa? Domain Name System: v distributed database implemented in hierarchy of many name servers v application-layer protocol: hosts, name servers communicate to resolve names (address/name translation) note: core Internet function, implemented as applicationlayer protocol complexity at network s edge 21

22 DNS: History v Initially all host-address mappings were in a hosts.txt file (in /etc/ hosts): Maintained by the Stanford Research Institute (SRI) Changes were submitted to SRI by New versions of hosts.txt periodically FTP d from SRI An administrator could pick names at their discretion v As the Internet grew this system broke down: SRI couldn t handle the load; names were not unique; hosts had inaccurate copies of hosts.txt v The Domain Name System (DNS) was invented to fix this Jon Postel 22

23 Example use of DNS v v v v You type in the URL window of your web browser Your browser must establish a TCP connection with the CSE web server To do this, your browser needs to know the IP address of the CSE web server How does it obtain the IP address?? The browser passes on the hostname to the client side of the DNS application running on your machine (gethostbyname() function in UNIX) The DNS client sends out a query for mapping the hostname to an IP address into the DNS hierarchy black box over UDP (destination port number: 53) The DNS client receives a reply with the IP address for The browser can now initiate a TCP connection with the HTTP server process located at that IP address 23

24 DNS: services, structure DNS services v hostname to IP address translation v host aliasing canonical, alias names v mail server aliasing v load distribution replicated Web servers: many IP addresses correspond to one name Content Distribution Networks: use IP address of requesting host to find best suitable server Example: closest, leastloaded, etc why not centralize DNS? v single point of failure v traffic volume v distant centralized database v maintenance A: doesn t scale! 24

25 Goals v No naming conflicts (uniqueness) v Scalable many names (secondary) frequent updates v Distributed, autonomous administration Ability to update my own (machines ) names Don t have to track everybody s updates v Highly available v Lookups should be fast 25

26 Key idea: Hierarchy Three intertwined hierarchies Hierarchical namespace As opposed to original flat namespace Hierarchically administered As opposed to centralised (Distributed) hierarchy of servers As opposed to centralised storage 26

27 Hierarchical Namespace root edu com gov mil org net uk fr berkeley eecs sims instr ucla v Top Level Domains are at the top v Domains are sub-trees E.g:.edu, berkeley.edu, eecs.berkeley.edu v Name is leaf-to-root path instr.eecs.berkeley.edu v Depth of tree is arbitrary (limit 128) v Name collisions trivially avoided each domain is responsible 27

28 Hierarchical Administration root edu com gov mil org net uk fr berkeley ucla eecs instr sims A zone corresponds to an administrative authority that is responsible for that portion of the hierarchy E.g., UCB controls names: *.berkeley.edu and *.sims.berkeley.edu v E.g., EECS controls names: *.eecs.berkeley.edu 28

29 Server Hierarchy v Top of hierarchy: Root servers Location hardwired into other servers v Next Level: Top-level domain (TLD) servers.com,.edu, etc. Managed professionally v Bottom Level: Authoritative DNS servers Actually store the name-to-address mapping Maintained by the corresponding administrative authority 29

30 Server Hierarchy v Each server stores a (small!) subset of the total DNS database v An authoritative DNS server stores resource records for all DNS names in the domain that it has authority for v Each server needs to know other servers that are responsible for the other portions of the hierarchy Every server knows the root Root server knows about all top-level domains 30

31 DNS Root v Located in Virginia, USA v How do we make the root scale? Verisign, Dulles, VA 31

32 DNS Root Servers v 13 root servers (labeled A-M; see E NASA Mt View, CA F Internet Software Consortium Palo Alto, CA A Verisign, Dulles, VA C Cogent, Herndon, VA D U Maryland College Park, MD G US DoD Vienna, VA H ARL Aberdeen, MD J Verisign K RIPE London I Autonomica, Stockholm M WIDE Tokyo B USC-ISI Marina del Rey, CA L ICANN Los Angeles, CA 32

33 DNS Root Servers l 13 root servers (labeled A-M; see l Replicated via any-casting E NASA Mt View, CA F Internet Software Consortium, Palo Alto, CA (and 37 other locations) A Verisign, Dulles, VA C Cogent, Herndon, VA (also Los Angeles, NY, Chicago) D U Maryland College Park, MD G US DoD Vienna, VA H ARL Aberdeen, MD J Verisign (21 locations) K RIPE London (plus 16 other locations) I Autonomica, Stockholm (plus 29 other locations) M WIDE Tokyo plus Seoul, Paris, San Francisco B USC-ISI Marina del Rey, CA L ICANN Los Angeles, CA Root Server health: 33

34 Anycast in a nutshell v Routing finds shortest paths to destination v If several locations are given the same address, then the network will deliver the packet to the closest location with that address v This is called anycast Very robust Requires no modification to routing algorithms 34

35 TLD, authoritative servers top-level domain (TLD) servers: responsible for com, org, net, edu, aero, jobs, museums, and all top-level country domains, e.g.: uk, fr, ca, jp Network Solutions maintains servers for.com TLD Educause for.edu TLD authoritative DNS servers: organization s own DNS server(s), providing authoritative hostname to IP mappings for organization s named hosts can be maintained by organization or service provider 35

36 Local DNS name server v does not strictly belong to hierarchy v each ISP (residential ISP, company, university) has one also called default name server v Hosts configured with local DNS server address (e.g., /etc/ resolv.conf) or learn server via a host configuration protocol (e.g., DHCP) v Client application Obtain DNS name (e.g., from URL) Do gethostbyname() to trigger DNS request to its local DNS server v when host makes DNS query, query is sent to its local DNS server has local cache of recent name-to-address translation pairs (but may be out of date!) acts as proxy, forwards query into hierarchy 36

37 DNS name resolution example root DNS server v host at wagner.cse.unsw.edu.au wants IP address for gaia.cs.umass.edu iterated query: v contacted server replies with name of server to contact v I don t know this name, but ask this server local DNS server cse.unsw.edu.au requesting host wagner.cse.unsw.edu.au TLD DNS server 6 authoritative DNS server dns.cs.umass.edu gaia.cs.umass.edu 37

38 DNS name resolution example root DNS server recursive query: v puts burden of name resolution on contacted name server local DNS server cse.unsw.edu.au 5 4 TLD DNS server 1 8 requesting host wagner.cse.unsw.edu.au authoritative DNS server dns.cs.umass.edu gaia.cs.umass.edu Applet: 38

39 Quiz: Which one would you use? Why? root DNS server Recursive queries Iterated queries TLD DNS server 4 root DNS server local DNS server cse.unsw.edu.au local DNS server cse.unsw.edu.au requesting host wagner.cse.unsw.edu.au authoritative DNS server dns.cs.umass.edu requesting host wagner.cse.unsw.edu.au gaia.cs.umass.edu gaia.cs.umass.edu 39

40 DNS: caching, updating records v once (any) name server learns mapping, it caches mapping cache entries timeout (disappear) after some time (TTL) TLD servers typically cached in local name servers thus root name servers not often visited v Subsequent requests need not burden DNS v cached entries may be out-of-date (best effort name-to-address translation!) if name host changes IP address, may not be known Internet-wide until all TTLs expire 40

41 Quiz: DNS Record TTL v The TTL value should be: A. Short, to make sure that changes are accurately reflected B. Long to avoid re-queries of higher level DNS servers C. Something else 41

42 DNS records DNS: distributed db storing resource records (RR) RR format: (name, value, type, ttl) type=a name is hostname value is IP address type=ns name is domain (e.g., foo.com) value is hostname of authoritative name server for this domain type=cname name is alias name for some canonical (the real) name is really servereast.backup2.ibm.com value is canonical name type=mx value is name of mailserver associated with name 42

43 DNS protocol, messages v query and reply messages, both with same message format 2 bytes 2 bytes msg header v v identification: 16 bit # for query, reply to query uses same # flags: query or reply recursion desired recursion available reply is authoritative identification flags # questions # answer RRs # authority RRs # additional RRs questions (variable # of questions) answers (variable # of RRs) authority (variable # of RRs) additional info (variable # of RRs) 43

44 DNS protocol, messages 2 bytes 2 bytes identification # questions flags # answer RRs name, type fields for a query RRs in response to query records for authoritative servers additional helpful info that may be used # authority RRs # additional RRs questions (variable # of questions) answers (variable # of RRs) authority (variable # of RRs) additional info (variable # of RRs) 44

45 bash-3.2$ dig ; <<>> DiG 9.6-ESV-R4 <<>> ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 4 Your 2nd lab ;; QUESTION SECTION: ; IN A ;; ANSWER SECTION: IN CNAME albeniz.orchestra.cse.unsw.edu.au. albeniz.orchestra.cse.unsw.edu.au IN A ;; AUTHORITY SECTION: orchestra.cse.unsw.edu.au IN NS beethoven.orchestra.cse.unsw.edu.au. orchestra.cse.unsw.edu.au IN NS maestro.orchestra.cse.unsw.edu.au. ;; ADDITIONAL SECTION: maestro.orchestra.cse.unsw.edu.au IN A beethoven.orchestra.cse.unsw.edu.au IN A beethoven.orchestra.cse.unsw.edu.au IN A beethoven.orchestra.cse.unsw.edu.au IN A ;; Query time: 1 msec ;; SERVER: #53( ) ;; WHEN: Mon Mar 18 12:36: ;; MSG SIZE rcvd:

46 Inserting records into DNS v example: new startup Network Utopia v register name networkuptopia.com at DNS registrar (e.g., Network Solutions) provide names, IP addresses of authoritative name server (primary and secondary) registrar inserts two RRs into.com TLD server: (networkutopia.com, dns1.networkutopia.com, NS) (dns1.networkutopia.com, , A) v create authoritative server type A record for type MX record for networkutopia.com v Q: Where do you insert these type A and type MX records? Application Layer 46

47 Reliability v DNS servers are replicated (primary/secondary) Name service available if at least one replica is up Queries can be load-balanced between replicas v Usually, UDP used for queries Need reliability: must implement this on top of UDP Spec supports TCP too, but not always implemented v Try alternate servers on timeout Exponential backoff when retrying same server v Same identifier for all queries Don t care which server responds 47

48 DNS provides Indirection v Addresses can change underneath Move to Humans/Apps should be unaffected v Name could map to multiple IP addresses Enables Load-balancing Reducing latency by picking nearby servers v Multiple names for the same address E.g., many services (mail, www, ftp) on same machine E.g., aliases like and cnn.com v But, this flexibility applies only within domain! 48

49 DNS Load Balancing (Authoritative) DNS server monitors the load of the multiple web servers Replies back with the IP address for the least loaded server Can also consider the location of the client (e.g., a user from Sydney directed to Australian server) 49

50 DNS for Content Distribution 0: cnn.com distributes images to Akamai server 1: An end user types in in their browser 2: index page contains link to the a73.g.akamai.net 3: local DNS server asks root DNS server to resolve a73.g.akamai.net 4: root DNS replies with IP address of high-level Akamai DNS server, akamai.net 5: local DNS server queries this nameserver to resolve a73.g.akamai.net 6: high-level DNS server replies with IP address of the DNS server for g.akamai.net 7: local DNS queries this nameserver to resolve a73.g.akamai.net 8: low level DNS server takes into consideration the client s location and replies with the IP address of the closest Akamai web server that hosts the image 9: end user s machine sends a GET request for the image to this closest Akamai web server 10: Akamai webserver responds with the image 50

51 Reverse DNS v IP address -> domain name v Special PTR record type to store reverse DNS entries v Where is reverse DNS used? Troubleshooting tools such as traceroute and ping Received trace header field in SMTP SMTP servers for validating IP addresses of originating servers Internet forums tracking users System logging or monitoring tools Used in load balancing servers/content distribution to determine location of requester 51

52 Do you trust your DNS server? v Censorship v Logging IP address, websites visited, geolocation data and more E.g., Google DNS: 52

53 Attacking DNS DDoS attacks v Bombard root servers with traffic Not successful to date Traffic Filtering Local DNS servers cache IPs of TLD servers, allowing root server to be bypassed v Bombard TLD servers Potentially more dangerous Redirect attacks v Man-in-middle Intercept queries v DNS poisoning Send bogus replies to DNS server, which caches Exploit DNS for DDoS v Send queries with spoofed source address: target IP v Requires amplification Want to dig deeper? 53

54 DNS Cache Poisoning v Suppose you are a bad guy and you control the name server for drevil.com. Your name server receives a request to resolve and you respond as follows: ;; QUESTION SECTION: ; IN A ;; ANSWER SECTION: IN CNAME ;; AUTHORITY SECTION: drevil.com IN NS dns1.drevil.com. drevil.com IN NS google.com ;; ADDITIONAL SECTION: google.com 600 IN A A drevil.com machine, not google.com v Solution: Do not allow DNS servers to cache IP address mappings unless they are from authoritative name servers 54

55 Dig deeper? DNS Cache Poisoning Test DNSSEC: DNS Security Extensions, 55

56 2. Application Layer: outline 2.1 principles of network applications app architectures app requirements 2.2 Web and HTTP 2.3 FTP 2.4 electronic mail SMTP, POP3, IMAP 2.5 DNS 2.6 P2P applications 2.7 socket programming with UDP and TCP 56

57 Pure P2P architecture v no always-on server v arbitrary end systems directly communicate v peers are intermittently connected and change IP addresses examples: file distribution (BitTorrent) Streaming (KanKan) VoIP (Skype) 57

58 File distribution: client-server vs P2P Question: how much time to distribute file (size F) from one server to N peers? peer upload/download capacity is limited resource u s : server upload capacity file, size F server u s u 1 d 1 u 2 d 2 d i : peer i download capacity u N d N network (with abundant bandwidth) d i u i u i : peer i upload capacity 58

59 File distribution time: client-server v server transmission: must sequentially send (upload) N file copies: time to send one copy: F/u s time to send N copies: NF/u s v client: each client must download file copy d min = min client download rate min client download time: F/d min F u s network d i u i time to distribute F to N clients using client-server approach D c-s > max{nf/u s,,f/d min } increases linearly in N 59

60 File distribution time: P2P v server transmission: must upload at least one copy time to send one copy: F/u s v client: each client must download file copy min client download time: F/d min v clients: as aggregate must download NF bits F u s network d i u i max upload rate (limiting max download rate) is u s + Σu i time to distribute F to N clients using P2P approach D P2P > max{f/u s,,f/d min,,nf/(u s + Σu i )} increases linearly in N but so does this, as each peer brings service capacity 60

61 Client-server vs. P2P: example client upload rate = u, F/u = 1 hour, u s = 10u, d min u s Minimum Distribution Time P2P Client-Server N 61

62 P2P file distribution: BitTorrent v file divided into 256Kb chunks v peers in torrent send/receive file chunks tracker: tracks peers participating in torrent torrent: group of peers exchanging chunks of a file Alice arrives obtains list of peers from tracker and begins exchanging file chunks with peers in torrent 62

63 .torrent files v Contains address of trackers for the file Where can I find other peers? v Contain a list of file chunks and their cryptographic hashes This ensures that chunks are not modified 63

64 P2P file distribution: BitTorrent v peer joining torrent: has no chunks, but will accumulate them over time from other peers registers with tracker to get list of peers, connects to subset of peers ( neighbours ) v while downloading, peer uploads chunks to other peers v peer may change peers with whom it exchanges chunks v churn: peers may come and go v once peer has entire file, it may (selfishly) leave or (altruistically) remain in torrent 64

65 BitTorrent: requesting, sending file chunks requesting chunks: v at any given time, different peers have different subsets of file chunks v periodically, Alice asks each peer for list of chunks that they have v Alice requests missing chunks from peers, rarest first sending chunks: tit-for-tat v Alice sends chunks to those four peers currently sending her chunks at highest rate other peers are choked by Alice (do not receive chunks from her) re-evaluate top 4 every10 secs v every 30 secs: randomly select another peer, starts sending chunks optimistically unchoke this peer newly chosen peer may join top 4 65

66 BitTorrent: tit-for-tat (1) Alice optimistically unchokes Bob (2) Alice becomes one of Bob s top-four providers; Bob reciprocates (3) Bob becomes one of Alice s top-four providers higher upload rate: find better trading partners, get file faster! Original Research Paper on BitTorrent linked to lecture notes page 66

67 Getting rid of the server v Distribute the tracker information using a Distributed Hash Table (DHT) v A DHT is a lookup structure Maps keys to an arbitrary value Works a lot like, well. hash table Title House of Cards Season 4 Walking Dead Season 6 Game of Thrones Season Better Call Saul Season 2 End-systems that have it Michonne, Rick, Chuck, Sansa Frank, Mike, Tyrion, Gregor Saul, Mike, Glenn Khal, Jon, Daryl 67

68 Getting rid of the server v Distribute the tracker information using a Distributed Hash Table (DHT) v A DHT is a lookup structure Maps keys to an arbitrary value Works a lot like, well. hash table Title End-systems that have it House of Cards Season , Walking Dead Season , Game of Thrones Season Better Call Saul Season

69 Recall: Hash Function v Mapping of any data to an integer E.g., md5sum, sha1, etc. md5: 04c3416cadd85971a129dd1de86cee49 v With a good (cryptographic) hash Hash values likely to be unique, although duplicates are possible Very difficult to find collisions (hashes spread out) 69

70 Recall: Hash Table v N buckets v Key-value pair is assigned bucket i i = HASH(key)%N v Easy to look up value based on key v Multiple key-value pairs assigned to each bucket 70

71 Distributed Hash Table (DHT) v DHT: a distributed P2P database v database has (key, value) pairs; examples: key: TFN number; value: human name key: file name; value: BT tracker peer(s) v Distribute the (key, value) pairs over the (millions of peers) v a peer queries DHT with key DHT returns values that match the key v peers can also insert (key, value) pairs 71

72 Overlay network v A network made up of virtual or logical links v Virtual links map to one or more physical links (i.e. paths) 72

73 Challenges v How do we assign (key, value) pairs to nodes? v How do we find them again quickly? v What happens if nodes join/leave? 73

74 Q: how to assign keys to peers? v basic idea: convert each key to an integer Assign integer to each peer put (key,value) pair in the peer that is closest to the key 74

75 DHT identifiers: Consistent Hashing v assign integer identifier to each peer in range [0,2 n -1] for some n-bit hash function E.g., node ID is hash of its IP address v require each key to be an integer in same range v to get integer key, hash original key e.g., key = hash( House of Cards Season 4 ) this is why its is referred to as a distributed hash table 75

76 Assign keys to peers v rule: assign key to the peer that has the closest ID. v common convention: closest is the immediate successor of the key. v e.g., n=4; peers: 1,3,4,5,8,10,12,14; key = 13, then successor peer = 14 key = 15, then successor peer = 1 76

77 Circular DHT (1) v each peer only aware of immediate successor and predecessor. v overlay network 77

78 Circular DHT (2) 1111 I am Who s responsible for key 1110? Define closest as closest successor

79 Quiz: DHT Complexity v Given N nodes, what is the complexity (number of messages) of finding a value when each peer knows its successor? A. O (log n) B. O (n) C. O (n 2 ) D. O (2 n ) 79

80 Circular DHT with shortcuts Who s responsible for key 1110? v each peer keeps track of IP addresses of predecessor, successor, short cuts v reduced from 6 to 2 messages. v possible to design shortcuts so O(log N) neighbours, O(log N) messages in query 5 80

81 Peer churn example: peer 5 abruptly leaves handling peer churn: v peers may come and go (churn) v each peer knows address of its two successors v each peer periodically pings its two successors to check aliveness v if immediate successor leaves, choose next successor as new immediate successor v peer 4 detects peer 5 departure; makes 8 its immediate successor; asks 8 who its immediate successor is; makes 8 s immediate successor its second successor. 81

82 1 Quiz: Peer Churn v What happens to 5 s value? A. Lost forever B. Lost until 5 comes back Still recoverable (how?) 82

83 Quiz: DHT v Which of the following is not true? A. DHT distributes portions of a hash table across peers. B. The key corresponding to an object (e.g., movie) depends on the current number of peers. C. Which peer is responsible for an object depends on the current number of peers. 83

84 More DHT info v How do nodes join? v How does cryptographic hashing work? v How much state does each node store? Research Papers (on the lectures page): Chord: A Scalable Peer-to-Peer Lookup Service for Internet Applications Dynamo: Amazon s Highly Available Key-value Store 84

85 DHT: Applications v File sharing and backup [CFS, Ivy, OceanStore, PAST, Pastiche ] v Web cache and replica [Squirrel, Croquet Media Player] v Censor-resistant stores [Eternity] v DB query and indexing [PIER, Place Lab, VPN Index] v Event notification [Scribe] v Naming systems [ChordDNS, Twine, INS, HIP] v Distributed BitTorrent tracker [Kademlia, Vuze] v Communication primitives [I3, ] v Host mobility [DTN Tetherless Architecture] 85

86 2. Application Layer: outline 2.1 principles of network applications app architectures app requirements 2.2 Web and HTTP 2.3 FTP 2.4 electronic mail SMTP, POP3, IMAP 2.5 DNS 2.6 P2P applications 2.7 socket programming with UDP and TCP Note: 6 th Edition uses Python. Lecture notes show examples of both Java and Python 86

87 Socket programming Self Study goal: learn how to build client/server applications that communicate using sockets socket: door between application process and endend-transport protocol application process socket application process controlled by app developer transport network link physical Internet transport network link physical controlled by OS 87

88 Socket programming Self Study Two socket types for two transport services: UDP: unreliable datagram TCP: reliable, byte stream-oriented Application Example: 1. Client reads a line of characters (data) from its keyboard and sends the data to the server. 2. The server receives the data and converts characters to uppercase. 3. The server sends the modified data to the client. 4. The client receives the modified data and displays the line on its screen. 88

89 Socket programming with UDP Self Study UDP: no connection between client & server v no handshaking before sending data v sender explicitly attaches IP destination address and port # to each packet v rcvr extracts sender IP address and port# from received packet UDP: transmitted data may be lost or received out-of-order Application viewpoint: v UDP provides unreliable transfer of groups of bytes ( datagrams ) between client and server 89

90 Self Study Client/server socket interaction: UDP (Java) Server (running on hostid) Client create socket, port=x, for incoming request: serversocket = DatagramSocket() read request from serversocket write reply to serversocket specifying client host address, port number create socket, clientsocket = DatagramSocket() Create, address (hostid, port=x, send datagram request using clientsocket read reply from clientsocket close clientsocket 90

91 Example: Java client (UDP) Self Study import java.io.*; import java.net.*; Create input stream Create client socket Translate hostname to IP address using DNS class UDPClient { public static void main(string args[]) throws Exception { BufferedReader infromuser = new BufferedReader(new InputStreamReader(System.in)); DatagramSocket clientsocket = new DatagramSocket(); InetAddress IPAddress = InetAddress.getByName("hostname"); byte[] senddata = new byte[1024]; byte[] receivedata = new byte[1024]; String sentence = infromuser.readline(); senddata = sentence.getbytes(); 91

92 Example: Java client (UDP), cont. Self Study Create datagram with data-to-send, length, IP addr, port Send datagram to server Read datagram from server DatagramPacket sendpacket = new DatagramPacket(sendData, senddata.length, IPAddress, 9876); clientsocket.send(sendpacket); DatagramPacket receivepacket = new DatagramPacket(receiveData, receivedata.length); clientsocket.receive(receivepacket); String modifiedsentence = new String(receivePacket.getData()); System.out.println("FROM SERVER:" + modifiedsentence); clientsocket.close(); } } 92

93 Example: Java server (UDP) Self Study import java.io.*; import java.net.*; Create datagram socket at port 9876 class UDPServer { public static void main(string args[]) throws Exception { DatagramSocket serversocket = new DatagramSocket(9876); byte[] receivedata = new byte[1024]; byte[] senddata = new byte[1024]; Create space for received datagram Receive datagram while(true) { DatagramPacket receivepacket = new DatagramPacket(receiveData, receivedata.length); serversocket.receive(receivepacket); 93

94 Example: Java server (UDP), cont Self Study String sentence = new String(receivePacket.getData()); Get IP addr port #, of sender InetAddress IPAddress = receivepacket.getaddress(); int port = receivepacket.getport(); String capitalizedsentence = sentence.touppercase(); senddata = capitalizedsentence.getbytes(); Create datagram to send to client Write out datagram DatagramPacket sendpacket = new DatagramPacket(sendData, senddata.length, IPAddress, port); serversocket.send(sendpacket); to socket } } } End of while loop, loop back and wait for another datagram 94

95 Client/server socket interaction: UDP (Python) Self Study server (running on serverip) create socket, port= x: serversocket = socket(af_inet,sock_dgram) read datagram from serversocket write reply to serversocket specifying client address, port number client create socket: clientsocket = socket(af_inet,sock_dgram) Create datagram with server IP and port=x; send datagram via clientsocket read datagram from clientsocket close clientsocket 95

96 Example app: UDP client Self Study include Python s socket library create UDP socket for server get user keyboard input Attach server name, port to message; send into socket read reply characters from socket into string print out received string and close socket Python UDPClient from socket import * servername = hostname serverport = clientsocket = socket(socket.af_inet, socket.sock_dgram) message = raw_input( Input lowercase sentence: ) clientsocket.sendto(message,(servername, serverport)) modifiedmessage, serveraddress = clientsocket.recvfrom(2048) print modifiedmessage clientsocket.close() 96

97 Example app: UDP server Self Study Python UDPServer create UDP socket bind socket to local port number loop forever Read from UDP socket into message, getting client s address (client IP and port) send upper case string back to this client from socket import * serverport = serversocket = socket(af_inet, SOCK_DGRAM) serversocket.bind(('', serverport)) print The server is ready to receive while 1: message, clientaddress = serversocket.recvfrom(2048) modifiedmessage = message.upper() serversocket.sendto(modifiedmessage, clientaddress) 97

98 Socket programming with TCP Self Study client must contact server v server process must first be running v server must have created socket (door) that welcomes client s contact client contacts server by: v Creating TCP socket, specifying IP address, port number of server process v when client creates socket: client TCP establishes connection to server TCP v when contacted by client, server TCP creates new socket for server process to communicate with that particular client allows server to talk with multiple clients source port numbers used to distinguish clients (more in Chap 3) application viewpoint: TCP provides reliable, in-order byte-stream transfer ( pipe ) between client and server 98

99 TCP Sockets Self Study 99

100 Client/server socket interaction: TCP (in Java) Self Study Server (running on hostid) create socket, port=x, for incoming request: welcomesocket = ServerSocket() wait for incoming connection request connectionsocket = welcomesocket.accept() read request from connectionsocket write reply to connectionsocket close connectionsocket TCP connection setup Client create socket, connect to hostid, port=x clientsocket = Socket() send request using clientsocket read reply from clientsocket close clientsocket 100

101 Example: Java client (TCP) Self Study import java.io.*; import java.net.*; class TCPClient { public static void main(string argv[]) throws Exception { String sentence; String modifiedsentence; Create input stream Create client socket, connect to server Create output stream attached to socket BufferedReader infromuser = new BufferedReader(new InputStreamReader(System.in)); Socket clientsocket = new Socket("hostname", 6789); DataOutputStream outtoserver = new DataOutputStream(clientSocket.getOutputStream()); 101

102 Self Study Example: Java client (TCP), cont. Create input stream attached to socket BufferedReader infromserver = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); sentence = infromuser.readline(); Send line to server Read line from server outtoserver.writebytes(sentence + '\n'); modifiedsentence = infromserver.readline(); System.out.println("FROM SERVER: " + modifiedsentence); } } clientsocket.close(); 102

103 Example: Java server (TCP) import java.io.*; Self Study import java.net.*; class TCPServer { Create welcoming socket at port 6789 Wait, on welcoming socket for contact by client Create input stream, attached to socket public static void main(string argv[]) throws Exception { String clientsentence; String capitalizedsentence; ServerSocket welcomesocket = new ServerSocket(6789); while(true) { Socket connectionsocket = welcomesocket.accept(); BufferedReader infromclient = new BufferedReader(new InputStreamReader(connectionSocket.getInputStream())); 103

104 Self Study Example: Java server (TCP), cont Create output stream, attached to socket Read in line from socket DataOutputStream outtoclient = new DataOutputStream(connectionSocket.getOutputStream()); clientsentence = infromclient.readline(); Write out line to socket } } } capitalizedsentence = clientsentence.touppercase() + '\n'; outtoclient.writebytes(capitalizedsentence); End of while loop, loop back and wait for another client connection 104

105 Example app: TCP client Self Study Python TCPClient create TCP socket for server, remote port No need to attach server name, port from socket import * servername = servername serverport = clientsocket = socket(af_inet, SOCK_STREAM) clientsocket.connect((servername,serverport)) sentence = raw_input( Input lowercase sentence: ) clientsocket.send(sentence) modifiedsentence = clientsocket.recv(1024) print From Server:, modifiedsentence clientsocket.close() 105

106 Example app: TCP server Self Study Python TCPServer create TCP welcoming socket server begins listening for incoming TCP requests loop forever server waits on accept() for incoming requests, new socket created on return from socket import * serverport = serversocket = socket(af_inet,sock_stream) serversocket.bind((,serverport)) serversocket.listen(1) print The server is ready to receive while 1: connectionsocket, addr = serversocket.accept() read bytes from socket (but not address as in UDP) close connection to this client (but not welcoming socket) sentence = connectionsocket.recv(1024) capitalizedsentence = sentence.upper() connectionsocket.send(capitalizedsentence) connectionsocket.close() 106

107 Application Layer: summary our study of network apps now complete! v application architectures client-server P2P v application service requirements: reliability, bandwidth, delay v Internet transport service model connection-oriented, reliable: TCP unreliable, datagrams: UDP v specific protocols: HTTP FTP SMTP, POP, IMAP DNS P2P: BitTorrent, DHT v socket programming: TCP, UDP sockets 107

108 Application Layer: summary most importantly: learned about protocols! v typical request/reply message exchange: client requests info or service server responds with data, status code v message formats: headers: fields giving info about data data: info being communicated important themes: v control vs. data msgs in-band, out-of-band v centralized vs. decentralized v stateless vs. stateful v reliable vs. unreliable msg transfer v complexity at network edge Solve all sample problems + those posted with lectures Reading Exercise for next week: Chapter 3:

Chapter 2 outline. 2.1 Principles of app layer protocols

Chapter 2 outline. 2.1 Principles of app layer protocols Chapter 2 outline 2.1 Principles of app layer protocols clients and servers app requirements 2.2 Web and HTTP 2.3 FTP 2.4 Electronic Mail SMTP, POP3, IMAP 2.5 DNS 2.6 Socket programming with TCP 2.7 Socket

More information

Chapter 2: outline. 2.1 principles of network applications. 2.6 P2P applications 2.7 socket programming with UDP and TCP

Chapter 2: outline. 2.1 principles of network applications. 2.6 P2P applications 2.7 socket programming with UDP and TCP Chapter 2: outline 2.1 principles of network applications app architectures app requirements 2.2 Web and HTTP 2.3 FTP 2.4 electronic mail SMTP, POP3, IMAP 2.5 DNS 2.6 P2P applications 2.7 socket programming

More information

Computer Networking Introduction

Computer Networking Introduction Computer Networking Introduction Halgurd S. Maghdid Software Engineering Department Koya University-Koya, Kurdistan-Iraq Lecture No.6 Chapter 2: outline 2.1 principles of network applications app architectures

More information

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 6

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 6 CMPE 150/L : Introduction to Computer Networks Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 6 1 Midterm room for overflow students The students who used my registration code to enroll

More information

Chapter 2: Application layer

Chapter 2: Application layer Chapter 2: Application layer 2.1 Principles of network applications 2.2 Web and HTTP 2.3 FTP 2.4 Electronic Mail SMTP, POP3, IMAP 2.5 DNS 2.6 P2P applications 2.7 Socket programming with TCP 2.8 Socket

More information

Application Layer: , DNS

Application Layer:  , DNS Application Layer: E-mail, DNS EECS 3214 Slides courtesy of J.F Kurose and K.W. Ross, All Rights Reserved 22-Jan-18 1-1 Chapter 2: outline 2.1 principles of network applications 2.2 Web and HTTP 2.3 electronic

More information

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

Lecture 05: Application Layer (Part 02) FTP, Peer-to-Peer,  . Dr. Anis Koubaa NET 331 Computer Networks Lecture 05: Application Layer (Part 02) FTP, Peer-to-Peer, Email Dr. Anis Koubaa Reformatted slides from textbook Computer Networking a top-down appraoch, Fifth Edition by Kurose

More information

Computer Networking Introduction

Computer Networking Introduction Computer Networking Introduction Halgurd S. Maghdid Software Engineering Department Koya University-Koya, Kurdistan-Iraq Lecture No.5 Chapter 2: outline 2.1 principles of network applications app architectures

More information

Chapter 2 Application Layer

Chapter 2 Application Layer Chapter 2 Application Layer A note on the use of these ppt slides: We re making these slides freely available to all (faculty, students, readers). They re in PowerPoint form so you can add, modify, and

More information

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

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

More information

Chapter 2 part B: outline

Chapter 2 part B: outline Chapter 2 part B: outline 2.3 FTP 2.4 electronic, POP3, IMAP 2.5 DNS Application Layer 2-1 FTP: the file transfer protocol at host FTP interface FTP client local file system file transfer FTP remote file

More information

Communication in Distributed Systems: Sockets Programming. Operating Systems

Communication in Distributed Systems: Sockets Programming. Operating Systems Communication in Distributed Systems: Sockets Programming Operating Systems TCP/IP layers Layers Message Application Transport Internet Network interface Messages (UDP) or Streams (TCP) UDP or TCP packets

More information

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

Chapter 2: outline. 2.6 P2P applications 2.7 socket programming with UDP and TCP Chapter 2: outline 2.1 principles of network applications app architectures app requirements 2.2 Web and HTTP 2.3 FTP 2.4 electronic mail SMTP, POP3, IMAP 2.5 DNS 2.6 P2P applications 2.7 socket programming

More information

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

Lecture 05: Application Layer (Part 02) Domain Name System. Dr. Anis Koubaa NET 331 Computer Networks Lecture 05: Application Layer (Part 02) Domain Name System Dr. Anis Koubaa Reformatted slides from textbook Computer Networking a top-down appraoch, Fifth Edition by Kurose and

More information

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

FTP. Mail. File Transfer Protocol (FTP) FTP commands, responses. Electronic Mail. TDTS06: Computer Networks 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

More information

CC451 Computer Networks

CC451 Computer Networks CC451 Computer Networks Lecture 4 Application Layer (cont d) Application Layer 1 Chapter 2: Application layer 2.1 Principles of network applications 2.2 Web and HTTP 2.3 FTP 2.4 Electronic Mail SMTP, POP3,

More information

Section 2: Application layer

Section 2: Application layer Section 2: Application layer 2.1 Principles of network applications 2.2 Web and HTTP 2.3 FTP 2.4 Electronic Mail SMTP, POP3, IMAP 2.5 DNS 2.6 P2P applications 2.7 Socket programming with UDP 2.8 Socket

More information

Chapter 2 Application Layer

Chapter 2 Application Layer Internet and Intranet Protocols and Applications Lecture 4: Application Layer 3: Socket Programming Spring 2006 Arthur Goldberg Computer Science Department New York University artg@cs.nyu.edu Chapter 2

More information

Web Caching and HTTPS

Web Caching and HTTPS Web Caching and HTTPS Caching as a technique to reduce user (perceived) response time Who caches? Origin server (database memory) Gateway reverse proxy (shared cache) Proxy (e.g., ISP share cache) Browser

More information

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

Applications & Application-Layer Protocols:  (SMTP) and DNS CS 312 Internet Concepts Applications & Application-Layer Protocols: E (SMTP) and DNS Dr. Michele Weigle Department of Computer Science Old Dominion University mweigle@cs.odu.edu http://www.cs.odu.edu/~mweigle/cs312-f11

More information

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

Domain Name Service. DNS Overview. October 2009 Computer Networking 1 Domain Name Service DNS Overview October 2009 Computer Networking 1 Why DNS? Addresses are used to locate objects (contain routing information) Names are easier to remember and use than numbers DNS provides

More information

Chapter 1 Introduction

Chapter 1 Introduction Chapter 1 Introduction Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 Slides adopted from original ones provided by the textbook authors. Introduction

More information

Lecture 7: Application Layer Domain Name System

Lecture 7: Application Layer Domain Name System Lecture 7: Application Layer Domain Name System COMP 332, Spring 2018 Victoria Manfredi Acknowledgements: materials adapted from Computer Networking: A Top Down Approach 7 th edition: 1996-2016, J.F Kurose

More information

Chapter 2 Application Layer

Chapter 2 Application Layer Chapter 2 Application Layer A note on the use of these ppt slides: We re making these slides freely available to all (faculty, students, readers). They re in PowerPoint form so you see the animations;

More information

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

ELEC / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition ELEC / COMP 177 Fall 2013 Some slides from Kurose and Ross, Computer Networking, 5 th Edition Project 1 Python HTTP Server Work day: Next Tuesday (Sept 24 th ) Due Thursday, September 26 th by 11:55pm

More information

Introduction to Sockets 9/25/14

Introduction to Sockets 9/25/14 Introduction to Sockets 9/25/14 81 Remote communication Inter-process communication is at the heart of all distributed systems Using the network protocol stack on a node is the only way to communicate

More information

Computer Networks. 2.Application Layer. László Böszörményi Computer Networks Application Layer - 1

Computer Networks. 2.Application Layer. László Böszörményi Computer Networks Application Layer - 1 Computer Networks 2.Application Layer László Böszörményi Computer Networks Application Layer - 1 Applications + App Layer Protocols Applications, app. processes E.g., E-mail, WWW, DNS, P2P file sharing,

More information

Web caches (proxy server)

Web caches (proxy server) Web caches (proxy server) goal: satisfy client request without involving origin server user sets browser: Web accesses via cache browser sends all HTTP requests to cache object in cache: cache returns

More information

CSC 401 Data and Computer Communications Networks

CSC 401 Data and Computer Communications Networks CSC 401 Data and Computer Communications Networks Application Layer DNS and P2P Sec 2.4 2.5 Prof. Lina Battestilli Fall 2017 Outline Application Layer (ch 2) 2.1 principles of network applications 2.2

More information

Chapter II: Application Layer

Chapter II: Application Layer Chapter II: Application Layer UG3 Computer Communications & Networks (COMN) Myungjin Lee myungjin.lee@ed.ac.uk Slides copyright of Kurose and Ross Internet hourglass Here 2 Some network apps e-mail web

More information

Chapter 2 Application Layer. 2: Application Layer 1

Chapter 2 Application Layer. 2: Application Layer 1 Chapter 2 Application Layer 2: Application Layer 1 Chapter 2: Application layer 2.1 Principles of network applications 2.2 Web and HTTP 2.3 FTP 2.4 Electronic Mail SMTP, POP3, IMAP 2.5 DNS 2.6 P2P applications

More information

Application Layer: P2P File Distribution

Application Layer: P2P File Distribution Application Layer: P2P File Distribution EECS 3214 Slides courtesy of J.F Kurose and K.W. Ross, All Rights Reserved 29-Jan-18 1-1 Chapter 2: outline 2.1 principles of network applications 2.2 Web and HTTP

More information

Computer Communication Networks Socket Programming

Computer Communication Networks Socket Programming Computer Communication Networks Socket Programming ICEN/ICSI 416 Fall 2018 Prof. Aveek Dutta 1 Application Programming Interface Interface exported by the network Since most network protocols are implemented

More information

COMP 3331/9331: Computer Networks and Applications

COMP 3331/9331: Computer Networks and Applications COMP 3331/9331: Computer Networks and Applications http://www.cse.unsw.edu.au/~cs3331 Week 3 Application Layer: DNS, P2P and Socket Programming Reading Guide: Chapter 2 - Sections 2.5 2.7 Announcements

More information

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

CS 43: Computer Networks. 10: Naming and DNS September 24, 2018 CS 43: Computer Networks 10: Naming and DNS September 24, 2018 Last class Distributed systems architectures Client-Server Peer-to-Peer Challenges in design Partial failures Event ordering Lecture 10 -

More information

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. Some network apps Chapter 2 Application Layer Computer Networking: A Top Down Approach, 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009. Chapter 2: Application layer 2.1 Principles of network applications

More information

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

Computer Networks 1 (Mạng Máy Tính 1) Lectured by: Dr. Phạm Trần Vũ Computer Networks 1 (Mạng Máy Tính 1) Lectured by: Dr. Phạm Trần Vũ Chapter 2 Application Layer Computer Networking: A Top Down Approach, 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009.

More information

Chapter 2 Application Layer

Chapter 2 Application Layer Chapter 2 Application Layer Computer Networking: A Top Down Approach, 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009. All material copyright 1996-2009 J.F Kurose and K.W. Ross, All Rights

More information

Chapter 2 Application Layer

Chapter 2 Application Layer Chapter 2 Application Layer A note on the use of these ppt slides: We re making these slides freely available to all (faculty, students, readers). They re in PowerPoint form so you can add, modify, and

More information

Chapter 2 Application Layer

Chapter 2 Application Layer Chapter 2 Application Layer A note on the use of these ppt slides: We re making these slides freely available to all (faculty, students, readers). They re in PowerPoint form so you can add, modify, and

More information

CPSC 441 UDP Socket Programming. Department of Computer Science University of Calgary

CPSC 441 UDP Socket Programming. Department of Computer Science University of Calgary CPSC 441 UDP Socket Programming Department of Computer Science University of Calgary Socket programming using UDP (vs TCP) UDP: no connection between client and server vno handshaking vsender explicitly

More information

Chapter 2 Application Layer

Chapter 2 Application Layer Chapter 2 Application Layer Computer Networking: A Top Down Approach, 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009. All material copyright 1996-2009 J.F Kurose and K.W. Ross, All Rights

More information

COMP 211 Chapter 2 Application Layer

COMP 211 Chapter 2 Application Layer COMP 211 Chapter 2 Application Layer All material copyright 1996-2012 J.F Kurose and K.W. Ross, All Rights Reserved Computer Networking: A Top Down Approach 7 th edition Jim Kurose, Keith Ross Pearson/Addison

More information

Part 2: Application Layer

Part 2: Application Layer Part 2: Application Layer Our goals: conceptual, implementation aspects of network application protocols client-server paradigm service models learn about protocols by examining popular application-level

More information

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. Some network apps. Chapter 2: Application Layer. Chapter 2: Application layer Chapter 2 Application Layer A note on the use of these ppt slides: We re making these slides freely available to all (faculty, students, readers). They re in PowerPoint form so you can add, modify, and

More information

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. Some network apps Chapter 2 Application Layer A note on the use of these ppt slides: We re making these slides freely available to all (faculty, students, readers). They re in PowerPoint form so you can add, modify, and

More information

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

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 CSC358 Week 3 Adapted from slides by J.F. Kurose and K. W. Ross. All material copyright 1996-2016 J.F Kurose and K.W. Ross, All Rights Reserved Logistics Assignment 1 Tutorial 2 is programming exercise,

More information

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

Application Layer. Pure P2P architecture. Client-server architecture. Processes communicating. Hybrid of client-server and P2P. Creating a network app Application Layer e- web instant messaging remote login PP file sharing multi- network games streaming stored video (YouTube) voice over IP real-time video conferencing cloud computing Creating a network

More information

A note on the use of these ppt slides:

A note on the use of these ppt slides: Chapter 2 Application Layer A note on the use of these ppt slides: We re making these slides freely available to all (faculty, students, readers). They re in PowerPoint form so you can add, modify, and

More information

Chapter 2 Application Layer

Chapter 2 Application Layer Chapter 2 Application Layer A note on the use of these ppt slides: We re making these slides freely available to all (faculty, students, readers). They re in PowerPoint form so you can add, modify, and

More information

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

CSEN 404 Introduction to Networks. Mervat AbuElkheir Mohamed Abdelrazik. ** Slides are attributed to J. F. Kurose CSEN 404 Introduction to Networks Mervat AbuElkheir Mohamed Abdelrazik ** Slides are attributed to J. F. Kurose HTTP Method Types HTTP/1.0 GET POST HEAD asks server to leave requested object out of response

More information

Chapter 2 Application Layer

Chapter 2 Application Layer Chapter 2 Application Layer A note on the use of these ppt slides: We re making these slides freely available to all (faculty, students, readers). They re in PowerPoint form so you see the animations;

More information

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

Application Layer. Pure P2P architecture. Client-server architecture. Processes communicating. Hybrid of client-server and P2P. Creating a network app Application Layer e- web instant messaging remote login P2P file sharing multi- network games streaming stored video (YouTube) voice over IP real-time video conferencing cloud computing Creating a network

More information

Chapter 2 Application Layer

Chapter 2 Application Layer Chapter 2 Application Layer A note on the use of these ppt slides: We re making these slides freely available to all (faculty, students, readers). They re in PowerPoint form so you can add, modify, and

More information

CSCD 330 Network Programming Spring 2018

CSCD 330 Network Programming Spring 2018 CSCD 330 Network Programming Spring 2018 Lecture 6 Application Layer Socket Programming in Java Reading for Java Client/Server see Relevant Links Some Material in these slides from J.F Kurose and K.W.

More information

CSC 4900 Computer Networks:

CSC 4900 Computer Networks: CSC 4900 Computer Networks: Email Professor Henry Carter Fall 2017 Villanova University Department of Computing Sciences Review Last week we talked about design principles, and the application protocols

More information

CS 3516: Advanced Computer Networks

CS 3516: Advanced Computer Networks Welcome to CS 3516: Adanced Computer Networks Prof. Yanhua Li Time: 9:00am 9:50am M, T, R, and F Location: Fuller 320 Fall 2017 A-term 1 Some slides are originally from the course materials of the textbook

More information

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

Domain Name System (DNS) 김현철 ( 화 ) 정보통신융합서울대학교컴퓨터공학부 Domain Name System (DNS) 김현철 2010.09.29 ( 화 ) 정보통신융합서울대학교컴퓨터공학부 Chapter 2 Application Layer A note on the use of these ppt slides: We re making these slides freely available to all (faculty, students,

More information

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

Application layer. Some network apps. Client-server architecture. Hybrid of client-server and P2P. Pure P2P architecture. Creating a network app Application layer Some network apps e- web instant messaging remote login P2P file sharing multi- network games streaming stored video (YouTube) voice over IP real-time video conferencing cloud computing

More information

Chapter 2 Application Layer

Chapter 2 Application Layer Chapter 2 Application Layer A note on the use of these ppt slides: We re making these slides freely available to all (faculty, students, readers). They re in PowerPoint form so you can add, modify, and

More information

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

Chapter 2: Application Layer last updated 22/09/03 Chapter 2: Application Layer last updated 22/09/03 Chapter goals: conceptual + implementation aspects of network application protocols client server paradigm service models learn about protocols by examining

More information

Chapter 2 Application Layer

Chapter 2 Application Layer Chapter 2 Application Layer Computer Networking: A Top Down Approach, 4 th edition. Jim Kurose, Keith Ross Addison-Wesley, July 2007. All material copyright 1996-2007 J.F Kurose and K.W. Ross, All Rights

More information

CSCD 330 Network Programming Spring 2018

CSCD 330 Network Programming Spring 2018 CSCD 330 Network Programming Spring 2018 Lecture 7 Application Layer Socket Programming in Java Reading: Chapter 2, Java links Relevant Links page Some Material in these slides from J.F Kurose and K.W.

More information

Data Communications & Networks. Session 2 Main Theme Application Layer. Dr. Jean-Claude Franchitti

Data Communications & Networks. Session 2 Main Theme Application Layer. Dr. Jean-Claude Franchitti Data Communications & Networks Session 2 Main Theme Application Layer Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical Sciences Adapted from

More information

Data Communications & Networks. Session 2 Main Theme Application Layer. Dr. Jean-Claude Franchitti

Data Communications & Networks. Session 2 Main Theme Application Layer. Dr. Jean-Claude Franchitti Data Communications & Networks Session 2 Main Theme Application Layer Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical Sciences Adapted from

More information

Chapter 2 Application Layer

Chapter 2 Application Layer Chapter 2 Application Layer A note on the use of these ppt slides: We re making these slides freely available to all (faculty, students, readers). They re in PowerPoint form so you can add, modify, and

More information

CSEN 503 Introduction to Communication Networks

CSEN 503 Introduction to Communication Networks CSEN 503 Introduction to Communication Networks 1-1 Mervat AbuElkheir Hana Medhat Ayman Dayf ** Slides are attributed to J. F. Kurose Roadmap: Application layer Cookies and User-Server State Web caches

More information

Chapter 2 Application Layer

Chapter 2 Application Layer CSB051 Computer Networks 電腦網路 Chapter 2 Application Layer 吳俊興國立高雄大學資訊工程學系 Chapter 2: Outline 2.1 Principles of network applications 2.2 Web and HTTP 2.3 FTP 2.4 Electronic Mail SMTP, POP3, IMAP 2.5 DNS

More information

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

Lecture 2 - Application Layer. Lecture 1 Review. Application Layer. Principles of network applications. Notes. Notes. Notes. Notes Lecture 2 - Application Layer Networks and Security Jacob Aae Mikkelsen IMADA September 9, 2013 September 9, 2013 1 / 101 Lecture 1 Review Explain in short the following terms Protocol Network Edge Network

More information

Chapter 2 Application Layer

Chapter 2 Application Layer Chapter 2 Application Layer A note on the use of these ppt slides: We re making these slides freely available to all (faculty, students, readers). They re in PowerPoint form so you can add, modify, and

More information

COMPUTER NETWORKS CHAP 2 : APPLICATION LAYER

COMPUTER NETWORKS CHAP 2 : APPLICATION LAYER COMPUTER NETWORKS CHAP 2 : APPLICATION LAYER 0210 8 h 12 h 22 Sep 2011 Chapter 2: Application layer 2 2.1 Principles of network applications 2.2 Web and HTTP 2.3 FTP 2.4 Electronic Mail SMTP, POP3, IMAP

More information

CSCD 330 Network Programming Winter 2019

CSCD 330 Network Programming Winter 2019 CSCD 330 Network Programming Winter 2019 Lecture 7 Application Layer Socket Programming in Java Reading: Chapter 2, Java links Relevant Links page Some Material in these slides from J.F Kurose and K.W.

More information

CS 43: Computer Networks BitTorrent & Content Distribution. Kevin Webb Swarthmore College September 28, 2017

CS 43: Computer Networks BitTorrent & Content Distribution. Kevin Webb Swarthmore College September 28, 2017 CS 43: Computer Networks BitTorrent & Content Distribution Kevin Webb Swarthmore College September 28, 2017 Agenda BitTorrent Cooperative file transfers Briefly: Distributed Hash Tables Finding things

More information

We will cover in this order: 2.1, 2.7, 2.5, 2.4, 2.2

We will cover in this order: 2.1, 2.7, 2.5, 2.4, 2.2 CSE 422 Notes, Set 2 These slides contain materials provided with the text: Computer Networking: A Top Down Approach,5 th edition, by Jim Kurose and Keith Ross, Addison-Wesley, April 2009. Additional figures

More information

Internet applications. 2: Application Layer 1

Internet applications. 2: Application Layer 1 Internet applications 2: Application Layer 1 Recall Internet architecture Intelligence at end systems e.g., web server software communicates with browser software No need to write software for network-core

More information

Application Programming Interfaces

Application Programming Interfaces Application Programming Interfaces The TCP/IP protocol suite provides only the protocols that can be used by processes to communicate across a network. Though standarized, how these protocols are implemented

More information

Domain Name System (DNS)

Domain Name System (DNS) Domain Name System (DNS) Smith College, CSC 249 Feb 6, 2017 1 TODAY: Domain Name System qthe directory system for the Internet v Used by other application layer protocols v via socket programming qmaps

More information

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

CS4/MSc Computer Networking. Lecture 3: The Application Layer CS4/MSc Computer Networking Lecture 3: The Application Layer Computer Networking, Copyright University of Edinburgh 2005 Network Applications Examine a popular network application: Web Client-server architecture

More information

CSC 401 Data and Computer Communications Networks

CSC 401 Data and Computer Communications Networks CSC 401 Data and Computer Communications Networks Application Layer: Cookies, Web Caching, SMTP Sec 2.2.4-2.4 Prof. Lina Battestilli Fall 2017 Outline Application Layer (ch 2) 2.1 principles of network

More information

Chapter 2 Application Layer

Chapter 2 Application Layer Chapter 2 Application Layer Prof. Yuh-Shyan Chen Department of Computer Science and Information Engineering National Taipei University March 2007 Computer Networking: A Top Down Approach Featuring the

More information

Application Layer. CMPS 4750/6750: Computer Networks

Application Layer. CMPS 4750/6750: Computer Networks Application Layer CMPS 4750/6750: Computer Networks 1 Agenda Principles of Network Applications Case Studies Web and HTTP Email Domain Name System (DNS) Peer-to-Peer File Sharing Socket Programming with

More information

Chapter 2: Application layer

Chapter 2: Application layer Chapter 2: Application layer 2. Principles of network applications app architectures app requirements 2.2 Web and HTTP 2.4 Electronic Mail SMTP, POP3, IMAP 2.5 DNS 2.6 P2P applications 2.7 Socket programming

More information

IP ADDRESSES, NAMING, AND DNS

IP ADDRESSES, NAMING, AND DNS IP ADDRESSES, NAMING, AND DNS George Porter Apr 9, 2018 ATTRIBUTION These slides are released under an Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0) Creative Commons license These

More information

Application Layer Protocols

Application Layer Protocols Application Layer Protocols Dr. Ihsan Ullah Department of Computer Science & IT University of Balochistan, Quetta Pakistan Email: ihsan.ullah.cs@gmail.com These slides are adapted from the slides accompanying

More information

Chapter 2 Application Layer

Chapter 2 Application Layer Chapter 2 Application Layer A note on the use of these ppt slides: We re making these slides freely available to all (faculty, students, readers). They re in PowerPoint form so you see the animations;

More information

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 5

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 5 CMPE 150/L : Introduction to Computer Networks Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 5 1 Any problem of your lab? Due by next Monday (Jan 29) Using Canvas? Email me cqian12@ucsc.edu

More information

Chapter 2 Application Layer

Chapter 2 Application Layer Chapter 2 Application Layer A note on the use of these ppt slides: We re making these slides freely available to all (faculty, students, readers). They re in PowerPoint form so you see the animations;

More information

CSCI Computer Networks Spring 2017

CSCI Computer Networks Spring 2017 source: computer-networks-webdesign.com CSCI 6760 - Computer Networks Spring 2017 Instructor: Prof. Roberto Perdisci perdisci@cs.uga.edu These slides are adapted from the textbook slides by J.F. Kurose

More information

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

Chapter 2: outline. 2.6 P2P applications 2.7 socket programming with UDP and TCP Chapter 2: outline 2.1 principles of network applications 2.2 Web and HTTP 2.3 FTP 2.4 electronic mail SMTP, POP3, IMAP 2.5 DNS 2.6 P2P applications 2.7 socket programming with UDP and TCP Application

More information

Layer 4 - Transport Layer. What do we need a Transport Layer for? Transport Protocols in the TCP/IP Reference Model. The Transport Layer TCP and UDP

Layer 4 - Transport Layer. What do we need a Transport Layer for? Transport Protocols in the TCP/IP Reference Model. The Transport Layer TCP and UDP Layer 4 - Transport Layer Core of the protocol hierarchy: Network-independent, reliable and economical data transfer Tasks of the transport layer: Connection-oriented or connectionless data transfer Addressing

More information

Chapter 2 Application Layer

Chapter 2 Application Layer Chapter 2 Application Layer Chapter 2: outline 2.1 principles of network applications 2.2 Web and HTTP 2.3 electronic mail SMTP, POP3, IMAP 2.4 DNS 2.5 P2P applications 2.6 video streaming and content

More information

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

Electronic Mail. Three Components: SMTP SMTP. SMTP mail server. 1. User Agents. 2. Mail Servers. 3. SMTP protocol SMTP Electronic Mail Three Components: 1. User Agents a.k.a. mail reader e.g., gmail, Outlook, yahoo 2. Mail Servers mailbox contains incoming messages for user message queue of outgoing (to be sent) mail

More information

Chapter 2: Application layer. Computer Networks. Application Layer. Chapter 2: Application Layer. Some network apps. Bu-Ali Sina University, Hamedan

Chapter 2: Application layer. Computer Networks. Application Layer. Chapter 2: Application Layer. Some network apps. Bu-Ali Sina University, Hamedan Computer Networks Chapter 2: Application layer Application Layer By: Mohammad Nassiri!! 2.1 Principles of network applications!! 2.2 Web and HTTP!! 2.3 FTP!! 2.4 Electronic Mail!! SMTP, POP3, IMAP!! 2.5

More information

Lecture 6: Application Layer Web proxies, , and SMTP

Lecture 6: Application Layer Web proxies,  , and SMTP Lecture 6: Application Layer Web proxies, Email, and SMTP COMP 332, Spring 2018 Victoria Manfredi Acknowledgements: materials adapted from Computer Networking: A Top Down Approach 7 th edition: 1996-2016,

More information

CSCD 330 Network Programming Winter 2015

CSCD 330 Network Programming Winter 2015 CSCD 330 Network Programming Winter 2015 Lecture 5 Application Layer Reading: Chapter 2 Still Some Material in these slides from J.F Kurose and K.W. Ross All material copyright 1996-2007 1 More Network

More information

Application-layer Protocols

Application-layer Protocols Application-layer Protocols Kai Shen application transport data link physical Network Applications and Application-Layer Protocols application transport data link physical application transport data link

More information

Computer Networks. Application Layer

Computer Networks. Application Layer Computer Networks Application Layer By: Mohammad Nassiri Bu-Ali Sina University, Hamedan Fall 2009 Chapter 2: Application layer!! 2.1 Principles of network applications!! 2.2 Web and HTTP!! 2.3 FTP!! 2.4

More information

Layer 4 - Transport Layer

Layer 4 - Transport Layer Layer 4 - Transport Layer Core of the protocol hierarchy: Network-independent, reliable and economical data transfer Tasks of the transport layer: Connection-oriented or connectionless data transfer Addressing

More information

CPSC 441 Tutorial - 11 UDP Socket Programming Department of Computer Science University of Calgary

CPSC 441 Tutorial - 11 UDP Socket Programming Department of Computer Science University of Calgary CPSC 441 Tutorial - 11 UDP Programming Department of Computer Science University of Calgary TCP Vs UDP Input: receives packet (TCP receives byte stream ) Output: sends packet (TCP sends byte stream ) What

More information

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

Lecture 7 Application Layer. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it Lecture 7 Application Layer Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it Application-layer protocols Application: communicating, distributed processes running in network hosts

More information