Top Banner
NETWORK DISCOVERY WITH SWIFT Alexandre Tavares, iOS Developer at STRV
19

NETWORK DISCOVERY WITH SWIFT

Jul 02, 2022

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: NETWORK DISCOVERY WITH SWIFT

NETWORK DISCOVERY WITH SWIFTAlexandre Tavares iOS Developer at STRV

DNS-SD and mDNS

2

DNS-SDDNS Service Discovery is a way of using standard DNS programming interfaces servers and packet formats to browse the network for services

DNS Service Discovery is compatible with but not dependent on Multicast DNS

3httpwwwdns-sdorg

4

httpswwwmaterialuicomaterialIconshardwarecast_white_576x576png1049697_googlecast_tcp

DNS-SD

_googlecast_tcp

_airplay_tcp

_spotify-connect_tcp

mDNSMulticast DNS is a way of using familiar DNS programming interfaces packet formats and operating semantics in a small network where no conventional DNS server has been installed

5httpwwwmulticastdnsorg

6

macbooklocal

httpswwwmaterialu1049697

printerlocal

televisionlocal

Who is macbooklocal

7

macbooklocal

httpswwwmaterialu1049697

printerlocal

televisionlocal

192168020

macbooklocals IP is 192168020

8

macbooklocal

httpswwwmaterialu1049697

printerlocal

televisionlocalbull _googlecast_tcplocalbull _airplay_tcplocalbull _spotify-connect_tcplocal

bull _ipp_tcplocal

bull _plexmediasvr_tcplocalbull _spotify-connect_tcplocal

any googlecasthere

9

macbooklocal

httpswwwmaterialu1049697

printerlocal

televisionlocalbull _googlecast_tcplocalbull _airplay_tcplocalbull _spotify-connect_tcplocal

bull _ipp_tcplocal

bull _plexmediasvr_tcplocalbull _spotify-connect_tcplocal

yeptelevisionlocal

BONJOURCombines mDNS and DNS-SD to provide zero configuration networking

Also works over P2P bluetooth and WiFi

10

BONJOUR SUPPORT

11

FRAMEWORKS

12

13

FOUNDATION

NetService

SDKsbull iOS 20+bull macOS 102+bull tvOS 90+

NetServiceBrowser

NETWORK

SDKsbull iOS 130+Beta

bull macOS 1015+Beta

bull tvOS 130+Beta

bull watchOS 60+Beta

bull Xcode 110+Beta

SDKsbull iOS 120+bull macOS 1014+bull tvOS 120+bull watchOS 50+bull Xcode 100+

NWListener

NWConnection

NWBrowser

DEMO

14

USAGE

15

HOW TO START

16

NWListener

NWConnection

NWBrowserNetService

NetServiceBrowser

Foundationframework Networkframework

17

httpsgithubcomAlTavaresCiao

THATrsquoS ITAlexandre Tavares

alexandretavaresstrvcom

QUESTIONS

Page 2: NETWORK DISCOVERY WITH SWIFT

DNS-SD and mDNS

2

DNS-SDDNS Service Discovery is a way of using standard DNS programming interfaces servers and packet formats to browse the network for services

DNS Service Discovery is compatible with but not dependent on Multicast DNS

3httpwwwdns-sdorg

4

httpswwwmaterialuicomaterialIconshardwarecast_white_576x576png1049697_googlecast_tcp

DNS-SD

_googlecast_tcp

_airplay_tcp

_spotify-connect_tcp

mDNSMulticast DNS is a way of using familiar DNS programming interfaces packet formats and operating semantics in a small network where no conventional DNS server has been installed

5httpwwwmulticastdnsorg

6

macbooklocal

httpswwwmaterialu1049697

printerlocal

televisionlocal

Who is macbooklocal

7

macbooklocal

httpswwwmaterialu1049697

printerlocal

televisionlocal

192168020

macbooklocals IP is 192168020

8

macbooklocal

httpswwwmaterialu1049697

printerlocal

televisionlocalbull _googlecast_tcplocalbull _airplay_tcplocalbull _spotify-connect_tcplocal

bull _ipp_tcplocal

bull _plexmediasvr_tcplocalbull _spotify-connect_tcplocal

