SlideShare une entreprise Scribd logo
1  sur  115
2: Application Layer Chapter 2 Application Layer Computer Networking: A Top Down Approach ,  5 th  edition.  Jim Kurose, Keith Ross Addison-Wesley, April 2009.  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Chapter 2: Application layer ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer
Chapter 2: Application Layer ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer
Some network apps ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer
Creating a network app ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer application transport network data link physical application transport network data link physical application transport network data link physical
Chapter 2: Application layer ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer
Application architectures ,[object Object],[object Object],[object Object],2: Application Layer
Client-server architecture ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer client/server
Pure P2P architecture ,[object Object],[object Object],[object Object],[object Object],2: Application Layer peer-peer
Hybrid of client-server and P2P ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer
Processes communicating ,[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer ,[object Object]
Sockets ,[object Object],[object Object],[object Object],[object Object],2: Application Layer Internet controlled by OS controlled by app developer ,[object Object],process TCP with buffers, variables socket host or server process TCP with buffers, variables socket host or server
Addressing processes ,[object Object],[object Object],[object Object],2: Application Layer
Addressing processes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer
App-layer protocol defines ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer
What transport service does an app need? ,[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer ,[object Object],[object Object],[object Object],[object Object],[object Object]
Transport service requirements of common apps 2: Application Layer Application file transfer e-mail Web documents real-time audio/video stored audio/video interactive games instant messaging Data loss no loss no loss no loss loss-tolerant loss-tolerant loss-tolerant no loss Throughput elastic elastic elastic audio: 5kbps-1Mbps video:10kbps-5Mbps same as above  few kbps up elastic Time Sensitive no no no yes, 100’s msec yes, few secs yes, 100’s msec yes and no
Internet transport protocols services ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer
Internet apps:  application, transport protocols 2: Application Layer Application e-mail remote terminal access Web  file transfer streaming multimedia Internet telephony Application layer protocol SMTP [RFC 2821] Telnet [RFC 854] HTTP [RFC 2616] FTP [RFC 959] HTTP (eg Youtube),  RTP [RFC 1889] SIP, RTP, proprietary (e.g., Skype) Underlying transport protocol TCP TCP TCP TCP TCP or UDP typically UDP
Chapter 2: Application layer ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer
Web and HTTP ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer www.someschool.edu/someDept/pic.gif host name path name
HTTP overview ,[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer PC running Explorer Server  running Apache Web server Mac running Navigator HTTP request HTTP request HTTP response HTTP response
HTTP overview (continued) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer ,[object Object],[object Object],[object Object],aside
HTTP connections ,[object Object],[object Object],[object Object],[object Object],2: Application Layer
Nonpersistent HTTP ,[object Object],[object Object],2: Application Layer 2.  HTTP  client sends HTTP  request message  (containing URL) into TCP connection socket. Message indicates that client wants object  someDepartment/home.index 1b.  HTTP  server at host  www.someSchool.edu  waiting for TCP connection at port 80.  “accepts” connection, notifying client 3.  HTTP  server receives request message, forms  response message  containing requested object, and sends message into its socket time (contains text,  references to 10  jpeg images)
Nonpersistent HTTP (cont.) ,[object Object],2: Application Layer 6.   Steps 1-5 repeated for each of 10 jpeg objects 4.  HTTP  server closes TCP connection.  time
Non-Persistent HTTP: Response time ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer time to  transmit  file initiate TCP connection RTT request file RTT file received time time
Persistent HTTP ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer
HTTP request message ,[object Object],[object Object],[object Object],2: Application Layer GET /somedir/page.html HTTP/1.1 Host: www.someschool.edu  User-agent: Mozilla/4.0 Connection: close  Accept-language:fr  (extra carriage return, line feed)   request line (GET, POST,  HEAD commands) header lines Carriage return,  line feed  indicates end  of message
HTTP request message: general format 2: Application Layer
Uploading form input ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer www.somesite.com/animalsearch?monkeys&banana
Uploading form input 2: Application Layer
Method types ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer
HTTP response message 2: Application Layer HTTP/1.1 200 OK  Connection close Date: Thu, 06 Aug 1998 12:00:15 GMT  Server: Apache/1.3.0 (Unix)  Last-Modified: Mon, 22 Jun 1998 …...  Content-Length: 6821  Content-Type: text/html data data data data data ...  status line (protocol status code status phrase) header lines data, e.g.,  requested HTML file
HTTP response status codes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer In first line in server->client response message. A few sample codes:
Trying out HTTP (client side) for yourself ,[object Object],2: Application Layer Opens TCP connection to port 80 (default HTTP server port) at cis.poly.edu. Anything typed in sent  to port 80 at cis.poly.edu telnet cis.poly.edu 80 ,[object Object],GET /~ross/ HTTP/1.1 Host: cis.poly.edu By typing this in (hit carriage return twice), you send this minimal (but complete)  GET request to HTTP server 3. Look at response message sent by HTTP server!
User-server state: cookies ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer
Cookies: keeping “state” (cont.) 2: Application Layer client server cookie file one week later: backend database usual http response msg usual http response msg usual http request msg cookie: 1678 cookie- specific action access ebay 8734 usual http request msg Amazon server creates ID 1678 for user create entry usual http response  Set-cookie: 1678  ebay 8734 amazon 1678 usual http request msg cookie: 1678 cookie- spectific action access ebay 8734 amazon 1678
Cookies (continued) ,[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer ,[object Object],[object Object],[object Object],aside ,[object Object],[object Object],[object Object]
Web caches (proxy server) ,[object Object],[object Object],[object Object],[object Object],2: Application Layer Goal:  satisfy client request without involving origin server client Proxy server client origin  server origin  server HTTP request HTTP response HTTP request HTTP request HTTP response HTTP response
More about Web caching ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer
Caching example  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer origin servers public Internet institutional network 10 Mbps LAN 1.5 Mbps  access link institutional cache
Caching example (cont) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer origin servers public Internet institutional network 10 Mbps LAN 10 Mbps  access link institutional cache
Caching example (cont) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer origin servers public Internet institutional network 10 Mbps LAN 1.5 Mbps  access link institutional cache
Conditional GET ,[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer cache server HTTP request msg If-modified-since: <date> object  not  modified HTTP request msg If-modified-since: <date> HTTP response HTTP/1.0 200 OK <data> object  modified HTTP response HTTP/1.0  304 Not Modified
Chapter 2: Application layer ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer
FTP: the file transfer protocol ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer file transfer local file system remote file system user  at host FTP server FTP user interface FTP client
FTP: separate control, data connections ,[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer ,[object Object],[object Object],[object Object],FTP client FTP server TCP control connection port 21 TCP data connection port 20
FTP commands, responses ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer
Chapter 2: Application layer ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer
Electronic Mail ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer user mailbox outgoing  message queue mail server user agent user agent user agent mail server user agent user agent mail server user agent SMTP SMTP SMTP
Electronic Mail: mail servers ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer mail server user agent user agent user agent mail server user agent user agent mail server user agent SMTP SMTP SMTP
Electronic Mail: SMTP  [RFC 2821] ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer
Scenario: Alice sends message to Bob ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer 1 2 3 4 5 6 user agent mail server mail server user agent
Sample SMTP interaction 2: Application Layer S: 220 hamburger.edu  C: HELO crepes.fr  S: 250  Hello crepes.fr, pleased to meet you  C: MAIL FROM: <alice@crepes.fr>  S: 250 alice@crepes.fr... Sender ok  C: RCPT TO: <bob@hamburger.edu>  S: 250 bob@hamburger.edu ... Recipient ok  C: DATA  S: 354 Enter mail, end with &quot;.&quot; 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
Try SMTP interaction for yourself: ,[object Object],[object Object],[object Object],[object Object],2: Application Layer
SMTP: final words ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer
Mail message format ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer header body blank line
Mail access protocols ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer SMTP access protocol receiver’s mail  server user agent sender’s mail  server user agent SMTP
POP3 protocol ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer C: list  S: 1 498  S: 2 912  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  S: +OK  POP3 server signing off S: +OK POP3 server ready  C: user bob  S: +OK  C: pass hungry  S: +OK  user successfully logged on
POP3 (more) and IMAP ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer
Chapter 2: Application layer ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer
DNS: Domain Name System ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer
DNS  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer
Distributed, Hierarchical Database ,[object Object],[object Object],[object Object],[object Object],2: Application Layer Root DNS Servers com DNS servers org DNS servers edu DNS servers poly.edu DNS servers umass.edu DNS servers yahoo.com DNS servers amazon.com DNS servers pbs.org DNS servers
DNS: Root name servers ,[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer 13 root name servers worldwide b USC-ISI Marina del Rey, CA l  ICANN Los Angeles, CA e NASA Mt View, CA f  Internet Software C. Palo  Alto, CA (and 36 other locations) i  Autonomica,  Stockholm (plus  28 other locations) k RIPE London (also 16 other locations) m WIDE Tokyo (also Seoul, Paris, SF) a Verisign, Dulles, VA c Cogent, Herndon, VA (also LA) d U Maryland College Park, MD g US DoD Vienna, VA h ARL Aberdeen, MD j  Verisign, ( 21 locations)
TLD and Authoritative Servers ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer
Local Name Server ,[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer
DNS name  resolution example ,[object Object],2: Application Layer requesting host cis.poly.edu gaia.cs.umass.edu root DNS server 1 2 3 4 5 6 authoritative DNS server dns.cs.umass.edu 7 8 TLD DNS server ,[object Object],[object Object],[object Object],local DNS server dns.poly.edu
DNS name  resolution example 2: Application Layer ,[object Object],[object Object],[object Object],requesting host cis.poly.edu gaia.cs.umass.edu root DNS server local DNS server dns.poly.edu 1 2 4 5 6 authoritative DNS server dns.cs.umass.edu 7 8 TLD DNS server 3
DNS: caching and updating records ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer
DNS records ,[object Object],[object Object],[object Object],[object Object],2: Application Layer ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],RR format:  (name, value, type, ttl)
DNS protocol, messages ,[object Object],2: Application Layer ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
DNS protocol, messages 2: Application Layer Name, type fields for a query RRs in response to query records for authoritative servers additional “helpful” info that may be used
Inserting records into DNS ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer
Chapter 2: Application layer ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer
Pure P2P architecture ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer peer-peer
File Distribution: Server-Client vs P2P ,[object Object],2: Application Layer u s u 2 d 1 d 2 u 1 u N d N Server Network (with  abundant bandwidth) File, size  F u s :  server upload bandwidth u i :  peer i upload bandwidth d i :  peer i download bandwidth
File distribution time: server-client ,[object Object],[object Object],[object Object],2: Application Layer u s u 2 d 1 d 2 u 1 u N d N Server Network (with  abundant bandwidth) F increases linearly in N (for large N) = d cs  = max  {   NF/u s , F/min(d i )   } i Time to  distribute  F   to  N  clients using  client/server approach
File distribution time: P2P ,[object Object],[object Object],[object Object],2: Application Layer u s u 2 d 1 d 2 u 1 u N d N Server Network (with  abundant bandwidth) F ,[object Object],d P2P  = max  {   F/u s , F/min(d i )  , NF/(u s  +   u i )   } i
2: Application Layer Server-client vs. P2P: example Client upload rate = u,  F/u = 1 hour,  u s  = 10u,  d min  ≥ u s
File distribution: BitTorrent  2: Application Layer tracker:  tracks peers  participating in torrent torrent:  group of  peers exchanging  chunks of a file ,[object Object],obtain list of peers   trading  chunks peer
BitTorrent (1) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer
BitTorrent (2) ,[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
BitTorrent:  Tit-for-tat 2: Application Layer (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 With higher upload rate,  can find better trading  partners & get file faster!
Distributed Hash Table (DHT) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
DHT Identifiers ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
How to assign keys to peers? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Circular DHT (1) ,[object Object],[object Object],1 3 4 5 8 10 12 15
Circle DHT  (2) 0001 0011 0100 0101 1000 1010 1100 1111 O(N) messages on avg to resolve query, when there are N peers 1110 1110 1110 1110 1110 1110 Define  closest as closest successor Who’s resp  for key 1110  ? I am
Circular DHT with Shortcuts ,[object Object],[object Object],[object Object],1 3 4 5 8 10 12 15 Who’s resp  for key 1110?
Peer Churn ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],1 3 4 5 8 10 12 15
P2P Case study: Skype ,[object Object],[object Object],[object Object],[object Object],2: Application Layer Supernode  (SN) Skype clients (SC) Skype  login server
Peers as relays ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer
Chapter 2: Application layer ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer
Socket programming ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer Goal:  learn how to build client/server application that communicate using sockets 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 socket
Socket-programming using TCP ,[object Object],[object Object],2: Application Layer controlled by application developer controlled by operating system host or server controlled by application developer controlled by operating system host or server internet process TCP with buffers, variables socket process TCP with buffers, variables socket
Socket programming  with TCP ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer TCP provides reliable, in-order transfer of bytes (“pipe”)  between client and server application viewpoint
Client/server socket interaction: TCP 2: Application Layer Server  (running on  hostid ) Client wait for incoming connection request connectionSocket = welcomeSocket.accept() create socket, port= x , for incoming request: welcomeSocket =  ServerSocket() create socket, connect to  hostid , port= x clientSocket =  Socket() close connectionSocket read reply from clientSocket close clientSocket send request using clientSocket read request from connectionSocket write reply to connectionSocket TCP  connection setup
[object Object],[object Object],[object Object],2: Application Layer Client process client TCP socket Stream jargon
Socket programming with TCP ,[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer
Example: Java client (TCP) 2: Application Layer import java.io.*;  import java.net.*;  class TCPClient {  public static void main(String argv[]) throws Exception  {  String sentence;  String modifiedSentence;  BufferedReader inFromUser =  new BufferedReader(new InputStreamReader(System.in));  Socket clientSocket = new Socket(&quot;hostname&quot;, 6789);  DataOutputStream outToServer =  new DataOutputStream(clientSocket.getOutputStream());   Create input stream Create  client socket,  connect to server Create output stream attached to socket
Example: Java client (TCP), cont. 2: Application Layer BufferedReader inFromServer =  new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));  sentence = inFromUser.readLine();  outToServer.writeBytes(sentence + '');  modifiedSentence = inFromServer.readLine();  System.out.println (&quot;FROM SERVER: &quot; + modifiedSentence );  clientSocket.close();  }  }   Create input stream attached to socket Send line to server Read line from server
Example: Java server (TCP) 2: Application Layer import java.io.*;  import java.net.*;  class TCPServer {  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()));  Create welcoming socket at port 6789 Wait, on welcoming socket for contact by client Create input stream, attached  to socket
Example: Java server (TCP), cont 2: Application Layer DataOutputStream  outToClient =  new DataOutputStream (connectionSocket.getOutputStream());   clientSentence = inFromClient.readLine();  capitalizedSentence = clientSentence.toUpperCase() + '';  outToClient.writeBytes(capitalizedSentence);  }  }  }   Read in  line from socket Create output stream, attached  to socket Write out line to socket End of while loop, loop back and wait for another client connection
Chapter 2: Application layer ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer
Socket programming  with UDP ,[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer application viewpoint UDP provides  unreliable  transfer of groups of bytes (“datagrams”) between client and server
Client/server socket interaction: UDP 2: Application Layer Server  (running on  hostid ) create socket, port= x. serverSocket =  DatagramSocket() close clientSocket read datagram from clientSocket create socket, clientSocket =  DatagramSocket() Client Create datagram with server IP and port=x; send datagram via   clientSocket read datagram from serverSocket write reply to serverSocket specifying  client address, port number
Example: Java client (UDP) 2: Application Layer Output:  sends packet (recall that TCP sent “byte stream”) Input:  receives packet (recall thatTCP received “byte stream”) Client process client UDP socket
Example: Java client (UDP) 2: Application Layer import java.io.*;  import java.net.*;  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(&quot;hostname&quot;);  byte[] sendData = new byte[1024];  byte[] receiveData = new byte[1024];  String sentence = inFromUser.readLine();  sendData = sentence.getBytes();   Create input stream Create  client socket Translate hostname to IP  address  using DNS
Example: Java client (UDP), cont. 2: Application Layer 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(&quot;FROM SERVER:&quot; + modifiedSentence);  clientSocket.close();  }  }   Create datagram with data-to-send, length, IP addr, port Send datagram to server Read datagram from server
Example: Java server (UDP) 2: Application Layer import java.io.*;  import java.net.*;  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];  while(true)  {  DatagramPacket receivePacket =  new DatagramPacket(receiveData, receiveData.length);  serverSocket.receive(receivePacket);   Create datagram socket at port 9876 Create space for received datagram Receive datagram
Example: Java server (UDP), cont 2: Application Layer String sentence = new String(receivePacket.getData());  InetAddress IPAddress = receivePacket.getAddress();  int port = receivePacket.getPort();  String capitalizedSentence = sentence.toUpperCase();  sendData = capitalizedSentence.getBytes();  DatagramPacket sendPacket =  new DatagramPacket(sendData, sendData.length, IPAddress,  port);  serverSocket.send(sendPacket);  }  }  }   Get IP addr port #, of sender Write out  datagram to socket End of while loop, loop back and wait for another datagram Create datagram to send to client
Chapter 2: Summary ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Chapter 2: Summary ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],2: Application Layer ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Contenu connexe

