Network Programming and Protocl Design. Nixu Ltd.

Size: px
Start display at page:

Download "Network Programming and Protocl Design. Nixu Ltd."

Transcription

1 Network Programming and Protocl Design Nixu Ltd.

2 What is a socket? Sockets (also known as Berkeley Sockets) is an application programming interface (API) to the operating system s TCP/IP stack Used on all Unixes Windows Sockets are similar Some Unixes have XTI (X/Open Transport Interface) and TLI (Transport Layer Interface) (not covered here) Can be used for other protocol stacks than TCP/IP (not covered here) Nixu Ltd. 2/50 Network Programming and Protocl Design

3 Socket functions Socket functions: Allocating resources: socket, bind Opening connections: accept, connect Closing connections: close, shutdown Sending and receiving: read, write, recv, send, recvfrom, sendto, recvmsg, sendmsg Other: getsockopt, setsockopt, getsockname, getpeername Utilities Network information (host names, addresses) Byte order Nixu Ltd. 3/50 Network Programming and Protocl Design

4 Byte order Addresses and port number must be in network byte order Also known as big-endian, most-significant byte first Conversion routines for 16 and 32-bit integers: htons, htonl ("host to network short/long") ntohs, ntohl ("network to host short/long") Null macros ("#define htons(x)(x)") on big-endian systems Nixu Ltd. 4/50 Network Programming and Protocl Design

5 Address structures struct in_addr { in_addr_t s_addr; /* IPv4 address, network byte order */ }; struct sockaddr_in { sa_family_t sin_family; /* AF_INET */ in_port_t sin_port; /* 16-bit port, network byte order */ struct in_addr sin_addr; /* IPv4 address */ char sin_zero[8]; /* always zero */ };x Nixu Ltd. 5/50 Network Programming and Protocl Design

6 Address functions From string to address: unsigned long inet_addr(const char *cp) returns -1 on error From address to string: char* inet_ntoa(struct in_addr) return pointer to statically allocated buffer surprisingly, is thread-safe (uses thread-specific data) ON SOME UNIXES inet_aton (NOT ON ALL UNIXES) from ascii " " to struct in_addr int inet_aton(const char *cp, struct in_addr *inp); Nixu Ltd. 6/50 Network Programming and Protocl Design

7 Creating a socket int socket(int domain, int type, int protocol) Domain is AF_INET for TCP/IP protocols AF_UNIX (AF_LOCAL) for Unix named pipes, others Type is SOCK_STREAM (TCP) SOCK_DGRAM (UDP) SOCK_RAW (raw IPv4), others Protocol is usually zero Returns new socket descriptor, or -1 on error Nixu Ltd. 7/50 Network Programming and Protocl Design

8 Typical TCP client socket connect read/write close Nixu Ltd. 8/50 Network Programming and Protocl Design

9 Connecting int connect(int sockfd, struct sockaddr *serv_addr, int addrlen); Establishes a connection to server Return values are 0 on success, -1 on error (errno set accordingly) Typical errno values: ECONNREFUSED: host is up, but no server listening ETIMEDOUT: host or network is down? Nixu Ltd. 9/50 Network Programming and Protocl Design

10 Example: Simple HTTP client (1/4) /* * Simple HTTP client program, version 1. * Written by Pasi.Eronen@nixu.fi. */ #include <arpa/inet.h> #include <netinet/in.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/socket.h> #include <sys/types.h> #include <unistd.h> Nixu Ltd. 10/50 Network Programming and Protocl Design

11 Example: Simple HTTP client (2/4) void die(const char* message) { fprintf(stderr, "%s\n", message); exit(1); } int main(int argc, char *argv[]) { int sockfd, n; struct sockaddr_in addr; unsigned char buffer[4096]; if (argc!= 4) die("usage: geturl ip-address port local-url"); Nixu Ltd. 11/50 Network Programming and Protocl Design

12 Example: Simple HTTP client (3/4) /* Open socket */ if ((sockfd = socket(af_inet, SOCK_STREAM, 0)) == -1) die("socket error"); /* Parse address */ memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET; addr.sin_port = htons(atoi(argv[2])); addr.sin_addr.s_addr = inet_addr(argv[1]); if (addr.sin_addr.s_addr == -1) die("bad address"); /* Connect to remote host */ if (connect(sockfd, (struct sockaddr*) &addr, sizeof(addr)) == -1) die("connect error"); Nixu Ltd. 12/50 Network Programming and Protocl Design

13 Example: Simple HTTP client (4/4) /* Send HTTP request */ write(sockfd, "GET ", 4); write(sockfd, argv[3], strlen(argv[3])); write(sockfd, " HTTP/1.0\r\n\r\n", 13); /* Read response */ while ((n = read(sockfd, buffer, sizeof(buffer))) > 0) write(stdout_fileno, buffer, n); } /* Close and exit */ close(sockfd); return 0; Nixu Ltd. 13/50 Network Programming and Protocl Design

14 Simple HTTP client in action $./httpclient / HTTP/ OK Date: Sat, 24 Apr :08:25 GMT Server: Apache/1.3.4 Last-Modified: Fri, 26 Feb :28:20 GMT Connection: close Content-Type: text/html <html><head><title>example Inc.</title></head> <body> <h1>welcome to Example Inc s web server!</h1>... $ Nixu Ltd. 14/50 Network Programming and Protocl Design

15 What is a Server Background process No user interface Handles service requests from network Can also send requests, for example DNS and NTP Typically must handle many requests concurrently??some kind of multitasking needed Nixu Ltd. 15/50 Network Programming and Protocl Design

16 What is special in a server Concurrency & network I/O Protocol encoding/decoding Application-specific logic System interaction: Unix daemons, Windows NT services Logging Security Nixu Ltd. 16/50 Network Programming and Protocl Design

17 Network I/O on Unix Sockets are file descriptors Important I/O operations for TCP sockets: accept connect read, write close, shutdown Important I/O operations for UDP sockets: sendto recvfrom Nixu Ltd. 17/50 Network Programming and Protocl Design

18 Binding to specific port int bind(int sockfd, struct sockaddr *my_addr, int addrlen) bind assigns a specific local address and port to the socket normally used for servers (where the port must be known) IP address (or IPADDR_ANY) In clients, you don t usually need bind a random "ephemeral" port is chosen automatically the correct interface and IP address are chosen automatically Nixu Ltd. 18/50 Network Programming and Protocl Design