any googlecasthere

9

macbooklocal

httpswwwmaterialu1049697

printerlocal

televisionlocalbull _googlecast_tcplocalbull _airplay_tcplocalbull _spotify-connect_tcplocal

bull _ipp_tcplocal

bull _plexmediasvr_tcplocalbull _spotify-connect_tcplocal

yeptelevisionlocal

BONJOURCombines mDNS and DNS-SD to provide zero configuration networking

Also works over P2P bluetooth and WiFi

10

BONJOUR SUPPORT

11

FRAMEWORKS

12

13

FOUNDATION

NetService

SDKsbull iOS 20+bull macOS 102+bull tvOS 90+

NetServiceBrowser

NETWORK

SDKsbull iOS 130+Beta

bull macOS 1015+Beta

bull tvOS 130+Beta

bull watchOS 60+Beta

bull Xcode 110+Beta

SDKsbull iOS 120+bull macOS 1014+bull tvOS 120+bull watchOS 50+bull Xcode 100+

NWListener

NWConnection

NWBrowser

DEMO

14

USAGE

15

HOW TO START

16

NWListener

NWConnection

NWBrowserNetService

NetServiceBrowser

Foundationframework Networkframework

17

httpsgithubcomAlTavaresCiao

THATrsquoS ITAlexandre Tavares

alexandretavaresstrvcom

QUESTIONS

Page 3: NETWORK DISCOVERY WITH SWIFT

DNS-SDDNS Service Discovery is a way of using standard DNS programming interfaces servers and packet formats to browse the network for services

DNS Service Discovery is compatible with but not dependent on Multicast DNS

3httpwwwdns-sdorg

4

httpswwwmaterialuicomaterialIconshardwarecast_white_576x576png1049697_googlecast_tcp

DNS-SD

_googlecast_tcp

_airplay_tcp

_spotify-connect_tcp

mDNSMulticast DNS is a way of using familiar DNS programming interfaces packet formats and operating semantics in a small network where no conventional DNS server has been installed

5httpwwwmulticastdnsorg

6

macbooklocal

httpswwwmaterialu1049697

printerlocal

televisionlocal

Who is macbooklocal

7

macbooklocal

httpswwwmaterialu1049697

printerlocal

televisionlocal

192168020

macbooklocals IP is 192168020

8

macbooklocal

httpswwwmaterialu1049697

printerlocal

televisionlocalbull _googlecast_tcplocalbull _airplay_tcplocalbull _spotify-connect_tcplocal

bull _ipp_tcplocal

bull _plexmediasvr_tcplocalbull _spotify-connect_tcplocal

any googlecasthere

9

macbooklocal

httpswwwmaterialu1049697

printerlocal

televisionlocalbull _googlecast_tcplocalbull _airplay_tcplocalbull _spotify-connect_tcplocal

bull _ipp_tcplocal

bull _plexmediasvr_tcplocalbull _spotify-connect_tcplocal

yeptelevisionlocal

BONJOURCombines mDNS and DNS-SD to provide zero configuration networking

Also works over P2P bluetooth and WiFi

10

BONJOUR SUPPORT

11

FRAMEWORKS

12

13

FOUNDATION

NetService

SDKsbull iOS 20+bull macOS 102+bull tvOS 90+

NetServiceBrowser

NETWORK

SDKsbull iOS 130+Beta

bull macOS 1015+Beta

bull tvOS 130+Beta

bull watchOS 60+Beta

bull Xcode 110+Beta

SDKsbull iOS 120+bull macOS 1014+bull tvOS 120+bull watchOS 50+bull Xcode 100+

NWListener

NWConnection

NWBrowser

DEMO

14

USAGE

15

HOW TO START

16

NWListener

NWConnection

NWBrowserNetService

NetServiceBrowser

Foundationframework Networkframework

17

httpsgithubcomAlTavaresCiao

THATrsquoS ITAlexandre Tavares

alexandretavaresstrvcom

QUESTIONS

Page 4: NETWORK DISCOVERY WITH SWIFT

4

httpswwwmaterialuicomaterialIconshardwarecast_white_576x576png1049697_googlecast_tcp

DNS-SD