Tendances

Tendances (20)

Lecture 9 electronic_mail_representation_and_transfer
Lecture 9 electronic_mail_representation_and_transferLecture 9 electronic_mail_representation_and_transfer
Lecture 9 electronic_mail_representation_and_transfer
 
Email
EmailEmail
Email
 
Application layer
Application layerApplication layer
Application layer
 
Application layer protocols
Application layer protocolsApplication layer protocols
Application layer protocols
 
Email
EmailEmail
Email
 
Electronic mail
Electronic mailElectronic mail
Electronic mail
 
Project report on mesh hybrid topology network vision
Project report on mesh hybrid topology network visionProject report on mesh hybrid topology network vision
Project report on mesh hybrid topology network vision
 
2. application layer
2. application layer2. application layer
2. application layer
 
Mail server report
Mail server reportMail server report
Mail server report
 
Csc network
Csc networkCsc network
Csc network
 
Application layer
Application layerApplication layer
Application layer
 
Appl layer
Appl layerAppl layer
Appl layer
 
Microsoft Exchange Technology Overview
Microsoft Exchange Technology OverviewMicrosoft Exchange Technology Overview
Microsoft Exchange Technology Overview
 
Final year project report on Internet And Interanet Emailing server
Final year project report on Internet And Interanet Emailing serverFinal year project report on Internet And Interanet Emailing server
Final year project report on Internet And Interanet Emailing server
 
