COMP 3331/9331: Computer Networks and Applications

Size: px
Start display at page:

Download "COMP 3331/9331: Computer Networks and Applications"

Transcription

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

2 Announcements Labs started this Week (Week 3) Labs for Week 4 Socket programming exercise Solutions available at the end of the week on webpage Problem Set Did anyone try to solve the first problem set? Please do so. Solution set soon. Remember mid-semester exam (see announcements) 2

3 Application Layer Recap Principles of Application Layer What are the different types of architectures you would consider while designing a new application? What transport services does an application need? Examples: Web, Interactive gaming Which transport protocols does the Internet provide? What are the differences? Which transport protocol is used by HTTP, FTP, Real-time audio? 3

4 Application layer: Roadmap 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 Networks 2.7 Socket programming 4

5 DNS: Domain Name System People: many identifiers: student #, name, passport # Internet hosts: IP address (32 bit) - used for addressing datagrams e.g: name, e.g., - used by humans Internet core: Uses IP addresses only Q: map between IP addresses and name? Domain Name System: distributed database implemented in hierarchy of many name servers application-layer protocol hosts and name servers communicate to resolve names (address/name translation) note: core Internet function, implemented as application-layer protocol complexity at network s edge 5

6 DNS Example 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 6

7 DNS DNS services Hostname to IP address translation Host aliasing Canonical and alias names CN: relay1.sydney.wifi.com.au Alias: wifi.com.au Mail server aliasing MS: relay1.sydney.hotmail.com Alias: hotmail.com Load distribution Replicated Web servers: set of IP addresses for one canonical name Rotation policy Content Distribution Networks: use IP address of requesting host to find best suitable server Example: closest, least-loaded, etc Why not centralize DNS? single point of failure traffic volume distant centralized database maintenance doesn t scale 7

8 Distributed, Hierarchical Database Root DNS Servers com DNS servers org DNS servers edu DNS servers yahoo.com DNS servers amazon.com DNS servers pbs.org DNS servers poly.edu umass.edu DNS servers DNS servers 1 st approx: Client wants IP for Client queries a root server to find com DNS server Client queries com DNS server to get yahoo.com DNS server Client queries yahoo.com authoritative DNS server to get IP address for 8

9 DNS: Root name servers contacted by local name server that can not resolve name root name server: contacts authoritative name server if name mapping not known gets mapping returns mapping to local name server a Verisign, Dulles, VA c Cogent, Herndon, VA (also Los Angeles) d U Maryland College Park, MD g US DoD Vienna, VA h ARL Aberdeen, MD j Verisign, ( 11 locations) k RIPE London (also Amsterdam, i Autonomica, Frankfurt) Stockholm (plus 3 other locations) e NASA Mt View, CA f Internet Software C. Palo Alto, CA (and 17 other locations) b USC-ISI Marina del Rey, CA l ICANN Los Angeles, CA m WIDE Tokyo 13 root name servers worldwide 9

10 TLD and Authoritative Servers Top-level domain (TLD) servers: responsible for com, org, net, edu, etc, and all top-level country domains au, uk, fr, ca, jp. Network Solutions maintains servers for com TLD Educause for edu TLD Authoritative DNS servers: organization s DNS servers, providing authoritative hostname to IP mappings for organization s servers (e.g., Web and mail). Can be maintained by organization or service provider 10

11 Local Name Server Does not strictly belong to hierarchy Each ISP (residential ISP, company, university) has one. Also called default name server When a host makes a DNS query, query is sent to its local DNS server Acts as a proxy, forwards query into hierarchy 11

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

13 Recursive queries root DNS server recursive query: puts burden of name resolution on contacted name server heavy load Typically recursive to local DNS and then iterative local DNS server dns.cse.unsw.edu.au requesting host cse.unsw.edu.au TLD DNS server 4 authoritative DNS server dns.umass.edu gaia.cs.umass.edu 13

