← Documents Documentation/networking/device_drivers/cellular/qualcomm/rmnet.rst GitHub 원문 ↗

Linux 6.18.37 · Networking

Rmnet Driver

Qualcomm modem의 MAP multiplexing·aggregation, v1·v4·v5 header, checksum offload와 flow-control command를 설명합니다.

Source pathDocumentation/networking/device_drivers/cellular/qualcomm/rmnet.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

rmnet.rst:1-202

Rmnet은 Qualcomm modem transport 위에서 MAP packet을 처리합니다. Multiplexer ID로 여러 PDN을 분리하고, 한 `skb`에 모인 여러 MAP frame을 다시 나누며, v4·v5 checksum offload 정보와 command 기반 flow control을 해석합니다.

Rmnet data path
USB·HSIC·PCIe·IP acceleratorMAP frameRmnet de-aggregationMultiplexer IDPDNNetwork stack

Physical transport 하나에서 여러 logical PDN으로 packet을 분배합니다.

MAP v1 header
BitField의미
0Command/Data1 command, 0 data
1Reserved송신 0, 수신 무시
2-7Pad4 byte 정렬용 byte 수
8-15Multiplexer ID대상 PDN
16-31Payload lengthPadding 포함, MAP header 제외
32-xRaw bytesIP 또는 command payload

모든 field는 big endian이며 payload length에는 padding이 포함됩니다.

MAP v4 packet
순서구성역할
1MAP headerCommand/Data·Pad·Mux ID·length
2Raw bytesPacket payload
3Checksum offload headerHardware checksum 결과

v1 header 뒤에 checksum offload header가 추가됩니다.

MAP v4 checksum offload
BitField의미
0-14Reserved송신 0, 수신 무시
15Valid1이면 partial checksum 유효
16-31Checksum start offsetIP header 시작 기준 byte offset
31-47Checksum length계산한 byte 길이
48-64Checksum value계산 결과

Partial checksum의 계산 범위와 결과를 전달합니다.

MAP v5 header
BitField의미
0Command/Data1 command, 0 data
1Next header현재 checksum header 지원
2-7Pad4 byte 정렬
8-15Multiplexer ID대상 PDN
16-31Payload lengthPadding 포함

v1의 reserved 영역 일부를 Next header 표시로 사용합니다.

MAP v5 checksum header
BitField
0-6Header Type0·1 reserved, 2 checksum
7Next Header후속 header 표시
8-15Checksum Valid1 valid, 0 invalid
16-31Reserved송신 0, 수신 무시

Header chain과 checksum validity를 나타냅니다.

MAP command packet
구간Field의미
32-39Command name1 flow disable, 2 flow enable
46-47Command TypeRequest·ACK·unsupported·error
64-95Transaction IDCommand transaction 식별
96-127Command dataCommand별 data

Transport flow control command의 공통 v1/v5 payload입니다.

MAP aggregation
Linear `skb`MAP header + IP + padMAP header + command + pad개별 packet 처리IP 전달 또는 command ACK

