<?xml version="1.0" encoding="ISO-8859-1"?>
<rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/'>
	<channel>
		<title>The Corelatus Blog - Entries from May 2010</title>
		<description>Entries from May 2010</description>
                <link>../../../</link>

	
	<item>
		<title>Decoding UMTS (3G) Interfaces with Wireshark</title>
		<link>../../../Decoding_UMTS__3G__Interfaces_with_Wireshark.html</link>        
		<guid isPermaLink="true">../../../Decoding_UMTS__3G__Interfaces_with_Wireshark.html</guid>
                <pubDate>Mon, 24 May 2010 10:19:15 GMT</pubDate>
		<description>&lt;p&gt; 
Many 3G networks use ATM on their internal interfaces, e.g. on the Iub and
Iu-PS interfaces. Those interfaces carry both control information (radio
environment information, attach/detach messages, location updates) and also
subscriber data, for instance IP traffic.
&lt;/p&gt;

&lt;p&gt;
Wireshark understands how to decode those ATM interfaces. Here&#39;s an
example of an interface sniffed by a GTH.  The interface was carrying
IP traffic over ATM on an E1 line.
&lt;/p&gt;

&lt;img alt=&#39;wireshark screenshot&#39; style=&#39;margin-left:-170px&#39; src=&#39;static/atm_llc_interface_screenshot.png&#39;/&gt;

&lt;h3&gt;How to tell the GTH to capture an ATM link&lt;/h3&gt;

&lt;p&gt;To look at a 3G network like this, you need to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Connect one of the GTH&#39;s E1 interfaces to the E1 (or T1) interface
carrying the ATM interface. You typically do that at a cross connect
panel, using a G.772 monitor point.&lt;/li&gt;

&lt;li&gt;Enable the E1 interface you connected.&lt;/li&gt;

&lt;li&gt;Tell the GTH to start decoding ATM AAL5 (and/or AAL2) on that interface&lt;/li&gt;

&lt;li&gt;Convert the captured data to the file format which wireshark understands,
  libpcap.&lt;/li&gt;

&lt;li&gt;Open the captured file in wireshark. (It&#39;s also possible to pipe the
  captured data into wireshark live, both on Windows and Unix-like OSs).&lt;/li&gt;

&lt;/ol&gt;

&lt;p&gt;Taking those steps one at a time, starting with #2:&lt;/p&gt;

&lt;h4&gt;Enable the E1 interface&lt;/h4&gt;

&lt;pre&gt;
&lt;code&gt;
  &lt;span class=&quot;synIdentifier&quot;&gt;&amp;lt;set &lt;/span&gt;&lt;span class=&quot;synType&quot;&gt;name&lt;/span&gt;=&lt;span class=&quot;synConstant&quot;&gt;&#39;pcm3A&#39;&lt;/span&gt;&lt;span class=&quot;synIdentifier&quot;&gt;&amp;gt;&amp;lt;attribute &lt;/span&gt;&lt;span class=&quot;synType&quot;&gt;name&lt;/span&gt;=&lt;span class=&quot;synConstant&quot;&gt;&#39;monitoring&#39;&lt;/span&gt;&lt;span class=&quot;synIdentifier&quot;&gt; &lt;/span&gt;&lt;span class=&quot;synType&quot;&gt;value&lt;/span&gt;=&lt;span class=&quot;synConstant&quot;&gt;&#39;true&#39;&lt;/span&gt;&lt;span class=&quot;synIdentifier&quot;&gt;/&amp;gt;&amp;lt;/set&amp;gt;&lt;/span&gt;
&lt;/code&gt;
&lt;/pre&gt;

&lt;h4&gt;Tell GTH start decoding ATM AAL5&lt;/h4&gt;

&lt;p&gt;IP traffic on ATM is always carried in AAL5. The timeslot
arrangement is usually 1--15 + 17--31. A few sites share the E1 with
other protocols, this is called fractional ATM. The GTH can handle
either scheme.&lt;/p&gt;