INVESTIGATING SOAP AND XML TECHNOLOGIES IN WEB SERVICE
INVESTIGATING SOAP AND XML TECHNOLOGIES IN WEB SERVICEINVESTIGATING SOAP AND XML TECHNOLOGIES IN WEB SERVICE
INVESTIGATING SOAP AND XML TECHNOLOGIES IN WEB SERVICE
 
Mail services and mail commands in linux
Mail services and mail commands in linuxMail services and mail commands in linux
Mail services and mail commands in linux
 
computer networks layers
computer networks layerscomputer networks layers
computer networks layers
 
The Fundamental of Electronic Mail (E-mail)
The Fundamental of Electronic Mail (E-mail)The Fundamental of Electronic Mail (E-mail)
The Fundamental of Electronic Mail (E-mail)
 
Email - Electronic Mail
Email - Electronic MailEmail - Electronic Mail
Email - Electronic Mail
 
Email Security, The Essence of Secure E-mail
Email Security, The Essence of Secure E-mailEmail Security, The Essence of Secure E-mail
Email Security, The Essence of Secure E-mail
 

Similaire à Chapter2 Application

applicationapplicationapplicationapplication.ppt
applicationapplicationapplicationapplication.pptapplicationapplicationapplicationapplication.ppt
applicationapplicationapplicationapplication.ppt
DEEPAK948083
 
