{"id":1188,"date":"2017-09-25T19:25:42","date_gmt":"2017-09-26T02:25:42","guid":{"rendered":"http:\/\/emresaglam.com\/blog\/?p=1188"},"modified":"2017-09-27T10:23:09","modified_gmt":"2017-09-27T17:23:09","slug":"icloud-photos-meraki-and-traffic-shaping","status":"publish","type":"post","link":"https:\/\/emresaglam.com\/blog\/blog\/2017\/09\/25\/icloud-photos-meraki-and-traffic-shaping\/","title":{"rendered":"iCloud Photos, Meraki and Traffic Shaping"},"content":{"rendered":"<p>I turned <a href=\"https:\/\/www.apple.com\/icloud\/photos\/\">iCloud Photo Library<\/a> on this week. We have close to 250 GB of photos, videos in several different computers and mobile devices. You might have guessed it: it flooded our network since our outbound internet peaks around 6 Mbs (realistically). I needed to do something.<\/p>\n<p>I have at home a <a href=\"https:\/\/meraki.cisco.com\/products\/appliances\/mx65\">Meraki MX65<\/a> and a <a href=\"https:\/\/meraki.cisco.com\/products\/wireless\/mr42\">MR42<\/a>\u00a0(Thanks Da\u011fhan \ud83d\ude09 ) They give great visibility and control over our home network. I can easily pinpoint where the problem is and take actions. Here is a great chart that shows how the nature of our traffic changed on Sep 24 after turning iCloud Photo Library on. (See the light blue? That&#8217;s increased upload!)<\/p>\n<p><a href=\"https:\/\/emresaglam.com\/blog\/wp-content\/uploads\/2017\/09\/Screen-Shot-2017-09-25-at-4.39.41-PM.png\"><img loading=\"lazy\" class=\"size-full wp-image-1190 aligncenter\" src=\"https:\/\/emresaglam.com\/blog\/wp-content\/uploads\/2017\/09\/Screen-Shot-2017-09-25-at-4.39.41-PM.png\" alt=\"\" width=\"501\" height=\"204\"><\/a><\/p>\n<p>One of the easiest way to slow this traffic down\u00a0is to shape it with Meraki Traffic Shaping rules. <a href=\"https:\/\/documentation.meraki.com\/MX-Z\/Firewall_and_Traffic_Shaping\/Traffic_Shaping_Settings\">This document<\/a> talks about in detail how to do this. However the iCloud settings in the canned traffic shaping rules is only related to backup and doesn&#8217;t work with iCloud Photo Library traffic.<\/p>\n<p><a href=\"https:\/\/emresaglam.com\/blog\/wp-content\/uploads\/2017\/09\/Screen-Shot-2017-09-25-at-4.55.37-PM.png\"><img loading=\"lazy\" class=\"wp-image-1195 size-full aligncenter\" src=\"https:\/\/emresaglam.com\/blog\/wp-content\/uploads\/2017\/09\/Screen-Shot-2017-09-25-at-4.55.37-PM.png\" alt=\"\" width=\"460\" height=\"460\"><\/a><\/p>\n<p>Meraki allows you to do application layer or layer 3 traffic shaping. Since the traffic is encrypted, the application layer traffic shaping was not an option. For layer 3, I needed the IPs that the Photos app was talking to. Since Apple owns the entire 17.0.0.0\/8, it&#8217;s always an option to craft your rule using the entire <a href=\"https:\/\/en.wikipedia.org\/wiki\/Classful_network#Classful_addressing_definition\">class A subnet<\/a>. However that wouldn&#8217;t be &#8220;elegant&#8221; \ud83d\ude42 So let&#8217;s do some tcpdump exercise.<\/p>\n<pre>iMac:~ user$ sudo tcpdump -i en1 -n -c 1000 ip and net 17.0.0.0\/8 | grep '&gt;'| cut -d '&gt;' -f 2 | cut -d \".\" -f 1-4 | grep 17\\. | sort | uniq -c <\/pre>\n<pre>tcpdump: verbose output suppressed, use -v or -vv for full protocol decode<\/pre>\n<pre>listening on en1, link-type EN10MB (Ethernet), capture size 262144 bytes<\/pre>\n<pre>1000 packets captured<\/pre>\n<pre>2120 packets received by filter<\/pre>\n<pre>0 packets dropped by kernel<\/pre>\n<pre> 647  17.248.128.44<\/pre>\n<pre><\/pre>\n<p>What this tells us is that we captured 1000 packets and looked for all the ones that has &#8220;17.&#8221; in it, and counted them. In total 647 packets were transmitted to 17.248.128.44. Also it&#8217;s on port 443 only.<\/p>\n<p>I did a similar packet dump for 10K packets. Which revealed that the sync between Photos app and iCloud is always happening on subnets: 17.248.0.0\/16 and 17.188.0.0\/16 on port 443. (There might be a more specific subnet, but this was enough for me to start with)<\/p>\n<p>Let&#8217;s apply this to Meraki MX65 traffic shaping rules. In this rule below my upload limit per client is 1.5 Mbps. Depending on how many clients you have and your upload speed, you can come up with something more suitable for your network.<\/p>\n<p><a href=\"https:\/\/emresaglam.com\/blog\/wp-content\/uploads\/2017\/09\/Screen-Shot-2017-09-25-at-7.19.52-PM.png\"><img loading=\"lazy\" class=\"size-full wp-image-1197 aligncenter\" src=\"https:\/\/emresaglam.com\/blog\/wp-content\/uploads\/2017\/09\/Screen-Shot-2017-09-25-at-7.19.52-PM.png\" alt=\"\" width=\"1256\" height=\"632\"><\/a><\/p>\n<p>In order to figure out how to define these in Meraki, please<a href=\"https:\/\/documentation.meraki.com\/MX-Z\/Firewall_and_Traffic_Shaping\/Traffic_Shaping_Settings\"> follow the instructions<\/a> in the previous doc that I linked.<\/p>\n<p>Et Voil\u00e0! You got your home network back \ud83d\ude09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I turned iCloud Photo Library on this week. We have close to 250 GB of photos, videos in several different computers and mobile devices. You might have guessed it: it flooded our network since our outbound internet peaks around 6 Mbs (realistically). I needed to do something. I have at home a Meraki MX65 and &hellip; <a href=\"https:\/\/emresaglam.com\/blog\/blog\/2017\/09\/25\/icloud-photos-meraki-and-traffic-shaping\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">iCloud Photos, Meraki and Traffic Shaping<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[43,77,39,9],"_links":{"self":[{"href":"https:\/\/emresaglam.com\/blog\/wp-json\/wp\/v2\/posts\/1188"}],"collection":[{"href":"https:\/\/emresaglam.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/emresaglam.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/emresaglam.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/emresaglam.com\/blog\/wp-json\/wp\/v2\/comments?post=1188"}],"version-history":[{"count":15,"href":"https:\/\/emresaglam.com\/blog\/wp-json\/wp\/v2\/posts\/1188\/revisions"}],"predecessor-version":[{"id":1210,"href":"https:\/\/emresaglam.com\/blog\/wp-json\/wp\/v2\/posts\/1188\/revisions\/1210"}],"wp:attachment":[{"href":"https:\/\/emresaglam.com\/blog\/wp-json\/wp\/v2\/media?parent=1188"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/emresaglam.com\/blog\/wp-json\/wp\/v2\/categories?post=1188"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/emresaglam.com\/blog\/wp-json\/wp\/v2\/tags?post=1188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}