14 DNS: caching and updating records once (any) name server learns mapping, it caches mapping cache entries timeout (disappear) after some time TLD servers typically cached in local name servers Thus root name servers not often visited TTL field in DNS record indicates how long to cache When passing DNS record to another name server, TTL is updated = (original TTL - time record cached for) TTL often set to 2 days 14

15 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 (e.g. dns.foo.com) Type=CNAME name is alias name for some cannonical (the real) name is really servereast.backup2.ibm.com value is cannonical name Type=MX value is name of mailserver associated with name 15

16 Reflections: Which type of DNS records? Q: I type in in my browser. Which type of DNS record will the DNS client on my computer request for? A: Type A Q: I send to cs3331@cse.unsw.edu.au using Outlook. Which type of DNS record will the DNS client on my computer request for? A: Type MX Q: Give an example of a case where a name server contains a type NS record for a hostname? A: The TLD name server for.edu contains a type NS record for the domain mit.edu (e:g: mit.edu, dns.mit.edu, NS) 16

17 bash-3.2$ dig ;; 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 maestro.orchestra.cse.unsw.edu.au. orchestra.cse.unsw.edu.au IN NS beethoven.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

18 Inserting records into DNS Example: just created startup Register name muckingaround.com at a registrar (e.g., Network Solutions) Need to provide registrar with names and IP addresses of your authoritative name server (primary and secondary) Registrar inserts two RRs into the com TLD server: (muckingaround.com, dns1.muckingaround.com, NS) (dns1.muckingaround.com, , A) Where do you put in the Type A record for Answer: in the DNS server (dns1.muckingaround.com) If you want to provide accounts such as abc@muckingaround.com, what do you do? Answer: Type MX record for muckingaround.com is added to the DNS server How do people get the IP address of your Web site? 18