02_Chapter_2_V6_LV.pptx
02_Chapter_2_V6_LV.pptx02_Chapter_2_V6_LV.pptx
02_Chapter_2_V6_LV.pptx
ALI2H
 
Hasanain_Application Layer_Chapter_2_Version 7.1.ppt
Hasanain_Application Layer_Chapter_2_Version 7.1.pptHasanain_Application Layer_Chapter_2_Version 7.1.ppt
Hasanain_Application Layer_Chapter_2_Version 7.1.ppt
nadeemrana0257
 
Lecture-2012-2-Application Layer-Introduction.ppt
Lecture-2012-2-Application Layer-Introduction.pptLecture-2012-2-Application Layer-Introduction.ppt
Lecture-2012-2-Application Layer-Introduction.ppt
Rashmin Tanna
 
Lecture application layer
Lecture application layerLecture application layer
Lecture application layer
Hasam Panezai
 
Materi Perkuliahan Jaringan Komputer Teknik Informatika Chapter 2
Materi Perkuliahan Jaringan Komputer Teknik Informatika Chapter 2Materi Perkuliahan Jaringan Komputer Teknik Informatika Chapter 2
Materi Perkuliahan Jaringan Komputer Teknik Informatika Chapter 2
Raga Yustia
 

Similaire à Chapter2 Application (20)

