Project

General

Profile

Proposed efficient TDMoIP » History » Version 12

laforge, 01/31/2022 11:12 AM
link to osmo-e1d e1oip

1 1 laforge
h1. Proposed efficient TDMoIP
2
3
{{>toc}}
4
5
This wiki page exists to collect some ideas about a proposed, new type of TDMoIP protocol.
6
7 10 laforge
The high-level goal of the protocol is to be able to carry E1 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
h2. Major design goals
10
11
h3. mandatory features
12
13
* *structure-agnostic*
14
** suitable for any kind of traffic, whether ISDN/Q921, GSM-Abis, SS7, ATM, Frame Relay, ...
15
** support for framed E1
16
** support for channelized and non-channelized E1
17
** support for E1 with and without CRC4
18
* *bandwidth-efficient*
19
** the average hobbyist doesn't want to waste 2Mbps full-duplex bandwidth even if no traffic at all is communicated
20
* *suitable for use with dynamic IP and NAT*
21
** at least on the client side, it should work with dynamic IP and through NAT
22
** server side is required to have static IP
23
* *support for IPv4 and IPv6*
24
** there are more and more users in the public internet without real IPv4 connectivity
25
* *support for cryptographic authentication*
26
** users should authenticate themselves against the server via some challenge-resposne mechanism safe against eavesdroppers
27
28
h3. optional features
29
30
* support for unframed E1
31
* support for T1 (in the protocol; not in the proposed primary [[Ice1usb]] based hardware implementation)
32
* support for confidentiality (encryption)
33
34
h2. Current WIP thoughts on implementation
35
36 4 laforge
h3. suppress transmission of idle timeslots
37 1 laforge
38 3 laforge
This is the most critical part of reducing the background traffic for an [relatively] idle link.
39 1 laforge
40 3 laforge
We'd need to know (ideally auto-detect) which timeslots are in use, and then only tramsmit those with actual traffic in them.
41
42 1 laforge
The actual packets then need to contain some kind of information which timeslots are present in the current packet, for example by including a 32bit bit-mask.
43 3 laforge
44
h4. traffic slots (B channels)
45
46
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.
47
48
h4. HDLC signaling slots (D channels)
49
50 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.
51 1 laforge
52
h3. batching / aggregation of frames
53
54
Batching several frames in a single packet serves the following purposes
55
* reduce the amount of packets per second
56
* reduce the proportional overhead for IP/UDP/protocol headers
57
58
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)
59
60
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.
61
62
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.
63
64
h3. optional HDLC processing on both sides
65
66
Many types of E1 traffic have one 64k slot for signalling (ISDN, Abis, SS7).  If this 64k bitstream is transmitted transparently at all times, we would end up with something like 120 kbit/s background traffic.
67
68
This could optionally be optimized further by telling the converters on both sides that a certain slot is in HDLC mode.  In this mode, the repeated sequences of flag octets are suppressed, and only the HDLC payload (with or without FCS) is passed over IP.  This would make an idle signalling channel free of bandwidth utilization
69
70
h3. clocking / timing / jitter
71
72
The curent idea is to use [[icE1usb]] as the physical E1 interface.  It has a built-in GPS-DO and hence would allow 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.
73
74
Some pre-buffering and a [minimal] jitter buffer is required to compensate for jitter in the IP transport medium.
75
76
h3. Initial / Preferred Hardware implementation
77
78
The idea would be to use something small and compact, with limited power consumption like an [[icE1usb]] plus an embedded Linux system like a Raspberry Pi, Banaa Pi, Odroid XU4, PC-Engines APU or the like.
79 9 laforge
80
Initial, incomplete WIP code can be found in the @laforge/e1oip@ branch of @osmo-e1d.git@
81 1 laforge
82
h3. Direct DAHDI driver
83
84
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:
85
86
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.
87 6 laforge
88
h2. Use cases
89
90
h3. pysical E1 line via Internet
91
92
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:
93
94
{{graphviz_link()
95
graph {
96
  rankdir=LR;
97
  subgraph cluster_L {
98
     label="Site L";
99
     PBX_L [label="PBX"];
100
     icE1usb_L [label="icE1usb"];
101
     GW_L [label="GW L"];
102
     PBX_L -- icE1usb_L [label="E1"];
103
     icE1usb_L -- GW_L [label="USB"];
104
  }
105
  subgraph cluster_R {
106
     label="Site R";
107
     PBX_R [label="PBX"];
108
     icE1usb_R [label="icE1usb"];
109
     GW_R [label="GW R"];
110
     PBX_R -- icE1usb_R [label="E1"];
111
     icE1usb_R -- GW_R [label="USB"];
112
  }
113
  Internet;
114
  GW_L -- Internet [label="IP"];
115
  GW_R -- Internet [label="IP"];
116
}
117
}}
118
119 7 laforge
h4. clocking
120
121
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.
122
123 12 laforge
h4. implementation
124
125
As of January 30, 2022, a basic proof-of-concept implementation of this can be found in the @lafore/e1oip@ branch of "osmo-e1d":https://git.osmocom.org/osmo-e1d/log/?h=laforge/e1oip
126 6 laforge
h3. Physical E1 to virtual E1
127
128
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).
129
130
{{graphviz_link()
131
graph {
132
  rankdir=LR;
133
  subgraph cluster_L {
134
     label="Site L";
135
     PBX_L [label="PBX"];
136
     icE1usb_L [label="icE1usb"];
137
     GW_L [label="GW L"];
138
     PBX_L -- icE1usb_L [label="E1"];
139
     icE1usb_L -- GW_L [label="USB"];
140
  }
141
  subgraph cluster_R {
142
     label="Site R";
143
     PBX_R [label="PBX\n(Virtual DAHDI)"];
144
  }
145
  Internet;
146
  GW_L -- Internet [label="IP"];
147
  PBX_R -- Internet [label="IP"];
148
}
149 1 laforge
}}
150 8 laforge
151
h4. clocking
152
153
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.
154
155
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.
156 6 laforge
157
h3. Virtual E1 to Virtual E1
158
159
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.
160
161
If the virtual E1 is exposed via the same DAHDI interface, the applications (e.g. softswitch) will not notice any differnce.
162
163
{{graphviz_link()
164
graph {
165
  rankdir=LR;
166
  subgraph cluster_L {
167
     label="Site L";
168
     PBX_L [label="PBX\n(Virtual DAHDI)"];
169
  }
170
  subgraph cluster_R {
171
     label="Site R";
172
     PBX_R [label="PBX\n(Virtual DAHDI)"];
173
  }
174
  Internet;
175
  PBX_L -- Internet [label="IP"];
176
  PBX_R -- Internet [label="IP"];
177
}
178
}}
179
180
h3. Virtual E1 timeslot mux
181
182
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.
183
184
We'd have different scenarios for different timeslots:
185
* static mapping of timeslots between E1 lines
186
** like leased lines, e.g. from a config file
187
* exposure of timeslot to userspace via DAHDI
188
** ISDN or SS7 signaling
189
** media playback
190
** media gateway with RTP on the other side
191
* dynamic mapping of timeslots between E1 lines
192
** under control of soft-switch for voice / data calls or the like
Add picture from clipboard (Maximum size: 48.8 MB)