19 Wibbly Wobbly Web (self study) DNS poisoning: redirect users to dodgy URLs I setup a server ( and add the following entires into my authoritative DNS server NS ns1.yahoo.com NS ns3.europe.yahoo.com ns1.yahoo.com A ns3.europe.yahoo.com A Once other DNS servers query for this mapping they will cache the mappings (including the yahoo name server mappings) into their caches. Hence the DNS cache is poisoned with false entries for the yahoo name server Solution: Do not allow DNS servers to cache IP address mappings unless they are from authoritative name servers In above example, none of the DNS servers will cache the type A records for Yahoo name servers received from nasty.com s name server DNSSEC: DNS Security Extensions,

20 Reverse DNS lookup IP address è domain name, location Sample application: A website has replicated its content in 4 servers located at Sydney, Oslo, Tokyo and New York When a DNS query reaches the website s DNS server, it performs a reverse DNS lookup to find out your location and provides you with the IP address of the server closest to you Example: If the request comes from a device from Australia, it will provide the IP address of the server in Sydney, rather than the other 3 locations. 20

21 Quiz - DNS What would happen if the DNS query sent out by a local DNS server is lost, given that DNS uses UDP? How is it is possible for CSE to have both a web server and mail server with an alias of cse.unsw.edu.au (i.e. a web server with hostname and addresses such as xyz@cse.unsw.edu.au) 21

22 News break: Internationalised domain names Currently, domain names can only contain a to z, 0 to 9 and (Note that. has a special meaning.) In the near future, domain names can contain alphabets, characters and scripts from all world languages Greek alphabets αβγδ, Swedish ä ö å Chinese, Korean and Japanese characters; Arabic script etc Non-Latin domain name will be coded in unicode DNS works on ASCII For backward compatibility, need a method to encode unicode as ASCII To probe more: ipj_11-1/111_idns.html 22

23 Roadmap: Application layer 2.1 Principles of network applications 2.2 Web and HTTP 2.4 Electronic Mail SMTP, POP3, IMAP 2.5 DNS 2.6: P2P Applications 2.7 Socket programming with TCP (self study) 2.8 Socket programming with UDP (self study) 23

24 Pure P2P architecture no always-on server arbitrary end systems directly communicate peers are intermittently connected and change IP addresses peer-peer Two topics: File distribution Searching for information 24

25 File Distribution: Client-Server vs P2P Question : How much time to distribute file from one server to N peers? File, size F Server u 1 d 1 u 2 u d 2 s u s : server upload bandwidth u i : peer i upload bandwidth d i : peer i download bandwidth u N d N Network (with abundant bandwidth) 25

26 File distribution time: server-client server sequentially sends N copies: NF/u s time client i takes F/d i time to download F Server u N d N u u 2 1 d 1 u d s 2 Network (with abundant bandwidth) Time to distribute F to N clients using client/server approach = d cs >= max { NF/u s, F/min(d i ) } i increases linearly in N (for large N) 26

27 File distribution time: P2P Server server must send one copy: F/u s time client i takes F/d i time to download F u N u u 2 1 d 1 u d s 2 Network (with abundant bandwidth) d N fastest possible upload rate: u s + Σu i d P2P >= max { F/u s, F/min(d i ), NF/(u s + Σu i ) } i 27

28 Server-client 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

29 File distribution: BitTorrent P2P file distribution tracker: tracks peers participating in torrent torrent: group of peers exchanging chunks of a file obtain list of peers trading chunks peer 29

30 BitTorrent (1) file divided into 256KB chunks. peer joining torrent: has no chunks, but will accumulate them over time registers with tracker to get list of peers, connects to subset of peers ( neighbors ) using TCP while downloading, peer uploads chunks to other peers. peers may come and go once peer has entire file, it may (selfishly) leave or (altruistically) remain 30

31 BitTorrent (2) Pulling Chunks at any given time, different peers have different subsets of file chunks periodically, a peer (Alice) asks each neighbor for list of chunks that they have. Alice sends requests for her missing chunks rarest first Sending Chunks: tit-for-tat Alice sends chunks to four neighbors currently sending her chunks at the highest rate re-evaluate top 4 every 10 secs every 30 secs: randomly select another peer, starts sending chunks newly chosen peer may join top 4 optimistically unchoke 31

32 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 Devil in details - mini-chunks - random first selection - anti-snubbing Read linked paper on website (NOT FOR EXAM) With higher upload rate, can find better trading partners & get file faster! 32

33 Philosophy behind P2P There is a spirit of sharing and cooperation behind P2P applications Sharing of files There are many other examples of sharing and cooperation in the Internet Linux is produced by many cooperating programmers Wikipedia is created by a team of cooperating authors What else can people share? Current research 33

34 Sharing of information Current research You are driving and you know the traffic condition at where you are If everyone shares his/her local traffic information, you get a traffic map You are driving past a petrol station You know the price at that petrol station If people share this information, you know the price of petrol at many petrol stations 34

35 Current research Automatic collection of petrol prices from mobile phone camera 35

36 Distributed Hash Tables (DHT): History In , academic researchers jumped on to the P2P bandwagon Motivation: frustrated by popularity of all these half-baked P2P apps. We can do better! (so they said) guaranteed lookup success for data in system provable bounds on search time provable scalability to millions of node Hot topic in networking ever since 36

37 Hash table - review (key,value) pairs Centralised hash table all (key,value) pairs on 1 node Distributed hash tables each node has a section of (key,value) pairs Figure src: 37

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

39 Distributed Hash Table (DHT) DHT = distributed P2P database Database has (key, value) pairs; key: tax file number; value: human name key: content type; value: IP address Peers query DB with key DB returns values that match the key Peers can also insert (key, value) peers 39

40 DHT: Basic Idea 40

41 DHT: Basic Idea (2) 41

42 DHT: Basic Idea (3) 42

43 DHT: Basic Idea (4) 43

44 DHT: Basic Idea (5) Two questions: - how are the nodes connected? - how the key space is partitioned? 44

45 DHT Identifiers Assign integer identifier to each peer in range [0,2 n -1] Each identifier can be represented by n bits Require each key to be an integer in same range To get integer keys, hash original key (Led Ze..) eg, key = h( Led Zeppelin IV ) Common hash function such a SHA-1 This is why they call it a distributed hash table 45

46 How to assign keys to peers? Central issue: Assigning (key, value) pairs to peers Rule: assign key to the peer that has the closest ID greater than or equal to the key Convention in lecture: closest is the immediate successor of the key n=4, range[0-15]; 8 peers: 1,3,4,5,8,10,12,14; key = 13, then successor peer = 14 key = 15, then successor peer = 1 46

47 Circular DHT (1) Peers organised in the form of a ring Overlay network Popular Instantiation: CHORD (paper linked to lecture notes) 8 47

48 Ciruclar DHT: How to search? (1) One extreme: Every node only knows its successor 1 Who s resp I am 3 for key 14? N/2 messages 15 on avg to resolve query, when there are N peers Define closest as closest successor

49 Ciruclar DHT: How to search? (2) Other extreme: Every node knows of every other node 1 Who s resp You are 3 for key 14? 1 message 15 to resolve query BUT large routing tables (N entries)

50 Circular DHT with Shortcuts Who s resp for key 1110? 10 8 Each peer keeps track of IP addresses of predecessor, successor, and a few short cuts Reduced from 6 to 2 messages Possible to design shortcuts so O(log N) neighbors, O(log N) messages in query Active research area

51 Peer Churn To handle peer churn, require each peer to know the IP address of its two successors. Each peer periodically pings its two successors to see if they are still alive Peer 5 abruptly leaves Peer 4 detects; makes 8 its immediate successor; asks 8 who its immediate successor is; makes 8 s immediate successor its second successor What if peer 13 wants to join? 51

52 1 Peer Join Joining peer gets in touch with one of the peers (e.g.: designated contact peer 1 in this example) Node 13 sends a join request This gets forwarded until reaches Node 12 detects that node 13 will be its new successor Node12 informs node 13 -> your predecessor (12) and successor (15) Node 13 joins and informs 12 to change its successor (from 15 to 13) Node 12 s key space is partitioned and appropriate keys transferred to 12 52

53 P2P Example: Skype Skype clients (SC) inherently P2P: pairs of users communicate proprietary application-layer protocol (inferred via reverse engineering) hierarchical overlay with SNs Index maps usernames to IP addresses; distributed over SNs Skype login server Supernode (SN) 53

54 Application: Summary Our study of network apps now complete! Application architectures client-server P2P hybrid application service requirements: reliability, bandwidth, delay Internet transport service model connection-oriented, reliable: TCP unreliable, datagrams: UDP specific protocols: HTTP FTP SMTP, POP, IMAP DNS P2P Networks socket programming 54

55 Application layer: Roadmap 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 Networks 2.7 Socket programming (self study) Note: 6 th Edition uses Phython, older editions used Java 55

56 Application: Summary Most importantly: learned about protocols typical request/reply message exchange: client requests info or service server responds with data, status code message formats: headers: fields giving info about data data: info being communicated control vs. data msgs in-band, out-of-band centralized vs. decentralized stateless vs. stateful reliable vs. unreliable msg transfer complexity at network edge 56

57 Socket programming Goal: learn how to build client/server application that communicate using sockets socket Socket API introduced in BSD4.1 UNIX, 1981 explicitly created, used, released by apps client/server paradigm two types of transport service via socket API: unreliable datagram reliable, byte stream-oriented a host-local, application-created, OS-controlled interface (a door ) into which application process can both send and receive messages to/from another application process 57

58 Socket Programming (self study) You should review this section in your own time (foils from this point to the end has been left as self study) You can learn programming sockets by programming hands on. Run sample codes, do lab-4 and then apply this to your assignment 58

59 Socket-programming using TCP Socket: a door between application process and end-end-transport protocol (UCP or TCP) TCP service: reliable transfer of bytes from one process to another controlled by application developer controlled by operating system process socket TCP with buffers, variables internet process socket TCP with buffers, variables controlled by application developer controlled by operating system host or server host or server 59

60 Socket programming with TCP Client must contact server server process must first be running server must have created socket (door) that welcomes client s contact Client contacts server by: creating client-local TCP socket specifying IP address, port number of server process When client creates socket: client TCP establishes connection to server TCP When contacted by client, server TCP creates new socket for server process to communicate with 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 transfer of bytes ( pipe ) between client and server 60

61 TCP Sockets 61

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

63 Client/Server Interaction (in C) server welcomesocket=socket(): create socket client clientsocket=socket(): create socket bind(welcomesocket, ): specify socket address/port bind(clientsocket): specify socket address optional listen(welcomesocket, ): specify that socket welcomesocket is a listening socket TCP connection setup connectionsocket=accept(welcomesocket, ): get a connected connection from the queue for socket welcomesocket; create a new socket identified by connectionsocket connect(clientsocket, serveraddr, serverport): initialize TCP handshake to server; return until TCP handshake is done read()/write(): do IO on clientsocket read()/write(): do IO on socket connectionsocket close(clientsocket): done close(connectionsocket): done 63

64 ServerSocket ServerSocket() creates an unbound server socket. ServerSocket(int port) creates a server socket, bound to the specified port. ServerSocket(int port, int backlog) creates a server socket and binds it to the specified local port number, with the specified backlog. ServerSocket(int port, int backlog, InetAddress bindaddr) create a server with the specified port, listen backlog, and local IP address to bind to. bind(socketaddress endpoint) binds the ServerSocket to a specific address (IP address and port number). bind(socketaddress endpoint, int backlog) binds the ServerSocket to a specific address (IP address and port number). Socket accept() listens for a connection to be made to this socket and accepts it. close() closes this socket. 64

65 Socket Socket(InetAddress address, int port) creates a stream socket and connects it to the specified port number at the specified IP address. Socket(InetAddress address, int port, InetAddress localaddr, int localport) creates a socket and connects it to the specified remote address on the specified remote port. Socket(String host, int port) creates a stream socket and connects it to the specified port number on the named host. bind(socketaddress bindpoint) binds the socket to a local address. connect(socketaddress endpoint) connects this socket to the server. connect(socketaddress endpoint, int timeout) connects this socket to the server with a specified timeout value. InputStreamget InputStream() returns an input stream for this socket. OutputStreamgetOutputStream() returns an output stream for this socket. close() closes this socket. 65

66 Stream jargon A stream is a sequence of characters that flow into or out of a process. An input stream is attached to some input source for the process, e.g., keyboard or socket. An output stream is attached to an output source, e.g., monitor or socket. 66

67 Socket programming with TCP keyboard monitor Example client-server app: 1) client reads line from standard input (infromuser stream), sends to server via socket (outtoserver stream) 2) server reads line from socket 3) server converts line to uppercase, sends back to client 4) client reads, prints modified line from socket (infromserver stream) Client Process process input stream output stream infromuser outtoserver to network infromserver client TCP clientsocket socket input stream from network TCP socket 67