applicationapplicationapplicationapplication.ppt
applicationapplicationapplicationapplication.pptapplicationapplicationapplicationapplication.ppt
applicationapplicationapplicationapplication.ppt
 
Chapter2_L2.ppt
Chapter2_L2.pptChapter2_L2.ppt
Chapter2_L2.ppt
 
20CS2008 Computer Networks
20CS2008 Computer Networks 20CS2008 Computer Networks
20CS2008 Computer Networks
 
Chapter2 l2 modified_um
Chapter2 l2 modified_umChapter2 l2 modified_um
Chapter2 l2 modified_um
 
02_Chapter_2_V6_LV.pptx
02_Chapter_2_V6_LV.pptx02_Chapter_2_V6_LV.pptx
02_Chapter_2_V6_LV.pptx
 
Hasanain_Application Layer_Chapter_2_Version 7.1.ppt
Hasanain_Application Layer_Chapter_2_Version 7.1.pptHasanain_Application Layer_Chapter_2_Version 7.1.ppt
Hasanain_Application Layer_Chapter_2_Version 7.1.ppt
 
Chapter_2_v8.3.pptx
Chapter_2_v8.3.pptxChapter_2_v8.3.pptx
Chapter_2_v8.3.pptx
 
Chapter_2_v8.1.pptx
Chapter_2_v8.1.pptxChapter_2_v8.1.pptx
Chapter_2_v8.1.pptx
 
