Bonjour Sleep Proxy

Last updated

Apple's Bonjour Sleep Proxy service is an open source [1] component of zero-configuration networking, designed to assist in reducing power consumption of networked electronic devices. [2] It allows a device providing services, such as file sharing, printer sharing, or remote log-in, to sleep, i.e. enter a low-power mode, while its services remain available, even world-wide, by registering with a sleep proxy server on the local network. The sleep proxy server continues to both advertise the services on the local network on behalf of the sleep host, and listen for incoming connections whether the services are available only locally or across the Internet. When any device attempts to use any proxied service, the proxy server wakes the sleeping device and the service works as if the sleeping device had remained fully powered.

Contents

Any device that can act as a sleep proxy server advertises this on all LANs of which it is a part. A device providing network services, such as file sharing, when its services are not actively being used can register its services with an available sleep proxy server and sleep until one of its services is needed. The sleep proxy server continues to advertise the services in Multicast DNS (mDNS) on behalf of the sleeping host. [2] When the sleep proxy server sees an attempt to use any such service it wakes the sleeping host and the service proceeds normally, and in the case of SSH, a server with an active session can register with a proxy, sleep, and be awakened with the next received packet, continuing the same session. [3] [2]

Apple refers to the service as Bonjour Sleep Proxy in its support documents. [4] The service uses the Wake on Demand feature, first offered in Mac OS X Snow Leopard. [5]

Details

Address Resolution Protocol and Neighbor Discovery Protocol

When a sleep proxy service accepts a request to proxy, it in effect takes over the IP addresses of proxied servers by announcing this through Address Resolution Protocol (ARP) and Neighbor Discovery Protocol (NDP). To claim traffic for the proxied host’s IPv4 addresses, it sends gratuitous ARP announcements so that packets addressed to the proxied server go to the proxy instead, and for IPv6 it does the same using the analogous NDP. To maintain the association, it responds on behalf of the sleeping host to ARP and NDP requests. This process effectively maps the IP addresses of proxied servers to a physical port of the proxy server.

When a packet arrives, from anywhere on the Internet, for a proxied service, the sleep proxy server wakes the sleeping host and reverses the above process, using ARP and NDP again to re-associate the same IP addresses with the proper machine, and any service proceeds as if the server had not slept.

This may appear confusing to network administrators who are not expecting the behaviour of changing MAC addresses.

Wake-on-LAN and magic packets

The method by which a sleep proxy server wakes a sleeping host is wake-on-LAN . The network interface of a sleeping host with this capability will wake the machine when it receives a specific series of bits, and a packet containing this pattern is a magic packet . Early implementations of Wake on LAN (WoL) required wired network interfaces. In the wireless case (Wi‑Fi), the wake-up packet is sent via Wireless Multimedia Extensions (WMM). [5] In either case the function must be supported by the network interface. Apple provides instructions for checking compatibility with this feature for Macintosh computers. [4]

Supported services and examples

The sleep proxy service is able to advertise any Bonjour-supported services, while the host computer sleeps. Some examples of supported services are: [4]

Implementations

Implementations on a local area network can be seen with Bonjour Browser.

Related Research Articles

AppleTalk is a discontinued proprietary suite of networking protocols developed by Apple Computer for their Macintosh computers. AppleTalk includes a number of features that allow local area networks to be connected with no prior setup or the need for a centralized router or server of any sort. Connected AppleTalk-equipped systems automatically assign addresses, update the distributed namespace, and configure any required inter-networking routing.

<span class="mw-page-title-main">Wake-on-LAN</span> Mechanism to wake up computers via a network

Wake-on-LAN is an Ethernet or Token Ring computer networking standard that allows a computer to be turned on or awakened from sleep mode by a network message.

<span class="mw-page-title-main">Mac OS X Server</span> Server software for macOS

