Content deleted Content added
→M-PHY: D-PHY 0.90 -> 1.00 |
m →top: Typo fixing, replaced: Iterface → Interface |
||
(200 intermediate revisions by 25 users not shown) | |||
Line 1:
{{short description|Interface technology communication architecture}}
{{About|a technical explanation of the architecture of the [[UniPro]] protocol stack|an overview of the protocol stack, its purpose, usage and status|UniPro}}
In mobile-telephone technology, the '''
{| border="1" cellpadding="3" style="margin: 1em auto 1em auto"
|+ ''UniPro protocol stack (this color
|- style="background:#D8D8D8; color:black"
! colspan="2" | Layer # || Layer name || Functionality || Data unit name
|- style="background:#7DD460; color:black"
| align="center" colspan="2" | LA
| align="center" | Application
| Payload and transaction semantics
| align="center" | Message
|- style="background:#D8D8D8; color:black"
| align="center" rowspan="5" | DME
|- style="background:#C2FA31; color:black"
| align="center" | Layer 4
| align="center" | Transport
| Ports, multiplexing, flow control
| align="center" | Segment
|-style="background:#FAF931; color:black"
| align="center" | Layer 3
| align="center" | Network
| Addressing, routing
| align="center" | Packet
|- style="background:#FF9400; color:black"
| align="center" | Layer 2
| align="center" | Data link
| Single-hop reliability and priority-based arbitration
| align="center" | Frame
|- style="background:#FF1804; color:white"
| align="center" | Layer 1.5
| align="center" | PHY adapter
| Physical layer abstraction and multi-lane support
| align="center" | UniPro symbol
|- style="background:#FF1804; color:white"
| align="center" colspan="2" | Layer 1
| align="center" | Physical layer (PHY)
| Signaling, clocking, line encoding, power modes
Line 39 ⟶ 42:
|}
The UniPro specification itself covers Layers 1.5, 2, 3, 4 and
OSI Layers 5 (Session) and 6 (Presentation) are, where applicable, counted as part of the Application Layer.
==Physical Layer (L1)==
===D-PHY===
Versions 1.0 and 1.1 of UniPro use MIPI's [[D-PHY]] technology for the off-chip Physical Layer. This PHY allows inter-chip communication
The [[D-PHY]]<ref>[https://members.mipi.org/mipi-adopters/file-fix/Specifications/Board%20Approved/
In UniPro, the D-PHY is used in a mode (called "8b9b" encoding) which conveys 8-bit bytes as 9-bit symbols. The UniPro protocol uses this to represent special control symbols (outside the usual 0 to 255 values). The PHY itself uses this to represent certain special symbols that have meaning to the PHY itself (e.g. IDLE symbols). Note that the ratio 8:9 can cause some confusion when specifying the data rate of the D-PHY: a PHY implementation running with a 450
The D-PHY also supports a Low-Power Data Transmission (LPDT) mode and various other low-power modes for use when no data needs to be sent.
==={{Anchor|M-PHY}}M-PHY===
Versions 1.4 and beyond of UniPro
{| border="1" cellpadding="3" style="margin: 1em auto 1em auto"
|+ ''Physical layer technologies supported by UniPro''
|- style="background:#D8D8D8; color:black"
! PHY technology || Version / Released || Symbol encoding ||
|- style="background:#FF1804; color:white"
| align="center" | D-PHY
| align="center" | 1.
| align="center" | 8b/9b
| align="center" |
| align="center" | 4
| align="center" |
|- style="background:#FF1804; color:white"
| align="center" | M-PHY
| align="center" |
| align="center" | 8b/10b
| align="center" |
| align="center" |
| align="center" |
|- style="background:#FF1804; color:white"
| align="center" | C-PHY
| align="center" | 1.00.00 / October 2014
| align="center" |
| align="center" | ? 2.5Gbit/s/lane ?
| align="center" | 3 lane port
| align="center" |
|}
The D- and M-PHY are expected to co-exist for several years. D-PHY is a less complex technology, M-PHY provides higher bandwidths with fewer signal wires, and C-PHY provides low-power.
===Low speed modes and power savings===
It is worth noting that UniPro supports the power efficient low speed communication modes provided by both the D-PHY (10 Mbit/s) and M-PHY (3 Mbit/sec up to 500 Mbit/s). In these modes, power consumption roughly scales with the amount of data that is sent.
Furthermore, both PHY technologies provide additional power saving modes because they were optimized for use in battery-powered devices.
==PHY Adapter Layer (L1.5)==
Architecturally, the PHY Adapter layer serves to hide the differences between the different PHY options (D- and M-PHY). This abstraction thus mainly gives architectural flexibility. Abstracted PHY details include the various power states and employed symbol encoding schemes.
===L1.5 symbols===
{| border="1" cellpadding="3" style="margin: 1em auto 1em auto"
|+ ''Example sequence of a UniPro's 17-bit L1.5 symbols''
|- style="background:#D8D8D8; color:black"
| align="center background:#FF1804;"
|- style="background:#F8F8F8; color:black" align="center"
| style="background:#FF1804; color:white" | 1
| colspan="8" | 1st byte of L1.5
| colspan="8" | 2nd byte of L1.5
|- style="background:#F8F8F8; color:black" align="center"
| style="background:#FF1804; color:white" | 0
| colspan="8" | 1st byte of L1.5
| colspan="8" | 2nd byte of L1.5
|- style="background:#F8F8F8; color:black" align="center"
| style="background:#FF1804; color:white" | 0
| colspan="8" | 1st byte of L1.5
| colspan="8" | 2nd byte of L1.5
|- style="background:#F8F8F8; color:black" align="center"
| style="background:#FF1804; color:white" | 0
| colspan="8" | 1st byte of L1.5
| colspan="8" | 2nd byte of L1.5
|- style="background:#F8F8F8; color:black" align="center"
| style="background:#FF1804; color:white" | 0
| colspan="8" | 1st byte of L1.5
| colspan="8" | 2nd byte of L1.5
|- style="background:#F8F8F8; color:black" align="center"
| style="background:#FF1804; color:white" | 1
| colspan="8" | 1st byte of L1.5
| colspan="8" | 2nd byte of L1.5
|- style="background:#F8F8F8; color:black" align="center"
| style="background:#FF1804; color:white" | 0
| colspan="8" | 1st byte of L1.5
| colspan="8" | 2nd byte of L1.5
|}
L1.5 thus has its own (conceptual) symbol encoding consisting of 17-bit symbols. These 17-bit symbols never show up on the
===L1.5 multi-lane support===
The main feature that L1.5 offers users is to allow the bandwidth of a UniPro link to be increased by using 2, 3 or 4 lanes when a single lane does not provide enough bandwidth. To the user, such a multi-lane link simply looks like a faster physical layer because the symbols are sent across 2, 3 or 4 lanes. Applications that require higher bandwidth in one direction but require less bandwidth in the opposite direction, can have different numbers of lanes per direction.
====L1.5 lane discovery====
Starting in UniPro v1.4, L1.5 automatically discovers the number of usable M-PHY lanes for each direction of the link. This involves a simple discovery protocol within L1.5 that is executed on initialization. The protocol transmits test data on each available outbound lane, and receives information back from the peer entity about which data on which lane actually made it to the other end of the link. The mechanism also supports transparent remapping of the lanes to give circuit board designers flexibility in how the lanes are physically wired.
===L1.5 link power management===
Starting in UniPro v1.4, L1.5 has a built in protocol called PACP (PA Control Protocol) that allows L1.5 to communicate with its peer L1.5 entity at the other end of an M-PHY-based link. Its main usage is to provide a simple and reliable way for a controller at one end of the link to change the power modes of both the forward and reverse directions of the link. This means that a controller situated at one end of the link can change the power mode of both link directions in a single atomic operation. The intricate steps required for doing this in a fully reliable way are handled transparently within L1.5.
===L1.5 peer parameters control===
In addition to the L1.5 link power management the PACP is also used to access control and status parameters of the peer UniPro device.
===L1.5 guarantees===
The mechanisms in L1.5 guarantee the following to upper layer protocols:
* after reset, each L1.5 transmitter will wait until the connected L1.5 receiver is known to be active (handled via a handshake)
* if more than one lane is used, the ordering of the original symbol stream is preserved (despite usage of multiple lanes and freedom on how to interconnect these lanes)
* power mode changes are executed reliably (even in the presence of bit errors)
==Data Link Layer (L2)==
The main task of UniPro's Data Link layer (L2) is to
===L2 data frames===
{| border="1" cellpadding="3" style="margin: 1em auto 1em auto"
|+ ''Example UniPro Data Frame''
|- style="background:#D8D8D8; color:black"
| align="center background:#FF1804;"
|- style="background:#FF9400; color:black" align="center"
| style="background:#FF1804; color:white" | 1
| colspan="16" | Start-of-Data-Frame control symbol (header)
|- style="background:#F8F8F8; color:black" align="center"
| style="background:#FF1804; color:white" | 0
Line 151 ⟶ 182:
|- style="background:#FF9400; color:black" align="center"
| style="background:#FF1804; color:white" | 1
| colspan="16" | End
|- style="background:#FF9400; color:black" align="center"
| style="background:#FF1804; color:white" | 0
Line 160 ⟶ 191:
In addition to data frames which contain user data, L2 also transmits and receives control frames. The control frames can be distinguished from data frames by three bits in the first symbol. There are two types of control frames:
* One type ("AFC- Acknowledgement and L2 Flow Control", 3 symbols) serves to acknowledge successfully received data frames.
* The other type ("NAC", 2 symbols) notifies the corresponding transmitter that an incorrect frame has been received.
Note that these L2 types of control frames are sent autonomously by L2
{| border="1" cellpadding="3" style="margin: 1em auto 1em auto"
|+ ''Example UniPro Control Frame''
|- style="background:#D8D8D8; color:black"
| align="center background:#FF1804;"
|- style="background:#FF9400; color:black" align="center"
| style="background:#FF1804; color:white" | 1
| colspan="16" | Start-of-Control-Frame control symbol (header)
|- style="background:#FF9400; color:black" align="center"
| style="background:#FF1804; color:white" | 0
Line 180 ⟶ 211:
===L2 retransmission===
High speed communication at low power levels can lead to occasional errors in the received data. The Data Link layer contains a protocol to automatically acknowledge correctly received data frames (using AFC control frames) and to actively signal
A bandwidth of 1
===L2 flow control===
Another feature of L2 is the ability for an L2 transmitter to know whether there is buffer space for the data frame at the receiving end. This again relies on L2 control frames (AFC) which allow a receiver to tell the
===L2
UniPro currently supports two priority levels for data frames called Traffic Class 0 (TC0) and Traffic Class 1 (TC1). TC1 has higher priority than TC0. This means that if an L2 transmitter has a mix of TC0 and TC1 data frames to send, the TC1 data frames will be sent first. Assuming that most data traffic uses TC0 and that the network has congestion, this helps ensure that TC1 data frames arrive at their destination faster than TC0 data frames (analogous to emergency vehicles and normal road traffic). Furthermore, L2 can even interrupt or "preempt" an outgoing TC0 data frame to transmit a TC1 data frame.
In a multi-hop network, the arbitration is done
===L2 single Traffic Class option===
In UniPro version 1.1, an option was introduced to allow simple endpoint devices to implement only one of the two Traffic Classes if they choose to. This can be useful when device designers are more concerned with implementation cost than with control over frame arbitration. The connected L2 peer device detects such devices during the link initialization phase and can avoid using the missing Traffic Class.
===L2 guarantees===
The various L2 mechanisms provide a number of guarantees to higher layer protocols:
* a received data frame will contain the correct payload (checked using a checksum)
* a transmitted data frame will reach the peer's receiver (after potential retransmissions)
* there will be room to accommodate received data frames (L2 flow control)
* the content of a data frame will only be passed once to the upper protocol layer (duplicate data frames are discarded)
* data frames within the same Traffic Class will be received and passed to the upper protocol layers in order
Thus individual links autonomously provide reliable data transfer. This is different from, for example, the widely used [[Transmission Control Protocol|TCP protocol]] that detects errors at the endpoints and relies on end-to-end retransmission in case of corrupted or missing data.
==Network Layer (L3)==
[[Image:UniPro network.png|500px|thumb|Example system architecture showing multiple UniPro devices connected via UniPro switches]]
The network layer is
Version 1.4 of the UniPro spec does not specify the details of a switch, but does specify enough to allow a device to work in a future networked environment.
===L3 addressing===
Although the role of the L3 address is the same as the IP address in packets on the Internet, a UniPro DeviceID address is only 7
===L3 packets===
The diagram shows an example of an L3 packet which starts at the first L2 payload byte of an L2 frame and ends at the last L2 payload byte of an L2 frame. For simplicity and efficiency, only a single L3 packet can be carried by one L2 frame. This implies that, in UniPro, the concepts of an L2 Frame, an L3 Packet and an L4 Segment (see below) are so closely aligned that they are almost synonyms. The distinction (and "coloring") is however still made to ensure that the specification can be described in a strictly layered fashion.
===L3 short-header packet structure===
UniPro short-header packets use a single header byte for L3 information. It includes the 7-bit L3 destination address. The remaining bit indicates the short-header packet format. For short-header packets, the L3 source address is not included in the header because it is assumed that the two communicating devices have exchanged such information beforehand ([[connection-oriented communication]]).
{| border="1" cellpadding="3" style="margin: 1em auto 1em auto"
|+ ''UniPro Short-Header Packet within a Data Frame''
|- style="background:#D8D8D8; color:black"
| align="center background:#FF1804;"
|- style="background:#FF9400; color:black" align="center"
| style="background:#FF1804; color:white" | 1
| colspan="16" | Start-of-Data-Frame control symbol (header)
|- style="background:#F8F8F8; color:black" align="center"
| style="background:#FF1804; color:white" | 0
| colspan="8" style="background:#FAF931" | L3 short-header
| colspan="8" | Packet payload
|- style="background:#F8F8F8; color:black" align="center"
Line 224 ⟶ 274:
|- style="background:#FF9400; color:black" align="center"
| style="background:#FF1804; color:white" | 1
| colspan="16" | End
|- style="background:#FF9400; color:black" align="center"
| style="background:#FF1804; color:white" | 0
Line 230 ⟶ 280:
|}
===L3
Long-header packets are intended to be introduced in a future version of the UniPro specification, so their format is undefined (except for one bit) in the current UniPro v1.4 specification. However, UniPro v1.4 defines a hook that allows long-header packets to be received or transmitted by a UniPro v1.4 conformant-device assuming the latter can be upgraded via software. The "long-header trap" mechanism of UniPro v1.4 simply passes the payload of a received L2 data frame (being the L3 packet with its header and payload) to the L3 extension (e.g. software) for processing. The mechanism can also accept L2 frame payload from the L3 extension for transmission. This mechanism aims to allow UniPro v1.4 devices to be able to be upgraded in order to support protocols that require the as-yet undefined long-header packets.
===L3 guarantees===
Although details of switches are still out of scope in the UniPro v1.4 spec, L3 allows UniPro v1.0/v1.1/v1.4 devices to serve as endpoints on a network. It therefore guarantees a number of properties to higher layer protocols:
* that packets will be delivered to the addressed destination device (and packets addressed to non-existent devices are discarded)
* that payload sent by an L3 source to a single L3 destination as a series of one or more short-header packets within a single Traffic Class will arrive in order and with the correct payload (reliability)
==Transport Layer (L4)==
The features of UniPro's Transport layer are not especially complex, because basic communication services have already been taken care of by lower protocol layers. L4 is essentially about enabling multiple devices on the network or even multiple clients within these devices to share the network in a controlled manner. L4's features tend to be roughly comparable to features found in computer networking (e.g. [[Transmission Control Protocol|TCP]] and [[User Datagram Protocol|UDP]]) but that are less commonly encountered in local busses like PCI Express, USB or on-chip busses.
UniPro's L4 also has special significance because it is the top protocol layer in the UniPro specification. Applications are required to use L4's top interface to interact with UniPro and are not expected to bypass L4 to directly access lower layers. Note that the interface at the top of L4 provided for transmitting or receiving data is defined at the behavioral or functional level. This high level of abstraction avoids restricting implementation options. Thus, although the specification contains an annex with a signal-level interface as a non-normative example, a UniPro implementation is not required to have any specific set of hardware signals or software function calls at its topmost interface.
===L4 features===
UniPro's Transport layer
* allows
* allows a UniPro device to simultaneously connect to multiple other devices (this requires switches as supported in a [[UniPro#
* provides mechanisms to reduce the risk of congestion on the network.
* provides
These points are explained in more detail below.
===L4 segments===
An L4 segment, is essentially the
The main field in the short L4 header is a 5-bit "CPort" identifier which can be seen as a sub-address within a UniPro device and is somewhat analogous to the [[TCP and UDP port|port]] numbers used in [[Transmission Control Protocol|TCP]] or [[User Datagram Protocol|UDP]]. Thus every segment (with a short header) is addressed to a specific CPort of specific UniPro device.
{| border="1" cellpadding="3" style="margin: 1em auto 1em auto"
|+ ''UniPro Segment within a Data Frame''
|- style="background:#D8D8D8; color:black"
| align="center background:#FF1804;"
|- style="background:#FF9400; color:black" align="center"
| style="background:#FF1804; color:white" | 1
| colspan="16" | Start-of-Data-Frame control symbol (header)
|- style="background:#F8F8F8; color:black" align="center"
| style="background:#FF1804; color:white" | 0
| colspan="8" style="background:#FAF931" | L3 short header
| colspan="8" style="background:#C2FA31" | L4 short header
|- style="background:#F8F8F8; color:black" align="center"
| style="background:#FF1804; color:white" | 0
Line 272 ⟶ 328:
|- style="background:#FF9400; color:black" align="center"
| style="background:#FF1804; color:white" | 1
| colspan="16" | End
|- style="background:#FF9400; color:black" align="center"
| style="background:#FF1804; color:white" | 0
Line 278 ⟶ 334:
|}
A single bit in the segment header also allows segments to be defined with long segment headers. UniPro v1.4 does not define the structure of such segment formats (except for this single bit). Long header segments may be generated via the long header trap described in the L3 section.
===L4 connections===
UniPro calls a pair of CPorts that communicate with each other a Connection (hence the C in CPort). Setting up a connection means that one CPort has been initialized to create segments which are addressed to a specific L4 CPort of a specific L3 DeviceID using a particular L2 Traffic Class. Because UniPro connections are bidirectional, the destination CPort is also configured to allow data to be sent back to the source CPort.
In UniPro 1.0/1.1 connection setup is implementation specific.
In UniPro v1.4 connection setup is assumed to be relatively static: the parameters of the paired CPorts are configured by setting the corresponding connection Attributes in the local and peer devices using the DME. This will be supplemented by a dynamic connection management protocol in a future version of UniPro.
===L4 flow control===
CPorts also contain state variables that can be used to track how much buffer space the peer or connected CPort has. This is used to prevent the situation whereby a CPort sends segments to a CPort which has insufficient buffer space to hold the data, thus leading to stalled data traffic. Unless resolved fast, this traffic jam at the destination quickly grows into a network-wide gridlock. This is highly undesirable as it can greatly affect network performance for all users or, worse, can lead to deadlock situations. The described L4 mechanism is known as end-to-end flow control (E2E FC) because it involves the endpoints of a connection.
===L4 flow control versus L2 flow control===
L4 flow control is complementary to L2 flow control. Both work by having the transmitter pause until it knows there is sufficient buffer space at the receiver. But L4 flow control works between a pair of CPorts (potentially multiple hops apart) and aims to isolate connections from one another ("virtual wire" analogy). In contrast, L2 flow control is per-hop and avoids basic loss of data due to lack of receiver buffer space.
===L4 flow control applicability===
E2E FC is only possible for connection-oriented communication, but at present UniPro's L4 does not support alternative options. E2E FC is enabled by default but can, however, be disabled. This is not generally recommended.
===L4 safety net===
UniPro provides "safety net" mechanisms that mandate that a CPort absorbs all data sent to it without stalling. If a stall is detected anyway, the endpoint discards the incoming data arriving at that CPort in order to maintain data flow on the network. This can be seen as a form of graceful degradation at the system level: if one connection on the network cannot keep up with the speed of the received data, other devices and other connections are unaffected.
===L4 and Messages===
UniPro L4 allows a connection
UniPro needs to be told by the application where or when to insert message boundaries into the byte stream: the boundaries have no special meaning for UniPro itself and are provided as a service to build higher-layer protocols on top of UniPro. Messages can be used to indicate (e.g. via an interrupt) to the application that a unit of data is complete and can thus be processed. Messages can also be useful as a robust and efficient mechanism to implement resynchronization points in some applications.
UniPro v1.4 introduces the notion of message fragment, a fragment being a portion of a message passed between the application and the CPort. This option can be useful when specifying Applications on top of UniPro that need to interrupt the Message creation based on information from the UniPro stack, e.g., incoming Messages, or backpressure.
===L4 guarantees===
The mechanisms in L4 provide a number of guarantees to upper layer protocols:
* A CPort cannot stall, in the sense that it will always continue to accept data as fast as the link or network can deliver the data.
* If an application bound to CPort of a connection stalls and thus fails (for brief or longer periods) to absorb data, other connections to the same or different devices are unaffected.
* A stream of data sent from one CPort to another will always arrive intact, in order, and with the correct message boundary information if the CPort is able to keep up with the incoming data stream.
* In case the CPort cannot keep up with the incoming data stream, one or more messages may be corrupted (due to missing data) and the receiver is notified about this error condition.
* It is safe for an application-level protocol to wait for a peer's response (e.g. an answer or acknowledgement) to a sent L4 message (e.g. a question or command). But it is unsafe for an application-level protocol to await a peer's response to a sent partial message.
* The content of received short header packets/segments will always be correct. Although delivery at the long-header trap interface is not guaranteed, a future protocol extension plans to make the delivery of such packets reliable. This protocol extension could be implemented in software on top of the long-header trap.
==Device Management Entity (DME)==
The DME (Device Management Entity) controls the layers in the UniPro stack. It provides access to control and status parameters in all layers, manages the power mode transitions of the Link and handles the boot-up, hibernate and reset of the stack. Furthermore, it provides means to control the peer UniPro stack on the Link.
==References==
{{reflist}}
{{DEFAULTSORT:Unipro Protocol Stack}}
[[Category:Embedded systems]]
[[Category:Network protocols]]
|