68 Example: Java client (TCP) 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()); 68

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

70 Example: Java server (TCP) import java.io.*; 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())); 70

71 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 71

72 Application layer: Roadmap 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 Networks 2.7 Socket programming 72

73 Socket programming with UDP UDP: no connection between client and server no handshaking sender explicitly attaches IP address and port of destination to each packet server must extract IP address, port of sender from received packet application viewpoint UDP provides unreliable transfer of groups of bytes ( datagrams ) between client and server UDP: transmitted data may be received out of order, or lost 73

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

75 Example: Java client (UDP) keyboard monitor Process Client process Output: sends packet (TCP sent byte stream ) input stream UDP packet infromuser sendpacket receivepacket UDP packet Input: receives packet (TCP received byte stream ) client clientsocket UDP socket UDP socket to network from network 75

76 Example: Java client (UDP) 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(); 76

77 Example: Java client (UDP), cont. 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(); } 77

78 Example: Java server (UDP) 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); 78

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

80 Differences with C C usually requires a little more work. Java does a lot of things implicitly Sequence of commands for TCP client: socket(), connect(), write(), read(), write(), read(),, close() Before call to connect() you have to explicitly get the IP address of the server using gethostbyname() Sequence of commands for the TCP server: socket(), bind() to well-known port, listen(), accept(), read(), write(), read(), write(),., close() socket() creates an active socket (client socket that will issue connect() ) listen() converts an unconnected socket into a passive socket, indicates to the OS that incoming connection requests should be directed to the socket accept() is used to welcome the next connection request that arrives 80