19 bind() example Bind socket to local port 80 (for HTTP server) struct sockaddr_in my_addr; memset(&my_addr, 0, sizeof(my_addr)); my_addr.sin_family = AF_INET; my_addr.sin_port = htons(80); my_addr.sin_addr.s_addr = INADDR_ANY; if (bind(sockfd, (struct sockaddr*) &my_addr, sizeof(my_addr)) == -1) die("bind failed"); Nixu Ltd. 19/50 Network Programming and Protocl Design

20 bind() notes Bind can also bind to specific IP address! Most hosts have at least two interfaces, loopback and Ethernet One physical interface can have multiple addresses ("IP Aliasing") Web servers need to bind to specific IP with IP Aliasing INADDR_ANY binds to all addresses Binding to ports requires root priviledges on Unix Traditionally used for security: do not trust this! Nixu Ltd. 20/50 Network Programming and Protocl Design

21 Getting remote host name gethostbyaddr() converts IP address to domain name Not all addresses have domain names Not secure: the owner of IP address can return any name he wants! Partial solution: Double DNS lookup gethostbyaddr(ip_address)? NAME gethostbyname(name)? NAME_ADDRESSES (0...N) check that IP_ADDRESS? NAME_ADDRESSES Nixu Ltd. 21/50 Network Programming and Protocl Design

22 TCP connections When the server calls accept() it gets: file descriptor for reading/writing data remote IP + port (from getpeername) local IP + port (from getsockname) Nixu Ltd. 22/50 Network Programming and Protocl Design

23 UDP "connections" UDP is not really connected When the server calls recvfrom() it gets packet data remote IP + port Nixu Ltd. 23/50 Network Programming and Protocl Design

24 Iterative UDP server initialize wait for packet process request send reply Nixu Ltd. 24/50 Network Programming and Protocl Design

25 Iterative UDP server Single thread of execution If processing doesn t take long, works well! Othervise the service is blocked Simple, easy to coordinate access to resources Must be careful not to use blocking operations: CPU-intensive tasks SQL database queries gethostbyname, gethostbyaddr Nixu Ltd. 25/50 Network Programming and Protocl Design

26 Example: radiusd Potentially lots of requests Uses UDP Very little processing per request Solution: single-threaded UDP server. Nixu Ltd. 26/50 Network Programming and Protocl Design

27 Process-per-connection TCP server initialize wait for connection fork receive data process request send reply close connection & exit Nixu Ltd. 27/50 Network Programming and Protocl Design

28 Process-per-connection TCP server New process started for each connection Good sides: Easy to use, works! Reliable: If one process dies, others continue Problems: Starting new processes is slow Co-operation between processes is limited or difficult Access to shared resources (log files, etc.) needs to be coordinated Nixu Ltd. 28/50 Network Programming and Protocl Design

29 Example: telnetd Each connection takes quite long, so process starting overhead is not a problem Asynchronous I/O would be very difficult Solution: process-per-connection TCP server Nixu Ltd. 29/50 Network Programming and Protocl Design

30 Process pre-allocation Since starting processes is slow, start all processes at the beginning Memory used by unused processes is wasted. Only a limited number of connections concurrently. Used very successfully! Nixu Ltd. 30/50 Network Programming and Protocl Design

31 Threads Creating threads is much faster than processes All modern Unixes and Windows NT have threads Shared memory makes co-operation easy Access to shared memory needs to be coordinated Nixu Ltd. 31/50 Network Programming and Protocl Design

32 Asynchronous TCP server initialize wait for events receive data and process send more reply data accept new connection Nixu Ltd. 32/50 Network Programming and Protocl Design

33 Asynchronous TCP server Single thread of execution Event multiplexing using poll() or select() Easy to coordinate access to resources Must avoid blocking operations Nixu Ltd. 33/50 Network Programming and Protocl Design

34 Example: Bind DNS server Lots of requests Needs to be very fast Most requests are UDP, but some TCP Very little CPU processing In-memory database and cache (hard to share between processes) Needs to be portable to legacy systems? no threads Solution: asynchronous I/O for both UDP and TCP Nixu Ltd. 34/50 Network Programming and Protocl Design

35 Concurrency in clients Typically clients have user interface, etc. Using separate processes is difficult, since there are communication needs between network process and user interface. Solution: threads. Nixu Ltd. 35/50 Network Programming and Protocl Design

36 Distributed Computing Generally a view of shared computing and data resources, transparent communications between programs and access to objects located in other hosts Sun RPC is the first popular protocol CORBA is currently somewhat popular Both are based on an abstraction layer that hides the network Web Services and.net take a slightly different approach XML is used to represent all kinds of objects Advantages are access to shared resources, transparent communications and flexibility Disadvantages are added complexity and security risks These technologies are also called middleware Nixu Ltd. 36/50 Network Programming and Protocl Design

37 RPC, Remote Procedure Calling From Sun Microsystem s Open Networking Group A communications layer between transport and application levels Used by NFS and NIS An API for software to communicate over the network Uses the client-server communications model The client and the server communicate using "stub code" interfaces that hide the actual communications layer The stub code is created by a RPC protocol compiler Nixu Ltd. 37/50 Network Programming and Protocl Design

38 Object Request Broker (ORB) Architectures Object Management Architecture (OMA) of the Object Management Group: Common Objet Request Broker Architecture (CORBA) Common Object Services Specification (COSS) CORBA definitions are used to describe the communications mechanisms of distributed objects Interface Description Language (IDL) COSS objects offer the basic services between applications objects The idea of an open software bus, on which object components from different vendors can interoperate on different networks and operating systems Nixu Ltd. 38/50 Network Programming and Protocl Design

39 CORBA Instead of calling remote functions (RPC) you call methods in remote objects Objects can have their own data store Allows more dynamic operations The Object Request Broker (ORB) locates the objects to be called The Internet Inter-ORB Protocol (IIOP) connects the ORBs Nixu Ltd. 39/50 Network Programming and Protocl Design

40 Protocol design Implementing a protocol in software is only reasonably difficult Designing a good protocol is very difficult But sometimes it must be done The design starts from the requirements Define the probelm to be solved Define why no existing protocol is good enough It is a good idea to supplement the requirements with practical usage cases Protocol design tools exist and should be used Help to avoid some pitfalls, like deadlocks Nixu Ltd. 40/50 Network Programming and Protocl Design

41 Some notes on protocol design Watch out for overhead Bandwidth CPU other Pretty good is hard to tell from optimal, but much more easier to implement Which is better, a big solution for all problems or a small solution for one problem? Things that are left for implementators to decide, are going to be implemented in as non-compatible way as possible IPSec Nixu Ltd. 41/50 Network Programming and Protocl Design

