BCS Autumn School. Distinguish your application with Bonjour. Nan Xu. 20 November 2013

Size: px
Start display at page:

Download "BCS Autumn School. Distinguish your application with Bonjour. Nan Xu. 20 November 2013"

Transcription

1 BCS Autumn School Distinguish your application with Bonjour Nan Xu 20 November 2013

2 About Speaker Director of Operations at Red7Mobile Ltd PRINCE2 project manager and Senior ios developer Have managed, developed and release 100+ apps for all platforms and many industry sectors.

3 Introduction Bonjour overview - why using Bonjour - ecosystem - Bonjour technology Code walkthrough Application demo Q&A

4 Why using Bonjour? Improve User Experience

5 Bonjour Ecosystem Platforms - Mac OS, ios, Windws, Linux and Android Devices - desktop/laptop - network printer and network camera - mobile phone - Apple TV Applications - itunes, iphoto, ichat, AirPrint - Safari on both Mac and windows - remote control, i.e Apple TV and Keynote

6 Bonjour Technology Link-local addressing - allocation IP addresses to hosts - IPv4 and IPv6 - handled by OS for software application Naming using Multicast DNS - using names to refer to hosts instead of IP addresses - handled by Bonjour for software application Note: if you build hardware, then you need to handle both addressing and naming yourself. DNS Service Discovery - using names to refer to hosts instead of IP addresses

7 Bonjour Service Name Bonjour service name contains three parts: 1. User-Visible Instance Name 2. Service Type (Application Protocol Name) 3. Domain Example: BSC Demo. _piano._tcp. local.

8 Service Types Service Type is a Unique Identifier String - contains max 15 characters in length - allows letters, digits and hyphens in US-ASCII encoding The identifier string describes: - what the service does - how to do it. i.e _keynotepairing._tcp IANA manages registry of unique service type strings - IANA list of assigned service type strings - applying for your own is easy and free - register your unique service type before releasing

9 Bonjour API Architecture NSNetService and NSNetServiceBrower in Foundation CFNetServices is parts of CFNetwork framework which is in Core Foundation DNS service discovery for Java is a OS X only API DNS Service discovery layer is built around BSD sockets Multicast DNS responder doesn t interact with developers software.

10 Bonjour API Architecture cont. How can your app plug into Bonjour framework

11 Bonjour API Architecture cont. TCP API will be used in each type of plug-in

12 Bonjour Operations Three basic operations. 1. Publishing (advertising a service) 2. Discovery (browsing for available services) 3. Resolution (translating service instance names to addresses and port numbers for use)

13 Bonjour Operations Server Side flow: Register and Publish Create TCP socket BSD fd (Socket/blind/listen) CFSocket Wrapped in CFSocket Create NSNetService NSNetService Ready to publish NSNetService (CFSocketCreateWithNative) (InitWithDomain:type:name:port) (publish)

14 Bonjour Operations Client Side flow: Browse (searchforserviceoftype:indomain:) NSNetServiceBrowser Found Service NSNetService (didfindservice:) Found Service NSNetService Found Service NSNetService Found Service NSNetService User Select Service Instance NSNetService

15 Bonjour Operations Final Resolve and Connect Client Side Connect NSInputStream Service Side Connect NSInputStream NSOutStream Connected NSOutStream Accept Callback NSNetService (getinputstream:outputstream) CFSocket