81 Programming References Lots of links on the assignment webpage (at the bottom) TCP/IP Sockets in Java: Practical Guide for Programmers, by Kenneth Calvert, Michael Donahoo Unix Network Programming Volume1: Networking APIs, by W. Richard Stevens Any other basic network programming book is sufficient Any basic C, Java book Note: The programming assignment does not require extensive knowledge of network programming, just basics 81

82 Sample Code Sections 2.7 and 2.8 of the text have sample working programs Sample Echo Client/Server Program on website (under Assignment link) Echo service: Client sends text to server and server echoes it back to the client Read and understand the code before executing it Practice Programming Lab: Week 4 82

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 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 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

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

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

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

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: 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

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

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

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

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

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

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

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

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

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 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

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 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

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

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

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

Lecture 3. Java Socket Programming. TCP, UDP and URL

Lecture 3. Java Socket Programming. TCP, UDP and URL Lecture 3 TCP, UDP and URL 1 Java Sockets Programming The package java.net provides support for sockets programming (and more). Typically you import everything defined in this package with: import java.net.*;

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

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

CS 355. Computer Networking. Wei Lu, Ph.D., P.Eng.

CS 355. Computer Networking. Wei Lu, Ph.D., P.Eng. CS 355 Computer Networking Wei Lu, Ph.D., P.Eng. Chapter 2: Application Layer Overview: Principles of network applications? Introduction to Wireshark Web and HTTP FTP Electronic Mail: SMTP, POP3, IMAP

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

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

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

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

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

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 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

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

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

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

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