42 Protocol life cycle How to prepare for future versions of the protocol Version numbers Reserved bit fields Forwards and backwards compatibility Parameters Leaving parameter values open creates more work for implementators and can cause problems, but also allows for tuning the performance Leaving values for implementators to set is the lazy way out and can cause probelms, but can also be used to solve unforeseen problems Nixu Ltd. 42/50 Network Programming and Protocl Design

43 Desirable protocol features Autoconfiguration Robustness Simple Self-stabilization Byzantine robustness Documentation and standardization Remember, two freely available independent implementations for an Internet standard Nixu Ltd. 43/50 Network Programming and Protocl Design

44 Protocol Design Folklore From "Interconnections, 2:nd ed." by Radia Perlman Flexibility, backward compliance and optimality create complexity, which makes the protocol implementation harder, which make the protocol less popular Each participant in a committee usually wants to add his own feature If the protocol becomes popular, it will be used for something that it is not intended for An underspecified protocol is not a protocol but a framework "Content-type:" field in HTTP would be useless, unless MIME was specified The goal should be simplicity, not complexity Nixu Ltd. 44/50 Network Programming and Protocl Design

45 Protocol Design Folklore Solving the general problem and leaving exceptions to be handled by some external mechanism makes sometimes sense Assuming that you know what the general problem is and what are the exceptions IPv6 is a sample of this You can also optimize the most common cases Think about the boundary limits Ethernet is physically limited, but does not need a router -> cheap Think about the address space Limited like IPv4 or TCP port numbers Unlimited like DNS or SNMP OIDs Nixu Ltd. 45/50 Network Programming and Protocl Design

46 Protocol Design Folklore Design how to fail How to run out of buffer space, capacity, etc. Plan an upgrade path for future versions How do different versions talk to each other "I talk" and "I accept" version fields Make protocol select the highest common denominator isntead of the lowes Respect the independence of layers Specify the handling of unknown options "Skip and ignore" "Skip and log" "Stop parsing and generate error" Nixu Ltd. 46/50 Network Programming and Protocl Design

47 Implementation Be conservative in what you send, and liberal in what you accept Always set reserved bits to zero For robustness, every line of code should be exercised frequently Problems caused by changes in other parts of code or the environment become apparent faster, not just in exception cases Document Document your thinking Nixu Ltd. 47/50 Network Programming and Protocl Design

48 Practical Problems for Protocols Split networks Garbage data, 8-bit characters (not really anymore, but 16- bit...) Multiple copies of a network entity Overload, lack of resources Intentional attacks Upper/lower layer crashes/problems Nixu Ltd. 48/50 Network Programming and Protocl Design

49 The Trends of Data Communications IP over everything, everything over IP Data, voice, pictures, reliability, security Mobility Route and capacity variations Weak terminals Ubiquitous computing We are the Borg... Always on, always connected, wearable computing Comprehensive security Nanocomputing, biocomputing... Nixu Ltd. 49/50 Network Programming and Protocl Design

50 So long Source and No Money will get you through the hard times better than Money and No Source. Bob Kodner Facts without theory are useless - Theory without facts is bullshit Unknown Nixu Ltd. 50/50 Network Programming and Protocl Design

Tietoliikennesovellukset

Tietoliikennesovellukset Tietoliikennesovellukset Tietoliikennesovellukset Tietoliikenteeseen on yleensä jokin syy Käyttäjälle tarjottava palvelu Ihmisten ja organisaation tarpeita toteuttavasta prosessista aiheutuva tiedonsiirtotarve

More information

Socket Programming. CSIS0234A Computer and Communication Networks. Socket Programming in C

Socket Programming. CSIS0234A Computer and Communication Networks. Socket Programming in C 1 CSIS0234A Computer and Communication Networks Socket Programming in C References Beej's Guide to Network Programming Official homepage: http://beej.us/guide/bgnet/ Local mirror http://www.cs.hku.hk/~c0234a/bgnet/

More information

Unix Network Programming

Unix Network Programming Introduction to Computer Networks Polly Huang EE NTU Unix Network Programming The socket struct and data handling System calls Based on Beej's Guide to Network Programming 1 The Unix Socket A file descriptor

More information

Network programming(i) Lenuta Alboaie

Network programming(i) Lenuta Alboaie Network programming(i) Lenuta Alboaie adria@info.uaic.ro 2017 2018 Computer Network http://www.info.uaic.ro/~computernetworks 1 Content Client/server paradigm API for network programming BSD Socket Characteristics

More information

CS321: Computer Networks Introduction to Application Layer

CS321: Computer Networks Introduction to Application Layer CS321: Computer Networks Introduction to Application Layer Dr. Manas Khatua Assistant Professor Dept. of CSE IIT Jodhpur E-mail: manaskhatua@iitj.ac.in Basic Application layer provides services to the

More information

Tutorial on Socket Programming

Tutorial on Socket Programming Tutorial on Socket Programming Computer Networks - CSC 458 Department of Computer Science Hao Wang (Slides are mainly from Seyed Hossein Mortazavi, Monia Ghobadi, and Amin Tootoonchian, ) 1 Outline Client-server

More information

Outline. Distributed Computing Systems. Socket Basics (1 of 2) Socket Basics (2 of 2) 3/28/2014

Outline. Distributed Computing Systems. Socket Basics (1 of 2) Socket Basics (2 of 2) 3/28/2014 Outline Distributed Computing Systems Sockets Socket basics Socket details (TCP and UDP) Socket options Final notes Socket Basics (1 of 2) An end-point for an Internet network connection what application

More information

Programming with TCP/IP. Ram Dantu

Programming with TCP/IP. Ram Dantu 1 Programming with TCP/IP Ram Dantu 2 Client Server Computing Although the Internet provides a basic communication service, the protocol software cannot initiate contact with, or accept contact from, a

More information

Oral. Total. Dated Sign (2) (5) (3) (2)

Oral. Total. Dated Sign (2) (5) (3) (2) R N Oral Total Dated Sign (2) (5) (3) (2) Assignment Group- A_07 Problem Definition Write a program using TCP socket for wired network for following Say Hello to Each other ( For all students) File transfer

More information

CS321: Computer Networks Socket Programming

CS321: Computer Networks Socket Programming CS321: Computer Networks Socket Programming Dr. Manas Khatua Assistant Professor Dept. of CSE IIT Jodhpur E-mail: manaskhatua@iitj.ac.in Socket Programming It shows how the network application programs

More information