_googlecast_tcp

_airplay_tcp

_spotify-connect_tcp

mDNSMulticast DNS is a way of using familiar DNS programming interfaces packet formats and operating semantics in a small network where no conventional DNS server has been installed

5httpwwwmulticastdnsorg

6

macbooklocal

httpswwwmaterialu1049697

printerlocal

televisionlocal

Who is macbooklocal

7

macbooklocal

httpswwwmaterialu1049697

printerlocal

televisionlocal

192168020

macbooklocals IP is 192168020

8

macbooklocal

httpswwwmaterialu1049697

printerlocal

televisionlocalbull _googlecast_tcplocalbull _airplay_tcplocalbull _spotify-connect_tcplocal

bull _ipp_tcplocal

bull _plexmediasvr_tcplocalbull _spotify-connect_tcplocal

any googlecasthere

9

macbooklocal

httpswwwmaterialu1049697

printerlocal

televisionlocalbull _googlecast_tcplocalbull _airplay_tcplocalbull _spotify-connect_tcplocal

bull _ipp_tcplocal

bull _plexmediasvr_tcplocalbull _spotify-connect_tcplocal

yeptelevisionlocal

BONJOURCombines mDNS and DNS-SD to provide zero configuration networking

Also works over P2P bluetooth and WiFi

10

BONJOUR SUPPORT

11

FRAMEWORKS

12

13

FOUNDATION

NetService

SDKsbull iOS 20+bull macOS 102+bull tvOS 90+

NetServiceBrowser

NETWORK

SDKsbull iOS 130+Beta

bull macOS 1015+Beta

bull tvOS 130+Beta

bull watchOS 60+Beta

bull Xcode 110+Beta

SDKsbull iOS 120+bull macOS 1014+bull tvOS 120+bull watchOS 50+bull Xcode 100+

NWListener

NWConnection

NWBrowser

DEMO

14

USAGE

15

HOW TO START

16

NWListener

NWConnection

NWBrowserNetService

NetServiceBrowser

Foundationframework Networkframework

17

httpsgithubcomAlTavaresCiao

THATrsquoS ITAlexandre Tavares

alexandretavaresstrvcom

QUESTIONS

Page 5: NETWORK DISCOVERY WITH SWIFT

mDNSMulticast DNS is a way of using familiar DNS programming interfaces packet formats and operating semantics in a small network where no conventional DNS server has been installed

5httpwwwmulticastdnsorg

6

macbooklocal

httpswwwmaterialu1049697

printerlocal

televisionlocal

Who is macbooklocal

7

macbooklocal

httpswwwmaterialu1049697

printerlocal

televisionlocal

192168020

macbooklocals IP is 192168020

8

macbooklocal

httpswwwmaterialu1049697

printerlocal

televisionlocalbull _googlecast_tcplocalbull _airplay_tcplocalbull _spotify-connect_tcplocal

bull _ipp_tcplocal

bull _plexmediasvr_tcplocalbull _spotify-connect_tcplocal

any googlecasthere

9

macbooklocal

httpswwwmaterialu1049697

printerlocal

televisionlocalbull _googlecast_tcplocalbull _airplay_tcplocalbull _spotify-connect_tcplocal

bull _ipp_tcplocal

bull _plexmediasvr_tcplocalbull _spotify-connect_tcplocal

yeptelevisionlocal

BONJOURCombines mDNS and DNS-SD to provide zero configuration networking

Also works over P2P bluetooth and WiFi

10

BONJOUR SUPPORT

11

FRAMEWORKS

12

13

FOUNDATION

NetService

SDKsbull iOS 20+bull macOS 102+bull tvOS 90+

NetServiceBrowser

NETWORK

SDKsbull iOS 130+Beta

bull macOS 1015+Beta

bull tvOS 130+Beta

bull watchOS 60+Beta

bull Xcode 110+Beta

SDKsbull iOS 120+bull macOS 1014+bull tvOS 120+bull watchOS 50+bull Xcode 100+

NWListener

NWConnection

NWBrowser

DEMO

14

USAGE

15

HOW TO START

16

NWListener

NWConnection

NWBrowserNetService

NetServiceBrowser