CMSC 332 Computer Networks P2P and Sockets

CMSC 332 Computer Networks P2P and Sockets CMSC 332 Computer Networks P2P and Sockets Professor Szajda Announcements Programming Assignment 1 is due Thursday Where are we? What sorts of problems are we having? 2 Recap SMTP is the language that

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

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

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

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

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: 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

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

CSC 4900 Computer Networks: P2P and Sockets

CSC 4900 Computer Networks: P2P and Sockets CSC 4900 Computer Networks: P2P and Sockets Professor Henry Carter Fall 2017 Recap SMTP is the language that mail servers use to exchange messages. SMTP is push-based... why? You can run SMTP from a telnet

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

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

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

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

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 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

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

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

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

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

Process Communication COMPUTER NETWORKING Part 2

Process Communication COMPUTER NETWORKING Part 2 Process Communication COMPUTER NETWORKING Part 2 Client-server paradigm and Socket Programming ch 18 Thanks to the authors of the textbook [USP] and [KR] for providing the base slides. I made several changes/additions.

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

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

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

Client/Server Computing & Socket Programming

Client/Server Computing & Socket Programming CPSC 852 Intering Client/Server Computing & Socket Programming Michele Weigle Department of Computer Science Clemson University mweigle@cs.clemson.edu http://www.cs.clemson.edu/~mweigle/courses/cpsc852

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

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

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

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 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

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

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. Application Layer 1. By Mikkel Christiansen for NA mm7 Spring 2004

Application Layer. Application Layer 1. By Mikkel Christiansen for NA mm7 Spring 2004 Application Layer By Mikkel Christiansen for NA mm7 Spring 2004 Based on power-point material from J.F Kurose and K.W. Ross website Application Layer 1 Last on NA End-systems PCs workstations, servers

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

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

JAVA SOCKET PROGRAMMING