Computer network network edge and network
Computer network network edge and networkComputer network network edge and network
Computer network network edge and network
 
Ch2 application layer Network
Ch2 application layer NetworkCh2 application layer Network
Ch2 application layer Network
 
CS3001_Computer_Networks_Chapter_2_v8.1(1).pptx
CS3001_Computer_Networks_Chapter_2_v8.1(1).pptxCS3001_Computer_Networks_Chapter_2_v8.1(1).pptx
CS3001_Computer_Networks_Chapter_2_v8.1(1).pptx
 
Chapter 2 - Computer Networking a top-down Approach 7th
Chapter 2 - Computer Networking a top-down Approach 7thChapter 2 - Computer Networking a top-down Approach 7th
Chapter 2 - Computer Networking a top-down Approach 7th
 
Lecture-2012-2-Application Layer-Introduction.ppt
Lecture-2012-2-Application Layer-Introduction.pptLecture-2012-2-Application Layer-Introduction.ppt
Lecture-2012-2-Application Layer-Introduction.ppt
 
App layer
App layerApp layer
App layer
 
Lecture application layer
Lecture application layerLecture application layer
Lecture application layer
 
Chapter2 application
Chapter2 applicationChapter2 application
Chapter2 application
 
Materi Perkuliahan Jaringan Komputer Teknik Informatika Chapter 2
Materi Perkuliahan Jaringan Komputer Teknik Informatika Chapter 2Materi Perkuliahan Jaringan Komputer Teknik Informatika Chapter 2
Materi Perkuliahan Jaringan Komputer Teknik Informatika Chapter 2
 
