Apple introduces its Multi-peer Connectivity Framework(abbreviated as MC below) in iOS 7. Recently, our team just brought an idea of using it in one of our apps, and as a developer with years of network management experience, by reading through the reference document and playing with code, what really interested me is the technology underneath this MC API/Framework, especially the newly introduced peer-to-peer Wi-Fi, which is suitable for zero-configuration, high-speed data transferring between iOS devices.

Before it, some background on Apple’s attempts with peer-to-peer connectivity.

From a historical point of view, the MC is an upgrade over old GameKit(abbreviated as GK below) Framework. As it names, GK is mainly used in games, but Apple decided to put a simple peer-to-peer(p2p) connectivity API in it to ease game data exchanging. With this API, it hides all the dirty network protocol/configuration/hardware from developers, and developers can just request to find a peer, connect to it, and sent the data in just a few steps. No socket programing, no TCP/IP programing, whatever you named it in old days if you try to send data over the network. But, you have to lose something for it. For iOS developers, there is no direct way to activate/deactivate, config the network hardware, network protocol stack in anyway.

Underlying the GK connectivity API, Apple actually puts Wi-Fi and Bluetooth working together, seamlessly. If all peer devices are connected to the same Wi-Fi network, it will just use the Wi-Fi network for peers discovery and data transferring; if they is no Wi-Fi network available, the devices’ Bluetooth adapter is activated, creating a virtual TCP/IP(v4) network over Bluetooth(Bluetooth PAN). Actually, our app’s first demo is built on GK, and our usage of it is solely to bring up the TCP/IP network. Then, we can play with TCP/IP network and socket communication directly, whatever we want.

Back to MC connectivity, from peer-to-peer to multiple peer, this is obvious an upgrade, and it seems Apple clearly understands this part is of great use, and should no longer be hidden in the GK framework. In fact, there is a whole new session on this topic in 2013’s WWDC, and my adventure of it begins there.

From the official reference:

The Multipeer Connectivity framework provides support for discovering services provided by nearby iOS devices using infrastructure Wi-Fi networks, peer-to-peer Wi-Fi, and Bluetooth personal area networks and subsequently communicating with those services by sending message-based data, streaming data, and resources (such as files).

As mentioned above, we are already quite familiar with Wi-Fi network and Bluetooth PAN in GK, and MC and GK have quite a similar design, but what is the role of peer-to-peer Wi-Fi here?

First, let’s test the transfer speed with GK/MC using different combinations of network devices, and see if there is any hint of peer-to-peer Wi-Fi.

Device A: iPad 4, iOS 7.0.4
Device B: iPhone 5s, iOS 7.0.4

Test steps: using GK to create an active session, once the opposite peer connected, send 1MB data to it, timing the transfer and then we got the speed; repeat these steps with MC API.

Test 1, Bluetooth enabled, Wi-Fi turned off:
GK speed: ~20KB/s
MC speed: ~20KB/s

Test 2, Bluetooth enabled, Wi-Fi turned on, but not connected to any Wi-Fi network:
GK speed: ~20KB/s
MC speed: ~200KB/s

Test 3: Bluetooth disabled, Wi-Fi turned on, but not connected to any Wi-Fi network:
GK speed: NA, can not discover peers.
MC speed: ~200KB/s

From 20KB/s to 200KB/s, the speed boost is a strong evidence of using Wi-Fi signal to transfer data instead of Bluetooth; and when Bluetooth is disabled at all, MC can still find peers and send data while GK can’t, which can only be made possible with peer-to-peer Wi-Fi.

The answer is clear: by using MC, iOS devices can create a virtual network using peer-to-peer Wi-Fi, without the help of any hardware Wi-Fi reuter, Wi-Fi access point, etc.

The the next question is, what kind of network protocol is using on it?

More technically, in the layered OSI model, the Wi-Fi layered is just the physical and the MAC sub-layer (of data link layer), what kind of upper layers are on top this peer-to-peer Wi-Fi network? Is it still a TCP/IP network?

For this part, now I only got some clues, and my guess is yes, but it is a IPv6 network!

Clue 1, by iterating the network devices to check if there is any suspicious physical/virtual network devices.

* AF_LINK, AF_INET, AF_INET6 are all constants defined in <sys/socket.h>, to describe the address family of the device.

Device A, MC activated and paired, Bluetooth turned off:

sa_family: AF_LINK, ifa_name: lo0
sa_family: AF_INET6, ifa_name: lo0
sa_family: AF_INET, ifa_name: lo0
sa_family: AF_INET6, ifa_name: lo0
sa_family: AF_LINK, ifa_name: en0
sa_family: AF_LINK, ifa_name: awdl0
sa_family: AF_INET6, ifa_name: awdl0
sa_family: AF_LINK, ifa_name: en1

device inet interfaces: {
“IPV4:lo0” = “127.0.0.1”;
“IPV6:awdl0” = “fe80::875:23ff:feb1:a1ec”;
“IPV6:lo0” = “fe80::1”;
}

Device B, MC activated and paired, Bluetooth turned off:

