Project

General

Profile

Proposed efficient TDMoIP » History » Version 16

laforge, 04/21/2022 05:36 PM

1 1 laforge
h1. Proposed efficient TDMoIP
2
3
{{>toc}}
4
5 16 laforge
This wiki page describes the current work-in-progress, new type of TDMoIP protocol.
6 1 laforge
7 16 laforge
The high-level goal of the protocol is to be able to carry E1/PRI circuits over IP networks, specifially the public internet.  The idea is for this to be used in order to interconnect various community/hobbyist folks who experiment with TDM technology at their home, but who have no chance to interconnect with others due to the decommissioning of the pubic PDH/ISDN networks. (more on that proposed network at [[retronetworking:Community_TDMSS7_Network]]).
8 1 laforge
9 16 laforge
There is ongoing work on implementing this protocol in the osmo-e1d":https://git.osmocom.org/osmo-e1d/log/?h=laforge/e1oip. It can be used with either a physical [[e1-t1-adapter:icE1usb]] or with a virtual @dahdi-trunkdev@ implementation, see #5430 
10 13 laforge
11 1 laforge
h2. Major design goals
12
13
h3. mandatory features
14
15
* *structure-agnostic*
16
** suitable for any kind of traffic, whether ISDN/Q921, GSM-Abis, SS7, ATM, Frame Relay, ...
17
** support for framed E1
18
** support for channelized and non-channelized E1
19
** support for E1 with and without CRC4
20
* *bandwidth-efficient*
21
** the average hobbyist doesn't want to waste 2Mbps full-duplex bandwidth even if no traffic at all is communicated
22 13 laforge
* *suitable for use with dynamic IP and NAT* #
23 1 laforge
** at least on the client side, it should work with dynamic IP and through NAT
24
** server side is required to have static IP
25
* *support for IPv4 and IPv6*
26
** there are more and more users in the public internet without real IPv4 connectivity
27 13 laforge
* *support for cryptographic authentication* #5429 
28 1 laforge
** users should authenticate themselves against the server via some challenge-resposne mechanism safe against eavesdroppers
29
30
h3. optional features
31
32
* support for unframed E1
33 15 laforge
* support for T1 (in the protocol; not in the proposed primary [[e1-t1-adapter:icE1usb]] based hardware implementation)
34 1 laforge
* support for confidentiality (encryption)
35
36 16 laforge
h2. Current WIP status / implementation
37 4 laforge
38 1 laforge
h3. suppress transmission of idle timeslots
39
40 3 laforge
This is the most critical part of reducing the background traffic for an [relatively] idle link.
41 1 laforge
42 16 laforge
We need to know (by means of auto-detection) which timeslots are in use, and then only tramsmit those with actual traffic in them.
43 3 laforge
44 16 laforge
The actual packets then need to contain information on which timeslots are present in the current packet, by including a 32bit bit-mask.
45 3 laforge
46
h4. traffic slots (B channels)
47
48
If a timeslot keeps carrying the same pattern (bytes) in consecutive frames, suppress transmission of that timeslot.  The receiver can reconstruct the bitstream by repeating the bytes from a previous (cached) frame.
49
50
h4. HDLC signaling slots (D channels)
51
52 5 laforge
As idle HDLC timeslots contain continuous flag characters coded as 01111110, we can also simply compare with the previous byte in the timeslot.  So the same handling applies for both B-channels and D-channels.
53 1 laforge
54
h3. batching / aggregation of frames
55
56
Batching several frames in a single packet serves the following purposes
57
* reduce the amount of packets per second
58
* reduce the proportional overhead for IP/UDP/protocol headers
59
60
Batching too many frames introduces unwanted additional latency.  Furthermore, we want to avoid exceeding the MTU of the IP connection (which would add IP level fragmentation, which is generally to be avoided)
61
62
We can fit at least 40 frames (32 bytes each) inside a single TCP/UDP packet without hitting the usual MTUs around the internet.  40 frames means 200 Hz packet rate, introducing 5ms of buffering.
63
64
Some quick estimate: Sending 36 bytes (IPv4 + UDP header +  estimated 8 byte TDMoIP header) at 200 Hz means 57.6 kbits-per-second of background traffic, plus then whatever active slots.  That's much better than 2Mbps flat.
65
66
h3. clocking / timing / jitter
67
68 16 laforge
The curent approach is to use [[e1-t1-adapter:icE1usb]] as the physical E1 interface.  It has a built-in GPS-DO and hence allows to avoid any significant clock drift between the participants of the network.  Larger clock drift would lead to buffer underruns/overruns with rather ugly effects to the payload.
69 1 laforge
70
Some pre-buffering and a [minimal] jitter buffer is required to compensate for jitter in the IP transport medium.
71
72
h3. Initial / Preferred Hardware implementation
73
74 16 laforge
Use an [[e1-t1-adapter:icE1usb]] plus some small and compact embedded Linux device, with limited power consumption like a Raspberry Pi, Banaa Pi, Odroid XU4, PC-Engines APU or the like.
75 9 laforge
76 1 laforge
77 13 laforge
h3. Direct DAHDI driver #5430 
78 1 laforge
79
The primary use case for this system is to attach legacy E1/PDH equipment.  However, there are of course use cases where one might want to connect software like Asterisk, yate, Freeswitch, osmo-bsc, ...  The _naive_ approach of course would be to use a physical E1 line card and then go via the icE1usb.   But in this case a fully virtualized approach can of course be used:
80
81
This entails an implementation of  this protocol directly inside a DAHDI driver (like the Astribank drivers).  This way, the software (e.g. Asterisk) sees a DAHDI span, but that span has no actual hardware associated with it, just the TDMoIP.
82 6 laforge
83
h2. Use cases
84
85
h3. pysical E1 line via Internet
86
87
In this scenario, there is E1 equipment like an ISDN PBX with PRI, a Frame Relay router, etc. in two locations, and they shall be interconnected over IP:
88
89
{{graphviz_link()
90
graph {
91
  rankdir=LR;
92
  subgraph cluster_L {
93
     label="Site L";
94
     PBX_L [label="PBX"];
95
     icE1usb_L [label="icE1usb"];
96
     GW_L [label="GW L"];
97
     PBX_L -- icE1usb_L [label="E1"];
98
     icE1usb_L -- GW_L [label="USB"];
99
  }
100
  subgraph cluster_R {
101
     label="Site R";
102
     PBX_R [label="PBX"];
103
     icE1usb_R [label="icE1usb"];
104
     GW_R [label="GW R"];
105
     PBX_R -- icE1usb_R [label="E1"];
106
     icE1usb_R -- GW_R [label="USB"];
107
  }
108
  Internet;
109
  GW_L -- Internet [label="IP"];
110
  GW_R -- Internet [label="IP"];
111
}
112
}}
113 1 laforge
114 6 laforge
h4. clocking
115 1 laforge
116 7 laforge
In this setup, it is possible to use the GPS-DO of the icE1usb on both sides as a clock reference.  As long as they are both locked, there shouldn't be any drift, just a very small amount of jitter, which si compensated by a small jitter buffer.
117
118
h4. implementation
119
120 16 laforge
As of January 30, 2022, the first basic proof-of-concept implementation of this was found in the @lafore/e1oip@ branch of @osmo-e1d@.  This was subsequently merged master, and has been improved step by step over time, dealing with dynamic IP addresses on the client side, various metrics, support for dahdi-trunkdev, handling packet re-ordering, etc.
121 12 laforge
122 16 laforge
123 6 laforge
h3. Physical E1 to virtual E1
124
125
In this scenario, we have physical E1 only on one of the two sides (where some legacy E1 equipment is located) while the other side is virtualized. This can be achieved by providing a _virtual DAHDI_ driver that shows up just like a physical DAHDI interface to the PBX software (or any other software using DAHDI).
126
127
{{graphviz_link()
128
graph {
129
  rankdir=LR;
130
  subgraph cluster_L {
131
     label="Site L";
132
     PBX_L [label="PBX"];
133
     icE1usb_L [label="icE1usb"];
134
     GW_L [label="GW L"];
135
     PBX_L -- icE1usb_L [label="E1"];
136
     icE1usb_L -- GW_L [label="USB"];
137
  }
138
  subgraph cluster_R {
139
     label="Site R";
140
     PBX_R [label="PBX\n(Virtual DAHDI)"];
141
  }
142
  Internet;
143
  GW_L -- Internet [label="IP"];
144
  PBX_R -- Internet [label="IP"];
145
}
146 1 laforge
}}
147 8 laforge
148
h4. clocking
149
150
In this situation, the _virtual_ side doesn't have any quality clock source.  clock would have to be recovered from timing of arriving packets from the physical side of the link, where hardware timing is present.  As long as there is only one link (or rather one clock source), this should work.
151
152
If there are multiple "physical" sides connected to the virtual side, then the  "physical" sides would all have to use GPS-DO clocking in order to ensure there is one single clock across the network.
153 6 laforge
154
h3. Virtual E1 to Virtual E1
155
156
In this situation there would be no physical E1 line involved, but only virtual lines.  This would mainly be to interconnect software developed for E1, but in a virtualized environment where no real E1 is present.
157
158
If the virtual E1 is exposed via the same DAHDI interface, the applications (e.g. softswitch) will not notice any differnce.
159
160
{{graphviz_link()
161
graph {
162
  rankdir=LR;
163
  subgraph cluster_L {
164
     label="Site L";
165
     PBX_L [label="PBX\n(Virtual DAHDI)"];
166
  }
167 1 laforge
  subgraph cluster_R {
168 6 laforge
     label="Site R";
169
     PBX_R [label="PBX\n(Virtual DAHDI)"];
170
  }
171
  Internet;
172
  PBX_L -- Internet [label="IP"];
173
  PBX_R -- Internet [label="IP"];
174
}
175
}}
176 16 laforge
177 6 laforge
178
h3. Virtual E1 timeslot mux
179
180
In this situation, we assume there is a hub terminating many E1-over-IP links, and whihc then provides services to multiplex/switch on a per-timeslot basis between those links.
181
182
We'd have different scenarios for different timeslots:
183
* static mapping of timeslots between E1 lines
184
** like leased lines, e.g. from a config file
185
* exposure of timeslot to userspace via DAHDI
186
** ISDN or SS7 signaling
187
** media playback
188
** media gateway with RTP on the other side
189
* dynamic mapping of timeslots between E1 lines
190
** under control of soft-switch for voice / data calls or the like
Add picture from clipboard (Maximum size: 48.8 MB)