Foundationframework Networkframework

17

httpsgithubcomAlTavaresCiao

THATrsquoS ITAlexandre Tavares

alexandretavaresstrvcom

QUESTIONS

Page 6: NETWORK DISCOVERY WITH SWIFT

6

macbooklocal

httpswwwmaterialu1049697

printerlocal

televisionlocal

Who is macbooklocal

7

macbooklocal

httpswwwmaterialu1049697

printerlocal

televisionlocal

192168020

macbooklocals IP is 192168020

8

macbooklocal

httpswwwmaterialu1049697

printerlocal

televisionlocalbull _googlecast_tcplocalbull _airplay_tcplocalbull _spotify-connect_tcplocal

bull _ipp_tcplocal

bull _plexmediasvr_tcplocalbull _spotify-connect_tcplocal

any googlecasthere

9

macbooklocal

httpswwwmaterialu1049697

printerlocal

televisionlocalbull _googlecast_tcplocalbull _airplay_tcplocalbull _spotify-connect_tcplocal

bull _ipp_tcplocal

bull _plexmediasvr_tcplocalbull _spotify-connect_tcplocal

yeptelevisionlocal

BONJOURCombines mDNS and DNS-SD to provide zero configuration networking

Also works over P2P bluetooth and WiFi

10

BONJOUR SUPPORT

11

FRAMEWORKS

12

13

FOUNDATION

NetService

SDKsbull iOS 20+bull macOS 102+bull tvOS 90+

NetServiceBrowser

NETWORK

SDKsbull iOS 130+Beta

bull macOS 1015+Beta

bull tvOS 130+Beta

bull watchOS 60+Beta

bull Xcode 110+Beta

SDKsbull iOS 120+bull macOS 1014+bull tvOS 120+bull watchOS 50+bull Xcode 100+

NWListener

NWConnection

NWBrowser

DEMO

14

USAGE

15

HOW TO START

16

NWListener

NWConnection

NWBrowserNetService

NetServiceBrowser

Foundationframework Networkframework

17

httpsgithubcomAlTavaresCiao

THATrsquoS ITAlexandre Tavares

alexandretavaresstrvcom

QUESTIONS

Page 7: NETWORK DISCOVERY WITH SWIFT

7

macbooklocal

httpswwwmaterialu1049697

printerlocal

televisionlocal

192168020

macbooklocals IP is 192168020

8

macbooklocal

httpswwwmaterialu1049697

printerlocal

televisionlocalbull _googlecast_tcplocalbull _airplay_tcplocalbull _spotify-connect_tcplocal

bull _ipp_tcplocal

bull _plexmediasvr_tcplocalbull _spotify-connect_tcplocal

any googlecasthere

9

macbooklocal

httpswwwmaterialu1049697

printerlocal

televisionlocalbull _googlecast_tcplocalbull _airplay_tcplocalbull _spotify-connect_tcplocal

bull _ipp_tcplocal

bull _plexmediasvr_tcplocalbull _spotify-connect_tcplocal

yeptelevisionlocal

BONJOURCombines mDNS and DNS-SD to provide zero configuration networking

Also works over P2P bluetooth and WiFi

10

BONJOUR SUPPORT

11

FRAMEWORKS

12

13

FOUNDATION

NetService

SDKsbull iOS 20+bull macOS 102+bull tvOS 90+

NetServiceBrowser

NETWORK

SDKsbull iOS 130+Beta

bull macOS 1015+Beta

bull tvOS 130+Beta

bull watchOS 60+Beta

bull Xcode 110+Beta

SDKsbull iOS 120+bull macOS 1014+bull tvOS 120+bull watchOS 50+bull Xcode 100+

NWListener

NWConnection

NWBrowser

DEMO

14

USAGE

15

HOW TO START

16

NWListener

NWConnection

NWBrowserNetService

NetServiceBrowser

Foundationframework Networkframework

17

httpsgithubcomAlTavaresCiao

THATrsquoS ITAlexandre Tavares

alexandretavaresstrvcom

QUESTIONS

Page 8: NETWORK DISCOVERY WITH SWIFT

8

macbooklocal

httpswwwmaterialu1049697

printerlocal

