Review: – Why layer architecture? – peer entities – Protocol and service interface – Connection-oriented/connectionless service – Reliable/unreliable service.

Slides:



Advertisements
Similar presentations
Sockets: Network IPC Internet Socket UNIX Domain Socket.
Advertisements

Review: –What functionality is supported by IP? –What IP does not do? –How many classes of IP addresses? –Explain fields in an IP header? –How subnet works?
Today’s topic: Basic TCP API –Socket –Bind –Listen –Connect –Accept –Read –Write –Close.
Networks: TCP/IP Socket Calls1 Elementary TCP Sockets Chapter 4 UNIX Network Programming Vol. 1, Second Ed. Stevens.
Elementary TCP Sockets Chapter 4 UNIX Network Programming Vol. 1, Second Ed. Stevens.
Socket Programming.
1 Socket Interfaces Professor Jinhua Guo CIS527 Fall 2003.
Tutorial 8 Socket Programming
CSE/EE 461 Getting Started with Networking. Basic Concepts  A PROCESS is an executing program somewhere.  Eg, “./a.out”  A MESSAGE contains information.
2: Application Layer 1 Chapter 2 Application Layer Computer Networking: A Top Down Approach, 5th edition. Jim Kurose, Keith Ross Addison-Wesley, April.
1 Computer Networks Transport Layer Protocols. 2 Application-layer Protocols Application-layer protocols –one “piece” of an app –define messages exchanged.
I NTRODUCTION OF S OCKET P ROGRAMMING L.Aseel AlTurki King Saud University.
1 Tutorial on Socket Programming Computer Networks - CSC 458 Department of Computer Science Yukun Zhu (Slides are mainly from Monia Ghobadi, and Amin Tootoonchian,
Introduction to Linux Network 劉德懿
UNIX Sockets COS 461 Precept 1.
Sockets CIS 370 Fall 2009, UMassD. Introduction  Sockets provide a simple programming interface which is consistent for processes on the same machine.
Basic Socket Programming TCP/IP overview. TCP interface Reference: –UNIX Network Programming, by Richard Stevens. –UNIX man page.
ECE 4110 – Internetwork Programming Client-Server Model.
Sockets and intro to IO multiplexing. Goals We are going to study sockets programming as means to introduce IO multiplexing problem. We will revisit socket.
1 Networking (Stack and Sockets API). 2 Topic Overview Introduction –Protocol Models –Linux Kernel Support TCP/IP Sockets –Usage –Attributes –Example.
Operating Systems Chapter 9 Distributed Communication.
Assignment 3 A Client/Server Application: Chatroom.
Socket Programming. Introduction Sockets are a protocol independent method of creating a connection between processes. Sockets can be either – Connection.
CS345 Operating Systems Φροντιστήριο Άσκησης 2. Inter-process communication Exchange data among processes Methods –Signal –Pipe –Sockets.
Sockets CIS 370 Lab 10 UMass Dartmouth. Introduction 4 Sockets provide a simple programming interface which is consistent for processes on the same machine.
1 ELEN602 Lecture 2 Review of Last Lecture Layering.
Server Sockets: A server socket listens on a given port Many different clients may be connecting to that port Ideally, you would like a separate file descriptor.
2: Application Layer 1 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,
ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 26.
1 End-user Protocols, Services and QoS. 2 Layering: logical communication application transport network link physical application transport network link.
---- IT Acumens. COM IT Acumens. COMIT Acumens. COM.
Chapter 2 Applications and Layered Architectures Sockets.
Remote Shell CS230 Project #4 Assigned : Due date :
Page 1 Jan 5, 1998 CMPN 369 CPSC441 Sockets Module Sockets Application Programming Interface (API)
Overview of TCP/IP protocols –Application layer (telnet, ssh, http, ftp, etc) The things that we use daily. –Transport layer (TCP, UDP) Allows processes.
CS 158A1 1.4 Implementing Network Software Phenomenal success of the Internet: – Computer # connected doubled every year since 1981, now approaching 200.
1 Computer Networks An Introduction to Computer Networks University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser Yazdani Lecture 3: Sockets.
UNIT8: SOCKETS Topics Introduction to sockets Socket Addresses
CSCE 515: Computer Network Programming UDP Socket Wenyuan Xu Department of Computer Science and Engineering.
UNIX Sockets COS 461 Precept 1. Socket and Process Communication The interface that the OS provides to its networking subsystem application layer transport.
Introduction to Socket
CSE/EE 461 Getting Started with Networking. 2 Basic Concepts A PROCESS is an executing program somewhere. –Eg, “./a.out” A MESSAGE contains information.
Chapter 27 Socket API Interface The interface between an application program and the communication protocols in an operating system is known as the Application.
Socket Programming Introduction. Socket Definition A network socket is one endpoint in a two-way communication flow between two programs running over.
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,
Advanced UNIX programming Fall 2002, lecture 16 Instructor: Ashok Srinivasan Acknowledgements: The syllabus and power point presentations are modified.
CSCI 330 UNIX and Network Programming Unit XV: Transmission Control Protocol.
Today’s topic: UDP Reliable communication over UDP.
S OCKET P ROGRAMMING IN C Professor: Dr. Shu-Ching Chen TA: HsinYu Ha.
Review: –Concurrent server and multiplexed server How they work? Which one is better?
Introduction to Sockets
S OCKET P ROGRAMMING IN C Professor: Dr. Shu-Ching Chen TA: Hsin-Yu Ha.
Read() recv() connection establishment Server (connection-oriented protocol) blocks until connection from client Client socket() bind() listen() accept()
CSCI 330 UNIX and Network Programming Unit XIV: User Datagram Protocol.
Socket Programming. Computer Science, FSU2 Interprocess Communication Within a single system – Pipes, FIFOs – Message Queues – Semaphores, Shared Memory.
UNIX Sockets Outline UNIX sockets CS 640.
1 Spring Semester 2008, Dept. of Computer Science, Technion Internet Networking recitation #7 Socket Programming.
Lecture 3 TCP and UDP Sockets CPE 401 / 601 Computer Network Systems slides are modified from Dave Hollinger.
1 Network Communications A Brief Introduction. 2 Network Communications.
1 Socket Interface. 2 Client-Server Architecture The client is the one who speaks first Typical client-server situations  Client and server on the same.
Sockets Intro to Network Programming. Before the internet... Early computers were entirely isolated No Internet No network No model No external communications.
1 Socket Interface. 2 Basic Sockets API Review Socket Library TCPUDP IP EthernetPPP ARP DHCP, Mail, WWW, TELNET, FTP... Network cardCom Layer 4 / Transport.
Sockets API Developing Applications using the Sockets API.
SOCKET PROGRAMMING Presented By : Divya Sharma.
Socket Programming Client/Server.
Socket Programming in C
Tutorial on Socket Programming
Transport layer API: Socket Programming
Socket Programming in C
Outline Communications in Distributed Systems Socket Programming
Presentation transcript:

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

Application Layer 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.

Some network apps 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

Network applications –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

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)

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

TCP API: –How to access the end point from a process: –socket: create a new communication end point #include 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

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

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?

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.

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

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