&lt;pre&gt;
&lt;code&gt;
  &lt;span class=&quot;synIdentifier&quot;&gt;&amp;lt;new&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;synIdentifier&quot;&gt;&amp;lt;atm_aal5_monitor &lt;/span&gt;&lt;span class=&quot;synType&quot;&gt;ip_addr&lt;/span&gt;=&lt;span class=&quot;synConstant&quot;&gt;&#39;172.16.2.1&#39;&lt;/span&gt;&lt;span class=&quot;synIdentifier&quot;&gt; &lt;/span&gt;&lt;span class=&quot;synType&quot;&gt;ip_port&lt;/span&gt;=&lt;span class=&quot;synConstant&quot;&gt;&#39;1234&#39;&lt;/span&gt;&lt;span class=&quot;synIdentifier&quot;&gt; &lt;/span&gt;&lt;span class=&quot;synType&quot;&gt;vpi&lt;/span&gt;=&lt;span class=&quot;synConstant&quot;&gt;&#39;0&#39;&lt;/span&gt;&lt;span class=&quot;synIdentifier&quot;&gt; &lt;/span&gt;&lt;span class=&quot;synType&quot;&gt;vci&lt;/span&gt;=&lt;span class=&quot;synConstant&quot;&gt;&#39;5&#39;&lt;/span&gt;&lt;span class=&quot;synIdentifier&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;synIdentifier&quot;&gt;&amp;lt;pcm_source &lt;/span&gt;&lt;span class=&quot;synType&quot;&gt;span&lt;/span&gt;=&lt;span class=&quot;synConstant&quot;&gt;&#39;3A&#39;&lt;/span&gt;&lt;span class=&quot;synIdentifier&quot;&gt; &lt;/span&gt;&lt;span class=&quot;synType&quot;&gt;timeslot&lt;/span&gt;=&lt;span class=&quot;synConstant&quot;&gt;&#39;1&#39;&lt;/span&gt;&lt;span class=&quot;synIdentifier&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;synIdentifier&quot;&gt;&amp;lt;pcm_source &lt;/span&gt;&lt;span class=&quot;synType&quot;&gt;span&lt;/span&gt;=&lt;span class=&quot;synConstant&quot;&gt;&#39;3A&#39;&lt;/span&gt;&lt;span class=&quot;synIdentifier&quot;&gt; &lt;/span&gt;&lt;span class=&quot;synType&quot;&gt;timeslot&lt;/span&gt;=&lt;span class=&quot;synConstant&quot;&gt;&#39;2&#39;&lt;/span&gt;&lt;span class=&quot;synIdentifier&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;synIdentifier&quot;&gt;&amp;lt;pcm_source &lt;/span&gt;&lt;span class=&quot;synType&quot;&gt;span&lt;/span&gt;=&lt;span class=&quot;synConstant&quot;&gt;&#39;3A&#39;&lt;/span&gt;&lt;span class=&quot;synIdentifier&quot;&gt; &lt;/span&gt;&lt;span class=&quot;synType&quot;&gt;timeslot&lt;/span&gt;=&lt;span class=&quot;synConstant&quot;&gt;&#39;3&#39;&lt;/span&gt;&lt;span class=&quot;synIdentifier&quot;&gt;/&amp;gt;&lt;/span&gt;
      ..
      &lt;span class=&quot;synIdentifier&quot;&gt;&amp;lt;pcm_source &lt;/span&gt;&lt;span class=&quot;synType&quot;&gt;span&lt;/span&gt;=&lt;span class=&quot;synConstant&quot;&gt;&#39;3A&#39;&lt;/span&gt;&lt;span class=&quot;synIdentifier&quot;&gt; &lt;/span&gt;&lt;span class=&quot;synType&quot;&gt;timeslot&lt;/span&gt;=&lt;span class=&quot;synConstant&quot;&gt;&#39;15&#39;&lt;/span&gt;&lt;span class=&quot;synIdentifier&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;synIdentifier&quot;&gt;&amp;lt;pcm_source &lt;/span&gt;&lt;span class=&quot;synType&quot;&gt;span&lt;/span&gt;=&lt;span class=&quot;synConstant&quot;&gt;&#39;3A&#39;&lt;/span&gt;&lt;span class=&quot;synIdentifier&quot;&gt; &lt;/span&gt;&lt;span class=&quot;synType&quot;&gt;timeslot&lt;/span&gt;=&lt;span class=&quot;synConstant&quot;&gt;&#39;17&#39;&lt;/span&gt;&lt;span class=&quot;synIdentifier&quot;&gt;/&amp;gt;&lt;/span&gt;
      ..
      &lt;span class=&quot;synIdentifier&quot;&gt;&amp;lt;pcm_source &lt;/span&gt;&lt;span class=&quot;synType&quot;&gt;span&lt;/span&gt;=&lt;span class=&quot;synConstant&quot;&gt;&#39;3A&#39;&lt;/span&gt;&lt;span class=&quot;synIdentifier&quot;&gt; &lt;/span&gt;&lt;span class=&quot;synType&quot;&gt;timeslot&lt;/span&gt;=&lt;span class=&quot;synConstant&quot;&gt;&#39;31&#39;&lt;/span&gt;&lt;span class=&quot;synIdentifier&quot;&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;synIdentifier&quot;&gt;&amp;lt;/fr_monitor&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;synIdentifier&quot;&gt;&amp;lt;/new&amp;gt;&lt;/span&gt;