sa_family: AF_LINK, ifa_name: lo0
sa_family: AF_INET6, ifa_name: lo0
sa_family: AF_INET, ifa_name: lo0
sa_family: AF_INET6, ifa_name: lo0
sa_family: AF_LINK, ifa_name: pdp_ip0
sa_family: AF_INET, ifa_name: pdp_ip0
sa_family: AF_LINK, ifa_name: pdp_ip1
sa_family: AF_LINK, ifa_name: pdp_ip2
sa_family: AF_LINK, ifa_name: pdp_ip3
sa_family: AF_LINK, ifa_name: pdp_ip4
sa_family: AF_LINK, ifa_name: en1
sa_family: AF_LINK, ifa_name: ap1
sa_family: AF_LINK, ifa_name: en0
sa_family: AF_LINK, ifa_name: awdl0
sa_family: AF_INET6, ifa_name: awdl0

device inet interfaces: {
“IPV4:lo0” = “127.0.0.1”;
“IPV4:pdp_ip0” = “10.37.167.92”;
“IPV6:awdl0” = “fe80::74f4:6dff:fe8d:98ad”;
“IPV6:lo0” = “fe80::1”;
}

The device marked in bold, see it?

Clue 2, looking for similar designs. And there is indeed one, named Wi-Fi Direct, now commonly found in Android devices.

More information on it: http://en.wikipedia.org/wiki/Wi-Fi_Direct

Enough fun for today, cheers!

To be, or to…

If you choose to enter Android world, I think you have to leave something behind. My advice, drop everything below ICS. ICS and above have a far superior multi screen/resolution support and much much better UI controls and performance, and you can’t go wrong by starting with Nexus/Galaxy S Series devices. In a typical Android project in good shape, you can still maintain one piece of Java code, two groups of XML UI interface layouts(one for phone based, one for tablet based), and several dimension definitions XML files(one for one group of screen).

natgeofound:

View of the interior of the Hagia Sophia in Istanbul, Turkey, December 1983.Photograph by James L. Stanfield, National Geographic

instagram:

Getting Familiar with Video Filters: Dogpatch, Helena and Ginza

Learn more about film colorist Denver Riddle at colorgradingcentral.com and follow him on Instagram: @colorgrading.

When working on video, Instagram turned to film colorist Denver Riddle to create 13 custom, cinema quality filters. Each filter has its own personality and is designed to evoke a certain feeling by highlighting or subduing different colors and tones.

Denver provided some background on three Instagram filters: Dogpatch, Helena and Ginza.

Dogpatch

What it does: Heightens contrast, mutes colors
What it’s good for: Dramatic or post-apocalyptic feel
"Some of the more organic video filters I created emulate the traditional photochemical techniques that are achieved in the lab. One of the most popular techniques is the bleach bypass look, like Instagram’s Dogpatch filter, where the bleaching step is skipped in the processing."

"The result is a sort of grungy, high-contrast muted look live you’ve seen in Steven Spielberg’s Saving Private Ryan, as well as in many post-apocalyptic thrillers.&#8221;

Helena

What it does: Emulates “golden hour&#8221; feeling with orange/teal look
What it’s good for: Contrasting between skin tones and background
"The orange/teal look you see in the Helena filter has become popular in Hollywood because it creates contrast between the background and skin tones, immediately focusing the audience’s eye on the talent," says Riddle.

"This look utilizes a concept of color theory, namely warm/cool contrast as well as contrast of complementary colors. Skin tones get pushed towards orange, and shadows and undertones get pushed towards teal."

Ginza

What it does: Hightens contrast, brightens colors
What it’s good for: Fashion magazine look
"Creating stylized looks is the part I enjoy most about being a colorist. The measure I believe in for a good colorist is their ability to leverage color contrast in a tasteful and meaningful way.  That is my goal when I set out to create stylized looks—to create nice color contrasts and color harmonies while still preserving the integrity of the skin tones."

"This is what I’ve provided in the more stylized Instagram video filters.  With looks like Ginza, you get a look like you’d see in a fashion magazine." instagram:

Getting Familiar with Video Filters: Dogpatch, Helena and Ginza

Learn more about film colorist Denver Riddle at colorgradingcentral.com and follow him on Instagram: @colorgrading.

When working on video, Instagram turned to film colorist Denver Riddle to create 13 custom, cinema quality filters. Each filter has its own personality and is designed to evoke a certain feeling by highlighting or subduing different colors and tones.

Denver provided some background on three Instagram filters: Dogpatch, Helena and Ginza.

Dogpatch

What it does: Heightens contrast, mutes colors
What it’s good for: Dramatic or post-apocalyptic feel
"Some of the more organic video filters I created emulate the traditional photochemical techniques that are achieved in the lab. One of the most popular techniques is the bleach bypass look, like Instagram’s Dogpatch filter, where the bleaching step is skipped in the processing."

"The result is a sort of grungy, high-contrast muted look live you’ve seen in Steven Spielberg’s Saving Private Ryan, as well as in many post-apocalyptic thrillers.&#8221;

Helena

What it does: Emulates “golden hour&#8221; feeling with orange/teal look
What it’s good for: Contrasting between skin tones and background
"The orange/teal look you see in the Helena filter has become popular in Hollywood because it creates contrast between the background and skin tones, immediately focusing the audience’s eye on the talent," says Riddle.

