1 / 12

Understanding the Application Layer and Service Interface in Network Communication

Explore the role of the application layer in network communication and the service interface between the application layer and the transport layer. Learn about different network applications and their service requirements.

msurber
Télécharger la présentation

Understanding the Application Layer and Service Interface in Network Communication

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Review: Why layer architecture? peer entities Protocol and service interface Connection-oriented/connectionless service Reliable/unreliable service What type of service will a typical end user want? Why even considering other types of services layers in the TCP/IP reference model layers in the ISO/OSI reference model

  2. Problems to be addressed in this layer: Directly related to the individual application (no common problems) Design issues directly related to each application (no common issues). Introduce application layer concepts. Examine the service interface between the application layer and the transport layer (socket API) Give an example showing how to develop network applications. Application Layer

  3. E-mail Web Instant messaging Remote login P2P file sharing Multi-user network games Streaming stored video clips Internet telephone Real-time video conference Massive parallel computing Some network apps

  4. run on different end systems (not routers) communicate over a network. view the network as the abstraction provided by the network (the transport layer). Addressing end points End-to end communication application transport network data link physical application transport network data link physical application transport network data link physical Network applications

  5. Service provided by the network: • Objective: to allow processes on different machines to talk to each other. • Is IP address alone sufficient to address an application entity? • Network end points: • IP address + port number • Why not IP address + PID? • A process can be associated with an end point. • E.g: http -- 80, ssh – 22, telnet—23, DNS – 53 • Service provided by the network: end-to-end communications: • Reliable connection-oriented byte stream service (TCP) • Unreliable connectionless service (UDP)

  6. From a network application point of view, what is the logical topology of the network? A process can bind to an end point and talk to anyone else in the network.

  7. TCP API: • How to access the end point from a process: • socket: create a new communication end point #include <sys/socket.h> int socket(int domain, int type, int protocol); domain: AF_UNIX file system AF_INET internet address type: SOCK_STREAM reliable connect-oriented, byte stream SOCK_DGRAM unreliable connectionless SOCK_SEQPACKET record stream protocol: 0, non-zero for a specific protocol • bind: attach an address to a socket int bind(int socket, const struct sockaddr *address, size_t address_len) address: contains the port number, address.sin_port

  8. Service primitives for TCP: • listen: announce willingness to accept connections int listen(int socket, int backlog); backlog: number of outstanding connections in the listen queue • accpet: accept a new connection on a socket int accept (int socket, struct sockaddr *address, size_t *address_len); address: the address of the connecting socket • connect: try to establish a connection int connect(int socket, const struct sockaddr *address, size_t address_len); address: the destination address • write: send data ssize_t write(int fildes, const void *buf, size_t nbyte); • read: receive data ssize_t read(int fildes, void *buf, size_t nbyte); • close: close a connection int close(int fildes);

  9. Server: socket bind listen accept read/write close Client: socket connect read/write close What is the end point (IP + port number) for the server? What is the end point (IP + port number) for the client? When is the TCP connection established?

  10. One more problem: machines may represent numbers in different ways. • See example3.c on linprog and program. • use htons/htonl/ntohl/ntohs routines to solve the problem. • See example1.c and example2.c.

  11. TCP: • Reliable byte stream service. • UDP: • Unreliable datagram service. • Data may get lost – application may need to deal with more details in the communication.

  12. Basic UDP service interface: • Socket, bind, sendto, recvfrom, close UDP server UDP client socket socket bind sendto recvfrom recvfrom sendto close TCP server TCP client socket socket Bind connect Listen Accept read/write close Read/write close

More Related