16 Code walkthrough Setup CFSocket CFSocketContext socketctxt = {0, self, NULL, NULL, NULL; CFSocketRef socket = CFSocketCreate(kCFAllocatorDefault, PF_INET6, SOCK_STREAM, IPPROTO_TCP, kcfsocketacceptcallback, (CFSocketCallBack)&TCPServerAcceptCallBack, &socketctxt); if (socket!= NULL) { protocolfamily = PF_INET6; else { socket = CFSocketCreate(kCFAllocatorDefault, PF_INET, SOCK_STREAM, IPPROTO_TCP, kcfsocketacceptcallback, (CFSocketCallBack)&TCPServerAcceptCallBack, &socketctxt); if (socket!= NULL) { protocolfamily = PF_INET; int yes = 1; setsockopt(cfsocketgetnative(socket), SOL_SOCKET, SO_REUSEADDR, (void *)&yes, sizeof(yes));

17 Code walkthrough Bind CFSocket with IPv6 BSD socket address if (protocolfamily == PF_INET6) { struct sockaddr_in6 addr6; memset(&addr6, 0, sizeof(addr6)); addr6.sin6_len = sizeof(addr6); addr6.sin6_family = AF_INET6; addr6.sin6_port = 0; addr6.sin6_flowinfo = 0; addr6.sin6_addr = in6addr_any; NSData *address6 = [NSData datawithbytes:&addr6 length:sizeof(addr6)]; if (kcfsocketsuccess!= CFSocketSetAddress(socket, (CFDataRef)address6)) { return NO; NSData *addr = [(NSData *)CFSocketCopyAddress(socket) autorelease]; memcpy(&addr6, [addr bytes], [addr length]); self.port = ntohs(addr6.sin6_port);

18 Code walkthrough Bind CFSocket with IPv6 BSD socket address if (protocolfamily == PF_INET4) { struct sockaddr_in addr4; memset(&addr4, 0, sizeof(addr4)); addr4.sin_len = sizeof(addr4); addr4.sin_family = AF_INET; addr4.sin_port = 0; addr4.sin_addr.s_addr = htonl(inaddr_any); NSData *address4 = [NSData datawithbytes:&addr4 length:sizeof(addr4)]; if (kcfsocketsuccess!= CFSocketSetAddress(socket, (CFDataRef)address4)) { return NO; NSData *addr = [(NSData *)CFSocketCopyAddress(socket) autorelease]; memcpy(&addr4, [addr bytes], [addr length]); self.port = ntohs(addr4.sin_port);

19 Code walkthrough Schedule sockets in Run loop CFRunLoopRef cfrl = CFRunLoopGetCurrent(); CFRunLoopSourceRef source = CFSocketCreateRunLoopSource(kCFAllocatorDefault, socket, 0); CFRunLoopAddSource(cfrl, source, kcfrunloopcommonmodes); CFRelease(source);

20 Code walkthrough Register and Publish Bonjour NSNetService *netservice = [[NSNetService alloc] initwithdomain:@ _local. type:@ _piano._tcp name:@ BCS Demo port:self.port]; if(netservice == nil) return NO; [netservice setdelegate:self]; [netservice scheduleinrunloop:[nsrunloop currentrunloop] formode:nsrunloopcommonmodes]; [netservice publish]; NSNetServices Delegate Methods - (void)netservicedidpublish:(nsnetservice *)sender { - (void)netservice:(nsnetservice *)sender didnotpublish:(nsdictionary *)errordict {

21 Code walkthrough Browse for Bonjour Services NSNetServiceBrowser *netservicebroswer = [[NSNetServiceBrowser alloc] init]; [netservicebroswer setdelegate:self]; [self.netservicebrowser searchforservicesoftype :@ _piano._tcp indomain :@ _local. ]; NSNetServiceBrowser Delegate Methods - (void)netservicebrowser:(nsnetservicebrowser *)netservicebrowser didfindservice:(nsnetservice *)service morecoming:(bool)morecoming { // If a service came online, add it to the list and update the table view if no more events are queued. [self.avaiableservices addobject:service]; // If morecoming is NO, it means that there are no more messages in the queue from the Bonjour daemon, so we should now try to connect. if (!morecoming) { if (self.delegate && [self.delegate respondstoselector:@selector(bonjourdidfindservices:)]) { [self.delegate bonjourdidfindservices:self.avaiableservices];

22 Code walkthrough Resolve and Connect Bonjour Service NSNetService *netservice = selectedservice; netservice.delegate = self; // Attempt to resolve the service. A value of 0.0 sets an unlimited time to resolve it. [netservice resolvewithtimeout:0.0]; NSNetService Delegate Methods for Resolving - (void)netservicedidresolveaddress:(nsnetservice *)service { NSInputStream *istream; NSOutputStream *ostream; if (![service getinputstream:&istream outputstream:&ostream]) { NSLog(@"Cannot get Input and Output streams for service: %@", service); return; [self.listernerchannel openinputstream:istream outputstream:ostream delegate:self]; - (void)netservice:(nsnetservice *)sender didnotresolve:(nsdictionary *)errordict {

23 Bonjour Channel Object Code walkthrough - (void)openinputstream:(nsinputstream *)istream outputstream:(nsoutputstream *)ostream delegate:(id)delegate { self.inputstream = istream; self.inputstream.delegate = delegate; [self.inputstream scheduleinrunloop:[nsrunloop currentrunloop] formode:nsdefaultrunloopmode]; [self.inputstream open]; self.outputstream = ostream; self.outputstream.delegate = delegate; [self.outputstream scheduleinrunloop:[nsrunloop currentrunloop] formode:nsdefaultrunloopmode]; [self.outputstream open];

24 Put Everything Together BCSBonjourObject - netservice - netservicebrower BCSBonjour Delegate methods BCSBonjourBroadcast - tcpserver - channearray BCSBonjourListener - channel - socket - port - netservice TCPServer BCSBonjourChannel - inputstream - outputstream TCPServer Delegate methods

25 Application Demo

26 Reference and Further Reading Bonjour for Developers Simplify Networking with Bonjour (WWDC 2012) Bonjour Overview (Wikipedia) Zero Configuration Networking (Book)

27 Thank you for listening Nan Xu Director of Operations Josh Regan Senior Mobile Developer

AsyncNetwork Cocoa & ios Networking Evolved

AsyncNetwork Cocoa & ios Networking Evolved AsyncNetwork Cocoa & ios Networking Evolved Open Source (MIT License) github.com/jdiehl/async-network jonathan.diehl@rwth-aachen.de Client/Server One Server Many Clients Listen to incoming connections

More information

iphone Application Programming L09: Networking

iphone Application Programming L09: Networking iphone Application Programming L09: Networking Prof. Dr., Florian Heller, Jonathan Diehl Media Computing Group, RWTH Aachen WS 2009/2010 http://hci.rwth-aachen.de/iphone Networking Bonjour Networking Push

More information

CS193E Lecture 18. Web Kit and Networking with Bonjour & Distributed Objects

CS193E Lecture 18. Web Kit and Networking with Bonjour & Distributed Objects CS193E Lecture 18 Web Kit and Networking with Bonjour & Distributed Objects Web Kit Web Kit Framework for handling web content Provides the core of Safari functionality Open Source project http://webkit.org/

More information

iphone Application Programming Networking

iphone Application Programming Networking iphone Application Programming Networking Media Computing Group RWTH Aachen University WS 2013/2014 http://hci.rwth-aachen.de/iphone Networking Connect Two Peers Standard UI What Is the Peer Picker? Game

More information

iphone Application Programming Networking

iphone Application Programming Networking iphone Application Programming Networking RWTH Aachen University WS 2015/16 http://hci.rwth-aachen.de/iphone Networking on ios There are many ways to network Think about what you need to do first Then

More information

Sockets 15H2. Inshik Song

Sockets 15H2. Inshik Song Sockets 15H2 Inshik Song Internet CAU www server (www.cau.ac.kr) Your web browser (Internet Explorer/Safari) Sockets 2 How do we find the server? Every computer on the Internet has an Internet address.

More information

An ios Static Library for Service Discovery and Dynamic Procedure Calls

An ios Static Library for Service Discovery and Dynamic Procedure Calls An ios Static Library for Service Discovery and Dynamic Procedure Calls Arnav Anshul Department of Engineering. Arizona State University Polytechnic Campus. arnavanshul@gmail.com Abstract - Remote procedure

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

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

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

Socket Programming. Sungkyunkwan University. Hyunseung Choo Copyright Networking Laboratory

Socket Programming. Sungkyunkwan University. Hyunseung Choo Copyright Networking Laboratory Socket Programming Sungkyunkwan University Hyunseung Choo choo@skku.edu Copyright 2000-2019 Networking Laboratory Contents Goals Client-Server mechanism Introduction to socket Programming with socket on

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

Lecture 7 Overview. IPv6 Source: Chapter 12 of Stevens book Chapter 31 of Comer s book

Lecture 7 Overview. IPv6 Source: Chapter 12 of Stevens book Chapter 31 of Comer s book Last Lecture Lecture 7 Overview Name and address conversions This Lecture IPv6 Source: Chapter 12 of Stevens book Chapter 31 of Comer s book Next Lecture Broadcast and multicast sockets Source: Chapters

More information

Server-side Programming

Server-side Programming Server-side Programming CSE 333 Spring 2018 Instructor: Justin Hsia Teaching Assistants: Danny Allen Dennis Shao Eddie Huang Kevin Bi Jack Xu Matthew Neldam Michael Poulain Renshu Gu Robby Marver Waylon

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

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

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

Concurrent Servers. Overview. In our current assignment we have the following changes:

Concurrent Servers. Overview. In our current assignment we have the following changes: Concurrent Servers Overview In our current assignment we have the following changes: Concurrent server Session command with an argument of the session name Shutdown command 2 Concurrent Server When a client

More information

Porting a Network Cryptographic Service to the RMC2000: A Case Study in Embedded Software Development

Porting a Network Cryptographic Service to the RMC2000: A Case Study in Embedded Software Development Porting a Network Cryptographic Service to the RMC2000: A Case Study in Embedded Software Development Stephen Jan Paolo de Dios Stephen A. Edwards Dept. of Computer Science Columbia University, New York,

More information

Server-side Programming

Server-side Programming L23: Serer-side Programming Serer-side Programming CSE 333 Autumn 2018 Instructor: Hal Perkins Teaching Assistants: Tarkan Al-Kazily Renshu Gu Trais McGaha Harshita Neti Thai Pham Forrest Timour Soumya

More information

Project 3. Reliable Data Transfer over UDP. NTU CSIE Computer Networks 2011 Spring

Project 3. Reliable Data Transfer over UDP. NTU CSIE Computer Networks 2011 Spring Project 3 Reliable Data Transfer over UDP NTU CSIE Computer Networks 2011 Spring Project Goal In Project 3, students are asked to understand and implement reliable data transfer mechanism over UDP. UDP

More information

Lecture 6 Overview. Last Lecture. This Lecture. Next Lecture. Name and address conversions

Lecture 6 Overview. Last Lecture. This Lecture. Next Lecture. Name and address conversions Last Lecture Lecture 6 Overview Name and address conversions This Lecture IPv6 Broadcast and multicast sockets Source: Chapters 12, 20, and 21 Next Lecture Introduction to wireless sensor networks Lecture

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

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

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

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

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

Computer Network Programming

Computer Network Programming Practical Programming Computer Network Programming Marwan Burelle & David Bouchet david.bouchet.epita@gmail.com 1 Quick Overview 1.IP and Protocol Stack 2.TCP Concepts 3.Client / Server Concepts 4.Socket

More information

CSCD 330 Network Programming Spring 2018

CSCD 330 Network Programming Spring 2018 CSCD 330 Network Programming Spring 2018 Lecture 6 Application Layer Socket Programming in Java Reading for Java Client/Server see Relevant Links Some Material in these slides from J.F Kurose and K.W.

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

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

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

C18: Network Fundamentals and Reliable Sockets

C18: Network Fundamentals and Reliable Sockets CISC 3120 C18: Network Fundamentals and Reliable Sockets Hui Chen Department of Computer & Information Science CUNY Brooklyn College 4/16/2018 CUNY Brooklyn College 1 Outline Networking fundamentals Network

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

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

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

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

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

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

What s an API? Do we need standardization?

What s an API? Do we need standardization? Network Interface z The network protocol stack is a part of the OS z Need an API to interface applications to the protocol stack. What s an API? Do we need standardization? z The socket interface is the

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

Cross Platform Nearby Networking

Cross Platform Nearby Networking Core OS #WWDC14 Cross Platform Nearby Networking Session 709 Demijan Klinc Software Engineer 2014 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission

More information

Network Software Implementations

Network Software Implementations Network Software Implementations Number of computers on the Internet doubling yearly since 1981, nearing 200 million Estimated that more than 600 million people use the Internet Number of bits transmitted

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

Lecture 24. Thursday, November 19 CS 375 UNIX System Programming - Lecture 24 1

Lecture 24. Thursday, November 19 CS 375 UNIX System Programming - Lecture 24 1 Lecture 24 Log into Linux. Copy directory /home/hwang/cs375/lecture24 Final project posted. Due during finals week. Reminder: No class next Tuesday (11/24) Questions? Thursday, November 19 CS 375 UNIX

More information

June Using Apple AirPrint with Xerox ConnectKey Devices User Guide

June Using Apple AirPrint with Xerox ConnectKey Devices User Guide June 2013 Using Apple AirPrint with Xerox ConnectKey Devices User Guide 2013 Xerox Corporation. All rights reserved. Xerox, Xerox and Design and ConnectKey are trademarks of the Xerox Corporation in the

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

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 Socket Programming What is a socket? Using sockets Types (Protocols) Associated functions Styles We will look at using sockets in C Note: Java and C# sockets are conceptually quite similar 1 What is a

More information

Introduction to Computer Networks

Introduction to Computer Networks Introduction to Computer Networks Tian Song ( 嵩天 ), Ph.D., Assoc. Prof. songtian@bit.edu.cn Introduction to Computer Networks Socket and Network Programming Tian Song ( 嵩天 ), Ph.D., Assoc. Prof. songtian@bit.edu.cn

More information

Cocoa. Last Week... Music 3SI: Introduction to Audio/Multimedia App. Programming. Today... Why Cocoa? Wikipedia - Cocoa

Cocoa. Last Week... Music 3SI: Introduction to Audio/Multimedia App. Programming. Today... Why Cocoa? Wikipedia - Cocoa Music 3SI: Introduction to Audio/Multimedia App. Programming IDE (briefly) VST Plug-in Assignment 1 hints Last Week... Week #5-5/5/2006 CCRMA, Department of Music Stanford University 1 2 Today... Cocoa

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

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

socketservertcl a Tcl extension for using SCM_RIGHTS By Shannon Noe - FlightAware

socketservertcl a Tcl extension for using SCM_RIGHTS By Shannon Noe - FlightAware socketservertcl a Tcl extension for using SCM_RIGHTS By Shannon Noe - FlightAware Presented at the 24th annual Tcl/Tk conference, Houston Texas, October 2017 Abstract: Horizontal scaling is used to distribute

More information

Linux TCP Bind Shell from Scratch with Intel x86 Assembly

Linux TCP Bind Shell from Scratch with Intel x86 Assembly Linux TCP Bind Shell from Scratch with Intel x86 Assembly Amonsec https://amonsec.com Jun 13, 2017 (V 1.0) 1 1 7 This blog post has been created for completing the requirements of the SecurityTube Linux

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

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

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

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

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

last time redo logging copy-on-write filesystems / snapshots distributed systems motivation, etc.

last time redo logging copy-on-write filesystems / snapshots distributed systems motivation, etc. Sockets / RPC 1 last time 2 redo logging write log + commit, then do operation on failure, check log redo anything marked committed in log copy-on-write filesystems / snapshots distributed systems motivation,

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

Randall Stewart, Cisco Systems Phill Conrad, University of Delaware

Randall Stewart, Cisco Systems Phill Conrad, University of Delaware SCTP: An Overview Randall Stewart, Cisco Systems Phill Conrad, University of Delaware 1 Our Objectives Be able to explain what SCTP is, and what its major features are when and why you might use it (instead

More information

EveryonePrint. Mobile Gateway 4.2. Installation Guide. EveryonePrint Mobile Gateway Installation Guide Page 1 of 30

EveryonePrint. Mobile Gateway 4.2. Installation Guide. EveryonePrint Mobile Gateway Installation Guide Page 1 of 30 EveryonePrint Mobile Gateway 4.2 Installation Guide EveryonePrint Mobile Gateway Installation Guide 2016.09.01 Page 1 of 30 1. Introduction... 3 1.1 Multiple networks (using Multicast Bonjour AirPrint)...

More information

E Event-based parser, XML, 180 Extended attributes, URLs, 118 API, 119 command line, 118 description, 118 NSURL category, 119

E Event-based parser, XML, 180 Extended attributes, URLs, 118 API, 119 command line, 118 description, 118 NSURL category, 119 Index A Access control lists (ACLs), 113 Application distribution, 353 certificate utility, 358 App ID creation, 358 App Store, 363 center, 357 no of certificates, 358 code sign identity, 362 configuring

More information

SOCKET. Valerio Di Valerio

SOCKET. Valerio Di Valerio SOCKET Valerio Di Valerio The Problem! Communication between computers connected to a network Network Network applications! A set of processes distributed over a network that communicate via messages!

More information

A set of processes distributed over a network that communicate via messages. Processes communicate via services offered by the operating system

A set of processes distributed over a network that communicate via messages. Processes communicate via services offered by the operating system SOCKET Network applications A set of processes distributed over a network that communicate via messages Ex: Browser Web, BitTorrent, ecc Processes communicate via services offered by the operating system

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

LAN Manager. Instruction Manual.

LAN Manager. Instruction Manual. LAN Manager Instruction Manual www.listeneverywhere.com www.listentech.com INTRODUCTION The LAN Manager is a web application, hosted in firmware by a Listen EVERYWHERE Venue Server, that enables network

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

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

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

Chapter 2 Applications and

Chapter 2 Applications and Chapter 2 Applications and Layered Architectures Sockets Socket API API (Application Programming Interface) Provides a standard set of functions that can be called by applications Berkeley UNIX Sockets

More information

Lab 0. Yvan Petillot. Networks - Lab 0 1

Lab 0. Yvan Petillot. Networks - Lab 0 1 Lab 0 Yvan Petillot Networks - Lab 0 1 What You Will Do In This Lab. The purpose of this lab is to help you become familiar with the UNIX/LINUX on the lab network. This means being able to do editing,

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

How a Unified Wired and Wireless Architecture Addresses BYOD

How a Unified Wired and Wireless Architecture Addresses BYOD How a Unified Wired and Wireless Architecture Addresses BYOD John W. Turner Brandeis University www.linkedin.com/in/johnwturner1 @johnwturner Airheads Social ID: turner Mobility Trends Birthplace of BYOD

More information

Introduction to Computer Systems. Networks 2. c Theodore Norvell. The Sockets API

Introduction to Computer Systems. Networks 2. c Theodore Norvell. The Sockets API The Sockets API [Wait! If you are not familiar with file descriptors and the UNIX read and write system calls, read chapter 10 of Bryant and O Hallaron and/or my summary before going on.] In this section

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

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

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

We will cover in this order: 2.1, 2.7, 2.5, 2.4, 2.2

We will cover in this order: 2.1, 2.7, 2.5, 2.4, 2.2 CSE 422 Notes, Set 2 These slides contain materials provided with the text: Computer Networking: A Top Down Approach,5 th edition, by Jim Kurose and Keith Ross, Addison-Wesley, April 2009. Additional figures

More information

Introduction to Client-Server Model

Introduction to Client-Server Model Preview Introduction to Client-Server Model Motivation of Client-Server Model Terminologies and Concepts in Client-Server Model Connectionless vs. Connection-Oriented Stateless vs. Stateful Server Identify

More information

Printopia Pro Multicast DNS (mdns) Deployment and Troubleshooting Guide

Printopia Pro Multicast DNS (mdns) Deployment and Troubleshooting Guide Printopia Pro Multicast DNS (mdns) Deployment and Troubleshooting Guide Version 4 Feb 18, 2016 Copyright 2016 Decisive Tactics, Inc. Mac, iphone, ipad, ipod Touch, ios, OS X, and AirPrint are trademarks

More information

Distributed Systems. 02. Networking. Paul Krzyzanowski. Rutgers University. Fall 2017

Distributed Systems. 02. Networking. Paul Krzyzanowski. Rutgers University. Fall 2017 Distributed Systems 02. Networking Paul Krzyzanowski Rutgers University Fall 2017 1 Inter-computer communication Without shared memory, computers need to communicate Direct link Direct links aren't practical

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

CSE 333 Lecture server sockets

CSE 333 Lecture server sockets CSE 333 Lecture 17 -- server sockets Hal Perkins Department of Computer Science & Engineering University of Washington Administrivia It s crunch time! HW3 due tomorrow, but lots of work to do still, so...

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

Networking with NSURLSession

Networking with NSURLSession System Frameworks #WWDC15 Networking with NSURLSession Session 711 Luke Case Software Engineer Andreas Garkuscha Software Engineer Dan Vinegrad Software Engineer 2015 Apple Inc. All rights reserved. Redistribution

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

IPv6 Porting Applications

IPv6 Porting Applications IPv6 Porting Applications US IPv6 Summit Dec 8-11, 8 2003 Eva M. Castro eva@gsyc.escet.urjc.es Systems and Communications Group (GSyC( GSyC) Experimental Sciences and Technology Department (ESCET) Rey

More information

SOCKETS. COMP750 Distributed Systems

SOCKETS. COMP750 Distributed Systems SOCKETS COMP750 Distributed Systems Sockets The Socket library is a traditional Application Program Interface (API) to the transport layer. Sockets were originally implemented in Unix systems and have

More information

ELEC / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition

ELEC / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition ELEC / COMP 177 Fall 2014 Some slides from Kurose and Ross, Computer Networking, 5 th Edition Project #1 Starts in one week Is your Linux environment all ready? Bring your laptop Work time after quick

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

Xerox AltaLink Multifunction Printers Deliver Apple AirPrint to the Enterprise. White Paper

Xerox AltaLink Multifunction Printers Deliver Apple AirPrint to the Enterprise. White Paper Xerox AltaLink Multifunction Printers Deliver Apple AirPrint to the Enterprise. White Paper Contents The information presented in this document is divided into the following sections: 3 Executive Summary

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

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

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

A. Basic Function Calls for Network Communications

A. Basic Function Calls for Network Communications IV. Network Programming A. Basic Function Calls for Network Communications 1 B. Settings for Windows Platform (1) Visual C++ 2008 Express Edition (free version) 2 (2) Winsock Header and Libraries Include

More information

UNIX System Programming Lecture 19: IP Sockets

UNIX System Programming Lecture 19: IP Sockets UNIX System Programming Lecture 19: Outline Reference BLP: Chapter 15 man pages: socket, bind, connect, listen, accept, ip(7), ipv6(7), getaddrinfo, getnameinfo 1 Review of UNIX Sockets On the server,

More information

Network Programming November 3, 2008

Network Programming November 3, 2008 15-213 Network Programming November 3, 2008 Topics Programmer s view of the Internet (review) Sockets interface Writing clients and servers class20.ppt A Client-Server Transaction Most network applications

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