Hyo-bong Son Computer Systems Laboratory Sungkyunkwan University

Hyo-bong Son Computer Systems Laboratory Sungkyunkwan University Sockets Hyo-bong Son (proshb@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Client-Server Model Most network application is based on the client-server model: A server

More information

Socket Programming TCP UDP

Socket Programming TCP UDP Socket Programming TCP UDP Introduction Computer Network hosts, routers, communication channels Hosts run applications Routers forward information Packets: sequence of bytes contain control information

More information

CSC209H Lecture 9. Dan Zingaro. March 11, 2015

CSC209H Lecture 9. Dan Zingaro. March 11, 2015 CSC209H Lecture 9 Dan Zingaro March 11, 2015 Socket Programming (Kerrisk Ch 56, 57, 59) Pipes and signals are only useful for processes communicating on the same machine Sockets are a general interprocess

More information

Outline. Distributed Computer Systems. Socket Basics An end-point for a IP network connection. Ports. Sockets and the OS. Transport Layer.

Outline. Distributed Computer Systems. Socket Basics An end-point for a IP network connection. Ports. Sockets and the OS. Transport Layer. Outline Distributed Computer Systems Socket basics Socket details (TCP and UDP) Socket options Final notes Sockets Socket Basics An end-point for a IP network connection what the application layer plugs

More information

Socket Programming for TCP and UDP

Socket Programming for TCP and UDP CSCI4430 Data Communication and Computer Networks Socket Programming for TCP and UDP ZHANG, Mi Jan. 19, 2017 Outline Socket Programming for TCP Introduction What is TCP What is socket TCP socket programming

More information

Session NM056. Programming TCP/IP with Sockets. Geoff Bryant Process software

Session NM056. Programming TCP/IP with Sockets. Geoff Bryant Process software Session NM056 Programming TCP/IP with Sockets Geoff Bryant Process software Course Roadmap Slide 57 NM055 (11:00-12:00) Important Terms and Concepts TCP/IP and Client/Server Model Sockets and TLI Client/Server

More information

Outline. Operating Systems. Socket Basics An end-point for a IP network connection. Ports. Network Communication. Sockets and the OS

Outline. Operating Systems. Socket Basics An end-point for a IP network connection. Ports. Network Communication. Sockets and the OS Outline Operating Systems Socket basics Socket details Socket options Final notes Project 3 Sockets Socket Basics An end-point for a IP network connection what the application layer plugs into programmer

More information

Lecture 7. Followup. Review. Communication Interface. Socket Communication. Client-Server Model. Socket Programming January 28, 2005

Lecture 7. Followup. Review. Communication Interface. Socket Communication. Client-Server Model. Socket Programming January 28, 2005 Followup symbolic link (soft link): pathname, can be across file systems, replacement of file will be active on all symbolic links, consumes at least an inode. hard link: pointers to an inode, only in

More information

A Client-Server Exchange

A Client-Server Exchange Socket programming A Client-Server Exchange A server process and one or more client processes Server manages some resource. Server provides service by manipulating resource for clients. 1. Client sends

More information

Hybrid of client-server and P2P. Pure P2P Architecture. App-layer Protocols. Communicating Processes. Transport Service Requirements

Hybrid of client-server and P2P. Pure P2P Architecture. App-layer Protocols. Communicating Processes. Transport Service Requirements Announcements CS 5565 Network Architecture and Protocols Lecture 5 Godmar Back Problem Set 1 due Feb 17 Project 1 handed out shortly 2 Layer The Layer Let s look at some s (in keeping with top-down) architectures:

More information

Network Programming in C: The Berkeley Sockets API. Networked Systems 3 Laboratory Sessions

Network Programming in C: The Berkeley Sockets API. Networked Systems 3 Laboratory Sessions Network Programming in C: The Berkeley Sockets API Networked Systems 3 Laboratory Sessions The Berkeley Sockets API Widely used low-level C networking API First introduced in 4.3BSD Unix Now available

More information

Sockets. Dong-kun Shin Embedded Software Laboratory Sungkyunkwan University Embedded Software Lab.

Sockets. Dong-kun Shin Embedded Software Laboratory Sungkyunkwan University  Embedded Software Lab. 1 Sockets Dong-kun Shin Embedded Software Laboratory Sungkyunkwan University http://nyx.skku.ac.kr Internet Connections (1) 2 Connection Clients and servers communicate by sending streams of bytes over

More information

UNIX Network Programming. Overview of Socket API Network Programming Basics

UNIX Network Programming. Overview of Socket API Network Programming Basics UNIX Network Programming Overview of Socket API Network Programming Basics 1 Client-Server Model Client Machine A Network Server Machine B Web browser and server FTP client and server Telnet client and

More information

The Berkeley Sockets API. Networked Systems Architecture 3 Lecture 4

The Berkeley Sockets API. Networked Systems Architecture 3 Lecture 4 The Berkeley Sockets API Networked Systems Architecture 3 Lecture 4 The Berkeley Sockets API Widely used low-level C networking API First introduced in 4.3BSD Unix Now available on most platforms: Linux,

More information

Network Programming in C. Networked Systems 3 Laboratory Sessions and Problem Sets

Network Programming in C. Networked Systems 3 Laboratory Sessions and Problem Sets Network Programming in C Networked Systems 3 Laboratory Sessions and Problem Sets Lab Timetable, Aims, and Objectives Teaching Week Activity 14 Introduction 15 Warm-up exercise 16 17 Web client 18 19 20

More information

Sockets. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Sockets. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University Sockets Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Internet Connections (1) Connection Clients and servers communicate by sending streams of

More information

CS118 Discussion 1B, Week 1. Taqi Raza BUNCHE 1209B, Fridays 12:00pm to 1:50pm

CS118 Discussion 1B, Week 1. Taqi Raza BUNCHE 1209B, Fridays 12:00pm to 1:50pm CS118 Discussion 1B, Week 1 Taqi Raza BUNCHE 1209B, Fridays 12:00pm to 1:50pm 1 TA Taqi, PhD student in Computer Networking Discussion (1B): Bunche 1209, Fri 12:00 1:50 p.m. Office hours: Boelter Hall

More information

CS 640: Computer Networking

CS 640: Computer Networking CS 640: Computer Networking Yu-Chi Lai Lecture 3 Network Programming Topics Client-server model Sockets interface Socket primitives Example code for echoclient and echoserver Debugging With GDB Programming

More information

The BSD UNIX Socket Interface (CS 640 Lecture) Assignment 1. Interprocess Communication (IPC) Work Individually (no groups)

The BSD UNIX Socket Interface (CS 640 Lecture) Assignment 1. Interprocess Communication (IPC) Work Individually (no groups) The BSD UNIX Socket Interface (CS 640 Lecture) Assignment 1 Work Individually (no groups) Due Date: in class, Monday, September 19 Robert T Olsen olsen@cswiscedu 7390CS Office Hours: 3-5T, 11-12F - exception

More information

CSE 333 Lecture 16 - network programming intro

CSE 333 Lecture 16 - network programming intro CSE 333 Lecture 16 - network programming intro Hal Perkins Department of Computer Science & Engineering University of Washington Today Network programming - dive into the Berkeley / POSIX sockets API -

More information

NETWORK AND SYSTEM PROGRAMMING

NETWORK AND SYSTEM PROGRAMMING NETWORK AND SYSTEM PROGRAMMING LAB 09 Network Byte Ordering, inet_aton, inet_addr, inet_ntoa Functions Objectives: To learn byte order conversion To understand inet-aton, inet_addr, inet_ntoa Functions

More information

CSE 124 Discussion Section Sockets Programming 10/10/17

CSE 124 Discussion Section Sockets Programming 10/10/17 CSE 124 Discussion Section Sockets Programming 10/10/17 Topics What s a socket? Creating a socket Connecting a socket Sending data Receiving data Resolving URLs to IPs Advanced socket options Live code

More information

CSE 333 SECTION 8. Sockets, Network Programming

CSE 333 SECTION 8. Sockets, Network Programming CSE 333 SECTION 8 Sockets, Network Programming Overview Domain Name Service (DNS) Client side network programming steps and calls Server side network programming steps and calls dig and ncat tools Network

More information

Introduction and Overview Socket Programming Lower-level stuff Higher-level interfaces Security. Network Programming. Samuli Sorvakko/Nixu Oy

Introduction and Overview Socket Programming Lower-level stuff Higher-level interfaces Security. Network Programming. Samuli Sorvakko/Nixu Oy Network Programming Samuli Sorvakko/Nixu Oy Telecommunications software and Multimedia Laboratory T-110.4100 Computer Networks October 5, 2009 Agenda 1 Introduction and Overview 2 Socket Programming 3

More information

sottotitolo Socket Programming Milano, XX mese 20XX A.A. 2016/17 Federico Reghenzani

sottotitolo Socket Programming Milano, XX mese 20XX A.A. 2016/17 Federico Reghenzani Titolo presentazione Piattaforme Software per la Rete sottotitolo Socket Programming Milano, XX mese 20XX A.A. 2016/17 Outline 1) Introduction to Sockets 2) UDP communication 3) TCP communication 4) RAW