televisionlocalbull _googlecast_tcplocalbull _airplay_tcplocalbull _spotify-connect_tcplocal

bull _ipp_tcplocal

bull _plexmediasvr_tcplocalbull _spotify-connect_tcplocal

any googlecasthere

9

macbooklocal

httpswwwmaterialu1049697

printerlocal

televisionlocalbull _googlecast_tcplocalbull _airplay_tcplocalbull _spotify-connect_tcplocal

bull _ipp_tcplocal

bull _plexmediasvr_tcplocalbull _spotify-connect_tcplocal

yeptelevisionlocal

BONJOURCombines mDNS and DNS-SD to provide zero configuration networking

Also works over P2P bluetooth and WiFi

10

BONJOUR SUPPORT

11

FRAMEWORKS

12

13

FOUNDATION

NetService

SDKsbull iOS 20+bull macOS 102+bull tvOS 90+

NetServiceBrowser

NETWORK

SDKsbull iOS 130+Beta

bull macOS 1015+Beta

bull tvOS 130+Beta

bull watchOS 60+Beta

bull Xcode 110+Beta

SDKsbull iOS 120+bull macOS 1014+bull tvOS 120+bull watchOS 50+bull Xcode 100+

NWListener

NWConnection

NWBrowser

DEMO

14

USAGE

15

HOW TO START

16

NWListener

NWConnection

NWBrowserNetService

NetServiceBrowser

Foundationframework Networkframework

17

httpsgithubcomAlTavaresCiao

THATrsquoS ITAlexandre Tavares

alexandretavaresstrvcom

QUESTIONS

Page 9: NETWORK DISCOVERY WITH SWIFT

9

macbooklocal

httpswwwmaterialu1049697

printerlocal

televisionlocalbull _googlecast_tcplocalbull _airplay_tcplocalbull _spotify-connect_tcplocal

bull _ipp_tcplocal

bull _plexmediasvr_tcplocalbull _spotify-connect_tcplocal

yeptelevisionlocal

BONJOURCombines mDNS and DNS-SD to provide zero configuration networking

Also works over P2P bluetooth and WiFi

10

BONJOUR SUPPORT

11

FRAMEWORKS

12

13

FOUNDATION

NetService

SDKsbull iOS 20+bull macOS 102+bull tvOS 90+

NetServiceBrowser

NETWORK

SDKsbull iOS 130+Beta

bull macOS 1015+Beta

bull tvOS 130+Beta

bull watchOS 60+Beta

bull Xcode 110+Beta

SDKsbull iOS 120+bull macOS 1014+bull tvOS 120+bull watchOS 50+bull Xcode 100+

NWListener

NWConnection

NWBrowser

DEMO

14

USAGE

15

HOW TO START

16

NWListener

NWConnection

NWBrowserNetService

NetServiceBrowser

Foundationframework Networkframework

17

httpsgithubcomAlTavaresCiao

THATrsquoS ITAlexandre Tavares

alexandretavaresstrvcom

QUESTIONS

Page 10: NETWORK DISCOVERY WITH SWIFT

BONJOURCombines mDNS and DNS-SD to provide zero configuration networking

Also works over P2P bluetooth and WiFi

10

BONJOUR SUPPORT

11

FRAMEWORKS

12

13

FOUNDATION

NetService

SDKsbull iOS 20+bull macOS 102+bull tvOS 90+

NetServiceBrowser

NETWORK

SDKsbull iOS 130+Beta

bull macOS 1015+Beta

bull tvOS 130+Beta

bull watchOS 60+Beta

bull Xcode 110+Beta

SDKsbull iOS 120+bull macOS 1014+bull tvOS 120+bull watchOS 50+bull Xcode 100+

NWListener

NWConnection

NWBrowser

DEMO

14

USAGE

15

HOW TO START

16

NWListener

NWConnection

NWBrowserNetService

NetServiceBrowser

Foundationframework Networkframework

17

httpsgithubcomAlTavaresCiao

THATrsquoS ITAlexandre Tavares

alexandretavaresstrvcom

QUESTIONS

Page 11: NETWORK DISCOVERY WITH SWIFT

BONJOUR SUPPORT

11

FRAMEWORKS

