<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-35259639</id><updated>2010-04-06T07:16:38.609-07:00</updated><title type='text'>Lynn's Industrial Protocols over IP</title><subtitle type='html'>Discussing my adventures in "IP-Enabling" commercial devices that don't always appreciate being liberated from serial or Ethernet. I have been Ethernet-enabling serial devices for over a decade.  However my current job involves putting Ethernet devices up on cellular (as in cell-phone) machine-to-machine data plans. I currently have a public demo site with with Rockwell, Modbus, GE, Siemens, DNP3 and other industrial PLC/devices up on cellular.</subtitle><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default'/><link rel='alternate' type='text/html' href='http://blog.iatips.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default?start-index=26&amp;max-results=25'/><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://iatips.com/blog/atom.xml'/><author><name>Lynn August Linse</name><uri>http://www.blogger.com/profile/01534730541144544922</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>61</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-35259639.post-8643549453296253694</id><published>2010-04-06T07:16:00.001-07:00</published><updated>2010-04-06T07:16:38.625-07:00</updated><title type='text'>This blog has moved</title><content type='html'>&lt;br /&gt;       This blog is now located at http://iatip.blogspot.com/.&lt;br /&gt;       You will be automatically redirected in 30 seconds, or you may click &lt;a href='http://iatip.blogspot.com/'&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;       For feed subscribers, please update your feed subscriptions to&lt;br /&gt;       http://iatip.blogspot.com/feeds/posts/default.&lt;br /&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35259639-8643549453296253694?l=blog.iatips.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/8643549453296253694/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=35259639&amp;postID=8643549453296253694' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/8643549453296253694'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/8643549453296253694'/><link rel='alternate' type='text/html' href='http://blog.iatips.com/2010/04/this-blog-has-moved.html' title='This blog has moved'/><author><name>Lynn August Linse</name><uri>http://www.blogger.com/profile/01534730541144544922</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='05116158169562844583'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35259639.post-1663914190055420403</id><published>2010-04-06T06:39:00.000-07:00</published><updated>2010-04-06T06:58:30.013-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='battery'/><category scheme='http://www.blogger.com/atom/ns#' term='Cellular'/><title type='text'>How Long to Obtain Cellular IP?</title><content type='html'>Well, I finally have a SIM, so I can actually do cellular tests again.  It is a GSM 'Capped Plan' with 20/MB of data per month for $30.  The 'capped' means that even if I go over the 20MB by dozens of GB, the maximum charge will be $130.  It is a truly 'unlimited plan' for that $130.  What's the catch?  If I hit the 'Cap' two months in a row, then the carrier either cancels the account or forces me to start paying full-rate for a normal 1GB or 5GB/mo plan.&lt;br /&gt;&lt;br /&gt;The 20MB is fine for me since I am testing methods to keep data small.&lt;br /&gt;&lt;br /&gt;My current tests have a sleep devices waking, then obtaining a cell-link.  For example, I am working on a Digi gateway called an X3 (not on Digi's web site yet).  The X3 can power itself down completely, using a real-time clock chip to wake it at a future time.&lt;br /&gt;&lt;br /&gt;I ran a test for 5 days, waking the X3 device every 10 minutes and clocked how long it too for the GSM carrier to assign an IP to the X3:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The fastest time was 23.7 seconds (half a minute)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The slowest time was 97.0 seconds (1 and a half minutes)&lt;/li&gt;&lt;li&gt;The average time was 28.6 seconds (so most near 30 seconds, with a few long outliers)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Note that there will be several seconds of CPU start-up time in there - I can only know the RTC wake-up time (which I loaded into the RTC last cycle) compared to the RTC time when the IP address is assigned.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Why is this important?  Because the cellular modem consumes a LOT of power for the duration of this variable time.  It is one of the variable which makes estimating battery life difficult.&lt;br /&gt;&lt;br /&gt;My next test will include actually doing work - probably sending a Modbus/TCP transaction to a DSL-based server.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35259639-1663914190055420403?l=blog.iatips.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/1663914190055420403/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=35259639&amp;postID=1663914190055420403' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/1663914190055420403'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/1663914190055420403'/><link rel='alternate' type='text/html' href='http://blog.iatips.com/2010/04/how-long-to-obtain-cellular-ip.html' title='How Long to Obtain Cellular IP?'/><author><name>Lynn August Linse</name><uri>http://www.blogger.com/profile/01534730541144544922</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='05116158169562844583'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35259639.post-5040129437520082991</id><published>2009-10-13T14:09:00.000-07:00</published><updated>2009-10-13T14:47:16.040-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Device Access'/><category scheme='http://www.blogger.com/atom/ns#' term='Cellular'/><category scheme='http://www.blogger.com/atom/ns#' term='WAN'/><category scheme='http://www.blogger.com/atom/ns#' term='Modbus'/><title type='text'>Cellular DNS Lookup Cost</title><content type='html'>I have been working with a customer using two cellular devices with a DDNS provider, so the 'Client/Master' device used a DNS name to connect to the remote 'Server/Slave' device.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Cost #1 - added delay&lt;br /&gt;&lt;/span&gt;The first cost they were seeing was added time lag to open a connection. &lt;br /&gt;&lt;ul&gt;&lt;li&gt;To open a TCP socket between two idle (but connected) cellular devices requires each device to be "unparked" by their cell tower.  So the client device would need to request a resource and be assigned it by the local cell tower - this can require 2 to 5 seconds.  &lt;/li&gt;&lt;li&gt;Next, a DNS query would be sent and a response would be required.  Some cellular carrier DNS servers don't seem very peppy, so this could add a few more seconds.&lt;/li&gt;&lt;li&gt;Then the client device would receive notice from the cell-tower control channel to request a resource and be "unparked"&lt;/li&gt;&lt;li&gt;Finally, after "X" seconds of delay and lag the client device would receive confirmation that the socket is open (or it might have given up to fast already &amp;amp; aborted).&lt;/li&gt;&lt;/ul&gt;So using a DNS name instead of an IP Address might add a few seconds delay - which might be just enough to cause problems.  The customer I am working with has a client tool with a hard-coded MAX timeout of 25 seconds, and it seems to often hit this during original socket open.  So they have no trouble communicating once the TCP socket is open, but it can be difficult to get the first data packets moving.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Cost #2 - added traffic&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;/span&gt;&lt;/span&gt;Of course the DNS query also adds raw traffic.  DNS uses UDP, and a query might be 44 bytes and a response 60 bytes.  So 104 bytes extra to open a TCP socket (which can be hundreds of bytes by itself). &lt;br /&gt;&lt;br /&gt;Is this traffic important?  Perhaps.  Perhaps Not.  Most cell plans today round up traffic hourly, so an extra 104 bytes for DNS and 150 bytes for a Modbus poll/response is still "1K of traffic".&lt;br /&gt;&lt;br /&gt;For TCP/IP, the DNS lookup would only occur for a socket open.  So regardless of the DNS name Time-To-Live, you might only see this added 104 bytes once per day or month - or anytime you open/reopen a socket.&lt;br /&gt;&lt;br /&gt;However for UDP/IP you MIGHT see this DNS lookup for every packet.  For example, a DDNS record from dyndns.org might expire in 60 seconds, so sending one 100 byte UDP packet every 5 minutes, could become 204 bytes per 5 minutes, so 2448 bytes per hour rounded up to 3K per hour or 72K per day and NOT the 49K expected.&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;So while UDP/IP can save a lot of traffic cost over TCP/IP, if short-lived DNS names are required then some of UDP's savings will be lost. &lt;br /&gt;&lt;br /&gt;One solution is a custom application to do indirect DNS lookup.  In other words, to directly lookup the DNS name within the application, then to ignore the DNS "Time-to-Live" and use only the cached IP address UNTIL COMMUNICATIONS FAILS - then do a new lookup.  This is not how normal operating system DNS caches work - they literally honor the DNS server's time to live and would cause a new look up based on the 60 second time-to-live.  Yet this is general safe for cellular end-devices since normally the dynamic IP only changes when the cell link is lost, so the remote IP is unlikely to change more than a few times per day.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35259639-5040129437520082991?l=blog.iatips.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/5040129437520082991/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=35259639&amp;postID=5040129437520082991' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/5040129437520082991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/5040129437520082991'/><link rel='alternate' type='text/html' href='http://blog.iatips.com/2009/10/cellular-dns-lookup-cost.html' title='Cellular DNS Lookup Cost'/><author><name>Lynn August Linse</name><uri>http://www.blogger.com/profile/01534730541144544922</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='05116158169562844583'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35259639.post-7969464053593369742</id><published>2009-06-10T06:33:00.000-07:00</published><updated>2009-06-10T06:54:42.218-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cellular'/><category scheme='http://www.blogger.com/atom/ns#' term='Rockwell'/><title type='text'>Does Cellular 3G help your Rockwell PLC Access?</title><content type='html'>&lt;span style="font-size:130%;"&gt;In short - No.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Cellular data systems are continuously being sub-optimized for the unidirectional fire-hose paradigm of web page viewing, media streaming, image viewing, email download and so on.  In other words, you only see the 3G "broadband" performance when you have tens of thousands of bytes to shove in one direction.&lt;br /&gt;&lt;br /&gt;Actual field tests of RSLogix 5000 downloading to ControlLogix processors show that using 3G is only a few percent faster than standard technology - plus still probably slower than analog dialup.  The problem is caused by RSLogix and Ethernet/IP moving thousands of small transactions in a half-duplex manner.  So RSLogix downloads the PLC object by object, confirming success after each object is written.  With cellular latency, each of these transactions can take up to a second to complete, so multiple 1 second by 3000 to 8000 transactions and you have your PLC download time.&lt;br /&gt;&lt;br /&gt;3G apologists will claim "&lt;span style="font-style: italic;"&gt;Oh, but latency in 3G is much lower than older, coarser technologies.&lt;/span&gt;"&lt;br /&gt;&lt;br /&gt;That may be, but when the rubber meets the road (aka RSLogix5000 downloads), 3G doesn't perform any better.  3G might have other value, but for most people moving data "faster" just means your data usage and the final bill racks up faster as well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35259639-7969464053593369742?l=blog.iatips.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/7969464053593369742/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=35259639&amp;postID=7969464053593369742' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/7969464053593369742'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/7969464053593369742'/><link rel='alternate' type='text/html' href='http://blog.iatips.com/2009/06/does-cellular-3g-help-your-rockwell-plc.html' title='Does Cellular 3G help your Rockwell PLC Access?'/><author><name>Lynn August Linse</name><uri>http://www.blogger.com/profile/01534730541144544922</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='05116158169562844583'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35259639.post-949554851077781585</id><published>2009-06-06T06:32:00.000-07:00</published><updated>2009-06-06T07:49:37.388-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Industrial'/><category scheme='http://www.blogger.com/atom/ns#' term='Cellular'/><category scheme='http://www.blogger.com/atom/ns#' term='DF1'/><category scheme='http://www.blogger.com/atom/ns#' term='Rockwell'/><title type='text'>Cellular to Redundant Rockwell ControlLogix</title><content type='html'>Can &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;RSLinx&lt;/span&gt; access a redundant pair via cellular?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Background&lt;/span&gt;&lt;br /&gt;A Pair of Rockwell Automation &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;ControlLogix&lt;/span&gt; racks with &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;SRM&lt;/span&gt; Module and dual &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;ENBT's&lt;/span&gt; will share a pair of &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;IP&lt;/span&gt; addresses. One &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;IP&lt;/span&gt; address is "the primary", and the other &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;IP&lt;/span&gt; is "the backup" (if/when it is online).  When the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;ENBTs&lt;/span&gt; switch role, they will issue the requisite Gratuitous &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;ARPs&lt;/span&gt; to cause other local Ethernet devices  (like a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;Digi&lt;/span&gt; cellular gateway) to update their &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;ARP&lt;/span&gt; cache, thus comprehending that the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;IP&lt;/span&gt;-to-MAC address mapping has changed.  Thus a NAT/Router forwarding to the primary &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;IP&lt;/span&gt; should handle the fail-over with only modest bumps.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;Config&lt;/span&gt; Details&lt;/span&gt;&lt;br /&gt;A user desiring &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;RSLinx&lt;/span&gt; (and &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;RSLogix&lt;/span&gt; or &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;RSView&lt;/span&gt; etc) to access a remote Rockwell &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;ControlLogix&lt;/span&gt; (any RA/AB &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;PLC&lt;/span&gt;) will be doing what the industry calls "&lt;span style="font-weight: bold; font-style: italic;"&gt;Mobile-Terminated&lt;/span&gt;" access.  The user needs to arrange a cell plan which offers either a fixed &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;IP&lt;/span&gt; address to target, or at least a Dynamic &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_20"&gt;DNS&lt;/span&gt; name to target (like tk101.iatips.com or panel2.digi.com).  This is NOT what you obtain with an iPhone or personal air-card data plan. Those will have private &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;IPs&lt;/span&gt; which only permit outgoing connections - called "&lt;span style="font-weight: bold; font-style: italic;"&gt;Mobile-Originated&lt;/span&gt;".  &lt;span style="font-style: italic;"&gt;That was a buzzword lesson - expect to be asked about those two terms when you ask about cellular data plans!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So once you can arrange your &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;targetable&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;IP&lt;/span&gt; or &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_24"&gt;DNS&lt;/span&gt; name, you need a cellular router such as one of the &lt;a href="http://www.digi.com/products/cellulargateways/digiconnectwanfamily.jsp"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_25"&gt;Digi&lt;/span&gt; Connect WAN family products.&lt;/a&gt;  My favorite model today is the &lt;a href="http://www.digi.com/products/wirelessdropinnetworking/connectportxgateways.jsp"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_26"&gt;ConnectPort&lt;/span&gt; X4&lt;/a&gt;, but that has large memory for Python programming, wireless mesh and other goodies you won't need to link up your Rockwell &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_27"&gt;PLC&lt;/span&gt; (Hey, I said it was MY favorite - doesn't mean it has to be yours!)&lt;br /&gt;&lt;br /&gt;Note that contrary to folklore or urban legend, all cellular devices need certification to work on a system - even &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_28"&gt;GSM&lt;/span&gt; devices.  Many small suppliers get around this by including fine-print that say the device buyer is responsible to arrange such legalities, and since you (the buyer) don't read such fine print the salesperson will just say "&lt;span style="font-style: italic;"&gt;Heck, it's &lt;/span&gt;&lt;span style="font-style: italic;" class="blsp-spelling-error" id="SPELLING_ERROR_29"&gt;GSM&lt;/span&gt;&lt;span style="font-style: italic;"&gt; - so it is allowed everywhere world wide!&lt;/span&gt;"  Deal with this issue as you see fit, but &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_30"&gt;Digi&lt;/span&gt; has more formal certs in more &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_31"&gt;countries&lt;/span&gt; worldwide than any of the other industrial players.&lt;br /&gt;&lt;br /&gt;But back on subject, when the gateway comes up, it is assigned your known &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_32"&gt;IP&lt;/span&gt; or &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_33"&gt;DNS&lt;/span&gt; name.  This is exactly how your home or business &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_34"&gt;DSL&lt;/span&gt;/T-line line works. Yet when &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_35"&gt;RSLinx&lt;/span&gt; tries to talk to the gateway on Ethernet/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_36"&gt;IP's&lt;/span&gt; well-known &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_37"&gt;TCP&lt;/span&gt; port of 44818, the gateway will reject the connection as a weird attempt at hacking. You need to instruct the gateway:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;to not reject the Ethernet/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_38"&gt;IP&lt;/span&gt; traffic on &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_39"&gt;TCP&lt;/span&gt; port 44818&lt;/li&gt;&lt;/ol&gt;&lt;ol&gt;&lt;li&gt;to instead forward it to a local &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_40"&gt;IP&lt;/span&gt; on the Ethernet - which would be the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_41"&gt;IP&lt;/span&gt; of your &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_42"&gt;ControlLogix&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_43"&gt;ENBT&lt;/span&gt; (or the primary &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_44"&gt;IP&lt;/span&gt; of the redundant pair)&lt;/li&gt;&lt;/ol&gt;The details of how this man-in-the-middle fake-out works is fascinating (to me), but quite a pile of text.  If you are interested, &lt;a href="http://blog.iatips.com/2007/06/real-world-cellular-controllogix-plc.html"&gt;this older blog entry goes through the NAT/Router details blow by blow.&lt;/a&gt;  But bottom-line, your &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_45"&gt;ENBT&lt;/span&gt; receives the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_46"&gt;RSLinx&lt;/span&gt; packet and needs to have its own Gateway &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_47"&gt;IP&lt;/span&gt; set to the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_48"&gt;Digi&lt;/span&gt; gateway's local Ethernet &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_49"&gt;IP&lt;/span&gt; address.  &lt;span style="font-style: italic;"&gt;Free hint: 9 out of 10 guys who call saying "Why can't &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_50"&gt;RSLinx&lt;/span&gt; see my &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_51"&gt;PLC&lt;/span&gt; through your &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_52"&gt;Digi&lt;/span&gt; gateway?" have failed to set the correct Gateway &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_53"&gt;IP&lt;/span&gt; in the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_54"&gt;PLC&lt;/span&gt;/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_55"&gt;ENBT&lt;/span&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So assuming your gateway and &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_56"&gt;PLC&lt;/span&gt; are setup correctly, then targeting the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_57"&gt;RSLinx&lt;/span&gt; "Ethernet Devices" driver (with timeouts slowed down to 30 seconds) will cause your &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_58"&gt;PLC's&lt;/span&gt; little icon to show up.  With &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_59"&gt;RSLinx&lt;/span&gt; running, you will create up to 200MB of billable cell traffic per month doing absolutely nothing - so don't leave it active.  &lt;span style="font-style: italic;"&gt;Note that the "Ethernet/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_60"&gt;IP&lt;/span&gt; Driver" won't work as it requires &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_61"&gt;UDP&lt;/span&gt; broadcast, which can't be routed over the Internet.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;At this point you'll say "Cool, now can I see my backup &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_62"&gt;ControlLogix&lt;/span&gt; or a second &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_63"&gt;PLC&lt;/span&gt;?", and the simple answer is "No."  One of the realities of &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_64"&gt;RSLinx&lt;/span&gt; and AB &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_65"&gt;PLC&lt;/span&gt; is that the Ethernet/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_66"&gt;IP&lt;/span&gt; protocol is hard fixed to only the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_67"&gt;TCP&lt;/span&gt;/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_68"&gt;IP&lt;/span&gt; port 44818, and the NAT/Router can only forward &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_69"&gt;TCP&lt;/span&gt; port 44818 to a single local &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_70"&gt;PLC&lt;/span&gt;.  The easy fix would be for Rockwell to change &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_71"&gt;RSLinx&lt;/span&gt; to enable adding both an &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_72"&gt;IP&lt;/span&gt;/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_73"&gt;DNS&lt;/span&gt; name and &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_74"&gt;TCP&lt;/span&gt; port number - then the NAT/Router &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_75"&gt;could&lt;/span&gt; forward &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_76"&gt;TCP&lt;/span&gt; port 44818 as 44818 to the primary &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_77"&gt;ENBT&lt;/span&gt;, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_78"&gt;TCP&lt;/span&gt; 44819 fixed-up to 44818 to the secondary &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_79"&gt;ENBT&lt;/span&gt;, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_80"&gt;TCP&lt;/span&gt; 17256 (a random number :-]) fixed up to 44818 to an &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_81"&gt;RSView&lt;/span&gt; panel and so on.  Because the NAT/Router can restore all traffic to 44818 on the local Ethernet, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_82"&gt;RSLinx&lt;/span&gt; is the only tool needing to change. &lt;br /&gt;&lt;br /&gt;Will Rockwell ever do this?  It would take a programmer half a day to do - then a few weeks to test - then a few months to document and &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_83"&gt;forestall&lt;/span&gt; support headaches.  So who knows.  They might.  They might not.&lt;br /&gt;&lt;br /&gt;But &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_84"&gt;bottomline&lt;/span&gt; is a simple cellular NAT/Router can be used to talk to a pair of &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_85"&gt;ControlLogix&lt;/span&gt; running in a &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_86"&gt;redundant&lt;/span&gt; configuration - you will just be limited to seeing only the primary &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_87"&gt;ENBT&lt;/span&gt; and the primary &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_88"&gt;IP&lt;/span&gt; address.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35259639-949554851077781585?l=blog.iatips.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/949554851077781585/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=35259639&amp;postID=949554851077781585' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/949554851077781585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/949554851077781585'/><link rel='alternate' type='text/html' href='http://blog.iatips.com/2009/06/cellular-to-redundant-rockwell.html' title='Cellular to Redundant Rockwell ControlLogix'/><author><name>Lynn August Linse</name><uri>http://www.blogger.com/profile/01534730541144544922</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='05116158169562844583'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35259639.post-8160611394173821694</id><published>2009-04-07T05:56:00.000-07:00</published><updated>2009-04-07T07:16:17.678-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Device Access'/><category scheme='http://www.blogger.com/atom/ns#' term='zigbee'/><category scheme='http://www.blogger.com/atom/ns#' term='Cellular'/><category scheme='http://www.blogger.com/atom/ns#' term='Ethernet'/><title type='text'>Cellular Antenna and your PLC</title><content type='html'>One of my customers is having fun with one of their own customers. My customer uses Digi gateways running a Python application to collect hourly tank levels, which are fetched by cellular once per day. The tanks hold 250-gallons of a chemical additive which is injected at a variable rate into crude oil pipelines.  Small battery-powered ultrasonic level sensors (www.massa.com) push the last 8 hourly samples every few hours using wireless IEEE 802.15.4 (aka Zigbee). The end customer's goal is to forecast when the tanks need to be refilled ... and I don't mean just receive an alarm when it is running low, they literally want to plan truck routes in advance.&lt;br /&gt;&lt;br /&gt;Fun stuff.&lt;br /&gt;&lt;br /&gt;The problem is that one of the pilot sites has bad cell coverage, meaning many days the central system cannot upload the log.  Of course the data eventually it all uploads since it is held for over a month. Now, never mind that this system sits down in a dry wash (a small valley), the end-user says "Hah, that's because carrier A*** stinks; we all love carrier S****." My customer does not want to mix carriers - especially since negotiated pricing between the two in question is so different.&lt;br /&gt;&lt;br /&gt;So remember that "coverage" for fixed RTU must be viewed differently from "coverage" for mobile uses. &lt;br /&gt;&lt;br /&gt;For a mobile device (or user) "coverage" is defined by the probability that a valid carrier connection will be available as the device moves around. Thus the number of towers (etc) is important, and if there is no signal in one spot, then hopefully will be one a mile or two away.&lt;br /&gt;&lt;br /&gt;Unfortunately, our little RTU bolted to a power pole in that gully won't be moving a mile or two ever. So in the end, "coverage" for a fixed device is defined only by the tower(s) which can be seen.  So the carrier with the best cell-phone coverage might not be the best carrier to support a particular fixed RTU.&lt;br /&gt;&lt;br /&gt;The first step will be to move the RTU up out of the gully, which is easy since the data signals are all wireless and power can be tapped from any of the privately owned power poles.  Probably carrier A*** (stinky or not) will work fine once the RTU moves.  As plan B and make the end-customer feel listened to, a S****-based RTU will be placed on the same pole as the relocated A*** one.  &lt;br /&gt;&lt;br /&gt;Could they run out a long external antenna?  Sure, they could.  But why bother?  Put the RTU where it has a nice signal.  Even in 2 or 3 store buildings we suggest customers put the cellular router up in the roof-area and run the Ethernet UTP it's 100 meters instead of trying to deal with the signal loss in long antenna cables.  We even have customers using 900Mhz Ethernet bridges to link a cellular router placed where it must be placed back to the Ethernet devices which want access.&lt;br /&gt;&lt;br /&gt;Worst case, a directional yagi antenna could be used, however you need to understand that cell towers are routinely turned off without warning. The carriers are truly geared towards mobile users who expect bad signals in some places.  Towers (or the active elements) also move. Most of the cell towers you see along the highway work like strip-malls; a company owning the tower and supplying power leases tower space to a mix of carriers. This allows everyone to be flexible.&lt;br /&gt;&lt;br /&gt;So prematurely locking down a cellular device to a single tower with a directional antenna can cause future problems since it will not see other weaker towers should the targeted tower be turned off or even moved.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35259639-8160611394173821694?l=blog.iatips.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/8160611394173821694/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=35259639&amp;postID=8160611394173821694' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/8160611394173821694'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/8160611394173821694'/><link rel='alternate' type='text/html' href='http://blog.iatips.com/2009/04/cellular-antenna-and-your-plc.html' title='Cellular Antenna and your PLC'/><author><name>Lynn August Linse</name><uri>http://www.blogger.com/profile/01534730541144544922</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='05116158169562844583'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35259639.post-7385825160822663829</id><published>2008-11-25T06:29:00.000-08:00</published><updated>2008-11-25T07:13:56.841-08:00</updated><title type='text'>Ethernet/IP PCCC Service Codes</title><content type='html'>&lt;span style="font-size:130%;"&gt;Summary: the Rockwell PCCC Service Codes (or how to get a 1761-NET-ENI or Digi One IAP to send specific DF1 DST/SRC bytes)&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;A customer had a product which acted as an Ethernet/IP originator (client) and needed to talk through a Digi One IAP to feed DF1 into a DH+ gateway.  The catch is the DH+ gateway used the DF1 destination byte as the DH+ node address - and so far they could only make the Digi One IAP spit out a destination = 1.  This made for pretty boring and unprofitable DH+ design!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;(Sorry: I cannot explain "How to write an Ethernet/IP stack" in a single blog entry, so this entry assumes you already have a product speaking Ethernet/IP and just want to tweak how you talk to remote DF1 devices.)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The PCCC object (code: hex 0x67) is not part of the ODVA spec - it is a vendor specific object used by Rockwell/Allen-Bradley to talk to SLC5, PLC5E and MicroLogix PLC.   I won't fully explain it here ... not much to explain; do a wireshark trace of a ControlLogix talking to a SLC5/05 or MicroLogix 1100 and you'll see all you need to see about the simple object.&lt;br /&gt;&lt;br /&gt;The default service code of 0x4B has this form:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;table border="2"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Exec PCCC Service&lt;/td&gt;&lt;td&gt;4B&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;IOI to PCCC Object&lt;/td&gt;&lt;td&gt;02 20 67 24 01&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Originator Info&lt;/td&gt;&lt;td&gt;07 03 85 50 4d 41 41&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Example PCCC Message&lt;/td&gt;&lt;td&gt;0f 00 5c 00 a2 14 07 89 00 00&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/span&gt;&lt;br /&gt;The only mystery here should be the "Originator Info".  The 07 means a total of 7 bytes (including the 07).  0385 is a unique sequence number which you should change between messages.  The 504d4141 is a "CIP Serial Number" which must be unique to your vendor id - most vendors just use the last 4 octets of an Ethernet MAC address.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;However, there is NO remote node or slave address info&lt;/span&gt;, so the Digi One IAP or 1761-NET-ENI will create a DF1 message for destination=1 and source=0.  So back to the customer's question ... how to force a DF1 message with say destination=5 and source=2?&lt;br /&gt;&lt;br /&gt;The easiest solution is to switch to service code 0x4C, which has this form:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;table border="2"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;DH+Like Service&lt;/td&gt;&lt;td&gt;4C&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;IOI to PCCC Object&lt;/td&gt;&lt;td&gt;02 20 67 24 01&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;DH+ Like Header&lt;/td&gt;&lt;td&gt;00 00 02 00 00 00 05 00&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Example PCCC Message&lt;/td&gt;&lt;td&gt;0f 00 5c 00 a2 14 07 89 00 00&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/span&gt;&lt;br /&gt;So the "Originator Info" has been swapped with an 8 byte structure of the form AA AA BB XX CC CC DD XX.  The "XX" are control bytes of some sort - just leave 0x00.  "AA AA" is the Destination Link; "BB" is the Destination node; "CC CC" is the Source Link; "DD" is the Source node.&lt;br /&gt;&lt;br /&gt;Voila - both the Digi One IAP and the Rockwell 1761-NET-ENI will now create a DF1 message with destination=5 and source=2.  Not too painful, was it.&lt;br /&gt;&lt;br /&gt;To my knowledge all Rockwell Ethernet/IP PLC accept either code, and if you'd like to see the service 0x4C in action just set your RSLogix5000 MSG block to use "CIP with Source ID" and the ControlLogix switches from using service 0x4B to using 0x4C.&lt;br /&gt;&lt;br /&gt;For completeness, there is a final service code of 0x4D with this form:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;table border="2"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Local PCCC Service&lt;/td&gt;&lt;td&gt;4D&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;IOI to PCCC Object&lt;/td&gt;&lt;td&gt;02 20 67 24 01&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Example PCCC Message&lt;/td&gt;&lt;td&gt;0f 00 5c 00 a2 14 07 89 00 00&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/span&gt;&lt;br /&gt;It is documented in DeviceNet gateway manuals to reduce total byte count - but it also lacks any destination or source info so is of limited use in Ethernet-based systems.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35259639-7385825160822663829?l=blog.iatips.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/7385825160822663829/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=35259639&amp;postID=7385825160822663829' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/7385825160822663829'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/7385825160822663829'/><link rel='alternate' type='text/html' href='http://blog.iatips.com/2008/11/ethernetip-pccc-service-codes.html' title='Ethernet/IP PCCC Service Codes'/><author><name>Lynn August Linse</name><uri>http://www.blogger.com/profile/01534730541144544922</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='05116158169562844583'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35259639.post-5278322795141761709</id><published>2008-08-07T07:05:00.000-07:00</published><updated>2008-08-07T08:23:13.512-07:00</updated><title type='text'>Creeping Firewalls and Change</title><content type='html'>Summary: Network infrastructure changes can create unexpected havoc (surprised?)&lt;br /&gt;&lt;br /&gt;We had a customer come in with a complaint recently about some old products - a 4-port terminal server (a TS4) running &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;Modbus&lt;/span&gt; bridging firmware.  Things had gone on smoothly for years, but suddenly they started having problems which power-cycling the units solved ... obviously it's a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;Digi&lt;/span&gt; problem, right?&lt;br /&gt;&lt;br /&gt;Well, I'm not going to run through all of the issues, but I'll highlight one which will affect more and more people over time.  Remember the old days - first you had dumb &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;dialup&lt;/span&gt; modems, then you had to pay a lot for various error-detection standards, and now all analog modems have a big chip which does a hundred different standard things and you &lt;span style="font-weight: bold; font-style: italic;"&gt;CANNOT buy any low-cost analog dial-up modem which is any dumber than state-of-the-art.&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;Such creep occurs in Ethernet switches also - once hubs were cheap and switches cost a king's ransom.  Now even the "cheap" $19 home switches purchased in big-box stores are auto-sense, auto-cross, auto-&lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_3"&gt;everything&lt;/span&gt;.  The same things happens - once the features are rolled into software or firmware, future revs of the product inherit such features for free ... said another way, it is often cheaper to sell lots of one powerful model than handle the marketing and support costs of a dozen models of various power and feature-set.&lt;br /&gt;&lt;br /&gt;Well, &lt;span style="font-weight: bold; font-style: italic;"&gt;this customer had been upgrading their wide-area-network infrastructure&lt;/span&gt; - a tangle of routed &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;IP&lt;/span&gt;-based leased lines, old analog lines, radio/microwave links and so one, and as part of the improvement the various router/PPP end-points had added &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;stateful&lt;/span&gt; awareness of packets ... part of an increase in US government security demands for utilities.  After all, when you have hundreds of raw Ethernet ports scattered across rural American protected with little more than a padlock and chain-link fence, one has to consider the possibility of someone trying to 'jack' back into the 100% private network from a remote location.&lt;br /&gt;&lt;br /&gt;The issue with such an addition is that routers with firewalls commonly default to a 5-minute &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;TCP&lt;/span&gt; life rule.  Every &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;stateful&lt;/span&gt; firewall creates a table entry for every &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;TCP&lt;/span&gt; or &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;UDP&lt;/span&gt; activity going "out" from a safer network and into a wilder, less safe network - your home &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;DSL&lt;/span&gt;/Cable router does the same thing.  NAT (etc) is optional, but bottom line is the firewall needs to understand and agree to the context of every packet trying to pass through.&lt;br /&gt;&lt;br /&gt;For a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;TCP&lt;/span&gt; socket this usually means at least 1 packet (data or &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;ACK&lt;/span&gt; or &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;Keepalive&lt;/span&gt;) must move every 5 minutes to refresh the context and inform the firewall that the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;TCP&lt;/span&gt; socket is still authorized.  If no packets are seen, the fire wall discards the context and the socket is now ignored and 100% blocked without comment.  Of course both &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;TCP&lt;/span&gt; peers might think the socket is alive and well, but they will never be able to use it again.&lt;br /&gt;&lt;br /&gt;So back to our TS4 off in some remote field - a host computer has 4 &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;TCP&lt;/span&gt; sockets open to it through various routed &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;subnets&lt;/span&gt; and for whatever reason the host doesn't send any new packets for 6 minutes.  The TS4 has no reason to talk since it is connected to &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;Modbus&lt;/span&gt; slaves.  So 6 minutes later the host issues 4 &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;Modbus&lt;/span&gt; requests on 4 sockets, which hit the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_20"&gt;stateful&lt;/span&gt; firewall.  The firewall looks up the context (called forwarding or trigger rules in some systems) and discovers there is no existing context for these &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;TCP&lt;/span&gt; packets.  Well, once upon a time the firewall would just assume since these were safe since they came from the safe side, and thus auto-create a new context, yet modern &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;stateful&lt;/span&gt; firewalls might NOT do this since it was a common hacker exploit to fool firmwalls to move malformed packets.  Thus modern security demands that the first packet of any new &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;TCP&lt;/span&gt; socket be a [SYN] packet.  All four packets are silently discarded as unknown (&lt;span style="font-style: italic;"&gt;note: this is a configurable behavior in most firewalls - to auto-recreate a context for an 'old' &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_24"&gt;TCP&lt;/span&gt; socket continuing or to only allow this for new &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_25"&gt;TCP&lt;/span&gt; sockets.&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;The TS4 never sees the four new request; the host sees neither an [&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_26"&gt;ACK&lt;/span&gt;] nor a [&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_27"&gt;RST&lt;/span&gt;] of the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_28"&gt;TCP&lt;/span&gt; socket, so it retries after 3 seconds, then 6 and so on.  Eventually it comprehends the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_29"&gt;TCP&lt;/span&gt; socket has died and opens four new &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_30"&gt;TCP&lt;/span&gt; sockets.  These are allowed through the firewall since they contain the correct TCP state as being new sockets.  The TS4 sees the four new socket requests and now has eight (8) sockets connected.&lt;br /&gt;&lt;br /&gt;Now you might say "What a minute - the four old sockets were closed!".  Well, yes - the HOST knows they are dead and closed them, but the TS4 does not know this.  Six minutes later, the same is repeated and the TS4 now has 12, then 16, then 20 sockets open.  Eventually the TS4 runs out of resources, and the customer's open recovery option is a hard reboot of the TS4.  This is of course worse if the host only &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_31"&gt;occasionally&lt;/span&gt; takes longer than 5 minutes to poll, since the increase in TS4 sockets could take an unpredictable amount of time to build up.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;How to solve this problem?&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;The first line of defense in the modern &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_32"&gt;IP&lt;/span&gt; age is to always, ALWAYS enable &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_33"&gt;TCP&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_34"&gt;keepalives&lt;/span&gt; with an aggressive 4 minute 30 second idle time in any product you install.  Even if you don't have &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_35"&gt;stateful&lt;/span&gt; packet inspection within your &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_36"&gt;IP&lt;/span&gt; network today, that doesn't mean the next time someone replaces a router or serial &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_37"&gt;PPP&lt;/span&gt; end-point you won't gain one.  Unfortunately the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_38"&gt;Digi&lt;/span&gt; products usually default to a 2 hour &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_39"&gt;TCP&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_40"&gt;Keepalive&lt;/span&gt; - which is also disabled (for historical reasons).  Yet having a 4.5 minute keepalive would have saved the TS4 because the first time the host delayed longer than 4.5 minutes to poll, the TS4 would have sent a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_41"&gt;TCP&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_42"&gt;keepalive&lt;/span&gt; packet back through the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_43"&gt;stateful&lt;/span&gt; firewall, which the host returns and the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_44"&gt;firewall's&lt;/span&gt; context for this socket is refreshed.  Thus when the host does finally send the next &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_45"&gt;Modbus&lt;/span&gt; poll after 6 minutes (1.5 minutes after the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_46"&gt;TCP&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_47"&gt;keepalive&lt;/span&gt; exchange) the firewall is &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_48"&gt;satisfied&lt;/span&gt; with the packets and forwards them out to the TS4.  Everyone is happy.  Plus even if the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_49"&gt;TCP&lt;/span&gt; socket has been aborted by the firewall, the TS4's &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_50"&gt;TCP&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_51"&gt;keepalive&lt;/span&gt; will be &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_52"&gt;silently&lt;/span&gt; discarded and the TS4 will retry and &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_53"&gt;eventually&lt;/span&gt; comprehend that the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_54"&gt;TCP&lt;/span&gt; socket is no longer valid.  This is the purpose of TCP Keepalive - to allow a TCP peer with no data to move to test (and refresh) the health of an idle connection.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The second possibility is unique to the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_55"&gt;Digi&lt;/span&gt; IA/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_56"&gt;Modbus&lt;/span&gt; application.  You can enable a setting &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_57"&gt;referred&lt;/span&gt; to as "&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_58"&gt;idletimeout&lt;/span&gt;" on incoming client or outgoing server connections.  Unlike the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_59"&gt;TCP&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_60"&gt;Keepalive&lt;/span&gt; which create traffic and keeps an idle socket open, the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_61"&gt;idletimeout&lt;/span&gt; literally just aborts an idle socket without giving it any chance to prove it is healthy.  So setting a 5 minute idle timeout in the TS4 would cause it to just assume any incoming &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_62"&gt;Modbus&lt;/span&gt; client (master) connection which has NOT sent a new request is bad.  This setting would also have saved the TS4, forcing the four old sockets to be aborted before the TS4 had a chance to build up a herd of dead sockets.&lt;/li&gt;&lt;/ol&gt;So understanding TCP Keepalive is a critical skill for all modern industrial Ethernet users, after all more and more facilities are breaking their floors and functional area into distinct subnets with stateful firewall protection to keep the Accountants from changing the color of the widgets being produced - and to keep the production engineers from printing on the accounting departments laser printer which uses red ink :-).&lt;br /&gt;&lt;br /&gt;&lt;a href="http://tldp.org/HOWTO/TCP-Keepalive-HOWTO/overview.html"&gt;More complete discussion of TCP Keepalive is here&lt;/a&gt; (one of dozens of web site you can find in a web search).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35259639-5278322795141761709?l=blog.iatips.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/5278322795141761709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=35259639&amp;postID=5278322795141761709' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/5278322795141761709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/5278322795141761709'/><link rel='alternate' type='text/html' href='http://blog.iatips.com/2008/08/creeping-firewalls-and-change.html' title='Creeping Firewalls and Change'/><author><name>Lynn August Linse</name><uri>http://www.blogger.com/profile/01534730541144544922</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='05116158169562844583'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35259639.post-695717031308817233</id><published>2008-08-01T09:51:00.000-07:00</published><updated>2008-08-01T10:06:21.254-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Device Access'/><category scheme='http://www.blogger.com/atom/ns#' term='Cellular'/><category scheme='http://www.blogger.com/atom/ns#' term='Serial'/><title type='text'>Tunneling Serial Data over Cellular</title><content type='html'>&lt;span style="font-size:130%;"&gt;Tunneling Serial Data over Cellular&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Question&lt;/span&gt;: you have a Windows-based application which expects to talk over normal serial ports - how can you connect to a remote serial device over a cellular-IP link?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Products&lt;/span&gt;: works with Digi Connect WAN, WANIA or WANVPN, Digi ConnectPort VPN, X4 or X8&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Answer&lt;/span&gt;: Our Digi RealPort driver for Windows 2000/XP/Vista dated Nov 2008 now supports a nice low-overhead "UDP: Serial Data Only" mode. This will cost a fraction of what normal TCP-mode Realport or competitors TCP redirectors will cost.&lt;br /&gt;&lt;br /&gt;Here is a web page explaining how to install RealPort for UDP mode (DDNS names can be used!)&lt;br /&gt;&lt;a href="http://digitips.wikispaces.com/Digi+Realport+with+UDP"&gt;http://digitips.wikispaces.com/Digi+Realport+with+UDP&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here is a web page explaining how to set the WANIA to UDP Sockets.&lt;br /&gt;&lt;a href="http://digitips.wikispaces.com/Digi+UDP+Sockets+WAN"&gt;http://digitips.wikispaces.com/Digi+UDP+Sockets+WAN&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I set this up yesterday and have been polling a Modbus/ASCII serial slave on my CPX4 using RealPort and UDP mode. Responses take from 2 to 3 seconds to return … in part because I am polling so slowly that the modem PARKS in between every poll and I wait 30 seconds for a response timeout. I see perhaps 0.25% error / no response timeout but then my SIM doesn’t have the best signal where my product sits.&lt;br /&gt;&lt;br /&gt;However, I still believe people need to be realistic – even in the situations where the slave response times out I’d suggest NOT retrying immediately since the retries have a higher than normal probability of failing as well. Missing a few polls a day is better than needlessly paying more for data plans.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35259639-695717031308817233?l=blog.iatips.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/695717031308817233/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=35259639&amp;postID=695717031308817233' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/695717031308817233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/695717031308817233'/><link rel='alternate' type='text/html' href='http://blog.iatips.com/2008/08/tunneling-serial-data-over-cellular.html' title='Tunneling Serial Data over Cellular'/><author><name>Lynn August Linse</name><uri>http://www.blogger.com/profile/01534730541144544922</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='05116158169562844583'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35259639.post-8715486721615699400</id><published>2008-07-23T12:28:00.000-07:00</published><updated>2008-07-23T13:29:46.692-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Device Access'/><category scheme='http://www.blogger.com/atom/ns#' term='Industrial'/><category scheme='http://www.blogger.com/atom/ns#' term='Cellular'/><title type='text'>Evolution of Data Plan Billing</title><content type='html'>&lt;span style="font-weight: bold;font-size:130%;" &gt;Summary: the big three have moved away from unlimited data, towards limited data.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It is interesting - I once (as in last year) had a talk with a potential partner who'd been at some European conference and was convinced the world was on the verge of low-cost (sub-$20/month) unlimited cellular data plans.  We were discussing the creation of report-by-exception  tools to reduce SCADA costs, and this partner's strong faith in this belief caused them to eventually bail out of the talks, saying "&lt;span style="font-style: italic;"&gt;In a year or two, no SCADA company will care about how much cellular data they use&lt;/span&gt;."&lt;br /&gt;&lt;br /&gt;Yet as of the summer of 2008 the world of cellular data is moving in the opposite direction.  Last year the big three (AT&amp;amp;T/Sprint/Verizon) offered "Unlimited Data" for personal users with the Service Terms listing a VERY narrow list of permitted activities - mainly email and web browsing, with many common things like file download/upload, media-streaming prohibited.  So when ever one of the big three would &lt;span style="font-weight: bold; font-style: italic;"&gt;cut off a user for moving too much data on an "unlimited plan"&lt;/span&gt;, the service provider would fall back on the "&lt;span style="font-style: italic;"&gt;You are doing prohibitted things, thus impacting our network, thus take your business elsewhere&lt;/span&gt;".  What a way to cause bad feelings, eh?  &lt;span style="font-style: italic;"&gt;Note that this change is CONSUMER plans - machine-to-machine have always been limited, priced by the MB/month without rollover, plus with charges for data overages.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now all three have dropped the price from the $80/month range down to $60/month range ... but added a hard limit of 5GB per month.  Isn't free &amp;amp; vigorous market competition wonderful?&lt;br /&gt;&lt;br /&gt;Sounds reasonable - 5,000 megabytes of data is a lot, yet this doesn't mean 5GB of data transfer.  It means 5GB of metered activity, with many activities I've studied including up to 95% overhead.  Thus someone only moving 20-30MB of real data in small packets per month might hit pretty close to their 5GB limit!  My experience with normal wide-area-network traffic hints that a real PC user doing simple email and web-browsing once a day would probably move 1-2GB of data before hitting the 5GB total activity limit.&lt;br /&gt;&lt;br /&gt;To paraphrase the wireless data service terms for all three:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Data transport is always measured in full kilobytes&lt;/li&gt;&lt;li&gt;Actual transport is always rounded up to next full-kilobyte at "end of session"&lt;/li&gt;&lt;li&gt;Network overhead and resend requests caused by network errors can increase measured kilobytes.&lt;/li&gt;&lt;li&gt;2 of 3 mention always rounding up to nearest kilobyte every hour period.&lt;/li&gt;&lt;li&gt;All warn that you will NOT receive an itemized detail of how your charges are calculated; you will NOT see which services were used or during which time periods the charges were inccurred under.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;So if I send a single 50 byte UDP/IP packet, is that a full session and billed as 1024 bytes?  Could be under this language since UDP is 'sessionless'.&lt;br /&gt;&lt;br /&gt;Hmm, the term &lt;span style="font-weight: bold; font-style: italic;"&gt;session &lt;/span&gt;is pretty ambiguous.  Perhaps it means per "time you enable your PC-based cellular data card."  That seems likely - plus if you left your device on twenty-four hours a day then the once per hour round-up would catch you.&lt;br /&gt;&lt;br /&gt;I'm afraid I haven't offered any new answer here, other than to suggest you understand that &lt;span style="font-weight: bold; font-style: italic;"&gt;low-cost unlimited data plans ARE NOT just around the corner&lt;/span&gt; ... at best we left them behind last year and I don't foresee them ever returning.  I suppose all three now understand that huge new profits are to be made with these 5GB limits, which will cause many "super-salesman" using their cellular data plan daily to spend an extra $50 to $500 in monthly overage charges.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35259639-8715486721615699400?l=blog.iatips.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/8715486721615699400/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=35259639&amp;postID=8715486721615699400' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/8715486721615699400'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/8715486721615699400'/><link rel='alternate' type='text/html' href='http://blog.iatips.com/2008/07/evolution-of-data-plan-billing.html' title='Evolution of Data Plan Billing'/><author><name>Lynn August Linse</name><uri>http://www.blogger.com/profile/01534730541144544922</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='05116158169562844583'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35259639.post-7241515663779141487</id><published>2008-07-11T09:56:00.000-07:00</published><updated>2008-07-11T10:13:13.801-07:00</updated><title type='text'>Lower Cost Cellular to Rockwell AB PLC</title><content type='html'>&lt;p&gt;I have several customers now working through how to manage cost-effective cellular access to Rockwell PLC such as ControlLogix, CompactLogix, Micrologix 1100 and so on.  Unfortunately the most straight forward way to link using Ethernet/IP is fairly costly.&lt;br /&gt;&lt;/p&gt;First, a personal recommendation from me – a free tool which I find very useful and think you will too.  Today, you can buy 2GB USB flash drives for $15 – if you're old like me, you remember when an entire Windows computer only had 0.020GB of hard drive space!  &lt;span style="font-weight: bold; font-style: italic;"&gt;Did you know you can literally install and run many Windows applications from these portable USB drives?  &lt;/span&gt;This means any Windows computer you plug this USB drive into has your applications, your settings, and your data files.  I've used one of these for over a year and it is invaluable - all free open source code too!   You can run &lt;a href="http://portableapps.com/apps/office/openoffice_portable"&gt;OpenOffice&lt;/a&gt; (which can read/write MSOffice 2003 files and is much faster than the MSOffice 2007 we use at Digi), &lt;a href="http://portableapps.com/apps/internet/firefox_portable"&gt;Firefox web browser&lt;/a&gt;, plus a dozen other tools. &lt;a href="http://portableapps.com/apps/utilities/keepass_portable"&gt; Take a special look at KeePass&lt;/a&gt;, which I use daily from my USB drive to securely hold all of my hundred-plus account names and passwords.&lt;br /&gt;&lt;p style="margin-bottom: 0in;"&gt;&lt;a href="http://portableapps.com/about/what_is_a_portable_app"&gt;Portableapps.com - What is a Portable App?&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Okay, back to work.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-size:180%;"&gt;Periodic PLC Access from RSLogix&lt;/span&gt;&lt;/p&gt;Customers who want to peek into a single PLC at a remote site for an hour or two can use RSLinx to connect to either an IP or DNS name, then see the PLC via cellular.  The catch is RSLinx will create from 12MB to 200MB of background traffic per month.  So you need to create a new Ethernet Driver (not Ethernet/IP!) JUST for this one-time use, configure in your details, connect and do your work.  When you are done you need to turn browsing off, then delete the comm driver.  Why not just delete the IP or DNS name?  Unfortunately once RSLinx has seen a device, it can be like a bad rash to get rid of it.&lt;br /&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;Data polling – at Central Office&lt;/span&gt;&lt;/p&gt;Customers with an OPC server speaking DF1, CSPv4, or even Ethernet/IP can poll PCCC-type data through a &lt;a href="http://www.digi.com/products/serialservers/digioneiaphaz.jsp"&gt;Digi One IAP&lt;/a&gt;, which converts the polls into &lt;a href="http://iatips.com/rockwell.html#common"&gt;DF1 Radio Modem&lt;/a&gt; under UDP.  Tests have show using DF1 Radio Modem every few minutes accomplishes the same data movement as Ethernet/IP with only 5% the data cost (or Ethernet/IP uses 2000% more data bytes).  One unit of Digi One IAP can poll up to 60 remote IP or DNS names.  If your OPC server can encapsulate DF1 Radio Modem directly into UDP/IP, then you won't need the Digi One IAP to act as your host.&lt;br /&gt;&lt;p&gt;&lt;span style="font-size:180%;"&gt;Data Polling – at Remote Site&lt;/span&gt;&lt;/p&gt;If you have an &lt;span style="font-weight: bold; font-style: italic;"&gt;AB PLC which speaks DF1 Radio Modem&lt;/span&gt; directly, then any Digi cellular router can be configured for UDP Sockets, with shuttles UDP data received to the serial port.  Make sure you use the latest Digi firmware so it can just return UDP responses to last sender without explicit address configuration.&lt;br /&gt;&lt;p&gt;If your &lt;span style="font-weight: bold; font-style: italic;"&gt;AB PLC doesn't speak DF1 Radio Modem&lt;/span&gt;, or you want to use an Ethernet link, then using a Digi cellular router with Python support allows a simple script which accepts DF1 requests and uses a local Ethernet/IP session to query responses from the PLC's PCCC Object.  This Python code even runs on a PC under Windows or Linux.  As soon as I have a link or web page explaining how to get and use this code, I'll edit this post to add it here.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35259639-7241515663779141487?l=blog.iatips.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/7241515663779141487/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=35259639&amp;postID=7241515663779141487' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/7241515663779141487'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/7241515663779141487'/><link rel='alternate' type='text/html' href='http://blog.iatips.com/2008/07/lower-cost-cellular-to-rockwell-ab-plc.html' title='Lower Cost Cellular to Rockwell AB PLC'/><author><name>Lynn August Linse</name><uri>http://www.blogger.com/profile/01534730541144544922</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='05116158169562844583'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35259639.post-4867409261614114943</id><published>2008-07-10T14:54:00.000-07:00</published><updated>2008-07-10T15:05:06.917-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ethernet'/><category scheme='http://www.blogger.com/atom/ns#' term='Rockwell'/><title type='text'>Quick Data Comms to AB PLC</title><content type='html'>One of my readers was asking for a quick way to talk via Ethernet to a Rockwell AB PLC.&lt;br /&gt;&lt;br /&gt;You can actually talk to a ControlLogix by only understanding TWO (2) different packets, each with a response, so four packets I guess.  The problem is this uses "UCMM" style communications, which the PLC has very limited resources for.  Said another way, the CIP Connected Messaging or I/O production both include an inherent allocation of resources, while the UCMM is designed to be used ONLY to setup such pre-allocated resources.&lt;br /&gt;&lt;br /&gt;So yes, you can use the information below to create a literal quick-n-dirty solution, and if you talk more than a few times a second you might start to interfer with other communications to the PLC (which is not a good thing!)  However you could treat this as a proof of concept, and then work to do the communications more fully per the ODVA specs.&lt;br /&gt;&lt;br /&gt;Here is the PDF of &lt;a href="http://iatips.com/digiwiki/quick_eip_demo.pdf"&gt;how to read/write to the PCCC Object in a Logix Processor&lt;/a&gt; here.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35259639-4867409261614114943?l=blog.iatips.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/4867409261614114943/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=35259639&amp;postID=4867409261614114943' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/4867409261614114943'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/4867409261614114943'/><link rel='alternate' type='text/html' href='http://blog.iatips.com/2008/07/quick-data-comms-to-ab-plc.html' title='Quick Data Comms to AB PLC'/><author><name>Lynn August Linse</name><uri>http://www.blogger.com/profile/01534730541144544922</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='05116158169562844583'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35259639.post-8695516226911618707</id><published>2008-05-30T07:06:00.001-07:00</published><updated>2008-05-30T07:42:33.059-07:00</updated><title type='text'>Public Internet Risk in Common Tools</title><content type='html'>Two months ago a SCADA customer asked me to enable FTP (File-Transfer-Protocol) on a test RTU they'd sent me to put online for them.  It was on a DSL link and although I warned them it was a bad idea they said it would be okay because the RTU had username/password protection and the RTU had nothing important on it.&lt;br /&gt;&lt;br /&gt;The punchline is that a few days later the customer sent me an email saying they couldn't FTP into the RTU anymore, so couldn't check the log files.&lt;br /&gt;&lt;br /&gt;I looked, and the RTU now had 3 TCP sockets open (all the sockets allocated for FTP on this RTU) to some FTP client at an IP address registered in Korea.  All 3 were just slowly walking through a dictionary attack of username/passwords (user &lt;span style="font-weight: bold;"&gt;bill&lt;/span&gt;, pass &lt;span style="font-weight: bold;"&gt;honda14 &lt;/span&gt;... user &lt;span style="font-weight: bold;"&gt;billk&lt;/span&gt;, pass &lt;span style="font-weight: bold;"&gt;12tomes &lt;/span&gt;...)  No doubt the IP and FTP client belonged to some university student running kiddy-scripts obtained on the Internet.  No doubt the kid probably didn't even care if the odd device he or she had never seen before was not a computer (&lt;span style="font-style: italic;"&gt;FTP servers always announce what and who they are when you connect&lt;/span&gt;).  No doubt this attack wasn't costing them anything, as either the university or parents were paying for the Internet connection - or the IP and connection belonged to some patsy whose home computer had been compromised.&lt;br /&gt;&lt;br /&gt;So okay, it was not causing any real harm,  &lt;span style="font-weight: bold; font-style: italic;"&gt;except it defeated the purpose of enabling FTP since the end user no longer had access to FTP.&lt;/span&gt;  I suppose you could call it a denial-of-service attack, yet I'm sure that was NOT the intension of the '&lt;span style="font-style: italic;"&gt;attacker&lt;/span&gt;'.  The student was probably just hoping to be able to post a message on some forum saying '&lt;span style="font-style: italic;"&gt;I hacked a computer at this IP address in the USA, and here is the FTP user name and password I created for you to access.&lt;/span&gt;'  The fact that the RTU only contained a dozen binary log files would be irrelevant.&lt;br /&gt;&lt;br /&gt;Do I have a moral to this story?  Hmm, not really - other than industrial users have to understand that what is NOT interesting to them might be interesting to others for very different reasons.&lt;br /&gt;&lt;br /&gt;If this user had allowed me to change the FTP port to some random value like TCP port 38207, then it is very likely this particular student would NOT have found it.  Since true port-scans are so easy to detect, the student's tool probably had a list of a few dozen TCP ports commonly used by FTP servers, then it would randomly try them over a few weeks at any single target IP.&lt;br /&gt;&lt;br /&gt;The same story could be true for web servers on TCP port 80 (or 8000 or 8080).  Digi ships our cellular products with the web server enabled on port 80 because that is what customers expect.  Sure, they add a username and password, but what will happen to their data plan bill if their 3MB per month plan moves 3-GigaByte because some scripts are trying dictionary attacks on the login of home web page?&lt;br /&gt;&lt;br /&gt;I've had to always mention that 3GB part (meaning a $500+ bill for a month) since every time I mention to such users not to leave port 80 setup as a web browser, the industrial customer's answer is invariably '&lt;span style="font-style: italic;"&gt;... it'll be okay because the unit has username/password protection and it has nothing worth trying to see on it ... &lt;/span&gt;'&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35259639-8695516226911618707?l=blog.iatips.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/8695516226911618707/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=35259639&amp;postID=8695516226911618707' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/8695516226911618707'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/8695516226911618707'/><link rel='alternate' type='text/html' href='http://blog.iatips.com/2008/05/public-internet-risk-in-common-tools.html' title='Public Internet Risk in Common Tools'/><author><name>Lynn August Linse</name><uri>http://www.blogger.com/profile/01534730541144544922</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='05116158169562844583'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35259639.post-4501052569202497675</id><published>2008-05-22T09:34:00.000-07:00</published><updated>2008-05-22T10:05:04.704-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='zigbee'/><category scheme='http://www.blogger.com/atom/ns#' term='Cellular'/><title type='text'>Cellular to Wireless Zigbee</title><content type='html'>An interesting new market we are moving into is cellular access to wireless mesh (Zigbee as example).  In some sense it's a supply-chain dream come true.  Imagine you supply a product to customers and EVERYONE (except the customer's IT department) want you to be able to see what the stock level is and auto-schedule deliveries.&lt;br /&gt;&lt;br /&gt;The customer benefits because they can treat the product as a 'utility' - turn the tap and there it is.&lt;br /&gt;&lt;br /&gt;You benefit because you can minimize emergency truck-rolls - no more angry, panicked customers demanding you send a truck over two-thirds empty because someone forgot to schedule a special delivery because the customer needed to use 60% more product for two days.  Of course as a supplier the cost of the truck, fuel, and driver are critical parts of your margin/profit.  You desire to only send out full trucks which return gracefully empty!&lt;br /&gt;&lt;br /&gt;So we are now working with several of the largest chemical suppliers in the world to enable:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;drop in a powered cellular unit at the customer site&lt;/li&gt;&lt;li&gt;drop in powered or battery tank sensors&lt;/li&gt;&lt;li&gt;log levels hourly, for the supplier to upload daily (reduces cellular data charges)  The supplier uses this as their 'secret-sauce', their own proprietary value-add to predict when trucks need to roll to maximize efficiency&lt;br /&gt;&lt;/li&gt;&lt;li&gt;enable alarm call-out if the levels hit unexpected low-low levels&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;How this works varies by suppliers.  The one I'm working with is using Modbus/TCP to pull up the logs daily.  Some other suppliers are having SMTP clients push emails back to the supplier with XML formatted reports.  The next supplier I might work will wants the binary logs to be compressed (ZIP'd) and then pushed upstream once a day by FTP, where their accounting system will convert from binary to XML to import and issue bills on product usage per MINUTE.&lt;br /&gt;&lt;br /&gt;Of course key to all of this is the &lt;a href="http://www.digi.com/products/wirelessdropinnetworking/"&gt;wireless drop-in-network concept&lt;/a&gt;.  The supplier doesn't want to invest thousands of dollars pulling wires through SOMEONE ELSE'S PLANT - especially when the supplier's contract might end in a few months. &lt;br /&gt;&lt;br /&gt;Wireless sensors aren't new; cellular data access isn't new; supply-chain systems which auto-detect product levels aren't new.  What is new here is the merger of many technologies which reduce infra-structure costs, and thus increase ROI.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35259639-4501052569202497675?l=blog.iatips.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/4501052569202497675/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=35259639&amp;postID=4501052569202497675' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/4501052569202497675'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/4501052569202497675'/><link rel='alternate' type='text/html' href='http://blog.iatips.com/2008/05/cellular-to-wireless-zigbee.html' title='Cellular to Wireless Zigbee'/><author><name>Lynn August Linse</name><uri>http://www.blogger.com/profile/01534730541144544922</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='05116158169562844583'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35259639.post-6149794360626282447</id><published>2008-03-14T07:42:00.000-07:00</published><updated>2008-03-15T09:40:33.293-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DF1'/><title type='text'>PCCC Protected Typed Logical Write with Mask</title><content type='html'>Someone asked about the "&lt;span style="font-style: italic;"&gt;DF1 Supplement for SLC500&lt;/span&gt;" from 1995 which was online at ab.com for a short period, then was pulled - probably because it is a very poor quality optical scan.  However, I had it ... then lost it ... then found it stashed away on one of my ftp sites. &lt;br /&gt;&lt;br /&gt;So here is the original AB PDF (which I downloaded from ab.com last year)  &lt;a href="http://iatips.com/docs/DF1%20Protocol%2017706516%20Suppliment.pdf"&gt;Grab it here while it survives&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The masked write is on page 11 and the first data-word is the mask and all data following has the SAME mask applied.  So [0x0001,0x0000] would clear the LSBit and so on.  It doesn't offer mask-data pairs - just one mask and N words.  Thus this command is mainly for use with 1 word element writes ... unless you have three or four consecutive N-file words you wish having the same mask applied.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35259639-6149794360626282447?l=blog.iatips.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/6149794360626282447/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=35259639&amp;postID=6149794360626282447' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/6149794360626282447'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/6149794360626282447'/><link rel='alternate' type='text/html' href='http://blog.iatips.com/2008/03/pccc-protected-typed-logical-write-with.html' title='PCCC Protected Typed Logical Write with Mask'/><author><name>Lynn August Linse</name><uri>http://www.blogger.com/profile/01534730541144544922</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='05116158169562844583'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35259639.post-4779672731597054757</id><published>2008-03-07T09:27:00.000-08:00</published><updated>2008-03-07T09:40:26.233-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cellular'/><category scheme='http://www.blogger.com/atom/ns#' term='Modbus'/><title type='text'>Optimizing Modbus for Cellular</title><content type='html'>&lt;h2 id="toc1"&gt;Goal: lower your data costs&lt;/h2&gt;  How nice it would be if you could take your Ethernet applications and just move them to cellular (or satellite).  Well, of course you can ... but you'll pay through the nose for this.&lt;br /&gt;&lt;br /&gt;At the moment I'm in the process of creating intelligent cellular gateways accessible by Modbus/UDP (aka Modbus/TCP form in UDP) which support data logging, report-by-exception and other cost-saving goodies.&lt;br /&gt;&lt;br /&gt;A few Facts:&lt;br /&gt; &lt;ol&gt;&lt;li&gt;You are charged for all IP, TCP, and UDP overhead - the cellular system moves your TCP/IP packet as raw payload encapsulated in mobile-IP or other transports. So to them the 40-52 bytes TCP/IP header as NOT DISTINGUISHED from your data. ( &lt;a class="wiki_link_ext" href="http://iatips.com/blog/2007/01/cellular-costs-bytes-you-pay-for-each.html" rel="nofollow"&gt;My Blog entry on this&lt;/a&gt; )&lt;/li&gt;&lt;li&gt;Thus Modbus/UDP (aka Modbus/TCP in UDP/IP) will save you from 60 to 90% of your data costs. It is a single one-shot request followed by a single one-shot response. In contrast TCP/IP might require up to 400 bytes of socket open &amp;amp; close overhead, plus TCP acknowledge packets.&lt;/li&gt;&lt;/ol&gt; &lt;br /&gt;So if you are concerned about cost, you should first make sure your DATA POLLING can be done with Modbus/UDP - not TCP. No sweat if you need to use Modbus/TCP to reprogram or monitor your RTU or PLC short-term, just make sure your 24/7 repetitive data polling in via UDP. ( &lt;a class="wiki_link_ext" href="http://blog.iatips.com/2007/08/truth-about-cellular-ip.html" rel="nofollow"&gt;Is UDP reliable enough?&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So I've defined a few extensions (read as 'heresy' to many).  &lt;a href="http://iatips.wikispaces.com/Optimizing+Modbus+TCP+for+Cellular"&gt;Full Details are Here at iatips.com:&lt;/a&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;I allow use of the full Modbus/TCP header - so one can read 500 registers in a single request.  This greatly reduces charges for header overhead&lt;/li&gt;&lt;li&gt;I allow returns LESS than data than requested when the context is appropriate.  This saves having to pay for data padding, plus not having to poll a status register to see how much logged data is waiting&lt;/li&gt;&lt;li&gt;I allow use of data compression like ZLIB.  Bottomline, 'ZIP' compression of small data sucks, but since I can return 500 registers (1K bytes) ZLIB starts showing value.&lt;/li&gt;&lt;li&gt;I allow packing multiple Modbus-ADU below a single header, which (unlike pipelining) signals the gateway to return multiple responses in a single packet.&lt;/li&gt;&lt;li&gt;I am looking at support for simple AES encryption, not as true 'security', but as a good-enough means to support Modbus without making development difficult.&lt;/li&gt;&lt;/ol&gt;If you are interested in the details, I have more discussion on &lt;a href="http://iatips.wikispaces.com/Optimizing+Modbus+TCP+for+Cellular"&gt;my wiki site&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35259639-4779672731597054757?l=blog.iatips.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/4779672731597054757/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=35259639&amp;postID=4779672731597054757' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/4779672731597054757'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/4779672731597054757'/><link rel='alternate' type='text/html' href='http://blog.iatips.com/2008/03/optimizing-modbus-for-cellular.html' title='Optimizing Modbus for Cellular'/><author><name>Lynn August Linse</name><uri>http://www.blogger.com/profile/01534730541144544922</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='05116158169562844583'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35259639.post-1284733540117655559</id><published>2008-03-07T09:21:00.000-08:00</published><updated>2008-03-07T09:26:17.491-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cellular'/><title type='text'>Lost My SIM</title><content type='html'>Well, I've been quiet for awhile - lost my "free development SIM" as part of Cingular's reorg into AT&amp;amp;T.  Thus my collection of PLC with free demo access are off-line.  Is interesting to support cellular without a SIM ... not that my boss is ignoring this, but there are 'plans in the works' which involve several companies ... plans which just keep moving out.&lt;br /&gt;&lt;br /&gt;However, I am working on Cellular gateways with intelligence now.  Goal is to allow a Modbus client/master to come in once per day and upload time-stamped logs; plus if certain events occur use Modbus to call for help.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35259639-1284733540117655559?l=blog.iatips.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/1284733540117655559/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=35259639&amp;postID=1284733540117655559' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/1284733540117655559'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/1284733540117655559'/><link rel='alternate' type='text/html' href='http://blog.iatips.com/2008/03/lost-my-sim.html' title='Lost My SIM'/><author><name>Lynn August Linse</name><uri>http://www.blogger.com/profile/01534730541144544922</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='05116158169562844583'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35259639.post-4483555301326173387</id><published>2007-10-05T10:28:00.000-07:00</published><updated>2007-10-05T10:41:27.007-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Device Access'/><category scheme='http://www.blogger.com/atom/ns#' term='Cellular'/><title type='text'>How Exposed in Public Cellular IP</title><content type='html'>One of the concerns about having a &lt;span style="font-weight: bold;"&gt;PUBLIC IP&lt;/span&gt; address for cellular is your exposure to public hackers probing public IPs for services.  In theory, you pay for all of these attempts since the mobile IP system encapsulates and transports them all on your behalf.&lt;br /&gt;&lt;br /&gt;I'm happy to report that after logging such attempts for many months my cellular devices receive less than 4 probes in any one day and &lt;span style="font-weight: bold; font-style: italic;"&gt;likely under 20 total per month&lt;/span&gt;.  So many days pass with no probes at all and it appears to stay under 2-3K per month.  This compares to perhaps &lt;span style="font-weight: bold; font-style: italic;"&gt;200 probes per day on my DSL&lt;/span&gt; router/firewall.&lt;br /&gt;&lt;br /&gt;I am not sure why the difference, although I'd guess it has to do with the high initial latency in contacting a cellular IP.  So any "script-kiddie" tool scanning IP address ranges probably is not willing to wait up to 5 seconds for cellular devices on busy towers which need "unparking" to respond.&lt;br /&gt;&lt;br /&gt;What kinds of probes are they?  Mainly those looking for MS-SQL servers, with a rare access to FTP and the remainder of accesses aimed to seemingly random, unnamed ports - likely associated with trojans or zombie networks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35259639-4483555301326173387?l=blog.iatips.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/4483555301326173387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=35259639&amp;postID=4483555301326173387' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/4483555301326173387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/4483555301326173387'/><link rel='alternate' type='text/html' href='http://blog.iatips.com/2007/10/how-exposed-in-public-cellular-ip.html' title='How Exposed in Public Cellular IP'/><author><name>Lynn August Linse</name><uri>http://www.blogger.com/profile/01534730541144544922</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='05116158169562844583'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35259639.post-589976063347310106</id><published>2007-08-22T06:19:00.000-07:00</published><updated>2007-08-22T11:22:41.938-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cellular'/><category scheme='http://www.blogger.com/atom/ns#' term='WAN'/><category scheme='http://www.blogger.com/atom/ns#' term='Ethernet'/><category scheme='http://www.blogger.com/atom/ns#' term='Rockwell'/><title type='text'>The Truth about Cellular IP</title><content type='html'>I have been very busy analyzing real-world telemetry traffic over cellular IP, and unfortunately I am now 100% convinced that &lt;strong&gt;&lt;em&gt;you cannot effectively use most (any?) off-the-shelf "Ethernet" software tool to talk to remote Ethernet devices over cellular IP&lt;/em&gt;&lt;/strong&gt;. Bottom-line is that - unless your host app is custom written to be data cost and time delay sensitive - your data costs will be bloated due to the nature of the tool. Even something as "obvious" as adding compression doesn't solve the problem because telemetry packets tend to be too small for effective compression. For example: an 8-byte Modbus/RTU request becomes 12-bytes after ZIP-style compression. Plus this doesn't reduce the 104-bytes of TCP overhead nor 28-bytes of UDP overhead. None of the cellular providers allow use of RFC-class TCP header compression, since it requires all of the infra-structure to maintain&lt;br /&gt;copies of headers etc.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;So I have been working on "reduction" solutions - how to obtain the effect of moving "X" IP packets but only moving "X-minus-a-bunch" of actual IP packets.&lt;br /&gt;&lt;br /&gt;&lt;/em&gt;&lt;/strong&gt;&lt;span style="font-size:130%;"&gt;Tunneling TCP thru UDP&lt;br /&gt;&lt;/span&gt;The most promising and generic form of &lt;strong&gt;&lt;em&gt;reduction&lt;/em&gt;&lt;/strong&gt; is to tunnel TCP/IP via UDP/IP over cellular. So the host application talks TCP/IP to a local proxy, which acts as the TCP end-point. All of the TCP SYN, ACK and Keepalive traffic is limited to the local Ethernet. The local proxy then initiates a UDP "session" with a remote proxy over cellular &amp; &lt;strong&gt;&lt;em&gt;we instantly see a 60-90% reduction in data costs&lt;/em&gt;&lt;/strong&gt;. The remote proxy initiates a TCP/IP connection to the remote Ethernet device, which again isolated the extra TCP overhead to the remote Ethernet.&lt;br /&gt;&lt;br /&gt;The reaction of non-IA network engineers to this idea is predictable and a bit humorous after a while. They immediately say "You cannot do that!!! UDP/IP is unreliable!!! You'll break something!!! &lt;strong&gt;&lt;em&gt;You are committing a mortal Sin!!!&lt;/em&gt;&lt;/strong&gt;" But in reality none of the IA protocols leverage the reliability of TCP anyway. For example, Rockwell RSLogix doesn't send a program block to a ControlLogix and blindly assume it was successful after the TCP Acknowledge from the peer is processed. Instead, RSLogix sits (blocks literally) and waits for a successful CIP response on a single CIP Connection. So if the local proxy returns a TCP-ACK to the RSLogix host and the CIP request is lost within the UDP/IP tunnel ... eventually RSLogix times out the CIP connection and the application (and/or user) will restart.&lt;br /&gt;&lt;br /&gt;Fortunately, cellular is very reliable - all of my tests sending 10,000 UDP packets rarely even lost 1 packet and I'm not sure if such a rare loss is due to cellular or just my test script hiccupping &amp;amp; dropping a packet. Plus cellular tends to have only &lt;strong&gt;&lt;em&gt;very bursty error problems&lt;/em&gt;&lt;/strong&gt;. In other words, you won't lose 1 packet per 10,000; instead you'll lose all packets for 5 minutes or just 5 random packets out of a group of 10 sent. This shotgun-damage tends to confuse TCP/IP state machines to the point that they abort the connection anyway. In truth, in all of my Wireshark/Ethereal trace reviewing I have never seen a single situation where a TCP retry did anything but add data cost; every TCP retransmission just results in a "Duplicate ACK" showing up a few packets below in the trace &amp; a doubling of the cost of that block of data.&lt;br /&gt;&lt;br /&gt;So overall, anyone planning to use cellular should first investigate if they can use UDP/IP instead of TCP/IP.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;TCP Problem #1 - added cost for pointless ACK&lt;/span&gt;&lt;br /&gt;As mentioned above, real-world analysis of telemetry use of TCP shows the TCP ACK isn't useful; but worse, Embedded TCP devices tend to sub-optimize the ACK timing to "speed up" data transmission and recovery. Almost universally moving an IA protocol via TCP/IP results in 4 TCP packets instead of the idealized 3.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Your app sends a TCP request (request data size + 40-52 bytes of overhead)&lt;/li&gt;&lt;li&gt;800-1100 msec later your app receives a TCP ACK without data (another 40-52 bytes of overhead)&lt;/li&gt;&lt;li&gt;10-40 msec later your app receives the protocol response (response data size + 40-52 bytes of overhead)&lt;/li&gt;&lt;li&gt;Within a few msec, your app sends the TCP ACK without data. &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;So what would have been a 2-packet transaction with only 56 bytes of overhead under UDP/IP, or what should have been a 3-packet transaction with 120-156 bytes of overhead under ideal TCP/IP usually becomes a 4-packet transaction with 160-208 bytes of overhead. Yes, there exists a TCP socket option and the concept of "Delayed ACK Timer" to prevent the first empty TCP ack from being returned over cellular, but few embedded products use this since it adds code complexity, and it slows down overall data communications. At least in the IA world it seems everyone wants their Ethernet Product costing 2-4 times more than their serial product to appear lightning fast. So they ignore the TCP community's decades of hard-earned experience and "hack" their TCP stack to sub-optimize fast local Ethernet performance. &lt;/p&gt;&lt;p&gt;So this is where the instant 60-90% data cost savings of using UDP over TCP comes from. UDP has smaller headers and results in fewer packets being sent. Since the cellular IP system is "encapsulating" your TCP/IP packets in a manner similar to PPP, the entire IP header, TCP or UDP header, and your data is all considered billable payload. &lt;/p&gt;&lt;p&gt;There is also a myth propagated to this day that the TCP ack causes retry to occur more rapidly out in the wide-area-network infrastructure. The rhetoric goes, "If the 3rd and 4th router link is congested and the TCP data packet is lost, then the 3rd router will retransmit ... which is faster ..." Perhaps this was true back in the 1980's, but today the 3rd and 4th router (and all of the other 20 to 30 routers in a cellular end-to-end path) are just tossing IP packets upstream with no awareness of the packet functions. In reality, it is only the TCP state machines within your host machine and within your remote device that have any ability to retransmit anything. &lt;/p&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;TCP Problem #2 - added cost for premature retry&lt;/span&gt;&lt;br /&gt;The TCP RFC includes many dynamic timers that automatically adjust themselves based on real-world performance. This is actually pretty neat. It means if the TCP ACK and response times tend to be longer than normal, then the TCP state-machine slowly increases the delay before retransmission. But I've seen 3 problems with this. &lt;/p&gt;&lt;ol&gt;&lt;li&gt;The most effective way to leverage auto-adjust is to &lt;strong&gt;include the 12-byte TCP header options that time-stamps all packets&lt;/strong&gt;. Linux system add this by default and installing one of many PLC engineering tools on your Windows computers causes Windows to also start always using this. The setting generally is global - you either have 40-byte TCP headers or 52-byte TCP headers forever. So for small telemetry packets, this adds a disproportionately large increase in data costs. &lt;/li&gt;&lt;li&gt;Many embedded devices (PLC, RTU and I/O devices) have &lt;strong&gt;"hacked" the TCP ACK sub-system to force connection failure to be faster than the standard 3-4 minutes&lt;/strong&gt;. For example, I worked with one large PLC company which expected TCP sockets failure in less than 1 second, so they forced TCP retransmission in hundreds of msec and without any normal exponential backoff between retries. This is totally unusable over cellular; you will end up with 30% to 90% of your data traffic being premature retries and responses to premature retries. I have literally seen Wireshark/Ethereal traces which are mainly black lines with red text - which is the default color used to show TCP "problems" such as lost-frag, retrans, dup-ack, etc. &lt;/li&gt;&lt;li&gt;The &lt;strong&gt;latency in cellular is abnormal by an order of mag&lt;/strong&gt;nitude. Even browsing the internet or doing a telemetry polling test over DSL/cable broadband averages latencies in the 100-150 msec range. This is what a Windows or Linux defines as "slow/bad" - not the 800 to 3500msec of cellular. So even watching a Windows or Linux TCP state machine auto-adjust the retransmission delay over time, you will not see it achieve a 100% effective setting which eliminates wasted TCP retransmissions. The delay seems to top out&lt;br /&gt;at about 1.5 to 1.8 seconds, which is just too close to the actual "normal" latency range.  So again, use of UDP/IP frees the use user from data costs associated with TCP legacy assumptions - both the main-stream MIS/IT market variety of assumptions and the misapplied IA vendors "speed-ups". &lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;TCP Problem #3 - uncontrollable SYN/Socket Opens&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Given the way all cellular systems "park" inactive cellular data devices, it is exceedingly rare to ever see a host app open a new TCP socket without prematurely retrying/retransmitting the SYN packet. This is because one is virtually guaranteed that it will take about 2.5 seconds for the data device to be given active airwave resources and return the SYN+ACK response. This has NOTHING to do with the "always connected" feature Digi and others claim. The data device (even when parked) is fully connected by IP and fully authenticated by the system - it is "always connected". However, the local cell tower only has finite airwave resources, so any device (cell phone or data device) which is idle from 3 to 45 seconds is "parked" without having any preallocated airwave resources. Literally when the TCP "SYN" shows up, the cell tower has to use the control channel to inform the data device to request airwave resources, and after these are requested and allocated the data device can receive and response to the TCP socket open request. &lt;/p&gt;&lt;p&gt;But that's not the real problem related to TCP Socket Opens ... the real problem is yet another case of IA vendors sub-optimizing TCP behavior for fast local Ethernet performance. For example, I once had a customer who normally paid about $40 per month receive a $2000 bill one month. It turns out they had powered down the remote site for 3+ days and the off-the-shelf 3rd-party host application they used would try to reopen the TCP socket every 5 seconds!!! So Windows would send the initial TCP SYN to start the open, since the remote was off-line Windows would retransmit this TCP SYN a few seconds later. After a total of 5 seconds, the application would ABORT this TCP socket attempt and start a new one. So this host app was pushing 24 billable TCP packets per minute out to a remote site that was powered down. This was nothing the host app vendor documented, nor was it anything a user could configure or over-ride. The user could configure the host app to ONLY poll once per 5 minutes; but the user had no control over this run-away TCP SYN/Open behavior. &lt;/p&gt;&lt;p&gt;Tunneling TCP through UDP effectively decouples the TCP SYN/Open from cellular data charges. The first TCP Syn/Open request to the local proxy would succeed even if the remote IP site is offline. No retries would be required. Even if the host app attempts to retry the data poll every 5 seconds, this is something the UDP proxy can be configured to "resist". If the user truly wants data packets to only move every few minutes, that is something the UDP proxy can easily enforce. &lt;/p&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;TCP Problem #4 - sub-optimized TCP keepalive&lt;/span&gt;&lt;/p&gt;&lt;p&gt;The final problem I'll discuss (but not by any means the "last" problem with TCP) is that many embedded IA devices have relatively fast TCP Keepalives hard-coded to speed up lost-socket detection. While this is an admirable goal, a Rockwell PLC sending out a TCP Keepalive at a fixed 45 second interval can create up to 6MB of monthly traffic by doing this. Siemens S7 PLC seem to issue TCP keepalive every 60 seconds - a bit better, but not by much. Maybe such a heart-beat is useful to know the remote is accessible, but given the reliability of cell phones (when the last time you had a dropped call or no signal ...) you'll obtain a lot of false-alarms if you treat every missed packets as something requiring maintenance's attention. &lt;/p&gt;&lt;p&gt;Again, tunneling TCP through UDP effectively eliminates the automatic, possibly uncontrollable use of TCP Keepalive. If your process can handle you talking to it once an hour, then the cost of TCP socket open and close, as well as any TCP Keepalive is all wasted investment. &lt;/p&gt;&lt;p&gt;Not only this, but the cellular providers do NOT want users who send a simple, rather empty packet every 30 to 60 seconds - this is literally the worst kind of customer, as this forces the cell tower to "waste" one of its very limited airwave resources with almost no income returned to the carrier. From what I hear, carriers either want customers who talk constantly and pay huge monthly fees (say $90 to $350/month); or they want customers who rare talk and pay a small fee (even just $5/mo) but cost the carrier virtually no direct expenses. &lt;/p&gt;&lt;p&gt;Putting this is "restaurant terms":&lt;/p&gt;&lt;ul&gt;&lt;li&gt;A cellular data device that talks constantly but pays for a large plan is like a restaurant patron who sits at a table, constantly ordering more food and paying a larger bill.&lt;/li&gt;&lt;li&gt;A cellular data device that rarely talks is like the restaurant patron who comes in once a month, sits at a table, orders a meal, pays and then vacates the table.&lt;/li&gt;&lt;li&gt;A cellular data device that keeps an idle channel open full time but rarely talks is like the restuarant patron who sits at a table in the resturant, reading the paper but rarely ordering food or paying a bill.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;In fact, in private chats with carrier account people, I have heard several times that they have been directly to prefer either customers who talk constantly on large plans or those who talk at most once an hour (better once a day)  on small plans. Customers planning to talk every few minutes have been defined as bad investments.  It may be fair to say that after years of building up the data-plan customer base, the cellular carriers have come to understand that the REAL cost of data plans is not the bulk data bytes moved; it is instead the percentage of time the device consumes (or squats on) 1-of-N scare airwave resources in proportion to the monthly fee they pay.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35259639-589976063347310106?l=blog.iatips.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/589976063347310106/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=35259639&amp;postID=589976063347310106' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/589976063347310106'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/589976063347310106'/><link rel='alternate' type='text/html' href='http://blog.iatips.com/2007/08/truth-about-cellular-ip.html' title='The Truth about Cellular IP'/><author><name>Lynn August Linse</name><uri>http://www.blogger.com/profile/01534730541144544922</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='05116158169562844583'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35259639.post-2271500049443900931</id><published>2007-07-06T07:55:00.000-07:00</published><updated>2007-07-06T08:09:01.126-07:00</updated><title type='text'>Report-By-Exception? Maybe not</title><content type='html'>One of the PLC vendors I am just starting to deal with was bragging about the power of their report by expection abilities ... how wonderful for lower cellular data costs they claim. Unfortunately they only support TCP/IP - no UDP/IP. I'll cover this application (&amp; name the PLC) more after I have some time to work at it.&lt;br /&gt;&lt;br /&gt;However, the big problem with their "&lt;strong&gt;report-by-expection&lt;/strong&gt;" is that the PLC holds the TCP/IP socket open 24/7 and sends a TCP Keepalive every 1 minute. Sending a TCP Keepalive (2 x TCP packet headers with no data) every 60 seconds costs about 3.4MB per month! I have a hard time seeing that as "low cost". They would be better to just poll real data every 4 minutes and eliminate the TCP keepalives!&lt;br /&gt;&lt;br /&gt;Hopefully there is a setting in the PLC to change this behavior, which is why I need to look into this more. &lt;em&gt;&lt;strong&gt;I just want to point out that just because a system claims to only move data during exceptions ... that does NOT mean it has very low cellular data costs. &lt;/strong&gt;&lt;/em&gt;Don't forget that data costs include things you don't normally see - TCP socket open/close, TCP keepalive, TCP ack, and TCP retransmissions are all things you pay for.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35259639-2271500049443900931?l=blog.iatips.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/2271500049443900931/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=35259639&amp;postID=2271500049443900931' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/2271500049443900931'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/2271500049443900931'/><link rel='alternate' type='text/html' href='http://blog.iatips.com/2007/07/report-by-exception-maybe-not.html' title='Report-By-Exception? Maybe not'/><author><name>Lynn August Linse</name><uri>http://www.blogger.com/profile/01534730541144544922</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='05116158169562844583'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35259639.post-6124547593969353944</id><published>2007-06-12T11:43:00.000-07:00</published><updated>2007-07-06T07:54:50.484-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cellular'/><category scheme='http://www.blogger.com/atom/ns#' term='Rockwell'/><title type='text'>Real World Cellular - ControlLogix PLC</title><content type='html'>Summary: Before I listed some real world numbers for Modbus polling. This time I walk through some of the costs and issues of using ODVA Ethernet/IP to talk to a Rockwell ControlLogix PLC.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;The Convoluted Path of Wide-Area-Networks:&lt;/span&gt;&lt;br /&gt;In general the magic of IP hides reality from us all. We tend to think "now I am browsing Google.com or iatips.com", but we don't really understand how COMPLEX and MIRACULOUS this really is. Your computer is NOT connected to either of these web servers; instead your computer uses the services of a dozen or more other computers/routers to get from "here" to "there". Every single data byte must be forwarded hop-by-hop through all of these cooperative peers.&lt;br /&gt;&lt;br /&gt;As example, here is a Trace Route (&lt;strong&gt;tracert&lt;/strong&gt;) of access from a computer within my test lab to a ControlLogix PLC sitting six (6) feet away. I am using public Internet access via a cellular Digi Connect WAN to the Ethernet (ENB) of the ControlLogix. Some of the public IP have "X" entered replacing the digits; you don't need to really know the exact IP value.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&lt;strong&gt;My computer has private IP = 10.9.92.1&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;01 01 ms 10.9.1.1 (Digi's private Intranet)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;02 01 ms 10.10.11.10 (Digi's private Intranet)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;03 01 ms 10.254.254.2 (Digi's private Intranet)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;04 16 ms 66.77.x.x (Digi Co-Host/Internet Link)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;05 04 ms 69.8.x.x (Digi Co-Host/Internet Link)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;06 64 ms 66.77.x.x (Digi Co-Host/Internet Link)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;07 09 ms min-core-02.inet.qwest.net [205.171.128.110] &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;08 11 ms cer-core-02.inet.qwest.net [67.14.8.18] &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;09 12 ms cer-brdr-01.inet.qwest.net [205.171.139.62] &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;10 39 ms qwest-gw.cgcil.ip.att.net [192.205.32.97] &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;11 35 ms tbr2.cgcil.ip.att.net [12.123.4.254] &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;12 35 ms tbr2.sl9mo.ip.att.net [12.122.10.46] &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;13 75 ms tbr2.attga.ip.att.net [12.122.10.137] &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;14 31 ms 12.122.85.157 &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;15 34 ms 12.86.140.146 &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;16 * Request timed out. (Part of Cellular Infra-Structure)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;17 * Request timed out. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;18 * Request timed out. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;19 * Request timed out. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;20 1276 ms mobile-166-XXX-XXX-XXX.mycingular.net [166.XXX.XXX.XXX]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&lt;strong&gt;Digi Connect WAN has private local IP = 192.168.196.80 (is 'gateway')&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&lt;strong&gt;ControlLogix PLC has private local IP = 192.168.196.21 &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;These traces always amaze me - how something so seemingly trivial takes so much effort to really function. Notice how my lab PC has to route through 6 devices to even get out of Digi's company network, then through Qwest (our ISP), through AT&amp;T (my cellular SIM provider), through some unnamed hops of the cell system, and finally be port forwarded to the ControlLogix PLC. The packets may be passing through Minneapolis, Chicago, Detroit, Atlanta, and then finally returning to the PLC sitting right beside me.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Effect of NAT (Network Address Translation)&lt;/span&gt;&lt;br /&gt;Now lets look at what happens when RSLinx on my PC opens an ODVA Ethernet/IP socket to the ControlLogix PLC. Every TCP/IP packet requires 4 unique values which define a connection:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Destination IP (target device)&lt;/li&gt;&lt;li&gt;Destination Port (target application within device) &lt;/li&gt;&lt;li&gt;Source IP (return address to originator)&lt;/li&gt;&lt;li&gt;Source Port (likely random port, originator is waiting for responses here)&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;So we start out with the 4-tuple &lt;strong&gt;DST=166.x.x.x : 44818&lt;/strong&gt; and &lt;strong&gt;SRC=10.9.92.1 : 22256&lt;/strong&gt;. The 166.x.x.x IP is assigned by my cellular carrier. Port 44818 is ODVA's "well-known" port for Ethernet/IP. 10.9.92.1 is an internal Digi selected private IP. TCP port 22256 is the ephemeral (or random) port selected by RSLinx to listen for responses.&lt;/p&gt;&lt;p&gt;The first NAT effect is the Digi corporate firewall changes the request to be &lt;strong&gt;DST=166.x.x.x : 44818&lt;/strong&gt; and &lt;strong&gt;SRC=66.77.x.x : 22256&lt;/strong&gt;. My private IP of 10.9.92.1 is meaningless out in the Qwest or AT&amp;amp;T's networks, so something needs to swap this for a "real" world-unique IP leased by Digi. Our corporate NAT interface creates a record (with a lifetime of 5 minutes) that allows any responses to be correctly restored to 10.9.92.1&lt;/p&gt;&lt;p&gt;The second NAT effect is when the Digi Connect WAN forwards to the ControlLogix with another private IP. So the 4-tuple now becomes &lt;strong&gt;DST=192.168.196.21 : 44818&lt;/strong&gt; and &lt;strong&gt;SRC=66.77.x.x : 22256&lt;/strong&gt;. The ControlLogix thinks IP host 66.77.something is connected to it - not the real host IP of 10.9.92.1. Plus the ControlLogix has NOT CLUE that the RSLinx thinks the ControlLogix as IP of 166.something.&lt;/p&gt;&lt;p&gt;Now, to send a response the ControlLogix issues a TCP/IP packet with the flipped 4-tuple of &lt;strong&gt;DST=66.77.x.x : 22256&lt;/strong&gt; and &lt;strong&gt;SRC=192.168.196.21 : 44818&lt;/strong&gt;. The Digi Connect WAN restores (undoes) the NAT and changes this to &lt;strong&gt;DST=66.77.x.x : 22256&lt;/strong&gt; and &lt;strong&gt;SRC=166.x.x.x : 44818&lt;/strong&gt;. After passing back through AT&amp;T and Qwest, Digi's corporate NAT interface restores its own NAT and changes it back to &lt;strong&gt;DST=10.9.92.1 : 22256&lt;/strong&gt; and &lt;strong&gt;SRC=166.x.x.x : 44818&lt;/strong&gt;. &lt;/p&gt;&lt;p&gt;This understanding of NAT and IP is useful for understanding the capability and limitations of cellular access to certain devices with certain protocols.  A future entry will cover setting up RSLinx Classic and using RSLogix 5000 to download over cellular to a L5555 processor.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35259639-6124547593969353944?l=blog.iatips.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/6124547593969353944/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=35259639&amp;postID=6124547593969353944' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/6124547593969353944'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/6124547593969353944'/><link rel='alternate' type='text/html' href='http://blog.iatips.com/2007/06/real-world-cellular-controllogix-plc.html' title='Real World Cellular - ControlLogix PLC'/><author><name>Lynn August Linse</name><uri>http://www.blogger.com/profile/01534730541144544922</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='05116158169562844583'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35259639.post-4619390280756043429</id><published>2007-05-31T12:23:00.000-07:00</published><updated>2007-05-31T12:46:52.456-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cellular'/><title type='text'>Unlimited Cellular Data - Revisted</title><content type='html'>As I go around dealing with large utility customers and hear feedback from Digi salespeople who survive large accounts, I hear some interesting but disturbing trends rising.&lt;br /&gt;&lt;br /&gt;First, there are the people (usually who are new to cellular) who claim any day now the age of cheap, unlimited cellular data plans means all my hard work to understand or offer reduced traffic are wasted effort. I especially hear this coming from European partners.&lt;br /&gt;&lt;br /&gt;Then there are the other people ... people I know work with very large, very powerful end users who fail to get the cellular plans they desire. Things I hear:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;I have heard of customers who pilot projects and hear promises of unlimited traffic, but when the time comes to sign the contract for 3000+ sites, the carrier decides that they cannot offer unlimited traffic ... period.  &lt;em&gt;Hmm, I guess this is the difference showing between the carrier's commissioned sales staff and the business managers who need to keep the cellular system profitable.&lt;/em&gt;&lt;/li&gt;&lt;li&gt;I have worked with large customers who do manage to get "unlimited deals" for a modest sized system - say 50 or 100 sites, but the carrier insists on adding the 2 clauses 1) the carrier has the right to artificially slow down the data communications (without detailing what this means) and 2) the carrier has the right to just stop all the customer's data traffic temporarily if the cell system gets busy (again, not details of this defined).  &lt;em&gt;Hmm, I have to kind of wonder what kind of control engineer agrees to such "clauses"? You'd think trying to get one's &lt;strong&gt;data under control&lt;/strong&gt; to avoid the need for unlimited data is a wiser design.&lt;/em&gt;&lt;/li&gt;&lt;li&gt;I have heard that overall the cellular carriers are starting to rethink the value of machine-to-machine data plans. Unlike DSL or cable, this is NOT an issue of bandwidth; it is an issue of the % of the time the device "hogs" 1 of N slots or resources on the tower forever.  Imagine having 10 or 20 such devices squatting there, locking up that tower resource.  So it is not even so much an issue of talking once per few minutes verse flat out unlimited traffic. In either case 1 of N finite tower resources is used, so long-term the only "good" data plan may be for a data system using the cellular resource every few hours or a few times a day.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;So overall it looks like my efforts to understand and reduce traffic is useful.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35259639-4619390280756043429?l=blog.iatips.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/4619390280756043429/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=35259639&amp;postID=4619390280756043429' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/4619390280756043429'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/4619390280756043429'/><link rel='alternate' type='text/html' href='http://blog.iatips.com/2007/05/unlimited-cellular-data-revisted.html' title='Unlimited Cellular Data - Revisted'/><author><name>Lynn August Linse</name><uri>http://www.blogger.com/profile/01534730541144544922</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='05116158169562844583'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35259639.post-5995110551426716422</id><published>2007-05-29T12:00:00.000-07:00</published><updated>2007-05-29T12:10:16.835-07:00</updated><title type='text'>I will give Webinar 31-May-2007</title><content type='html'>31-May-2007 (Thursday) I'll be giving a webinar related to outdoor use of IP-to-serial devices. While not directly related to my blog theme of "Industrial Protocols over IP", remote devices  frequently are in bad locations, where extended temperature ranges, conformal coating, and Class 1 Div 2 certs are desired.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Title: Connect Local and Remote Devices in Hazardous Environment SCADA Applications &lt;/span&gt;&lt;br /&gt;&lt;a href="https://digi.webex.com/mw0304l/mywebex/default.do?siteurl=digi&amp;service=6&amp;amp;main_url=%2Fec0509l%2Feventcenter%2Fmainframe.do%3Fmainurl%3Dhttps%253A%252F%252Fdigi.webex.com%252Fec0509l%252Feventcenter%252Fevent%252FeventAction.do%253FtheAction%253Ddetail%2526confViewID%253D242769927%2526siteurl%253Ddigi%26siteurl%3Ddigi"&gt;Register here: WebEx Link&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Date: May 31, 2007&lt;br /&gt;Time: 11:00am CDT (central zone)&lt;br /&gt;Duration: 1 hour&lt;br /&gt;Speakers:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Lynn Linse - Engineer, Digi International&lt;/li&gt;&lt;li&gt;Deb Smith - Business Development, Digi                    International&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;b&gt;What you will learn&lt;/b&gt;&lt;br /&gt;This live webinar will illustrate              the value of using TCP/IP &amp; UDP/IP based communication over              wired and wireless networks to monitor and manage local and remote              devices. Topics include:&lt;/p&gt;             &lt;ul&gt;&lt;li&gt;Overview of requirements for robust, remote, outdoor                communication devices&lt;a href="http://www.elabs3.com/c.html?rtr=on&amp;amp;s=e5x,tmwk,4h24,16go,godj,8oz0,62hf"&gt;&lt;img alt="" src="http://www.digi.com/images/products/portservertshazmei.jpg" align="right" border="0" height="150" hspace="0" width="150" /&gt;&lt;/a&gt;                &lt;/li&gt;&lt;li&gt;Discussion of extended temperature, conformal coating,                hazardous certs                &lt;/li&gt;&lt;li&gt;Comparing features of IT-grade network devices to &lt;a href="http://www.elabs3.com/c.html?rtr=on&amp;s=e5x,tmwk,4h24,16go,godj,8oz0,62hf"&gt;Digi's                Haz product line&lt;/a&gt;                &lt;/li&gt;&lt;li&gt;Extending IP networks to remote serial and Ethernet                devices                &lt;/li&gt;&lt;li&gt;Moving serial communications through TCP/IP and                UDP/IP                &lt;/li&gt;&lt;li&gt;Migrating from analog Telco/POTS lines to IP-based broadband                &lt;/li&gt;&lt;li&gt;Real-world usage examples                &lt;/li&gt;&lt;li&gt;Implementation benefits&lt;br /&gt;- Real-time access to remote sites                and process data without site visits&lt;br /&gt;- Reduce                repair/replacement costs due to less-than ideal environments&lt;br /&gt;-                Options to reduce installation costs with wireless&lt;/li&gt;&lt;/ul&gt;             Please &lt;a href="http://www.elabs3.com/c.html?rtr=on&amp;amp;s=e5x,tmwk,4h24,8v42,5991,8oz0,62hf" target="_blank"&gt;register today&lt;/a&gt; and join us May 31st for this              informative webinar!&lt;br /&gt;Questions? Contact Deb Smith at &lt;a href="mailto:deb_smith@digi.com"&gt;deb_smith@digi.com&lt;/a&gt; or              952-912-3283.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35259639-5995110551426716422?l=blog.iatips.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/5995110551426716422/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=35259639&amp;postID=5995110551426716422' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/5995110551426716422'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/5995110551426716422'/><link rel='alternate' type='text/html' href='http://blog.iatips.com/2007/05/i-will-give-webinar-31-may-2007.html' title='I will give Webinar 31-May-2007'/><author><name>Lynn August Linse</name><uri>http://www.blogger.com/profile/01534730541144544922</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='05116158169562844583'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35259639.post-3323952332823814587</id><published>2007-05-04T12:53:00.000-07:00</published><updated>2007-05-04T14:13:24.552-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Device Access'/><category scheme='http://www.blogger.com/atom/ns#' term='Ethernet'/><category scheme='http://www.blogger.com/atom/ns#' term='Rockwell'/><category scheme='http://www.blogger.com/atom/ns#' term='Modbus'/><title type='text'>ODVA, Rockwell, and Modbus Get Smart</title><content type='html'>&lt;span style="font-style: italic;"&gt;Summary: next week an amazing joining of technologies will take place at ODVA in Ann Arbor MI as ODVA, Rockwell, and Schneider-Electric discuss how to integrate Modbus servers (slaves) into CIP Producer/Consumer systems&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;One of the fun things about being involved in "multi-vendor" solutions is when you recognize &lt;span style="font-weight: bold;font-size:130%;" &gt;moments of amazing sanity&lt;/span&gt; as they occur.  One such moment of amazing sanity is occurring next week when ODVA (aka Rockwell / Allen-Bradley) and Modbus supporters (aka Schneider-Electric / Modicon / SquareD / Telemecanique) sit down to discuss how to integrate Modbus devices into the ODVA Ethernet/IP and CIP network systems.  Of course there must be some interesting hidden politics behind this move - and I somewhat light-heartedly believe that perhaps French Schneider-Electric sees joining with the Americans (Rockwell/ODVA) as the lesser of two evils when compared to  joining with the Germans (Siemens/PNO).&lt;br /&gt;&lt;br /&gt;Check out: &lt;a href="http://www.odva.org/Home/tabid/53/ctl/Detail/mid/376/ItemId/121/Default.aspx"&gt;ODVA Call For Members: Modbus Integration JSIG&lt;/a&gt;  The kick-off meeting for the Modbus JSIG runs from Thursday, May 10, 11:00 AM to Friday, May 11, 04:00 PM&lt;br /&gt;&lt;br /&gt;Side-stepping the marketing fluff and platitudes of &lt;span style="font-style: italic;"&gt;a brighter future&lt;/span&gt; such meetings evoke, small third-party suppliers and the folks on the plant floor can expect the following benefits.  Regardless of the directly stated goals of ODVA, Rockwell, or Schneider-Electric, small vendors will implement solutions that include these abilities:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Vendors making Ethernet Modbus/TCP products will have a simpler "first step" to adding full ODVA/CIP support without the somewhat overwhelming task of 100% conversion of a word-array device model into hundreds (or thousands) of CIP objects.&lt;/li&gt;&lt;li&gt;ControlLogix PLC will be able to connect through Ethernet-to-Serial devices to multi-drops of Modbus/RTU slaves.  For example a user with a dozen small Modbus/RTU PID loop controllers will be able to add an Ethernet-to-Serial device to read via Modbus and cyclically produce a small block of word data from each loop controller over Ethernet.&lt;/li&gt;&lt;li&gt;HART, Bluetooth, ZigBee and other new technologies which offer Modbus interfaces will find a instant place as sensors and I/O within CIP and Rockwell systems.&lt;/li&gt;&lt;li&gt;Since Siemens, GE-Fanuc, Omron, Mitsubishi and most major PLC brands offer some method to act as Modbus slaves, users with any of these PLC will be able to integrate them within the CIP Producer/Consumer system.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Looking forward a year or two, I also can foresee some other secondary benefits evolving from this JSIG's work:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;I started working with ODVA Ethernet/IP almost 8 years ago and still as-of today the legacy &lt;span style="font-weight: bold; font-style: italic;"&gt;PLC5E, SLC5, and serial MicroLogix (the old PCCC-based PLC)&lt;/span&gt; don't have effective inclusion within CIP Producer/Consumer systems.  Since the device model of PCCC PLC shares much in  common with Modbus PLC, it is a very small enhancement to add a similar support for AB PLC - perhaps AB will actually extend this to future firmware updates to Ethernet-based PLC.  In fact, since my Digi One IAP code already allows Modbus masters to query DF1 and CSPv4 slaves as-if Modbus slaves, as soon as Digi adds Ethernet-to-Modbus support per this JSIG's output users of older AB PLC will gain access to CIP Producer/Consumer systems indirectly as honorary Modbus slaves.&lt;/li&gt;&lt;li&gt;Today legacy Modbus and Modbus/TCP systems lack any simple form of multicast producer/consumer exchange.  While the IDA protocol offers this, IDA is so many orders of magnitude more complex (and resource hungry) than simple Modbus as to become really an "unrelated" protocol.  Any specification that defines a "server interface" naturally implies a corresponding "client interface".  So although this ODVA JSIG is not planning to define how &lt;span style="font-weight: bold; font-style: italic;"&gt;Modbus "peers" could use multicast to exchange cyclic data&lt;/span&gt;, the end result will be a fairly natural and multi-vendor method to do this.  So while I doubt many pure Modbus/TCP products would implement ODVA protocols just to gain this multicast exchange, any products which add the CIP support anyway will naturally add the last few bits of code required to enable pure Modbus-to-Modbus multicast via the ODVA mechanism.&lt;/li&gt;&lt;li&gt;Taking the above point to its natural conclusion means Modbus/TCP masters which implement the Modbus JSIG's "server" function will also gain a mechanism to access CIP Producer/Consumer systems.  Even if the ODVA JSIG doesn't cover how to do this, natural methods will be inferred, produced, and copied by vendors to make this a fairly common new product feature.&lt;/li&gt;&lt;/ul&gt;And lastly, it will interesting to see what response PNO considers to likewise include Modbus slaves more formally into PROFINET.  Personally, I have always felt that the simpler PROFINET IO protocol would fit very naturally with multi-drops of Modbus slaves acting like plug in I/O modules ... each slave would be a module within the IO device.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35259639-3323952332823814587?l=blog.iatips.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/3323952332823814587/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=35259639&amp;postID=3323952332823814587' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/3323952332823814587'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/3323952332823814587'/><link rel='alternate' type='text/html' href='http://blog.iatips.com/2007/05/odva-rockwell-and-modbus-get-smart.html' title='ODVA, Rockwell, and Modbus Get Smart'/><author><name>Lynn August Linse</name><uri>http://www.blogger.com/profile/01534730541144544922</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='05116158169562844583'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35259639.post-5001515885220701000</id><published>2007-04-25T10:09:00.000-07:00</published><updated>2007-04-25T11:12:38.806-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cellular'/><category scheme='http://www.blogger.com/atom/ns#' term='DF1'/><category scheme='http://www.blogger.com/atom/ns#' term='Rockwell'/><category scheme='http://www.blogger.com/atom/ns#' term='Modbus'/><title type='text'>Rockwell and Modbus Data Traffic</title><content type='html'>&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;Summary&lt;/span&gt;: I compare the data costs for four common off-the-shelf PLC protocols to a remote cellular site.  As a rule of thumb, even if you have an Ethernet-based PLC your lowest data costs for SCADA-style periodic polling are obtained using serial protocols via the PLC's serial port.  Their modern "Ethernet protocols" are very wasteful of cellular bandwidth.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;PLC Protocol Example:&lt;br /&gt;&lt;/span&gt;A simple but realistic SCADA scenario is to poll every 15 minutes and read 10 words of data and write 2 words of data.   This commonly requires 1 Read command and 1 Write command (I'll ignore the rarely supported Modbus command that reads &amp; writes within a single command.)&lt;br /&gt;&lt;br /&gt;While there exists special SCADA protocols and special products that optimize remote traffic, I am not looking at those protocols at the moment.  Instead, since cellular and satellite access to remote IP and Ethernet products has enabled people to use off-the-shelf PLC technology, I am looking at the more traditional PLC protocols.  These are things which affect users when they apply an Ethernet design to an IP-based wide-area-network system.&lt;br /&gt;&lt;br /&gt;I compare these 4 PLC protocols:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;AB/DF1 Radio Modem (RM) encapsulated in UDP/IP.  DF1 RM is basically DF1 Full-Duplex with no ACK/NAK and is supported by the SLC5 and MicroLogix line.&lt;/li&gt;&lt;li&gt;Modbus/RTU encapsulated in UDP/IP.  Modbus/TCP within UDP/IP is roughly the same size.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;AB/CSPv4 in TCP/IP as supported by SLC5/05 and PLC5E MSG blocks.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;AB/Ethernet/IP as moved by ControlLogix Explicit MSG blocks to PCCC-based remote PLC. Note that Ethernet/IP "I/O Messaging" does NOT work through NAT'd wide-area-networks since the protocol embeds IP information within the data packets and is thus is "broken" by NAT.&lt;/li&gt;&lt;/ul&gt;The &lt;span style="font-style: italic;"&gt;bytes per 15 minutes&lt;/span&gt; includes the IP headers, any PLC protocol overhead, and the actual data moved for each update (always 20 + 4 bytes).  The &lt;span style="font-style: italic;"&gt;MB per month &lt;/span&gt;is just defined by 30 days of such polling, or 2880 updates at once per 15 minutes.  The 2 serial protocol have been encapsulated into UDP/IP and I assume the remote IP end-point can handle connecting this to the PLC's serial port.&lt;br /&gt;&lt;br /&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="font-weight: bold;"&gt;Protocol&lt;/td&gt;&lt;td style="font-weight: bold;"&gt;Transport&lt;/td&gt;&lt;td style="font-weight: bold;"&gt;Per 15 Min&lt;/td&gt;&lt;td style="font-weight: bold;"&gt;MB per month&lt;/td&gt;&lt;td&gt;Relative Cost&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Ethernet/IP&lt;/td&gt;&lt;td&gt;TCP/IP&lt;/td&gt;&lt;td&gt;1202 bytes&lt;/td&gt;&lt;td&gt;3.46 MB&lt;/td&gt;&lt;td&gt;100%&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;AB/CSPv4&lt;/td&gt;&lt;td&gt;TCP/IP&lt;/td&gt;&lt;td&gt;960 bytes&lt;/td&gt;&lt;td&gt;2.76 MB&lt;/td&gt;&lt;td&gt;80%&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Modbus/RTU&lt;/td&gt;&lt;td&gt;UDP/IP&lt;/td&gt;&lt;td&gt;166 bytes&lt;/td&gt;&lt;td&gt;0.48 MB&lt;/td&gt;&lt;td&gt;14%&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;DF1 Radio Modem&lt;/td&gt;&lt;td&gt;UDP/IP&lt;/td&gt;&lt;td&gt;194 bytes&lt;/td&gt;&lt;td&gt;0.56 MB&lt;/td&gt;&lt;td&gt;16%&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;The two Rockwell "Ethernet" protocols cost a lot more to use in part because they force use of TCP/IP, and therefore suffer the repeated cost of TCP socket opening and closing, plus extra TCP acknowledgment overhead.  They also suffer because they both involve connection registration and service functions that needlessly repeat every time the connection is reestablished. While the actual data packets of these protocols are roughly twice the size of the serial encapsulated protocols, the real burden they suffer is all the extra TCP/IP packets exchanged that do NOT directly involve field data update.&lt;br /&gt;&lt;br /&gt;Both the serial Modbus/RTU and DF1 Radio Modem benefit that they move no IP packets that don't relate to the field data update - no TCP/IP open or close or acknowledgement; no protocol "service function" overhead.  Each moves just 1 read request and 1 read response, plus 1 write request and 1 write response.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Discussion of Other PLC Protocols:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Most other PLC Ethernet protocols will either approach the costs of the AB/CSPv4 - or they won't work at all due to use of direct "Ether-Types" and lack of IP compatibility.  Most serial protocols with roughly either match the 2 show here or be twice the cost if protocol ACKs are used by the protocol.&lt;br /&gt;&lt;br /&gt;Modbus/ASCII will almost double the cost of Modbus/RTU since each data packet is roughly twice the size.  But this wouldn't increase the IP overhead any.&lt;br /&gt;&lt;br /&gt;Using DF1 Full-Duplex instead of Radio Modem would effectively double the cost over DF1 RM since DF1 Full-Duplex moves the protocol ACK/NAK, which doubles the IP header overhead also.  Using DF1 Half-Duplex would triple or even quadruple the costs since HD not only moves protocol DF1 ACK/NAKs, but the ENQ/EOT polling overhead.&lt;br /&gt;&lt;br /&gt;Most other protocols I am aware of - such as Omron Hostlink, GE-Fanuc SNPX, and Siemens PPI - would cost roughly 2 to 3 times more than Modbus/RTU or DF1 RM since they include protocol ACK, while a few even encode many parts of the message as ASCII or BCD form instead of as binary.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35259639-5001515885220701000?l=blog.iatips.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/5001515885220701000/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=35259639&amp;postID=5001515885220701000' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/5001515885220701000'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35259639/posts/default/5001515885220701000'/><link rel='alternate' type='text/html' href='http://blog.iatips.com/2007/04/rockwell-and-modbus-data-traffic.html' title='Rockwell and Modbus Data Traffic'/><author><name>Lynn August Linse</name><uri>http://www.blogger.com/profile/01534730541144544922</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='05116158169562844583'/></author><thr:total>0</thr:total></entry></feed>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            