Understanding DLNA: Architecture, Functions, and Implementation Steps
This article explains the DLNA standard, its layered architecture, core functions, required protocols such as UPnP, SSDP, and SOAP, and provides a step‑by‑step guide for implementing video casting from a mobile control point to a DLNA‑compatible device.
DLNA (Digital Living Network Alliance) is a set of specifications that enables seamless sharing of music, photos, and videos across PCs, consumer electronics, and mobile devices using a combination of standard protocols such as HTTP, TCP/IP, UDP, UPnP, SSDP, SOAP, XML, and others.
DLNA Architecture consists of several layers: networking connectivity (Ethernet, Wi‑Fi, Bluetooth), networking stack (IPv4/IPv6), device discovery & control (UPnP), media management (UPnP AV), remote UI, media transport (HTTP over TCP/UDP), and media formats (image, audio, video).
Key Functions include device discovery, browsing, searching, streaming, control, upload/download, and automatic transcoding, among others. The article lists 12 functions with a numbered description.
Prerequisite Knowledge for implementing DLNA includes understanding the roles of control point (CP) and renderer, the relationship between DLNA and UPnP, and the relevant protocols (UPnP, SSDP, SOAP, HTTP, UDP, TCP/IP). Sample device type strings (ST) are provided:
ssdp:all // all DLNA‑compatible devices
upnp:rootdevice // TVs, set‑top boxes, routers, etc.
urn:schemas-upnp-org:device:MediaRenderer:1 // renderers
urn:schemas-upnp-org:device:MediaServer:1 // servers
urn:schemas-upnp-org:device:InternetGatewayDevice:1 // gatewaysImplementation Steps :
1. Search Devices
The control point sends an SSDP M‑SEARCH request via UDP to the multicast address 239.255.255.250. Example request:
M-SEARCH * HTTP/1.1
MX: 1
ST: upnp:rootdevice
MAN: ssdp:discover
Connection: close
Host: 239.255.255.250
User-Agent: iOS product/versionResponses contain LOCATION and USN(UUID) fields, which are used to retrieve the device description document (DDD).
2. Retrieve DDD
Send an HTTP GET to the URL found in the LOCATION header. The DDD is an XML document describing the device, its services, and URLs for control and eventing.
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns="urn:schemas-upnp-org:device-1-0" xmlns:dlna="urn:schemas-dlna-org:device-1-0">
...
<serviceList>
<service>
<serviceType>urn:schemas-upnp-org:service:AVTransport:1</serviceType>
<serviceId>urn:upnp-org:serviceId:AVTransport</serviceId>
<SCPDURL>/AVTransport/74495474-dmr/scpd.xml</SCPDURL>
<controlURL>/AVTransport/74495474-dmr/control.xml</controlURL>
<eventSubURL>/AVTransport/74495474-dmr/event.xml</eventSubURL>
</service>
...
</serviceList>
</root>3. Retrieve SDD
From the DDD, extract the SCPDURL of the desired service, combine it with the device’s IP and port from the LOCATION , and issue another HTTP GET to obtain the Service Description Document (SDD), which lists actions and arguments.
<scpd xmlns="urn:schemas-upnp-org:service-1-0">
<actionList>
<action>
<name>SetAVTransportURI</name>
<argumentList>
<argument>
<name>InstanceID</name>
<direction>in</direction>
<relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>
</argument>
<argument>
<name>CurrentURI</name>
<direction>in</direction>
<relatedStateVariable>AVTransportURI</relatedStateVariable>
</argument>
...
</argumentList>
</action>
</actionList>
</scpd>4. Invoke Service (SetAVTransportURI)
Using the control URL from the DDD, send a SOAP POST request to set the media URI on the renderer:
POST /AVTransport/74495474-dmr/control.xml HTTP/1.1
HOST: 192.168.31.8:1298
Content-Type: text/xml; charset="utf-8"
SOAPAction: "urn:schemas-upnp-org:service:AVTransport:1#SetAVTransportURI"
0
yourAVURIIf the device returns HTTP 200, the media URI has been successfully set and playback can be controlled (play, pause, volume, seek) via additional SOAP actions.
Summary : DLNA provides a standardized, protocol‑based framework for media sharing across heterogeneous devices, but it relies on clear‑text communication and lacks built‑in security, making encryption optional only through vendor cooperation.
Sohu Tech Products
A knowledge-sharing platform for Sohu's technology products. As a leading Chinese internet brand with media, video, search, and gaming services and over 700 million users, Sohu continuously drives tech innovation and practice. We’ll share practical insights and tech news here.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.