More information

Lecture 3 Overview! Last Lecture! TCP/UDP and Sockets introduction!

Lecture 3 Overview! Last Lecture! TCP/UDP and Sockets introduction! Lecture 3 Overview! Last Lecture! TCP/UDP and Sockets introduction! This Lecture! Elementary TCP sockets! TCP Client-Server example! Source: Stevens book(chapters 4,5), Comer s book (Chapters 20, 21)!

More information

ECE 435 Network Engineering Lecture 2

ECE 435 Network Engineering Lecture 2 ECE 435 Network Engineering Lecture 2 Vince Weaver http://web.eece.maine.edu/~vweaver vincent.weaver@maine.edu 6 September 2018 Announcements Homework 1 will be posted. Will be on website, will announce

More information

Network Programming Worksheet 2. Simple TCP Clients and Servers on *nix with C.

Network Programming Worksheet 2. Simple TCP Clients and Servers on *nix with C. Simple TCP Clients and Servers on *nix with C. Aims. This worksheet introduces a simple client and a simple server to experiment with a daytime service. It shows how telnet can be used to test the server.

More information

ICT 6544 Distributed Systems Lecture 5

ICT 6544 Distributed Systems Lecture 5 ICT 6544 Distributed Systems Lecture 5 Hossen Asiful Mustafa Message Brokers Figure 4-21. The general organization of a message broker in a message-queuing system. IBM s WebSphere Message-Queuing System

More information

CS 3516: Computer Networks

CS 3516: Computer Networks Welcome to CS 3516: Prof. Yanhua Li Time: 9:00am 9:50am M, T, R, and F Location: AK219 Fall 2018 A-term 1 Some slides are originally from the course materials of the textbook Computer Networking: A Top

More information

Processes communicating. Network Communication. Sockets. Addressing processes 4/15/2013

Processes communicating. Network Communication. Sockets. Addressing processes 4/15/2013 Processes communicating Network Communication Process: program running within a host. within same host, two processes communicate using inter-process communication (defined by OS). processes in different

More information

Introduction and Overview Socket Programming Higher-level interfaces Final thoughts. Network Programming. Samuli Sorvakko/Nixu Oy

Introduction and Overview Socket Programming Higher-level interfaces Final thoughts. Network Programming. Samuli Sorvakko/Nixu Oy Network Programming Samuli Sorvakko/Nixu Oy Telecommunications software and Multimedia Laboratory T-110.4100 Computer Networks October 16, 2008 Agenda 1 Introduction and Overview Introduction 2 Socket

More information

How do we Communicate? Introduction to Unix Network Programming. What does Alice do? What does Bob do? Two simplest networking programs

How do we Communicate? Introduction to Unix Network Programming. What does Alice do? What does Bob do? Two simplest networking programs Introduction to Unix Network Programming Reference: Stevens Unix Network Programming How do we Communicate? Send a mail from Alice to Bob Bob Alice in Champaign, Bob in Hollywood Example: US Postal Service

More information

Socket Programming. #In the name of Allah. Computer Engineering Department Sharif University of Technology CE443- Computer Networks

Socket Programming. #In the name of Allah. Computer Engineering Department Sharif University of Technology CE443- Computer Networks #In the name of Allah Computer Engineering Department Sharif University of Technology CE443- Computer Networks Socket Programming Acknowledgments: Lecture slides are from Computer networks course thought

More information

Introduction to Socket Programming

Introduction to Socket Programming UNIT II - ELEMENTARY TCP SOCKETS Introduction to Socket Programming Introduction to Sockets Socket address Structures Byte ordering functions address conversion functions Elementary TCP Sockets socket,

More information

CSE 333 SECTION 7. C++ Virtual Functions and Client-Side Network Programming

CSE 333 SECTION 7. C++ Virtual Functions and Client-Side Network Programming CSE 333 SECTION 7 C++ Virtual Functions and Client-Side Network Programming Overview Virtual functions summary and worksheet Domain Name Service (DNS) Client side network programming steps and calls dig