Mac OS X Server is a series of discontinued Unix-like server operating systems developed by Apple Inc. based on macOS. It provided server functionality and system administration tools, and tools to manage both macOS-based computers and iOS-based devices, network services such as a mail transfer agent, AFP and SMB servers, an LDAP server, and a domain name server, as well as server applications including a Web server, database, and calendar server.

The Address Resolution Protocol (ARP) is a communication protocol used for discovering the link layer address, such as a MAC address, associated with a given internet layer address, typically an IPv4 address. This mapping is a critical function in the Internet protocol suite. ARP was defined in 1982 by RFC 826, which is Internet Standard STD 37.

Proxy ARP is a technique by which a proxy server on a given network answers the Address Resolution Protocol (ARP) queries for an IP address that is not on that network. The proxy is aware of the location of the traffic's destination and offers its own MAC address as the destination. The traffic directed to the proxy address is then typically routed by the proxy to the intended destination via another interface or via a tunnel.

<span class="mw-page-title-main">Bonjour (software)</span> Computer networking technology

Bonjour is Apple's implementation of zero-configuration networking (zeroconf), a group of technologies that includes service discovery, address assignment, and hostname resolution. Bonjour locates devices such as printers, other computers, and the services that those devices offer on a local network using multicast Domain Name System (mDNS) service records.

Zero-configuration networking (zeroconf) is a set of technologies that automatically creates a usable computer network based on the Internet Protocol Suite (TCP/IP) when computers or network peripherals are interconnected. It does not require manual operator intervention or special configuration servers. Without zeroconf, a network administrator must set up network services, such as Dynamic Host Configuration Protocol (DHCP) and Domain Name System (DNS), or configure each computer's network settings manually.

<span class="mw-page-title-main">ARP spoofing</span> Cyberattack which associates the attackers MAC address with the IP address of another host

In computer networking, ARP spoofing, ARP cache poisoning, or ARP poison routing, is a technique by which an attacker sends (spoofed) Address Resolution Protocol (ARP) messages onto a local area network. Generally, the aim is to associate the attacker's MAC address with the IP address of another host, such as the default gateway, causing any traffic meant for that IP address to be sent to the attacker instead.

The Apple Filing Protocol (AFP), formerly AppleTalk Filing Protocol, is a proprietary network protocol, and part of the Apple File Service (AFS), that offers file services for macOS, classic Mac OS, and Apple II computers. In OS X 10.8 Mountain Lion and earlier, AFP was the primary protocol for file services. Starting with OS X 10.9 Mavericks, Server Message Block (SMB) was made the primary file sharing protocol, with the ability to run an AFP server removed later in macOS 11 Big Sur. AFP supports Unicode file names, POSIX and access-control list permissions, resource forks, named extended attributes, and advanced file locking.

<span class="mw-page-title-main">Port forwarding</span> Computer networking feature

In computer networking, port forwarding or port mapping is an application of network address translation (NAT) that redirects a communication request from one address and port number combination to another while the packets are traversing a network gateway, such as a router or firewall. This technique is most commonly used to make services on a host residing on a protected or masqueraded (internal) network available to hosts on the opposite side of the gateway, by remapping the destination IP address and port number of the communication to an internal host.

An application firewall is a form of firewall that controls input/output or system calls of an application or service. It operates by monitoring and blocking communications based on a configured policy, generally with predefined rule sets to choose from. The two primary categories of application firewalls are network-based and host-based.

In computer networks, a tunneling protocol is a communication protocol which allows for the movement of data from one network to another. It can, for example, allow private network communications to be sent across a public network, or for one network protocol to be carried over an incompatible network, through a process called encapsulation.

<span class="mw-page-title-main">Ettercap (software)</span> Network traffic analysis and interception software

Ettercap is a free and open source network security tool for man-in-the-middle attacks on a LAN. It can be used for computer network protocol analysis and security auditing. It runs on various Unix-like operating systems including Linux, Mac OS X, BSD and Solaris, and on Microsoft Windows. It is capable of intercepting traffic on a network segment, capturing passwords, and conducting active eavesdropping against a number of common protocols. Its original developers later founded Hacking Team.