12

13

FOUNDATION

NetService

SDKsbull iOS 20+bull macOS 102+bull tvOS 90+

NetServiceBrowser

NETWORK

SDKsbull iOS 130+Beta

bull macOS 1015+Beta

bull tvOS 130+Beta

bull watchOS 60+Beta

bull Xcode 110+Beta

SDKsbull iOS 120+bull macOS 1014+bull tvOS 120+bull watchOS 50+bull Xcode 100+

NWListener

NWConnection

NWBrowser

DEMO

14

USAGE

15

HOW TO START

16

NWListener

NWConnection

NWBrowserNetService

NetServiceBrowser

Foundationframework Networkframework

17

httpsgithubcomAlTavaresCiao

THATrsquoS ITAlexandre Tavares

alexandretavaresstrvcom

QUESTIONS

Page 12: NETWORK DISCOVERY WITH SWIFT

FRAMEWORKS

12

13

FOUNDATION

NetService

SDKsbull iOS 20+bull macOS 102+bull tvOS 90+

NetServiceBrowser

NETWORK

SDKsbull iOS 130+Beta

bull macOS 1015+Beta

bull tvOS 130+Beta

bull watchOS 60+Beta

bull Xcode 110+Beta

SDKsbull iOS 120+bull macOS 1014+bull tvOS 120+bull watchOS 50+bull Xcode 100+

NWListener

NWConnection

NWBrowser

DEMO

14

USAGE

15

HOW TO START

16

NWListener

NWConnection

NWBrowserNetService

NetServiceBrowser

Foundationframework Networkframework

17

httpsgithubcomAlTavaresCiao

THATrsquoS ITAlexandre Tavares

alexandretavaresstrvcom

QUESTIONS

Page 13: NETWORK DISCOVERY WITH SWIFT

13

FOUNDATION

NetService

SDKsbull iOS 20+bull macOS 102+bull tvOS 90+

NetServiceBrowser

NETWORK

SDKsbull iOS 130+Beta

bull macOS 1015+Beta

bull tvOS 130+Beta

bull watchOS 60+Beta

bull Xcode 110+Beta

SDKsbull iOS 120+bull macOS 1014+bull tvOS 120+bull watchOS 50+bull Xcode 100+

NWListener

NWConnection

NWBrowser

DEMO

14

USAGE

15

HOW TO START

16

NWListener

NWConnection

NWBrowserNetService

NetServiceBrowser

Foundationframework Networkframework

17

httpsgithubcomAlTavaresCiao

THATrsquoS ITAlexandre Tavares

alexandretavaresstrvcom

QUESTIONS

Page 14: NETWORK DISCOVERY WITH SWIFT

DEMO

14

USAGE

15

HOW TO START

16

NWListener

NWConnection

NWBrowserNetService

NetServiceBrowser

Foundationframework Networkframework

17

httpsgithubcomAlTavaresCiao

THATrsquoS ITAlexandre Tavares

alexandretavaresstrvcom

QUESTIONS

Page 15: NETWORK DISCOVERY WITH SWIFT

USAGE

15

HOW TO START

16

NWListener

NWConnection

NWBrowserNetService

NetServiceBrowser

Foundationframework Networkframework

17

httpsgithubcomAlTavaresCiao

THATrsquoS ITAlexandre Tavares

alexandretavaresstrvcom

QUESTIONS

Page 16: NETWORK DISCOVERY WITH SWIFT

HOW TO START

16

NWListener

NWConnection

NWBrowserNetService

NetServiceBrowser

Foundationframework Networkframework

17

httpsgithubcomAlTavaresCiao

THATrsquoS ITAlexandre Tavares

alexandretavaresstrvcom

QUESTIONS

Page 17: NETWORK DISCOVERY WITH SWIFT

17

httpsgithubcomAlTavaresCiao

THATrsquoS ITAlexandre Tavares

alexandretavaresstrvcom

QUESTIONS

Page 18: NETWORK DISCOVERY WITH SWIFT

THATrsquoS ITAlexandre Tavares

alexandretavaresstrvcom

QUESTIONS

Page 19: NETWORK DISCOVERY WITH SWIFT

QUESTIONS