More information

System Programming. Sockets

System Programming. Sockets Content : by Dr. B. Boufama School of Computer Science University of Windsor Instructor: Dr. A. Habed adlane@cs.uwindsor.ca http://cs.uwindsor.ca/ adlane/60-256 Content Content 1 Introducing 2 3 Internet

More information

Introduction and Overview Socket Programming Higher-level interfaces Final thoughts. Network Programming. Samuli Sorvakko/Nixu Oy

Introduction and Overview Socket Programming Higher-level interfaces Final thoughts. Network Programming. Samuli Sorvakko/Nixu Oy Network Programming Samuli Sorvakko/Nixu Oy Telecommunications software and Multimedia Laboratory T-110.4100 Computer Networks October 9, 2006 Agenda 1 Introduction and Overview Introduction 2 Socket Programming

More information

MSc Integrated Electronics Networks Assignment. Investigation of TCP/IP Sockets and Ports. Gavin Cameron

MSc Integrated Electronics Networks Assignment. Investigation of TCP/IP Sockets and Ports. Gavin Cameron MSc Integrated Electronics Networks Assignment Investigation of TCP/IP Sockets and Ports Gavin Cameron Introduction TCP and IP (Transmission Control Protocol / Internet Protocol) are two protocols from

More information

CSE 333 SECTION 7. Client-Side Network Programming

CSE 333 SECTION 7. Client-Side Network Programming CSE 333 SECTION 7 Client-Side Network Programming Overview Domain Name Service (DNS) Client side network programming steps and calls dig and ncat tools Network programming for the client side Recall the

More information

Networked Applications: Sockets. End System: Computer on the Net

Networked Applications: Sockets. End System: Computer on the Net Networked Applications: Sockets Topics Programmer s view of the Internet Sockets interface End System: Computer on the Net Internet Also known as a host 2 Page 1 Clients and Servers Client program Running

More information

PA #2 Reviews. set_name, get_name, del_name. Questions? Will be modified after PA #4 ~

PA #2 Reviews. set_name, get_name, del_name. Questions? Will be modified after PA #4 ~ Sockets Prof. Jin-Soo Kim( jinsookim@skku.edu) TA Dong-Yun Lee(dylee@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu PA #2 Reviews set_name, get_name, del_name Will

More information

NETWORK PROGRAMMING. Instructor: Junaid Tariq, Lecturer, Department of Computer Science

NETWORK PROGRAMMING. Instructor: Junaid Tariq, Lecturer, Department of Computer Science NETWORK PROGRAMMING CSC- 341 25 Instructor: Junaid Tariq, Lecturer, Department of Computer Science 26 9 Lecture Sockets as means for inter-process communication (IPC) application layer Client Process Socket

More information

Types (Protocols) Associated functions Styles We will look at using sockets in C Java sockets are conceptually quite similar

Types (Protocols) Associated functions Styles We will look at using sockets in C Java sockets are conceptually quite similar Socket Programming What is a socket? Using sockets Types (Protocols) Associated functions Styles We will look at using sockets in C Java sockets are conceptually quite similar - Advanced Data Communications:

More information

Topics for this Week

Topics for this Week Topics for this Week Layered Network Architecture ISO/OSI Reference Model Internet Protocol Suite Overview Application Programming Interface BSD Socket API Readings Sections 1.1-1.5, 6.1.3 (socket programming),

More information

SOCKET PROGRAMMING. What is a socket? Using sockets Types (Protocols) Associated functions Styles

SOCKET PROGRAMMING. What is a socket? Using sockets Types (Protocols) Associated functions Styles LABORATORY SOCKET PROGRAMMING What is a socket? Using sockets Types (Protocols) Associated functions Styles 2 WHAT IS A SOCKET? An interface between application and network The application creates a socket

More information

CSE 333 Lecture network programming intro

CSE 333 Lecture network programming intro CSE 333 Lecture 17 -- network programming intro Hal Perkins Paul G. Allen School of Computer Science & Engineering University of Washington Administrivia HW3 due Thursday night HW4 out Friday morning -

More information

UNIX Sockets. Developed for the Azera Group By: Joseph D. Fournier B.Sc.E.E., M.Sc.E.E.

UNIX Sockets. Developed for the Azera Group By: Joseph D. Fournier B.Sc.E.E., M.Sc.E.E. UNIX Sockets Developed for the Azera Group By: Joseph D. Fournier B.Sc.E.E., M.Sc.E.E. Socket and Process Communication application layer User Process Socket transport layer (TCP/UDP) network layer (IP)

More information

Client Server Computing

Client Server Computing Client Server Computing Although the Internet provides a basic communication service, the protocol software cannot initiate contact with, or accept contact from, a remote computer. Instead, two application

More information

Systems software design NETWORK COMMUNICATIONS & RPC SYSTEMS

Systems software design NETWORK COMMUNICATIONS & RPC SYSTEMS Systems software design NETWORK COMMUNICATIONS & RPC SYSTEMS outline network programming BSD/POSIX Socket API RPC systems object-oriented bridges CORBA DCOM RMI WebServices WSDL/SOAP XML-RPC REST network

More information

Network Socket Programming - 3 BUPT/QMUL

Network Socket Programming - 3 BUPT/QMUL Network Socket Programming - 3 BUPT/QMUL 2017-3-27 Agenda Basic concepts in NP Introduction to IP & TCP/UDP Introduction to Sockets 2 Introduction to Sockets Reviews of some helpful points Sockets interface

More information

Socket Programming. Dr. -Ing. Abdalkarim Awad. Informatik 7 Rechnernetze und Kommunikationssysteme

Socket Programming. Dr. -Ing. Abdalkarim Awad. Informatik 7 Rechnernetze und Kommunikationssysteme Socket Programming Dr. -Ing. Abdalkarim Awad Informatik 7 Rechnernetze und Kommunikationssysteme Before we start Can you find the ip address of an interface? Can you find the mac address of an interface?

More information

Network Socket Programming - 3 BUPT/QMUL

Network Socket Programming - 3 BUPT/QMUL Network Socket Programming - 3 BUPT/QMUL 2018-04-02 Agenda Basic concepts in NP Introduction to IP & TCP/UDP Introduction to Sockets 2 Introduction to Sockets Reviews of some helpful points Sockets interface

More information

Piotr Mielecki Ph. D.