JAVA SOCKET PROGRAMMING JAVA SOCKET PROGRAMMING WHAT IS A SOCKET? Socket The combination of an IP address and a port number. (RFC 793 original TCP specification) The name of the Berkeley-derived application programming interfaces

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

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

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

Computer Networks Unit II Transport layer (2012 pattern)

Computer Networks Unit II Transport layer (2012 pattern) Computer Networks Unit II Transport layer (2012 pattern) By Prof. B.A.Khivsara Assistant Prof. Department of Computer Engg. SNJB s KBJ COE, Chandwad Introduction 1-1 Chapter 2: ROAD MAP Transport Layer

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

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

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

The Application Layer: Sockets, DNS

The Application Layer: Sockets, DNS The Application Layer: Sockets, DNS CS 352, Lecture 3 http://www.cs.rutgers.edu/~sn624/352-s19 Srinivas Narayana 1 App-layer protocol Types of messages exchanged, e.g., request, response Message format:

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 v SMTP, POP3, IMAP 2.5 DNS 2.6 P2P applications

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

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

Chapter 2 Application Layer

Chapter 2 Application Layer Chapter 2 Application Layer A note on the use of these ppt slides: The notes used in this course are substantially based on powerpoint slides developed and copyrighted by J.F. Kurose and K.W. Ross, 2007

More information

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

Introduction to Computer Networking. Guy Leduc. Chapter 2 Application Layer. Chapter 2: outline Introduction to Computer Networking Guy Leduc Chapter 2 Application Layer Computer Networking: A Top Down Approach, 6 th edition. Jim Kurose, Keith Ross Addison-Wesley, March 2012 2: Application Layer

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

TCP and UDP Socket Programming in JAVA TCP Socket Programming 1. Write code for Client and save in GreetingClient.java

TCP and UDP Socket Programming in JAVA TCP Socket Programming 1. Write code for Client and save in GreetingClient.java TCP Socket Programming 1. Write code for Client and save in GreetingClient.java // File Name GreetingClient.java public class GreetingClient public static void main(string [] args) String servername =

More information

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

Computer Networks and Applications. Application Layer ( , DNS, P2P, Socket Programming) Computer Networks and Applications COMP 3331/COMP 9331 Week 3 Application Layer (Email, DNS, P2P, Socket Programming) Reading Guide: Chapter 2, Sections 2.4 2.7 Announcements v Lab for Week 3 Socket Programming

More information

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

Application Layer. Goals: Service models. Conceptual aspects of network application protocols Client server paradigm Application Layer Goals: Conceptual aspects of network application protocols Client server paradigm Service models Review protocols by examining popular application-level protocols HTTP DNS 1 Applications

More information

CSc 450/550 Computer Networks Domain Name System

CSc 450/550 Computer Networks Domain Name System CSc 450/550 Computer Networks Domain Name System Jianping Pan Summer 2007 5/28/07 CSc 450/550 1 Review: Web/HTTP Web URI/URL, HTML tags, embedded objects HTTP request and response persistence, statefulness

More information

Chapter II: Application Layer

Chapter II: Application Layer Chapter II: Application Layer UG3 Computer Communications & Networks (COMN) MAHESH MARINA mahesh@ed.ac.uk Slides thanks to Myungjin Lee, and copyright of Kurose and Ross First, a review Web and HTTP 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 Some network apps e-mail web instant messaging remote login P2P file sharing multi-user network games streaming stored video clips voice over IP real-time

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

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

Introduction to Computer Networking. Guy Leduc. Chapter 2 Application Layer. Chapter 2: outline Introduction to Computer Networking Guy Leduc Chapter 2 Application Layer Computer Networking: A Top Down Approach, 7 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2016 2: Application Layer

More information

Lecture 8: Application Layer P2P Applications and DHTs

Lecture 8: Application Layer P2P Applications and DHTs Lecture 8: Application Layer P2P Applications and DHTs COMP 332, Spring 2018 Victoria Manfredi Acknowledgements: materials adapted from Computer Networking: A Top Down Approach 7 th edition: 1996-2016,

More information