Week3 applications
Week3 applicationsWeek3 applications
Week3 applications
 
3rd edition chapter2
3rd edition chapter23rd edition chapter2
3rd edition chapter2
 
009577496.pdf
009577496.pdf009577496.pdf
009577496.pdf
 

Dernier

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 

Dernier (20)

Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 

Chapter2 Application

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17. Transport service requirements of common apps 2: Application Layer Application file transfer e-mail Web documents real-time audio/video stored audio/video interactive games instant messaging Data loss no loss no loss no loss loss-tolerant loss-tolerant loss-tolerant no loss Throughput elastic elastic elastic audio: 5kbps-1Mbps video:10kbps-5Mbps same as above few kbps up elastic Time Sensitive no no no yes, 100’s msec yes, few secs yes, 100’s msec yes and no
  • 18.
  • 19. Internet apps: application, transport protocols 2: Application Layer Application e-mail remote terminal access Web file transfer streaming multimedia Internet telephony Application layer protocol SMTP [RFC 2821] Telnet [RFC 854] HTTP [RFC 2616] FTP [RFC 959] HTTP (eg Youtube), RTP [RFC 1889] SIP, RTP, proprietary (e.g., Skype) Underlying transport protocol TCP TCP TCP TCP TCP or UDP typically UDP
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30. HTTP request message: general format 2: Application Layer
  • 31.
  • 32. Uploading form input 2: Application Layer
  • 33.
  • 34. HTTP response message 2: Application Layer HTTP/1.1 200 OK Connection close Date: Thu, 06 Aug 1998 12:00:15 GMT Server: Apache/1.3.0 (Unix) Last-Modified: Mon, 22 Jun 1998 …... Content-Length: 6821 Content-Type: text/html data data data data data ... status line (protocol status code status phrase) header lines data, e.g., requested HTML file
  • 35.
  • 36.
  • 37.
  • 38. Cookies: keeping “state” (cont.) 2: Application Layer client server cookie file one week later: backend database usual http response msg usual http response msg usual http request msg cookie: 1678 cookie- specific action access ebay 8734 usual http request msg Amazon server creates ID 1678 for user create entry usual http response Set-cookie: 1678 ebay 8734 amazon 1678 usual http request msg cookie: 1678 cookie- spectific action access ebay 8734 amazon 1678
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55. Sample SMTP interaction 2: Application Layer S: 220 hamburger.edu C: HELO crepes.fr S: 250 Hello crepes.fr, pleased to meet you C: MAIL FROM: <alice@crepes.fr> S: 250 alice@crepes.fr... Sender ok C: RCPT TO: <bob@hamburger.edu> S: 250 bob@hamburger.edu ... Recipient ok C: DATA S: 354 Enter mail, end with &quot;.&quot; 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
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65.
  • 66.
  • 67.
  • 68.
  • 69.
  • 70.
  • 71.
  • 72.
  • 73.
  • 74. DNS protocol, messages 2: Application Layer Name, type fields for a query RRs in response to query records for authoritative servers additional “helpful” info that may be used
  • 75.
  • 76.
  • 77.
  • 78.
  • 79.
  • 80.
  • 81. 2: Application Layer Server-client vs. P2P: example Client upload rate = u, F/u = 1 hour, u s = 10u, d min ≥ u s
  • 82.
  • 83.
  • 84.
  • 85. BitTorrent: Tit-for-tat 2: Application Layer (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 With higher upload rate, can find better trading partners & get file faster!
  • 86.
  • 87.
  • 88.
  • 89.
  • 90. Circle DHT (2) 0001 0011 0100 0101 1000 1010 1100 1111 O(N) messages on avg to resolve query, when there are N peers 1110 1110 1110 1110 1110 1110 Define closest as closest successor Who’s resp for key 1110 ? I am
  • 91.
  • 92.
  • 93.
  • 94.
  • 95.
  • 96.
  • 97.
  • 98.
  • 99. Client/server socket interaction: TCP 2: Application Layer Server (running on hostid ) Client wait for incoming connection request connectionSocket = welcomeSocket.accept() create socket, port= x , for incoming request: welcomeSocket = ServerSocket() create socket, connect to hostid , port= x clientSocket = Socket() close connectionSocket read reply from clientSocket close clientSocket send request using clientSocket read request from connectionSocket write reply to connectionSocket TCP connection setup
  • 100.
  • 101.
  • 102. Example: Java client (TCP) 2: Application Layer import java.io.*; import java.net.*; class TCPClient { public static void main(String argv[]) throws Exception { String sentence; String modifiedSentence; BufferedReader inFromUser = new BufferedReader(new InputStreamReader(System.in)); Socket clientSocket = new Socket(&quot;hostname&quot;, 6789); DataOutputStream outToServer = new DataOutputStream(clientSocket.getOutputStream()); Create input stream Create client socket, connect to server Create output stream attached to socket
  • 103. Example: Java client (TCP), cont. 2: Application Layer BufferedReader inFromServer = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); sentence = inFromUser.readLine(); outToServer.writeBytes(sentence + ''); modifiedSentence = inFromServer.readLine(); System.out.println (&quot;FROM SERVER: &quot; + modifiedSentence ); clientSocket.close(); } } Create input stream attached to socket Send line to server Read line from server
  • 104. Example: Java server (TCP) 2: Application Layer import java.io.*; import java.net.*; class TCPServer { 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())); Create welcoming socket at port 6789 Wait, on welcoming socket for contact by client Create input stream, attached to socket
  • 105. Example: Java server (TCP), cont 2: Application Layer DataOutputStream outToClient = new DataOutputStream (connectionSocket.getOutputStream()); clientSentence = inFromClient.readLine(); capitalizedSentence = clientSentence.toUpperCase() + ''; outToClient.writeBytes(capitalizedSentence); } } } Read in line from socket Create output stream, attached to socket Write out line to socket End of while loop, loop back and wait for another client connection
  • 106.
  • 107.
  • 108. Client/server socket interaction: UDP 2: Application Layer Server (running on hostid ) create socket, port= x. serverSocket = DatagramSocket() close clientSocket read datagram from clientSocket create socket, clientSocket = DatagramSocket() Client Create datagram with server IP and port=x; send datagram via clientSocket read datagram from serverSocket write reply to serverSocket specifying client address, port number
  • 109. Example: Java client (UDP) 2: Application Layer Output: sends packet (recall that TCP sent “byte stream”) Input: receives packet (recall thatTCP received “byte stream”) Client process client UDP socket
  • 110. Example: Java client (UDP) 2: Application Layer import java.io.*; import java.net.*; 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(&quot;hostname&quot;); byte[] sendData = new byte[1024]; byte[] receiveData = new byte[1024]; String sentence = inFromUser.readLine(); sendData = sentence.getBytes(); Create input stream Create client socket Translate hostname to IP address using DNS
  • 111. Example: Java client (UDP), cont. 2: Application Layer 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(&quot;FROM SERVER:&quot; + modifiedSentence); clientSocket.close(); } } Create datagram with data-to-send, length, IP addr, port Send datagram to server Read datagram from server
  • 112. Example: Java server (UDP) 2: Application Layer import java.io.*; import java.net.*; 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]; while(true) { DatagramPacket receivePacket = new DatagramPacket(receiveData, receiveData.length); serverSocket.receive(receivePacket); Create datagram socket at port 9876 Create space for received datagram Receive datagram
  • 113. Example: Java server (UDP), cont 2: Application Layer String sentence = new String(receivePacket.getData()); InetAddress IPAddress = receivePacket.getAddress(); int port = receivePacket.getPort(); String capitalizedSentence = sentence.toUpperCase(); sendData = capitalizedSentence.getBytes(); DatagramPacket sendPacket = new DatagramPacket(sendData, sendData.length, IPAddress, port); serverSocket.send(sendPacket); } } } Get IP addr port #, of sender Write out datagram to socket End of while loop, loop back and wait for another datagram Create datagram to send to client
  • 114.
  • 115.