RFC 1692
Transport Multiplexing Protocol (TMux)
RFC 1692 ยท Transport Multiplexing Protocol (TMux) ๐ฆ
Okay bestie, let's knock out the paperwork first ๐ This is RFC 1692, titled "Transport Multiplexing Protocol (TMux)", from the Network Working Group. It's a Standards Track doc dated August 1994. The authors are P. Cameron (Xylogics, International Ltd.), D. Crocker (Silicon Graphics, Inc.), D. Cohen (Myricom), and J. Postel (ISI). The title block doesn't list anything it obsoletes or updates, so there's nothing extra to flag there โจ
Status of this Memo ๐ธ
This document specifies an Internet standards track protocol for the Internet community, and it's asking for discussion and suggestions for improvements ๐ซถ For the standardization state and status of this protocol, check the current edition of the "Internet Official Protocol Standards" (STD 1). Distribution of this memo is unlimited ๐
Abstract ๐
Terminal servers have a small-packet problem. They can generate a huge pile of tiny packets, and most of those are headed to just one or two hosts ๐ญ TMux lets multiple short transport segments, no matter what application they belong to, get bundled up between a server and host pair ๐
Acknowledgments ๐
This spec is the result of merging two documents. One is the original TMux proposal, which came out of several discussions and related initiatives through IETF working groups. The other is IEN 90 [1], which Danny Cohen and Jon Postel first proposed in May 1979 ๐ง
Applicability Statement ๐
TMux is built to optimize sending a ton of small data packets, the kind you get when lots of interactive Telnet and Rlogin sessions connect to a few hosts on the network ๐ป In that situation, TMux can improve both network and host performance โจ TMux is not intended for multiplexing long streams made of large blocks of data, the kind apps like FTP usually send. Not its vibe ๐ โโ๏ธ
TMux may be applicable to other situations that generate small packets, but the design didn't consider those, so don't assume it's a perfect fit ๐คทโโ๏ธ
Using TMux in any other situation may require some modification ๐ ๏ธ
1. Introduction โจ
When network designers figure out which protocols create the most load, they usually think about protocols that move big blocks of data, like FTP and NFS. What often gets missed is the load from Telnet and Rlogin, because everyone assumes users type slowly and the packets are super tiny. That's a seriously big underestimate for networks and hosts with lots of Telnet and Rlogin ports spread across multiple terminal servers ๐ค
The problem is that the work a host has to do to process a 1-octet packet is almost as much as the work for a 1500-octet packet. So it's the overhead of handling each packet that eats a host's resources, not the processing of the data itself ๐คฏ
Communication load isn't only measured in bits per second. It's also measured in packets per second, and in many situations the packets-per-second number is the real performance limit, not the bits. The proposed multiplexing is aimed at fixing exactly that ๐
If most users on a terminal server only connect to a few hosts, then it's pretty obvious that network and host load could drop a lot if traffic from multiple users headed to the same host could ride in the same packet ๐
TMux is designed to improve network utilization and cut the interrupt load on hosts running multiple sessions with lots of short packets. It does this by multiplexing transport traffic onto a single IP datagram [2], which means fewer, larger packets. TMux is very constrained in how it pulls this off, going for simplicity over sophistication ๐ง
2. Protocol Design ๐
IP hosts may use TMux transparently, and they may even switch back and forth between TMux and sending transport segments in the usual, independent IP datagrams ๐ฆ
TMux works by stuffing a set of transport segments into the same IP datagram. Each segment gets a TMux mini-header in front of it, and that header says how long the segment is and which transport protocol it actually belongs to. The receiving host splits out the individual transport segments and hands them up to the transport layer as if they'd arrived the normal IP/transport way. So the transport layer has no clue about the special wrapping ๐
A TMux message looks like this ๐
| IP hdr | TM hdr | Tport segment | TM hdr | Tport segment| ...|
Quick legend ๐
TM hdris a TMux mini-header and specifies the followingTport segment.Tport segmentrefers to the entire transport segment, including transport headers.
The TMux protocol lets you combine transmission units from different higher-level protocols into one transmission unit of a lower-level protocol. Only segments with the same Internet Protocol (IP) header can be combined, with the possible exception of the protocol and checksum fields. Say you have the segment (H1, B1) and the segment (H2, B2), where Hi and Bi are the headers and bodies of each segment. They may be combined (multiplexed) only if H=H1=H2. The combined TMux message ends up as either (H, B1, B2) or (H, B2, B1) ๐ซถ
The receiver should treat this combined message as if the two original segments, (H,B1) and (H,B2), arrived separately. It is recommended, though not a requirement, that the segments in the TMux message should be processed in the same order that they appear in the TMux message ๐ฆ
Here's the multiplexing magic โจ The individual segments (H,B1) through (H,Bn) get combined into one single message. That message has an IP header equal to H, except the PROTOCOL field is set to 18, which is the protocol number of the TMux protocol. After that header come all the segments, B1 through Bn. Each segment, Bi, gets a 4 octet TMux mini-header in front of it. That mini-header holds the number of the protocol the segment is addressed to, plus the total length of the segment, including the mini-header itself. Since this mini-header isn't otherwise protected by a checksum, it also has a checksum field that just covers the mini-header ๐
2.1. IP Protocol field value ๐ข
TMux is indicated in an IP datagram by the Protocol (ID) value of 18 (22 octal), see [3]. Main character number 18 ๐
2.2. Header Format ๐งฉ
Every 4 octet TMux mini-header has this general format ๐
+-------------------------------+
| Length high |
+-------------------------------+
| Length low |
+-------------------------------+
| Protocol ID |
+-------------------------------+
| Checksum |
+-------------------------------+
| Transport segment |
| ... |
| ... |
The LENGTH field is the octet count for this mini-header plus the transport segment after it, anywhere from 0-65535 octets. So the length field has a minimum value of 4 ๐ Segments that are larger than the maximum allowed for TMux (see section 5.1) should be sent as individual IP datagrams instead.
The Protocol ID field holds the value that would normally have been placed in the IP header Protocol field ๐ง
The Checksum field is the XOR of the first 3 octets ๐งฎ
Now for the padding ๐งต To keep TCP, UDP and other segments on their 32 bit alignment, when the segments being multiplexed aren't a multiple of 32 bits long, extra octets get added to re-align the end of the segment, and therefore the next segment too. The receiver ignores these octets on input. The padding doesn't affect the LENGTH field, though. It still contains the real length of the segment ๐
2.3. Sending Data ๐
Okay so host endpoints can use TMux whenever they want, in either direction (or both!) ๐. They can even flip back and forth between TMux packaging and the usual individual IP datagrams for individual transport associations ๐ฆ. The only barrier to using TMux is that the sender has to know whether the receiver supports it. This matters a lot because early TMux use is probably gonna be limited ๐ญ.
The easiest way to detect TMux support is to only send TMux messages to hosts that have already sent you a valid TMux message ๐. That leaves the question of who starts the TMux connection in the first place ๐ค. The most straightforward answer is that the host sends an IP datagram with no data (so the IP total length field is 20), but with an IP Protocol field value of 18 for TMux. This is called a TMux ENQ (enquiry) message โจ.
The host that receives this message knows the originator supports TMux, so it can start sending TMux messages ๐ง. That in turn makes the originator of the ENQ message start using TMux too. If for any reason the receiver doesn't plan to send TMux messages to the originator, but is ready to accept them, it can reply with another ENQ message.
If an ENQ message doesn't get a response, it's reasonable to resend the ENQ a while later in case the original was lost ๐. If that one gets lost too, the ENQ may be repeated as often as needed, but the time between requests should increase exponentially, up to a limit of about 1 hour. Suitable times between ENQs would be 15 seconds, 30 seconds, 60 seconds, 120 seconds etc. โณ
Note that this checking process doesn't need to get in the way of any of the transport (user) data ๐ . That data can be sent whenever it's convenient, albeit in its less-efficient IP datagram form.
The only problem with this scheme is that a host which supports TMux may stop supporting it, like what happens when the host gets rebooted ๐ฌ. Other hosts need to learn about this change. The fix is to keep a Time To Live (TTL) value for each host that has sent TMux messages. This TTL is a timed TTL, not a count like the IP TTL field, and its time stamp gets updated every time a TMux message is received. TMux can then use it to expire the information it holds about the host after a suitable time, e.g., 1 minute โฐ.
Here's how this TTL time stamp works ๐. When TMux is handed a segment to send to a host, it checks whether the time to live has expired. If the TTL hasn't expired, the segment goes out in a TMux message as normal. If the TTL has expired, the host is marked as being unable to TMux, but the segment is still sent as a TMux message (i.e., with the normal delay to allow other segments to be multiplexed). If the host really can't TMux anymore (a rare occurrence), this segment will time out and get retried by the transport provider, i.e., TCP. Because the host was marked as not able to TMux, the retry gets sent as a normal IP datagram. If the remote host can still TMux, it should send back TMux traffic (even if it has been rebooted), typically a TCP window update, and the local host will mark it as able to TMux again ๐ฅณ. This approach avoids the performance problem of constantly dropping out of TMuxing and having to send probe messages. If the IP datagram to be sent is from UDP, the remote host may not send anything in reply. So for UDP this scheme isn't any better than just stopping TMux messages to the host, but it's also no worse ๐คทโโ๏ธ.
3. Protocol Behavior ๐ง
3.1. Transport Flow Control
TMux works as an extension to the IP datagram protocol, so it doesn't really mess with most flow control mechanisms ๐. Those operate at the transport layer -- above TMux, so they're totally unaffected.
3.2. Connection Management
The concept of a connection belongs to certain transport protocols, not to IP or to TMux ๐ฆ. So when a transport protocol using TMux needs connection management, it happens the same way it does for IP. In fact, the transport protocol isn't supposed to know TMux is being used at all ๐.
3.3 Multiplexed Message Construction
When a transport provider (e.g., TCP or UDP) sends a segment, TMux first removes the IP header (if present), then adds a TMux mini-header and the segment to the Multiplexed Message under construction for the host specified by the destination address of the segment ๐.
When the first message to be transmitted gets placed into the Multiplexed Message under construction, a timer starts โฑ๏ธ. When the timer expires, the Multiplexed Message under construction is transmitted. This makes sure all the segments available before the timer expires get sent in a single Multiplexed Message โจ. If the buffer holding the message fills up during construction, the Multiplexed Message is transmitted immediately ๐ฅ.
The delay time should be user configurable, and a reasonable time is 20 to 30 milliseconds ๐ธ. The time period should be long enough to give a reasonable chance of sending multiple segments, but not so long that the echo response time becomes a problem. This suggests the upper limit for the timer is probably 1/10th second. Timeouts are pretty expensive on many systems, so it is recommended that a single timer be used and that all TMux messages under construction get sent when the timer expires ๐ .
Configuration options may also limit the number of included data segments or the maximum size of the Multiplexed Message before it's transmitted ๐. It's also suggested that larger segments (e.g., those over 700 octets) should be sent as standard IP datagrams and not multiplexed. This makes sure the delay caused by the TMux timer doesn't hold up those segments, for which it's inadvisable ๐ญ. The size of the largest segments to be multiplexed should (if possible) be configurable.
4. Protocol Example ๐
This example shows a TMux message made up of three multiplexed segments ๐ฆ:
A TCP segment consisting of a 20 octet TCP header, 5 octets of data and 3 octets of padding. So the length field is:
Mini header + TCP header + data
= 4 + 20 + 5
= 29
The padding is not included in the length ๐.
A TCP segment consisting of a 20 octet TCP header and 4 octets of data. This segment doesn't need padding โจ.
A UDP segment consisting of a 4 octet UDP header, 41 octets of data and 3 octets of padding ๐.
+-------------------------------+
| Length = 29 |
| (2 octets) |
+-------------------------------+
| Protocol ID = 6 (TCP) |
+-------------------------------+
| Checksum |
+-------------------------------+
| TCP Header |
| (20 octets) |
+-------------------------------+
| TCP data |
| (5 octets) |
+-------------------------------+
| Padding |
| (3 octets) |
+-------------------------------+
| Length = 28 |
| (2 octets) |
+-------------------------------+
| Protocol ID = 6 (TCP) |
+-------------------------------+
| Checksum |
+-------------------------------+
| TCP Header |
| (20 octets) |
+-------------------------------+
| TCP data |
| (4 octets) |
+-------------------------------+
| Length = 49 |
| (2 octets) |
+-------------------------------+
| Protocol ID = 17 (UDP) |
+-------------------------------+
| Checksum |
+-------------------------------+
| UDP Header |
| (4 octets) |
+-------------------------------+
| UDP data |
| (41 octets) |
+-------------------------------+
| Padding |
| (3 octets) |
+-------------------------------+
5. Implementation Suggestion ๐ญ
5.1 Maximum TMux Message Size
Section 3.3 mentions sending messages immediately if the limit on TMux message size is reached ๐ฅ. On systems where Path MTU Discovery (as per RFC 1191 [4]) has been implemented, this should be used to discover the maximum message size that can be transmitted, and that size should be used as the maximum TMux message size ๐.
5.2 Deciding Which Segments to Multiplex
It's the sender's job to decide which segments should be TMux'd and which shouldn't ๐. For example, segments sent by FTP should not normally be multiplexed ๐ โโ๏ธ. In lots of situations, it may be sensible to restrict multiplexing to just the sessions involved in interactive traffic (Telnet and Rlogin) by checking the source and destination TCP port numbers ๐. However, if a segment that wouldn't normally be multiplexed is about to be sent and a TMux message is already under construction, the extra segment can be added to that TMux message, and this complete message should be sent immediately, rather than waiting for the timer to expire โฐโจ.
6. Implementation notes ๐ ๏ธ
okay bestie ๐ these notes come from actual testing of the early TMux implementations โจ. they're NOT technically part of the standard, but they SHOULD be followed if possible so everyone's implementations play nicely together ๐
since the TMux mini-header doesn't have a TOS field ๐, only segments with the same IP TOS field SHOULD be packed into a single TMux message. most systems don't even use the TOS feature, so it's not a major restriction ๐ . where TOS is used, it MAY be desirable to hold several messages under construction for a host, one for each TOS value ๐.
segments with IP options SHOULD NOT be multiplexed ๐ซ.
only unicast addresses SHOULD be considered for multiplexing ๐ฏ.
segments addressed to the loopback address (127.0.0.1) are not candidates for multiplexing ๐ โโ๏ธ.
only segments with a source or destination port for an interactive session (i.e., Telnet and Rlogin) SHOULD be considered for multiplexing using TMux ๐ฅ๏ธโจ.
if an error is discovered in a checksum of a TMux header, the rest of the message, starting there, is ignored ๐ญ. if an unknown PROTOCOL field is discovered in any TMux header, this segment, and only this one, is ignored ๐ซถ.
if the TMux implementation is continually sending TMux messages containing exactly one segment (because there is little traffic to multiplex), then TMux MAY be turned off. this implies that TMux MAY be switched off when there is no congestion. the vibe is "don't multiplex when there's nothing to multiplex" ๐
to stop intermediate nodes from fragmenting and reconstructing TMux frames, implementations MAY want to set the "do not fragment" flag in the IP datagram of TMux messages ๐ง.
okay this one is spicy ๐ฅ. if host B receives a TMux ENQ message from host A, but doesn't have any data for host A, then it MAY also send back an ENQ message. HOWEVER, host A MAY send another ENQ message in response to this, which causes B to respond, and so on, and so on, forever ๐ตโ๐ซ. so if this facility is used, code MUST be included to prevent this looping behavior from happening. sending an ENQ in response to an ENQ is NOT RECOMMENDED, except in special circumstances ๐.
it is RECOMMENDED that the following aspects of the TMux protocol be user configurable ๐:
- the maximum size of a segment that can be multiplexed by TMux.
- the delay between the first segment being placed into the message under construction and the message being sent.
7. Security Considerations ๐
okay bestie, serious moment incoming ๐จ. because TMux is basically an extension to IP, it doesn't have any more impact on site security than IP already does. security SHOULD be handled by the upper layer protocols ๐ก๏ธ.
now, this is the drama ๐ฑ. some routers filter packets based on TCP port numbers. segments sent using TMux won't be subject to that filtering, because it obscures the TCP port number. HOWEVER, larger segments for the same TCP connection will still be sent as IP datagrams, so they WILL be subject to filtering, and that creates a potential problem ๐.
so for this reason, any router that doesn't support TMux, but which does support this type of filtering, SHOULD NOT allow TMux messages through (in either direction) ๐ง. this makes both hosts think the other doesn't support TMux, so all segments get sent as IP datagrams, and the problem is eliminated โ .
a better solution is for routers to actually understand the TMux protocol, inspect each of the multiplexed segments, and remove the segments that fail the filtering ๐. that's the iconic move, periodt ๐ .
8. References ๐
[1] Cohen, D., and Postel, J., "Multiplexing Protocol", IEN 90, USC/Information Sciences Institute,, May 1979.
[2] Postel, J., "Internet Protocol", STD 5, RFC 791, USC/Information Sciences Institute, September 1981.
[3] Reynolds, J. and J. Postel, "Assigned Numbers", STD 2, RFC 1340, USC/Information Sciences Institute, March 1990.
[4] Mogul, J., and S. Deering, "Path MTU discovery", RFC 1191, DECWRL and Stanford University, November 1990.
9. Authors' Addresses ๐
Peter Cameron
Peter Cameron
Xylogics International, Ltd.
Featherstone Rd.
Wolverton Mill
Milton Keynes
MK12 5RD
United Kingdom
Phone: +44 908 222112
Fax: +44 908 222115
EMail: cameron@xylint.co.uk
David Crocker
David Crocker
Silicon Graphics, Inc.
2011 N. Shoreline Blvd.
P.O. Box 7311
Mountain View, CA 94039-7311
USA
Phone: +1 415 390 1804
Fax: +1 415 962 8404
EMail: dcrocker@sgi.com
Danny Cohen
Danny Cohen
Myricom
325 N. Santa Anita Ave.
Arcadia, CA 91006
USA
Phone: +1 818 821 5555
EMail: Cohen@myricom.com
Jon Postel
Jon Postel
USC/Information Sciences Institute
4676 Admiralty Way
Marina del Rey, CA 90292-6695
USA
Phone: +1 310 822 1511
Fax: +1 310 823 6714
EMail: Postel@ISI.EDU
10. Discussion List ๐ฌ
there's a discussion list for this protocol, which is called this for historical reasons ๐๏ธโจ:
cmp-id@xylint.co.uk
requests to join the list SHOULD be sent to ๐ฉ:
cmp-id-request@xylint.co.uk
that's the whole tea, bestie ๐๐ thanks for reading all three parts ๐ซถ
๐ฆ where this page comes from
- ietf: rfc1692 1994-08
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms