2: Application Layer 1 Chapter 2 Application Layer Computer Networking: A Top Down Approach, 5th edition. Jim Kurose, Keith Ross Addison-Wesley, April.

Slides:



Advertisements
Similar presentations
Introduction 1-1 Chapter 3 Transport Layer Intro and Multiplexing Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley.
Advertisements

Application Layer 2-1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.
ECE 4450:427/527 - Computer Networks Spring 2015 Dr. Nghi Tran Department of Electrical & Computer Engineering Lecture 8: Application Layer Dr. Nghi Tran.
CPSC 441: Intro, UDP1 Transport Layer Instructor: Carey Williamson Office: ICT Class Location:
Application Layer 2-1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Application Layer – Lecture.
Application Layer 2-1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Application Layer – Lecture.
2: Application Layer 1 Socket programming Socket API r introduced in BSD4.1 UNIX, 1981 r explicitly created, used, released by apps r client/server paradigm.
2: Application Layer P2P applications and Sockets.
1 Overview r Socket programming with TCP r Socket programming with UDP r Building a Web server.
Internet and Intranet Protocols and Applications Lecture 4: Application Layer 3: Socket Programming February 8, 2005 Arthur Goldberg Computer Science Department.
Lecture 8 Chapter 3 Transport Layer
CPSC 441: Intro, UDP1 Instructor: Anirban Mahanti Office: ICT Class Location: ICT 121 Lectures: MWF 12:00 – 12:50 Notes.
1 School of Computing Science Simon Fraser University CMPT 771/471: Internet Architecture and Protocols Socket Programming Instructor: Dr. Mohamed Hefeeda.
Some slides are in courtesy of J. Kurose and K. Ross Review of Previous Lecture Electronic Mail: SMTP, POP3, IMAP DNS Socket programming with TCP.
2: Application Layer P2P applications, Sockets, UDP.
CPSC 441: DNS1 Instructor: Anirban Mahanti Office: ICT Class Location: ICT 121 Lectures: MWF 12:00 – 12:50 Notes derived.
Introduction 1-1 Chapter 2 FTP & Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 IC322 Fall.
Chapter 2 Application Layer Computer Networking: A Top Down Approach, 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April A note on the use.
2: Application Layer1 Chapter 2 Application Layer These slides derived from Computer Networking: A Top Down Approach, 6 th edition. Jim Kurose, Keith Ross.
Communications Recap Duncan Smeed. Introduction 1-2 Chapter 1: Introduction Our goal: get “feel” and terminology more depth, detail later in course.
Elementary UDP Sockets© Dr. Ayman Abdel-Hamid, CS4254 Spring CS4254 Computer Network Architecture and Programming Dr. Ayman A. Abdel-Hamid Computer.
CS1652 September 13th, 2012 The slides are adapted from the publisher’s material All material copyright J.F Kurose and K.W. Ross, All Rights.
2: Application Layer1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail  SMTP,
2: Application Layer1 Socket programming Socket API r introduced in BSD4.1 UNIX, 1981 r explicitly created, used, released by apps r client/server paradigm.
Application Layer 2-1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.
2: Application Layer 1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r Internet gaming r 2.3 FTP r 2.4 Electronic.
1 ELEN602 Lecture 2 Review of Last Lecture Layering.
 Socket  The combination of an IP address and a port number. (RFC 793 original TCP specification)  The name of the Berkeley-derived application programming.
Network LayerII-1 RSC Part III: Transport Layer 1. Basic Concepts Redes y Servicios de Comunicaciones Universidad Carlos III de Madrid These slides are,
Transport Layer 3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 All.
Discussion 2 Sockets Programming Applets TCP UDP HTTP Delay Estimation
Application Layer 2-1 ESERCITAZIONE SOCKET PROGRAMMING.
Sockets process sends/receives messages to/from its socket
Transport Layer 3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 Part.
Chapter 3 Transport Layer
2: Application Layer1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.
Application Layer 2-1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.
Transport Layer3-1 Chapter 3: Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable.
Transport Layer 3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A.
Transport Layer3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach Featuring the Internet, 2 nd edition. Jim Kurose, Keith Ross Addison-Wesley,
Application Layer 2-1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.
2: Application Layer1 Chapter 2: Application layer r 2.1 Principles of network applications  app architectures  app requirements r 2.2 Web and HTTP r.
Transport Layer3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 4 th edition. Jim Kurose, Keith Ross Addison-Wesley, July A.
Application Layer 2-1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.
2: Application Layer1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail  SMTP,
CPSC 441 TUTORIAL – FEB 13, 2012 TA: RUITNG ZHOU UDP REVIEW.
1 Computer Networks An Introduction to Computer Networks University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser Yazdani Lecture 3: Sockets.
Chapter 3: Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable data transfer.
Transport Layer3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross Addison-Wesley,
2: Application Layer1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail  SMTP,
Programming with UDP – II Covered Subjects: Creating UDP sockets Client Server Sending data Receiving data Connected mode.
Review: – Why layer architecture? – peer entities – Protocol and service interface – Connection-oriented/connectionless service – Reliable/unreliable service.
CSCI 330 UNIX and Network Programming Unit XIV: User Datagram Protocol.
Application Layer 2-1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Application Layer – Lecture.
Socket programming with UDP UDP: no “connection” between client & server sender explicitly attaches IP destination address and port # to each packet receiver.
Socket programming in C. Socket programming Socket API introduced in BSD4.1 UNIX, 1981 explicitly created, used, released by apps client/server paradigm.
Ch 2. Application Layer Myungchul Kim
Data Communications and Computer Networks Chapter 2 CS 3830 Lecture 11 Omar Meqdadi Department of Computer Science and Software Engineering University.
SOCKET PROGRAMMING Presented By : Divya Sharma.
Socket Programming original by Joonbok Lee KAIST heavily adapted by /Jens.
05 - P2P applications and Sockets
CS 1652 Jack Lange University of Pittsburgh
Chapter 2 Application Layer
Chapter 2: Application layer
Chapter 2 Application Layer
Chapter 2: Application layer
Chapter 2: Application layer
Presentation transcript:

2: Application Layer 1 Chapter 2 Application Layer Computer Networking: A Top Down Approach, 5th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009.

2: Application Layer 2 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 programming with UDP

2: Application Layer 3 recv and send  recv may be used instead of read (and is recommended): n = recv(fd, buffer, count, flags);  The first three arguments are the same as for read. The flags argument provides additional flexibility. Interesting flags are MSG_DONTWAIT and MSG_PEEK. Refer to recv(2) for details.

2: Application Layer 4 recv and send  Similarly send may be used instead of write (and is also recommended): n = send(fd, buffer, count, flags);  Interesting flags are MSG_DONTWAIT, MSG_MORE and MSG_DONTROUTE. Refer to send(2) for details.

2: Application Layer 5 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 programming with UDP

2: Application Layer 6 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 UDP: transmitted data may be received out of order, or lost application viewpoint UDP provides unreliable transfer of groups of bytes (“datagrams”) between client and server

2: Application Layer 7 Client/server socket interaction: UDP Server (running on hostid ) close close() read datagram using recvfrom create socket, clifd = socket() Client Create datagram with server IP and port=x; send datagram via sendto create socket, port= x. srvfd = socket() bind() read datagram using recvfrom write reply using sendto specifying client address, port number

2: Application Layer 8 UDP Programming  The client functions for passing UDP datagrams are: socket(), sendto(), and recvfrom(). It is not necessary for the client to connect() with the server. (Although connect() can be used.)  The server uses socket(), bind(), recvfrom(), and sendto(). The server does not accept() a connection from the client, instead recvfrom() returns the data and client address.

2: Application Layer 9 UDP Programming  The sendto() routine takes a destination address structure as an argument: typedef struct sockaddr SA; struct sockaddr_in srvaddr_in; memset(&srvaddr_in, 0, sizeof(srvaddr_in)); srvaddr.sin_family = AF_INET; srvaddr.sin_port = htons(9000); inet_pton(AF_INET, “ ”, &srvaddr_in.sin_addr.s_addr); sfd = socket(AF_INET, SOCK_DGRAM, 0); sendto(sfd, msg, msglen, 0, (SA *)&srvaddr_in, sizeof(srvaddr_in));

2: Application Layer 10 UDP Programming  recvfrom() returns an address as an argument. The address is used by the server to respond to the proper client: n = recvfrom(sockfd, mesg, mesg_len, 0, (SA *)&cliaddr_in, &len); sendto(sockfd, mesg, n, 0, (SA *)&cliaddr_in, len);  A NULL address may be used in recvfrom() if we do not care about the address.  Refer to udp_server.cpp for a complete example of UDP socket programming (a modified echo server).  In-class Exercise: Write a udp_client.cpp program to communicate with udp_server.cpp. It should prompt the user for input, send the input to the server, and then read and display the response.

2: Application Layer 11 Chapter 2: Summary  application architectures  client-server  P2P  hybrid  application service requirements:  reliability, bandwidth, delay  Internet transport service model  connection-oriented, reliable: TCP  unreliable, datagrams: UDP our study of network apps now complete!  specific protocols:  HTTP  FTP  SMTP, POP, IMAP  DNS  P2P: BitTorrent, Skype  socket programming

2: Application Layer 12 Chapter 2: Summary  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 Most importantly: learned about protocols Important themes:  control vs. data msgs  in-band, out-of-band  centralized vs. decentralized  stateless vs. stateful  reliable vs. unreliable msg transfer  “complexity at network edge”