The Neighbor Discovery Protocol (NDP), or simply Neighbor Discovery (ND), is a protocol of the Internet protocol suite used with Internet Protocol Version 6 (IPv6). It operates at the internet layer of the Internet model, and is responsible for gathering various information required for network communication, including the configuration of local connections and the domain name servers and gateways.

<span class="mw-page-title-main">Sleep mode</span> Low power mode for electronic devices

Sleep mode is a low power mode for electronic devices such as computers, televisions, and remote controlled devices. These modes save significantly on electrical consumption compared to leaving a device fully on and, upon resume, allow the user to avoid having to reissue instructions or to wait for a machine to boot. Many devices signify this power mode with a pulsed or red colored LED power light.

In computer networking, the multicast DNS (mDNS) protocol resolves hostnames to IP addresses within small networks that do not include a local name server. It is a zero-configuration service, using essentially the same programming interfaces, packet formats and operating semantics as unicast Domain Name System (DNS). It was designed to work as either a stand-alone protocol or compatible with standard DNS servers. It uses IP multicast User Datagram Protocol (UDP) packets and is implemented by the Apple Bonjour and open-source Avahi software packages, included in most Linux distributions. Although the Windows 10 implementation was limited to discovering networked printers, subsequent releases resolved hostnames as well. mDNS can work in conjunction with DNS Service Discovery (DNS-SD), a companion zero-configuration networking technique specified separately in RFC 6763.

The domain name .local is a special-use domain name reserved by the Internet Engineering Task Force (IETF) so that it may not be installed as a top-level domain in the Domain Name System (DNS) of the Internet. As such it is similar to the other special domain names, such as .localhost. However, .local has since been designated for use in link-local networking, in applications of multicast DNS (mDNS) and zero-configuration networking (zeroconf) so that DNS service may be established without local installations of conventional DNS infrastructure on local area networks.

<span class="mw-page-title-main">Mac OS X Snow Leopard</span> Seventh major version of macOS, released in 2009

Mac OS X Snow Leopard is the seventh major release of macOS, Apple's desktop and server operating system for Macintosh computers.

<span class="mw-page-title-main">AirPort Time Capsule</span> Wireless router by Apple

The AirPort Time Capsule is a wireless router which was sold by Apple Inc., featuring network-attached storage (NAS) and a residential gateway router, and is one of Apple's AirPort products. They are, essentially, versions of the AirPort Extreme with an internal hard drive. Apple describes it as a "Backup Appliance", designed to work in tandem with the Time Machine backup software utility introduced in Mac OS X 10.5.

References

  1. Note: see mDNSResponder source code at www.macosforge.org, which includes a full implementation of the DNS-SD/mDNS Sleep Proxy Service, available under the Apache 2.0 Open Source license.
  2. 1 2 3 Marc Krochmal (2010-03-23). "Internet Draft: draft-cheshire-dnsext-multicastdns-11". Apple Inc. Retrieved 2010-05-30.
  3. Cheshire, Stuart (December 2009). "Understanding Sleep Proxy Service". Stuart Cheshire. Retrieved 2024-04-11.
  4. 1 2 3 4 5 6 "Mac OS X v10.6: About Wake on Demand (Apple Article HT3774)". Apple. 2009-08-27. Retrieved 2009-09-15. Setting up Wake on Demand", "Setting up a Bonjour Sleep Proxy
  5. 1 2 Glenn Fleishman (2009-08-28). "Wake on Demand lets Snow Leopard sleep with one eye open". Macworld.com. Archived from the original on 2009-09-16. Retrieved 2009-09-15. How it works", "Energy Saver preference pane
  6. Apple Inc. Worldwide Developers Conference (WWDC) 2009, Session 508, Zero Configuration Networking Using Bonjour "Archived copy" (PDF). Archived from the original (PDF) on 2009-08-06. Retrieved 2009-09-15.{{cite web}}: CS1 maint: archived copy as title (link)