한 linear skb의 data·command packet을 순서대로 분리합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 ============
4 Rmnet Driver
5 ============
6
7 1. Introduction
8 ===============
9
10 rmnet driver is used for supporting the Multiplexing and aggregation
11 Protocol (MAP). This protocol is used by all recent chipsets using Qualcomm
12 Technologies, Inc. modems.
13
14 This driver can be used to register onto any physical network device in
15 IP mode. Physical transports include USB, HSIC, PCIe and IP accelerator.
16
17 Multiplexing allows for creation of logical netdevices (rmnet devices) to
18 handle multiple private data networks (PDN) like a default internet, tethering,
19 multimedia messaging service (MMS) or IP media subsystem (IMS). Hardware sends
20 packets with MAP headers to rmnet. Based on the multiplexer id, rmnet
21 routes to the appropriate PDN after removing the MAP header.
22
23 Aggregation is required to achieve high data rates. This involves hardware
24 sending aggregated bunch of MAP frames. rmnet driver will de-aggregate
25 these MAP frames and send them to appropriate PDN's.
26
27 2. Packet format
28 ================
29
30 a. MAP packet v1 (data / control)
31
32 MAP header fields are in big endian format.
33
34 Packet format::
35
36 Bit 0 1 2-7 8-15 16-31
37 Function Command / Data Reserved Pad Multiplexer ID Payload length
38
39 Bit 32-x
40 Function Raw bytes
41
42 Command (1)/ Data (0) bit value is to indicate if the packet is a MAP command
43 or data packet. Command packet is used for transport level flow control. Data
44 packets are standard IP packets.
45
46 Reserved bits must be zero when sent and ignored when received.
47
48 Padding is the number of bytes to be appended to the payload to
49 ensure 4 byte alignment.
50
51 Multiplexer ID is to indicate the PDN on which data has to be sent.
52
53 Payload length includes the padding length but does not include MAP header
54 length.
55
56 b. Map packet v4 (data / control)
57
58 MAP header fields are in big endian format.
59
60 Packet format::
61
62 Bit 0 1 2-7 8-15 16-31
63 Function Command / Data Reserved Pad Multiplexer ID Payload length
64
65 Bit 32-(x-33) (x-32)-x
66 Function Raw bytes Checksum offload header
67
68 Command (1)/ Data (0) bit value is to indicate if the packet is a MAP command
69 or data packet. Command packet is used for transport level flow control. Data
70 packets are standard IP packets.
71
72 Reserved bits must be zero when sent and ignored when received.
73
74 Padding is the number of bytes to be appended to the payload to
75 ensure 4 byte alignment.
76
77 Multiplexer ID is to indicate the PDN on which data has to be sent.
78
79 Payload length includes the padding length but does not include MAP header
80 length.
81
82 Checksum offload header, has the information about the checksum processing done
83 by the hardware.Checksum offload header fields are in big endian format.
84
85 Packet format::
86
87 Bit 0-14 15 16-31
88 Function Reserved Valid Checksum start offset
89
90 Bit 31-47 48-64
91 Function Checksum length Checksum value
92
93 Reserved bits must be zero when sent and ignored when received.
94
95 Valid bit indicates whether the partial checksum is calculated and is valid.
96 Set to 1, if its is valid. Set to 0 otherwise.
97
98 Padding is the number of bytes to be appended to the payload to
99 ensure 4 byte alignment.
100
101 Checksum start offset, Indicates the offset in bytes from the beginning of the
102 IP header, from which modem computed checksum.
103
104 Checksum length is the Length in bytes starting from CKSUM_START_OFFSET,
105 over which checksum is computed.
106
107 Checksum value, indicates the checksum computed.
108
109 c. MAP packet v5 (data / control)
110
111 MAP header fields are in big endian format.
112
113 Packet format::
114
115 Bit 0 1 2-7 8-15 16-31
116 Function Command / Data Next header Pad Multiplexer ID Payload length
117
118 Bit 32-x
119 Function Raw bytes
120
121 Command (1)/ Data (0) bit value is to indicate if the packet is a MAP command
122 or data packet. Command packet is used for transport level flow control. Data
123 packets are standard IP packets.
124
125 Next header is used to indicate the presence of another header, currently is
126 limited to checksum header.
127
128 Padding is the number of bytes to be appended to the payload to
129 ensure 4 byte alignment.
130
131 Multiplexer ID is to indicate the PDN on which data has to be sent.
132
133 Payload length includes the padding length but does not include MAP header
134 length.
135
136 d. Checksum offload header v5
137
138 Checksum offload header fields are in big endian format.
139
140 Packet format::
141
142 Bit 0 - 6 7 8-15 16-31
143 Function Header Type Next Header Checksum Valid Reserved
144
145 Header Type is to indicate the type of header, this usually is set to CHECKSUM
146
147 Header types
148
149 = ===============
150 0 Reserved
151 1 Reserved
152 2 checksum header
153 = ===============
154
155 Checksum Valid is to indicate whether the header checksum is valid. Value of 1
156 implies that checksum is calculated on this packet and is valid, value of 0
157 indicates that the calculated packet checksum is invalid.
158
159 Reserved bits must be zero when sent and ignored when received.
160
161 e. MAP packet v1/v5 (command specific)::
162
163 Bit 0 1 2-7 8 - 15 16 - 31
164 Function Command Reserved Pad Multiplexer ID Payload length
165 Bit 32 - 39 40 - 45 46 - 47 48 - 63
166 Function Command name Reserved Command Type Reserved
167 Bit 64 - 95
168 Function Transaction ID
169 Bit 96 - 127
170 Function Command data
171
172 Command 1 indicates disabling flow while 2 is enabling flow
173
174 Command types
175
176 = ==========================================
177 0 for MAP command request
178 1 is to acknowledge the receipt of a command
179 2 is for unsupported commands
180 3 is for error during processing of commands
181 = ==========================================
182
183 f. Aggregation
184
185 Aggregation is multiple MAP packets (can be data or command) delivered to
186 rmnet in a single linear skb. rmnet will process the individual
187 packets and either ACK the MAP command or deliver the IP packet to the
188 network stack as needed
189
190 Packet format::
191
192 MAP header|IP Packet|Optional padding|MAP header|IP Packet|Optional padding....
193
194 MAP header|IP Packet|Optional padding|MAP header|Command Packet|Optional pad...
195
196 3. Userspace configuration
197 ==========================
198
199 rmnet userspace configuration is done through netlink using iproute2
200 https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/
201
202 The driver uses rtnl_link_ops for communication.
203

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