Piotr Mielecki Ph. D. Piotr Mielecki Ph. D. http://mielecki.ristel.pl/ piotr.mielecki@pwr.edu.pl pmielecki@gmail.com Building blocks of client-server applications: Client, Server, Middleware. Simple client-server application:

More information

Ports under 1024 are often considered special, and usually require special OS privileges to use.

Ports under 1024 are often considered special, and usually require special OS privileges to use. 1 2 Turns out that besides an IP address (used by the IP layer), there is another address that is used by TCP (stream sockets) and, coincidentally, by UDP (datagram sockets). It is the port number. It's

More information

Elementary TCP Sockets

Elementary TCP Sockets Elementary TCP Sockets Chapter 4 UNIX Network Programming Vol. 1, Second Ed. Stevens Distributed Computer Systems 1 socket interface Application 1 Application 2 socket interface user kernel user kernel

More information

TCP: Three-way handshake

TCP: Three-way handshake Sockets in C 1 Sockets in C The slides by themselves will not be sufficient to learn how to write socket code. If you did not attend class, then you will want to review the relevant chapters in Kerrisk

More information

Chapter 6. The Transport Layer. Transport Layer 3-1

Chapter 6. The Transport Layer. Transport Layer 3-1 Chapter 6 The Transport Layer Transport Layer 3-1 Transport services and protocols provide logical communication between app processes running on different hosts transport protocols run in end systems

More information

A Socket Example. Haris Andrianakis & Angelos Stavrou George Mason University

A Socket Example. Haris Andrianakis & Angelos Stavrou George Mason University A Socket Example & George Mason University Everything is a file descriptor Most socket system calls operate on file descriptors Server - Quick view socket() bind() listen() accept() send(), recv() close()

More information

WinSock. What Is Sockets What Is Windows Sockets What Are Its Benefits Architecture of Windows Sockets Network Application Mechanics

WinSock. What Is Sockets What Is Windows Sockets What Are Its Benefits Architecture of Windows Sockets Network Application Mechanics WinSock What Is Sockets What Is Windows Sockets What Are Its Benefits Architecture of Windows Sockets Network Application Mechanics What Is Sockets Standard API (Application Programming Interface) for

More information

Network Communication

Network Communication Network Communication Processes communicating Process: program running within a host. q within same host, two processes communicate using inter- process communica6on (defined by OS). q processes in different

More information

Review. Preview. Closing a TCP Connection. Closing a TCP Connection. Port Numbers 11/27/2017. Packet Exchange for TCP Connection

Review. Preview. Closing a TCP Connection. Closing a TCP Connection. Port Numbers 11/27/2017. Packet Exchange for TCP Connection Review Preview Algorithms and Issues in Client Software Design Client Architecture Identifying the Location of a Parsing an Address Argument Looking Up a Domain Name Looking Up a Well-Known Port by Name

More information

CS307 Operating Systems Processes

CS307 Operating Systems Processes CS307 Processes Fan Wu Department of Computer Science and Engineering Shanghai Jiao Tong University Spring 2018 Process Concept Process a program in execution An operating system executes a variety of

More information

Processes. Process Concept. The Process. The Process (Cont.) Process Control Block (PCB) Process State

Processes. Process Concept. The Process. The Process (Cont.) Process Control Block (PCB) Process State CS307 Process Concept Process a program in execution Processes An operating system executes a variety of programs: Batch system jobs Time-shared systems user programs or tasks All these activities are

More information

Internet applications

Internet applications CSc 450/550 Computer Networks Worldwide Web Jianping Pan Summer 2006 5/18/06 CSc 450/550 1 Traditionally Internet applications remote login: e.g., telnet file transfer: e.g., FTP electronic mail: e.g.,

More information

Networked Applications: Sockets. Goals of Todayʼs Lecture. End System: Computer on the ʻNet. Client-server paradigm End systems Clients and servers

Networked Applications: Sockets. Goals of Todayʼs Lecture. End System: Computer on the ʻNet. Client-server paradigm End systems Clients and servers Networked Applications: Sockets CS 375: Computer Networks Spring 2009 Thomas Bressoud 1 Goals of Todayʼs Lecture Client-server paradigm End systems Clients and servers Sockets and Network Programming Socket

More information

CSMC 412. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala Set 2. September 15 CMSC417 Set 2 1

CSMC 412. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala Set 2. September 15 CMSC417 Set 2 1 CSMC 412 Computer Networks Prof. Ashok K Agrawala 2015 Ashok Agrawala Set 2 September 15 CMSC417 Set 2 1 Contents Client-server paradigm End systems Clients and servers Sockets Socket abstraction Socket

More information

Announcements. CS 5565 Network Architecture and Protocols. Queuing. Demultiplexing. Demultiplexing Issues (1) Demultiplexing Issues (2)

Announcements. CS 5565 Network Architecture and Protocols. Queuing. Demultiplexing. Demultiplexing Issues (1) Demultiplexing Issues (2) Announcements CS 5565 Network Architecture and Protocols Problem Set 1 due Feb 18 Project 1A due Feb 19 Lecture 5 Godmar Back 2 Queuing Demultiplexing send queues Layer k+1 Layer k recv queues End systems

More information

CS 43: Computer Networks. 05: Socket Programming September 12-14, 2018

CS 43: Computer Networks. 05: Socket Programming September 12-14, 2018 CS 43: Computer Networks 05: Socket Programming September 12-14, 2018 Reading Quiz Lecture 5/6 - Slide 2 Socket Programming Adapted from: Donahoo, Michael J., and Kenneth L. Calvert. TCP/IP sockets in

More information

Socket Programming(2/2)

Socket Programming(2/2) Socket Programming(2/2) 1 Outline 1. Introduction to Network Programming 2. Network Architecture Client/Server Model 3. TCP Socket Programming 4. UDP Socket Programming 5. IPv4/IPv6 Programming Migration

More information

Client-server model The course that gives CMU its Zip! Network programming Nov 27, Using ports to identify services.

Client-server model The course that gives CMU its Zip! Network programming Nov 27, Using ports to identify services. 15-213 The course that gives CMU its Zip! Network programming Nov 27, 2001 Topics Client- model Sockets interface Echo and Client- model Every network application is based on the - model: Application is

More information

ECE 435 Network Engineering Lecture 2

ECE 435 Network Engineering Lecture 2 ECE 435 Network Engineering Lecture 2 Vince Weaver http://web.eece.maine.edu/~vweaver vincent.weaver@maine.edu 31 August 2017 Announcements Homework 1 will be posted. Will be on website, will announce

More information