&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;
In this example, the VPI/VCI is 0/5. If you know the VPI/VCI in advance,
great. If you don&#39;t, the GTH can sniff traffic at the AAL0 interface and
show you which VPI/VCI are active on the link.
&lt;/p&gt;

&lt;h4&gt;Convert the captured data&lt;/h4&gt;

&lt;p&gt;GTH sends out data in a format described in
the &lt;a href=&#39;www.corelatus.com/gth/api/gth_api.pdf&#39;&gt;API manual&lt;/a&gt;.
Wireshark wants the data to be in libpcap format. save_to_pcap.erl, in
the &lt;a href=&#39;http://www.corelatus.com/gth/api/gth_erlang_api.zip&#39;&gt;sample
Erlang code for GTH&lt;/a&gt; can do the conversion, like this:
&lt;/p&gt;

&lt;pre&gt;
&lt;code&gt;
  &lt;span class=&quot;synIdentifier&quot;&gt;save_to_pcap:from_file&lt;/span&gt;(&lt;span class=&quot;synConstant&quot;&gt;&amp;quot;/tmp/captured.raw&amp;quot;&lt;/span&gt;, &lt;span class=&quot;synConstant&quot;&gt;&amp;quot;/tmp/captured.pcap&amp;quot;&lt;/span&gt;)&lt;span class=&quot;synSpecial&quot;&gt;.&lt;/span&gt;
&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;
  A lazier approach is to let save_to_pcap.erl configure the GTH and
start the capture:
&lt;/p&gt;

&lt;pre&gt;
&lt;code&gt;
  &lt;span class=&quot;synIdentifier&quot;&gt;save_to_pcap:aal5&lt;/span&gt;(&lt;span class=&quot;synConstant&quot;&gt;&amp;quot;172.16.2.7&amp;quot;&lt;/span&gt;, &lt;span class=&quot;synConstant&quot;&gt;&amp;quot;3A&amp;quot;&lt;/span&gt;, &lt;span class=&quot;synIdentifier&quot;&gt;lists:seq&lt;/span&gt;(&lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt;,&lt;span class=&quot;synConstant&quot;&gt;15&lt;/span&gt;) &lt;span class=&quot;synStatement&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;synIdentifier&quot;&gt;lists:seq&lt;/span&gt;(&lt;span class=&quot;synConstant&quot;&gt;17&lt;/span&gt;,&lt;span class=&quot;synConstant&quot;&gt;31&lt;/span&gt;),
  {&lt;span class=&quot;synConstant&quot;&gt;0&lt;/span&gt;,&lt;span class=&quot;synConstant&quot;&gt;5&lt;/span&gt;}, &lt;span class=&quot;synConstant&quot;&gt;&amp;quot;aal5.pcap&amp;quot;&lt;/span&gt;)&lt;span class=&quot;synSpecial&quot;&gt;.&lt;/span&gt;
&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;  
  The &lt;a href=&#39;http://www.corelatus.com/gth/api/gth_c_examples.zip&#39;&gt;C version
    &lt;/a&gt;of save_to_pcap can currently only convert MTP-2, not AAL5. If
    you want it extended, send mail (address at top right).
&lt;/p&gt;


&lt;h4&gt;Start up wireshark&lt;/h4&gt;

&lt;p&gt;
Recent versions of Wireshark, e.g. 1.2.7, can decode such capture files
out of the box, without any configuration. Finished.
&lt;/p&gt;

</description>
	</item>
	
        </channel>
</rss>

