요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. 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.
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.
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.
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.
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.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
MAP multiplexing과 aggregation
1-26Rmnet 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-552. 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-108b. 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-160c. 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-202e. 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.
요약·해설
rmnet.rst:1-202Rmnet은 Qualcomm modem transport 위에서 MAP packet을 처리합니다. Multiplexer ID로 여러 PDN을 분리하고, 한 `skb`에 모인 여러 MAP frame을 다시 나누며, v4·v5 checksum offload 정보와 command 기반 flow control을 해석합니다.
Physical transport 하나에서 여러 logical PDN으로 packet을 분배합니다.
모든 field는 big endian이며 payload length에는 padding이 포함됩니다.
v1 header 뒤에 checksum offload header가 추가됩니다.
Partial checksum의 계산 범위와 결과를 전달합니다.
v1의 reserved 영역 일부를 Next header 표시로 사용합니다.
Header chain과 checksum validity를 나타냅니다.
Transport flow control command의 공통 v1/v5 payload입니다.
한 linear skb의 data·command packet을 순서대로 분리합니다.