9/13/2007. Motivations for Sockets What s in a Socket? Working g with Sockets Concurrent Network Applications Software Engineering for Project 1

9/13/2007. Motivations for Sockets What s in a Socket? Working g with Sockets Concurrent Network Applications Software Engineering for Project 1 Daniel Spangenberger 15 441 Computer Networks, Fall 2007 Goal of Networking: Communication Share data Pass Messages Say I want to talk to a friend in Singapore How can I do this? What applications and

More information

Unix Network Programming Chapter 4. Elementary TCP Sockets 광운대학교컴퓨터과학과 정보통신연구실 석사과정안중현

Unix Network Programming Chapter 4. Elementary TCP Sockets 광운대학교컴퓨터과학과 정보통신연구실 석사과정안중현 Unix Network Programming Chapter 4. Elementary TCP Sockets 광운대학교컴퓨터과학과 정보통신연구실 석사과정안중현 4.1 Introduction A Time line of the typical scenario that takes place between a TCP client and server. Describes the

More information

CSE 333 Section 8 - Client-Side Networking

CSE 333 Section 8 - Client-Side Networking CSE 333 Section 8 - Client-Side Networking Welcome back to section! We re glad that you re here :) Networking Quick Review What are the following protocols used for? (bonus: what layer of the networking

More information

Computer Networks Prof. Ashok K. Agrawala

Computer Networks Prof. Ashok K. Agrawala CMSC417 Computer Networks Prof. Ashok K. Agrawala 2018Ashok Agrawala September 6, 2018 Fall 2018 Sept 6, 2018 1 Overview Client-server paradigm End systems Clients and servers Sockets Socket abstraction

More information

CptS 360 (System Programming) Unit 17: Network IPC (Sockets)

CptS 360 (System Programming) Unit 17: Network IPC (Sockets) CptS 360 (System Programming) Unit 17: Network IPC (Sockets) Bob Lewis School of Engineering and Applied Sciences Washington State University Spring, 2018 Motivation Processes need to talk to each other

More information

CLIENT-SIDE PROGRAMMING

CLIENT-SIDE PROGRAMMING CLIENT-SIDE PROGRAMMING George Porter Apr 11, 2018 ATTRIBUTION These slides are released under an Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0) Creative Commons license These slides

More information

CSE 333 SECTION 6. Networking and sockets

CSE 333 SECTION 6. Networking and sockets CSE 333 SECTION 6 Networking and sockets Overview Network Sockets IP addresses and IP address structures in C/C++ DNS Resolving DNS names Demos Section exercise Sockets Network sockets are network interfaces

More information

CS4700/CS5700 Fundamentals of Computer Networking

CS4700/CS5700 Fundamentals of Computer Networking CS4700/CS5700 Fundamentals of Computer Networking Prof. Alan Mislove Lecture 3: Crash course in socket programming September 10th, 2009 Project 0 Goal: Familiarize you with socket programming in C Implement

More information

Applications and Layered Architectures. Chapter 2 Communication Networks Leon-Garcia, Widjaja

Applications and Layered Architectures. Chapter 2 Communication Networks Leon-Garcia, Widjaja Applications and Layered Architectures Chapter 2 Communication Networks Leon-Garcia, Widjaja Network Architecture Architecture: Any design or orderly arrangement perceived by man. The goals of a network:

More information

UNIT IV- SOCKETS Part A

UNIT IV- SOCKETS Part A 1. Define sockets - SOCKETS Part A A socket is a construct to provide a communication between computers. It hides the underlying networking concepts and provides us with an interface to communicate between

More information

Christian Tschudin (basierend auf einem Foliensatz von C. Jelger und T. Meyer) Departement Mathematik und Informatik, Universität Basel

Christian Tschudin (basierend auf einem Foliensatz von C. Jelger und T. Meyer) Departement Mathematik und Informatik, Universität Basel Internettechnologien (CS262) Socket Programming in C 4. März 2015 Christian Tschudin (basierend auf einem Foliensatz von C. Jelger und T. Meyer) Departement Mathematik und Informatik, Universität Basel

More information

Context. Distributed Systems: Sockets Programming. Alberto Bosio, Associate Professor UM Microelectronic Departement

Context. Distributed Systems: Sockets Programming. Alberto Bosio, Associate Professor UM Microelectronic Departement Distributed Systems: Sockets Programming Alberto Bosio, Associate Professor UM Microelectronic Departement bosio@lirmm.fr Context Computer Network hosts, routers, communication channels Hosts run applications

More information

Department of Computer Science

Department of Computer Science Department of Computer Science Notes on Interprocess Communication in Unix Jean Dollimore,Oct.1990, last revised Feb. 1996 These notes explain how you can write "distributed programs" in C or C++ running

More information

UNIX Sockets. COS 461 Precept 1

UNIX Sockets. COS 461 Precept 1 UNIX Sockets COS 461 Precept 1 Socket and Process Communica;on application layer User Process Socket transport layer (TCP/UDP) OS network stack network layer (IP) link layer (e.g. ethernet) Internet Internet

More information

Overview. Administrative. * HW# 5 Due next week. * HW# 5 : Any Questions. Topics. * Client Server Communication. * 12.

Overview. Administrative. * HW# 5 Due next week. * HW# 5 : Any Questions. Topics. * Client Server Communication. * 12. Overview Administrative * HW# 5 Due next week * HW# 5 : Any Questions Topics * Client Server Communication * 12.3 ISO/OSI Layers * 12.4 UICI Implementations * App. B (UICI : Socket Implementation) * 12.4

More information

Introduction to Socket Programming

Introduction to Socket Programming Introduction to Socket Programming (Advanced Computer Networks) By Priyank Shah NET ID : pss160530 A Simple Question What are Sockets? Sockets are communication points on the same or different computers

More information

Socket Programming 2007/03/28

Socket Programming 2007/03/28 Socket Programming 2007/03/28 Reference W. Richard Stevens, Unix Network Programming 2/e Volume 1,1998 James F. Kurose and Keith W. Ross, "Computer Networks: A Top-Down Approach Featuring the Internet

More information

Communication. Communication. Distributed Systems. Networks and protocols Sockets Remote Invocation Messages Streams. Fall /10/2001 DoCS

Communication. Communication. Distributed Systems. Networks and protocols Sockets Remote Invocation Messages Streams. Fall /10/2001 DoCS Communication Distributed Systems Fall 2002 Communication Process Process Networks and protocols Sockets Remote Invocation Messages Streams 9/10/2001 DoCS 2002 2 Layered Protocols (1) Layers, interfaces,

More information