"This look utilizes a concept of color theory, namely warm/cool contrast as well as contrast of complementary colors. Skin tones get pushed towards orange, and shadows and undertones get pushed towards teal."

Ginza

What it does: Hightens contrast, brightens colors
What it’s good for: Fashion magazine look
"Creating stylized looks is the part I enjoy most about being a colorist. The measure I believe in for a good colorist is their ability to leverage color contrast in a tasteful and meaningful way.  That is my goal when I set out to create stylized looks—to create nice color contrasts and color harmonies while still preserving the integrity of the skin tones."

"This is what I’ve provided in the more stylized Instagram video filters.  With looks like Ginza, you get a look like you’d see in a fashion magazine." instagram:

Getting Familiar with Video Filters: Dogpatch, Helena and Ginza

Learn more about film colorist Denver Riddle at colorgradingcentral.com and follow him on Instagram: @colorgrading.

When working on video, Instagram turned to film colorist Denver Riddle to create 13 custom, cinema quality filters. Each filter has its own personality and is designed to evoke a certain feeling by highlighting or subduing different colors and tones.

Denver provided some background on three Instagram filters: Dogpatch, Helena and Ginza.

Dogpatch

What it does: Heightens contrast, mutes colors
What it’s good for: Dramatic or post-apocalyptic feel
"Some of the more organic video filters I created emulate the traditional photochemical techniques that are achieved in the lab. One of the most popular techniques is the bleach bypass look, like Instagram’s Dogpatch filter, where the bleaching step is skipped in the processing."

"The result is a sort of grungy, high-contrast muted look live you’ve seen in Steven Spielberg’s Saving Private Ryan, as well as in many post-apocalyptic thrillers.&#8221;

Helena

What it does: Emulates “golden hour&#8221; feeling with orange/teal look
What it’s good for: Contrasting between skin tones and background
"The orange/teal look you see in the Helena filter has become popular in Hollywood because it creates contrast between the background and skin tones, immediately focusing the audience’s eye on the talent," says Riddle.

"This look utilizes a concept of color theory, namely warm/cool contrast as well as contrast of complementary colors. Skin tones get pushed towards orange, and shadows and undertones get pushed towards teal."

Ginza

What it does: Hightens contrast, brightens colors
What it’s good for: Fashion magazine look
"Creating stylized looks is the part I enjoy most about being a colorist. The measure I believe in for a good colorist is their ability to leverage color contrast in a tasteful and meaningful way.  That is my goal when I set out to create stylized looks—to create nice color contrasts and color harmonies while still preserving the integrity of the skin tones."

"This is what I’ve provided in the more stylized Instagram video filters.  With looks like Ginza, you get a look like you’d see in a fashion magazine."

instagram:

Getting Familiar with Video Filters: Dogpatch, Helena and Ginza

Learn more about film colorist Denver Riddle at colorgradingcentral.com and follow him on Instagram: @colorgrading.

When working on video, Instagram turned to film colorist Denver Riddle to create 13 custom, cinema quality filters. Each filter has its own personality and is designed to evoke a certain feeling by highlighting or subduing different colors and tones.

Denver provided some background on three Instagram filters: Dogpatch, Helena and Ginza.

Dogpatch

  • What it does: Heightens contrast, mutes colors
  • What it’s good for: Dramatic or post-apocalyptic feel

"Some of the more organic video filters I created emulate the traditional photochemical techniques that are achieved in the lab. One of the most popular techniques is the bleach bypass look, like Instagram’s Dogpatch filter, where the bleaching step is skipped in the processing."

"The result is a sort of grungy, high-contrast muted look live you’ve seen in Steven Spielberg’s Saving Private Ryan, as well as in many post-apocalyptic thrillers.”

Helena

  • What it does: Emulates “golden hour” feeling with orange/teal look
  • What it’s good for: Contrasting between skin tones and background

"The orange/teal look you see in the Helena filter has become popular in Hollywood because it creates contrast between the background and skin tones, immediately focusing the audience’s eye on the talent," says Riddle.

"This look utilizes a concept of color theory, namely warm/cool contrast as well as contrast of complementary colors. Skin tones get pushed towards orange, and shadows and undertones get pushed towards teal."

Ginza

  • What it does: Hightens contrast, brightens colors
  • What it’s good for: Fashion magazine look

"Creating stylized looks is the part I enjoy most about being a colorist. The measure I believe in for a good colorist is their ability to leverage color contrast in a tasteful and meaningful way. That is my goal when I set out to create stylized looks—to create nice color contrasts and color harmonies while still preserving the integrity of the skin tones."

"This is what I’ve provided in the more stylized Instagram video filters. With looks like Ginza, you get a look like you’d see in a fashion magazine."

old pieces of work, finally found a place to settle down.

objectivecrizzo:

I have compiled a list of Static Blogs that you can fork and download from GitHub.

1. BLATTER : Blatter is a tiny tool for creating and publishing static web sites built from dynamic templates. When developing your site, you can work locally on your own computer and view your work through a…