EEC-492/693/793 iPhone Application Development

Slides:



Advertisements
Similar presentations
Intermediate TCP/IP TCP Operation.
Advertisements

S305 – Network Infrastructure Chapter 5 Network and Transport Layers Part 2.
SUPE z2z: Discovering Zeroconf Services Beyond Local Link Jae Woo Lee, Henning Schulzrinne Columbia University Wolfgang Kellerer, Zoran Despotovic.
Understanding Networks. Objectives Compare client and network operating systems Learn about local area network technologies, including Ethernet, Token.
1 Chapter Overview Introduction to Windows XP Professional Printing Setting Up Network Printers Connecting to Network Printers Configuring Network Printers.
Network Layer (Part IV). Overview A router is a type of internetworking device that passes data packets between networks based on Layer 3 addresses. A.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Application Layer Functionality and Protocols Network Fundamentals – Chapter 3.
Network Protocols. Why Protocols?  Rules and procedures to govern communication Some for transferring data Some for transferring data Some for route.
Chapter 17 Domain Name System
Zero Configuration Networking Sander Temme. Agenda What is Zero Configuration Networking Demonstration Description of Protocols Available Implementations.
COMT 6251 Network Layers COMT Overview IP and general Internet Operations Address Mapping ATM LANs Other network protocols.
Part 3: Internetworking Internet architecture, addressing, encapsulation, reliable transport and the TCP/IP protocol suite.
1 Kyung Hee University Chapter 18 Domain Name System.
Application Block Diagram III. SOFTWARE PLATFORM Figure above shows a network protocol stack for a computer that connects to an Ethernet network and.
Data Communications and Networks Chapter 5 – Network Services DNS, DHCP, FTP and SMTP ICT-BVF8.1- Data Communications and Network Trainer: Dr. Abbes Sebihi.
DHCP Meha Modi. “Dynamic Host Configuration Protocol” Automatically assigns IP addresses to devices (I.e. hosts) on your network. -Prevents to enter data.
Transport Layer3-1 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet.
7DS - Node Cooperation and Information Exchange in Mostly Disconnected Networks Suman Srinivasan, Arezu Moghadam, Se Gi Hong, Henning Schulzrinne IRT Lab,
Copyright © 2006 Heathkit Company, Inc. All Rights Reserved Introduction to Networking Technologies Dynamic Host Configuration Protocol (DHCP)
Chapter 4: server services. The Complete Guide to Linux System Administration2 Objectives Configure network interfaces using command- line and graphical.
IST 201 Chapter 11 Lecture 2. Ports Used by TCP & UDP Keep track of different types of transmissions crossing the network simultaneously. Combination.
Cisco I Introduction to Networks Semester 1 Chapter 3 JEOPADY.
Domain Name System: DNS To identify an entity, TCP/IP protocols use the IP address, which uniquely identifies the Connection of a host to the Internet.
System Administration(SAD622S) Name of Presenter: Shadreck Chitauro Lecturer 18 July 2016 Faculty of Computing and Informatics.
Some Network Commands n Some useful network commands –ping –finger –nslookup –tracert –ipconfig.
Chapter TCP/IP in the Windows Environment © N. Ganesan, Ph.D., All rights reserved.
Unit 7: DHCP, APIPA and NTP. Static versus dynamic IP addressing Dynamic IP addresses can change each time you connect to the Internet, while static IP.
Dynamic Host Configuration Protocol
Dynamic Host Configuration Protocol
Network Protocols Transmission Control Protocol/Internet Protocol (TCP/IP) Asynchronous Transfer Mode (ATM) NWLink NetBIOS Enhanced User Interface (NetBEUI)
Chapter 5 Network and Transport Layers
COMPUTER NETWORKS CS610 Lecture-27 Hammad Khalid Khan.
CS 372 COMPUTER COMMUNICATION AND NETWORKS
More on WANs Fiber Optic Cables Used in Internet backbone
Unit 28 Website Production
Domain Name System DNS - A system for converting host names and domain names into IP addresses on the Internet or on local networks that use the TCP/IP.
Module 8: Networking Services
Domain Name System (DNS)
Implementing TCP/IP.
“Size of DNS” Size of the DNS can be describe from the time before it was created all the computer on a network used to receive a host file named HOST.TXT,
Network Load Balancing
EA C451 Vishal Gupta.
SUBMITTED BY: NAIMISHYA ATRI(7TH SEM) IT BRANCH
IPSec VPN Chapter 13 of Malik.
Introduction to Computers
Net 431: ADVANCED COMPUTER NETWORKS
Subject Name: Computer Communication Networks Subject Code: 10EC71
Chapter 3: Windows7 Part 4.
Net 431 D: ADVANCED COMPUTER NETWORKS
Chapter 5 Network and Transport Layers
How Data Flows through the Internet
Name and Address Conversions Part I
Process-to-Process Delivery:
Wide Area Networks and Internet CT1403
Network Hardware and Protocols
TCP/IP Protocol Suite: Review
EEC-492/693/793 iPhone Application Development
JINI ICS 243F- Distributed Systems Middleware, Spring 2001
Allocating IP Addressing by Using Dynamic Host Configuration Protocol
Overview Multimedia: The Role of DHCP in the Network Infrastructure
World Wide Web Uniform Resource Locator hostname [:port]/path
CS4470 Computer Networking Protocols
Applications Layer Functionality & Protocols
APACHE WEB SERVER.
Process-to-Process Delivery: UDP, TCP
Computer Networks Protocols
Data Communications and Networks
Review of Internet Protocols Network Layer
Exceptions and networking
Presentation transcript:

EEC-492/693/793 iPhone Application Development Lecture 14 Wenbing Zhao & Nigamanth Sridhar 2/15/2019 EEC492/693/793 - iPhone Application Development

Outline Bonjour Programming Assignments: Publish a service on the network Discover services on the network Resolve IP address of services on the network Assignments: Build the Bonjour app (based on the handout) 2/15/2019 2/15/2019 EEC492/693/793 - iPhone Application Development EEC492/693/793 - iPhone Application Development 2

EEC492/693/793 - iPhone Application Development Bonjour Three main functions: Automate address distribution and name mapping Publish availability of a service Discover available services Open protocol Apple submitted to IETF www.zeroconf.org Sqlite3_bind_text, beyond the first 3 parameters: The first is the length of the data being passed in the third parameter. In the case of C strings, you can pass -1 instead of the string’s length, and the function will use the entire string. In all other cases, you have to tell it the length of the data being passed int. The final parameter is an optional function callback in case you need to do any memory cleanup after the statement is executed 2/15/2019 EEC492/693/793 - iPhone Application Development

EEC492/693/793 - iPhone Application Development Bonjour Makes LANs self configuring Requires no administration Assign addresses without a DHCP server Map names to addresses without a DNS server Find services without a directory server 2/15/2019 EEC492/693/793 - iPhone Application Development

EEC492/693/793 - iPhone Application Development Automatic Addressing Bonjour will pick a random address, see if it is in use If it is not in use, it’s yours If it is in use, try again Uses “.local.” as a virtual top-level domain For example: iPhone3G.local. 2/15/2019 EEC492/693/793 - iPhone Application Development

EEC492/693/793 - iPhone Application Development Advertising Services Applications provide a service name and port Follows same DNS specific-to-general model ServiceName._ServiceType._TransportProtocolName.Domain Service Name is a human readable descriptive name Maximum of 63 octets of UTF-8 All characters are allowed Service Type is an IANA registered protocol name Maximum of fourteen characters Format of [a-z0-9]([a-z0-9\-]*[a-z0-9])? Transport Protocol Name is either TCP or UDP 2/15/2019 EEC492/693/793 - iPhone Application Development

EEC492/693/793 - iPhone Application Development Service Naming Canon MP780._ipp._tcp.local. Canon MP780: Service name ipp: Service type (Internet printing protocol) tcp: transport protocol local.: top level domain 2/15/2019 EEC492/693/793 - iPhone Application Development

EEC492/693/793 - iPhone Application Development Publishing a Service NSNetService is used to publish services via Bonjour NSNetService *service; service = [[NSNetService alloc] initWithDomain:@”” type:@”_ipp._tcp” name:@”Canon MP780” port:4721]; Leaving domain blank implies “.local.” Leaving name blank will use the device’s iTunes name 2/15/2019 EEC492/693/793 - iPhone Application Development

EEC492/693/793 - iPhone Application Development Publishing a Service NSNetService is entirely asynchronous // Set up delegate to receive callbacks [service setDelegate:self]; // or: server.delegate = self; [service publish]; Always remember to unset the delegate in dealloc! - (void)dealloc { [service setDelegate:nil]; [service stop]; [service release]; [super dealloc]; } 2/15/2019 EEC492/693/793 - iPhone Application Development

NSNetService Delegate Methods Conflict resolution handled automatically Status is communicated to the delegate - (void)netServiceWillPublish:(NSNetService *)sender - (void)netServiceDidPublish:(NSNetService *)sender - (void)netService:(NSNetService *)sender didNotPublish:(NSDictionary *)errorDict errorDict is like an NSError - has two keys, one for error domain and one for error code. 2/15/2019 EEC492/693/793 - iPhone Application Development

EEC492/693/793 - iPhone Application Development Finding a Service Applications register service names with local daemon which handles responding to lookup queries Service discovery is completely independent of service implementation Resolving a service gives you an address and a port Can also get NSStreams pointing to that location 2/15/2019 EEC492/693/793 - iPhone Application Development

EEC492/693/793 - iPhone Application Development Finding a Service NSNetServiceBrowser is used to search for services on the network NSNetServiceBrowser *browser; browser = [[NSNetServiceBrowser alloc] init]; [browser setDelegate:self]; [browser searchForServicesOfType:@”_ipp._tcp.” inDomain:@””]; 2/15/2019 EEC492/693/793 - iPhone Application Development

NSNetServiceBrowser Delegate Methods NSNetServiceBrowser browsing is also asynchronous Delegate methods called as services come and go - (void)netServiceBrowserWillSearch:(NSNetServiceBrowser *)browser - (void)netServiceBrowserDidStopSearch:(NSNetServiceBrowser *)browser - (void)netServiceBrowser:(NSNetServiceBrowser *)browser didNotSearch:(NSDictionary *)errorInfo didFindService:(NSNetService *)service moreComing:(BOOL)more didRemoveService:(NSNetService *)service 2/15/2019 EEC492/693/793 - iPhone Application Development

EEC492/693/793 - iPhone Application Development Service Resolution NSNetServices found by NSNetServiceBrowser must have their addresses resolved before use: [netService setDelegate:self]; [netService resolveWithTimeout:5]; Status communicated asynchronously to delegate: - (void)netService:(NSNetService *)sender didNotResolve:(NSDictionary *)errorDict; Same errorDict as before - (void)netServiceDidResolveAddress:(NSNetService *)sender; Once a service has been resolved you can use the address information to connect to it 2/15/2019 EEC492/693/793 - iPhone Application Development