MAP multiplexing과 aggregation

1-26

Rmnet driver

1. 소개

Rmnet driver는 MAP(Multiplexing and Aggregation Protocol)을 지원합니다. 이 protocol은 Qualcomm Technologies, Inc. modem을 사용하는 모든 최신 chipset에서 쓰입니다.

Driver는 IP mode로 동작하는 어떤 physical network device에도 등록할 수 있습니다. Physical transport에는 USB, HSIC, PCIe, IP accelerator가 포함됩니다.

Multiplexing은 default internet, tethering, MMS(Multimedia Messaging Service), IMS(IP Media Subsystem)처럼 여러 PDN(Private Data Network)을 처리하는 logical netdevice, 즉 rmnet device를 만들 수 있게 합니다. Hardware는 MAP header를 붙인 packet을 rmnet에 보내고, rmnet은 MAP header를 제거한 뒤 multiplexer ID에 따라 알맞은 PDN으로 routing합니다.

높은 data rate를 달성하려면 aggregation이 필요합니다. Hardware는 여러 MAP frame을 한 묶음으로 보내고, rmnet driver는 이를 de-aggregation하여 각각 알맞은 PDN으로 전달합니다.

.. SPDX-License-Identifier: GPL-2.0

============
Rmnet Driver
============

1. Introduction
===============

rmnet driver is used for supporting the Multiplexing and aggregation
Protocol (MAP). This protocol is used by all recent chipsets using Qualcomm
Technologies, Inc. modems.

This driver can be used to register onto any physical network device in
IP mode. Physical transports include USB, HSIC, PCIe and IP accelerator.

Multiplexing allows for creation of logical netdevices (rmnet devices) to
handle multiple private data networks (PDN) like a default internet, tethering,
multimedia messaging service (MMS) or IP media subsystem (IMS). Hardware sends
packets with MAP headers to rmnet. Based on the multiplexer id, rmnet
routes to the appropriate PDN after removing the MAP header.

Aggregation is required to achieve high data rates. This involves hardware
sending aggregated bunch of MAP frames. rmnet driver will de-aggregate
these MAP frames and send them to appropriate PDN's.

MAP packet v1 형식

27-55

2. Packet 형식

a. MAP packet v1(data/control)

MAP header field는 big endian 형식입니다.

Bit             0             1           2-7      8-15           16-31
Function   Command / Data   Reserved     Pad   Multiplexer ID    Payload length

Bit            32-x
Function      Raw bytes

Command/Data bit는 MAP command packet이면 1, data packet이면 0입니다. Command packet은 transport 계층 flow control에 사용하고 data packet은 표준 IP packet입니다.

Reserved bit는 송신할 때 0이어야 하고 수신할 때 무시해야 합니다.

Padding은 payload를 4 byte 정렬하기 위해 뒤에 붙이는 byte 수입니다.

Multiplexer ID는 data를 보낼 PDN을 나타냅니다. Payload length에는 padding 길이가 포함되지만 MAP header 길이는 포함되지 않습니다.

2. Packet format
================

a. MAP packet v1 (data / control)

MAP header fields are in big endian format.

Packet format::

  Bit             0             1           2-7      8-15           16-31
  Function   Command / Data   Reserved     Pad   Multiplexer ID    Payload length

  Bit            32-x
  Function      Raw bytes

Command (1)/ Data (0) bit value is to indicate if the packet is a MAP command
or data packet. Command packet is used for transport level flow control. Data
packets are standard IP packets.

Reserved bits must be zero when sent and ignored when received.

Padding is the number of bytes to be appended to the payload to
ensure 4 byte alignment.

Multiplexer ID is to indicate the PDN on which data has to be sent.

Payload length includes the padding length but does not include MAP header
length.

MAP packet v4와 checksum offload header

56-108

b. MAP packet v4(data/control)

MAP header field는 big endian 형식입니다.

Bit             0             1           2-7      8-15           16-31
Function   Command / Data   Reserved     Pad   Multiplexer ID    Payload length

Bit            32-(x-33)      (x-32)-x
Function      Raw bytes      Checksum offload header

Command/Data bit는 MAP command이면 1, data이면 0입니다. Command packet은 transport 계층 flow control에 사용하고 data packet은 표준 IP packet입니다.

Reserved bit는 송신 시 0이고 수신 시 무시합니다. Padding은 4 byte 정렬을 위한 byte 수입니다. Multiplexer ID는 대상 PDN을 나타냅니다. Payload length에는 padding이 포함되고 MAP header는 포함되지 않습니다.

Checksum offload header에는 hardware가 수행한 checksum 처리 정보가 들어가며 field는 big endian 형식입니다.

Bit             0-14        15              16-31
Function      Reserved   Valid     Checksum start offset

Bit                31-47                    48-64
Function      Checksum length           Checksum value

Reserved bit는 송신할 때 0이고 수신할 때 무시합니다. `Valid`가 1이면 partial checksum이 계산되어 유효하고, 0이면 유효하지 않습니다.

Checksum start offset은 IP header 시작부터 modem이 checksum 계산을 시작한 위치까지의 byte offset입니다. Checksum length는 `CKSUM_START_OFFSET`부터 checksum을 계산한 byte 길이이고, Checksum value는 계산 결과입니다.

원문의 이 구간에는 padding 설명이 한 번 더 나오며, 의미는 payload를 4 byte 경계에 맞추기 위해 덧붙이는 byte 수입니다.

b. Map packet v4 (data / control)

MAP header fields are in big endian format.

Packet format::

  Bit             0             1           2-7      8-15           16-31
  Function   Command / Data   Reserved     Pad   Multiplexer ID    Payload length

  Bit            32-(x-33)      (x-32)-x
  Function      Raw bytes      Checksum offload header

Command (1)/ Data (0) bit value is to indicate if the packet is a MAP command
or data packet. Command packet is used for transport level flow control. Data
packets are standard IP packets.

Reserved bits must be zero when sent and ignored when received.

Padding is the number of bytes to be appended to the payload to
ensure 4 byte alignment.

Multiplexer ID is to indicate the PDN on which data has to be sent.

Payload length includes the padding length but does not include MAP header
length.

Checksum offload header, has the information about the checksum processing done
by the hardware.Checksum offload header fields are in big endian format.

Packet format::

  Bit             0-14        15              16-31
  Function      Reserved   Valid     Checksum start offset

  Bit                31-47                    48-64
  Function      Checksum length           Checksum value

Reserved bits must be zero when sent and ignored when received.

Valid bit indicates whether the partial checksum is calculated and is valid.
Set to 1, if its is valid. Set to 0 otherwise.

Padding is the number of bytes to be appended to the payload to
ensure 4 byte alignment.

Checksum start offset, Indicates the offset in bytes from the beginning of the
IP header, from which modem computed checksum.

Checksum length is the Length in bytes starting from CKSUM_START_OFFSET,
over which checksum is computed.

Checksum value, indicates the checksum computed.

MAP packet v5와 next checksum header

109-160

c. MAP packet v5(data/control)

MAP header field는 big endian 형식입니다.

Bit             0             1         2-7      8-15           16-31
Function   Command / Data  Next header  Pad   Multiplexer ID   Payload length

Bit            32-x
Function      Raw bytes

Command/Data bit는 command이면 1, data이면 0입니다. Command packet은 transport 계층 flow control용이며 data packet은 표준 IP packet입니다.

Next header는 뒤에 다른 header가 있음을 나타냅니다. 현재는 checksum header만 허용됩니다. Padding은 4 byte 정렬을 위해 추가하는 byte 수이고, Multiplexer ID는 대상 PDN입니다. Payload length에는 padding이 포함되고 MAP header 길이는 포함되지 않습니다.

d. Checksum offload header v5

Checksum offload header field는 big endian 형식입니다.

Bit            0 - 6          7               8-15              16-31
Function     Header Type    Next Header     Checksum Valid    Reserved

