Fall 2000Datacom 11 Lecture 4 Socket Interface Programming: Service Interface between Applications and TCP.

Slides:



Advertisements
Similar presentations
Socket Programming 101 Vivek Ramachandran.
Advertisements

Introduction to Sockets Jan Why do we need sockets? Provides an abstraction for interprocess communication.
Computer Net Lab/Praktikum Datenverarbeitung 2 1 Overview Sockets Sockets in C Sockets in Delphi.
Programming with UDP – I Covered Subjects: IPv4 Socket Address Structure Byte Ordering Functions Address Access/Conversion Functions Functions: 1.socket()
Spring 2000CS 4611 Introduction Outline Statistical Multiplexing Inter-Process Communication Network Architecture Performance Metrics.
Spring 2003CS 4611 Introduction, Continued COS 461.
Socket Programming Application Programming Interface.
Network Architectures Professor Jinhua Guo CIS 527 Fall 2002.
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.
Sockets Basics Conectionless Protocol. Today IPC Sockets Basic functions Handed code Q & A.
CIS 527 Computer Networks Introduction Professor Jinhua Guo (updated version) Fall 2003.
1 Socket Interfaces Professor Jinhua Guo CIS527 Fall 2003.
Tutorial 8 Socket Programming
Spring 2003CS 4611 Welcome to COS 461 Vivek Pai. Spring 2003CS 4612 Mechanics First time teaching 461 –But have been doing some level of networking for.
Socket Addresses. Domains Internet domains –familiar with these Unix domains –for processes communicating on the same hosts –not sure of widespread use.
CSE/EE 461 Getting Started with Networking. Basic Concepts  A PROCESS is an executing program somewhere.  Eg, “./a.out”  A MESSAGE contains information.
1/20 Introduction Outline Statistical Multiplexing Inter-Process Communication Network Architecture Performance Metrics Implementation Issues.
Sockets COS 518: Advanced Computer Systems Michael Freedman Fall
UNIX Sockets COS 461 Precept 1. Clients and Servers Client program – Running on end host – Requests service – E.g., Web browser Server program – Running.
1 Tutorial on Socket Programming Computer Networks - CSC 458 Department of Computer Science Yukun Zhu (Slides are mainly from Monia Ghobadi, and Amin Tootoonchian,
UNIX Sockets COS 461 Precept 1.
Computer Networks Chapter 1: Foundation
Fall 2009COSC 6501 Welcome to COSC650 Towson University Yanggon Kim.
Fall 2000Datacom 11 Socket Programming Review Examples: Client and Server-Diagnostics UDP versus TCP Echo.
Network Programming Tutorial #9 CPSC 261. A socket is one end of a virtual communication channel Provides network connectivity to any other socket anywhere.
Chapter 17 Networking Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William Stallings.
Lecture 4: Networked Applications & Sockets Reading: Chapter 1 ? CMSC 23300/33300 Computer Networks
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.
---- IT Acumens. COM IT Acumens. COMIT Acumens. COM.
Chapter 2 Applications and Layered Architectures Sockets.
Remote Shell CS230 Project #4 Assigned : Due date :
CS 158A1 1.4 Implementing Network Software Phenomenal success of the Internet: – Computer # connected doubled every year since 1981, now approaching 200.
CPSC 441 TUTORIAL – FEB 13, 2012 TA: RUITNG ZHOU UDP REVIEW.
1 Pre-Introduction What is computer network?. 2 Pre-Introduction Suppose you want to build a computer network The question is: –What available technologies.
UNIX Sockets COS 461 Precept 1. Socket and Process Communication The interface that the OS provides to its networking subsystem application layer transport.
Spring 2002CS 4611 Introduction Outline Statistical Multiplexing Inter-Process Communication Network Architecture Performance Metrics Implementation Issues.
CSS CSS432 Foundation Textbook Ch1 Professor: Munehiro Fukuda.
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.
CS 6401 Introduction to Computer Networks 09/21/2010 Outline - UNIX sockets - A simple client-server program - Project 1 - LAN bridges and learning.
Requirements Connectivity Resource Sharing Support for Common Services Performance.
CSCI 330 UNIX and Network Programming Unit XV: Transmission Control Protocol.
S OCKET P ROGRAMMING IN C Professor: Dr. Shu-Ching Chen TA: HsinYu Ha.
S OCKET P ROGRAMMING IN C Professor: Dr. Shu-Ching Chen TA: Hsin-Yu Ha.
Review: – Why layer architecture? – peer entities – Protocol and service interface – Connection-oriented/connectionless service – Reliable/unreliable service.
1 Introduction Outline Statistical Multiplexing Inter-Process Communication Network Architecture Performance Metrics Implementation Issues.
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.
1 Network Architecture Section Network Architecture Challenge –Fill the gap between hardware capabilities and application expectations, and to.
Performance Metrics & Network Architectures Professor Jinhua Guo CIS 427 Winter 2003.
CSE331: Introduction to Networks and Security Lecture 2 Fall 2002.
1 CS716 Advanced Computer Networks By Dr. Amir Qayyum.
Socket Programming in C CS587x Lecture 3 Department of Computer Science Iowa State University.
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.
Sockets and Beginning Network Programming
Jim Fawcett CSE 681 – Software Modeling & Analysis Fall 2002
UNIX Sockets COS 461 Precept 1.
Socket Programming in C
Tutorial on Socket Programming
UNIX Sockets Outline Homework #1 posted by end of day
Socket Programming in C
TCP Sockets Programming
University of Houston Datacom II Lecture 1B Review Dr Fred L Zellner
Socket Programming Neil Tang 09/08/2008
Internet Networking recitation #8
Presentation transcript:

Fall 2000Datacom 11 Lecture 4 Socket Interface Programming: Service Interface between Applications and TCP

Fall 2000Datacom 12 Inter-Process Communication Turn host-to-host connectivity into process-to-process communication.. Host Application Host Application Host Channel

Fall 2000Datacom 13 Layering Use abstractions to hide complexity Abstraction naturally lead to layering

Fall 2000Datacom 14 Layering Request/reply channel Message stream channel Application programs Hardware Host-to-host connectivity Alternative abstractions at each layer

Fall 2000Datacom 15 Internet Architecture Defined by Internet Engineering Task Force (IETF) Hourglass Design Application vs Application Protocol (FTP, HTTP) … FTPHTTPNV TFTP TCP UDP IP NET 1 2 n

Fall 2000Datacom 16 ISO or OSI Architecture OSI= Open Systems Interconnection Application Presentation Session Transport End host One or more nodes within the network Network Data link Physical Network Data link Physical Network Data link Physical Application Presentation Session Transport End host Network Data link Physical

Fall 2000Datacom 17 3-features of Internet Architecture Strict layering is abandoned IP is the big idea—a single protocol for interconnecting networks and providing host-to- host connectivity To become a standard requires a working implementation

Fall 2000Datacom 18 Protocols Building blocks of a network architecture Provides communications service that higher level objects use to exchange messages Each protocol object has two different interfaces –service interface: operations on this protocol –peer-to-peer interface: messages exchanged with peer

Fall 2000Datacom 19 Host 1 Protocol Host 2 Protocol High-level object High-level object Service interface Peer-to-peer interface Interfaces

Fall 2000Datacom 110 Socket Interface-an Application Programming Interface (API) Create the Socket for a specific transport layer protocol int socket(int domain,int type, int protocol) domain=Protocol Family=PF_INET type=semantics=SOCK_STREAM (or DGRAM) protocol=0 (UNSPEC) PF_INET and SOCK_STREAM means TCP socket returns an socket number: negative value means an error

Fall 2000Datacom 111 Socket Interface: Client (a) Connecting to a Socket int connect (int socket, struct sockaddr*address, int addr_len) –sockaddr is the name of a data structure that gives the IP address for reaching the server’s socket variable_name.element1 is address family=AF_INET variable_name (sin).element2 is server IP address variable_name.element3 is address family=Port number (use htons function to translate) –address is a pointer to location of address information (&sin) –addr_len is the length of the address field to which address points

Fall 2000Datacom 112 Socket Interface: Client (b) Sending data to a Socket int send(int socket, char*message, int msg_len, int flags) –message is a pointer to the location of the message to be sent –msg_len is the length of that memory location

Fall 2000Datacom 113 Socket Interface: Server (a) Binding a Socket to an IP address int bind (int socket, struct sockaddr*address, int addr_len) –sockaddr is the name of a data structure that gives the IP address for receiving information socket Variable_name.element1 is address family=AF_INET Variable_name.element2 is client IP address=UNSPEC until connected Variable_name.element3 is address family=Port number (use htons function to translate)

Fall 2000Datacom 114 Socket Interface: Server (b) Defining the queue length for the receiving socket int send(int socket, int backlog) –backlog is number of calls waiting Passive listening int accept (int socket, struct sockaddr*address, int addr_len) –Sender’s IP address is returned –New Socket is created and its number is returned

Fall 2000Datacom 115 Socket Interface: Server (c) Receiving a message int recv(int socket, char*buffer, int buf_len, int flags) –new socket created by accept function –buffer is a pointer to the location where message will be stored –buf_len is the length of that memory location Closing a socket close(socket) Use this command to close the new_socket created when the connection is accepted. The old one is still listening—keeping track of the incoming queue