Header Type은 header 종류를 나타내며 보통 `CHECKSUM`으로 설정합니다.

0 Reserved
1 Reserved
2 checksum header

Checksum Valid가 1이면 이 packet의 header checksum이 계산되었고 유효합니다. 0이면 계산된 packet checksum이 유효하지 않습니다. Reserved bit는 송신할 때 0이고 수신할 때 무시합니다.

c. MAP packet v5 (data / control)

MAP header fields are in big endian format.

Packet format::

  Bit             0             1         2-7      8-15           16-31
  Function   Command / Data  Next header  Pad   Multiplexer ID   Payload length

  Bit            32-x
  Function      Raw bytes

Command (1)/ Data (0) bit value is to indicate if the packet is a MAP command
or data packet. Command packet is used for transport level flow control. Data
packets are standard IP packets.

Next header is used to indicate the presence of another header, currently is
limited to checksum header.

Padding is the number of bytes to be appended to the payload to
ensure 4 byte alignment.

Multiplexer ID is to indicate the PDN on which data has to be sent.

Payload length includes the padding length but does not include MAP header
length.

d. Checksum offload header v5

Checksum offload header fields are in big endian format.

Packet format::

  Bit            0 - 6          7               8-15              16-31
  Function     Header Type    Next Header     Checksum Valid    Reserved

Header Type is to indicate the type of header, this usually is set to CHECKSUM

Header types

= ===============
0 Reserved
1 Reserved
2 checksum header
= ===============

Checksum Valid is to indicate whether the header checksum is valid. Value of 1
implies that checksum is calculated on this packet and is valid, value of 0
indicates that the calculated packet checksum is invalid.

Reserved bits must be zero when sent and ignored when received.

MAP command, aggregation과 userspace 구성

161-202

e. MAP packet v1/v5 command 전용 형식

Bit             0             1         2-7      8 - 15           16 - 31
Function   Command         Reserved     Pad   Multiplexer ID    Payload length
Bit          32 - 39        40 - 45    46 - 47       48 - 63
Function   Command name    Reserved   Command Type   Reserved
Bit          64 - 95
Function   Transaction ID
Bit          96 - 127
Function   Command data

Command 1은 flow 비활성화, command 2는 flow 활성화를 뜻합니다.

Command type은 다음과 같습니다.

  • 0: MAP command request
  • 1: command 수신 acknowledgment
  • 2: 지원하지 않는 command
  • 3: command 처리 중 error

f. Aggregation

Aggregation은 여러 MAP packet을 하나의 linear `skb`로 rmnet에 전달하는 방식입니다. 각 packet은 data 또는 command일 수 있습니다. Rmnet은 개별 packet을 처리하여 필요에 따라 MAP command에 ACK를 보내거나 IP packet을 network stack으로 전달합니다.

MAP header|IP Packet|Optional padding|MAP header|IP Packet|Optional padding....

MAP header|IP Packet|Optional padding|MAP header|Command Packet|Optional pad...

3. Userspace 구성

Rmnet userspace configuration은 iproute2 `<https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/>`_를 사용해 netlink로 수행합니다. Driver는 통신에 `rtnl_link_ops`를 사용합니다.

e. MAP packet v1/v5 (command specific)::

    Bit             0             1         2-7      8 - 15           16 - 31
    Function   Command         Reserved     Pad   Multiplexer ID    Payload length
    Bit          32 - 39        40 - 45    46 - 47       48 - 63
    Function   Command name    Reserved   Command Type   Reserved
    Bit          64 - 95
    Function   Transaction ID
    Bit          96 - 127
    Function   Command data

Command 1 indicates disabling flow while 2 is enabling flow

Command types

= ==========================================
0 for MAP command request
1 is to acknowledge the receipt of a command
2 is for unsupported commands
3 is for error during processing of commands
= ==========================================

f. Aggregation

Aggregation is multiple MAP packets (can be data or command) delivered to
rmnet in a single linear skb. rmnet will process the individual
packets and either ACK the MAP command or deliver the IP packet to the
network stack as needed

Packet format::

  MAP header|IP Packet|Optional padding|MAP header|IP Packet|Optional padding....

  MAP header|IP Packet|Optional padding|MAP header|Command Packet|Optional pad...

3. Userspace configuration
==========================

rmnet userspace configuration is done through netlink using iproute2
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/

The driver uses rtnl_link_ops for communication.